1import f from"highlight.js/lib/core";const p="hljs-";class k{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const s=this.stack[this.stack.length-1],o=e.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):s.children.push(...o)}openNode(e){const n=this.options.classPrefix,s=e.split(".").map((h,t)=>t?h+"_".repeat(t):n+h),o=this.stack[this.stack.length-1],g={type:"element",tagName:"span",properties:{className:s},children:[]};o.children.push(g),this.stack.push(g)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}export function createLowlight(d){const e=f.newInstance();return d&&g(d),{highlight:n,highlightAuto:s,listLanguages:o,register:g,registered:h};function n(t,a,c){const l=c||{},u=typeof l.prefix=="string"?l.prefix:p;if(!e.getLanguage(t))throw new Error("Unknown language: `"+t+"` is not registered");e.configure({__emitter:k,classPrefix:u});const i=e.highlight(a,{ignoreIllegals:!0,language:t});if(i.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:i.errorRaised});const r=i._emitter.root;return r.data.language=i.language,r.data.relevance=i.relevance,r}function s(t,a){const c=(a||{}).subset||o();let l=0,u;for(const i of c){if(!e.getLanguage(i))continue;const r=n(i,t,a);r.data&&r.data.relevance!==void 0&&r.data.relevance>l&&(l=r.data.relevance,u=r)}return u||{type:"root",children:[],data:{language:void 0,relevance:l}}}function o(){return e.listLanguages()}function g(t,a){if(typeof t=="string")e.registerLanguage(t,a);else for(const c of Object.keys(t))e.registerLanguage(c,t[c])}function h(t){return!!e.getLanguage(t)}}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.