import{d as p,s as c,r as w}from"./jwt-decode.esm-BYfS37aG.js";import"./router-D53qV9Zg.js";import{B as b,a as m}from"./build-BF0fFutA.js";import{a as S}from"./project-C7QI6pXl.js";import"./tables-nYEEmE6H.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="9f20c765-574a-40c7-af41-9355dea3e57d",t._sentryDebugIdIdentifier="sentry-dbid-9f20c765-574a-40c7-af41-9355dea3e57d")}catch{}})();const x=p("build",()=>{const t=c([]),n=c([]),s=w(!1);let u=null;const l=new Map;async function o(e){const a=await b.list(e);return u===e&&(t.value=a),a}async function i(e){const a=await S.getStatus(e);return u===e&&(n.value=a),a}async function f(e){s.value=!0;try{const[a,r]=await Promise.all([o(e),i(e)]);return{builds:a,statuses:r}}finally{s.value=!1}}async function d(e){const a=l.get(e);if(a!==void 0)return a;const r=await m.get(e);return l.set(e,r),r}function y(){return t.value.find(e=>e.latest)}function v(e){u!==e&&(u=e,t.value=[],n.value=[],l.clear())}function g(){u=null,t.value=[],n.value=[],l.clear(),s.value=!1}return{builds:t,deployStatuses:n,loading:s,fetchBuilds:o,fetchDeployStatuses:i,fetchAll:f,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:v,resetStore:g}});export{x as u};
//# sourceMappingURL=buildStore-BHmwnmds.js.map
