1import{d as A,u as v,p as P,r as c,j as t}from"./vendor-react-DfYGAhtm.js";import{aM as T}from"./vendor-icons-1odZwi-b.js";import{s as H}from"./success-C0L8gZxS.js";import{b1 as S,m as x,y as F,g as R}from"./index-DsBgCU7r.js";import{G as W,e as b,E as i,b as j,a as s}from"./EducationCardShell-CWM2CwNG.js";import{u as C}from"./educationPolicyApi-BFZ7uOa_.js";import{E}from"./routes-CkGlntR3.js";import"./vendor-forms-BP-7CbAP.js";import"./LinkPaymentMethodOption-CuZHpNDU.js";import{F as l,S as z,T as n,a as m,v as O}from"./vendor-ui-DA_r9yXk.js";import"./vendor-state-BsBVN-fX.js";import"./checkoutSessionStore-BRM5sYZN.js";const U=5e3,k=({origin:e,policyId:o})=>{const u=new URLSearchParams({activation:"success",policyId:o}),d=new URLSearchParams({activation:"failed",policyId:o});return{successUrl:`${e}/${E.ActivationSuccess}?${u.toString()}`,failedUrl:`${e}/${E.ActivationSuccess}?${d.toString()}`}},N=e=>e?`/${S.policiesDetail.replace(":id",e)}`:`/${S.policies}`,I=()=>{const e=A(),{state:o}=v(),[u]=P(),a=o?.policyId??u.get("policyId")??null,{submitEducationPolicyAsync:f}=C(),[w,g]=c.useState(a?"submitting":"success"),h=c.useCallback(async()=>{if(!a){g("success");return}const{successUrl:r,failedUrl:p}=k({origin:window.location.origin,policyId:a});try{await f({policyId:a,successUrl:r,failedUrl:p})}catch{}finally{g("success")}},[a,f]),y=c.useRef(!1);return c.useEffect(()=>{if(y.current)return;W();let r=!1;const p=window.setTimeout(()=>{r||(y.current=!0,h())},U);return()=>{r=!0,window.clearTimeout(p)}},[h]),{status:w,viewPolicy:()=>e(N(a))}},Q=()=>{const{status:e,viewPolicy:o}=I();return e==="submitting"?t.jsx(b,{variant:"panel",maxW:"928px",contentMaxW:"672px",children:t.jsxs(l,{direction:"column",align:"center",justify:"center",gap:"20px",minH:"320px",children:[t.jsx(z,{size:"xl",color:i.orangeMain}),t.jsx(n,{as:"h1",textAlign:"center",fontFamily:j,fontWeight:"600",fontSize:{base:"20px",md:"22px"},lineHeight:"30px",letterSpacing:"-0.5px",color:i.summaryHeading,children:"Confirming your payment"}),t.jsx(n,{maxW:"300px",textAlign:"center",fontFamily:s,fontSize:"13px",lineHeight:"19.5px",color:x.text.tertiary,children:"Hang on a moment â we are confirming your payment."})]})}):t.jsxs(b,{variant:"panel",maxW:"928px",contentMaxW:"672px",children:[t.jsxs(l,{direction:"column",align:"center",pb:"24px",children:[t.jsx(m,{w:{base:"240px",md:"300px"},maxW:"100%",mb:{base:"-32px",md:"-44px"},lineHeight:0,children:t.jsx(F,{data:H,autoplay:!0,loop:!1,style:{width:"100%",height:"100%",display:"block"}})}),t.jsx(n,{as:"h1",textAlign:"center",fontFamily:j,fontWeight:"600",fontSize:{base:"22px",md:"26px"},lineHeight:"32px",letterSpacing:"-0.5px",color:i.summaryHeading,children:"Your policy is on its way"}),t.jsx(n,{pt:"8px",maxW:"268px",textAlign:"center",fontFamily:s,fontSize:"13px",lineHeight:"19.5px",color:x.text.tertiary,children:"The certificate will be delivered to you within 24 to 48 hours."})]}),t.jsx(l,{align:"baseline",justify:"space-between",gap:"12px",pb:"12px",children:t.jsx(n,{as:"h2",fontFamily:s,fontSize:"14px",fontWeight:"semibold",lineHeight:"21px",color:i.summaryHeading,children:"Suggested for you"})}),t.jsxs(l,{gap:"12px",align:"flex-start",bg:i.noticeBg,border:"1px solid",borderColor:i.noticeBorder,borderRadius:"16px",p:"17px",children:[t.jsx(O,{as:T,boxSize:"20px",mt:"2px",flexShrink:0,color:i.orangeMain}),t.jsxs(m,{children:[t.jsx(n,{fontFamily:s,fontSize:"13px",fontWeight:"semibold",lineHeight:"19.5px",color:i.orangeMain,children:"Don't Miss Your Next Payment"}),t.jsx(n,{pt:"4px",fontFamily:s,fontSize:"12px",lineHeight:"18px",color:x.text.tertiary,children:"Please link a card, bank account, or keep money in your wallet so we can debit you automatically."})]})]}),t.jsx(m,{pt:"24px",children:t.jsx(R,{buttonType:"primary",type:"button",text:"View policy",size:"lg",h:"52px",fullWidth:!0,borderRadius:"full",fontFamily:s,fontSize:"15px",fontWeight:"medium",onClick:o})})]})};export{Q 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.