import{B as r}from"./p-BcNb9bVO.js";import{C as o}from"./p-DaIKrQry.js";import{g as s,a as e}from"./p-Cb8cfh-k.js";const a=({id:a,authToken:i,service:n})=>async({onSuccess:t,onError:c,final:f})=>{var l;try{const f=await n.fetchBusiness(a,i);if(f.error){return c({error:e(f.error),code:s(null===(l=f.error)||void 0===l?void 0:l.code),severity:o.ERROR})}t({business:new r(f.data)})}catch(r){const e=s(null==r?void 0:r.code);return c({error:r.message||r,code:e,severity:o.ERROR})}finally{f()}};export{a as m}