wikiparser-node 1.22.1 → 1.24.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.
Files changed (100) hide show
  1. package/README.md +3 -3
  2. package/bin/config.js +2 -2
  3. package/bundle/bundle-es8.min.js +24 -24
  4. package/config/default.json +6 -0
  5. package/config/enwiki.json +2 -2
  6. package/config/llwiki.json +382 -261
  7. package/config/moegirl.json +325 -325
  8. package/coverage/badge.svg +1 -1
  9. package/dist/base.d.mts +18 -2
  10. package/dist/base.d.ts +18 -2
  11. package/dist/bin/config.js +17 -5
  12. package/dist/index.d.ts +3 -2
  13. package/dist/index.js +3 -6
  14. package/dist/lib/element.d.ts +10 -64
  15. package/dist/lib/element.js +28 -135
  16. package/dist/lib/lsp.d.ts +19 -1
  17. package/dist/lib/lsp.js +131 -16
  18. package/dist/lib/node.d.ts +5 -9
  19. package/dist/lib/node.js +26 -24
  20. package/dist/lib/range.d.ts +90 -4
  21. package/dist/lib/range.js +596 -391
  22. package/dist/lib/text.d.ts +17 -16
  23. package/dist/lib/text.js +78 -62
  24. package/dist/lib/title.js +5 -4
  25. package/dist/mixin/attributesParent.js +3 -13
  26. package/dist/mixin/elementLike.d.ts +65 -0
  27. package/dist/mixin/elementLike.js +96 -0
  28. package/dist/mixin/fixed.js +2 -3
  29. package/dist/mixin/gapped.js +2 -2
  30. package/dist/mixin/hidden.js +2 -2
  31. package/dist/mixin/multiLine.js +2 -2
  32. package/dist/mixin/noEscape.js +4 -2
  33. package/dist/mixin/nodeLike.d.ts +17 -0
  34. package/dist/mixin/nodeLike.js +29 -0
  35. package/dist/mixin/padded.js +2 -1
  36. package/dist/mixin/singleLine.js +2 -1
  37. package/dist/mixin/sol.js +2 -2
  38. package/dist/mixin/syntax.js +2 -2
  39. package/dist/parser/commentAndExt.js +7 -8
  40. package/dist/parser/externalLinks.js +2 -2
  41. package/dist/parser/hrAndDoubleUnderscore.js +8 -5
  42. package/dist/parser/selector.js +3 -0
  43. package/dist/src/arg.js +4 -4
  44. package/dist/src/atom.d.ts +1 -1
  45. package/dist/src/attribute.d.ts +1 -1
  46. package/dist/src/attribute.js +11 -10
  47. package/dist/src/attributes.js +4 -4
  48. package/dist/src/converter.js +1 -1
  49. package/dist/src/converterFlags.js +2 -2
  50. package/dist/src/gallery.js +8 -7
  51. package/dist/src/heading.js +16 -7
  52. package/dist/src/html.d.ts +8 -0
  53. package/dist/src/html.js +36 -14
  54. package/dist/src/imageParameter.js +2 -2
  55. package/dist/src/imagemap.js +2 -2
  56. package/dist/src/index.d.ts +5 -1
  57. package/dist/src/index.js +3 -2
  58. package/dist/src/link/base.js +5 -18
  59. package/dist/src/link/file.js +14 -5
  60. package/dist/src/link/galleryImage.js +2 -2
  61. package/dist/src/link/index.js +6 -3
  62. package/dist/src/link/redirectTarget.js +1 -1
  63. package/dist/src/magicLink.js +4 -4
  64. package/dist/src/nested.js +3 -3
  65. package/dist/src/nowiki/base.js +1 -1
  66. package/dist/src/nowiki/comment.js +1 -1
  67. package/dist/src/nowiki/index.js +2 -2
  68. package/dist/src/nowiki/quote.js +10 -10
  69. package/dist/src/onlyinclude.js +1 -1
  70. package/dist/src/paramTag/index.d.ts +1 -1
  71. package/dist/src/paramTag/index.js +1 -1
  72. package/dist/src/parameter.js +1 -1
  73. package/dist/src/redirect.js +2 -2
  74. package/dist/src/syntax.d.ts +1 -1
  75. package/dist/src/table/base.d.ts +3 -2
  76. package/dist/src/table/base.js +18 -15
  77. package/dist/src/table/index.d.ts +0 -1
  78. package/dist/src/table/index.js +7 -9
  79. package/dist/src/table/td.d.ts +1 -1
  80. package/dist/src/table/td.js +13 -21
  81. package/dist/src/tagPair/include.js +2 -2
  82. package/dist/src/tagPair/index.js +2 -2
  83. package/dist/src/transclude.js +9 -15
  84. package/dist/util/debug.js +2 -0
  85. package/dist/util/lint.js +89 -4
  86. package/dist/util/sharable.js +2 -2
  87. package/dist/util/sharable.mjs +2 -2
  88. package/dist/util/string.js +11 -10
  89. package/extensions/typings.d.ts +3 -1
  90. package/package.json +8 -9
  91. package/bundle/bundle-lsp.min.js +0 -32
  92. package/bundle/bundle.min.js +0 -29
  93. package/extensions/dist/base.js +0 -353
  94. package/extensions/dist/codejar.js +0 -57
  95. package/extensions/dist/editor.js +0 -159
  96. package/extensions/dist/highlight.js +0 -30
  97. package/extensions/dist/lint.js +0 -80
  98. package/extensions/dist/lsp.js +0 -83
  99. package/extensions/editor.css +0 -59
  100. package/extensions/ui.css +0 -1
@@ -1,32 +0,0 @@
1
- "use strict";(()=>{var Io=Object.defineProperty;var Br=e=>{throw TypeError(e)};var To=(e,t,s)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var No=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ke=(e,t,s)=>To(e,typeof t!="symbol"?t+"":t,s),Us=(e,t,s)=>t.has(e)||Br("Cannot "+s);var x=(e,t,s)=>(Us(e,t,"read from private field"),s?s.call(e):t.get(e)),O=(e,t,s)=>t.has(e)?Br("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),R=(e,t,s,r)=>(Us(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Us(e,t,"access private method"),s);var Wr=(e,t,s,r)=>({set _(l){R(e,t,l,s)},get _(){return x(e,t,r)}});var Nd=No((Fd,Co)=>{var Lo=Object.create,wt=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,mr=Object.getOwnPropertyNames,Fo=Object.prototype.hasOwnProperty,ql=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yt=e=>{throw TypeError(e)},Bl=(e,t,s)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ur=(e,t)=>wt(e,"name",{value:t,configurable:!0}),N=(e,t)=>function(){return e&&(t=(0,e[mr(e)[0]])(e=0)),t},jo=(e,t)=>function(){return t||(0,e[mr(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)wt(e,s,{get:t[s],enumerable:!0})},Ro=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of mr(t))!Fo.call(e,l)&&l!==s&&wt(e,l,{get:()=>t[l],enumerable:!(r=Ol(t,l))||r.enumerable});return e},ee=e=>Ro(wt({},"__esModule",{value:!0}),e),re=e=>{var t;return[,,,Lo((t=e==null?void 0:e[ql("metadata")])!=null?t:null)]},Wl=["class","method","getter","setter","accessor","field","value","get","set"],Ot=e=>e!==void 0&&typeof e!="function"?yt("Function expected"):e,Po=(e,t,s,r,l)=>({kind:Wl[e],name:t,metadata:r,addInitializer:i=>s._?yt("Already initialized"):l.push(Ot(i||null))}),Ls=(e,t)=>Bl(t,ql("metadata"),e[3]),ne=(e,t,s,r)=>{for(var l=0,i=e[t>>1],n=i&&i.length;l<n;l++)t&1?i[l].call(s):r=i[l].call(s,r);return r},le=(e,t,s,r,l,i)=>{var n,a,o,d,u,h=t&7,p=!!(t&8),c=!!(t&16),m=h>3?e.length+1:h?p?1:2:0,S=Wl[h+5],A=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),$=h&&(!c&&!p&&(l=l.prototype),h<5&&(h>3||!c)&&Ol(h<4?l:{get[s](){return ge(this,i)},set[s](g){return Ce(this,i,g)}},s));h?c&&h<4&&Ur(i,(h>2?"set ":h>1?"get ":"")+s):Ur(l,s);for(var f=r.length-1;f>=0;f--)d=Po(h,s,o={},e[3],y),h&&(d.static=p,d.private=c,u=d.access={has:c?g=>Oo(l,g):g=>s in g},h^3&&(u.get=c?g=>(h^1?ge:ft)(g,l,h^4?i:$.get):g=>g[s]),h>2&&(u.set=c?(g,w)=>Ce(g,l,w,h^4?i:$.set):(g,w)=>g[s]=w)),a=(0,r[f])(h?h<4?c?i:$[S]:h>4?void 0:{get:$.get,set:$.set}:l,d),o._=1,h^4||a===void 0?Ot(a)&&(h>4?A.unshift(a):h?c?i=a:$[S]=a:l=a):typeof a!="object"||a===null?yt("Object expected"):(Ot(n=a.get)&&($.get=n),Ot(n=a.set)&&($.set=n),Ot(n=a.init)&&A.unshift(n));return h||Ls(e,l),$&&wt(l,s,$),c?h^4?i:$:l},Eo=(e,t,s)=>Bl(e,typeof t!="symbol"?t+"":t,s),xr=(e,t,s)=>t.has(e)||yt("Cannot "+s),Oo=(e,t)=>Object(t)!==t?yt('Cannot use the "in" operator on this value'):e.has(t),ge=(e,t,s)=>(xr(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?yt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ce=(e,t,s,r)=>(xr(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),ft=(e,t,s)=>(xr(e,t,"access private method"),s),qo=(e,t,s,r)=>({set _(l){Ce(e,t,l,s)},get _(){return ge(e,t,r)}}),Ul,vr,Ml=N({"base.ts"(){"use strict";Ul=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),vr=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Xe(e){const t=new Map,s=new WeakMap;return r=>{const l=typeof r=="string"?t:s;if(l.has(r)){const n=l.get(r);return n.lastIndex=0,n}const i=e(r);return l.set(r,i),i}}var es,zl,Mr,Hl,Dl,St=N({"../common/dist/index.mjs"(){"use strict";es=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),zl=e=>Math.round(e*255).toString(16).padStart(2,"0"),Mr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,r=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,l=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${r}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${r})`,"giu")}})(),Hl=(e,t=!0)=>{const s=[],r=Mr[t?"full":"rgb"];r.lastIndex=0;let l=r.exec(e),i=0;for(;l;){const n=l.index+l[1].length;n>i&&s.push([e.slice(i,n),i,n,!1]),{lastIndex:i}=r,s.push([l[2],n,i,e[n-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=r.exec(e)}return e.length>i&&s.push([e.slice(i),i,e.length,!1]),s},Dl=Xe}}),Be,Ms,mt,xt,vt,Re,rt,ts,Ie,Ye,zr,Hr,ss,Gl,Dr,Gr,is,bt,he=N({"util/string.ts"(){"use strict";St(),Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ms=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,mt=String.raw`(?:\[[\da-f:.]+\]|${Ms})`,xt=String.raw`(?:${Ms}|\0\d+[cn!~]\x7F)*`,vt=e=>e.trim().toLowerCase(),Re=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,r)=>t[r]),rt=(e,t)=>s=>s.replace(e,t),ts=rt(/[\0\x7F]|\r$/gmu,""),Ie=rt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),zr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Hr=rt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):zr[s.toLowerCase()]),ss=e=>Hr(e),Gl=rt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Dr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Gr=e=>rt(e,t=>`&${Dr[t]};`),is=Gr(/[&<>]/gu),bt=(e,t={})=>{const{pre:s="",post:r="",sep:l=""}=t;return s+e.map(i=>i.print()).join(l)+r}}}),Bo=jo({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),Se,Yi,Ze=N({"util/constants.ts"(){"use strict";Se=11,Yi=Bo()}}),de,ce=N({"lib/rect.ts"(){"use strict";var e,t,s,r,Zi,i;de=(i=class{constructor(n,a){O(this,r);O(this,e);O(this,t);O(this,s);R(this,e,n),R(this,t,a)}get start(){return x(this,t)}get top(){return P(this,r,Zi).call(this).top}get left(){return P(this,r,Zi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakSet,Zi=function(){var n;return(n=x(this,s))!=null||R(this,s,x(this,e).getRootNode().posFromIndex(x(this,t))),x(this,s)},i)}}),Vr,Qr,Kt,rs,zs,X,te,Ke,br,K=N({"util/lint.ts"(){"use strict";we(),ce(),J(),Vr=new Set(["tr","td","th","caption"]),Qr=new Set(["Template:!!","Template:!-"]),Kt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Qr.has(t.name)||t.is("html")&&Vr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Kt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Kt);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},rs=(e,t,s,r)=>({line:e+s-1,character:(s===1?t:0)+r}),zs=e=>(t,s,r,l,i="error")=>{const{start:n}=s,{top:a,left:o}=s instanceof de?s:new de(t,n),{offsetHeight:d,offsetWidth:u}=t,{startIndex:h,startLine:p,startCol:c}=e(t,n,a,o),{line:m,character:S}=rs(p,c,d,u);return{rule:r,message:I.msg(l),severity:i,startIndex:h,endIndex:h+t.toString().length,startLine:p,endLine:m,startCol:c,endCol:S}},X=zs((e,t,s,r)=>{const l=e.getRelativeIndex(),{top:i,left:n}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+i,startCol:i?n:r+n}}),te=zs((e,t,s,r)=>({startIndex:t,startLine:s,startCol:r})),Ke=(e,t,s,r)=>{if(e&&(r||I.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(r||I.viewOnly)&&s([ve.rev,l]),l},br=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Jr,ys,Wo=N({"parser/selector.ts"(){"use strict";Jr=(e,t,s)=>{if(e.includes("#")){const r=e.indexOf("#");return(r===0||e.slice(0,r)===t)&&e.slice(r+1)===s}return!e||e===t},ys=(e,t,s)=>{const r=e.split(",");return({type:l,name:i})=>r.some(n=>Jr(n.trim(),l,i))}}}),Fs,wr=N({"mixin/cached.ts"(){"use strict";K(),Fs=(e=!0)=>t=>{const s=new WeakMap;return function(...r){return Ke(s.get(this),()=>t.apply(this,r),l=>{s.set(this,l)},e)}}}}),Xr,os,Ct,It,ds,Tt,Nt,Lt,us,hs,Yt,Vl=N({"lib/node.ts"(){"use strict";K(),we(),wr(),J(),Xr=[Fs(!1)],Yt=class{constructor(){ne(hs,5,this),je(this,Lt),Eo(this,"childNodes",[]),je(this,os),je(this,Ct),je(this,It),je(this,ds),je(this,Tt),je(this,Nt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return ge(this,os)}get nextSibling(){return ge(this,Ct)}get previousSibling(){return ge(this,It)}get offsetHeight(){return ft(this,Lt,us).call(this).height}get offsetWidth(){return ft(this,Lt,us).call(this).width}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":Ce(this,os,t),t||(Ce(this,Ct,void 0),Ce(this,It,void 0));break;case"nextSibling":Ce(this,Ct,t);break;case"previousSibling":Ce(this,It,t);break;case"aIndex":I.viewOnly&&Ce(this,Tt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(ge(this,ds),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ce(this,ds,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,r,l]=s[e],i=r+t;return i>l?void 0:i}this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),r=s.findIndex(([,,l])=>e<=l);return{top:r,left:e-s[r][1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ke(ge(this,Nt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let r=this.getAttribute("padding");for(let l=0;l<s;l++)I.viewOnly&&(ge(this,Nt)[l]=[ve.rev,r]),r+=t[l].toString().length+this.getGaps(l);return r},t=>{ge(this,Nt)[e]=t})}getAbsoluteIndex(){return Ke(ge(this,Tt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ce(this,Tt,e)})}getBoundingClientRect(){return{...ft(this,Lt,us).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
2
- `)){const r=t+s.length;e.push([s,t,r]),t=r+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},hs=re(null),os=new WeakMap,Ct=new WeakMap,It=new WeakMap,ds=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakSet,us=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},le(hs,1,"getLines",Xr,Yt),Ls(hs,Yt)}}),Ql,Uo=N({"lib/element.ts"(){"use strict";var e,er,tr,r;he(),we(),Wo(),Vl(),Ql=(r=class extends Yt{constructor(){super(...arguments);O(this,e)}get length(){return this.childNodes.length}text(i){return Ye(this.childNodes,i)}normalize(){const i=this.getChildNodes(),n=a=>{var o,d;i.splice(a,1),(o=i[a-1])==null||o.setAttribute("nextSibling",i[a]),(d=i[a])==null||d.setAttribute("previousSibling",i[a-1])};for(let a=i.length-1;a>=0;a--){const{type:o,data:d}=i[a];o!=="text"||i.length===1||this.getGaps(a-(a&&1))||d===""&&n(a)}this.setAttribute("childNodes",i)}removeAt(i){return Ns(this,i,1)[0]}insertAt(i,n=this.length){return Ns(this,n,0,[i]),i}closest(i){const n=ys(i,this);let{parentNode:a}=this;for(;a;){if(n(a))return a;({parentNode:a}=a)}}querySelector(i){const n=ys(i,this);return P(this,e,er).call(this,n)}querySelectorAll(i){const n=ys(i,this);return P(this,e,tr).call(this,n)}append(...i){this.safeAppend(i)}safeAppend(i){for(const n of i)this.insertAt(n)}replaceChildren(...i){this.safeReplaceChildren(i)}safeReplaceChildren(i){for(let n=this.length-1;n>=0;n--)this.removeAt(n);this.safeAppend(i)}setText(i,n=0){n+=n<0?this.length:0;const a=this.childNodes[n],{data:o}=a;return a.replaceData(i),o}toString(i,n=""){return this.childNodes.map(a=>a.toString(i)).join(n)}caretPositionFromIndex(i){{if(i===void 0)return;const{length:n}=this.toString();if(i>n||i<-n)return;i+=i<0?n:0;let a=this,o=0,d=0;for(;a.type!=="text";){const{childNodes:u}=a;o+=a.getAttribute("padding");for(let h=0;o<=i&&h<u.length;h++){const p=u[h],{nextSibling:c}=p,m=p.toString(),S=m.length;if(p.setAttribute("aIndex",o),o+=S,o>i||o===i&&S>0&&(!c||c.type==="text"||p.type!=="text"&&(m.trim()||!c.toString().trim()))){a=p,o-=S,d=o;break}o+=a.getGaps(h)}if(a.childNodes===u)return{offsetNode:a,offset:i-d}}return{offsetNode:a,offset:i-d}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(i){var n;{const a=(n=this.caretPositionFromIndex(i))==null?void 0:n.offsetNode;return(a==null?void 0:a.type)==="text"?a.parentNode:a}this.lspError("AstElement.elementFromIndex")}elementFromPoint(i,n){return this.elementFromIndex(this.indexFromPos(n,i))}lint(i=this.getAbsoluteIndex(),n){const a=[];for(let o=0,d=i+this.getAttribute("padding");o<this.length;o++){const u=this.childNodes[o];u.setAttribute("aIndex",d);const h=u.lint(d,n);h.length>0&&a.push(...h),d+=u.toString().length+this.getGaps(o)}return a}print(i={}){const n=i.class;return this.toString()?(n===""?"":`<span class="wpb-${n!=null?n:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+bt(this.childNodes,i)+(n===""?"":"</span>"):""}json(i,n=this.getAbsoluteIndex()){const a={...this,type:this.type,range:[n,n+this.toString().length],childNodes:[]};for(let o=0,d=n+this.getAttribute("padding");o<this.length;o++){const u=this.childNodes[o],{length:h}=u.toString();u.setAttribute("aIndex",d),a.childNodes.push(u.type==="text"?{data:u.data,range:[d,d+h]}:u.json(void 0,d)),d+=h+this.getGaps(o)}return a}},e=new WeakSet,er=function(i){var n;for(const a of this.childNodes){if(a.type==="text")continue;if(i(a))return a;const o=P(n=a,e,er).call(n,i);if(o)return o}},tr=function(i,n=[]){var a;for(const o of this.childNodes)o.type!=="text"&&(i(o)&&n.push(o),P(a=o,e,tr).call(a,i,n));return n},r)}}),cs,Hs,Kr,Yr,Zr,en,Ds,Gs,sr,Mo=N({"lib/text.ts"(){"use strict";var e,Jl,s;he(),K(),J(),Vl(),cs=String.raw`[${Be}\t]*`,Hs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${cs}\d)|isbn(?=[-::]?${cs}(?:\d(?:${cs}|-)){6})`,Kr=new RegExp(String.raw`${Hs}|https?[:/]/+`,"giu"),Yr=new RegExp(Hs,"giu"),Zr=new Set(["attr-value","ext-link-text","link-text"]),en={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ds=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Gs=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{Gs=/\w/u}sr=(s=class extends Yt{constructor(l){super();O(this,e);ke(this,"data","");this.data=l}get type(){return"text"}toString(l){var i;return l&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?Ie(this.data):this.data}text(){return this.data}lint(l=this.getAbsoluteIndex(),i){var _,C,E;if(i===!1)return[];const{data:n,parentNode:a,nextSibling:o,previousSibling:d}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:u,name:h,parentNode:p}=a;if(u==="attr-value"){const{name:T,tag:L}=p;if(L==="ref"&&(T==="name"||T==="extends"||T==="follow")||T==="group"&&(L==="ref"||L==="references")||L==="choose"&&(T==="before"||T==="after"))return[]}if(i!=null||(i=u==="free-ext-link"||u==="ext-link-url"||u==="ext-link-text"||u==="image-parameter"&&h==="link"||u==="attr-value"?Yr:Kr),n.search(i)===-1)return[];i.lastIndex=0;const c=[],m=o==null?void 0:o.type,S=o==null?void 0:o.name,A=d==null?void 0:d.type,y=this.getRootNode(),$=y.toString(),{ext:f,html:g,variants:w}=y.getAttribute("config"),{top:b,left:v}=y.posFromIndex(l),k=new Set(["onlyinclude","noinclude","includeonly",...f,...g[0],...g[1],...g[2],...Ds]);for(let T=i.exec(n);T;T=i.exec(n)){const[,L,B]=T;let{index:j,0:F}=T;if(B&&B!=="]"){const{length:z}=B;j+=z,F=F.slice(z)}F=F.toLowerCase();const[U]=F,W=U==="r"||U==="p"||U==="i",q=U==="{",M=U==="}",D=U==="[",G=U==="]";let{length:Z}=F;if(U==="<"&&!k.has(L.toLowerCase())||D&&u==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(j+1))||o!=null&&o.is("ext")&&S==="nowiki"&&((_=o.innerText)!=null&&_.includes("]")))||W&&(!a.isPlain()||Zr.has(u)))continue;G&&(j||Z>1)&&i.lastIndex--;let Y=l+j,se=Y+Z,ue,Ae;const Le=$[se],it=$[Y-1],V=q||D,oe=q&&it==="-"&&w.length>0,me=M&&Le==="-"&&w.length>0,xe=D&&m==="free-ext-link"&&!n.slice(j+1).trim()||G&&A==="free-ext-link"&&!n.slice(0,j).includes("]");if(W)ue="lonely-http",F=F.toUpperCase(),Ae=I.lintConfig.getSeverity(ue,F);else if(U==="<"){ue="tag-like";let z;/^<\s/u.test(F)||!/[\s/>]/u.test(Le!=null?Le:"")?z="invalid":Ds.has(L)&&(z="disallowed"),Ae=I.lintConfig.getSeverity(ue,z)}else if(oe||me)ue="lonely-bracket",Ae=I.lintConfig.getSeverity(ue,"converter"),oe&&j>0?(F="-{",j--,Y--,Z=2):me&&j<n.length-1&&(F="}-",se++,Z=2);else if(xe)ue="lonely-bracket",Ae=I.lintConfig.getSeverity(ue,"extLink");else if(V||M||G)if(ue="lonely-bracket",Z>1||q&&Le===U||M&&it===U)Ae=I.lintConfig.getSeverity(ue,"double");else{if(!D||u!=="ext-link-text"){const z=en[U],Ee=V?n.slice(j+1):n.slice(0,j);if(q&&((C=z.exec(Ee))==null?void 0:C[0])==="}"||M&&((E=z.exec(Ee))==null?void 0:E[0])==="{")continue;if(!Ee.includes(U)){const _t=V?"nextSibling":"previousSibling";let De=this[_t];for(;De&&(De.type!=="text"||!z.test(De.data));)De=De[_t];if(De&&z.exec(De.data)[0]!==U)continue}}Ae=I.lintConfig.getSeverity(ue,"single")}else ue="lonely-http",Ae=I.lintConfig.getSeverity(ue);if(!Ae)continue;const $e=this.posFromIndex(j),{line:He,character:ye}=rs(b,v,$e.top+1,$e.left),Fe={rule:ue,message:I.msg('lonely "$1"',W||U==="h"||oe||me?F:U),severity:Ae,startIndex:Y,endIndex:se,startLine:He,endLine:He,startCol:ye,endCol:ye+Z};if(U==="<")Fe.suggestions=[{desc:"escape",range:[Y,Y+1],text:"&lt;"}];else if(U==="h"&&u!=="link-text"&&Gs.test(it||""))Fe.suggestions=[{desc:"whitespace",range:[Y,Y],text:" "}];else if(D&&u==="ext-link-text"){const z=a.getAbsoluteIndex()+a.toString().length;Fe.suggestions=[{desc:"escape",range:[z,z+1],text:"&#93;"}]}else if(G&&xe){const z=l-d.toString().length;Fe.suggestions=[{desc:"left bracket",range:[z,z],text:"["}]}else W&&(Fe.suggestions=[...T[0]===F?[]:[{desc:"uppercase",range:[Y,se],text:F}],...Le===":"||Le===":"?[{desc:"whitespace",range:[se,se+1],text:" "}]:[]]);c.push(Fe)}return c}replaceData(l){P(this,e,Jl).call(this,l)}print(){return is(this.data)}},e=new WeakSet,Jl=function(l){this.setAttribute("data",l)},s)}}),et,At=N({"mixin/hidden.ts"(){"use strict";we(),et=(e=!0,t=!0)=>s=>{class r extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return kt(r,s),r}}}),tt,$t=N({"src/syntax.ts"(){"use strict";var e,t;Q(),tt=(t=class extends H{constructor(r,l,i,n,a){super(r,i,n,a);O(this,e);R(this,e,l)}get type(){return x(this,e)}lint(r=this.getAbsoluteIndex()){return super.lint(r,!1)}},e=new WeakMap,t)}}),Pe,We=N({"mixin/padded.ts"(){"use strict";we(),Pe=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return kt(s,t),s}}}),be,Ue=N({"src/atom.ts"(){"use strict";var e,t;Q(),be=(t=class extends H{constructor(r,l,i,n,a){super(r,i,n,a);O(this,e);R(this,e,l)}get type(){return x(this,e)}set type(r){R(this,e,r)}getAttribute(r){var l;return r==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(r)}},e=new WeakMap,t)}}),tn,sn,Vs,rn,qe,js=N({"src/link/base.ts"(){"use strict";var e,t,s,r;K(),Ze(),he(),ce(),We(),J(),Q(),Ue(),tn=l=>l==="redirect-target"||l==="link",sn=[Pe("[[")],qe=(r=class extends(rn=H){constructor(i,n,a,o=[],d="|"){super(void 0,a,o,{});O(this,e,!0);O(this,t);O(this,s);if(this.insertAt(new be(i,"link-target",a,o,{})),n!==void 0){const u=new H(n,a,o,{});u.type="link-text",u.setAttribute("stage",Se-1),this.insertAt(u)}R(this,t,d)}get link(){return x(this,s)}get fragment(){return x(this,s).fragment}afterBuild(){R(this,s,this.getTitle()),x(this,t).includes("\0")&&R(this,t,this.buildFromStr(x(this,t),0)),this.setAttribute("name",x(this,s).title),super.afterBuild()}setAttribute(i,n){i==="bracket"?R(this,e,n):i==="title"?R(this,s,n):super.setAttribute(i,n)}toString(i){const n=super.toString(i,x(this,t));return x(this,e)?`[[${n}]]`:n}text(){const i=super.text("|");return x(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?x(this,s):super.getAttribute(i)}getGaps(i){return i===0?x(this,t).length:1}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{childNodes:[o,d],type:u}=this,{encoded:h,fragment:p}=x(this,s),c=new de(this,i);let m="unknown-page",S=I.lintConfig.getSeverity(m);if(S&&o.childNodes.some(({type:A})=>A==="template")&&a.push(X(o,c,m,"template in an internal link target",S)),m="url-encoding",S=I.lintConfig.getSeverity(m),S&&h){const A=X(o,c,m,"unnecessary URL encoding in an internal link",S);A.fix={desc:"decode",range:[A.startIndex,A.endIndex],text:es(o.text())},a.push(A)}if(m="pipe-like",S=I.lintConfig.getSeverity(m,"link"),S&&(u==="link"||u==="category")){const A=d==null?void 0:d.childNodes.findIndex($=>$.type==="text"&&$.data.includes("|")),y=d==null?void 0:d.childNodes[A];if(y){const $=X(d,c,m,'additional "|" in the link text',S),f=$.startIndex+d.getRelativeIndex(A);$.suggestions=[{desc:"escape",range:[f,f+y.data.length],text:y.data.replace(/\|/gu,"&#124;")}],a.push($)}}if(m="no-ignored",S=I.lintConfig.getSeverity(m,"fragment"),S&&p!==void 0&&!tn(u)){const A=X(o,c,m,"useless fragment",S),y=o.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("#")),$=o.childNodes[y];$&&(A.fix={desc:"remove",range:[A.startIndex+o.getRelativeIndex(y)+$.data.indexOf("#"),A.endIndex],text:""}),a.push(A)}return a}getTitle(i,n){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:n,temporary:i,decode:!0,selfLink:!0})}print(){return super.print(x(this,e)?{pre:"[[",post:"]]",sep:x(this,t)}:{sep:x(this,t)})}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n),{type:o,fragment:d}=this;return d!==void 0&&(o==="link"||o==="redirect-target")&&(a.fragment=d),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r),Vs=re(rn),qe=le(Vs,0,"LinkBaseToken",sn,qe),ne(Vs,1,qe)}}),Me,st=N({"src/nowiki/base.ts"(){"use strict";Q(),Me=class extends H{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),nn,Qs,ln,pe,ze=N({"src/nowiki/noinclude.ts"(){"use strict";At(),st(),nn=[et()],pe=class extends(ln=Me){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Qs=re(ln),pe=le(Qs,0,"NoincludeToken",nn,pe),ne(Qs,1,pe)}}),Xl,zo=N({"src/link/redirectTarget.ts"(){"use strict";K(),J(),js(),ze(),Xl=class extends qe{get type(){return"redirect-target"}constructor(e,t,s,r){super(e,void 0,s,r),t!==void 0&&this.insertAt(new pe(t,s,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){const t=super.lint(e,!1),s="no-ignored",r=I.lintConfig.getSeverity(s,"redirect");if(r&&this.length===2){const l=X(this.lastChild,{start:e},s,"useless link text",r);l.startIndex--,l.startCol--,l.fix={desc:"remove",range:[l.startIndex,l.endIndex],text:""},t.push(l)}return t}}}}),an,Js,on,qt,Ho=N({"src/redirect.ts"(){"use strict";var e,t,s;At(),Q(),$t(),zo(),an=[et(!1,!1)],qt=(s=class extends(on=H){constructor(l,i,n,a,o,d,u=[]){super(void 0,d,u);O(this,e);O(this,t);R(this,e,l),R(this,t,o),this.append(new tt(i,"redirect-syntax",d,u),new Xl(n,a==null?void 0:a.slice(1),d,u))}get type(){return"redirect"}getAttribute(l){return l==="padding"?x(this,e).length:super.getAttribute(l)}toString(l){return x(this,e)+super.toString(l)+x(this,t)}lint(l=this.getAbsoluteIndex()){const i=l+x(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}print(){return super.print({pre:x(this,e),post:x(this,t)})}},e=new WeakMap,t=new WeakMap,s),Js=re(on),qt=le(Js,0,"RedirectToken",an,qt),ne(Js,1,qt)}}),Kl={};ie(Kl,{parseRedirect:()=>Yl});var Yl,Do=N({"parser/redirect.ts"(){"use strict";J(),Ho(),Yl=(e,t,s)=>{var l;(l=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const r=t.regexRedirect.exec(e);return r&&I.normalizeTitle(r[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(r[0].length)}`,new qt(...r.slice(1),t,s),e):!1}}}),dn,Xs,un,Bt,Go=N({"src/onlyinclude.ts"(){"use strict";We(),Q(),dn=[Pe("<onlyinclude>")],Bt=class extends(un=H){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</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>'})}},Xs=re(un),Bt=le(Xs,0,"OnlyincludeToken",dn,Bt),ne(Xs,1,Bt)}}),ls,Rs=N({"mixin/gapped.ts"(){"use strict";we(),ls=(e=1)=>t=>{class s extends t{getGaps(){return e}}return kt(s,t),s}}}),hn,Ks,cn,Je,yr=N({"src/tagPair/index.ts"(){"use strict";var e,t;Rs(),Q(),hn=[ls()],Je=(t=class extends(cn=H){constructor(r,l,i,n,a,o=[]){super(void 0,a);O(this,e);ke(this,"closed");ke(this,"selfClosing");this.setAttribute("name",r.toLowerCase()),R(this,e,[r,n||r]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(l,i);const d=typeof l=="string"?-1:o.indexOf(l);o.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(r){const{selfClosing:l,firstChild:i,lastChild:n}=this,[a,o]=x(this,e);return l?`<${a}${i.toString(r)}/>`:`<${a}${i.toString(r)}>${n.toString(r)}${this.closed?`</${o}>`:""}`}text(){const[r,l]=x(this,e);return this.selfClosing?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(r){return r==="padding"?x(this,e)[0].length+1:super.getAttribute(r)}print(){const[r,l]=x(this,e);return super.print(this.selfClosing?{pre:`&lt;${r}`,post:"/&gt;"}:{pre:`&lt;${r}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),Ks=re(cn),Je=le(Ks,0,"TagPairToken",hn,Je),ne(Ks,1,Je)}}),Zl,Vo=N({"src/tagPair/translate.ts"(){"use strict";var e,ea,s;Q(),yr(),$t(),ze(),Zl=(s=class extends Je{constructor(l,i,n,a=[]){const o=new tt(l,"translate-attr",n,a);i=i==null?void 0:i.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,h,p,c)=>(new pe(h,n,a),new pe(c,n,a),`\0${a.length-1}n${p}\0${a.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(u,h,p,c,m)=>(new pe(h,n,a),new pe(m,n,a),`\0${a.length-1}n${c}\0${a.length}n`));const d=new H(i,n,a);d.type="translate-inner";super("translate",o,d,"translate",n,a);O(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,ea).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,ea=function(){return this.firstChild.toString()===" nowrap"},s)}}),gn,Ys,pn,Wt,Qo=N({"src/tagPair/include.ts"(){"use strict";K(),ce(),At(),J(),yr(),gn=[et(!1)],Wt=class extends(pn=Je){get type(){return"include"}constructor(e,t="",s,r,l,i){super(e,t,s!=null?s:"",s===void 0||r!=null?r:"",l,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:r,name:l}=this,i=new de(this,e),n=["no-ignored","unclosed-comment"],a=n.map(o=>I.lintConfig.getSeverity(o,"include"));if(a[0]&&s.data.trim()){const o=X(s,i,n[0],"useless attribute",a[0]);o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],t.push(o)}if(a[1]&&!r){const o=te(this,i,n[1],I.msg("unclosed $1",`<${l}>`),a[1]);o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${l}>`}],t.push(o)}return t}},Ys=re(pn),Wt=le(Ys,0,"IncludeToken",gn,Wt),ne(Ys,1,Wt)}}),Ps,Sr=N({"mixin/attributesParent.ts"(){"use strict";we(),Ps=(e=0)=>t=>{var r,ir;class s extends t{constructor(){super(...arguments);O(this,r)}hasAttr(a){return P(this,r,ir).call(this).hasAttr(a)}getAttr(a){return P(this,r,ir).call(this).getAttr(a)}}return r=new WeakSet,ir=function(){return this.childNodes[e]},kt(s,t),s}}}),ae,Zs,ei,Ft,gs,ti,Ge,si,ii,ri,ps,ni,Te,Ar,$r,kr,ta,sa=N({"util/sharable.ts"(){"use strict";ae=new Set(["align"]),Zs=new Set(["cite"]),ei=new Set(["cite","datetime"]),Ft=new Set(["width"]),gs=new Set(["axis","align","bgcolor","height","width","valign"]),ti=new Set([...gs,"abbr","headers","scope","rowspan","colspan"]),Ge=new Set(["type"]),si=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ii=new Set(["clear"]),ri=new Set(["bgcolor","align","valign"]),ps=new Set(["qid","forcemathmode","type","display"]),ni=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Te=new Set,Ar=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"]),$r={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:Zs,q:Zs,p:ae,br:ii,pre:Ft,ins:ei,del:ei,ul:Ge,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...si,"border"]),caption:ae,tr:ri,td:ti,th:ti,font:new Set(["size","color","face"]),hr:Ft,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ge,poem:ae,categorytree:ae,combooption:ae,math:Te,chem:Te,ce:Te,img:new Set(["alt","src","width","height","loading"])},kr={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:Te,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Te,inputbox:Te,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Te,poll:new Set(["id","show-results-before-voting"]),sm2:Ge,flashmp3:Ge,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([...ps,"chem"]),chem:ps,ce:ps,hiero:Te,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ni,syntaxhighlight:ni,templatedata:Te,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Te},ta={table:si,td:new Set([...gs,"scope"]),th:gs,br:ii,caption:ae,div:ae,hr:Ft,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:Ge,p:ae,pre:Ft,tr:ri,ul:Ge}}}),fn,mn,xn,vn,Ss,Jo=N({"src/attribute.ts"(){"use strict";var e,t,s,r,l,rr,n;K(),he(),Ze(),sa(),ce(),J(),Q(),Ue(),fn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,mn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,xn=new Set(["ext","arg","magic-word","template"]),vn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ss=(n=class extends H{constructor(o,d,u,h="",p,c=[],m=I.getConfig(),S=[]){const A=new be(u,"attr-key",m,S);let y;if(u==="title"||d==="img"&&u==="alt")y=new H(p,m,S,{}),y.type="attr-value",y.setAttribute("stage",Se-1);else if(d==="gallery"&&u==="caption"||d==="choose"&&(u==="before"||u==="after")||d==="img"&&u==="src"&&(p!=null&&p.includes("{{"))){const $={...m,excludes:[...m.excludes,"heading","html","table","hr","list"]};y=new H(p,$,S,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new be(p,"attr-value",m,S,{});super(void 0,m,S);O(this,l);O(this,e);O(this,t);O(this,s);O(this,r);R(this,e,o),this.append(A,y),R(this,s,h),R(this,r,[...c]),R(this,t,d),this.setAttribute("name",vt(Ie(u)))}get type(){return x(this,e)}get tag(){return x(this,t)}get balanced(){return!x(this,s)||x(this,r)[0]===x(this,r)[1]}afterBuild(){x(this,s).includes("\0")&&R(this,s,this.buildFromStr(x(this,s),0)),this.parentNode&&R(this,t,this.parentNode.name),this.setAttribute("name",vt(this.firstChild.text())),super.afterBuild()}toString(o){const[d="",u=""]=x(this,r);return x(this,s)?super.toString(o,x(this,s)+d)+u:this.firstChild.toString(o)}text(){return x(this,s)?`${super.text(`${x(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,d;return x(this,s)?x(this,s).length+((d=(o=x(this,r)[0])==null?void 0:o.length)!=null?d:0):0}lint(o=this.getAbsoluteIndex(),d){var g;const u=super.lint(o,d),{balanced:h,firstChild:p,lastChild:c,name:m,tag:S}=this,A=new de(this,o),y=["unclosed-quote","obsolete-attr"],$=y.map(w=>I.lintConfig.getSeverity(w,m));if($[0]&&!h){const w=X(c,A,y[0],I.msg("unclosed $1","quotes"),$[0]);w.startIndex--,w.startCol--,w.suggestions=[{desc:"close",range:[w.endIndex,w.endIndex],text:x(this,r)[0]}],u.push(w)}const f=P(this,l,rr).call(this,o,A);return f&&u.push(f),$[1]&&((g=ta[S])!=null&&g.has(m))&&u.push(X(p,A,y[1],"obsolete attribute",$[1])),u}getValue(){return x(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(o){return o==="invalid"?P(this,l,rr).call(this):super.getAttribute(o)}print(){const[o="",d=""]=x(this,r);return x(this,s)?super.print({sep:is(x(this,s))+o,post:d}):super.print()}json(o,d=this.getAbsoluteIndex()){const u=super.json(void 0,d);return u.tag=this.tag,u}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakSet,rr=function(o,d){const{firstChild:u,lastChild:h,type:p,name:c,tag:m,parentNode:S}=this,A=!h.childNodes.some(({type:b})=>xn.has(b)),y=this.getValue(),$=kr[m],f=$r[m],{length:g}=this.toString();let w="illegal-attr";if(!($!=null&&$.has(c))&&!(f!=null&&f.has(c))&&(p==="ext-attr"?$||f:!/\{\{[^{]+\}\}/u.test(c))&&(p==="ext-attr"&&!f||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(m==="meta"||m==="link"||!Ar.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(S!=null&&S.hasAttr("itemscope"))){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"unknown");if(b){const v=X(u,d,w,"illegal attribute name",b);return v.suggestions=[{desc:"remove",range:[o,o+g],text:""}],v}}else if(c==="style"&&typeof y=="string"&&fn.test(y)){if(o===void 0)return!0;w="insecure-style";const b=I.lintConfig.getSeverity(w);return b&&X(h,d,w,"insecure style",b)}else if(c==="tabindex"&&typeof y=="string"&&y!=="0"){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"tabindex");if(b){const v=X(h,d,w,"nonzero tabindex",b);return v.suggestions=[{desc:"remove",range:[o,o+g],text:""},{desc:"0 tabindex",range:[v.startIndex,v.endIndex],text:"0"}],v}}else if(A&&p!=="ext-attr"){const b=br(m,c),v=String(y).toLowerCase();if(b.length>0&&b.every(k=>k!==v)){if(o===void 0)return!0;const k=I.lintConfig.getSeverity(w,"value");return k&&X(h,d,w,"illegal attribute value",k)}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||vn.has(c))&&mn.test(y)||A&&(c==="href"||m==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"value");return b&&X(h,d,w,"illegal attribute value",b)}return!1},n)}}),li,bn,ai,Es,_r=N({"src/attributes.ts"(){"use strict";var e,t,As,r;K(),he(),ce(),J(),Q(),Ue(),Jo(),li=l=>l.slice(0,-1),bn=l=>`${li(l)}-dirty`;try{ai=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{ai=/[^\W_]/u}Es=(r=class extends H{constructor(i,n,a,o,d=[]){super(void 0,o,d,{});O(this,t);O(this,e);if(R(this,e,n),this.setAttribute("name",a),i){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",p=u.exec(i),c=0;const m=()=>{h&&(super.insertAt(new be(h,bn(n),o,d,{})),h="")};for(;p;){const{index:S,0:A,1:y,2:$,3:f,4:g,5:w,6:b}=p;if(h+=i.slice(c,S),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ie(y).trim())){const v=g!=null?g:b,k=[f,w],_=new Ss(li(n),a,y,$,v,k,o,d);m(),super.insertAt(_)}else h+=A;({lastIndex:c}=u),p=u.exec(i)}h+=i.slice(c),m()}}get type(){return x(this,e)}afterBuild(){const{parentNode:i}=this;i!=null&&i.is("td")&&this.setAttribute("name",i.subtype),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(n=>n instanceof Ss&&(!i||n.name===vt(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){const n=this.getAttrTokens(i);return n[n.length-1]}getAttr(i){var n;return(n=this.getAttrToken(i))==null?void 0:n.getValue()}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{parentNode:o,childNodes:d}=this,u=new Map,h=new Set,p=new de(this,i),c=["no-ignored","no-duplicate"],m=["closingTag","invalidAttributes","nonWordAttributes"].map(A=>I.lintConfig.getSeverity(c[0],A));if(m[0]&&P(this,t,As).call(this)){const A=te(this,p,c[0],"attributes of a closing tag",m[0]),y=o.getAbsoluteIndex();A.suggestions=[{desc:"remove",range:[i,A.endIndex],text:""},{desc:"open",range:[y+1,y+2],text:""}],a.push(A)}for(const A of d)if(A instanceof Ss){const{name:y}=A;u.has(y)?(h.add(y),u.get(y).push(A)):u.set(y,[A])}else{const y=A.text().trim(),$=m[ai.test(y)?1:2];if(y&&$){const f=X(A,p,c[0],"containing invalid attribute",$);f.suggestions=[{desc:"remove",range:[f.startIndex,f.endIndex],text:" "}],a.push(f)}}const S=I.lintConfig.getSeverity(c[1],"attribute");if(S&&h.size>0)for(const A of h){const y=u.get(A).map($=>{const f=$.getValue();return[$,f===!0?"":f]});a.push(...y.map(([$,f],g)=>{const w=X($,p,c[1],I.msg("duplicated $1 attribute",A),S),b={desc:"remove",range:[w.startIndex,w.endIndex],text:""};return!f||y.slice(0,g).some(([,v])=>v===f)?w.fix=b:w.suggestions=[b],w}))}return a}getAttribute(i){return i==="invalid"?P(this,t,As).call(this):super.getAttribute(i)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,As).call(this)?" wpb-invalid":""}">${this.childNodes.map(i=>i.print(i instanceof be?{class:i.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,As=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},r)}}),ia={};ie(ia,{PreToken:()=>ra});var ra,Xo=N({"src/pre.ts"(){"use strict";Ze(),Q(),ze(),ra=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const r=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:i}=r.source;let n=r.exec(e);n&&(l.lastIndex=n.index+i);let a=l.exec(e),o=0,d="";for(;n&&a;)new pe(n[0],t,s),new pe(a[0],t,s),d+=`${e.slice(o,n.index)}\0${s.length-1}n${e.slice(n.index+i,a.index)}\0${s.length}n`,o=a.index+i+1,r.lastIndex=o,n=r.exec(e),n&&(l.lastIndex=n.index+i),a=l.exec(e);e=d+e.slice(o)}super(e,t,s,{}),this.setAttribute("stage",Se-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Os,Cr=N({"mixin/multiLine.ts"(){"use strict";we(),Os=e=>{class t extends e{toString(r){return super.toString(r,`
3
- `)}text(){return super.text(`
4
- `).replace(/\n\s*\n/gu,`
5
- `)}getGaps(){return 1}print(){return super.print({sep:`
6
- `})}}return kt(t,e),t}}}),na={};ie(na,{ParamTagToken:()=>dt});var wn,oi,yn,dt,la=N({"src/paramTag/index.ts"(){"use strict";K(),ce(),Bs(),Cr(),J(),Q(),Ue(),wn=[Os],dt=class extends(yn=H){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),r=[],l){if(super(void 0,s,r,{}),t){const i=be;this.append(...t.split(`
7
- `).map(n=>l?n:as(n,s,r,e)).map(n=>new i(n,"param-line",s,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=I.lintConfig.getSeverity(t,this.name);if(!s)return[];const r=new de(this,e),l=I.msg("invalid parameter of <$1>",this.name),i=[];for(const n of this.childNodes){n.setAttribute("aIndex",e);const a=n.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(a.some(({type:o})=>o==="ext"))i.push(X(n,r,t,l,s));else{const o=a.findIndex(({type:u})=>u!=="text"),d=a.slice(0,o===-1?void 0:o).map(String).join("");if(d&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const u=X(n,r,t,l,s);u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:""}],i.push(u)}else{const u=n.lint(e,!1);u.length>0&&i.push(...u)}}e+=n.toString().length+1}return i}},oi=re(yn),dt=le(oi,0,"ParamTagToken",wn,dt),ne(oi,1,dt)}}),Ir,aa=N({"src/heading.ts"(){"use strict";var e,t,$s,r;K(),we(),ce(),J(),Q(),$t(),Ir=(r=class extends H{constructor(i,n,a,o=[]){super(void 0,a,o);O(this,t);O(this,e);R(this,e,i);const d=new H(n[0],a,o);d.type="heading-title",d.setAttribute("stage",2);const u=new tt(n[1],"heading-trail",a,o);this.append(d,u)}get type(){return"heading"}get level(){return x(this,e)}toString(i){const n=P(this,t,$s).call(this);return n+this.firstChild.toString(i)+n+this.lastChild.toString(i)}text(){const i=P(this,t,$s).call(this);return i+this.firstChild.text()+i}getAttribute(i){return i==="invalid"?this.inHtmlAttrs()===2:i==="padding"?this.level:super.getAttribute(i)}getGaps(){return this.level}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{firstChild:o,level:d}=this,u=o.toString(),h=u.startsWith("="),p=h||u.endsWith("="),c=new de(this,i),m=this.inHtmlAttrs(),S=["h1","unbalanced-header","format-leakage"],A=S.map(y=>I.lintConfig.getSeverity(y,"apostrophe"));if(A[0]&&this.level===1){const y=X(o,c,S[0],"<h1>",A[0]);p||(y.suggestions=[{desc:"h2",range:[y.startIndex,y.endIndex],text:`=${u}=`}]),a.push(y)}if(A[1]&&p){const y=I.msg("unbalanced $1 in a section header",'"="'),$=X(o,c,S[1],y,A[1]);if(u!=="=")if(h){const[f]=/^=+/u.exec(u),g=d+f.length;$.suggestions=[{desc:`h${d}`,range:[$.startIndex,$.startIndex+f.length],text:""}],g<7&&$.suggestions.push({desc:`h${g}`,range:[$.endIndex,$.endIndex],text:f})}else{const f=/[^=](=+)$/u.exec(u)[1],g=d+f.length;$.suggestions=[{desc:`h${d}`,range:[$.endIndex-f.length,$.endIndex],text:""}],g<7&&$.suggestions.push({desc:`h${g}`,range:[$.startIndex,$.startIndex],text:f})}a.push($)}if(m){const y="parsing-order",$=I.lintConfig.getSeverity(y,m===2?"heading":"templateInTable");$&&a.push(te(this,c,y,"section header in HTML tag attributes",$))}if(A[2]){const y=this.getRootNode().toString(),$=o.childNodes.filter(Ws("quote")),f=$.filter(({bold:w})=>w),g=$.filter(({italic:w})=>w);if(f.length%2){const w=X(f[f.length-1],{...c,start:i+d,left:c.left+d},S[2],I.msg("unbalanced $1 in a section header","bold apostrophes"),A[2]),b=i+d+u.length;y.slice(w.endIndex,b).trim()?w.suggestions=[{desc:"close",range:[b,b],text:"'''"}]:w.fix={desc:"remove",range:[w.startIndex,w.endIndex],text:""},a.push(w)}if(g.length%2){const w=X(g[g.length-1],{start:i+d},S[2],I.msg("unbalanced $1 in a section header","italic apostrophes"),A[2]),b=i+d+u.length;y.slice(w.endIndex,b).trim()?w.suggestions=[{desc:"close",range:[b,b],text:"''"}]:w.fix={desc:"remove",range:[w.startIndex,w.endIndex],text:""},a.push(w)}}return a}print(){const i=P(this,t,$s).call(this);return super.print({pre:i,sep:i})}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n);return a.level=this.level,a}},e=new WeakMap,t=new WeakSet,$s=function(){return"=".repeat(this.level)},r)}}),Sn,oa,Ko=N({"src/parameter.ts"(){"use strict";he(),K(),J(),Q(),Sn=new RegExp(`https?://${mt}${xt}$`,"iu"),oa=class extends H{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,r=[]){super(void 0,s,r);const l=new H(typeof e=="number"?void 0:e,s,r,{}),i=new H(t,s,r);l.type="parameter-key",l.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(l,i)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var i;const s=super.lint(e,t),r="unescaped",l=I.lintConfig.getSeverity(r);if(l){const{firstChild:n}=this,a=(i=Sn.exec(n.text()))==null?void 0:i[0];try{if(a&&new URL(a).search){const o="unescaped query string in an anonymous parameter",d=X(n,{start:e},r,o,l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,d.fix={desc:"escape",range:[d.startIndex,d.endIndex],text:"{{=}}"},s.push(d)}}catch{}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),An,di,$n,ut,Yo=N({"src/transclude.ts"(){"use strict";var e,t,s,r,l,i,Ut,da,o;he(),K(),we(),ce(),Rs(),J(),Q(),Ko(),Ue(),$t(),An=[ls()],ut=(o=class extends($n=H){constructor(u,h,p,c=[]){var C,E;let m;const S=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);S&&(m=Number(S[1]),u=u.replace(`\0${m}h`,c[m].toString().replace(/^\n/u,"")));super(void 0,p,c,{});O(this,i);ke(this,"modifier","");O(this,e,"template");O(this,t,":");O(this,s,!1);O(this,r,new Map);O(this,l);const{parserFunction:[A,y],variable:$,functionHook:f}=p,g=(C=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:C[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[T,...L]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=L[0])!=null?E:"");this.setModifier(`${T}:${B}`)&&(u=L.join(":").slice(B.length))}const w=u.search(/[::]/u),b=u[w]===":",v=w!==-1;if(v||h.length===0&&!x(this,s)){const T=v?u.slice(0,w):u,L=v&&u.slice(w+1),B=Ie(T),j=v?B.slice(B.search(/\S/u))+(b?":":""):B.trim(),F=j.toLowerCase(),U=Array.isArray(y),W=U?y.includes(j):Object.prototype.hasOwnProperty.call(y,j),q=!U&&W?y[j]:Object.prototype.hasOwnProperty.call(A,F)&&A[F],M=U&&W||!("functionHook"in p)||f.includes(q),D=U&&W||$.includes(q);if(v?q&&M:D){this.setAttribute("name",q||F.replace(/^#|:$/u,"")),R(this,e,"magic-word"),b&&R(this,t,":");const G=new tt(T,"magic-word-name",p,c);if(super.insertAt(G),L!==!1&&h.unshift([L]),this.name==="invoke")for(let Z=0;Z<2;Z++){const Y=h.shift();if(!Y)break;const se=new be(Y.join("="),`invoke-${Z?"function":"module"}`,p,c);super.insertAt(se)}}}if(this.type==="template"){const T=Ie(u).trim();if(!this.normalizeTitle(T,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const L=new be(u,"template-name",p,c,{});super.insertAt(L)}typeof m=="number"&&(c[m]=void 0);const k=this.isTemplate();let _=1;for(let T=0;T<h.length;T++){const L=h[T];k||this.name==="switch"&&T>0||this.name==="tag"&&T>1||(L[0]=L.join("="),L.length=1),L.length===1&&(L.unshift(_),_++),this.insertAt(new oa(...L,p,c))}this.seal("modifier")}get type(){return x(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,i,Ut).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,h,p]}=this.getAttribute("config"),c=Ie(u).trim();if(u&&!c.endsWith(":"))return!1;const m=c.slice(0,-1).toLowerCase(),S=h.includes(m),A=p.includes(m);return x(this,s)&&S||!x(this,s)&&(A||!u)||(ve.running||this.length>1)&&(S||A||!u)?(this.setAttribute("modifier",u),R(this,s,S),!!u):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(R(this,l,P(this,i,Ut).call(this)),this.setAttribute("name",x(this,l).title))}toString(u){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(u)+(this.length===1?"":x(this,t))+this.childNodes.slice(1).map(h=>h.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:h,firstChild:p,modifier:c,type:m,name:S}=this;return m==="magic-word"&&S==="vardefine"?"":`{{${c}${m==="magic-word"?p.text()+(h===1?"":x(this,t))+Ye(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return x(this,l);case"colon":return x(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,i,Ut).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),h){const p=super.lint(u,h);if(!this.isTemplate())return p;const{type:c,childNodes:m,length:S}=this,A=new de(this,u),y=c==="magic-word";let $="no-ignored",f=I.lintConfig.getSeverity($,"fragment");if(y&&!P(this,i,Ut).call(this).valid)$="invalid-invoke",f=I.lintConfig.getSeverity($,"name"),f&&p.push(X(m[1],A,$,"illegal module name",f));else if(f){const g=m[y?1:0],w=g.childNodes.findIndex(v=>v.type==="text"&&ss(v.data).includes("#")),b=g.childNodes[w];if(b){const v=X(g,A,$,"useless fragment",f);v.fix={desc:"remove",range:[v.startIndex+g.getRelativeIndex(w)+b.data.indexOf("#"),v.endIndex],text:""},p.push(v)}}if($="invalid-invoke",f=I.lintConfig.getSeverity($,"function"),f&&y&&S===2)return p.push(te(this,A,$,"missing module function",f)),p;if($="no-duplicate",f=I.lintConfig.getSeverity($,"parameter"),f){const g=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),w="duplicated parameter";for(const[,b]of g)p.push(...b.map(v=>{const k=X(v,A,$,w,f);return k.suggestions=[{desc:"remove",range:[k.startIndex-1,k.endIndex],text:""}],k}))}return p}insertAt(u,h=this.length){return super.insertAt(u,h),u.anon?P(this,i,da).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Ws("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,h,p=!0){const c=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let m;return x(this,r).has(c)?m=x(this,r).get(c):(m=new Set(this.getAllArgs().filter(({name:S})=>c===S)),x(this,r).set(c,m)),m}getDuplicatedArgs(){return[...x(this,r)].filter(([,{size:u}])=>u>1).map(([u,h])=>[u,[...h]])}getPossibleValues(){const{type:u,name:h,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,m;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const S=p.slice(2),A=S[S.length-1];m=[...S.filter(({anon:y})=>!y),...A!=null&&A.anon?[A]:[]].map(({lastChild:y})=>y);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}m!=null||(m=p.slice(c,c+2).map(({lastChild:S})=>S));for(let S=0;S<m.length;){const{length:A,0:y}=m[S].childNodes.filter($=>$.text().trim());if(A===0)m.splice(S,1);else if(A>1||y.type!=="magic-word")S++;else try{const $=y.getPossibleValues();m.splice(S,1,...$),S+=$.length}catch{S++}}return m}print(){const{childNodes:u,length:h,firstChild:p,modifier:c,type:m}=this;return`<span class="wpb-${m}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${m==="magic-word"?is(c)+p.print()+(h===1?"":x(this,t))+bt(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${is(c)}</span>`:"")+bt(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakSet,Ut=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},da=function(u){const h=this.getAnonArgs(),p=typeof u!="number";for(let c=p?h.indexOf(u):u-1;c<h.length;c++){const m=h[c],{name:S}=m,A=String(c+1);(S!==A||m===u)&&(m.setAttribute("name",A),this.getArgs(A,!1,!1).add(m))}},o),di=re($n),ut=le(di,0,"TranscludeToken",An,ut),ne(di,1,ut)}}),kn,ui,_n,Mt,Zo=N({"src/hidden.ts"(){"use strict";At(),Q(),kn=[et()],Mt=class extends(_n=H){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ui=re(_n),Mt=le(ui,0,"HiddenToken",kn,Mt),ne(ui,1,Mt)}}),Cn,hi,In,zt,ed=N({"src/arg.ts"(){"use strict";var e,ua,s;he(),K(),ce(),We(),Rs(),J(),Q(),Ue(),Zo(),Cn=[Pe("{{{"),ls()],zt=(s=class extends(In=H){constructor(l,i,n=[]){super(void 0,i,n,{});O(this,e);for(let a=0;a<l.length;a++){const o=l[a];if(a===0){const d=new be(o,"arg-name",i,n,{});super.insertAt(d)}else if(a>1){const d=new Mt(o,i,n);super.insertAt(d)}else{const d=new H(o,i,n);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var l,i;return(i=(l=this.childNodes[1])==null?void 0:l.text())!=null?i:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,ua).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),i){const{childNodes:[n,a,...o]}=this;n.setAttribute("aIndex",l+3);const d=n.lint(l+3,i);if(a){const p=l+4+n.toString().length;a.setAttribute("aIndex",p);const c=a.lint(p,i);c.length>0&&d.push(...c)}const u=["no-ignored","no-arg"],h=u.map(p=>I.lintConfig.getSeverity(p,"arg"));if(h[0]&&o.length>0){const p=new de(this,l);d.push(...o.map(c=>{const m=X(c,p,u[0],"invisible content inside triple braces",h[0]);return m.startIndex--,m.startCol--,m.suggestions=[{desc:"remove",range:[m.startIndex,m.endIndex],text:""},{desc:"escape",range:[m.startIndex,m.startIndex+1],text:"{{!}}"}],m}))}if(h[1]&&!this.getAttribute("include")){const p=te(this,{start:l},u[1],"unexpected template argument",h[1]);a&&(p.suggestions=[{desc:"expand",range:[l,p.endIndex],text:a.text()}]),d.push(p)}return d}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,i=this.getAbsoluteIndex()){const n=super.json(void 0,i);return n.default=this.default,n}},e=new WeakSet,ua=function(){this.setAttribute("name",this.firstChild.text().trim())},s),hi=re(In),zt=le(hi,0,"ArgToken",Cn,zt),ne(hi,1,zt)}}),ha={};ie(ha,{parseBraces:()=>qs});var Tn,ci,fs,gi,pi,fi,Nn,mi,qs,Tr=N({"parser/braces.ts"(){"use strict";St(),he(),aa(),Yo(),ed(),Tn={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ci=String.raw`\[(?!\[)`,fs=String.raw`\n(?![=\0])`,gi=String.raw`|\{{2,}`,pi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),fi=Xe(e=>new RegExp(e,"gmu")),Nn=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ci}|${fs})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${fs})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ci}|${fs})*\}-`,"gu"),mi=e=>{const t=vt(Ie(e));return pi.has(t)?pi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},qs=(e,t,s)=>{var m,S,A,y,$;const r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,i=[],n=[],a=(f,g,w,b)=>{g[g.length-1].push(Re(f.slice(w,b),n))};let o;do o!==void 0&&(e=o),o=e.replace(Nn,(f,g,w)=>{if(g!==void 0||typeof w=="string")try{const{length:b}=s,v=(g!=null?g:w).split("|");return new ut(Re(v[0],n),v.slice(1).map(k=>{const _=k.indexOf("=");return(_===-1?[k]:[k.slice(0,_),k.slice(_+1)]).map(C=>Re(C,n))}),t,s),`\0${b}${mi(v[0])}`}catch(b){if(!(b instanceof SyntaxError)||b.message!=="Invalid template name")throw b}return n.push(Re(f,n)),`\0${n.length-1}`});while(o!==e);e=o;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,h=fi(r+(u?gi:"")),p=h.exec(e),c;for(;p||c!==void 0&&c<=e.length&&((S=(m=i[i.length-1])==null?void 0:m[0])!=null&&S.startsWith("="));){if(p!=null&&p[1]){const[,{length:L}]=p;p[0]=p[0].slice(L),p.index+=L}const{0:f,index:g}=p!=null?p:{0:`
8
- `,index:e.length},w=(A=i.pop())!=null?A:{},{0:b,index:v,parts:k,findEqual:_,pos:C}=w,E=f==="="&&_;if(f==="]]"||f==="}-")c=g+2;else if(f===`
9
- `){c=g+1;const{pos:L,findEqual:B}=(y=i[i.length-1])!=null?y:{};if(L===void 0||B||Ie(e.slice(L,v))!==""){const j=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,g));j&&(j[2]=Re(j[2],n),j[2].includes(`
10
- `)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(g)}`,c=v+4+String(s.length).length,new Ir(j[1].length,j.slice(2),t,s)))}}else if(f==="|"||E)c=g+1,a(e,k,C,g),f==="|"&&k.push([]),w.pos=c,w.findEqual=f==="|",i.push(w);else if(f.startsWith("}}")){const L=f.slice(0,Math.min(b.length,3)),B=b.length-L.length,{length:j}=s;c=g+L.length,a(e,k,C,g);let F=!1,U="t";if(L.length===3){const W=k.map(M=>M.join("=")),q=W.length>1&&Ie(W[1]).trim();new zt(W,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(U="s")}else try{new ut(k[0][0],k.slice(1),t,s),U=mi(k[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")F=!0;else throw W}F||(e=`${e.slice(0,v+B)}\0${j}${U}${e.slice(c)}`,c=v+B+3+String(j).length,B>1?i.push({0:b.slice(0,B),index:v,pos:v+B,parts:[[]]}):B===1&&e[v-1]==="-"&&i.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else c=g+f.length,f.startsWith("{")&&(p.pos=c,p.parts=[[]]),i.push(..."0"in w?[w]:[],p);let T=i[i.length-1];if(u&&d+e.length<c)for(u=!1;($=T==null?void 0:T[0])!=null&&$.startsWith("{");)i.pop(),T=i[i.length-1];h=fi(r+(u?gi:"")+(T?`|${Tn[T[0][0]]}${T.findEqual?"|=":""}`:"")),h.lastIndex=c,p=h.exec(e)}return Re(e,n)}}}),ca={};ie(ca,{InputboxToken:()=>ga});var ga,td=N({"src/paramTag/inputbox.ts"(){"use strict";Bs(),Tr(),J(),la(),ga=class extends dt{constructor(e,t,s=I.getConfig(),r=[]){const l=Symbol("InputboxToken"),i=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:n}=r;r.push(l),t&&(t=as(t,i,r,e)),t&&(t=qs(t,i,r)),r.splice(n,1),super(e,t,i,r,{})}}}}),ks={};ie(ks,{NestedToken:()=>pa});var Ln,Fn,pa,xi=N({"src/nested.ts"(){"use strict";var e,t,s;K(),ce(),Bs(),Tr(),J(),Q(),La(),ze(),Ln=new Set(["comment","include","arg","template","magic-word"]),Fn=[!1,!0].map(r=>{const l=r?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),pa=(s=class extends H{constructor(l,i,n,a,o=[]){if(typeof i=="boolean"){const d=Symbol("InputboxToken"),{length:u}=o;o.push(d),l&&(l=as(l,a,o,i)),l&&(l=qs(l,a,o)),o.splice(u,1)}else l&&(l=l.replace(i,(d,u,h,p,c)=>{const m=`\0${o.length+1}e`;return new pt(u,h,p,c,a,!1,o),m}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,h)=>(new pe(h,a,o),`${u}\0${o.length}n`)));super(l,a,o);O(this,e);O(this,t);R(this,e,[...n]),R(this,t,i)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),i){const n=super.lint(l,i),a="no-ignored",o=I.lintConfig.getSeverity(a,this.name);if(!o)return n;const d=new de(this,l),u=typeof x(this,t)=="boolean"?Fn[x(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...n,...this.childNodes.filter(h=>{const{type:p,name:c}=h;if(p==="ext")return!x(this,e).includes(c);if(Ln.has(p))return!1;const m=h.toString().trim();return m&&!u.test(m)}).map(h=>{const p=X(h,d,a,I.msg("invalid content in <$1>",this.name),o);return p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"comment",range:[p.startIndex,p.endIndex],text:`<!--${h.toString()}-->`}],p})]}},e=new WeakMap,t=new WeakMap,s)}});function jn(e,t,s,r,l){t=Ie(t).trim();let i=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(fa(s.protocol).test(i))return ma(s.protocol).test(i)&&t;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;const n=I.normalizeTitle(i,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0});return n.valid&&n}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var fa,ma,Rn,Pn,xa,sd=N({"src/imageParameter.ts"(){"use strict";var e,t,va,l;St(),he(),K(),J(),Q(),fa=Xe(i=>new RegExp(String.raw`^(?:${i}|//|\0\d+m\x7F)`,"iu")),ma=Xe(i=>new RegExp(String.raw`^(?:(?:${i}|//)${mt}|\0\d+m\x7F)${xt}$`,"iu")),Rn=Xe(i=>new RegExp(String.raw`^(\s*(?!\s))${i.replace("$1","(.*)")}${i.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),Pn=new Set(["alt","link","lang","page","caption"]),xa=(l=class extends H{constructor(n,a,o,d){var i=(...r)=>(super(...r),O(this,t),O(this,e,""),this);let u;const h=Object.entries(o.img).map(([c,m])=>[c,m,Rn(c)]),p=h.find(([,c,m])=>(u=m.exec(n),u&&(u.length!==4||jn(c,u[2],o,!0,a)!==!1)));if(p&&u){u.length===3?(i(void 0,o,d),R(this,e,n)):(i(u[2],o,d,{}),R(this,e,u[1]+p[0]+u[3])),this.setAttribute("name",p[1]);return}i(n,o.excludes.includes("list")?o:{...o,excludes:[...o.excludes,"list"]},d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?jn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var n;(n=this.parentNode)!=null&&n.is("gallery-image")&&!Pn.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(n){return x(this,e)?x(this,e).replace("$1",super.toString(n)):super.toString(n)}text(){return x(this,e)?x(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(n){return n==="invalid"?this.name==="invalid":n==="padding"?Math.max(0,x(this,e).indexOf("$1")):super.getAttribute(n)}lint(n=this.getAbsoluteIndex(),a){const o=super.lint(n,a),{link:d,name:u}=this;if(u==="invalid"){const h="invalid-gallery",p=I.lintConfig.getSeverity(h,"parameter");if(p){const c=te(this,{start:n},h,"invalid image parameter",p);c.fix={desc:"remove",range:[n-1,c.endIndex],text:""},o.push(c)}}else if(typeof d=="object"&&d.encoded){const h="url-encoding",p=I.lintConfig.getSeverity(h,"file");if(p){const c=te(this,{start:n},h,"unnecessary URL encoding in an internal link",p);c.suggestions=[{desc:"decode",range:[n,c.endIndex],text:es(this.text())}],o.push(c)}}return o}getValue(){return this.name==="invalid"?this.text():P(this,t,va).call(this)||super.text()}print(){return x(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${x(this,e).replace("$1",`<span class="wpb-image-caption">${bt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,va=function(){return x(this,e)&&!x(this,e).includes("$1")},l)}}),vi,En,On,bi,wi,qn,Bn,yi,Nr,ba=N({"src/link/file.ts"(){"use strict";K(),ce(),J(),js(),sd(),vi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),En=new Set(["arg"]),On=new Set(["template","magic-word"]),bi=new Set(["left","right","center","none"]),wi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),qn=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Bn=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let r=t.exec(e),l=0,i=0;for(;r;){const{0:n,index:a}=r;n!=="|"?l+=n==="-{"?1:-1:l===0&&(s.push(e.slice(i,a)),{lastIndex:i}=t),r=t.exec(e)}return s.push(e.slice(i)),s},yi=(e,t)=>e.filter(({childNodes:s})=>{const r=s.filter(l=>l.text().trim());return r.length!==1||!t.has(r[0].type)}),Nr=class extends qe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,r=[],l="|"){super(e,void 0,s,r,l);const{extension:i}=this.getTitle(!0,!0);this.safeAppend(Bn(t).map(n=>new xa(n,i,s,r)))}lint(e=this.getAbsoluteIndex(),t){var A;const s=super.lint(e,t),r=yi(this.getAllArgs(),En),l=[...new Set(r.map(({name:y})=>y))],i=l.filter(y=>vi.has(y)),n=l.filter(y=>bi.has(y)),a=l.filter(y=>wi.has(y)),[o]=i,d=o==="framed"||o==="manualthumb",u=new de(this,e);let h="nested-link",p=I.lintConfig.getSeverity(h,"file");if(p&&this.closest("ext-link-text")&&((A=this.getValue("link"))==null?void 0:A.trim())!==""&&s.push(te(this,u,h,"internal link in an external link",p)),h="invalid-gallery",p=I.lintConfig.getSeverity(h,"parameter"),p&&d)for(const y of r.filter(({name:$})=>$==="width")){const $=X(y,u,h,"invalid image parameter",p);$.fix={desc:"remove",range:[$.startIndex-1,$.endIndex],text:""},s.push($)}if(r.length===l.length&&i.length<2&&n.length<2&&a.length<2)return s;h="no-duplicate";const{extension:c}=this,m=["unknownImageParameter","imageParameter"].map(y=>I.lintConfig.getSeverity(h,y)),S=(y,$,f,g=!0)=>y.map(w=>{if(p=m[Number(typeof g=="function"?g(w):g)],!p)return!1;const b=X(w,u,h,I.msg(`${$} image $1 parameter`,f),p);return b.suggestions=[{desc:"remove",range:[b.startIndex-1,b.endIndex],text:""}],b}).filter(w=>w!==!1);for(const y of l){if(y==="invalid"||y==="width"&&d)continue;const $=y==="caption";let f=r.filter(({name:g})=>g===y);if($&&(f=[...f.slice(0,-1).filter(g=>g.text()),...f.slice(-1)]),f.length>1){let g=!$||!c||qn.has(c);if($&&g){const w=yi(f,On);g=w.length>1&&(b=>w.includes(b))}s.push(...S(f,"duplicated",y,g))}}return i.length>1&&s.push(...S(r.filter(({name:y})=>vi.has(y)),"conflicting","frame")),n.length>1&&s.push(...S(r.filter(({name:y})=>bi.has(y)),"conflicting","horizontal-alignment")),a.length>1&&s.push(...S(r.filter(({name:y})=>wi.has(y)),"conflicting","vertical-alignment")),s}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{extension:r}=this;return r&&(s.extension=r),s}}}}),Wn,Si,Un,ht,wa=N({"src/link/galleryImage.ts"(){"use strict";var e,nr,s;K(),Ze(),We(),J(),Q(),ba(),Wn=[Pe("")],ht=(s=class extends(Un=Nr){constructor(l,i,n,a,o=[]){let d;if(n!==void 0){const{length:u}=o;d=new H(n,a,o);for(let h=1;h<Se;h++)d.parseOnce();o.splice(u,1)}super(i,d==null?void 0:d.toString(),a,o);O(this,e);ke(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const i=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),i?0:6,{halfParsed:!0,temporary:l,decode:!i})}lint(l=this.getAbsoluteIndex(),i){const n=super.lint(l,i),a="invalid-gallery",o=I.lintConfig.getSeverity(a,"image");if(o&&P(this,e,nr).call(this)){const d=te(this,{start:l},a,"invalid gallery image",o);d.suggestions=[{desc:"prefix",range:[l,l],text:"File:"}],n.push(d)}return n}getAttribute(l){return l==="invalid"?P(this,e,nr).call(this):super.getAttribute(l)}},e=new WeakSet,nr=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),Si=re(Un),ht=le(Si,0,"GalleryImageToken",Wn,ht),ne(Si,1,ht)}}),ya={};ie(ya,{GalleryToken:()=>Ht});var Mn,Ai,zn,Ht,id=N({"src/gallery.ts"(){"use strict";var e,Sa,lr,r;Cr(),J(),Q(),wa(),ze(),Mn=[Os],Ht=(r=class extends(zn=H){constructor(i,n,a=[]){var o;super(void 0,n,a,{});O(this,e);for(const d of(o=i==null?void 0:i.split(`
12
- `))!=null?o:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new pe(d,n,a):d);continue}const[,h,p]=u;P(this,e,Sa).call(this,h)?super.insertAt(new ht("gallery",h,p,n,a)):super.insertAt(new pe(d,n,a))}}get type(){return"ext-inner"}get widths(){return P(this,e,lr).call(this,"widths")}get heights(){return P(this,e,lr).call(this,"heights")}lint(i=this.getAbsoluteIndex(),n){const{top:a,left:o}=this.getRootNode().posFromIndex(i),d=[],u="no-ignored",h=["Image","NoImage","Comment"].map(p=>I.lintConfig.getSeverity(u,`gallery${p}`));for(let p=0;p<this.length;p++){const c=this.childNodes[p],m=c.toString(),{length:S}=m,A=m.trim(),{type:y}=c,$=a+p,f=p?0:o;if(c.setAttribute("aIndex",i),y==="noinclude"&&A&&!/^<!--.*-->$/u.test(A)){let[g]=h;if(A.startsWith("|")?[,g]=h:(A.startsWith("<!--")||A.endsWith("-->"))&&([,,g]=h),g){const w=i+S;d.push({rule:u,message:I.msg("invalid content in <$1>","gallery"),severity:g,startIndex:i,endIndex:w,startLine:$,endLine:$,startCol:f,endCol:f+S,suggestions:[{desc:"remove",range:[i,w],text:""},{desc:"comment",range:[i,w],text:`<!--${m}-->`}]})}}else if(y!=="noinclude"&&y!=="text"){const g=c.lint(i,n);g.length>0&&d.push(...g)}i+=S+1}return d}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n);return Object.assign(a,{widths:this.widths,heights:this.heights}),a}},e=new WeakSet,Sa=function(i){return this.normalizeTitle(i,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},lr=function(i){var o,d;const n=(o=this.parentNode)==null?void 0:o.getAttr(i),a=typeof n=="string"&&((d=/^(\d+)\s*(?:px)?$/u.exec(n))==null?void 0:d[1]);return a&&Number(a)||120},r),Ai=re(zn),Ht=le(Ai,0,"GalleryToken",Mn,Ht),ne(Ai,1,Ht)}}),Lr,Aa=N({"src/link/index.ts"(){"use strict";K(),J(),js(),Lr=class extends qe{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r="nested-link",l=I.lintConfig.getSeverity(r);return l&&this.closest("ext-link-text")&&s.push(te(this,{start:e},r,"internal link in an external link",l)),s}}}}),Hn,Dn,ns,Fr=N({"src/magicLink.ts"(){"use strict";var e,t,ar,r;K(),he(),ce(),J(),Q(),Hn=String.raw`(?:[${Be}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Dn=new RegExp(`${Hn}+`,"gu"),ns=(r=class extends H{constructor(i,n="free-ext-link",a=I.getConfig(),o){super(i,a,o,{});O(this,t);O(this,e);R(this,e,n)}get type(){return x(this,e)}get innerText(){const i=new Map([["!","|"],["=","="]]);let n=Ye(this.childNodes.map(a=>{const{type:o}=a,d=String(a.name);return o==="magic-word"&&i.has(d)?i.get(d):a}));return this.type==="magic-link"&&(n=n.replace(Dn," ")),n}get link(){const{innerText:i}=this;return this.type==="magic-link"?i.startsWith("ISBN")?`ISBN ${i.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:i:Gl(i).replace(/\n/gu,"%0A")}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),o=new de(this,i),{type:d,childNodes:u}=this;if(d==="magic-link"){const m="invalid-isbn",S=I.lintConfig.getSeverity(m);return S&&P(this,t,ar).call(this)&&a.push(te(this,o,m,"invalid ISBN",S)),a}const h=d==="ext-link-url",p="unterminated-url",c=I.lintConfig.getSeverity(p,h?"pipe":"punctuation");if(c){const m=h?/\|/u:/[,;。:!?()]+/u,S=u.find(A=>A.type==="text"&&m.test(A.data));if(S){const{data:A}=S,y=X(S,o,p,I.msg("$1 in URL",h?'"|"':"full-width punctuation"),c),{index:$,0:f}=m.exec(A),g=y.startIndex+$;y.suggestions=h?[{desc:"whitespace",range:[g,g+1],text:" "}]:[{desc:"whitespace",range:[g,g],text:" "},{desc:"escape",range:[g,g+f.length],text:encodeURI(f)}],a.push(y)}}return a}getUrl(i){{const{type:n}=this;let{link:a}=this;if(n==="magic-link"){if(a.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${a.slice(5)}`,-1,{temporary:!0}).getUrl(i);a=a.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${a.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${a.slice(5)}`}else a.startsWith("//")&&(a=`https:${a}`);return new URL(a)}this.lspError("MagicLinkToken.getUrl")}getAttribute(i){return i==="invalid"?P(this,t,ar).call(this):super.getAttribute(i)}},e=new WeakMap,t=new WeakSet,ar=function(){if(this.type==="magic-link"){const{link:i}=this;if(i.startsWith("ISBN")){const n=[...i.slice(5)].map(a=>a==="X"?10:Number(a));return n.length===10?n.reduce((a,o,d)=>a+o*(10-d),0)%11!==0:n.length===13&&(n[12]===10||n.reduce((a,o,d)=>a+o*(d%2?3:1),0)%10!==0)}}return!1},r)}}),Gn,$i,Vn,ct,$a=N({"src/extLink.ts"(){"use strict";var e,t;Ze(),K(),We(),J(),Q(),Fr(),Gn=[Pe("[")],ct=(t=class extends(Vn=H){constructor(r,l="",i="",n,a=[]){super(void 0,n,a,{});O(this,e);const o=r&&/^\0\d+f\x7F$/u.test(r)?a[Number(r.slice(1,-2))]:new ns(r,"ext-link-url",n,a);if(this.insertAt(o),R(this,e,l),i){const d=new H(i,n,a,{});d.type="ext-link-text",d.setAttribute("stage",Se-1),this.insertAt(d)}}get type(){return"ext-link"}toString(r){return this.length===1?`[${super.toString(r)}${x(this,e)}]`:`[${super.toString(r,x(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return x(this,e).length}lint(r=this.getAbsoluteIndex(),l){const i=super.lint(r,l),n="var-anchor",a=I.lintConfig.getSeverity(n,"extLink");return a&&this.length===1&&this.closest("heading-title")&&i.push(te(this,{start:r},n,"variable anchor in a section header",a)),i}print(){return super.print(this.length===1?{pre:"[",post:`${x(this,e)}]`}:{pre:"[",sep:x(this,e),post:"]"})}},e=new WeakMap,t),$i=re(Vn),ct=le($i,0,"ExtLinkToken",Gn,ct),ne($i,1,ct)}}),or,rd=N({"src/imagemapLink.ts"(){"use strict";Q(),ze(),Aa(),$a(),or=class extends H{get type(){return"imagemap-link"}constructor(e,t,s,r,l=[]){super(void 0,r,l),this.append(e,t.length===2?new Lr(...t,r,l):new ct(...t,r,l),new pe(s,r,l))}}}}),ka={};ie(ka,{ImagemapToken:()=>Dt});var Qn,ki,Jn,Dt,nd=N({"src/imagemap.ts"(){"use strict";K(),we(),ce(),Cr(),J(),Q(),ze(),wa(),rd(),Qn=[Os],Dt=class extends(Jn=H){get type(){return"ext-inner"}get image(){return this.childNodes.find(Ws("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const r=e.split(`
13
- `),l=new Set(t.protocol.split("|")),i=pe;let n=!0,a=!1;for(const o of r){const d=o.trim();if(!(a||!d||d.startsWith("#"))){if(n){const u=o.indexOf("|"),h=u===-1?o:o.slice(0,u),{valid:p,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(p&&c===6){const m=new ht("imagemap",h,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(m),n=!1;continue}else a=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),h=o.slice(u),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new or(o.slice(0,u),p.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||l.has(h.slice(1,h.indexOf(":")+1))||l.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new or(o.slice(0,u),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new i(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e),{childNodes:l,image:i}=this,n="invalid-imagemap",a=I.lintConfig.getSeverity(n,i?"link":"image");return a&&(i?s.push(...l.filter(o=>{const d=o.toString().trim();return o.is("noinclude")&&d&&!d.startsWith("#")}).map(o=>{const d=X(o,r,n,"invalid link in <imagemap>",a);return d.suggestions=[{desc:"remove",range:[d.startIndex-1,d.endIndex],text:""},{desc:"comment",range:[d.startIndex,d.startIndex],text:"# "}],d})):s.push(te(this,r,n,"<imagemap> without an image",a))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},ki=re(Jn),Dt=le(ki,0,"ImagemapToken",Qn,Dt),ne(ki,1,Dt)}}),Xn,_i,Kn,gt,_a=N({"src/nowiki/comment.ts"(){"use strict";K(),At(),We(),J(),st(),Xn=[et(!1),Pe("<!--")],gt=class extends(Kn=Me){constructor(t,s,r,l){super(t,r,l);ke(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",r=I.lintConfig.getSeverity(s);if(!r)return[];const l=te(this,{start:t},s,I.msg("unclosed $1","HTML comment"),r);return l.suggestions=[{desc:"close",range:[l.endIndex,l.endIndex],text:"-->"}],[l]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},_i=re(Kn),gt=le(_i,0,"CommentToken",Xn,gt),ne(_i,1,gt)}}),Ca={};ie(Ca,{CommentedToken:()=>Ia});var Ia,ld=N({"src/commented.ts"(){"use strict";Q(),_a(),Ia=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let r=e.indexOf("<!--"),l=r!==-1&&e.indexOf("-->",r+4),i=0;for(;l!==!1&&l!==-1;)r>i&&this.insertAt(e.slice(i,r)),this.insertAt(new gt(e.slice(r+4,l),!0,t,s)),i=l+3,r=e.indexOf("<!--",i),l=r!==-1&&e.indexOf("-->",r+4);i<e.length&&this.insertAt(e.slice(i))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ta={};ie(Ta,{NowikiToken:()=>Na});var Yn,Zn,Na,ad=N({"src/nowiki/index.ts"(){"use strict";var e,dr,s;St(),K(),J(),st(),Yn=Xe(r=>new RegExp(String.raw`<\s*(?:/\s*)${r==="nowiki"?"":"?"}(${r})\b`,"giu")),Zn=new Set(["img","languages","section","templatestyles"]),Na=(s=class extends Me{constructor(){super(...arguments);O(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:i}=this,n="void-ext",a=I.lintConfig.getSeverity(n,i);if(a&&P(this,e,dr).call(this)){const o=te(this,{start:l},n,I.msg("nothing should be in <$1>",i),a);return o.fix={desc:"empty",range:[l,o.endIndex],text:""},[o]}return super.lint(l,Yn(i))}getAttribute(l){return l==="invalid"?P(this,e,dr).call(this):super.getAttribute(l)}},e=new WeakSet,dr=function(){const{name:l,firstChild:{data:i}}=this;return Zn.has(l)&&!!i},s)}}),el,Ci,tl,pt,La=N({"src/tagPair/ext.ts"(){"use strict";K(),ce(),J(),Sr(),Q(),yr(),_r(),el=[Ps()],pt=class extends(tl=Je){get type(){return"ext"}constructor(e,t,s,r,l=I.getConfig(),i=!1,n=[]){const a=e.toLowerCase(),o=new Es(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,l,n),d={...l,ext:l.ext.filter(h=>h!==a),excludes:[...l.excludes]};let u;switch(d.inExt=!0,a){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"&&d.excludes.push("heading"),u=new H(s,d,n);break;case"pre":{const{PreToken:h}=(Xo(),ee(ia));u=new h(s,d,n);break}case"dynamicpagelist":{const{ParamTagToken:h}=(la(),ee(na));u=new h(i,s,d,n);break}case"inputbox":{const{InputboxToken:h}=(td(),ee(ca));u=new h(i,s,d,n);break}case"references":{const{NestedToken:h}=(xi(),ee(ks));d.excludes.push("heading"),u=new h(s,i,["ref"],d,n);break}case"choose":{const{NestedToken:h}=(xi(),ee(ks));u=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,n);break}case"combobox":{const{NestedToken:h}=(xi(),ee(ks));u=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,n);break}case"gallery":{const{GalleryToken:h}=(id(),ee(ya));u=new h(s,d,n);break}case"imagemap":{const{ImagemapToken:h}=(nd(),ee(ka));u=new h(s,d,n);break}case"hiero":{const{CommentedToken:h}=(ld(),ee(Ca));u=new h(s,d,n);break}default:{const{NowikiToken:h}=(ad(),ee(Ta));u=new h(s,d,n)}}u.setAttribute("name",a),u.type==="plain"&&(u.type="ext-inner"),super(e,o,u,r,l,n),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),a="parsing-order",o=n&&I.lintConfig.getSeverity(a,n===2?"ext":"templateInTable");o&&s.push(te(this,r,a,"extension tag in HTML tag attributes",o))}const l="var-anchor",i=I.lintConfig.getSeverity(l,"ref");return i&&this.name==="ref"&&this.closest("heading-title")&&s.push(te(this,r,l,"variable anchor in a section header",i)),s}},Ci=re(tl),pt=le(Ci,0,"ExtToken",el,pt),ne(Ci,1,pt)}}),Fa={};ie(Fa,{parseCommentAndExt:()=>as});var Ii,sl,ms,il,Ti,as,Bs=N({"parser/commentAndExt.ts"(){"use strict";St(),he(),Go(),ze(),Vo(),Qo(),La(),_a(),Ii="<onlyinclude>",sl="</onlyinclude>",{length:ms}=Ii,il=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Dl(r=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${r.filter(l=>l!=="img").join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))${r.includes("img")?String.raw`|<img(\s[^>]*?)?(/?)>`:""}`,"giu"))}),Ti=e=>{const t=e.indexOf(Ii);return{i:t,j:e.indexOf(sl,t+ms)}},as=(e,t,s,r)=>{if(r){let{i:a,j:o}=Ti(e);if(a!==-1&&o!==-1){let d="";const u=h=>{new pe(h,t,s),d+=`\0${s.length-1}n`};for(;a!==-1&&o!==-1;){const h=`\0${s.length}e`;new Bt(e.slice(a+ms,o),t,s),a>0&&u(e.slice(0,a)),d+=h,e=e.slice(o+ms+1),{i:a,j:o}=Ti(e)}return e&&u(e),d}}const{ext:l}=t,i=l.filter(a=>a!=="translate"&&a!=="tvar"),n={...t,ext:i};if(l.includes("translate")){const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,o=>(a.push(o),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(o,d,u)=>{const h=s.length;return new Zl(d,u&&Re(u,a),n,s),`\0${h}g`}),e=Re(e,a)}return e.replace(il[r?1:0](i),(a,o,d,u,h,p,c,m,S,A,y)=>{const $=s.length;let f="n";if(o||i.includes("img")&&y!==void 0)f="e",new pt(o!=null?o:"img",o?d:A,u,o?h:y&&void 0,n,p,s);else if(a.startsWith("<!--")){f="c";const g=a.endsWith("-->");new gt(a.slice(4,g?-3:void 0),g,t,s)}else p?new Wt(p,c,m,S,t,s):new pe(a,t,s);return`\0${$}${f}`})}}}),rl,nl,ll,al,Ni,ol,Gt,od=N({"src/html.ts"(){"use strict";var e,t,s,r,l;K(),we(),ce(),Sr(),J(),Q(),rl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),ll=new Set(["strike","big","center","font","tt"]),al=[Ps()],Gt=(l=class extends(ol=H){constructor(n,a,o,d,u,h){super(void 0,u,h);O(this,e);O(this,t);O(this,s);O(this,r);this.insertAt(a),this.setAttribute("name",n.toLowerCase()),R(this,e,o),R(this,t,d),R(this,s,n)}get type(){return"html"}get selfClosing(){return x(this,t)}get closing(){return x(this,e)}toString(n){return`<${this.closing?"/":""}${x(this,s)}${super.toString(n)}${x(this,t)?"/":""}>`}text(){const{closing:n}=this,a=x(this,s)+(n?"":super.text());return`<${n?"/":""}${a}${x(this,t)?"/":""}>`}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:n==="padding"?x(this,s).length+(this.closing?2:1):super.getAttribute(n)}lint(n=this.getAbsoluteIndex(),a){const o=super.lint(n,a),{name:d,parentNode:u,closing:h,selfClosing:p}=this,c=new de(this,n),m=this.inTableAttrs();let S="h1",A=I.lintConfig.getSeverity(S,"html");if(A&&d==="h1"&&!h){const b=te(this,c,S,"<h1>",A);b.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}],o.push(b)}if(S="parsing-order",A=m&&I.lintConfig.getSeverity(S,m===2?"html":"templateInTable"),A){const b=te(this,c,S,"HTML tag in table attributes",A);m===2&&(b.fix={desc:"remove",range:[n,b.endIndex],text:""}),o.push(b)}S="obsolete-tag",A=I.lintConfig.getSeverity(S,d),A&&ll.has(d)&&o.push(te(this,c,S,"obsolete HTML tag",A)),S="bold-header",A=I.lintConfig.getSeverity(S,d),A&&(d==="b"||d==="strong")&&this.closest("heading-title")&&o.push(te(this,c,S,"bold in section header",A));const{html:[,y,$]}=this.getAttribute("config"),f=$.includes(d),g=y.includes(d),w=!f&&!g;if(S="unmatched-tag",h&&(p||f)||p&&w){if(A=I.lintConfig.getSeverity(S,h?"both":"selfClosing"),A){const b=te(this,c,S,h?"tag that is both closing and self-closing":"invalid self-closing tag",A),v={desc:"open",range:[n+1,n+2],text:""},k={desc:"no self-closing",range:[b.endIndex-2,b.endIndex-1],text:""};g?b.suggestions=[v,k]:h?b.fix=f?v:k:b.suggestions=[k,{desc:"close",range:[b.endIndex-2,b.endIndex],text:`></${d}>`}],o.push(b)}}else if(!this.findMatchingTag()){const b=te(this,c,S,h?"unmatched closing tag":"unclosed tag"),v=this.closest("magic-word");if(v&&rl.has(v.name))A=I.lintConfig.getSeverity(S,"conditional");else if(h)A=I.lintConfig.getSeverity(S,"closing"),b.suggestions=[{desc:"remove",range:[n,b.endIndex],text:""}];else{A=I.lintConfig.getSeverity(S,"opening");const k=u==null?void 0:u.childNodes;nl.has(d)&&(k!=null&&k.slice(0,k.indexOf(this)).some(({type:_,name:C})=>_==="html"&&C===d)&&(b.suggestions=[{desc:"close",range:[n+1,n+1],text:"/"}]),this.closest("heading-title")&&(b.rule="format-leakage",A=I.lintConfig.getSeverity("format-leakage",d)))}A&&(b.severity=A,o.push(b))}return o}findMatchingTag(){return Ke(x(this,r),()=>{const{name:n,parentNode:a,closing:o,selfClosing:d}=this,{html:[,u,h]}=this.getAttribute("config"),p=h.includes(n),c=u.includes(n);if(p||c&&d)return this;if(!a)return;const{childNodes:m}=a,S=m.indexOf(this),A=o?m.slice(0,S).reverse():m.slice(S+1),y=[this],{rev:$}=ve;for(const f of A)if(!(!f.is("html")||f.name!==n||c&&x(f,t)))if(x(f,e)===o)y.push(f);else{const g=y.pop();if(g===this)return f;I.viewOnly&&(R(g,r,[$,f]),R(f,r,[$,g]))}if(I.viewOnly)for(const f of y)R(f,r,[$,void 0])},n=>{R(this,r,n),n[1]&&n[1]!==this&&R(n[1],r,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${x(this,s)}`,post:`${x(this,t)?"/":""}&gt;`})}json(n,a=this.getAbsoluteIndex()){const o=super.json(void 0,a);return Object.assign(o,{closing:this.closing,selfClosing:x(this,t)}),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l),Ni=re(ol),Gt=le(Ni,0,"HtmlToken",al,Gt),ne(Ni,1,Gt)}}),ja={};ie(ja,{parseHtml:()=>Ra});var dl,Ra,dd=N({"parser/html.ts"(){"use strict";_r(),od(),dl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ra=(e,t,s)=>{var n;const{html:r}=t;(n=t.htmlElements)!=null||(t.htmlElements=new Set([...r[0],...r[1],...r[2]]));const l=e.split("<");let i=l.shift();for(const a of l){const o=dl.exec(a),d=o==null?void 0:o[2],u=d==null?void 0:d.toLowerCase();if(!o||!t.htmlElements.has(u)){i+=`<${a}`;continue}const[,h,,p="",c,m]=o,{length:S}=s,A=new Es(p,"html-attrs",u,t,s),y=A.hasAttr("itemprop");if(u==="meta"&&!(y&&A.hasAttr("content"))||u==="link"&&!(y&&A.hasAttr("href"))){i+=`<${a}`,s.length=S;continue}i+=`\0${s.length}x${m}`,new Gt(d,A,h==="/",c==="/>",t,s)}return i}}}),jr,Pa=N({"src/table/base.ts"(){"use strict";Sr(),Q(),$t(),_r(),jr=class extends Ps(1)(H){constructor(e,t,s,r,l,i=[],n){super(void 0,l,i,n),this.append(new tt(t,"table-syntax",l,i),new Es(r,"table-attrs",s,l,i))}}}}),ul,Li,Ne,xs,jt,Rt,Ts,Ea=N({"src/table/td.ts"(){"use strict";K(),ce(),wr(),J(),Q(),Pa(),Ts=class extends(Li=jr,ul=[Fs(!1)],Li){constructor(e,t,s,r=[]){var a;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(i)&&(l=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,r),ne(xs,5,this),je(this,jt),je(this,Ne,""),l&&([qo(this,Ne)._]=l);const n=new H(t==null?void 0:t.slice(((a=l==null?void 0:l.index)!=null?a:NaN)+ge(this,Ne).length),s,r);n.type="td-inner",n.setAttribute("stage",4),this.insertAt(n)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return ft(this,jt,Rt).call(this).subtype}afterBuild(){ge(this,Ne).includes("\0")&&Ce(this,Ne,this.buildFromStr(ge(this,Ne),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,r]}=this;return t.toString(e)+s.toString(e)+ge(this,Ne)+r.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ge(this,Ne)+s.text()}getGaps(e){return e===1?ge(this,Ne).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",i=["td","double"].map(n=>I.lintConfig.getSeverity(l,n));for(const n of this.lastChild.childNodes)if(n.type==="text"){const{data:a}=n;if(a.includes("|")){const o=a.includes("||"),d=i[o?1:0];if(d){const u=X(n,r,l,'additional "|" in a table cell',d);if(o){const h={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={desc:"newline",range:[u.startIndex,u.endIndex],text:a.replace(/\|\|/gu,`
14
- ${h}`)}}else u.suggestions=[{desc:"escape",range:[u.startIndex,u.endIndex],text:a.replace(/\|/gu,"&#124;")}];s.push(u)}}}return s}isIndependent(){return this.firstChild.text().startsWith(`
15
- `)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ge(this,Ne)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:r,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},r!==1&&{rowspan:r},l!==1&&{colspan:l}),s}},xs=re(Li),Ne=new WeakMap,jt=new WeakSet,Rt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let r="td";if(s==="!"?r="th":s==="+"&&(r="caption"),this.isIndependent())return{subtype:r};const{previousSibling:l}=this;return{...ft(e=l,jt,Rt).call(e)}},Rt=le(xs,17,"#getSyntax",ul,jt,Rt),Ls(xs,Ts)}}),Rr,Oa=N({"src/table/trBase.ts"(){"use strict";K(),J(),Pa(),Ea(),Rr=class extends jr{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=this.childNodes.find(({type:a})=>a==="table-inter");if(!r)return s;const l=Kt(r),i="fostered-content",n=l&&I.lintConfig.getSeverity(i,l===2?void 0:"transclusion");if(n){const a=X(r,{start:e},i,"content to be moved outside the table",n);a.startIndex++,a.startLine++,a.startCol=0,s.push(a)}return s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Ts&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),hl,cl,gl,pl,Fi,vs,_s,ud=N({"src/table/index.ts"(){"use strict";K(),we(),ce(),wr(),J(),Oa(),$t(),hl=(e,t)=>new Array(e).fill(void 0).map((s,r)=>t(r)),cl=({type:e})=>e==="tr"||e==="table-syntax",gl=class extends Array{},_s=class extends(Fi=Rr,pl=[Fs(!1)],Fi){constructor(e,t,s,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,r,{}),ne(vs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e),l=["unclosed-table","table-layout"],i=l.map(n=>I.lintConfig.getSeverity(n));if(i[0]&&!this.closed&&s.push(X(this.firstChild,r,l[0],I.msg("unclosed $1","table"),i[0])),i[1]){const n=this.getLayout(),{length:a}=n;if(a>1){let o=1,d=1/0,u=0;for(;u<a;u++){const h=n[u],p=h.length;if(p<o)break;p<d&&(d=p);const c=h.indexOf(h[p-1])+1;if(c>d)break;c>o&&(o=c)}if(u<a){const h=this.getNthRow(u),p=X(h,r,l[1],"inconsistent table layout",i[1]);p.startIndex++,p.startLine++,p.startCol=0,s.push(p)}}}return s}close(e=`
16
- |}`,t){const s=this.getAttribute("config"),r=this.getAttribute("accum"),l=[e];ve.run(()=>{const i=new tt(void 0,"table-syntax",s,r);super.insertAt(i)}),this.lastChild.safeReplaceChildren(l)}getLayout(e){const t=this.getAllRows(),{length:s}=t,r=gl.from(hl(s,()=>[]));for(let l=0;l<r.length;l++){const i=r[l];let n=0,a=0,o;for(const d of t[l].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(o=d.subtype!=="caption"),o){const u={row:l,column:n},{rowspan:h,colspan:p}=d;for(n++;i[a];)a++;for(let c=l;c<Math.min(l+h,s);c++)for(let m=a;m<a+p;m++)r[c][m]=u;a+=p}}else if(cl(d))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const r=super.getRowCount();if(e===0&&r)return this;r&&e--;for(const l of this.childNodes.slice(2)){const{type:i}=l;if(i==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},vs=re(Fi),le(vs,1,"getLayout",pl,_s),Ls(vs,_s)}}),qa,hd=N({"src/table/tr.ts"(){"use strict";Oa(),qa=class extends Rr{get type(){return"tr"}constructor(e,t,s,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,r)}}}}),Pr,Ba=N({"src/nowiki/listBase.ts"(){"use strict";st(),Pr=class extends Me{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:r}=this;return r&&(s.indent=r),s}}}}),Er,Wa=N({"src/nowiki/dd.ts"(){"use strict";Ba(),Er=class extends Pr{get type(){return"dd"}}}}),Ua={};ie(Ua,{parseTable:()=>Ma});var fl,ji,Ma,cd=N({"parser/table.ts"(){"use strict";Q(),ud(),hd(),Ea(),Wa(),fl=e=>e.lastChild.constructor!==H,ji=(e,t)=>e.is("td")?t.pop():e,Ma=({firstChild:{data:e},type:t,name:s},r,l)=>{const i=[],n=e.split(`
17
- `);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${n.shift()}`,o;const d=(u,h)=>{if(!h){a+=u;return}const{lastChild:p}=h;if(fl(h)){const c=new H(u,r,l);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else p.setText(p.toString()+u)};for(const u of n){o=i.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),p=u.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(c){for(;o&&!o.is("td");)o=i.pop();const[,f,g,w,b]=c;f&&new Er(f,r,l),d(`
19
- ${h}${f&&`\0${l.length-1}d`}${g}\0${l.length}b`,o),i.push(...o?[o]:[],new _s(w,b,r,l));continue}else if(!o){a+=`
20
- ${u}`;continue}const m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!m){d(`
21
- ${u}`,o),i.push(o);continue}const[,S,A,y,$]=m;if(S){for(;!o.is("table");)o=i.pop();o.close(`
22
- ${h}${S}`,!0),d($,i[i.length-1])}else if(A){o=ji(o,i),o.is("tr")&&(o=i.pop());const f=new qa(`
23
- ${h}${A}`,$,r,l);i.push(o,f),o.insertAt(f)}else{o=ji(o,i);const f=y==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let g=f.exec($),w=0,b=`
24
- ${h}${y}`;const v=k=>{const _=new Ts(b,$.slice(w,g==null?void 0:g.index),r,l);return k.insertAt(_),_};for(;g;)v(o),{lastIndex:w}=f,[b]=g,g=f.exec($);i.push(o,v(o))}}return a.slice(1)}}}),za,gd=N({"src/nowiki/hr.ts"(){"use strict";st(),za=class extends Me{get type(){return"hr"}}}}),ml,Ri,xl,Vt,pd=N({"src/nowiki/doubleUnderscore.ts"(){"use strict";At(),We(),st(),ml=[et(),Pe("__")],Vt=class extends(xl=Me){get type(){return"double-underscore"}constructor(e,t,s,r){var a,o;super(e,s,r);const l=e.toLowerCase(),{doubleUnderscore:[,,i,n]}=s;this.setAttribute("name",(o=t?(a=n==null?void 0:n[e])==null?void 0:a.toLowerCase():i==null?void 0:i[l])!=null?o:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Ri=re(xl),Vt=le(Ri,0,"DoubleUnderscoreToken",ml,Vt),ne(Ri,1,Vt)}}),Ha={};ie(Ha,{parseHrAndDoubleUnderscore:()=>Da});var Da,fd=N({"parser/hrAndDoubleUnderscore.ts"(){"use strict";gd(),pd(),aa(),Da=({firstChild:{data:e},type:t,name:s},r,l)=>{var o,d,u;const{doubleUnderscore:[i,n,a]}=r;return(o=r.insensitiveDoubleUnderscore)!=null||(r.insensitiveDoubleUnderscore=new Set(i)),(d=r.sensitiveDoubleUnderscore)!=null||(r.sensitiveDoubleUnderscore=new Set(n)),(u=r.regexHrAndDoubleUnderscore)!=null||(r.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...n].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,p,c)=>(new za(c,r,l),`${p}\0${l.length-1}r`)).replace(r.regexHrAndDoubleUnderscore,(h,p)=>{var A;const c=r.sensitiveDoubleUnderscore.has(p),m=p.toLowerCase(),S=r.insensitiveDoubleUnderscore.has(m);return c||S?(new Vt(p,c,r,l),`\0${l.length-1}${S&&((A=a==null?void 0:a[m])!=null?A:m)==="toc"?"u":"n"}`):h}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(h,p,c,m,S)=>{const A=`${p}\0${l.length}h`;return new Ir(c.length,[m,S],r,l),A}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ga,md=N({"src/nowiki/quote.ts"(){"use strict";var e,t;K(),ce(),J(),st(),Ga=(t=class extends Me{constructor(r,l,i,n){super(r,i,n);O(this,e);R(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:x(this,e).bold}:void 0,...this.italic?{italic:x(this,e).italic}:void 0}}text(){const{parentNode:r,innerText:l}=this;return r!=null&&r.is("image-parameter")&&r.name!=="caption"?"":l}lint(r=this.getAbsoluteIndex()){const{previousSibling:l,bold:i,closing:n}=this,a=(l==null?void 0:l.type)==="text"?l.data:void 0,o=[],d=new de(this,r),u=["lonely-apos","bold-header"],h=[void 0,"word"].map(c=>I.lintConfig.getSeverity(u[0],c)),p=I.lintConfig.getSeverity(u[1]);if(a!=null&&a.endsWith("'")){const c=h[(n.bold||n.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(c){const m=te(this,d,u[0],I.msg('lonely "$1"',"'"),c),{startIndex:S,startLine:A,startCol:y}=m,[,{length:$}]=/(?:^|[^'])('+)$/u.exec(a),f=r-$;o.push({...m,startIndex:f,endIndex:S,endLine:A,startCol:y-$,endCol:y,suggestions:[{desc:"escape",range:[f,S],text:"&apos;".repeat($)},{desc:"remove",range:[f,S],text:""}]})}}if(p&&i&&this.closest("heading-title")){const c=te(this,d,u[1],"bold in section header",p);c.suggestions=[{desc:"remove",range:[r,r+3],text:""}],o.push(c)}return o}json(r,l=this.getAbsoluteIndex()){const i=super.json(void 0,l);return Object.assign(i,{bold:this.bold,italic:this.italic}),i}},e=new WeakMap,t)}}),Va={};ie(Va,{parseQuotes:()=>Or});var Or,Qa=N({"parser/quotes.ts"(){"use strict";md(),Or=(e,t,s,r)=>{var c;const l=e.split(/('{2,})/u),{length:i}=l;if(i===1)return e;let n=0,a=0,o,d,u;for(let m=1;m<i;m+=2){const S=l[m].length;switch(S){case 2:a++;break;case 4:l[m-1]+="'",l[m]="'''";case 3:if(n++,o!==void 0)break;l[m-1].endsWith(" ")?d===void 0&&u===void 0&&(u=m):l[m-1].slice(-2,-1)===" "?o=m:d!=null||(d=m);break;default:l[m-1]+="'".repeat(S-5),l[m]="'''''",a++,n++}}if(a%2===1&&n%2===1){const m=(c=o!=null?o:d)!=null?c:u;m!==void 0&&(l[m]="''",l[m-1]+="'")}let h=!0,p=!0;for(let m=1;m<i;m+=2){const S=l[m].length,A=S!==2,y=S!==3;A&&(h=!h),y&&(p=!p),new Ga(l[m],{bold:A&&h,italic:y&&p},t,s),l[m]=`\0${s.length-1}q`}return l.join("")}}}),Ja={};ie(Ja,{parseExternalLinks:()=>qr});var qr,Xa=N({"parser/externalLinks.ts"(){"use strict";he(),$a(),Fr(),qr=(e,t,s,r)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${mt}|\0\d+m\x7F)${xt}(?=[[\]<>"\t${Be}]|\0\d))([${Be}]*(?![${Be}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,n,a,o)=>{const{length:d}=s,u=/&[lg]t;/u.exec(n);return u&&(a="",o=n.slice(u.index)+a+o,n=n.slice(0,u.index)),r?(new ns(n,"ext-link-url",t,s),`[\0${d}f${a}${o}]`):(new ct(n,a,o,t,s),`\0${d}w`)})}}}),Ka,xd=N({"src/link/category.ts"(){"use strict";he(),js(),Ka=class extends qe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&ss(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:r}=this;return r&&(s.sortkey=r),s}}}}),Ya={};ie(Ya,{parseLinks:()=>ur});var vl,ur,vd=N({"parser/links.ts"(){"use strict";J(),Qa(),Xa(),Aa(),ba(),xd(),vl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,ur=(e,t,s,r)=>{var a;(a=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=e.split("[[");let n=i.shift();for(let o=0;o<i.length;o++){let d=!1,u,h,p,c;const m=i[o],S=l.exec(m);if(S)[,u,h,p,c]=S,c.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",c=c.slice(1));else{const g=vl.exec(m);g&&(d=!0,[,u,h,p]=g)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){n+=`[[${m}`;continue}const A=u.trim().startsWith(":");if(A&&d){n+=`[[${m}`;continue}const{ns:y,valid:$}=I.normalizeTitle(u,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if($){if(d){if(y!==6){n+=`[[${m}`;continue}let g=!1;for(o++;o<i.length;o++){const w=i[o],b=w.split("]]");if(b.length>2){g=!0,p+=`[[${b[0]}]]${b[1]}`,c=b.slice(2).join("]]");break}else if(b.length===2)p+=`[[${b[0]}]]${b[1]}`;else{p+=`[[${w}`;break}}if(p=ur(p,t,s,r),!g){n+=`[[${u}${h}${p}`;continue}}}else{n+=`[[${m}`;continue}p&&(p=Or(p,t,s,r));let f=Lr;A||(y===6?(p&&(p=qr(p,t,s,!0)),f=Nr):y===14&&(f=Ka)),p===void 0&&h&&(p=""),n+=`\0${s.length}l${c}`,new f(u,p,t,s,h)}return n}}}),Za={};ie(Za,{parseMagicLinks:()=>eo});var Pi,Ei,Oi,qi,eo,bd=N({"parser/magicLinks.ts"(){"use strict";he(),Fr(),Pi=String.raw`[${Be}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Ei=`(?:${Pi})+`,Oi=`(?:${Pi}|-)`,qi=String.raw`(?:RFC|PMID)${Ei}\d+\b|ISBN${Ei}(?:97[89]${Oi}?)?(?:\d${Oi}?){9}[\dx]\b`,eo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${mt}${xt})|${qi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${mt}${xt})|${qi})`,"giu")}return e.replace(t.regexMagicLinks,(r,l,i)=>{let n=l?r.slice(l.length):r;if(i){let a="";const o=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(n);o&&(a=n.slice(o.index),n=n.slice(0,o.index));const d=n.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(n);if(u){let h=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(n.slice(0,u.index))&&(h=2),a=n.slice(u.index+h)+a,n=n.slice(0,u.index+h)}return a.length>=i.length?r:(new ns(n,void 0,t,s),`${l}\0${s.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(n))return r;return new ns(n,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),to,wd=N({"util/html.ts"(){"use strict";to=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,r)=>s!==e[r])}}),so,yd=N({"src/nowiki/list.ts"(){"use strict";Ba(),so=class extends Pr{get type(){return"list"}}}}),io={};ie(io,{parseList:()=>ro});var ro,Sd=N({"parser/list.ts"(){"use strict";wd(),yd(),Wa(),ro=(e,t,s,r)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[i,n,a,o]=l,d=a.replace(/;/gu,":"),u=to(d,t.lastPrefix),h=((u>1?a.slice(u-1):a)+o).split(/(?=;)/u),p=h[0].startsWith(";");let c=h.length-(p?0:1);if(u>1){const C=a.slice(0,u-1);if(p){const E=C.split(/(?=;)/u);h.unshift(...E),c+=C.includes(";")?E.length:0}else h[0]=C+h[0]}t.lastPrefix=d;let m=n+h.map((C,E)=>`\0${r.length+E}d`).join("")+e.slice(i.length);for(const C of h)new so(C,s,r);if(!c)return m;const{html:[S,,A]}=s,y=/:+|-\{|\0\d+[xq]\x7F/gu;let $=y,f=$.exec(m),g=0,w=!1,b=!1,v=0;const k=(C,E)=>(new Er(C,s,r),`${m.slice(0,E)}\0${r.length-1}d${m.slice(E+C.length)}`),_=C=>{C?g&&g--:g++};for(;f&&c;){const{0:C,index:E}=f;if(C==="-{"){if(!v){const{lastIndex:T}=$;$=/-\{|\}-/gu,$.lastIndex=T}v++}else if(C==="}-"){if(v--,!v){const{lastIndex:T}=$;$=y,$.lastIndex=T}}else if(C.endsWith("x")){const{name:T,closing:L,selfClosing:B}=r[Number(C.slice(1,-2))];(S.includes(T)||!B&&!A.includes(T))&&_(L)}else if(C.endsWith("q")){const{bold:T,italic:L}=r[Number(C.slice(1,-2))];T&&(_(w),w=!w),L&&(_(b),b=!b)}else if(g===0){if(C.length>=c)return k(C.slice(0,c),E);c-=C.length,$.lastIndex=E+4+String(r.length).length,m=k(C,E)}f=$.exec(m)}return m}}}),bs,bl,Bi,wl,Qt,Ad=N({"src/converterFlags.ts"(){"use strict";var e,t;K(),ce(),Rs(),J(),Q(),Ue(),bs=new Set(["A","T","R","D","-","H","N"]),bl=[ls()],Qt=(t=class extends(wl=H){constructor(r,l,i=[]){super(void 0,l,i,{});O(this,e);this.safeAppend(r.map(n=>new be(n,"converter-flag",l,i)))}get type(){return"converter-flags"}afterBuild(){R(this,e,this.childNodes.map(r=>r.text().trim())),super.afterBuild()}toString(r){return super.toString(r,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(x(this,e).filter(r=>/\{{3}[^{}]+\}{3}/u.test(r)))}getVariantFlags(){const r=new Set(this.getAttribute("config").variants);return new Set(x(this,e).filter(l=>r.has(l)))}isInvalidFlag(r,l,i,n){return typeof r=="object"&&(r=r.text().trim(),l=this.getVariantFlags(),i=this.getUnknownFlags(),n=new Set(x(this,e).filter(a=>bs.has(a)))),!!r&&!l.has(r)&&!i.has(r)&&(l.size>0||!n.has(r))}lint(r=this.getAbsoluteIndex(),l){const i=this.getVariantFlags(),n=this.getUnknownFlags(),a=new Set(x(this,e).filter(c=>bs.has(c))),o=x(this,e).filter(c=>!c).length,d=x(this,e).length-n.size-o,u=super.lint(r,l);if(i.size===d||a.size===d)return u;const h="no-ignored",p=I.lintConfig.getSeverity(h,"conversionFlag");if(p){const c=new de(this,r);for(let m=0;m<this.length;m++){const S=this.childNodes[m],A=S.text().trim();if(this.isInvalidFlag(A,i,n,a)){const y=X(S,c,h,"invalid conversion flag",p);i.size===0&&bs.has(A.toUpperCase())?y.fix={desc:"uppercase",range:[y.startIndex,y.endIndex],text:A.toUpperCase()}:y.suggestions=[{desc:"remove",range:[y.startIndex-(m&&1),y.endIndex],text:""}],u.push(y)}}}return u}print(){return super.print({sep:";"})}},e=new WeakMap,t),Bi=re(wl),Qt=le(Bi,0,"ConverterFlagsToken",bl,Qt),ne(Bi,1,Qt)}}),Cs,$d=N({"src/converterRule.ts"(){"use strict";J(),Q(),Ue(),Cs=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=I.getConfig(),r=[]){super(void 0,s,r);const l=e.indexOf(":"),i=e.slice(0,l).indexOf("=>"),n=i===-1?e.slice(0,l):e.slice(i+2,l);t&&s.variants.includes(n.trim().toLowerCase())?(super.insertAt(new be(n,"converter-rule-variant",s,r)),super.insertAt(new be(e.slice(l+1),"converter-rule-to",s,r)),i!==-1&&super.insertAt(new be(e.slice(0,i),"converter-rule-from",s,r),0)):super.insertAt(new be(e,"converter-rule-to",s,r))}toString(e){const{childNodes:t,firstChild:s,lastChild:r}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${r.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,r]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),yl,Wi,Sl,Jt,kd=N({"src/converter.ts"(){"use strict";he(),We(),Q(),Ad(),$d(),yl=[Pe("-{")],Jt=class extends(Sl=H){get type(){return"converter"}constructor(e,t,s,r=[]){super(void 0,s,r),this.insertAt(new Qt(e,s,r));const[l]=t,i=l.includes(":"),n=new Cs(l,i,s,r);i&&n.length===1||!i&&t.length===2&&!Ie(t[1]).trim()?this.insertAt(new Cs(t.join(";"),!1,s,r)):this.append(n,...t.slice(1).map(a=>new Cs(a,!0,s,r)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(r=>r.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${bt(t,{sep:";"})}}-</span>`}},Wi=re(Sl),Jt=le(Wi,0,"ConverterToken",yl,Jt),ne(Wi,1,Jt)}}),no={};ie(no,{parseConverter:()=>lo});var lo,_d=N({"parser/converter.ts"(){"use strict";kd(),lo=(e,t,s)=>{var o;(o=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const r=/-\{/gu,l=/-\{|\}-/gu,i=[];let n=r,a=n.exec(e);for(;a;){const{0:d,index:u}=a;if(d==="}-"){const h=i.pop(),{length:p}=s,c=e.slice(h.index+2,u),m=c.indexOf("|"),[S,A]=m===-1?[[],c]:[c.slice(0,m).split(";"),c.slice(m+1)],y=A.replace(/(&[#a-z\d]+);/giu,"$1"),$=y.split(t.regexConverter).map(f=>f.replace(/\x01/gu,";"));new Jt(S,$,t,s),e=`${e.slice(0,h.index)}\0${p}v${e.slice(u+2)}`,i.length===0&&(n=r),n.lastIndex=h.index+3+String(p).length}else i.push(a),n=l,n.lastIndex=u+2;a=n.exec(e)}return e}}}),Zt={};ie(Zt,{Token:()=>H});var Al,H,Q=N({"src/index.ts"(){"use strict";var e,t,s,r,l,i,n,a,ao,oo,uo,ho,co,go,po,fo,mo,xo,vo,bo,g;he(),Ze(),K(),we(),J(),Uo(),Mo(),Al=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(g=class extends Ql{constructor(v,k=I.getConfig(),_=[],C){super();O(this,a);O(this,e,"plain");O(this,t,0);O(this,s);O(this,r);O(this,l);O(this,i,!1);O(this,n);typeof v=="string"&&this.insertAt(v),R(this,s,k),R(this,r,_),_.push(this)}get type(){return x(this,e)}set type(v){R(this,e,v)}parseOnce(v=x(this,t),k=!1,_){if(v<x(this,t)||this.length===0||!this.isPlain())return this;if(x(this,t)>=Se)return this;switch(v){case 0:if(this.type==="root"){x(this,r).pop();const C=P(this,a,ao).call(this);k&&(k=!C)}R(this,l,k),P(this,a,oo).call(this,k);break;case 1:P(this,a,uo).call(this);break;case 2:P(this,a,ho).call(this);break;case 3:P(this,a,co).call(this);break;case 4:P(this,a,go).call(this);break;case 5:P(this,a,po).call(this,_);break;case 6:P(this,a,fo).call(this,_);break;case 7:P(this,a,mo).call(this);break;case 8:P(this,a,xo).call(this);break;case 9:P(this,a,vo).call(this);break;case 10:P(this,a,bo).call(this)}if(this.type==="root")for(const C of x(this,r))C==null||C.parseOnce(v,k,_);return Wr(this,t)._++,this}buildFromStr(v,k){const _=v.split(/[\0\x7F]/u).map((C,E)=>{if(E%2===0)return new sr(C);if(isNaN(C.slice(-1)))return x(this,r)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return k===0?_.map(String).join(""):k===1?Ye(_):_}build(){R(this,t,Se);const{length:v,firstChild:k}=this,_=k==null?void 0:k.toString();if(v===1&&k.type==="text"&&_.includes("\0")&&(Ns(this,0,1,this.buildFromStr(_)),this.normalize(),this.type==="root"))for(const C of x(this,r))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of x(this,r))v==null||v.afterBuild();R(this,i,!0)}parse(v=Se,k,_){for(v=Math.min(v,Se);x(this,t)<v;)this.parseOnce(x(this,t),k,_);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===g}getAttribute(v){var k;switch(v){case"config":return x(this,s);case"include":return(k=x(this,l))!=null?k:!!x(this.getRootNode(),l);case"accum":return x(this,r);case"built":return x(this,i);case"stage":return x(this,t);case"invalid":return this.type==="table-inter"&&Kt(this)===2;default:return super.getAttribute(v)}}setAttribute(v,k){switch(v){case"stage":x(this,t)===0&&this.type==="root"&&x(this,r).shift(),R(this,t,k);break;default:super.setAttribute(v,k)}}insertAt(v,k=this.length){const _=typeof v=="string"?new sr(v):v;super.insertAt(_,k);const{type:C}=_;return C==="root"&&(_.type="plain"),_}normalizeTitle(v,k=0,_){return I.normalizeTitle(v,k,x(this,l),x(this,s),_)}inTableAttrs(){var v,k;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),k){var C;let _=super.lint(v,k);if(this.type==="root"){const E=new Map,T="no-duplicate",L=["category","id"].map(q=>I.lintConfig.getSeverity(T,q)),B=Al.filter((q,M)=>L[M]).join();if(B){for(const q of this.querySelectorAll(B)){let M;if(q.is("category"))M=q.name;else{const D=q.getValue();D&&D!==!0&&(M=`#${D}`)}if(M){const D=E.get(M);D?D.add(q):E.set(M,new Set([q]))}}for(const[q,M]of E)if(M.size>1&&!q.startsWith("#mw-customcollapsible-")){const D=!q.startsWith("#"),G=`duplicated ${D?"category":"id"}`,Z=L[D?0:1];_.push(...[...M].map(Y=>{const se=te(Y,{start:Y.getAbsoluteIndex()},T,G,Z);return D&&(se.suggestions=[{desc:"remove",range:[se.startIndex,se.endIndex],text:""}]),se}))}}const j=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,F=this.toString(),U=[];let W=j.exec(F);for(;W;){const{1:q,index:M}=W,D=(C=W[2])==null?void 0:C.trim();U.push({line:this.posFromIndex(M).top+(q==="disable-line"?0:1),from:q==="disable"?j.lastIndex:void 0,to:q==="enable"?j.lastIndex:void 0,rules:D?new Set(D.split(",").map(G=>G.trim())):void 0}),W=j.exec(F)}if(_=_.filter(({rule:q,startLine:M,startIndex:D})=>{const G={pos:0};for(const{line:Z,from:Y,to:se,rules:ue}of U){if(Z>M+1)break;if(ue&&!ue.has(q))continue;if(Z===M&&Y===void 0&&se===void 0)return!1;Y<=D&&Y>G.pos?(G.pos=Y,G.type="from"):se<=D&&se>G.pos&&(G.pos=se,G.type="to")}return G.type!=="from"}),_.some(({fix:q})=>q)){const q=_.map(({fix:G})=>G).filter(Boolean).sort(({range:[G,Z]},{range:[Y,se]})=>Z===se?Y-G:se-Z);let M=1/0,D=F;for(const{range:[G,Z],text:Y}of q)Z<=M&&(D=D.slice(0,G)+Y+D.slice(Z),M=G);Object.assign(_,{output:D})}}return _}toString(v,k){return v?super.toString(!0,k):Ke(x(this,n),()=>super.toString(!1,k),_=>{const C=this.getRootNode();C.type==="root"&&x(C,i)&&R(this,n,_)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakSet,ao=function(){const{parseRedirect:v}=(Do(),ee(Kl)),k=this.firstChild.toString(),_=v(k,x(this,s),x(this,r));return _&&this.setText(_),!!_},oo=function(v){const{parseCommentAndExt:k}=(Bs(),ee(Fa));this.setText(k(this.firstChild.toString(),x(this,s),x(this,r),v))},uo=function(){const{parseBraces:v}=(Tr(),ee(ha)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,_=v(k,x(this,s),x(this,r));this.setText(this.type==="root"?_:_.slice(1))},ho=function(){if(x(this,s).excludes.includes("html"))return;const{parseHtml:v}=(dd(),ee(ja));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},co=function(){if(x(this,s).excludes.includes("table"))return;const{parseTable:v}=(cd(),ee(Ua));this.setText(v(this,x(this,s),x(this,r)))},go=function(){if(x(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(fd(),ee(Ha));this.setText(v(this,x(this,s),x(this,r)))},po=function(v){const{parseLinks:k}=(vd(),ee(Ya));this.setText(k(this.firstChild.toString(),x(this,s),x(this,r),v))},fo=function(v){if(x(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(Qa(),ee(Va)),_=this.firstChild.toString().split(`
25
- `);for(let C=0;C<_.length;C++)_[C]=k(_[C],x(this,s),x(this,r),v);this.setText(_.join(`
26
- `))},mo=function(){if(x(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Xa(),ee(Ja));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},xo=function(){if(x(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(bd(),ee(Za));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},vo=function(){if(x(this,s).excludes.includes("list"))return;const{parseList:v}=(Sd(),ee(io)),{firstChild:k,type:_,name:C}=this,E=k.toString().split(`
27
- `),T={lastPrefix:""};let L=_==="root"||_==="ext-inner"&&C==="poem"?0:1;for(;L<E.length;L++)E[L]=v(E[L],T,x(this,s),x(this,r));this.setText(E.join(`
28
- `))},bo=function(){if(x(this,s).variants.length>0){const{parseConverter:v}=(_d(),ee(no));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))}},g)}}),ve,Ws,Ns,kt,we=N({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(Q(),ee(Zt)),r=e();return r instanceof s&&!r.getAttribute("built")&&r.afterBuild(),this.running=t,r}catch(s){throw this.running=t,s}},rev:0},Ws=e=>t=>t.type===e,Ns=(e,t,s,r=[])=>{var n,a;let l=e.getChildNodes(),i;l.length===s?(i=l,l=r):i=l.splice(t,s,...r);for(let o=0;o<r.length;o++){const d=r[o];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",l[t+o+1]),d.setAttribute("previousSibling",l[t+o-1])}return(n=l[t-1])==null||n.setAttribute("nextSibling",l[t]),(a=l[t+r.length])==null||a.setAttribute("previousSibling",l[t+r.length-1]),l===r&&e.setAttribute("childNodes",l),i},kt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),$l,Pt,Ui,Mi,kl,zi,_l,hr,Cd=N({"lib/lintConfig.ts"(){"use strict";Ml(),$l=new Set([0,1,2]),Pt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Ui={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Ui),Mi=e=>typeof e=="number"&&$l.has(e),kl=e=>Mi(e)||Array.isArray(e)&&e.length===2&&Mi(e[0])&&e[1]&&typeof e[1]=="object",zi=(e,t,s)=>{if(vr.includes(t)){if(kl(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},_l=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Ui))),!!e)for(const[t,s]of Object.entries(e))zi(this,t,s)}getSeverity(e,t){var r;if(!(e in this))throw new RangeError(`Unknown rule: ${e}`);const s=this[e];return typeof s=="number"?Pt.get(s):t&&(r=Pt.get(s[1][t]))!=null?r:Pt.get(s[0])}},hr=e=>new Proxy(new _l(e),{set:zi})}}),wo={};ie(wo,{Title:()=>yo});var yo,Id=N({"lib/title.ts"(){"use strict";var e,t,s,r,l,i;he(),yo=(i=class{constructor(n,a,o,{temporary:d,decode:u,selfLink:h}={}){O(this,e);O(this,t);O(this,s);O(this,r);O(this,l);ke(this,"valid");ke(this,"encoded",!1);const p=n.trim().startsWith("../");if(u&&n.includes("%"))try{const m=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=es(n),this.encoded=m}catch{}if(n=ss(n).replace(/[_ ]+/gu," ").trim(),p)R(this,r,0);else{let m=a;n.startsWith(":")&&(m=0,n=n.slice(1).trim());const S=n.split(":");if(S.length>1){const A=vt(S[0]),y=Object.prototype.hasOwnProperty.call(o.nsid,A)&&o.nsid[A];y&&(m=y,n=S.slice(1).join(":").trim())}R(this,r,m)}const c=n.indexOf("#");if(c!==-1){let m=n.slice(c).trim().slice(1);if(m.includes("%"))try{m=es(m)}catch{}R(this,l,m.replace(/ /gu,"_")),n=n.slice(0,c).trim()}this.valid=!!(n||h&&this.ns===0&&x(this,l)!==void 0)&&ss(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,R(this,t,o.namespaces),R(this,s,o.articlePath||"/wiki/$1"),x(this,s).includes("$1")||R(this,s,x(this,s)+`${x(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return x(this,r)}get fragment(){return x(this,l)}get main(){return x(this,e)}set main(n){n=n.replace(/_/gu," ").trim(),R(this,e,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){const n=x(this,t)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:n}=this,a=n.lastIndexOf(".");return a===-1?void 0:n.slice(a+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){R(this,l,n)}getUrl(n){{typeof n=="string"&&(R(this,s,n),x(this,s).includes("$1")||R(this,s,x(this,s)+`${x(this,s).endsWith("/")?"":"/"}$1`));const{title:a,fragment:o}=this;return a?x(this,s).replace("$1",encodeURIComponent(a)+(o?`#${encodeURIComponent(o)}`:"")):o===void 0?"":`#${encodeURIComponent(o)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i)}}),So={};ie(So,{LanguageService:()=>Ao,isAttr:()=>Is,tasks:()=>cr});var cr,Cl,Il,Tl,Nl,Hi,Ll,Fl,jl,Rl,Is,Pl,Di,nt,Gi,Ve,fe,Vi,Qi,lt,at,Qe,Et,Ji,Ao,Td=N({"lib/lsp.ts"(){"use strict";var e,t,s,r,l,i,n,a,o,d,Xt,_e,gr,$o,pr,ko,fr,ot,$;St(),sa(),K(),he(),J(),cr=new WeakMap,Cl=new Set(["ref"]),Il=new Set(["ref","references"]),Tl=new Set(["name","extends","follow"]),Nl=new Set(["group"]),Hi=new Set(["arg-name","template-name","link-target","parameter-key"]),Ll=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...Hi]),Fl=new Set(["text","comment","noinclude","include"]),jl=["ext","html","table"].map(f=>`${f}-attr#style`).join(),Rl=Xe(f=>new RegExp(`^(?:${f}|//)`,"iu")),Is=({type:f,parentNode:g,length:w,firstChild:b},v)=>f==="attr-value"&&w===1&&b.type==="text"&&(!v||g.name==="style"),Pl=f=>f.is("html-attr")||f.is("table-attr"),Di=f=>f.childNodes.every(({type:g})=>Fl.has(g)),nt=(f,g)=>{const{top:w,left:b}=f.posFromIndex(g);return{line:w,character:b}},Gi=(f,g,w)=>({start:nt(f,g),end:nt(f,w)}),Ve=f=>{const{top:g,left:w,height:b,width:v}=f.getBoundingClientRect();return{start:{line:g,character:w},end:rs(g,w,b,v)}},fe=(f,g,w,{line:b,character:v},k,_)=>[...new Set(f)].map(C=>{var T;const E=(T=_==null?void 0:_(C))==null?void 0:T.description;return{label:C,kind:g,textEdit:{range:{start:{line:b,character:v-w.length},end:{line:b,character:v}},newText:C+(k!=null?k:"")},...E&&{documentation:{kind:"markdown",value:E}}}}),Vi=(f,g,{line:w,character:b})=>{const v=f.indexFromPos(w,b);return f.caretPositionFromIndex(v+Number(/\w/u.test(g.charAt(v))))},Qi=(f,g,w)=>{const{type:b,parentNode:v={}}=f,{name:k,tag:_}=v;return b==="attr-value"&&g.has(_)&&w.has(k)?f.toString().trim():NaN},lt=f=>Qi(f,Cl,Tl),at=f=>Qi(f,Il,Nl),Qe=(f,g)=>{const w=f==null?void 0:f.getAttr(g);return w!==!0&&w||!1},Et=f=>{const{type:g,name:w,parentNode:b}=f;switch(g){case"heading":return f.level;case"heading-title":return b.level;case"parameter-key":return`${b.parentNode.name}|${b.name}`;case"ext":case"html":case"image-parameter":return w;default:return b.name}},Ji=(f,g,w=!1)=>({range:Gi(f,...g.range),newText:g.text,title:`${w?"Fix":"Suggestion"}: ${g.desc}`,fix:w}),Ao=($=class{constructor(f){O(this,d);O(this,e);O(this,t);O(this,s);O(this,r);O(this,l);O(this,i);O(this,n);O(this,a);O(this,o);ke(this,"include",!0);ke(this,"config");ke(this,"data");cr.set(f,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(f,g,w=!0){const b=await P(this,d,_e).call(this,g);return b.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(v=>{const{type:k,childNodes:_}=v;return k!=="attr-value"&&!Di(v)?[]:_.filter(C=>C.type==="text").reverse().flatMap(C=>{const{data:E}=C,T=Hl(E,w).filter(([,,,B])=>B);if(T.length===0)return[];const L=C.getAbsoluteIndex();return T.map(([B,j,F])=>{const U=f(B);return U.length===4&&{color:{red:U[0]/255,green:U[1]/255,blue:U[2]/255,alpha:U[3]},range:Gi(b,L+j,L+F)}}).filter(Boolean)})})}provideColorPresentations(f){const{color:{red:g,green:w,blue:b,alpha:v},range:k}=f,_=[g,w,b],C=v<1?`rgba(${_.map(E=>Math.round(E*255)).join()},${v})`:`#${_.map(zl).join("")}`;return[{label:C,textEdit:{range:k,newText:C}}]}async provideCompletionItems(f,g){var Z,Y,se,ue,Ae,Le,it;const{re:w,allTags:b,functions:v,switches:k,protocols:_,params:C,tags:E,ext:T}=P(this,d,ko).call(this),{line:L,character:B}=g,j=f.split(/\r?\n/u,L+1)[L],F=w.exec((Z=j==null?void 0:j.slice(0,B))!=null?Z:""),[,,U={},W={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const V=F[1].startsWith("/");return fe(b,"Class",F[1].slice(V?1:0),g,V&&!(j!=null&&j.slice(B).trim().startsWith(">"))?">":"")}else{if(F!=null&&F[4])return fe(k,"Constant",F[4],g,"",V=>{if(this.data)return V=V.slice(2,-2),V in U?V=U[V]:V in W&&(V=W[V]),P(this,d,fr).call(this,V.toLowerCase())});if((F==null?void 0:F[5])!==void 0)return fe(_,"Reference",F[5],g)}const q=await P(this,d,_e).call(this,f);let M;if(F!=null&&F[2]){M=q.elementFromPoint(F.index+F[2].length-1,L);const V=(Y=F[3])!=null?Y:"";if(F[2]==="{{{")return fe(q.querySelectorAll("arg").filter(z=>z.name&&z!==M).map(({name:z})=>z),"Variable",V,g);const[oe,me]=this.config.parserFunction,xe=Array.isArray(me),$e=j.charAt(B),He=V.startsWith(":"),ye=He?V.slice(1).trimStart():V;if(F[2]==="[[")return fe(q.querySelectorAll("link,file,category,redirect-target").filter(z=>z!==M).map(({name:z})=>z),"Folder",ye,g);let Fe=v;return $e===":"?Fe=v.filter(z=>!z.endsWith(":")):$e===":"&&(Fe=v.filter(z=>z.endsWith(":")).map(z=>z.slice(0,-1))),[...fe(Fe,"Function",V,g,"",z=>{if(this.data)z in oe?z=oe[z]:!xe&&z in me&&(z=me[z]);else return;return P(this,d,ot).call(this,z.toLowerCase())}),...V.startsWith("#")?[]:fe(q.querySelectorAll("template").filter(z=>z!==M).map(z=>{const{name:Ee}=z;if(He)return Ee;const{ns:_t}=z.getAttribute("title");return _t===0?`:${Ee}`:_t===10?Ee.slice(9):Ee}),"Folder",ye,g)]}let D,G;if((F==null?void 0:F[7])===void 0&&(M=q.elementFromPoint(B,L),{type:D,parentNode:G}=M),(F==null?void 0:F[6])!==void 0||D==="image-parameter"){const V=q.indexFromPos(L,B),oe=(ue=(se=F==null?void 0:F[6])==null?void 0:se.trimStart())!=null?ue:x(this,e).slice(M.getAbsoluteIndex(),V).trimStart(),me=x(this,e)[V]==="=";return[...fe(C,"Property",oe,g).filter(({label:xe})=>!me||!/[= ]$/u.test(xe)),...fe(q.querySelectorAll("image-parameter#width").filter(xe=>xe!==M).map(xe=>xe.text()),"Unit",oe,g)]}else if((F==null?void 0:F[7])!==void 0||D==="attr-key"){const V=(Le=(Ae=F==null?void 0:F[7])==null?void 0:Ae.toLowerCase())!=null?Le:G.tag,oe=(it=F==null?void 0:F[9])!=null?it:M.toString().slice(0,B-q.posFromIndex(M.getAbsoluteIndex()).left);if(!E.has(V))return;const me=$r[V],xe=kr[V],$e=xe&&fe(xe,"Field",oe,g);return T.includes(V)&&!me?$e:[...$e!=null?$e:[],...V==="meta"||V==="link"?[]:fe(Ar,"Property",oe,g),...me?fe(me,"Property",oe,g):[],...fe(["data-"],"Variable",oe,g),...fe(["xmlns:"],"Interface",oe,g)]}else if(D==="parameter-key"||D==="parameter-value"&&G.anon){const V=G.parentNode,{type:oe,name:me}=V;if(oe==="magic-word"&&me!=="invoke")return;const xe=x(this,e).slice(M.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart(),{module:$e,function:He}=V;return xe?fe(q.querySelectorAll("parameter").filter(ye=>ye===G||ye.anon||ye.parentNode.type!==oe||ye.parentNode.name!==me?!1:oe==="template"?!0:ye.parentNode.module===$e&&ye.parentNode.function===He).map(({name:ye})=>ye),"Variable",xe,g,D==="parameter-value"?"=":""):void 0}else if(Is(M)&&Pl(G)){const V=br(G.tag,G.name);if(V.length===0)return;const oe=x(this,e).slice(M.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart();return fe(V,"Value",oe,g)}}async provideDiagnostics(f,g=!0){const w=await P(this,d,_e).call(this,f),b=w.lint();return[(g?b:b.filter(({severity:C})=>C==="error")).map(({startLine:C,startCol:E,endLine:T,endCol:L,severity:B,rule:j,message:F,fix:U,suggestions:W})=>({range:{start:{line:C,character:E},end:{line:T,character:L}},severity:B==="error"?1:2,source:"WikiLint",code:j,message:F,data:[...U?[Ji(w,U,!0)]:[],...W?W.map(q=>Ji(w,q)):[]]})),[],[]].flat(2)}async provideFoldingRanges(f){const g=await P(this,d,_e).call(this,f),{length:w}=g.getLines(),b=[],v=new Array(6),k=g.querySelectorAll("heading-title,table,template,magic-word");for(const _ of[...k].reverse())_.getRelativeIndex();for(const _ of k){const{offsetHeight:C}=_;if(_.type==="heading-title"||C>2){const{top:E}=g.posFromIndex(_.getAbsoluteIndex());if(_.type==="heading-title"){const{level:T}=_.parentNode;for(let L=T-1;L<6;L++){const B=v[L];B!==void 0&&B<E-1&&b.push({startLine:B,endLine:E-1,kind:"region"}),v[L]=void 0}v[T-1]=E+C-1}else b.push({startLine:E,endLine:E+C-2,kind:"region"})}}for(const _ of v)_!==void 0&&_<w-1&&b.push({startLine:_,endLine:w-1,kind:"region"});return b}async provideLinks(f){var k;(k=this.config)!=null||(this.config=I.getConfig());const{articlePath:g,protocol:w}=this.config,b=g==null?void 0:g.includes("//"),v=Rl(w);return(await P(this,d,_e).call(this,f)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${b?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(_=>{let C;_.is("magic-word")&&({name:C}=_,_=_.childNodes[1].lastChild);const{type:E,parentNode:T,firstChild:L,lastChild:B,childNodes:j,length:F}=_,{tag:U}=T;if(C!=null||(C=T.name),!(E!=="attr-value"||C==="src"&&["templatestyles","img"].includes(U)||C==="cite"&&["blockquote","del","ins","q"].includes(U))||!Di(_))return!1;let W=j.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(_.is("magic-link")||_.is("ext-link-url")||_.is("free-ext-link"))W=_.getUrl(g);else if(E==="link-target"&&(T.is("link")||T.is("redirect-target")||T.is("category"))){if(W.startsWith("/"))return!1;W=T.link.getUrl(g)}else if(E==="template-name")W=T.getAttribute("title").getUrl(g);else if(["link-target","invoke-module","parameter-value"].includes(E)||E==="attr-value"&&C==="src"&&U==="templatestyles"||E==="image-parameter"&&!v.test(W)){if(!b||W.startsWith("/"))return!1;let q=0;switch(E){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=C==="filepath"?6:274}const M=I.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!M.valid)return!1;W=M.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,E==="image-parameter"){const q=L.getBoundingClientRect(),{top:M,left:D,height:G,width:Z}=F===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:rs(M,D,G,Z)},target:W}}return{range:Ve(_),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(f,g){const w=await P(this,d,_e).call(this,f),{offsetNode:b,offset:v}=Vi(w,x(this,e),g),k=b.type==="text"?b.parentNode:b,_=v===0&&(k.type==="ext-attr-dirty"||k.type==="html-attr-dirty")?k.parentNode.parentNode:k,{type:C}=_,E=lt(_),T=at(_);if(!E&&!T&&!Ll.has(C))return;const L=Et(_),B=w.querySelectorAll(C==="heading-title"?"heading":C).filter(j=>C==="attr-value"?lt(j)===E||at(j)===T:Et(j)===L).reverse().map(j=>({range:Ve(j.type==="parameter-key"?j.parentNode:j)}));return B.length===0?void 0:B}async provideDefinition(f,g){const w=await P(this,d,_e).call(this,f),b=w.elementFromPoint(g.character,g.line),v=b.is("ext")&&b.name==="ref"?b:b.closest("ext#ref"),k=Qe(v,"name");if(!k)return;const _=Qe(v,"group"),C=w.querySelectorAll("ext#ref").filter(E=>E.innerText&&Qe(E,"name")===k&&Qe(E,"group")===_).reverse().map(({lastChild:E})=>({range:Ve(E)}));return C.length===0?void 0:C}async resolveRenameLocation(f,g){const w=await P(this,d,_e).call(this,f),b=w.elementFromPoint(g.character,g.line),{type:v}=b,k=lt(b),_=at(b);return!k&&!_&&(!Hi.has(v)||v==="parameter-key"&&/^[1-9]\d*$/u.test(b.parentNode.name)||v==="link-target"&&!["link","redirect-target"].includes(b.parentNode.type))?void 0:Ve(b)}async provideRenameEdits(f,g,w){const b=await P(this,d,_e).call(this,f),v=b.elementFromPoint(g.character,g.line),{type:k}=v,_=lt(v),C=_&&Qe(v.parentNode.parentNode,"group"),E=at(v),T=Et(v),L=b.querySelectorAll(k).filter(B=>{const{type:j}=B.parentNode;return k==="link-target"&&j!=="link"&&j!=="redirect-target"?!1:k==="attr-value"?at(B)===E||lt(B)===_&&Qe(B.parentNode.parentNode,"group")===C:Et(B)===T});return L.length===0?void 0:{changes:{"":L.reverse().map(B=>({range:Ve(B),newText:w}))}}}async provideHover(f,g){if(!this.data)return;const w=await P(this,d,_e).call(this,f);let{offsetNode:b,offset:v}=Vi(w,x(this,e),g);b.type==="text"&&(v+=b.getRelativeIndex(),b=b.parentNode);const{type:k,parentNode:_,length:C,name:E}=b;let T,L,B,j;if(b.is("double-underscore")&&v>0)T=P(this,d,fr).call(this,b.name);else if(k==="magic-word-name")T=P(this,d,ot).call(this,_.name),L=b.text().trim(),B=_.getAttribute("colon");else if(b.is("magic-word")&&!b.modifier&&C===1&&(v>0||w.posFromIndex(b.getAbsoluteIndex()).left===g.character))T=P(this,d,ot).call(this,E),L=b.firstChild.text().trim(),B=b.getAttribute("colon");else if((b.is("magic-word")||b.is("template"))&&b.modifier&&v>=2&&b.getRelativeIndex(0)>v&&(L=b.modifier.trim().slice(0,-1),T=P(this,d,ot).call(this,L.toLowerCase()),B=":",T)){const F=b.getAbsoluteIndex();j={start:nt(w,F+2),end:nt(w,F+b.modifier.trimEnd().length+1)}}return T&&{contents:{kind:"markdown",value:(T.signatures?`${T.signatures.map(F=>`- **{{ ${L}${F.length===0?"**":`${B}** `}${F.map(({label:U,const:W})=>W?U:`*${U}*`).join(" **|** ")} **}}**`).join(`
29
- `)}
30
-
31
- `:"")+T.description},range:j!=null?j:Ve(b)}}async provideSignatureHelp(f,g){if(!this.data)return;const{line:w,character:b}=g,v=f.split(/\r?\n/u,w+1)[w],{lastChild:k}=await P(this,d,$o).call(this,`${v.slice(0,b+/^[^{}<]*/u.exec(v.slice(b))[0].length)}}}`);if(!k.is("magic-word")||k.length===1)return;const{name:_,childNodes:C,firstChild:E}=k,T=P(this,d,ot).call(this,_);if(!(T!=null&&T.signatures))return;const L=C.length-1,B=T.signatures.filter(W=>{var q;return(W.length>=L||((q=W[W.length-1])==null?void 0:q.rest))&&W.every(({label:M,const:D},G)=>{var Y;const Z=D&&G<L&&((Y=C[G+1])==null?void 0:Y.text().trim());return!Z||M.toLowerCase().includes(Z.toLowerCase())})});if(B.length===0)return;let j=-1;for(let W=k.getAbsoluteIndex()+k.getAttribute("padding");j<L&&(W+=C[j+1].toString().length+1,!(W>b));j++);const F=E.text().trim(),U=k.getAttribute("colon");return{signatures:B.map(W=>({label:`{{${F}${W.length===0?"":U}${W.map(({label:q})=>q).join("|")}}}`,parameters:W.map(({label:q,const:M})=>({label:q,...M?{documentation:"Predefined parameter"}:void 0})),...W.length<L?{activeParameter:Math.min(j,W.length-1)}:void 0})),activeParameter:j}}async provideInlayHints(f){const g=await P(this,d,_e).call(this,f);let w=[];for(const b of g.querySelectorAll("template,magic-word#invoke").reverse()){const{type:v,childNodes:k}=b;w=[...w,...k.slice(v==="template"?1:3).filter(({anon:_})=>_).reverse().map(_=>({position:nt(g,_.getAbsoluteIndex()),label:`${_.name}=`,kind:2}))]}return w}findStyleTokens(){return x(this,l).querySelectorAll(jl).filter(({lastChild:f})=>Is(f))}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakMap,d=new WeakSet,Xt=function(){return x(this,n)===this.config&&x(this,a)===this.include},_e=async function(f){var g;return f=ts(f),!x(this,s)&&P(this,d,Xt).call(this)&&x(this,e)===f?x(this,l):(R(this,e,f),(g=x(this,s))!=null||R(this,s,P(this,d,gr).call(this)),x(this,s))},gr=async function(){var w;(w=this.config)!=null||(this.config=I.getConfig()),R(this,n,this.config),R(this,a,this.include);const f=x(this,e),g=await I.partialParse(f,()=>x(this,e),this.include,this.config);return P(this,d,Xt).call(this)&&x(this,e)===f?(R(this,l,g),R(this,s,void 0),g):(R(this,s,P(this,d,gr).call(this)),x(this,s))},$o=async function(f){var g;return f=ts(f),!x(this,r)&&P(this,d,Xt).call(this)&&x(this,t)===f?x(this,i):(R(this,t,f),(g=x(this,r))!=null||R(this,r,P(this,d,pr).call(this)),x(this,r))},pr=async function(){var w;(w=this.config)!=null||(this.config=I.getConfig()),R(this,n,this.config),R(this,a,this.include);const f=x(this,t),g=await I.partialParse(f,()=>x(this,t),this.include,this.config);return P(this,d,Xt).call(this)&&x(this,t)===f?(R(this,i,g),R(this,r,void 0),g):(R(this,r,P(this,d,pr).call(this)),x(this,r))},ko=function(){var f;if(!x(this,o)||x(this,o)[1]!==this.config){(f=this.config)!=null||(this.config=I.getConfig());const{nsid:g,ext:w,html:b,parserFunction:[v,k,..._],doubleUnderscore:C,protocol:E,img:T}=this.config,L=new Set([w,b].flat(2)),B=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(g).filter(([,j])=>j===6).map(([j])=>j).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");R(this,o,[{re:B,ext:w,tags:L,allTags:[...L,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(v),Array.isArray(k)?k:Object.keys(k),_].flat(2),switches:C.slice(0,2).flat().map(j=>`__${j}__`),protocols:E.split("|"),params:Object.keys(T).filter(j=>j.endsWith("$1")||!j.includes("$1")).map(j=>j.replace(/\$1$/u,""))},this.config])}return x(this,o)[0]},fr=function(f){return this.data.behaviorSwitches.find(({aliases:g})=>g.includes(f))},ot=function(f){return this.data.parserFunctions.find(({aliases:g})=>g.some(w=>w.replace(/^#/u,"")===f))},$)}}),_o={};ie(_o,{default:()=>I});Co.exports=ee(_o);var ws,Xi,Oe,Ki,El,I,J=N({"index.ts"(){Ml(),we(),Ze(),he(),Cd(),ws=!0,Xi=hr(),Oe={config:Yi,i18n:void 0,rules:vr,get lintConfig(){return Xi},set lintConfig(e){Xi=hr(e)},get viewOnly(){return ws},set viewOnly(e){ws&&!e&&ve.rev++,ws=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:r,parserFunction:l,variable:i}=t;for(let n=0;n<2;n++)s.length>n+2&&s[n].length===0&&(s[n]=Object.keys(s[n+2]));return r.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Yi,...t,excludes:[]}},msg(e,t=""){var s,r;return e&&((r=(s=this.i18n)==null?void 0:s[e])!=null?r:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,r=Oe.getConfig(),l){const{Title:i}=(Id(),ee(wo));let n;if(l!=null&&l.halfParsed)n=new i(e,t,r,l);else{const{Token:a}=(Q(),ee(Zt));n=ve.run(()=>{const o=new a(e,r);o.type="root",o.parseOnce(0,s).parseOnce();const d=new i(o.toString(),t,r,l);o.build();for(const u of["main","fragment"]){const h=d[u];if(h!=null&&h.includes("\0")){const p=o.buildFromStr(h,1);u==="main"?d.main=p:d.setFragment(p)}}return d})}return n},parse(e,t,s=Se,r=Oe.getConfig()){e=ts(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(a=>Ul[a]||Se)));const{Token:i}=(Q(),ee(Zt));return ve.run(()=>{const a=new i(e,r);return a.type="root",a.parse(s,t)})},async partialParse(e,t,s,r=Oe.getConfig()){{const{Token:l}=(Q(),ee(Zt)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:n}=ve;ve.running=!0;const a=new l(ts(e),r);a.type="root";let o=0;try{await new Promise(d=>{const u=()=>{t()===e?(o++,i(h,0)):d()},h=()=>{o===Se+1?(a.afterBuild(),d()):(a[o===Se?"build":"parseOnce"](o,s),u())};i(h,0)})}catch(d){throw ve.running=n,d}return ve.running=n,a}},createLanguageService(e={}){var t;{const s=(Td(),ee(So)),{LanguageService:r,tasks:l}=s;return(t=l.get(e))!=null?t:new r(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Ki={},El=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Oe)El.has(e)||(Ki[e]={enumerable:!1});Object.defineProperties(Oe,Ki),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Oe}),I=Oe}});J()});Nd();})();
32
- //# sourceMappingURL=bundle-lsp.min.js.map