1import{j as c,r as h}from"./index-lGppnjmY.js";const f="\\w+",x=new RegExp(`^<(${f})\\s*(/?)>`),d=new RegExp(`^</(${f})\\s*>`),a=(e,t)=>{if(t.length===0)return;const n=e.at(-1);if(n?.type==="text"){e.splice(-1,1,{type:"text",value:n.value+t});return}e.push({type:"text",value:t})},p=(e,t,n,r)=>{e.push({type:"element",name:t,selfClosing:n,children:r})},g=e=>{const t=e.pop(),n=e.at(-1);if(!(!t||!n)){a(n.children,`<${t.name??""}>`);for(const r of t.children)n.children.push(r)}},T=(e,t,n)=>{const r=n[1],s=e.findIndex(o=>o.name===r);if(s<=0)return a(t.children,n[0]),n[0].length;for(;e.length-1>s;)g(e);const l=e.pop(),i=e.at(-1);return l&&i&&p(i.children,l.name??"",!1,l.children),n[0].length},j=(e,t,n)=>{const r=n[1]??"";return n[2]==="/"?p(t.children,r,!0,[]):e.push({name:r,children:[]}),n[0].length},w=e=>{const t=[{name:void 0,children:[]}];let n=0;for(;n<e.length;){const r=t.at(-1);if(!r)break;if(e.charAt(n)!=="<"){const o=e.indexOf("<",n),u=o===-1?e.length:o;a(r.children,e.slice(n,u)),n=u;continue}const s=e.slice(n),l=d.exec(s);if(l){n+=T(t,r,l);continue}const i=x.exec(s);if(i){n+=j(t,r,i);continue}a(r.children,"<"),n+=1}for(;t.length>1;)g(t);return t[0]?.children??[]},m=(e,t)=>e.length===0?null:e.map((n,r)=>{if(n.type==="text")return c.jsx(h.Fragment,{children:n.value},r);const s=t?.[n.name];if(n.selfClosing)return s?c.jsx(s,{},r):null;const l=m(n.children,t);return s?c.jsx(s,{children:l},r):c.jsx(h.Fragment,{children:l},r)}),C=({phrase:e,components:t})=>{const n=w(e);if(n.length===0)return null;const[r]=n;return n.length===1&&r?.type==="text"?r.value:c.jsx(c.Fragment,{children:m(n,t)})};export{C as 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.