(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[6520],{76520:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>w});var l=o(69060),n=o(47600),i=o(66152),a=o(55707),r=o(51560),c=o(79468),s=o(66156),u=o(95705),p=o(64640),b=o(3428),d=o(48504),f=o(82496),h=null;const w=()=>{const e=(0,r.i6)(),[t,o]=(0,l.useState)(!1),[w,g]=(0,l.useState)(["cpu","mem","block","mutex","goroutines"]),m=(0,c.IX)(),x=e=>{let t=[];t=w.indexOf(e.target.value)>-1?w.filter((t=>t!==e.target.value)):[...w,e.target.value],g(t)},y=(0,s.Ab)();return(0,l.useEffect)((()=>{y((0,u.i8)("profile"))}),[]),(0,f.jsxs)(l.Fragment,{children:[(0,f.jsx)(b.c,{label:"Profile",actions:(0,f.jsx)(d.c,{})}),(0,f.jsxs)(i._al,{children:[!m&&(0,f.jsx)(p.c,{compactMode:!0}),(0,f.jsxs)(i.yE_,{children:[(0,f.jsxs)(i.kvh,{sx:{display:"flex",gap:10,"& div":{width:"initial"},"& .inputItem:not(:last-of-type)":{marginBottom:0}},children:[(0,f.jsx)(i.mWW,{noMinWidth:!0,children:"Types to profile:"}),[{label:"cpu",value:"cpu"},{label:"mem",value:"mem"},{label:"block",value:"block"},{label:"mutex",value:"mutex"},{label:"goroutines",value:"goroutines"}].map((e=>(0,f.jsx)(i.ywS,{checked:w.indexOf(e.value)>-1,disabled:t||!m,id:"checkbox-".concat(e.label),label:e.label,name:"checkbox-".concat(e.label),onChange:x,value:e.value},"checkbox-".concat(e.label))))]}),(0,f.jsxs)(i.kvh,{sx:{display:"flex",justifyContent:"flex-end",marginTop:24,gap:10},children:[(0,f.jsx)(i.qaq,{id:"start-profiling",type:"submit",variant:m?"callAction":"regular",disabled:t||w.length<1||!m,onClick:()=>{m?(()=>{const e=w.join(","),t=new URL(window.location.toString()),l=t.port,i=new URL(document.baseURI).pathname,r=(0,a.K_)(t.protocol);if(null!==(h=new n.w3cwebsocket("".concat(r,"://").concat(t.hostname,":").concat(l).concat(i,"ws/profile?types=").concat(e))))h.onopen=()=>{o(!0),h.send("ok")},h.onmessage=e=>{let t=new Blob([e.data],{type:"application/zip"});o(!1);var l=document.createElement("a");l.href=window.URL.createObjectURL(t),l.download="profile.zip",document.body.appendChild(l),l.click(),document.body.removeChild(l)},h.onclose=()=>{console.log("connection closed by server"),o(!1)}})():e("/support/register")},label:"Start Profiling"}),(0,f.jsx)(i.qaq,{id:"stop-profiling",type:"submit",variant:"callAction",color:"primary",disabled:!t||!m,onClick:()=>{h.close(1e3),o(!1)},label:"Stop Profiling"})]})]})]})]})}},7504:e=>{var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},47600:(e,t,o)=>{var l;if("object"===typeof globalThis)l=globalThis;else try{l=o(7504)}catch(r){}finally{if(l||"undefined"===typeof window||(l=window),!l)throw new Error("Could not determine global this")}var n=l.WebSocket||l.MozWebSocket,i=o(3068);function a(e,t){return t?new n(e,t):new n(e)}n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(a,e,{get:function(){return n[e]}})})),e.exports={w3cwebsocket:n?a:null,version:i}},3068:(e,t,o)=>{e.exports=o(40648).version},40648:e=>{"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=6520.9be3294f.chunk.js.map