PageSourceSearch

https://portal.eafghans.com/assets/PublicTokenApply-52715545.js

js eafghans.com collected 2026-10-02 21:19:53 UTC 5,124 bytes, 1 lines download raw bytes

1import{G as C,e as r,k as U,a4 as L,Z as R,z as B,a5 as F,j as t,C as $,a6 as H,a7 as G,a2 as M,T as S,H as W,E as P}from"./index-a4468079.js";/* empty css              */import{A as z}from"./App-4a321c4a.js";import"./PhotoTool-ae508b90.js";import"./Tooltip-70fe071d.js";import"./index-18c98c76.js";function E(e){let s=`${e}`;return s.length>13&&(s=s.substr(0,13)),parseInt(s)}const K=function(e){return{"passport-standard":e["passport-standard"],"passport-vip":e["passport-vip"],"passport-pending":e["passport-pending-documents"],"passport-guarantor":e["passport-guarantor"],"business-passport-standard":e["passport-business-standard"],"business-passport-vip":e["passport-business-vip"],"business-passport-pending":e["passport-business-pending-documents"],"business-passport-guarantor":e["passport-business-guarantor"],"birth-certificate-standard":e["birth-certificate"],"birth-certificate-pending":e["birth-certificate-pending-documents"],"birth-certificate-guarantor":e["birth-certificate-guarantor"]}},N={"passport-standard":"Standard Passport Application","passport-vip":"Urgent Passport Application","passport-pending":"Submit Pending Documents","passport-guarantor":"Submit Guarantor Information","business-passport-standard":"Business Passport Application","business-passport-vip":"Urgent Business Passport Application","business-passport-pending":"Submit Pending Business Documents","business-passport-guarantor":"Submit Guarantor Information","birth-certificate-standard":"Birth Certificate Application","birth-certificate-pending":"Submit Pending Documents","birth-certificate-guarantor":"Submit Guarantor Information"},V={"passport-standard":"standard","passport-vip":"vip","passport-pending":"passport-pending","passport-guarantor":"passport-guarantor","business-passport-standard":"business-standard","business-passport-vip":"business-vip","business-passport-pending":"business-passport-pending","business-passport-guarantor":"business-passport-guarantor","birth-certificate-standard":"birth-certificate","birth-certificate-pending":"birth-certificate-pending","birth-certificate-guarantor":"birth-certificate-guarantor"};function Y(e){switch(e){case"passport-pending":case"business-passport-pending":case"birth-certificate-pending":return["first_name","last_name","email_used_for_the_application","application_reference_number"];case"passport-guarantor":case"business-passport-guarantor":case"birth-certificate-guarantor":return["first_name","last_name","email_address","application_number"]}return[]}function ae(){const{forms:e}=C();let[s,b]=r.useState(""),[_,x]=r.useState(""),[a,v]=r.useState(""),[l,u]=r.useState(!0),[f,p]=r.useState(!0),[O,A]=r.useState("");const y=U();let[T,J]=L(),{token:j}=R(),I=B("public-apply");const k=K(e);r.useEffect(function(){document.body.style.backgroundColor=y.palette.grey[500],I.post("/cc/portals/form-access",{token:j}).then(c=>{let n=c.data;if(n)if(n.status=="ok"){let{service:g,type:o}=n.data,d=`${g}-${o}`,m=k[d];if(m){let i=N[d],w=V[d];b(m),x(i),v(w)}else throw new Error("Invalid service/type")}else throw new Error(n.error||"Invalid response");else throw new Error("Invalid response")}).catch(c=>{console.warn(c),p(!1),u(!1)})},[]),r.useEffect(function(){if(a&&!a.includes("pending")&&!a.includes("guarantor")){let c="";T.get("t")&&(c=`&t=${T.get("t")}`),I.get(`/cc/portals/passport-service?type=${a}${c}`).then(n=>{let g=n.data&&n.data.data;if(g&&g[a]){let o=g[a];if(!o.enabled||o.hidden)p(!1),A(o.default_unavailable_message);else{let d=Date.now(),m=(o.unavailability||[]).filter(function(i){return d>E(i.start)&&d<E(i.end)});if(m.length>0){p(!1);let i=F.first(m);A((i==null?void 0:i.message)||o.default_unavailable_message)}}}else p(!1);u(!1)}).catch(n=>{console.error(n),p(!1),u(!1)})}else s&&(p(!0),u(!1))},[a,s]);let h;return l?h=t.jsx(M,{}):f?h=t.jsx(Z,{type:a,id:`${a}-form`,formId:s,searchParams:T}):h=t.jsxs(t.Fragment,{children:[t.jsx(S,{variant:"h4",component:"h1",sx:{fontWeight:"bold",mb:2,fontSize:"28px"},children:_}),t.jsx(S,{variant:"h4",component:"h3",sx:{fontWeight:"bold",mb:2},children:"Service Unavailable"}),t.jsx(S,{variant:"body1",sx:{fontSize:"16px",color:"text.secondary"},children:O})]}),t.jsx($,{maxWidth:"lg",sx:{px:{xs:0,sm:1,md:3},backgroundColor:y.palette.grey[500]},children:t.jsx(H,{sx:q.card(y),children:t.jsx(G,{sx:{p:{xs:1,sm:1,md:3}},children:h})})})}function Z(e){let{type:s,id:b,formId:_,searchParams:x}=e;const a=r.createRef();let{countries:v}=W();const l={};
1return r.useEffect(function(){Y(s).forEach(f=>{x.get(f)?l[f]=!0:l[f]=!1})},[s]),t.jsx("div",{id:b,className:"saphyte-form saphyte-form--embedded",children:t.jsx(z,{ref:a,id:_,mode:"e",container:`#${b}`,environment:{API_BASE_URL:P.API_BASE_URL,REF_PARAMS:["sp_rid"],PHOTO_TOOL_API_BASE_URL:P.PHOTO_TOOL_API_BASE_URL,PHOTO_TOOL_API_KEY:P.PHOTO_TOOL_API_KEY,DOCUMENT:"passport"},countries:v,session:{extra:{allowUserInput:l}}})})}const q={card:e=>({pt:{xs:0,sm:1,md:3},px:{xs:0,sm:1,md:3},background:e.palette.mode==="dark"?e.palette.dark.main:e.palette.grey[500],borderColor:e.palette.mode==="dark"?e.palette.dark.main:e.palette.grey[100]})};export{ae 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.