PageSourceSearch

https://portal.eafghans.com/assets/BirthCertificateApplication-f2fff62f.js

js eafghans.com collected 2026-10-02 21:20:17 UTC 11,608 bytes, 1 lines download raw bytes

1import{G as X,a4 as V,k as N,e as h,l as J,H as te,aV as se,j as e,C as H,B as m,T as c,a6 as A,a7 as _,E as T,m as Q,a5 as ae,v as Y,ab as ie,aD as re,aE as G,aW as O,ai as ne,z as oe,aX as le,aw as Z}from"./index-a4468079.js";import{B as z}from"./Button-563ce9a3.js";import{u as M}from"./Session-41942e91.js";import{e as ce,u as de}from"./useDrafts-cf601277.js";import{d as pe}from"./ArrowBackIos-093a6011.js";import{A as he}from"./App-4a321c4a.js";import{R as q,a as w}from"./RadioGroup-eb23b1ea.js";import{F as I}from"./FormControlLabel-b7469367.js";import"./PhotoTool-ae508b90.js";import"./Tooltip-70fe071d.js";import"./index-18c98c76.js";const xe=({onExit:a,draft:n,draftDelete:g,selectedApplicant:r,diditSessionId:d})=>{const{forms:o}=X(),[u,t]=V(location.search),l=N(),i=h.createRef(),b=h.useRef(!1),{user:x}=J(),{countries:j}=te(),[S,v]=h.useState(!1),f=()=>{var P,B,R,C,p,D,k,U;(R=(B=(P=i.current)==null?void 0:P.formWrapper.current)==null?void 0:B.form)!=null&&R.refs.form&&ce((D=(p=(C=i.current)==null?void 0:C.formWrapper.current)==null?void 0:p.form)==null?void 0:D.refs.form,((U=(k=i.current)==null?void 0:k.formWrapper.current)==null?void 0:U.form._files)||{}).then(W=>{a(W),b.current=!0}).catch(W=>{console.error("Unable to save draft: ",W)})};let s={},y={hasAfghanPassport:u.get("hasPassport")||"",hasResidenceCard:u.get("hasResidence")||""};return r=="Myself"&&x&&!n&&(s=se(x,o["birth-certificate"],o)),e.jsx(H,{maxWidth:"xl",children:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",mt:5,gap:6},children:[e.jsxs(c,{variant:"h3",fontSize:"32px",display:"flex",alignItems:"center",children:[e.jsx(m,{component:"span",sx:{cursor:"pointer",display:"flex",alignItems:"center",mr:1},onClick:()=>a(),children:e.jsx(pe,{})}),"Applying for birth certificate"]}),!S&&e.jsx(z,{variant:"contained",sx:{position:{md:"absolute",xs:"relative"},right:{md:"12rem",xs:"0rem"},top:{md:"16rem",xs:"0rem"},backgroundColor:"#16B572","&:hover":{backgroundColor:"#13a463"}},onClick:f,children:"Save Draft & Exit"}),e.jsx(H,{maxWidth:"lg",children:e.jsx(A,{sx:fe.card(l),children:e.jsx(_,{children:e.jsx("div",{id:"birth-certificate-form",className:"saphyte-form saphyte-form--embedded",children:e.jsx(he,{ref:i,id:o["birth-certificate"],mode:"e",container:"#birth-certificate-form",environment:{API_BASE_URL:T.API_BASE_URL,REF_PARAMS:["sp_rid"],DOCUMENT:"birth_certificate"},draft:n,draftDelete:g,session:{data:{applicant:r,customer:x,customer_email:(x==null?void 0:x.emails[0])??"",didit_session_id:d,draft_id:n?n._id:"",...y}},initialStep:0,predefinedValues:s,countries:j,onSuccess:()=>v(!0)})})})})})]})})},fe={card:a=>({pt:{xs:0,sm:1,md:3},px:{xs:0,sm:1,md:3},background:a.palette.mode==="dark"?a.palette.dark.main:a.palette.grey[500],borderColor:a.palette.mode==="dark"?a.palette.dark.main:a.palette.grey[100]})},L="Yes",$="No",E="liveliness-completed",ue="birthcertificate",me="Myself",ge="My Spouse",be="My Child (Under the age of 18)",ye="My Parent",K="There was an error while processing your request. Please try again.",ee=[me,ge,be,ye],F=a=>ee.includes(a);function je({onNext:a,onHasPassportChange:n,onHasResidenceChange:g,selectedApplicant:r,onApplicantChange:d}){const[o,u]=h.useState(""),[t,l]=h.useState(""),i=N(),b={background:i.palette.mode==="dark"?i.palette.dark.main:i.palette.grey[50],border:"1px solid #BCBCBC"};h.useEffect(()=>{},[o,t]);const x=s=>{u(s.target.value),n(s.target.value)},j=s=>{const y=typeof s=="string"?s:s.target.value;l(y),g(y)},S=s=>{F(s)&&d(s)},v=()=>!(!r||!F(r)||o&&o!=L||t&&t!=L),f=()=>!r||!o||!t;return e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:4,maxWidth:"800px",mx:"auto"},children:[e.jsx(A,{sx:b,children:e.jsxs(_,{sx:{p:4},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{fontWeight:"bold",mb:2,fontSize:"28px"},children:"Complete the Birth Certificate Application Form"}),e.jsx(c,{variant:"body1",sx:{fontSize:"16px",color:"text.secondary"},children:"Fill out the required details to provide the necessary information for your birth certificate application process."})]})}),e.jsx(A,{sx:b,children:e.jsxs(_,{sx:{p:4},children:[e.jsx(c,{variant:"h4",component:"h2",sx:{fontWeight:"bold",mb:2,fontSize:"28px"},children:"Instructions"}),e.jsx(c,{variant:"body1",sx:{mb:4,fontSize:"16px",lineHeight:1.6},children:"Please ensure that all information provided in this form is accurate and complete, as it will be used in a legal document. Any inaccuracies or omissions may have legal consequences."}),e.jsxs(Y,{fullWidth:!0,sx:{mb:2},children:[e.jsx(ie,{id:"applicant-select-label",children:"This application is for"}),e.jsxs(re,{labelId:"applicant-select-label",id:"applicant-select",value:r,label:"This application is for*",onChange:s=>S(s.target.value),sx:{"& .MuiOutlinedInput-notchedOutline":{borderRadius:2}},children:[e.jsx(G,{value:"",children:e.jsx("em",{children:"Select applicant"})}),ee.map(s=>e.jsx(G,{value:s,children:s},s))]})]}),e.jsxs(Y,{fullWidth:!0,margin:"normal",sx:{mb:4},children:[e.jsx(O,{id:"passport-label",children:"Does the Applicant have an Afghan Passport?"}),e.jsxs(q,{row:!0,"aria-labelledby":"passport-label",name:"passport-radio-buttons-group",value:o,onChange:x,children:[e.jsx(I,{value:L,control:e.jsx(w,{}),label:"Yes"}),e.jsx(I,{value:$,control:e.jsx(w,{}),label:"No"})]}),e.jsx(O,{id:"residence-label",children:"Does the Applicant have a Residence Card?"}),e.jsxs(q,{row:!0,"aria-labelledby":"residence-label",name:"residence-radio-buttons-group",value:t,onChange:j,children:[e.jsx(I,{value:L,control:e.jsx(w,{}),label:"Yes"}),e.jsx(I,{value:$,control:e.jsx(w,{}),label:"No"})]}),e.jsx(m,{sx:{mt:2}})]}),!v()&&!f()&&e.jsx(A,{sx:{backgroundColor:i.palette.mode==="dark"?i.palette.grey[900]:i.palette.grey[100],border:"1px solid #ff0000",mb:4},children:e.jsxs(_,{children:[e.jsx(c,{variant:"h5",component:"h3",sx:{fontWeight:"bold",mb:2,fontSize:"20px"},children:"Ineligible"}),e.jsx(c,{variant:"body1",sx:{mb:1,fontSize:"14px",color:"text.secondary"},children:"You are not eligible to apply for a Birth Certificate."}),e.jsxs(c,{variant:"body1",component:"div",sx:{mb:1,fontSize:"14px",color:"text.secondary"},children:["We regret to inform you that you are not eligible to apply for an electronic Birth Certificate. Alternatively, you may apply to the nearest Consulate or Embassy to you. To be eligible you need to:",e.jsxs("ul",{style:{paddingLeft:"20px",marginTop:"8px"},children:[e.jsx("li",{style:{marginBottom:"8px"},children:"Have a valid Afghan Passport"}),e.jsx("li",{style:{marginBottom:"8px"},children:"Have a valid Residence Card"})]})]})]})}),e.jsx(m,{sx:{display:"flex",justifyContent:"flex-end"},children:e.jsx(z,{variant:"contained",disabled:!v()||f(),onClick:a,children:"Continue"})})]})}),e.jsx(m,{sx:{display:"flex",flexDirection:"column",gap:2},children:e.jsxs(c,{variant:"body2",sx:{fontSize:"12px",lineHeight:1.6,color:"text.secondary"},children:["Learn more about the birth certificate application process ",e.jsx(ne,{href:"https://eafghans.com/citizen-services/#passport-services/passport-new",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})}function ve({onNext:a,onBack:n}
1){const g=N(),[r,d]=h.useState(!1),[o,u]=h.useState(!1),[t,l]=h.useState(),{session:i}=M("new_business_application");let b=oe("business-passport-services");const x={background:g.palette.mode==="dark"?g.palette.dark.main:g.palette.grey[50],border:"1px solid #BCBCBC",display:"flex",flexDirection:"column",height:"100%"},j=function(){a()},S=function(){n()},v=()=>{if(o){j();return}d(!0),l(null);var f=new URLSearchParams(location.search);f.set(E,ue),b.post("/didit/sessions/create",{callback:location.href.split("?")[0]+"?"+f.toString(),session_id:i==null?void 0:i.id}).then(s=>{window.location.href=s.data.result.session.session_url}).catch(s=>{l(K)}).finally(()=>{d(!1)})};return h.useEffect(()=>{new RegExp(E).exec(location.search)&&(d(!0),b.get("/didit/sessions/retrieve").then(f=>{var s,y;((y=(s=f.data)==null?void 0:s.session)==null?void 0:y.general_status)=="Approved"?j():l("There was a problem while verifying your identity. Please try again.")}).catch(f=>{console.log(f),l(K)}).finally(()=>{d(!1)})),new RegExp(T.LIVELINESS_BYPASS_KEY).exec(location.search)&&u(!0)},[]),e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:4,maxWidth:"800px",mx:"auto"},children:[t?e.jsx(le,{severity:"error",sx:{mt:2},children:t}):null,e.jsx(A,{sx:x,children:e.jsxs(_,{sx:{p:4},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{fontWeight:"bold",mb:2,fontSize:"28px"},children:"Identity Verification"}),e.jsx(c,{variant:"body1",sx:{fontSize:"16px",color:"text.secondary"},children:"Verify your identity to continue with the passport application process."})]})}),e.jsx(A,{sx:x,children:e.jsxs(_,{sx:{p:4},children:[e.jsx(c,{variant:"h4",component:"h2",sx:{fontWeight:"bold",mb:2,fontSize:"28px"},children:"Instructions"}),e.jsx(c,{variant:"body1",sx:{mb:4,fontSize:"16px",lineHeight:1.6},children:"Please verify your identity to continue with the passport application process."}),e.jsxs(c,{variant:"body1",sx:{mb:4,fontSize:"16px",lineHeight:1.6},children:["Please prepare:",e.jsxs("ul",{children:[e.jsx("li",{children:"Your Passport."}),e.jsx("li",{children:"A mobile device with camera and internet connection."}),e.jsx("li",{children:"A well lighted environment to take the photo of your face."})]})]}),e.jsxs(m,{sx:{display:"flex"},children:[e.jsx(m,{sx:{display:"flex",flexGrow:1,justifyContent:"flex-start"},children:e.jsx(z,{variant:"contained",onClick:S,children:"Back"})}),e.jsx(m,{sx:{display:"flex",flexGrow:1,justifyContent:"flex-end"},children:e.jsx(z,{variant:"contained",isLoading:r,onClick:v,children:"Start Verification"})})]})]})}),e.jsx(m,{sx:{display:"flex",flexDirection:"column",gap:2},children:e.jsx(c,{variant:"body2",sx:{fontSize:"12px",lineHeight:1.6,color:"text.secondary"},children:"The verification process is conducted through a secure channel. All data is encrypted and secured using industry-standard security protocols to protect your personal information."})})]})}function Se({draft:a,saveDraft:n,deleteDraft:g,selectedApplicant:r}){const{session:d,setSession:o}=M("birth_certificate_application");V(location.search);const u=Q();let t=(a==null?void 0:a.didit_session_id)||(d==null?void 0:d.data.didit_session_id),l=i=>{i&&n(i,t),u(`${Z.certificate_home}`)};return e.jsx(m,{children:e.jsx(xe,{onExit:l,draft:a,draftDelete:g,selectedApplicant:r,diditSessionId:t})})}function Le(){const[a,n]=h.useState(0),{forms:g}=X(),{session:r,setSession:d}
1=M("birth_certificate_application"),[o,u]=h.useState(""),[t,l]=V(location.search),{user:i}=J(),[b,x]=h.useState(),[j,S,v]=de(!0,(i==null?void 0:i._id)||"",g["birth-certificate"]),f=Q(),s=()=>{a==0&&!T.LIVELINESS_ENABLED?n(2):n(a+1)},y=()=>{f(`${Z.passport_home}`)},P=p=>{F(p)&&(r!=null&&r.data&&(r.data.applicant=p,d(r.data)),u(p),t.set("applicant",p),l(t),t.get(E)&&t.delete(E),l(t))},B=p=>{t.set("hasPassport",p),l(t)},R=p=>{t.set("hasResidence",p),l(t)};h.useEffect(function(){if(t.get("applicant")&&F(t.get("applicant")??"")){let p=t.get("applicant");if(p!==o&&u(p),t.get("draft")){let D=t.get("draft"),k=ae.find(j,["_id",D]);k&&(x(k),n(2))}else t.get(E)&&n(1)}else u(""),n(0)},[t]);let C=e.jsx(e.Fragment,{});return a===0?C=e.jsx(je,{onNext:s,onHasPassportChange:B,onHasResidenceChange:R,selectedApplicant:o,onApplicantChange:P}):a===1?C=e.jsx(ve,{onNext:s,onBack:y}):a===2&&(C=e.jsx(Se,{draft:b,saveDraft:S,deleteDraft:v,selectedApplicant:o})),e.jsx(H,{maxWidth:"xl",sx:{backgroundColor:"#F6F9FB",minHeight:"100vh",py:{xs:2,sm:2,md:4},px:{xs:1,sm:2,md:3},borderRadius:"10px"},children:C})}export{Le as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.