PageSourceSearch

https://myka.ng/assets/VerifyCompanyPage-D_tt8HEZ.js

js myka.ng collected 2026-10-09 22:43:53 UTC 7,611 bytes, 1 lines download raw bytes

1import{j as e,d as M,r as T}from"./vendor-react-DfYGAhtm.js";import{b as _,C as G}from"./vendor-forms-BP-7CbAP.js";import{V as k,y as Y,W as $}from"./vendor-icons-1odZwi-b.js";import{h as K,u as U}from"./vendor-state-BsBVN-fX.js";import{e as J,m as r,L as Q,G as X,g as h,bs as Z}from"./index-DsBgCU7r.js";import{u as ee}from"./useOpenLoginModalOnAuthRequired-D6y-uK5-.js";import{u as re}from"./useSmeStepBreadcrumbs-eAyE9Kbh.js";import{S as se}from"./StepPageLayout-DdZUweau.js";import{g as oe}from"./errors-BYKXB8DF.js";import{S as te}from"./SelectField-B8rkxDSz.js";import{C as ie,b as ne}from"./cacRegistrationNumber-CQHoH1B4.js";import{f as ae}from"./text-D803XGGZ.js";import{S as le}from"./SmeFormShell-D4x0eiWi.js";import{a as t,i as ce,T as s,H as d,v as y,V as v,G as de}from"./vendor-ui-DA_r9yXk.js";import{S as A}from"./routes-alBnq1HL.js";import"./stepBreadcrumbs-FCtSk5Kj.js";import"./DropdownPopover-KjBTPKBF.js";const ue=async i=>(await J.post("/api/v1/compliance/business",i)).data,me=()=>{const i=K({mutationKey:["sme","compliance","business"],mutationFn:ue});return{verifyCompany:i.mutate,isLoading:i.isPending,isError:i.isError,error:i.error}},xe=()=>e.jsxs(t,{children:[e.jsxs(ce,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",mb:2,children:[e.jsxs(s,{as:"span",color:r.text.primary,fontWeight:"normal",children:["Verify Your"," "]}),e.jsx(s,{as:"span",color:r.text.label,fontWeight:"bold",children:"Business"})]}),e.jsx(s,{fontSize:"sm",color:r.text.gray,children:"Select your business type, then enter your CAC registration number"})]}),pe=()=>e.jsx(t,{borderLeft:"6px solid",borderColor:r.success[700],bg:r.gray[50],borderRadius:"lg",p:4,children:e.jsxs(d,{align:"flex-start",gap:2,children:[e.jsx(t,{flexShrink:0,bg:r.success[50],border:"2px solid",borderColor:r.success[200],borderRadius:"xl",p:2,display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(y,{as:k,boxSize:5,color:r.success[700]})}),e.jsxs(t,{children:[e.jsx(s,{fontWeight:"bold",fontSize:"sm",color:r.text.label,mb:1,children:"Why we need this"}),e.jsx(s,{fontSize:"xs",color:r.text.gray,lineHeight:"1.6",children:"To comply with NAICOM regulations and generate an accurate SME insurance quote, we need to verify your company through the Corporate Affairs Commission."})]})]})}),g=({label:i,value:u})=>e.jsxs(t,{children:[e.jsx(s,{fontSize:"sm",color:r.text.gray,mb:.5,children:i}),e.jsx(s,{fontSize:"sm",fontWeight:"semibold",color:r.text.label,wordBreak:"break-word",children:u})]}),We=()=>{const{items:i}=re(),u=M(),E=U(),{verifyCompany:V,isLoading:I}=me(),W=ee(),[o,j]=T.useState(null),[f,m]=T.useState(null),a=o?.isVerified&&o?.status==="VERIFIED",l=o!==null||f!==null,S=l&&!a,{register:B,control:w,handleSubmit:P,setValue:F,formState:{errors:x,isValid:L}}=_({defaultValues:{businessType:"limited_company",cacNumber:""},mode:"onChange"}),z=()=>{j(null),m(null),F("cacNumber","")},D=()=>{u(`/${A.AuthorizedRep}`)},O=n=>{if(a&&o){E(Z(o)),u(`/${A.AuthorizedRep}`);return}m(null);const p=ne({businessType:n.businessType,registrationNumberWithoutPrefix:n.cacNumber});V({rcNumbers:[p]},{onSuccess:b=>{const c=b.data[0];if(!c){m("Business not found. Please check your CAC number and try again.");return}c.status==="VERIFIED"&&c.isVerified===!0||m(c.reason??"Verification failed. Please check your CAC number and try again."),j(c)},onError:b=>{W(b)||m(oe(b)??"Verification failed. Please check your CAC number and try again.")}})},C=o?.details?.headOfficeAddress||o?.details?.branchAddress||"N/A",R=o?.details?.registrationDate,q=R?Q(R,"en-NG",{dateStyle:"medium"}):"N/A",N=o?.details?.classification,H=N?ae(N):"N/A";return e.jsx(se,{items:i,hideGoBack:!0,contentMaxW:"600px",children:e.jsx(le,{children:e.jsxs(v,{gap:6,align:"stretch",children:[e.jsx(xe,{}),e.jsx("form",{onSubmit:P(O),children:e.jsxs(v,{gap:3,align:"stretch",children:[e.jsxs(t,{children:[e.jsxs(d,{gap:.5,mb:2,children:[e.jsx(s,{fontSize:"sm",fontWeight:"medium",color:r.text.info,children:"Business type"}),e.jsx(s,{fontSize:"md",color:r.error[500],children:"*"})]}),e.jsx(G,{name:"businessType",control:w,rules:{required:"Select a business type"},render:({field:n})=>e.jsx(te,{options:ie,value:n.value,onChange:p=>{n.onChange(p)},onBlur:n.onBlur,placeholder:"Select business type",isDisabled:l,hasError:!!x.businessType,borderRadius:"full"})}),x.businessType?.message&&e.jsx(s,{fontSize:"xs",color:r.error[500],mt:1,children:x.businessType.message})]}),e.jsxs(t,{children:[e.jsxs(d,{gap:.5,mb:2,children:[e.jsx(s,{fontSize:"sm",fontWeight:"medium",color:r.text.info,children:"Registration number"}),e.jsx(s,{fontSize:"md",color:r.error[500],children:"*"})]}),e.jsx(s,{fontSize:"xs",color:r.text.gray,mb:2,children:"Enter the number only (no RC, BN, or IT prefix). We add the correct prefix from your business type."}),e.jsx(X,{placeholder:"e.g. 1234567",border:`1px solid ${r.border.primary}`,bg:"white",_hover:{bg:"white"},hasError:!l&&(!!x.cacNumber||!!f),error:l?void 0:x.cacNumber?.message??f??void 0,disabled:l,...B("cacNumber",{required:"Registration number is required",minLength:{value:5,message:"Please enter a valid registration number"},validate:n=>{const p=n.trim();return/^(RC|BN|IT)/i.test(p)?"Enter the number only, without RC, BN, or IT at the start":!0}})})]}),e.jsxs(d,{justify:"center",gap:2,py:1,children:[e.jsx(y,{as:Y,boxSize:4,color:r.success[500]}),e.jsx(s,{fontSize:"xs",color:r.text.gray,children:"Your data is encrypted and completely safe"})]}),o&&a&&e.jsx(t,{border:"1px solid",borderColor:r.success[200],bg:r.success[50],borderRadius:"xl",p:3,children:e.jsxs(d,{gap:2,children:[e.jsx(t,{bg:r.success[100],border:"2px s
1olid",borderColor:r.success[300],borderRadius:"xl",p:1.5,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:e.jsx(y,{as:k,boxSize:4,color:r.success[700]})}),e.jsxs(t,{children:[e.jsxs(s,{fontWeight:"semibold",fontSize:"sm",color:r.success[700],children:["Company verified: ",o.name]}),C!=="N/A"&&e.jsx(s,{fontSize:"xs",color:r.text.gray,mt:.5,wordBreak:"break-word",children:C})]})]})}),o&&a&&e.jsx(t,{border:"1px solid",borderColor:r.border.primary,borderRadius:"xl",p:4,bg:"white",children:e.jsxs(de,{templateColumns:{base:"1fr",sm:"1fr 1fr"},gap:4,children:[e.jsx(g,{label:"Company Name",value:o.name}),e.jsx(g,{label:"Registered Address",value:C}),e.jsx(g,{label:"Date of Incorporation",value:q}),e.jsx(g,{label:"Company Type",value:H})]})}),S&&e.jsx(t,{border:"1px solid",borderColor:r.error[200],bg:r.error[50],borderRadius:"xl",p:3,children:e.jsxs(d,{gap:2,align:"flex-start",children:[e.jsx(t,{bg:r.error[100],border:"2px solid",borderColor:r.error[300],borderRadius:"xl",p:1.5,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:e.jsx(y,{as:$,boxSize:4,color:r.error[700]})}),e.jsxs(t,{flex:1,children:[e.jsx(s,{fontWeight:"semibold",fontSize:"sm",color:r.error[700],children:o?`Verification failed: ${o.name}`:"Verification failed"}),e.jsx(s,{fontSize:"xs",color:r.error[600],mt:.5,children:o?.reason??f??"Please check your registration number and try again."})]})]})}),S&&e.jsx(h,{buttonType:"primary",text:"Try again",fullWidth:!0,size:"lg",h:"60px",type:"button",onClick:z,mt:2}),!S&&e.jsxs(e.Fragment,{children:[e.jsx(h,{buttonType:"primary",text:a?"Continue":"Verify Business",fullWidth:!0,size:"lg",h:"60px",type:"submit",loading:I,disabled:!L,mt:o?2:6}),a&&e.jsx(h,{buttonType:"text",text:"Not Your Business?",type:"button",size:"sm",onClick:z,mt:1})]}),!a&&e.jsx(h,{buttonType:"ghost",text:"Skip for now",fullWidth:!0,size:"md",type:"button",onClick:D})]})}),!l&&e.jsx(pe,{})]})})})};export{We 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.