1import{I as X}from"./chunk-2Q5K7J3B-ChVaIFwP.js";import{p as O}from"./chunk-JWPE2WC7-BB6pRTBG.js";import{_ as f,z as G,ae as Y,l as A,g as F,b as P,p as j,c as q,s as Z,o as U,i as J,B as N,A as D,q as K,F as Q,k as ee,af as te}from"./AIDemoShowcase-BbAH1eDQ.js";import{p as re}from"./cynefin-VYW2F7L2-O9PYUeYT.js";import"./query-zKe4mOlO.js";import"./vendor-BV72JwGM.js";import"./index-b3SWkXql.js";import"./badge-DgEKWgvG.js";import"./textarea-eQE_CzYA.js";import"./select-ziSDwp_c.js";import"./index-BdQq_4o_.js";import"./index-BcFqJv69.js";import"./index-BSNYq_IR.js";import"./check-iA5WZ6OB.js";import"./play-CR9Xjm6m.js";import"./copy-CplDqpsc.js";import"./purify.es-D6gMnemd.js";import"./isArguments-HEPTc7lU.js";import"./isArrayLikeObject-DzpQn6gc.js";import"./table-DtZVbMlF.js";import"./circle-check-BIRNLulk.js";import"./arrow-left-C5xhlwR_.js";import"./git-branch-Cw6n6scQ.js";import"./book-open-1XKjOEDX.js";import"./bot-1LBfHded.js";import"./wrench-1AGdYr6P.js";import"./users-DxQaKDDx.js";import"./trending-up-IXie-JW6.js";import"./calendar-C5ZA1iBg.js";var E=/[ââââââââ£]/,S=/[ââââ£]/,ie=/[ââ]/,k=/^[\sââ]+$/,V=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,ne=" ";function L(r){return r.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(r){for(const e of r){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const n=parseInt(i,10),a=e.get(n);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(r){const e=r.split(` 2`),t=new Map;let i=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){i=s;break}if(i===-1)return{text:r,lineMap:t};const n=[];for(let s=i+1;s<e.length;s++){const o=e[s];o.trim()===""||$.test(o)||V.test(o)||k.test(o)||n.push(o.replace(/\t/g," "))}if(!L(n))return{text:r,lineMap:t};const a=_(n),c=[];let l=0;for(let s=0;s<=i;s++)c.push(e[s]),l++,t.set(l,s+1);for(let s=i+1;s<e.length;s++){const o=e[s],p=o.trim(),h=s+1;if(p===""){c.push(o),l++,t.set(l,h);continue}if($.test(o)){c.push(o),l++,t.set(l,h);continue}if(V.test(o)){c.push(o),l++,t.set(l,h);continue}if(k.test(o))continue;const d=o.replace(/\t/g," "),m=S.exec(d);if(m?.index!==void 0){const g=m.index,w=Math.round(g/a)+1;let u=g+1;for(;u<d.length&&ie.test(d[u]);)u++;for(;u<d.length&&d[u]===" ";)u++;const v=d.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node â expected a filename or directory name after the box-drawing prefix`);const W=ne.repeat(w);c.push(W+v),l++,t.set(l,h)}else{if(/^[\sââââââââ£]+$/.test(d))continue;if(E.test(d))c.push(o),l++,t.set(l,h);else{if(/^\s+/.test(d))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use âââ or âââ prefixes for indented nodes.`);c.push(o),l++,t.set(l,h)}}}return{text:c.join(` 3`),lineMap:t}}f(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),K()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=G.treeView,le=f(()=>D(ce,N().treeView),"getConfig"),de=f((r,e,t,i,n,a)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:r,name:e,nodeType:t,icon:n,cssClass:i,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),pe={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:F,getAccDescription:P,getDiagramTitle:j,setAccDescription:q,setAccTitle:Z,setDiagramTitle:U},I=pe,he=f(r=>{O(r,I);for(const e of r.nodes){const t=typeof e.indent=="number"?e.indent:0;let i=e.name;const n=i.endsWith("/");n&&(i=i.slice(0,-1));const a=n?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,p=o?J(o,N()):void 0;I.addNode(t,i,a,c,s,p)}},"populate"),fe={parse:f(async r=>{const{text:e,lineMap:t}=R(r);try{const i=await re("treeView",e);A.debug(i),he(i)}catch(i){throw t.size>0&&i instanceof Error&&(i.message=M(i.message,t)),i}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="
3currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function z(r,e){const t=e?.filenameIcons?.[r];if(t)return t;const i=r.lastIndexOf(".");if(i>0){const n=r.substring(i).toLowerCase(),a=e?.extensionIcons;return a?.[n]??a?.[n.slice(1)]}}f(z,"detectIcon");function C(r,e){return r.includes(":")?r:r in b.icons||!e?`${b.prefix}:${r}`:`${e}:${r}`}f(C,"qualifyIcon");function B(r,e){if(r.icon!=="none"){if(r.icon)return C(r.icon,e.defaultIconPack);if(e.showIcons){if(r.nodeType==="file"){const t=z(r.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");Y([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,H=f((r,e)=>`tv-icon-${r}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),me=f(async(r,e,t,i)=>{const n=new Set,a=f(s=>{const o=B(s,t);o&&n.add(o),s.children.forEach(a)},"collect");if(a(e),n.size===0)return;const c=await Promise.all([...n].map(async s=>({icon:s,svg:await te(s,{height:y,width:y})}))),l=r.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",H(i,s)).html(o)},"injectIconDefs"),we=f((r,e,t,i,n,a)=>{const c=i.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,n),p=o!==void 0;o&&c.append("use").attr("xlink:href",`#${H(a,o)}`).attr("x",r+n.paddingX).attr("y",e+n.paddingY).attr("class","treeView-node-icon");const h=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:m}=h.node().getBBox(),g=d+n.paddingY*2,w=r+n.paddingX+(p?s:0);h.attr("x",w),h.attr("y",e+g/2);const u=w+m,v=m+n.paddingX*2+(p?s:0);return t.BBox={x:r,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",r).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((r,e,t,i,n,a)=>r.append("line").attr("x1",e).attr("y1",t).attr("x2",i).attr("y2",n).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((r,e,t,i)=>{let n=0,a=0;const c=[],l=f((p,h,d,m)=>{const g=m*(d.rowIndent+d.paddingX),w=we(g,n,h,p,d,i);c.push(w);const{height:u,width:v}=h.BBox;T(p,g-d.rowIndent,n+u/2,g,n+u/2,d.lineThickness),a=Math.max(a,g+v),n+=u},"drawNode"),s=f((p,h=0)=>{l(r,p,t,h),p.children.forEach(w=>{s(w,h+1)});const{x:d,y:m,height:g}=p.BBox;if(p.children.length){const{y:w,height:u}=p.children[p.children.length-1].BBox;T(r,d+t.paddingX,m+g,d+t.paddingX,w+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(p=>p.node.description);if(o.length>0){const h=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",d.centerY).node().getBBox();a=Math.max(a,h+g.width+t.paddingX)}}for(const p of c)if(p.node.cssClass?.split(/\s+/).includes("highlight")){const h=p.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const d=a-p.node.BBox.x+8;h.attr("width",d),a=Math.max(a,p.node.BBox.x+d+2)}}return{totalHeight:n,totalWidth:a}},"drawTree"),ve=f(async(r,e,t,i)=>{A.debug(`Rendering treeView diagram 4`+r);const n=i.db,a=n.getRoot(),c=n.getConfig(),l=Q(e);await me(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:p}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${p} ${o}`),ee(l,o,p,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:r})=>{const{labelFontSize:e,labelColor:t,lineColor:i,iconColor:n,descriptionColor:a,highlightBg:c,highlightStroke:l}=D(Ce,r);return` 5 .treeView-node-label { 6 font-size: ${e}; 7 fill: ${t}; 8 white-space: pre; 9 } 10 .treeView-node-dir { 11 font-weight: bold; 12 } 13 .treeView-node-line { 14 stroke: ${i}; 15 } 16 .treeView-node-icon { 17 color: ${n}; 18 } 19 .treeView-node-description { 20 font-size: ${e}; 21 fill: ${a}; 22 font-style: italic; 23 white-space: pre; 24 } 25 .treeView-highlight-bg { 26 fill: ${c}; 27 stroke: ${l}; 28 stroke-width: 1; 29 } 30 `},"styles"),Be=ye,et={db:I,renderer:Ie,parser:fe,styles:Be};export{et as diagram};
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.