import{d as C,i as g,s as I,o as n,a as y,w as D,k as c,M as V,j as r,c as h,b as x,v as z,n as H,a3 as T,a4 as B,e as i,F as m,f as _,t as E,a5 as P,x as q}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{_ as S}from"./Type.ec60a9ee.js";import{f as N}from"./filters.69c883c5.js";/* empty css              */const R=["src"],M=C({__name:"ImageModalPreview",props:{url:{type:String,required:!0},title:{type:String,required:!0},isVisible:{type:Boolean,required:!0}},emits:["cancel"],setup(a,{emit:p}){const u=a,l=g(!1);g("");const s=g("");I(()=>u.url,o=>{l.value=!0});const d=()=>{p("cancel",!0),l.value=!1,s.value=""};return(o,e)=>{const b=V;return n(),y(b,{visible:a.isVisible,title:a.title,footer:null,onCancel:d},{default:D(()=>[c("img",{alt:"example",style:{width:"100%"},src:a.url},null,8,R)]),_:1},8,["visible","title"])}}}),F=C({__name:"CustomerDocumentPreview",props:{photo:{type:String,required:!0}},setup(a){const p=a;let u=g(),l=g(),s=g(!1);const d=o=>{let e=p.photo;if(typeof e=="string"&&(e=JSON.parse(e)),o==="passport"&&(l.value="Passport Photo"),o==="vaccine"&&(l.value="Vaccine Photo"),o==="visa"&&(l.value="VISA Photo"),o==="rtpcr"&&(l.value="RT-PCR Photo"),!e[o]||e[o].length===0)return s.value=!1,H.warn("\u0E9A\u0ECD\u0EC8\u0E9E\u0EBB\u0E9A\u0EAE\u0EB9\u0E9A\u0E9E\u0EB2\u0E9A!");s.value=!0,u.value=T(e[o])};return(o,e)=>{const b=B;return n(),r("div",null,[c("span",null,[c("a",{onClick:e[0]||(e[0]=v=>d("passport"))},"Passport"),h(b,{type:"vertical"}),c("a",{onClick:e[1]||(e[1]=v=>d("vaccine"))},"Vaccine"),h(b,{type:"vertical"}),c("a",{onClick:e[2]||(e[2]=v=>d("rtpcr"))},"RT-PCR")]),h(M,{url:x(u),title:x(l),"is-visible":x(s),onCancel:e[3]||(e[3]=v=>z(s)?s.value=!1:s=!1)},null,8,["url","title","is-visible"])])}}}),j={style:{"margin-bottom":"20px"}},O={key:0,class:"font-bold"},U={key:5},G=["onClick"],J=["onClick"],L=["onClick"],K=["onClick"],re=C({__name:"Members",props:{data:{type:Object,required:!0},hideTitle:Boolean,showAction:Boolean,showHeadEdit:{type:Boolean,default:!0},showHeadDelete:{type:Boolean,default:!0},showDelete:{type:Boolean,default:!0},showCertificatePrint:Boolean,showInvoicePrint:Boolean},emits:["edit","delete"],setup(a,{emit:p}){const u=[{title:"Relation",dataIndex:"relation",key:"relation"},{title:"First name",dataIndex:"firstname",key:"firstname"},{title:"Last name",dataIndex:"lastname",key:"lastname"},{title:"Phone",dataIndex:"phone",key:"phone"},{title:"E-mail",dataIndex:"email",key:"email"},{title:"Gender",dataIndex:"gender",key:"gender"},{title:"Data of Birth",dataIndex:"dob",key:"dob"},{title:"VISA Type",key:"visatype"},{title:"Passport No",dataIndex:"passport",key:"passport"},{title:"Document(s)",key:"document"},{title:"Action",key:"action"}],l=e=>{window.open(`${P().replace("admin","")}policyschedule?id=${e.certificate.id}&no=${e.certificate.no}&member=${e.seq}`,"_blank")},s=e=>{window.open(`${P().replace("admin","")}invoice?id=${e.certificate.id}&no=${e.certificate.no}&member=${e.seq}`,"_blank")},d=e=>{p("edit",e)},o=e=>{p("delete",e)};return(e,b)=>{const v=S,k=B,A=q;return n(),r("div",j,[a.hideTitle===!1?(n(),r("h1",O,"Members")):i("",!0),c("div",null,[h(A,{columns:u,"data-source":a.data,pagination:!1},{bodyCell:D(({column:f,text:Q,record:t,index:$})=>[f.key==="fullname"?(n(),r(m,{key:0},[_(E(`${t.firstname} ${t.lastname}`),1)],64)):i("",!0),f.key==="gender"?(n(),y(v,{key:1,type:t.gender},null,8,["type"])):i("",!0),f.key==="dob"?(n(),r(m,{key:2},[_(E(x(N).formatDob(t.dob)),1)],64)):i("",!0),f.key==="visatype"?(n(),r(m,{key:3},[_(E(t.visa_type?t.visa_type.name:"-"),1)],64)):i("",!0),f.key==="document"?(n(),y(F,{key:4,photo:t.photo},null,8,["photo"])):i("",!0),f.key==="action"?(n(),r("span",U,[a.showCertificatePrint===!0?(n(),r(m,{key:0},[c("a",{onClick:w=>l(t)},"Certificate",8,G),h(k,{type:"vertical"})],64)):i("",!0),a.showInvoicePrint===!0?(n(),r(m,{key:1},[c("a",{onClick:w=>s(t)},"Invoice",8,J),h(k,{type:"vertical"})],64)):i("",!0),a.showAction===!0?(n(),r(m,{key:2},[a.showHeadEdit===!0&&t.relation==="HEAD"||t.relation!=="HEAD"?(n(),r("a",{key:0,onClick:w=>d(t.id?t.id:$)},"Edit",8,L)):i("",!0),a.showHeadEdit===!0&&t.relation==="HEAD"||t.relation!=="HEAD"?(n(),y(k,{key:1,type:"vertical"})):i("",!0),(a.showHeadDelete===!0&&t.relation==="HEAD"||t.relation!=="HEAD")&&a.showDelete?(n(),r("a",{key:2,onClick:w=>o($)},"Delete",8,K)):i("",!0)],64)):i("",!0)])):i("",!0)]),_:1},8,["data-source"])])])}}});export{re as _};
