import{d as g,E as c,r as p}from"./jwt-decode.esm-CX61wVx3.js";import"./router-C3xfRTQ9.js";import{B as w,a as m}from"./build-K9CcU5EW.js";import{P as S}from"./project-BBDdDK81.js";import"./tables-uXC0iev6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="d4a51098-7cc4-41a9-8211-d76fa1e7b0f0",t._sentryDebugIdIdentifier="sentry-dbid-d4a51098-7cc4-41a9-8211-d76fa1e7b0f0")}catch{}})();const x=g("build",()=>{const t=c([]),a=c([]),s=p(!1);let u=null;const l=new Map;async function o(e){const n=await w.list(e);return u===e&&(t.value=n),n}async function i(e){const n=await S.getStatus(e);return u===e&&(a.value=n),n}async function f(e){s.value=!0;try{const[n,r]=await Promise.all([o(e),i(e)]);return{builds:n,statuses:r}}finally{s.value=!1}}async function d(e){const n=l.get(e);if(n!==void 0)return n;const r=await m.get(e);return l.set(e,r),r}function y(){return t.value.find(e=>e.latest)}function b(e){u!==e&&(u=e,t.value=[],a.value=[],l.clear())}function v(){u=null,t.value=[],a.value=[],l.clear(),s.value=!1}return{builds:t,deployStatuses:a,loading:s,fetchBuilds:o,fetchDeployStatuses:i,fetchAll:f,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:b,resetStore:v}});export{x as u};
//# sourceMappingURL=buildStore-C5n8kisI.js.map
