")))&&o.children.length>0};let r=i;if(!n(r)||(r=t(r.children),!s(r))||(r=t(r.children),!l(r)))return i;for(;l(r);)r=t(r.children);return r.removeFromParent(),r}function oi(i,e){return i?(i.children.forEach(t=>oi(t)),i.group&&i.group.frames.length<3&&i.group.removeFrame(i),i):null}function Cn(i){let e,t,n;return t=new Kt({props:{frame:i[3],rootFrame:i[3]}}),{c(){e=f("div"),we(t.$$.fragment),a(e,"class","call-stack-margins svelte-1hebm9u")},m(s,l){S(s,e,l),ce(t,e,null),n=!0},p(s,l){const r={};l&8&&(r.frame=s[3]),l&8&&(r.rootFrame=s[3]),t.$set(r)},i(s){n||(D(t.$$.fragment,s),n=!0)},o(s){N(t.$$.fragment,s),n=!1},d(s){s&&L(e),ue(t)}}}function Mn(i){let e;return{c(){e=f("div"),e.innerHTML='All frames were filtered out.
',a(e,"class","margins")},m(t,n){S(t,e,n)},p:F,i:F,o:F,d(t){t&&L(e)}}}function Fn(i){let e,t,n,s,l,r,o;const c=[Mn,Cn],d=[];function v(p,m){return p[3]?1:0}return n=v(i),s=d[n]=c[n](i),{c(){e=f("div"),t=f("div"),s.c(),l=b(),r=f("div"),a(t,"class","scroll-inner svelte-1hebm9u"),a(r,"class","scroll-size-fixer svelte-1hebm9u"),a(e,"class","call-stack-view svelte-1hebm9u")},m(p,m){S(p,e,m),u(e,t),d[n].m(t,null),i[7](t),u(e,l),u(e,r),i[8](r),i[9](e),o=!0},p(p,[m]){let h=n;n=v(p),n===h?d[n].p(p,m):(Oe(),N(d[h],1,1,()=>{d[h]=null}),Ve(),s=d[n],s?s.p(p,m):(s=d[n]=c[n](p),s.c()),D(s,1),s.m(t,null))},i(p){o||(D(s),o=!0)},o(p){N(s),o=!1},d(p){p&&L(e),d[n].d(),i[7](null),i[8](null),i[9](null)}}}function Pn(i,e,t){let n,{session:s}=e;const l=Vt([Z],([h])=>{const g=[h.removeImportlib?Ft:null,h.removeTracebackHide?Pt:null,ti,Jt,ii,h.removeIrrelevant?ni:null,h.removePyinstrument?si:null,h.collapseMode!=="disabled"?ei:null,oi].filter(E=>E!==null),w={filterThreshold:h.removeIrrelevantThreshold,hideRegex:h.collapseMode=="custom"?h.collapseCustomHide:void 0,showRegex:h.collapseMode=="custom"?h.collapseCustomShow:void 0};return{processors:g,options:w}});ge(i,l,h=>t(6,n=h));let r,o,c;bt(()=>{let h=0;const g=r;if(!g)throw new Error("element not set");if(!o)throw new Error("scrollInnerElement not set");if(!c)throw new Error("scrollSizeFixerElement not set");const w=new ResizeObserver(()=>{const C=o.getBoundingClientRect().height;C>h&&(h=C,t(2,c.style.top=`${h-1}px`,c))});w.observe(o);let E;return g.addEventListener("scroll",E=()=>{let C=g.scrollTop+g.clientHeight;const y=o.getBoundingClientRect().height;C{w.disconnect(),g.removeEventListener("scroll",E)}});let d;function v(h){ke[h?"unshift":"push"](()=>{o=h,t(1,o)})}function p(h){ke[h?"unshift":"push"](()=>{c=h,t(2,c)})}function m(h){ke[h?"unshift":"push"](()=>{r=h,t(0,r)})}return i.$$set=h=>{"session"in h&&t(5,s=h.session)},i.$$.update=()=>{var h;i.$$.dirty&96&&t(3,d=Qt(((h=s.rootFrame)==null?void 0:h.cloneDeep())??null,n.processors,n.options))},[r,o,c,d,l,s,n,v,p,m]}class Rn extends he{constructor(e){super(),de(this,e,Pn,Fn,re,{session:5})}}class In{constructor(e){T(this,"mediaQueryList",null);this.onDevicePixelRatioChanged=e,this._onChange=this._onChange.bind(this),this.createMediaQueryList()}createMediaQueryList(){this.removeMediaQueryList();let e=`(resolution: ${window.devicePixelRatio}dppx)`;this.mediaQueryList=matchMedia(e),this.mediaQueryList.addEventListener("change",this._onChange)}removeMediaQueryList(){var e;(e=this.mediaQueryList)==null||e.removeEventListener("change",this._onChange),this.mediaQueryList=null}_onChange(e){this.onDevicePixelRatioChanged(),this.createMediaQueryList()}destroy(){this.removeMediaQueryList()}}class Ln{constructor(e){T(this,"canvas");T(this,"_size_observer");T(this,"_devicePixelRatioObserver");T(this,"drawAnimationRequest",null);this.container=e,getComputedStyle(e).position!="absolute"&&(e.style.position="relative"),this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.canvas.style.width="100%",this.canvas.style.height="100%",this.container.appendChild(this.canvas),this.setCanvasSize=this.setCanvasSize.bind(this),this._size_observer=new ResizeObserver(this.setCanvasSize),this._size_observer.observe(e),this._devicePixelRatioObserver=new In(this.setCanvasSize),window.requestAnimationFrame(()=>{this.setCanvasSize()})}destroy(){this._size_observer.disconnect(),this._devicePixelRatioObserver.destroy(),this.canvas.remove(),this.drawAnimationRequest!==null&&(window.cancelAnimationFrame(this.drawAnimationRequest),this.drawAnimationRequest=null)}setNeedsRedraw(){this.drawAnimationRequest===null&&(this.drawAnimationRequest=window.requestAnimationFrame(()=>{this.drawAnimationRequest=null,this.canvasViewRedraw()}))}redrawIfNeeded(){this.drawAnimationRequest!==null&&(window.cancelAnimationFrame(this.drawAnimationRequest),this.drawAnimationRequest=null,this.canvasViewRedraw())}canvasViewRedraw(){const e=this.canvas.getContext("2d");e&&(e.resetTransform(),e.scale(window.devicePixelRatio,window.devicePixelRatio),this.redraw(e,{width:this.canvas.width/window.devicePixelRatio,height:this.canvas.height/window.devicePixelRatio}))}get width(){return this.canvas.width/window.devicePixelRatio}get height(){return this.canvas.height/window.devicePixelRatio}setCanvasSize(){const e=window.devicePixelRatio;this.canvas.height=this.container.clientHeight*e,this.canvas.width=this.container.clientWidth*e,this.canvasViewRedraw()}}function Sn(i){let e,t=i[2]=="self"?"self":"time",n,s,l,r=i[3](i[0].time)+"";return{c(){e=f("div"),n=I(t),s=b(),l=f("div"),a(e,"class","label svelte-ci3g2p"),a(l,"class","time-val svelte-ci3g2p")},m(o,c){S(o,e,c),u(e,n),S(o,s,c),S(o,l,c),l.innerHTML=r},p(o,c){c&4&&t!==(t=o[2]=="self"?"self":"time")&&_e(n,t),c&1&&r!==(r=o[3](o[0].time)+"")&&(l.innerHTML=r)},d(o){o&&(L(e),L(s),L(l))}}}function Dn(i){let e,t,n,s,l=i[3](i[0].time)+"",r,o=i[0].selfTime/i[0].time>.001&&ri(i);return{c(){e=f("div"),e.textContent="time",t=b(),n=f("div"),s=f("div"),r=b(),o&&o.c(),a(e,"class","label svelte-ci3g2p"),a(s,"class","time-val svelte-ci3g2p"),a(n,"class","time-row svelte-ci3g2p")},m(c,d){S(c,e,d),S(c,t,d),S(c,n,d),u(n,s),s.innerHTML=l,u(n,r),o&&o.m(n,null)},p(c,d){d&1&&l!==(l=c[3](c[0].time)+"")&&(s.innerHTML=l),c[0].selfTime/c[0].time>.001?o?o.p(c,d):(o=ri(c),o.c(),o.m(n,null)):o&&(o.d(1),o=null)},d(c){c&&(L(e),L(t),L(n)),o&&o.d()}}}function ri(i){let e,t,n,s=i[3](i[0].selfTime)+"";return{c(){e=f("div"),e.textContent="self",t=b(),n=f("div"),a(e,"class","label svelte-ci3g2p"),a(n,"class","time-val svelte-ci3g2p")},m(l,r){S(l,e,r),S(l,t,r),S(l,n,r),n.innerHTML=s},p(l,r){r&1&&s!==(s=l[3](l[0].selfTime)+"")&&(n.innerHTML=s)},d(l){l&&(L(e),L(t),L(n))}}}function Hn(i){let e,t,n=i[0].name+"",s,l,r,o,c,d,v,p,m,h;function g(C,y){return C[2]=="both"?Dn:Sn}let w=g(i),E=w(i);return{c(){e=f("div"),t=f("div"),s=I(n),l=b(),E.c(),r=b(),o=f("div"),o.textContent="loc",c=b(),d=f("div"),v=f("div"),m=b(),h=new Ri(!1),a(t,"class","name svelte-ci3g2p"),a(o,"class","label svelte-ci3g2p"),a(v,"class","location-color svelte-ci3g2p"),a(v,"style",p=`background: ${i[0].locationColor}`),h.a=null,a(d,"class","location-row"),a(e,"class","timeline-canvas-view-tooltip svelte-ci3g2p"),a(e,"style",`font: ${ai}; max-width: ${Vn}px;`)},m(C,y){S(C,e,y),u(e,t),u(t,s),u(e,l),E.m(e,null),u(e,r),u(e,o),u(e,c),u(e,d),u(d,v),u(d,m),h.m(i[1],d)},p(C,[y]){y&1&&n!==(n=C[0].name+"")&&_e(s,n),w===(w=g(C))&&E?E.p(C,y):(E.d(1),E=w(C),E&&(E.c(),E.m(e,r))),y&1&&p!==(p=`background: ${C[0].locationColor}`)&&a(v,"style",p),y&2&&h.p(C[1])},i:F,o:F,d(C){C&&L(e),E.d()}}}function li(i){return i.selfTime==i.time?"self":i.selfTime/i.time>.001?"both":"time"}function On(i,e){i.font=ai;const t=li(e)=="both"?140:70,n=i.measureText(e.name).width,s=i.measureText(e.location).width+46;let r=Math.max(t,n,s)+20;return r>310&&(r=310),r}const Vn=310,ai="400 13px Source Sans Pro, sans-serif";function xn(i,e,t){let{f:n}=e,s,l;function r(o){return`${o.toFixed(n.precision)}`}return i.$$set=o=>{"f"in o&&t(0,n=o.f)},i.$$.update=()=>{i.$$.dirty&1&&t(1,s=Ct(n.location)),i.$$.dirty&1&&t(2,l=li(n))},[n,s,l,r]}class Nn extends he{constructor(e){super(),de(this,e,xn,Hn,re,{f:0})}}const $n="#212325",ci=18,Bn=17,Ie=28,lt=17,ui=29,zn=["#3475BA","#318DBC","#47A298","#8AAE5D","#C1A731","#C07210","#B84210","#B53134","#9A3586","#4958B5","#3475BA"].map(Ki);class Wn extends Ln{constructor(t){super(t);T(this,"zoom",1);T(this,"startT",0);T(this,"yOffset",0);T(this,"frames",[]);T(this,"isZoomedIn",!1);T(this,"tooltipContainer");T(this,"tooltipComponent",null);T(this,"_rootFrame",null);T(this,"maxDepth",0);T(this,"tooltipLocation",null);T(this,"lastDrawWidth",0);T(this,"lastDrawHeight",0);T(this,"_libraryOrder",null);T(this,"_colors",[]);T(this,"_frameMaxT");T(this,"mouseLocation",null);T(this,"mouseDownLocation",null);T(this,"touches",{});this.onWheel=this.onWheel.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.windowMouseUp=this.windowMouseUp.bind(this),this.onTouchstart=this.onTouchstart.bind(this),this.onTouchmove=this.onTouchmove.bind(this),this.onTouchend=this.onTouchend.bind(this),this.onTouchcancel=this.onTouchend.bind(this),this.canvas.addEventListener("wheel",this.onWheel),this.canvas.addEventListener("mousemove",this.onMouseMove),this.canvas.addEventListener("mouseleave",this.onMouseLeave),this.canvas.addEventListener("mousedown",this.onMouseDown),this.canvas.addEventListener("touchstart",this.onTouchstart),this.canvas.addEventListener("touchmove",this.onTouchmove),this.canvas.addEventListener("touchend",this.onTouchend),this.canvas.addEventListener("touchcancel",this.onTouchcancel),this.tooltipContainer=document.createElement("div"),this.tooltipContainer.style.position="absolute",this.tooltipContainer.style.pointerEvents="none",this.container.appendChild(this.tooltipContainer)}destroy(){this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("mousemove",this.onMouseMove),this.canvas.removeEventListener("mouseleave",this.onMouseLeave),this.canvas.removeEventListener("mousedown",this.onMouseDown),this.canvas.removeEventListener("touchstart",this.onTouchstart),this.canvas.removeEventListener("touchmove",this.onTouchmove),this.canvas.removeEventListener("touchend",this.onTouchend),this.canvas.removeEventListener("touchcancel",this.onTouchcancel),this.tooltipContainer.remove(),super.destroy()}setRootFrame(t){this._rootFrame=t,this.frames=[],this._frameMaxT=void 0,this.maxDepth=0,this._collectFrames(t,0),this.fitContents(),this.setNeedsRedraw()}_collectFrames(t,n){this.frames.push({frame:t,depth:n,isApplicationCode:t.isApplicationCode,library:t.library,className:t.className,filePathShort:t.filePathShort}),this.maxDepth=Math.max(this.maxDepth,n);for(const s of t.children)s.identifier!==Ze&&this._collectFrames(s,n+1)}updateTooltip(t,n){var s,l;if(n){const r={name:this.frameName(n),time:n.frame.time,selfTime:this.frameSelfTime(n),totalTime:((s=this._rootFrame)==null?void 0:s.time)??1e-12,precision:((l=this._rootFrame)==null?void 0:l.context.precision)??3,location:`${n.filePathShort}:${n.frame.lineNo}`,locationColor:this.colorForFrame(n)};if(this.tooltipComponent?this.tooltipComponent.$set({f:r}):this.tooltipComponent=new Nn({target:this.tooltipContainer,props:{f:r}}),this.tooltipLocation){const o={x:this.tooltipLocation.x+12,y:this.tooltipLocation.y+12},c=On(t,r),d=this.width-10-c;o.x>d&&(o.x=d);const p=this.height-10-60;o.y>p&&(o.y=p),this.tooltipContainer.style.left=`${o.x}px`,this.tooltipContainer.style.top=`${o.y}px`}}n||this.tooltipComponent&&(this.tooltipComponent.$destroy(),this.tooltipComponent=null)}redraw(t,n){const{width:s,height:l}=n;(s!==this.lastDrawWidth||l!==this.lastDrawHeight)&&(this.isZoomedIn?this.clampViewport():this.fitContents()),this.lastDrawWidth=s,this.lastDrawHeight=l,t.fillStyle=$n,t.fillRect(0,0,s,l),this.drawAxes(t);for(const d of this.frames)this.drawFrame(t,d);t.globalAlpha=1;const r=this.maxYOffset>0||this.isZoomedIn,o=!!this.mouseDownLocation;this.canvas.style.cursor=o&&r?"grabbing":"initial",t.fillStyle="red",t.font='23px "Source Sans Pro", sans-serif';let c=null;!o&&this.tooltipLocation&&(c=this.hitTest(this.tooltipLocation)),this.updateTooltip(t,c)}drawAxes(t){const n=Math.max(800,this.width)/this.zoom;if(n==0)return;const s=Math.log10(n);let l=Math.ceil(s)+2;l<0&&(l=0);const r=Math.ceil(s)-3,o=c=>Ne(c,{from:[s,s-3],to:[.71,0],clamp:!0});for(let c=r;c.01){t.globalAlpha=h,t.font='13px "Source Sans Pro", sans-serif';let g=d.toFixed(c);g=="0"&&(g="0s");let w=m+10;t.fillText(g,v+3,w);let E=this.height+lt+10-this.yOffset;Ethis.width)return;if(t.fillStyle=this.colorForFrame(n),t.globalAlpha=n.isApplicationCode?1:.5,r<2){t.fillRect(s,l,r,o);return}let d=this.frameName(n);const v=Math.floor(r/3.3);if(d.length>v&&(d=d.substring(0,v)),d.length==0){t.fillRect(s,l,r,o);return}t.save(),t.beginPath(),t.rect(s,l,r,o),t.fill(),t.clip(),t.font='13px "Source Sans Pro", sans-serif',t.fillStyle="white";let p=s;p<0&&(p=0),t.fillText(d,p+2,l+13),t.restore()}_assignLibraryOrder(){const t={};for(const s of this.frames){const r=s.frame.library??"";t[r]=(t[r]||0)+s.frame.time}const n=Object.keys(t);n.sort((s,l)=>t[l]-t[s]),this._libraryOrder=n}colorForLibraryIndex(t){if(this._colors[t]!==void 0)return this._colors[t];const n=Math.pow(2,Math.ceil(Math.log2(t+1))),l=(2*t-n+1)/n,r=Gi(zn,l);return this._colors[t]=r,r}libraryIndexForFrame(t){this._libraryOrder||this._assignLibraryOrder();const n=t.library||"";let s=this._libraryOrder.indexOf(n);return s===-1&&(s=this._libraryOrder.length,this._libraryOrder.push(n)),s}colorForFrame(t){const n=this.libraryIndexForFrame(t);return this.colorForLibraryIndex(n)}get frameMaxT(){return this._frameMaxT===void 0&&(this._frameMaxT=this.frames.reduce((t,n)=>Math.max(t,n.frame.startTime+n.frame.time),0)),this._frameMaxT}get maxYOffset(){return Math.max(0,(this.maxDepth+1)*ci+lt*2+ui-this.height)}get minZoom(){return(this.width-2*Ie)/this.frameMaxT}get maxZoom(){return 6666666666666667e-8}fitContents(){this.startT=0,this.zoom=this.minZoom,this.isZoomedIn=!1}clampViewport(){this.zoomthis.maxZoom&&(this.zoom=this.maxZoom),this.startT<0&&(this.startT=0);const t=this.frameMaxT-(this.width-2*Ie)/this.zoom;this.startT>t&&(this.startT=t),this.yOffset<0&&(this.yOffset=0),this.yOffset>this.maxYOffset&&(this.yOffset=this.maxYOffset)}frameDims(t){const n=t.depth*ci+lt+ui-this.yOffset,s=Bn;let l=this.xForT(t.frame.startTime),o=this.xForT(t.frame.startTime+t.frame.time)-l;return o<1&&(o=1),o>1&&(o-=Ne(o,{from:[1,3],to:[0,1],clamp:!0})),{x:l,y:n,w:o,h:s}}xForT(t){return(t-this.startT)*this.zoom+Ie}tForX(t){return(t-Ie)/this.zoom+this.startT}frameName(t){let n;return t.className?n=`${t.className}.${t.frame.function}`:t.frame.function==""?n=t.filePathShort??t.frame.filePath??"":n=t.frame.function,n}frameSelfTime(t){let n=t.frame.time;const s=t.frame.children.filter(l=>!l.isSynthetic);for(const l of s)n-=l.time;return n}hitTest(t){for(const n of this.frames){const{x:s,y:l,w:r,h:o}=this.frameDims(n);if(t.x>=s&&t.x<=s+r&&t.y>=l&&t.y<=l+o)return n}return null}onWheel(t){const n=t.ctrlKey||t.metaKey,s=n?.01:.0023,l=this.tForX(t.offsetX);this.zoom*=1-t.deltaY*s,this.clampViewport(),this.startT=l-(t.offsetX-Ie)/this.zoom,n||(this.startT+=t.deltaX/this.zoom),this.clampViewport(),this.setNeedsRedraw(),t.preventDefault()}onMouseMove(t){const n={x:t.offsetX,y:t.offsetY},s=this.mouseLocation;if(this.mouseLocation=n,s&&this.mouseDownLocation){const l={x:n.x-s.x,y:n.y-s.y};this.startT-=l.x/this.zoom,this.yOffset-=l.y,this.clampViewport()}this.tooltipLocation=n,this.setNeedsRedraw()}onMouseLeave(t){this.mouseLocation=null,this.tooltipLocation=null,this.setNeedsRedraw()}onMouseDown(t){(t.button===0||t.button===1)&&(this.mouseDownLocation={x:t.offsetX,y:t.offsetY},window.addEventListener("mouseup",this.windowMouseUp),this.setNeedsRedraw())}windowMouseUp(t){window.removeEventListener("mouseup",this.windowMouseUp),this.mouseDownLocation=null,this.setNeedsRedraw()}onTouchstart(t){t.preventDefault(),t.stopPropagation();for(const n of Array.from(t.changedTouches))this.touches[n.identifier]={x:n.clientX,y:n.clientY,downT:this.tForX(n.clientX),startDate:Date.now(),downX:n.clientX,downY:n.clientY}}onTouchmove(t){t.preventDefault(),t.stopPropagation();let n=0;for(const l of Array.from(t.changedTouches)){const r=this.touches[l.identifier];r&&(n+=l.clientY-r.y,this.touches[l.identifier]={...r,x:l.clientX,y:l.clientY})}const s=n/Object.keys(this.touches).length;this.yOffset-=s,this.adjustXAxisForTouches(),this.setNeedsRedraw()}onTouchend(t){t.preventDefault(),t.stopPropagation();for(const n of Array.from(t.changedTouches))delete this.touches[n.identifier];this.setNeedsRedraw()}onTouchcancel(t){t.preventDefault(),t.stopPropagation();for(const n of Array.from(t.changedTouches))delete this.touches[n.identifier];this.setNeedsRedraw()}adjustXAxisForTouches(){const t=Object.keys(this.touches).map(Number);if(t.length!=0){if(t.length==1){const n=this.touches[t[0]];this.startT=n.downT-(n.x-Ie)/this.zoom}if(t.length>=2){const n=this.touches[t[0]],s=this.touches[t[1]],l=(s.x-n.x)/(s.downT-n.downT),r=n.downT-(n.x-Ie)/l;this.startT=r,this.zoom=l}this.clampViewport()}}}function qn(i){let e;return{c(){e=f("div"),e.innerHTML="",a(e,"class","timeline svelte-p2tt1k")},m(t,n){S(t,e,n),i[6](e)},p:F,i:F,o:F,d(t){t&&L(e),i[6](null)}}}function Un(i,e,t){let n,{session:s}=e;const l=Vt([je],([v])=>({processors:[v.removeImportlib?Ft:null,v.removeTracebackHide?Pt:null,v.removePyinstrument?si:null].filter(h=>h!==null),options:{}}));ge(i,l,v=>t(5,n=v));let r,o=null,c=null;Ii(()=>{c==null||c.destroy()});function d(v){ke[v?"unshift":"push"](()=>{o=v,t(0,o)})}return i.$$set=v=>{"session"in v&&t(2,s=v.session)},i.$$.update=()=>{var v;i.$$.dirty&36&&t(3,r=Qt(((v=s.rootFrame)==null?void 0:v.cloneDeep())??null,n.processors,n.options)),i.$$.dirty&1&&o&&t(4,c=new Wn(o)),i.$$.dirty&24&&r&&c&&c.setRootFrame(r)},[o,l,s,r,c,n,d]}class Yn extends he{constructor(e){super(),de(this,e,Un,qn,re,{session:2})}}function Xn(i){let e,t,n=i[1].viewMode+"",s;return{c(){e=f("div"),t=I("Unknown view mode: "),s=I(n),a(e,"class","error")},m(l,r){S(l,e,r),u(e,t),u(e,s)},p(l,r){r&2&&n!==(n=l[1].viewMode+"")&&_e(s,n)},i:F,o:F,d(l){l&&L(e)}}}function Gn(i){let e,t;return e=new Yn({props:{session:i[0]}}),{c(){we(e.$$.fragment)},m(n,s){ce(e,n,s),t=!0},p(n,s){const l={};s&1&&(l.session=n[0]),e.$set(l)},i(n){t||(D(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){ue(e,n)}}}function jn(i){let e,t;return e=new Rn({props:{session:i[0]}}),{c(){we(e.$$.fragment)},m(n,s){ce(e,n,s),t=!0},p(n,s){const l={};s&1&&(l.session=n[0]),e.$set(l)},i(n){t||(D(e.$$.fragment,n),t=!0)},o(n){N(e.$$.fragment,n),t=!1},d(n){ue(e,n)}}}function Zn(i){let e;return{c(){e=f("div"),e.innerHTML=' No samples recorded.
',a(e,"class","margins")},m(t,n){S(t,e,n)},p:F,i:F,o:F,d(t){t&&L(e)}}}function Kn(i){let e,t,n,s,l,r,o,c;n=new pn({props:{session:i[0]}});const d=[Zn,jn,Gn,Xn],v=[];function p(m,h){return m[0].rootFrame?m[1].viewMode==="call-stack"?1:m[1].viewMode==="timeline"?2:3:0}return r=p(i),o=v[r]=d[r](i),{c(){e=f("div"),t=f("div"),we(n.$$.fragment),s=b(),l=f("div"),o.c(),a(t,"class","header"),a(l,"class","body svelte-1vwroj7"),a(e,"class","app svelte-1vwroj7")},m(m,h){S(m,e,h),u(e,t),ce(n,t,null),u(e,s),u(e,l),v[r].m(l,null),c=!0},p(m,[h]){const g={};h&1&&(g.session=m[0]),n.$set(g);let w=r;r=p(m),r===w?v[r].p(m,h):(Oe(),N(v[w],1,1,()=>{v[w]=null}),Ve(),o=v[r],o?o.p(m,h):(o=v[r]=d[r](m),o.c()),D(o,1),o.m(l,null))},i(m){c||(D(n.$$.fragment,m),D(o),c=!0)},o(m){N(n.$$.fragment,m),N(o),c=!1},d(m){m&&L(e),ue(n),v[r].d()}}}function Qn(i,e,t){let n;ge(i,Ge,p=>t(1,n=p));let{session:s}=e;const l=document.createElement("link");l.rel="shortcut icon",l.href=vn,document.head.appendChild(l);const r=document.createElement("link");r.rel="preload",r.as="style",r.onload=()=>{r.rel="stylesheet"},r.href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:400,600&display=swap",document.head.appendChild(r);const o=s.rootFrame,c=o==null?void 0:o.time.toLocaleString(void 0,{maximumSignificantDigits:3});let d,v;return(v=/[^\s/]+(:\d+)?$/.exec(s.target_description))?d=v[0]:d=s.target_description,document.title=`${c}s - ${d} - pyinstrument`,i.$$set=p=>{"session"in p&&t(0,s=p.session)},[s,n]}class Jn extends he{constructor(e){super(),de(this,e,Qn,Kn,re,{session:0})}}class es{constructor(e){T(this,"startTime");T(this,"duration");T(this,"minInterval");T(this,"maxInterval");T(this,"precision");T(this,"sampleCount");T(this,"target_description");T(this,"cpuTime");T(this,"rootFrame");T(this,"sysPath");T(this,"sysPrefixes");T(this,"_shortenPathCache",{});this.startTime=e.session.start_time,this.duration=e.session.duration,this.minInterval=e.session.min_interval,this.maxInterval=e.session.max_interval,this.sampleCount=e.session.sample_count,this.target_description=e.session.target_description,this.cpuTime=e.session.cpu_time,this.sysPath=e.session.sys_path,this.sysPrefixes=e.session.sys_prefixes,this.precision=Math.ceil(-Math.log10(Math.min(Math.max(1e-9,this.maxInterval),1))),this.rootFrame=e.frame_tree?new Ke(e.frame_tree,this):null}shortenPath(e){if(this._shortenPathCache[e])return this._shortenPathCache[e];let t=e;if($e(e).length>1)for(const s of this.sysPath){const l=ts(e,s);$e(l).length<$e(t).length&&(t=l)}return this._shortenPathCache[e]=t,t}}function $e(i){return i.split(/[/\\]/)}function di(i){const e=$e(i);return e.length>0&&e[0].endsWith(":")?e[0]:null}function ts(i,e){if(di(i)!=di(e))return i;const t=$e(i),n=$e(e);let s=0;for(;s"..").concat(t.slice(s)).join("/")}return{render(i,e){const t=new es(e);return new Jn({target:i,props:{session:t}})}}}();