import{d as l,o as c,H as u,b as p,et as g,f,u as w,af as b}from"./outputWidgets.75a5b0b9.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="71b4ca05-741c-4491-a3e3-c38d321852d4",s._sentryDebugIdIdentifier="sentry-dbid-71b4ca05-741c-4491-a3e3-c38d321852d4")}catch{}})();class y{async list(t){const a=new URLSearchParams({stage:t});return await(await fetch(`/_editor/api/stage_runs?${a}`)).json()}}const h=new y;class r{constructor(t){this.dto=t}static async list(t){return(await h.list(t)).map(o=>new r(o))}get id(){return this.dto.id}get data(){return this.dto.data}get assignee(){return this.dto.assignee}get stage(){return this.dto.stage}get status(){return this.dto.status}}const S=l({__name:"StageRunSelector",props:{path:{},optional:{type:Boolean},disabled:{type:Boolean}},emits:["select"],setup(s,{emit:t}){const a=s;c(async()=>{const i=await r.list(a.path);n.options=i.filter(e=>e.status==="waiting").map(e=>({value:e.id,label:e.id}))});const o=i=>{t("select",i)},n=u({options:[],loading:!1});return(i,e)=>(p(),g("div",null,[f(w(b),{value:n.stageRunId,"onUpdate:value":e[0]||(e[0]=d=>n.stageRunId=d),"filter-option":"","allow-clear":a.optional,style:{width:"100%"},placeholder:"Select task instance",options:n.options,disabled:a.disabled,"not-found-content":"There are no waiting task instances",onSelect:e[1]||(e[1]=d=>o(d))},null,8,["value","allow-clear","options","disabled"])]))}});export{r as S,S as _};
//# sourceMappingURL=StageRunSelector.vue_vue_type_script_setup_true_lang.4674e54d.js.map
