import{N as p,a4 as m,h as f,a5 as l}from"./EJiqiqZX.js";const D=t=>{const{kapi:a}=p(),{setCachedData:o,addTimeToProcessedData:u}=m(),s=f(),{data:c,error:i,status:d,refresh:h}=l(()=>{const{pid:e}=s.params;return`incidents-${t}-${e}`},async()=>{const{pid:e}=s.params;if(e===null)throw new Error("No project id found");return t==="current"?await a("Incident").then(r=>r.search(Number(e))):await a("Incident").then(r=>r.since(Number(e),{days:3}))},{transform:e=>u(e),getCachedData:(e,r,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return o(e)}});return{data:c,error:i,status:d,refresh:h}};export{D as u};