import{C as h}from"./router.1b12d634.js";import{f as u,eG as l,f3 as w,f4 as I,d as j,b as s,c as a,u as c,ex as S}from"./outputWidgets.ed48fa42.js";import{C as P}from"./CheckCircleFilled.42e1853c.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]="dc63a933-fbaf-478d-9797-d15435209dff",r._sentryDebugIdIdentifier="sentry-dbid-dc63a933-fbaf-478d-9797-d15435209dff")}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 A=_;function O(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(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach(function(i){F(r,i,e[i])})}return r}function F(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var d=function(t,e){var n=O({},t,e.attrs);return u(l,O({},n,{icon:w}),null)};d.displayName="CloseCircleFilled";d.inheritAttrs=!1;const D=d;function v(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(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach(function(i){E(r,i,e[i])})}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 f=function(t,e){var n=v({},t,e.attrs);return u(l,v({},n,{icon:I}),null)};f.displayName="LoadingOutlined";f.inheritAttrs=!1;const $=f;function C(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(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach(function(i){x(r,i,e[i])})}return r}function x(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var g=function(t,e){var n=C({},t,e.attrs);return u(l,C({},n,{icon:A}),null)};g.displayName="MinusCircleFilled";g.inheritAttrs=!1;const M=g;class B{async list({projectId:t,...e}){var b,y;const n={...e,offset:(b=e.offset)==null?void 0:b.toString(),limit:(y=e.limit)==null?void 0:y.toString()};Object.keys(n).forEach(o=>n[o]===void 0&&delete n[o]);const i=await h.get(`projects/${t}/executions`,n);return{executions:i.executions.map(o=>m.from(o)),totalCount:i.totalCount}}async fetchLogs(t,e){const n=await h.get(`projects/${t}/executions/${e}/logs`);return p.from(n)}}class p{constructor(t){this.dto=t}static from(t){return new p(t)}get entries(){return this.dto.sort((t,e)=>t.sequence-e.sequence).filter(t=>t.event!=="form-message")}}class m{constructor(t){this.dto=t}static from(t){return new m(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(){return this.dto.buildId}get stageId(){return this.dto.stageId}get duration_seconds(){return(this.updatedAt.getTime()-this.createdAt.getTime())/1e3}get stageRunId(){return this.dto.stageRunId}get projectId(){return this.dto.projectId}}const R=j({__name:"ExecutionStatusIcon",props:{status:{}},setup(r){return(t,e)=>t.status==="finished"?(s(),a(c(P),{key:0,style:{color:"#33b891"}})):t.status==="failed"?(s(),a(c(D),{key:1,style:{color:"#fa675c"}})):t.status==="abandoned"||t.status==="lock-failed"?(s(),a(c(M),{key:2,style:{color:"#f69220"}})):t.status==="running"?(s(),a(c($),{key:3})):S("",!0)}});export{B as E,R as _};
//# sourceMappingURL=ExecutionStatusIcon.vue_vue_type_script_setup_true_lang.f1d7480a.js.map
