mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3966],{46291:e=>{!function(){var t;function n(e){for(var t,n,i,r,o=1,s=[].slice.call(arguments),a=0,c=e.length,l="",g=!1,u=!1,d=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<c;++a)if(t=e[a],g)switch(g=!1,"."==t?(u=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(u=!0,t=e[a+=2]):u=!0,r=h(),t){case"b":l+=parseInt(d(),10).toString(2);break;case"c":l+="string"==typeof(n=d())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":l+=parseInt(d(),10);break;case"f":i=String(parseFloat(d()).toFixed(r||6)),l+=u?i:i.replace(/^0/,"");break;case"j":l+=JSON.stringify(d());break;case"o":l+="0"+parseInt(d(),10).toString(8);break;case"s":l+=d();break;case"x":l+="0x"+parseInt(d(),10).toString(16);break;case"X":l+="0x"+parseInt(d(),10).toString(16).toUpperCase();break;default:l+=t}else"%"===t?g=!0:l+=t;return l}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()},33390:e=>{var t={exports:{}};function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||n(i)})),e}t.exports=n,t.exports.default=n;var i=t.exports;class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const a=e=>!!e.kind;class c{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!a(e))return;let t=e.kind;t=e.sublanguage?`language-${t}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){a(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class g extends l{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new c(this,this.options).value()}finalize(){return!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function d(e){return p("(?=",e,")")}function h(e){return p("(?:",e,")*")}function f(e){return p("(?:",e,")?")}function p(...e){return e.map((e=>u(e))).join("")}function b(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>u(e))).join("|")+")"}function m(e){return new RegExp(e.toString()+"|").exec("").length-1}const x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let i=u(e),r="";for(;i.length>0;){const e=x.exec(i);if(!e){r+=i;break}r+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)}const y="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",_="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",N={begin:"\\\\[\\s\\S]",relevance:0},S={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},M=function(e,t,n={}){const i=s({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=b("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:p(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},R=M("//","$"),A=M("/\\*","\\*/"),I=M("#","$"),j={scope:"number",begin:_,relevance:0},L={scope:"number",begin:k,relevance:0},T={scope:"number",begin:v,relevance:0},B={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]}]},C={scope:"title",begin:y,relevance:0},P={scope:"title",begin:E,relevance:0};var H=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:y,UNDERSCORE_IDENT_RE:E,NUMBER_RE:_,C_NUMBER_RE:k,BINARY_NUMBER_RE:v,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=p(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:N,APOS_STRING_MODE:S,QUOTE_STRING_MODE:O,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:M,C_LINE_COMMENT_MODE:R,C_BLOCK_COMMENT_MODE:A,HASH_COMMENT_MODE:I,NUMBER_MODE:j,C_NUMBER_MODE:L,BINARY_NUMBER_MODE:T,REGEXP_MODE:B,TITLE_MODE:C,UNDERSCORE_TITLE_MODE:P,METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function D(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function $(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=D,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function z(e,t){Array.isArray(e.illegal)&&(e.illegal=b(...e.illegal))}function K(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function W(e,t){void 0===e.relevance&&(e.relevance=1)}const X=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=p(n.beforeMatch,d(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},F=["of","and","for","in","not","or","if","then","parent","list","value"];function G(e,t,n="keyword"){const i=Object.create(null);return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((function(n){Object.assign(i,G(e[n],t,n))})),i;function r(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");i[n[0]]=[e,Z(n[0],n[1])]}))}}function Z(e,t){return t?Number(t):function(e){return F.includes(e.toLowerCase())}(e)?0:1}const J={},V=e=>{console.error(e)},q=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Y=(e,t)=>{J[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),J[`${e}/${t}`]=!0)},Q=new Error;function ee(e,t,{key:n}){let i=0;const r=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+i]=r[e],o[e+i]=!0,i+=m(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function te(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw V("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Q;if("object"!=typeof e.beginScope||null===e.beginScope)throw V("beginScope must be object"),Q;ee(e,e.begin,{key:"beginScope"}),e.begin=w(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw V("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Q;if("object"!=typeof e.endScope||null===e.endScope)throw V("endScope must be object"),Q;ee(e,e.end,{key:"endScope"}),e.end=w(e.end,{joinWith:""})}}(e)}function ne(e){function t(t,n){return new RegExp(u(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=m(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(w(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r;if(r.isCompiled)return a;[$,K,te,X].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))),r.__beforeBegin=null,[U,z,W].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),c=r.keywords.$pattern,delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=G(r.keywords,e.case_insensitive)),a.keywordPatternRe=t(c,!0),o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(a.endRe=t(a.end)),a.terminatorEnd=u(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(a.illegalRe=t(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return s(e,{variants:null},t)}))),e.cachedVariants?e.cachedVariants:ie(e)?s(e,{starts:e.starts?s(e.starts):null}):Object.isFrozen(e)?s(e):e}("self"===e?r:e)}))),r.contains.forEach((function(e){n(e,a)})),r.starts&&n(r.starts,o),a.matcher=function(e){const t=new i;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class re extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const oe=o,se=s,ae=Symbol("nomatch");var ce=function(e){const t=Object.create(null),n=Object.create(null),o=[];let s=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function u(e){return l.noHighlightRe.test(e)}function m(e,t,n){let i="",r="";"object"==typeof t?(i=e,n=t.ignoreIllegals,r=t.language):(Y("10.7.0","highlight(lang, code, ...args) has been deprecated."),Y("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,i=t),void 0===n&&(n=!0);const o={code:i,language:r};S("before:highlight",o);const s=o.result?o.result:x(o.language,o.code,n);return s.code=o.code,S("after:highlight",s),s}function x(e,n,i,o){const c=Object.create(null);function g(){if(!N.keywords)return void O.addText(M);let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(M),n="";for(;t;){n+=M.substring(e,t.index);const r=E.case_insensitive?t[0].toLowerCase():t[0],o=(i=r,N.keywords[i]);if(o){const[e,i]=o;if(O.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{const n=E.classNameAliases[e]||e;O.addKeyword(t[0],n)}}else n+=t[0];e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(M)}var i;n+=M.substr(e),O.addText(n)}function u(){null!=N.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof N.subLanguage){if(!t[N.subLanguage])return void O.addText(M);e=x(N.subLanguage,M,!0,S[N.subLanguage]),S[N.subLanguage]=e._top}else e=w(M,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(R+=e.relevance),O.addSublanguage(e._emitter,e.language)}():g(),M=""}function d(e,t){let n=1;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue}const i=E.classNameAliases[e[n]]||e[n],r=t[n];i?O.addKeyword(r,i):(M=r,g(),M=""),n++}}function h(e,t){return e.scope&&"string"==typeof e.scope&&O.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(O.addKeyword(M,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=""):e.beginScope._multi&&(d(e.beginScope,t),M="")),N=Object.create(e,{parent:{value:N}}),N}function f(e,t,n){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(i){if(e["on:end"]){const n=new r(e);e["on:end"](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return f(e.parent,t,n)}function p(e){return 0===N.matcher.regexIndex?(M+=e[0],1):(j=!0,0)}function b(e){const t=e[0],i=n.substr(e.index),r=f(N,e,i);if(!r)return ae;const o=N;N.endScope&&N.endScope._wrap?(u(),O.addKeyword(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(u(),d(N.endScope,e)):o.skip?M+=t:(o.returnEnd||o.excludeEnd||(M+=t),u(),o.excludeEnd&&(M=t));do{N.scope&&O.closeNode(),N.skip||N.subLanguage||(R+=N.relevance),N=N.parent}while(N!==r.parent);return r.starts&&h(r.starts,e),o.returnEnd?0:t.length}let m={};function y(t,o){const a=o&&o[0];if(M+=t,null==a)return u(),0;if("begin"===m.type&&"end"===o.type&&m.index===o.index&&""===a){if(M+=n.slice(o.index,o.index+1),!s){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=o,"begin"===o.type)return function(e){const t=e[0],n=e.rule,i=new r(n),o=[n.__beforeBegin,n["on:begin"]];for(const n of o)if(n&&(n(e,i),i.isMatchIgnored))return p(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),u(),n.returnBegin||n.excludeBegin||(M=t)),h(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!i){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(N.scope||"<unnamed>")+'"');throw e.mode=N,e}if("end"===o.type){const e=b(o);if(e!==ae)return e}if("illegal"===o.type&&""===a)return 1;if(I>1e5&&I>3*o.index)throw new Error("potential infinite loop, way more iterations than matches");return M+=a,a.length}const E=k(e);if(!E)throw V(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=ne(E);let v="",N=o||_;const S={},O=new l.__emitter(l);!function(){const e=[];for(let t=N;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>O.openNode(e)))}();let M="",R=0,A=0,I=0,j=!1;try{for(N.matcher.considerAll();;){I++,j?j=!1:N.matcher.considerAll(),N.matcher.lastIndex=A;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e);A=e.index+t}return y(n.substr(A)),O.closeAllNodes(),O.finalize(),v=O.toHTML(),{language:e,value:v,relevance:R,illegal:!1,_emitter:O,_top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:oe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A,context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:v},_emitter:O};if(s)return{language:e,value:oe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:O,_top:N};throw t}}function w(e,n){n=n||l.languages||Object.keys(t);const i=function(e){const t={value:oe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}(e),r=n.filter(k).filter(N).map((t=>x(t,e,!1)));r.unshift(i);const o=r.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1;if(k(t.language).supersetOf===e.language)return-1}return 0})),[s,a]=o,g=s;return g.secondBest=a,g}function y(e){let t=null;const i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=k(n[1]);return t||(q(a.replace("{}",n[1])),q("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>u(e)||k(e)))}(e);if(u(i))return;if(S("before:highlightElement",{el:e,language:i}),e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),l.throwUnescapedHTML))throw new re("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;const r=t.textContent,o=i?m(r,{language:i,ignoreIllegals:!0}):w(r);e.innerHTML=o.value,function(e,t,i){const r=t&&n[t]||i;e.classList.add("hljs"),e.classList.add(`language-${r}`)}(e,i,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),S("after:highlightElement",{el:e,result:o,text:r})}let E=!1;function _(){"loading"!==document.readyState?document.querySelectorAll(l.cssSelector).forEach(y):E=!0}function k(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function N(e){const t=k(e);return t&&!t.disableAutodetect}function S(e,t){const n=e;o.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){E&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:w,highlightAll:_,highlightElement:y,highlightBlock:function(e){return Y("10.7.0","highlightBlock will be removed entirely in v12.0"),Y("10.7.0","Please use highlightElement now."),y(e)},configure:function(e){l=se(l,e)},initHighlighting:()=>{_(),Y("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){_(),Y("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,i){let r=null;try{r=i(e)}catch(e){if(V("Language definition for '{}' could not be registered.".replace("{}",n)),!s)throw e;V(e),r=c}r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&v(r.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:k,registerAliases:v,autoDetection:N,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),o.push(e)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.5.1",e.regex={concat:p,lookahead:d,either:b,optional:f,anyNumberOfTimes:h};for(const e in H)"object"==typeof H[e]&&i(H[e]);return Object.assign(e,H),e}({});e.exports=ce,ce.HighlightJS=ce,ce.default=ce},93966:(e,t,n)=>{"use strict";n.d(t,{$:()=>u});const i=n(33390);var r=n(46291);const o=Object.assign(s(Error),{eval:s(EvalError),range:s(RangeError),reference:s(ReferenceError),syntax:s(SyntaxError),type:s(TypeError),uri:s(URIError)});function s(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const i=t?r(t,...n):t;return new e(i)}}const a={}.hasOwnProperty,c="hljs-";function l(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw o("Expected `string` for name, got `%s`",e);if(!i.getLanguage(e))throw o("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw o("Expected `string` for value, got `%s`",t);null==r&&(r=c),i.configure({__emitter:g,classPrefix:r});const s=i.highlight(t,{language:e,ignoreIllegals:!0});if(i.configure({}),s.errorRaised)throw s.errorRaised;return s._emitter.root.data.language=s.language,s._emitter.root.data.relevance=s.relevance,s._emitter.root}class g{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],i=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(e){const t={type:"element",tagName:"span",properties:{className:e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e))},children:[]};this.stack[this.stack.length-1].children.push(t),this.stack.push(t)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const u={highlight:l,highlightAuto:function(e,t={}){const n=t.subset||i.listLanguages();let r=t.prefix,s=-1,a={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=c),"string"!=typeof e)throw o("Expected `string` for value, got `%s`",e);for(;++s<n.length;){const r=n[s];if(!i.getLanguage(r))continue;const o=l(r,e,t);o.data.relevance>a.data.relevance&&(a=o)}return a},registerLanguage:function(e,t){i.registerLanguage(e,t)},registered:function(e){return Boolean(i.getLanguage(e))},listLanguages:function(){return i.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)i.registerAliases(t,{languageName:e});else{let t;for(t in e)a.call(e,t)&&i.registerAliases(e[t],{languageName:t})}}}}}]);
|
|
//# sourceMappingURL=3966.097d0a2dd03e55cf7c46.js.map
|