import{d as S,o as d,c as u,F as y,a as o,g as w,n as x,t as p,r as D,j as E,b as $,h as b,N as P,K as T,f as C,i as z}from"./index-CXwCk-SR.js";import{_ as L}from"./_plugin-vue_export-helper-DlAUqK2U.js";const B={class:"row"},I={key:1,class:"caret-spacer"},N=["title"],R={class:"cell num"},_={class:"cell num self"},M={class:"cell num"},V=S({__name:"ProfileStackRow",props:{node:{},thread:{},depth:{}},setup(e){const g=e,a=b(!0),f=g.depth*12;return(k,i)=>{const m=P("ProfileStackRow",!0);return d(),u(y,null,[o("div",B,[o("div",{class:x(["cell sig",{"is-top":e.node.topDur,"is-root":e.node.parentId==="0"}]),style:w({width:e.thread+"px",paddingLeft:8+f+"px"})},[e.node.children&&e.node.children.length?(d(),u("span",{key:0,class:x(["caret",{open:a.value}]),onClick:i[0]||(i[0]=c=>a.value=!a.value)},"▸",2)):(d(),u("span",I)),o("span",{class:"sig-text",title:e.node.codeSignature},p(e.node.codeSignature),9,N)],6),o("div",R,p(e.node.duration),1),o("div",_,p(e.node.durationChildExcluded),1),o("div",M,p(e.node.count),1)]),a.value&&e.node.children?(d(!0),u(y,{key:0},D(e.node.children,(c,t)=>(d(),E(m,{key:"c"+t,node:c,thread:e.thread,depth:e.depth+1},null,8,["node","thread","depth"]))),128)):$("",!0)],64)}}}),F=L(V,[["__scopeId","data-v-bbca05b6"]]),X={class:"stack-table"},j={class:"stack-scroll"},A={class:"stack-header"},H={class:"cell num"},K={class:"stack-body"},q={key:0,class:"empty"},G=S({__name:"ProfileStackTable",props:{trees:{},highlightTop:{type:Boolean}},emits:["toggle-highlight"],setup(e,{emit:g}){const a=e,f=g,k=z(()=>{if(!a.trees.length)return[];const t=[...a.trees.flatMap(n=>n.elements.map(l=>l.durationChildExcluded))].sort((n,l)=>l-n).filter((n,l)=>l<10&&n!==0),r=[];for(const n of a.trees){const l={},h=n.elements.map(s=>({...s,topDur:t.includes(s.durationChildExcluded)&&a.highlightTop}));for(const s of h)l[s.id]=s;for(const s of h){if(s.parentId==="0"){r.push(s);continue}const v=l[s.parentId];v&&(v.children??(v.children=[])).push(s)}}return r}),i=b(520),m=b(null);return T(()=>{const c=m.value;c&&c.addEventListener("mousedown",t=>{const r=t.clientX,n=i.value,l=s=>{i.value=Math.max(120,n+(s.clientX-r))},h=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",h)})}),(c,t)=>(d(),u("div",X,[o("div",j,[o("div",A,[o("div",{class:"cell sig",style:w({width:i.value+"px"})},[t[1]||(t[1]=C(" Thread Stack ",-1)),o("span",{ref_key:"dragger",ref:m,class:"dragger",title:"Drag to resize"},"⇿",512)],4),t[3]||(t[3]=o("div",{class:"cell num"},"Duration (ms)",-1)),o("div",H,[t[2]||(t[2]=C(" Self Duration (ms) ",-1)),o("button",{type:"button",class:x(["top-slow",{"is-on":e.highlightTop}]),onClick:t[0]||(t[0]=r=>f("toggle-highlight")),title:"Highlight top 10 slow methods"}," top slow ",2)]),t[4]||(t[4]=o("div",{class:"cell num"},"Dump Count",-1))]),o("div",K,[k.value.length?$("",!0):(d(),u("div",q,"No analyze data yet — pick a profiled span and click Analyze.")),(d(!0),u(y,null,D(k.value,(r,n)=>(d(),E(F,{key:"r"+n,node:r,thread:i.value,depth:0},null,8,["node","thread"]))),128))])])]))}}),Q=L(G,[["__scopeId","data-v-348476e0"]]);export{Q as P};
