import{y as q,m as Q,u as K,k,o as n,t as A,n as l}from"./index-7T7TTikv.js";import{i as b,d as h,b as C,s as M,c as P,e as U,f as _,r as f,g as I,h as G,j as T,k as j}from"./employeePositionsService-C7MSoCNC.js";/**
 * @license lucide-react v0.513.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],w=q("trash",D),x=o=>{const t=Q(),{t:m}=K(),{handleError:i}=k(m),d=e=>l({queryKey:["positionEmployees","given-first",e],queryFn:()=>T(e,o).then(s=>s.data),enabled:!!e}),v=e=>l({queryKey:["positionEmployees","given-second",e],queryFn:()=>j(e,o).then(s=>s.data),enabled:!!e}),a=n({mutationFn:({payload:e,successCallback:s})=>b(e),onSuccess:(e,s)=>{t.invalidateQueries({queryKey:["positionEmployees"]}),s.successCallback()},onError:e=>{i(e)}}),r=n({mutationFn:({payload:e,successCallback:s})=>h(e),onSuccess:(e,s)=>{t.invalidateQueries({queryKey:["deleteEmployees"]}),t.invalidateQueries({queryKey:["positionEmployees"]}),t.invalidateQueries({queryKey:["employees"]}),s.successCallback()},onError:e=>{i(e)}}),c=n({mutationFn:({payload:e,successCallback:s})=>C(e),onSuccess:(e,s)=>{t.invalidateQueries({queryKey:["archived-users"]}),t.invalidateQueries({queryKey:["employees"]}),s.successCallback()},onError:e=>{i(e)}}),u=n({mutationFn:({payload:e,successCallback:s})=>M(e),onSuccess:(e,s)=>{t.invalidateQueries({queryKey:["positionEmployees"]}),A.success("Team member removed successfully."),s.successCallback()},onError:e=>{i(e)}}),F=n({mutationFn:e=>P(e),onSuccess:()=>t.invalidateQueries({queryKey:["positionEmployees"]})}),p=n({mutationFn:e=>U(e),onSuccess:()=>t.invalidateQueries({queryKey:["positionEmployees"]})}),y=n({mutationFn:e=>_(e),onSuccess:()=>{t.invalidateQueries({queryKey:["positionEmployees"]}),t.invalidateQueries({queryKey:["employees"]})},onError:e=>{i(e)}}),g=n({mutationFn:e=>f(e),onSuccess:()=>t.invalidateQueries({queryKey:["positionEmployees"]})}),E=n({mutationFn:e=>I(e),onSuccess:()=>t.invalidateQueries({queryKey:["positionEmployees"]})}),S=n({mutationFn:e=>G(e),onSuccess:()=>t.invalidateQueries({queryKey:["positionEmployees"]})});return{getGivenFirstQuery:d,getGivenSecondQuery:v,invite:a.mutateAsync,isInviting:a.isPending,setInactive:u.mutateAsync,isDeActivatingUser:u.isPending,assignFirstsForSecond:F.mutateAsync,assignSecondsForFirst:p.mutateAsync,removeFirstsForSecond:g.mutateAsync,assignEmployee:y.mutateAsync,isAssigning:y.isPending,removeSecondsForFirst:E.mutateAsync,remove:S.mutateAsync,deactivateUser:r.mutateAsync,isDeactivating:r.isPending,activateUser:c.mutateAsync,isActivatingUser:c.isPending}};export{w as T,x as u};
