PageSourceSearch

https://myka.ng/assets/ManualRequestPage-B9lgdXp2.js

js myka.ng collected 2026-10-09 22:43:32 UTC 5,079 bytes, 1 lines download raw bytes

1import{d as O,u as C,r as y,j as e}from"./vendor-react-DfYGAhtm.js";import{o as N,s as c,b as F,c as P}from"./vendor-forms-BP-7CbAP.js";import{f as M,m as r,G as u,g as f,y as D,B as E,t as L}from"./index-DsBgCU7r.js";import{s as q}from"./success-C0L8gZxS.js";import{o as B}from"./other-icon-DC1bN4dP.js";import{u as v}from"./useAnalytics-HP01GbIH.js";import{S as w}from"./StepPageLayout-DdZUweau.js";import{M as U}from"./Modal-DS-VW05m.js";import{a as Y,g as z}from"./errors-BYKXB8DF.js";import{u as G}from"./enquiryPolicyApi-9jp9YRr5.js";import{O as k,a as H}from"./OtherFormShell-BzyOfe3V.js";import{V as S,a as n,o as V,T as t,x as W,F as $}from"./vendor-ui-DA_r9yXk.js";import"./vendor-icons-1odZwi-b.js";import"./vendor-state-BsBVN-fX.js";import"./professional-indemnity-Cx_HID73.js";import"./transit-insurance-DHaUSpuL.js";import"./fire-BtgY-J44.js";const Q=()=>G("others"),d={"liability-insurance":"LIABILITY","fire-special-perils":"FIRE_AND_SPECIAL_PERILS","burglary-theft":"BURGLARY_AND_THEFT","goods-in-transit":"GOODS_IN_TRANSIT","money-insurance":"MONEY","fidelity-guarantee":"FIDELITY_GUARANTEE","marine-aviation":"MARINE_AVIATION"},J=d["liability-insurance"],K=s=>s&&s in d?d[s]:J,X=N({name:c().trim().min(2,"Please enter your full name").max(120,"Name is too long"),phoneNumber:c().refine(s=>{const a=s.replace(/\D/g,"");return a.length>=10&&a.length<=14},{message:"Enter a valid phone number"}),email:M({requiredMessage:"Please enter your email"}),message:c().trim().min(10,"Please tell us a bit more about what you need").max(2e3,"Message is too long")}),xe=()=>{const s=O(),a=C(),{submitEnquiryAsync:j,isSubmitting:p}=Q(),{track:g}=v(),b=a.state?.selectedCoverage,x=a.state?.selectedCoverages,T=y.useMemo(()=>x?.[0]?.id??b?.id??k[0]?.id,[b?.id,x]),{register:l,handleSubmit:A,formState:{errors:o}}=F({resolver:P(X),defaultValues:{name:"",phoneNumber:"",email:"",message:""}}),[_,m]=y.useState(!1),R=async i=>{try{await j({productType:K(T),fullName:i.name.trim(),phone:i.phoneNumber.replace(/\D/g,""),email:i.email.trim(),message:i.message.trim()}),g(E.FORM_OTHERS_SUBMITTED,{product_type:"others"}),m(!0)}catch(h){if(Y(h))return;g(E.FORM_OTHERS_SUBMIT_FAILED,{product_type:"others",failure_reason:"server_error"}),L.error(z(h)??"We could not submit your request. Please try again.")}},I=()=>{m(!1),s("/")};return e.jsxs(w,{items:[],onGoBack:()=>s(-1),contentMaxW:"800px",mobileContentOnly:!0,children:[e.jsx(H,{children:e.jsxs(S,{align:"stretch",gap:6,children:[e.jsxs(n,{children:[e.jsx(V,{src:B,alt:"Other insurance",boxSize:"48px",objectFit:"contain",mb:2}),e.jsx(t,{fontSize:{base:"4xl",md:"5xl"},color:r.text.primary,fontWeight:"semibold",children:"Other Insurance Covers"}),e.jsx(t,{fontSize:"md",color:r.text.gray,children:"Additional protection options for your business and assets."})]}),e.jsxs(n,{as:"form",onSubmit:A(R),border:"1px solid",borderColor:r.border.primary,borderRadius:"16px",p:{base:4,md:5},bg:r.white.DEFAULT,children:[e.jsxs(S,{gap:4,align:"stretch",mb:{base:4,md:6},children:[e.jsx(u,{label:"Name",placeholder:"e.g. Mr John Doe",bg:r.gray[50],border:"1px solid",borderColor:r.gray[200],error:o.name?.message,...l("name")}),e.jsx(u,{label:"Phone Number",type:"tel",placeholder:"e.g. 09000112233",inputMode:"numeric",bg:r.gray[50],border:"1px solid",borderColor:r.gray[200],error:o.phoneNumber?.message,...l("phoneNumber")}),e.jsx(u,{label:"Email Address",type:"email",placeholder:"e.g. [email protected]",bg:r.gray[50],border:"1px solid",borderColor:r.gray[200],error:o.email?.message,...l("email")}),e.jsxs(n,{children:[e.jsx(t,{fontSize:"sm",color:r.text.info,mb:2,children:"Message"}),e.jsx(W,{placeholder:"Describe what you want to insure or any questions you have.",minH:"120px",resize:"vertical",p:4,borderRadius:"16px",bg:r.gray[50],border:"1px solid",borderColor:o.message?r.error[500]:r.gray[200],_focus:{borderColor:o.message?r.error[500]:r.orange[400],boxShadow:o.message?`0 0 0 1px ${r.error[500]}`:`0 0 0 1px ${r.orange[400]}`},...l("message")}),o.message?.message?e.jsx(n,{mt:1.5,children:e.jsx(t,{textStyle:"text-sm-regular",color:r.error[500],children:o.message.message})}):null]})]}),e.jsx($,{justify:"flex-end",mt:{base:1,md:0},children:e.jsx(f,{buttonType:"primary",text:"Continue",size:"lg",type:"submit",loading:p,disabled:p,minW:"170px"})})]})]})}),e.jsx(U,{open:_,onClose:()=>m(!1),showCloseButton:!1,closeOnEscape:!1,closeOnInteractOutside:!1,maxW:"460px",contentProps:{borderRadius:"28px",overflow:"hidden"},bodyProps:{p:0},children:e.jsxs(n,{px:{base:6,md:10},py:{base:8,md:10},bg:"radial-gradient(circle at top, #E8FBEA 0%, #FFFFFF 56%)",textAlign:"center",children:[e.jsx(D,{data:q,autoplay:!0}),e.jsxs(t,{color:r.text.primary,fontSize:{base:"3xl",md:"4xl"},fontWeight:"semibold",lineHeight:"1.2",mb:3,children:["Request Submitted",e.jsx("br",{}),"Successfully"]}),e.jsx(t,{fontSize:"sm",color:r.text.gray,mb:8,children:"Great job! Your request has been submitted successfully."}),e.jsx(f,{buttonType:"primary",text:"Back home",size:"lg",type:"button",onClick:I,fullWidth:!0})]})})]})};export{xe 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.