1import{_,o as p,c as y,a4 as j,A as f,z as w,X as g,aO as h,u as C,bc as E,bl as P,aI as v,C as t}from"./XTQa8YUS.js";import{u as O}from"./NZhRwgjy.js";const x={name:"ScenarioGetConnector",props:{noFetch:Boolean,scenarioId:{type:String,default:""},projectId:{type:String,default:""}},setup(r){const n=f(),s=w(),e=g(),i=h(),{$sentryCaptureException:d}=C(),o=t(()=>r.scenarioId||e.params.sid),a=t(()=>r.projectId||e.params.id),l=t(()=>n.getScenarioById(o.value)),u=t(()=>s.isProjectOwner(a.value)),{status:S,error:m}=O("getScenario",async()=>{if(!r.noFetch)try{o.value&&a.value?await n.getScenario({id:o.value,pid:a.value}):console.warn("Scenario ID and Project ID required to get scenario")}catch(I){const c=new E({errorCode:P,error:I,payload:{id:o.value,pid:a.value}});throw d(c),v.$emit("add",{title:"Scenario Error",message:"We couldn't load the scenario. Maybe it doesn't exist?",actionLabel:"Contact Support",actionCallback:()=>{i.push({name:"contact",query:{message:`I can't load up the scenario! ${e.params.sid}`}})},timeout:-1,color:"error"}),console.error(c),c}},{watch:[()=>r.projectId,()=>r.scenarioId]});return{status:S,error:m,scenario:l,internalProjectId:a,internalScenarioId:o,scenariosStore:n,isProjectOwner:u}}},R={class:"ScenarioGetConnector"};function b(r,n,s,e,i,d){return p(),y("div",R,[j(r.$slots,"default",{loading:e.status==="pending",error:e.error,scenario:e.scenario,isOwner:e.scenariosStore.isScenarioOwner(e.internalScenarioId),isProjectOwner:e.isProjectOwner,canRead:e.scenariosStore.canReadScenario(e.internalScenarioId),canEdit:e.scenariosStore.canEditScenario(e.internalScenarioId),temporaryScenario:e.scenariosStore.isTemporaryScenario(e.internalProjectId)})])}const D=_(x,[["render",b]]);export{D as default};
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.