import{N as f,a4 as S,R as l,a5 as h,g as b}from"./Dk4AzF7j.js";const g=()=>{const{kapi:c}=f(),{addTimeToProcessedData:i,setCachedData:u}=S(),a=l().companyDetails?.id;if(!a)throw new Error("No company ID found");const{data:n,status:m,error:p}=h(`availableSubscriptionSizes-${a}`,async()=>await c("Subscription").then(s=>s.getCompanySubscription(a)),{transform:s=>{const o=Object.entries(s.systems_new).map(([e,r])=>({id:r.id,name:e,sku:r.sku,systems_free:r.systems_free})),t=o.filter(e=>e.systems_free!==void 0&&e.systems_free>0),y=t.reduce((e,r)=>e+(r.systems_free||0),0);return i({total:o,available:t,qty:y},3e5)},getCachedData(s,o,t){if(!(t.cause==="refresh:manual"||t.cause==="refresh:hook"))return u(s)}}),d=b(()=>n.value?.qty||0);return{data:n,status:m,projectsRemaining:d,error:p}};export{g as u};
