| 172 | return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{ |
| 173 | constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}} |
| 174 | const J=t,Y=a,ee=Symbol("nomatch"),ne=t=>{ |
| 175 | const a=Object.create(null),i=Object.create(null),r=[];let s=!0 |
| 176 | ;const o="Could not find the language '{}', did you forget to load/include a language module?",c={ |
| 177 | disableAutodetect:!0,name:"Plain text",contains:[]};let p={ |
| 178 | ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, |
| 179 | languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", |
| 180 | cssSelector:"pre code",languages:null,__emitter:l};function _(e){ |
| 181 | return p.noHighlightRe.test(e)}function h(e,n,t){let a="",i="" |
| 182 | ;"object"==typeof n?(a=e, |
| 183 | t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), |
| 184 | q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), |
| 185 | i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r) |
| 186 | ;const s=r.result?r.result:f(r.language,r.code,t) |
| 187 | ;return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){ |
| 188 | const l=Object.create(null);function c(){if(!x.keywords)return void S.addText(A) |
| 189 | ;let e=0;x.keywordPatternRe.lastIndex=0;let n=x.keywordPatternRe.exec(A),t="" |
| 190 | ;for(;n;){t+=A.substring(e,n.index) |
| 191 | ;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,x.keywords[a]);if(r){ |
| 192 | const[e,a]=r |
| 193 | ;if(S.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(C+=a),e.startsWith("_"))t+=n[0];else{ |
| 194 | const t=w.classNameAliases[e]||e;g(n[0],t)}}else t+=n[0] |
| 195 | ;e=x.keywordPatternRe.lastIndex,n=x.keywordPatternRe.exec(A)}var a |
| 196 | ;t+=A.substring(e),S.addText(t)}function d(){null!=x.subLanguage?(()=>{ |
| 197 | if(""===A)return;let e=null;if("string"==typeof x.subLanguage){ |
| 198 | if(!a[x.subLanguage])return void S.addText(A) |
| 199 | ;e=f(x.subLanguage,A,!0,M[x.subLanguage]),M[x.subLanguage]=e._top |
| 200 | }else e=E(A,x.subLanguage.length?x.subLanguage:null) |
| 201 | ;x.relevance>0&&(C+=e.relevance),S.__addSublanguage(e._emitter,e.language) |
| 202 | })():c(),A=""}function g(e,n){ |
| 203 | ""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function u(e,n){let t=1 |
| 204 | ;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue} |
| 205 | const a=w.classNameAliases[e[t]]||e[t],i=n[t];a?g(i,a):(A=i,c(),A=""),t++}} |
| 206 | function b(e,n){ |
| 207 | return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope), |
| 208 | e.beginScope&&(e.beginScope._wrap?(g(A,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), |
| 209 | A=""):e.beginScope._multi&&(u(e.beginScope,n),A="")),x=Object.create(e,{parent:{ |
| 210 | value:x}}),x}function m(e,t,a){let i=((e,n)=>{const t=e&&e.exec(n) |
| 211 | ;return t&&0===t.index})(e.endRe,a);if(i){if(e["on:end"]){const a=new n(e) |
| 212 | ;e["on:end"](t,a),a.isMatchIgnored&&(i=!1)}if(i){ |
| 213 | for(;e.endsParent&&e.parent;)e=e.parent;return e}} |
| 214 | if(e.endsWithParent)return m(e.parent,t,a)}function _(e){ |
| 215 | return 0===x.matcher.regexIndex?(A+=e[0],1):(D=!0,0)}function h(e){ |
| 216 | const n=e[0],a=t.substring(e.index),i=m(x,e,a);if(!i)return ee;const r=x |
| 217 | ;x.endScope&&x.endScope._wrap?(d(), |
| 218 | g(n,x.endScope._wrap)):x.endScope&&x.endScope._multi?(d(), |
| 219 | u(x.endScope,e)):r.skip?A+=n:(r.returnEnd||r.excludeEnd||(A+=n), |
| 220 | d(),r.excludeEnd&&(A=n));do{ |
| 221 | x.scope&&S.closeNode(),x.skip||x.subLanguage||(C+=x.relevance),x=x.parent |
| 222 | }while(x!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length} |
| 223 | let y={};function N(a,r){const o=r&&r[0];if(A+=a,null==o)return d(),0 |
| 224 | ;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){ |
| 225 | if(A+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) |
| 226 | ;throw n.languageName=e,n.badRule=y.rule,n}return 1} |
| 227 | if(y=r,"begin"===r.type)return(e=>{ |
| 228 | const t=e[0],a=e.rule,i=new n(a),r=[a.__beforeBegin,a["on:begin"]] |
| 229 | ;for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return _(t) |
| 230 | ;return a.skip?A+=t:(a.excludeBegin&&(A+=t), |
| 231 | d(),a.returnBegin||a.excludeBegin||(A=t)),b(a,e),a.returnBegin?0:t.length})(r) |