import{A as e,D as t,K as n,M as r,b as i,gt as a,j as o,jt as s,kt as c,ot as l,w as u,wt as d}from"./dist-B4ulKgpj.js";import{n as f}from"./usetoast-BF8L6V7u.js";import{t as p}from"./toast-CIOCHy8g.js";import{t as m}from"./button-DVjHqmFH.js";var h={class:`space-y-4`},g={class:`rounded-lg border border-[#d9e3ef] bg-[#f8fbff] p-4 text-sm`},_={class:`mt-1`},v={class:`mt-1`},y={class:`mt-1`},b={class:`flex justify-end gap-2`},x=r({__name:`DeleteMember`,props:{userDetails:{},memberDetails:{}},setup(r){let x=r,S=f(),C=a(!1),w=x.memberDetails??x.userDetails,T=(e,t)=>{let n=[`success`,`error`,`info`].includes(e)?e:`info`;S.add({severity:n,summary:{success:`Success`,error:`Error`,info:`Notice`}[n],detail:t,life:3e3})};function E(){if(!w?.id){T(`error`,`No member selected`);return}C.value=!0,s.delete(`/member-management/${w.id}`,{onSuccess:()=>{C.value=!1,T(`success`,`Member deleted successfully`),setTimeout(()=>{s.visit(`/member-management`)},900)},onError:()=>{C.value=!1,T(`error`,`Failed to delete member`)}})}return(r,a)=>(n(),t(i,null,[o(d(p)),u(`div`,h,[a[5]||=u(`p`,{class:`text-sm text-[#234e7a]`},` You are about to permanently remove this member record. `,-1),u(`div`,g,[u(`p`,null,[a[0]||=u(`span`,{class:`font-semibold`},`Name:`,-1),e(` `+c(d(w)?.eac_member_name||`-`),1)]),u(`p`,_,[a[1]||=u(`span`,{class:`font-semibold`},`Type:`,-1),e(` `+c(d(w)?.eac_member_type||`-`),1)]),u(`p`,v,[a[2]||=u(`span`,{class:`font-semibold`},`Email:`,-1),e(` `+c(d(w)?.contact_email||`-`),1)]),u(`p`,y,[a[3]||=u(`span`,{class:`font-semibold`},`Phone:`,-1),e(` `+c(d(w)?.contact_number||`-`),1)])]),u(`div`,b,[o(d(m),{type:`button`,severity:`danger`,loading:C.value,onClick:E},{default:l(()=>[...a[4]||=[u(`span`,null,[u(`i`,{class:`pi pi-trash`})],-1),u(`span`,null,` Delete Member`,-1)]]),_:1},8,[`loading`])])])],64))}});export{x as t};