import{C as c}from"./gateway.4d0dc75b.js";import{b as C,e6 as j,eQ as O,d as v,o as u,c as l,u as d,F as I}from"./index.e310aebb.js";import{C as S}from"./CheckCircleFilled.8ed73a12.js";import{L as x}from"./LoadingOutlined.c81a4534.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="96ad9602-f3b8-45ce-89e6-46a8bde38f85",r._sentryDebugIdIdentifier="sentry-dbid-96ad9602-f3b8-45ce-89e6-46a8bde38f85")}catch{}})();var _={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm192 472c0 4.4-3.6 8-8 8H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h368c4.4 0 8 3.6 8 8v48z"}}]},name:"minus-circle",theme:"filled"};const $=_;function y(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),n.forEach(function(s){E(r,s,e[s])})}return r}function E(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var m=function(t,e){var n=y({},t,e.attrs);return C(j,y({},n,{icon:O}),null)};m.displayName="CloseCircleFilled";m.inheritAttrs=!1;const k=m;function w(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),n.forEach(function(s){P(r,s,e[s])})}return r}function P(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var h=function(t,e){var n=w({},t,e.attrs);return C(j,w({},n,{icon:$}),null)};h.displayName="MinusCircleFilled";h.inheritAttrs=!1;const A=h,R=["running","lock-failed","failed","finished","abandoned"];class f{constructor(t){this.dto=t}static from(t){return new f(t)}get entries(){return this.dto.sort((t,e)=>t.sequence-e.sequence).filter(t=>t.event!=="form-message")}}class g{constructor(t){this.dto=t}static from(t){return new g(t)}get id(){return this.dto.id}get shortId(){return this.dto.id.slice(0,8)}get createdAt(){return new Date(this.dto.createdAt)}get updatedAt(){return new Date(this.dto.updatedAt)}get status(){return this.dto.status}get context(){return this.dto.context}get buildId(){var t;return(t=this.dto.buildId)!=null?t:""}get stageId(){return this.dto.stageId}get duration_seconds(){return this.status==="running"?"-":`${(this.updatedAt.getTime()-this.createdAt.getTime())/1e3} s`}get stageRunId(){return this.dto.stageRunId}get projectId(){return this.dto.projectId}}class T{async list({projectId:t,...e}){var p,a;const n={...e,offset:(p=e.offset)==null?void 0:p.toString(),limit:(a=e.limit)==null?void 0:a.toString()};Object.keys(n).forEach(o=>n[o]===void 0&&delete n[o]);const s=await c.get(`projects/${t}/executions`,n);return{executions:s.executions.map(o=>g.from(o)),totalCount:s.totalCount}}async fetchLogs(t,e){const n=await c.get(`projects/${t}/executions/${e}/logs`);return f.from(n)}async fetchThreadData(t,e){return(await c.get(`projects/${t}/executions/${e}/thread-data`)).response}async getExecutionTasks(t,e){return await c.get(`projects/${t}/executions/${e}/tasks`)}async fetchStages(){throw new Error("Method not implemented.")}}class N{async list(t){var o,b;const e={...t,offset:(o=t.offset)==null?void 0:o.toString(),limit:(b=t.limit)==null?void 0:b.toString()};Object.keys(e).forEach(i=>e[i]===void 0&&delete e[i]);const n=Object.fromEntries(Object.entries(e!=null?e:{}).filter(([,i])=>i!=null)),s=Object.keys(n).length>0?`?${new URLSearchParams(n).toString()}`:"",a=await(await fetch(`/_editor/api/executions${s}`)).json();return{executions:a.executions.map(i=>g.from(i)),totalCount:a.totalCount}}async fetchLogs(t,e){const s=await(await fetch(`/_editor/api/logs/${e}`)).json();return f.from(s)}async fetchThreadData(){return{}}async getExecutionTasks(t,e){return await(await fetch(`/_editor/api/executions/${e}/tasks`)).json()}async fetchStages(){return await(await fetch("/_editor/api/executions/stages")).json()}}const B=v({__name:"ExecutionStatusIcon",props:{status:{}},setup(r){return(t,e)=>t.status==="finished"?(u(),l(d(S),{key:0,style:{color:"#33b891"}})):t.status==="failed"?(u(),l(d(k),{key:1,style:{color:"#fa675c"}})):t.status==="abandoned"||t.status==="lock-failed"?(u(),l(d(A),{key:2,style:{color:"#f69220"}})):t.status==="running"?(u(),l(d(x),{key:3})):I("",!0)}});export{N as L,T as R,B as _,R as e};
//# sourceMappingURL=ExecutionStatusIcon.vue_vue_type_script_setup_true_lang.f5f02442.js.map
