1var e;import{_ as t,F as a,H as s,K as l,e as r,l as n,as as o,d as i,b as c,a as d,q as p,t as h,g as m,s as y,G as f,at as u,z as S}from"./index-C16DHWFp.js";import{s as g}from"./chunk-KX2RTZJC-D7shOJrd.js";import{p as x}from"./chunk-4BX2VUAB-CJu338GO.js";import{p as b}from"./treemap-KZPCXAKY-DdCrRx6w.js";import{f as v}from"./defaultLocale-FGEv0fP-.js";import{o as C}from"./ordinal-BXL5nHgV.js";import{h as $,t as w}from"./vendor-charts-CKochBGt.js";import"./vendor-react-DejgYtBM.js";import"./vendor-semi-D8d7bTtM.js";import"./index-BeIIFw6E.js";import"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./vendor-katex-BuQuj6Fv.js";import"./dayjs.min-CASHsil8.js";import"./purify.es-Bm-lHtoJ.js";import"./index-DcbB2zxU.js";import"./vendor-highlight-CaHTjBxz.js";import"./index-B_PxGnmD.js";import"./_baseUniq-BjWlgG8Y.js";import"./_basePickBy-bVyxPQRR.js";import"./clone-VMOlTGG7.js";import"./init-C0SZ43gy.js";var L=(t(e=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=c,this.getAccTitle=d,this.setDiagramTitle=p,this.getDiagramTitle=h,this.getAccDescription=m,this.setAccDescription=y}getNodes(){return this.nodes}getConfig(){const e=f,t=s();return a({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),0===t&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){const a=this.classes.get(e)??{id:e,styles:[],textStyles:[]},s=t.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(e=>{u(e)&&(a?.textStyles?a.textStyles.push(e):a.textStyles=[e]),a?.styles?a.styles.push(e):a.styles=[e]}),this.classes.set(e,a)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){S(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},"TreeMapDB"),e);function k(e){if(!e.length)return[];const t=[],a=[];return e.forEach(e=>{const s={name:e.name,children:"Leaf"===e.type?void 0:[]};for(s.classSelector=e?.classSelector,e?.cssCompiledStyles&&(s.cssCompiledStyles=e.cssCompiledStyles),"Leaf"===e.type&&void 0!==e.value&&(s.value=e.value);a.length>0&&a[a.length-1].level>=e.level;)a.pop();if(0===a.length)t.push(s);else{const e=a[a.length-1].node;e.children?e.children.push(s):e.children=[s]}"Leaf"!==e.type&&a.push({node:s,level:e.level})}),t}t(k,"buildHierarchy");var j=t((e,a)=>{x(e,a);const s=[];for(const t of e.TreemapRows??[])"ClassDefStatement"===t.$type&&a.addClass(t.className??"",t.styleText??"");for(const t of e.TreemapRows??[]){const e=t.item;if(!e)continue;const l=t.indent?parseInt(t.indent):0,r=T(e),n=e.classSelector?a.getStylesForClass(e.classSelector):[],o=n.length>0?n:void 0,i={level:l,name:r,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:o};s.push(i)}const l=k(s),r=t((e,t)=>{for(const s of e)a.addNode(s,t),s.children&&s.children.length>0&&r(s.children,t+1)},"addNodesRecursively");r(l,0)},"populate"),T=t(e=>e.name?String(e.name):"","getItemName"),z={parser:{yy:void 0},parse:t(async e=>{try{const t=b,a=await t("treemap",e);n.debug("Treemap AST:",a);const s=z.parser?.yy;if(!(s instanceof L))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");j(a,s)}catch(t){throw n.error("Error parsing treemap:",t),t}},"parse")},M={draw:t((e,a,c,d)=>{const p=d.db,h=p.getConfig(),m=h.padding??10,y=p.getDiagramTitle(),f=p.getRoot(),{themeVariables:u}=s();if(!f)return;const S=y?30:0,x=l(a),b=h.nodeWidth?10*h.nodeWidth:960,L=h.nodeHeight?10*h.nodeHeight:500,k=b,j=L+S;let T;x.attr("viewBox",`0 0 ${k} ${j}`),r(x,j,k,h.useMaxWidth);try{const e=h.valueFormat||",";if("$0,0"===e)T=t(e=>"$"+v(",")(e),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const a=/\.\d+/.exec(e),s=a?a[0]:"";T=t(e=>"$"+v(","+s)(e),"valueFormat")}else if(e.startsWith("$")){const a=e.substring(1);T=t(e=>"$"+v(a||"")(e),"valueFormat")}else T=v(e)}catch(E){n.error("Error creating format function:",E),T=v(",")}const z=C().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),M=C().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),F=C().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);y&&x.append("text").attr("x",k/2).attr("y",S/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(y);const P=x.append("g").attr("transform",`translate(0, ${S})`).attr("class","treemapContainer"),N=$(f).sum(e=>e.value??0).sort((e,t)=>
1(t.value??0)-(e.value??0)),A=w().size([b,L]).paddingTop(e=>e.children&&e.children.length>0?35:0).paddingInner(m).paddingLeft(e=>e.children&&e.children.length>0?10:0).paddingRight(e=>e.children&&e.children.length>0?10:0).paddingBottom(e=>e.children&&e.children.length>0?10:0).round(!0)(N),W=A.descendants().filter(e=>e.children&&e.children.length>0),D=P.selectAll(".treemapSection").data(W).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>0===e.depth?"display: none;":""),D.append("clipPath").attr("id",(e,t)=>`clip-section-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",25),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>z(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(0===e.depth)return"display: none;";const t=o({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text(e=>0===e.depth?"":e.data.name).attr("font-weight","bold").attr("style",e=>0===e.depth?"display: none;":"dominant-baseline: middle; font-size: 12px; fill:"+F(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+o({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).each(function(e){if(0===e.depth)return;const t=i(this),a=e.data.name;t.text(a);const s=e.x1-e.x0;let l;l=!1!==h.showValues&&e.value?s-10-30-10-6:s-6-6;const r=Math.max(15,l),n=t.node();if(n.getComputedTextLength()>r){const e="...";let s=a;for(;s.length>0;){if(s=a.substring(0,s.length-1),0===s.length){t.text(e),n.getComputedTextLength()>r&&t.text("");break}if(t.text(s+e),n.getComputedTextLength()<=r)break}}}),!1!==h.showValues&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?T(e.value):"").attr("font-style","italic").attr("style",e=>0===e.depth?"display: none;":"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+F(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+o({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"));const V=A.leaves(),B=P.selectAll(".treemapLeafGroup").data(V).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);B.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?z(e.parent.data.name):z(e.data.name)).attr("style",e=>o({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?z(e.parent.data.name):z(e.data.name)).attr("stroke-width",3),B.append("clipPath").attr("id",(e,t)=>`clip-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),B.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+F(e.data.name)+";"+o({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.data.name).each(function(e){const t=i(this),a=e.x1-e.x0,s=e.y1-e.y0,l=t.node(),r=a-8,n=s-8;if(r<10||n<10)return void t.style("display","none");let o=parseInt(t.style("font-size"),10);for(;l.getComputedTextLength()>r&&o>8;)o--,t.style("font-size",`${o}px`);let c=Math.max(6,Math.min(28,Math.round(.6*o))),d=o+2+c;for(;d>n&&o>
18&&(o--,c=Math.max(6,Math.min(28,Math.round(.6*o))),!(c<6&&8===o));)t.style("font-size",`${o}px`),d=o+2+c;t.style("font-size",`${o}px`),(l.getComputedTextLength()>r||o<8||n<o)&&t.style("display","none")}),!1!==h.showValues&&B.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+F(e.data.name)+";"+o({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.value?T(e.value):"").each(function(e){const t=i(this),a=this.parentNode;if(!a)return void t.style("display","none");const s=i(a).select(".treemapLabel");if(s.empty()||"none"===s.style("display"))return void t.style("display","none");const l=parseFloat(s.style("font-size")),r=Math.max(6,Math.min(28,Math.round(.6*l)));t.style("font-size",`${r}px`);const n=(e.y1-e.y0)/2+l/2+2;t.attr("y",n);const o=e.x1-e.x0,c=e.y1-e.y0-4,d=o-8;t.node().getComputedTextLength()>d||n+r>c||r<6?t.style("display","none"):t.style("display",null)});const R=h.diagramPadding??8;g(x,R,"flowchart",h?.useMaxWidth||!1)},"draw"),getClasses:t(function(e,t){return t.db.getClasses()},"getClasses")},F={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},P=t(({treemap:e}={})=>{const t=a(F,e);return`\n .treemapNode.section {\n stroke: ${t.sectionStrokeColor};\n stroke-width: ${t.sectionStrokeWidth};\n fill: ${t.sectionFillColor};\n }\n .treemapNode.leaf {\n stroke: ${t.leafStrokeColor};\n stroke-width: ${t.leafStrokeWidth};\n fill: ${t.leafFillColor};\n }\n .treemapLabel {\n fill: ${t.labelColor};\n font-size: ${t.labelFontSize};\n }\n .treemapValue {\n fill: ${t.valueColor};\n font-size: ${t.valueFontSize};\n }\n .treemapTitle {\n fill: ${t.titleColor};\n font-size: ${t.titleFontSize};\n }\n `},"getStyles"),N={parser:z,get db(){return new L},renderer:M,styles:P};export{N 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.