1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`8ad37547-c29e-4945-8d18-5d1ea184c861`,e._sentryDebugIdIdentifier=`sentry-dbid-8ad37547-c29e-4945-8d18-5d1ea184c861`)}catch{}})();import"./_sentry-release-injection-file-CF9M8Hp2.js";import{ht as e,l as t}from"./runtime-core.esm-bundler-BtSCGTMb.js";import{Gn as n,wt as r}from"./store-DgpH8Ps7.js";import{n as i}from"./pinia-BRp_2fvD.js";var a={getStatus:()=>n.get(`/api/dev-panel/status`).then(e=>e.data),getCommands:()=>n.get(`/api/dev-panel/commands`).then(e=>e.data),getCommandMetadata:(e,t={})=>n.post(`/api/dev-panel/command/${e}/metadata`,{parameters:t}).then(e=>e.data),executeCommand:({commandId:e,parameters:t})=>n.post(`/api/dev-panel/execute`,{commandId:e,parameters:t}).then(e=>e.data),getExecutionStatus:e=>n.get(`/api/dev-panel/executions/${e}`).then(e=>e.data),impersonate:(e,t=`realLogin`)=>n.post(`/api/dev-panel/impersonate`,{userId:e,mode:t}).then(e=>e.data)},o={PRODUCT_MODULES:`product-modules`,INFRASTRUCTURE:`infrastructure`,IMPERSONATION:`impersonation`},s={FILL_REVIEW_ASSESSMENTS:`fill-review-assessments`,GENERATE_TEST_SURVEYS:`generate-test-surveys`},c=[{id:o.IMPERSONATION,label:`ðµ Impersonation`}],l=1500,u=1200,d=e=>e===`success`||e===`failed`,f=e=>({status:e.status===`success`?`success`:`failed`,logs:e.logs,exitCode:e.exitCode??(e.status===`success`?0:1),...e.error===void 0?{}:{error:e.error},...e.result===void 0?{}:{result:e.result}}),p=i(`devPanel`,()=>{let n=e(!1),i=e(!1),s=e([]),p=e(null),m=e(null),h=e(!1),g=e(!1),_=e(null),v=e(null),y=e(!1),b=e(!1),x=e(!1),S=e(null),C=new Map,w=e({}),T=0,E=null,D=null,O=e(null),k=t(()=>s.value.find(e=>e.id===O.value)||null),A=(e,t)=>{for(let n of t)for(let t of n.sections){let n=t.commands.find(t=>t.id===e);if(n)return n}return null},j=t(()=>k.value?k.value.sections.map(e=>({_id:e.id,sectionName:e.name,sectionDescription:e.description,commands:e.commands,show:!0})):[]),M=t(()=>{let e=s.value.map(e=>({label:e.name,active:O.value===e.id,handler:()=>{O.value=e.id},show:!0})),t=c.map(e=>({label:e.label,active:O.value===e.id,handler:()=>{O.value=e.id},show:e.id===o.IMPERSONATION?i.value:!0}));return[...e,...t]}),N=e=>{let t=e?.parameters??[],n={};for(let e of t)e.default!==void 0&&(n[e.name]=e.default);return n},P=()=>{E&&=(E(),null),D&&=(D(Error(`Polling has been manually canceled`)),null)},F=async()=>{let e=++T,t=t=>{e===T&&t()};try{let e=await a.getStatus();t(()=>{n.value=e.enabled,i.value=e.impersonationAllowed})}catch{t(()=>{n.value=!1,i.value=!1})}},I=()=>{T+=1,n.value=!1,i.value=!1},L=async()=>{b.value=!0,S.value=null;try{return s.value=await a.getCommands(),!O.value&&s.value.length>0&&(O.value=s.value[0].id),s.value}catch(e){return S.value=e instanceof Error?e.message:`Failed to fetch commands`,s.value}finally{b.value=!1}},R=async e=>{let{commandId:t,parameters:n}=e;P(),y.value=!0,S.value=null,_.value={jobId:``,status:`queued`,logs:[]},v.value=null;try{let{jobId:e}=await a.executeCommand({commandId:t,parameters:n});v.value=e,_.value={jobId:e,status:`queued`,logs:[]};let{future:i,cancel:o}=r({request:async()=>{let t=await a.getExecutionStatus(e);return v.value===e&&(_.value=t),t},pollingPeriod:l,maxAttempts:u,shouldStop:e=>d(e.status)});E=o;let s=new Promise((e,t)=>{D=t}),c=await Promise.race([i,s]);return E=null,D=null,v.value===e&&(_.value=c),f(c)}catch(e){throw e instanceof Error&&e.message===`Polling has been manually canceled`||(S.value=e instanceof Error?e.message:`Failed to execute command`),e}finally{y.value=!1}},z=()=>{h.value=!0,s.value.length===0?(O.value=null,L()):O.value=s.value[0].id},B=()=>{h.value=!1},V=async(e,t={})=>{x.value=!0;try{let n=`${e}:${JSON.stringify(t)}`,r=C.get(n);if(r){m.value=r;return}let i=await a.getCommandMetadata(e,t);C.set(n,i),m.value=i}catch{m.value=null}finally{x.value=!1}};return{serverAllowsDevPanel:n,impersonationAllowed:i,categories:s,selectedCommand:p,commandMetadata:m,isDrawerOpen:h,isExecutionModalOpen:g,currentExecution:_,currentJobId:v,isExecuting:y,isLoading:b,isLoadingMetadata:x,error:S,executionFormData:w,tabs:M,activeTabId:O,scrollspySections:j,fetchAccessStatus:F,resetAccessStatus:I,fetchCommands:L,fetchCommandMetadata:V,executeCommand:R,openDrawer:z,closeDrawer:B,openExecutionModal:async e=>{P(),v.value=null,y.value=!1;let t=await L(),n=A(e.id,t)??e;p.value=n,m.value=null,_.value=null,w.value=N(n),g.value=!0,await V(n.id)},closeExecutionModal:()=>{P(),g.value=!1,p.value=null,_.value=null,v.value=null,y.value=!1,m.value=null,w.value={}},$reset:()=>{P(),I(),s.value=[],p.value=null,m.value=null,h.value=!1,g.value=!1,_.value=null,v.value=null,y.value=!1,b.value=!1,x.value=!1,S.value=null,C.clear(),w.value={},O.value=null}}});export{a as i,o as n,p as r,s as t}; 2//# sourceMappingURL=devPanelStore-CkBhInBB.js.map
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.