import{bV as U,c9 as n,ca as F}from"./bootstrap-Bqxdt4iG.js";function g(){var l,A,I,S,h,f,w,m;const c=U(),e=(I=(A=(l=c.userInfo)==null?void 0:l.roles)==null?void 0:A[0])!=null?I:"",R=(h=(S=c.userInfo)==null?void 0:S.userId)!=null?h:"",i=(w=(f=c.userInfo)==null?void 0:f.warehouseIds)!=null?w:[],u=(m=i[0])!=null?m:"",d=e===n.ADMIN||e===n.SUPER_ADMIN,t=e===n.MANAGER,r=e===n.STAFF,E=e===n.SALESMAN,M=e===n.CUSTOMER,p=d||t||r,C=t||r,D=(...s)=>s.includes(e),N=(...s)=>()=>s.includes(e),o=(s,a)=>F(s,a,e);return{can:o,canCreate:s=>o(s,"create"),canDelete:s=>o(s,"delete"),canEdit:s=>o(s,"edit"),canView:s=>o(s,"view"),hasRole:D,isAdmin:d,isAdminOrStaff:p,isCustomer:M,isManager:t,isSalesman:E,isStaff:r,isWarehouseScoped:C,primaryWarehouseId:u,role:e,showAction:(s,a)=>()=>o(s,a),showForRoles:N,userId:R,warehouseIds:i,warehouseId:u}}export{g as u};
