1import{f as s,u as e,r as a,a as r,t as l,j as i}from"./BEk21kDlNpaFwPwxmIg1s-1791270595313.js";import{u as o}from"./KOGkIfjD_1LWWLszGw8HH.js";import{T as d,L as c}from"./B4QlRO3TohsHdLK2wZ2-g.js";import{S as t}from"./ByjMoL9saIGP-hH5q1GQy.js";import{C as m}from"./DhK6uePuRJc0ukPvMeg2b.js";import{v as n,k as p}from"./C5HyxVeI7qc-XthwmvPF5.js";import{C as u}from"./D6Gl40MSRaokzhwRIxYso.js";import"./Xbtfw3AeZgNEtZJDIZgeK.js";const AddPayment=()=>{const{control:x,watch:h,formState:{isSubmitting:j,errors:N},handleSubmit:f}=o({mode:"onBlur"}),v=s(),g=e();a.useEffect(()=>{validateToken()},[]);const validateToken=async()=>{try{await r.get(`/api/common/valid-token/${v.token}`)}catch(s){s?.response?.data?.message?l.error(s?.response?.data?.message):console.error(s),g("/token-invalid")}};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-2 ps-1",children:i.jsx(d,{partnerType:""})}),i.jsxs("div",{className:"container-fluid p-0 login-main-div overflow-auto-xs overflow-auto-sm ",children:[i.jsx(c,{partnerType:""}),i.jsx("form",{onSubmit:f(async s=>{try{const{data:e}=await r.post("/api/client/salesRep-password-payment",{creditCardNumber:s.creditCardNumber,cardCVV:s.cardCVV,cardExpiryDate:s.cardExpiryDate,password:s.password,clientId:v.clientId,token:v.token});if(0===e.status)return void l.error(e.message);l.success(e.message),setTimeout(()=>{g("/login")},1e3)}catch(e){e?.response?.data?.message?l.error(e?.response?.data?.message):console.error(e)}}),className:"login-form-height",children:i.jsx("div",{className:"container login-box position-relative",children:i.jsx("div",{className:"col-12 col-lg-6 d-flex align-items-center",children:i.jsxs("div",{className:"w-100 pt-5 mt-5 pt-md-0 mt-md-0",children:[i.jsx("h1",{className:"login-heading mb-1 font-24",children:"Please enter your card details and password"}),i.jsx("p",{className:"font-16",children:"You can set your monthly budget from settings to avoid unlimited spending."}),i.jsxs("div",{className:"card-bg rounded p-4 mb-3",children:[i.jsx("h1",{className:"font-16 text-black-dark",children:"Add Card Details"}),i.jsxs("div",{className:"row",children:[i.jsx("div",{className:"col-12 col-sm-12 col-md-5 col-lg-5",children:i.jsxs("div",{className:"mb-3 position-relative",children:[i.jsxs("label",{className:"stikkum-label",children:["Card Number",i.jsx("span",{className:"color-red",children:"*"})]}),i.jsx(m,{control:x,format:"###################",placeholder:"Enter Card Number",className:"stikkum-form-control custom-input",type:"text",name:"creditCardNumber",rules:{required:"Card Number is required"}}),N.creditCardNumber&&i.jsx("small",{className:"invalid-field",children:N.creditCardNumber.message})]})}),i.jsx("div",{className:"col-12 col-sm-12 col-md-4 col-lg-4",children:i.jsxs("div",{className:"mb-3 position-relative",children:[i.jsxs("label",{className:"stikkum-label",children:["Expiry Date",i.jsx("span",{className:"color-red",children:"*"})]}),i.jsx(m,{name:"cardExpiryDate",format:"## | ####",placeholder:"MM | YYYY",control:x,className:"stikkum-form-control custom-input",rules:{required:"Expiry date is required",validate:n}}),N.cardExpiryDate&&i.jsx("small",{className:"invalid-field",children:N.cardExpiryDate.message})]})}),i.jsx("div",{className:"col-12 col-sm-12 col-md-3 col-lg-3",children:i.jsxs("div",{className:"mb-3 position-relative",children:[i.jsxs("label",{className:"stikkum-label",children:["CVV Code",i.jsx("span",{className:"color-red",children:"*"})," "]}),i.jsx(m,{name:"cardCVV",control:x,format:"####",className:"stikkum-form-control custom-input",placeholder:"CVV",rules:{required:"CVV is required",minLength:{value:3,message:"Invalid CVV"}}}),N.cardCVV&&i.jsx("small",{className:"invalid-field",children:N.cardCVV.message})]})})]})]}),i.jsxs("div",{className:"card-bg rounded p-4",children:[i.jsx("h1",{className:"font-16 text-black-dark",children:"Set Your Password"}),i.jsxs("div",{className:"row",children:[i.jsx("div",{className:"col-12 col-sm-6",children:i.jsxs("div",{className:"mb-3 position-relative",children:[i.jsxs("label",{className:"stikkum-label",children:["Password",i.jsx("span",{className:"color-red",children:"*"})]}),i.jsx(u,{className:"input-form-control border-bottom-grey padding-right-30",name:"password",control:x,rules:{required:"Password is required",pattern:p},placeholder:"Enter Password"}),N.password?.message&&i.jsx("small",{className:"invalid-field",children:N.password.message})]})}),i.jsx("div",{className:"col-12 col-sm-6",children:i.jsxs("div",{className:"mb-3 position-relative",children:[i.jsxs("label",{className:"stikkum-label",children:["Confirm Password",i.jsx("span",{className:"color-red",children:"*"})]}),i.jsx(u,{name:"confirmPassword",control:x,rules:{required:"Confirm Password is required",validate:s=>s===h("password")||"Please enter the same value again"},placeholder:"Enter Password"}),N.confirmPassword?.message&&i.jsx("small",{className:"invalid-field",children:N.confirmPassword.message})]})})]})]}),i.jsx("div",{className:"col-12 p-0 mt-4 d-flex justify-content-end",children:i.jsx(t,{className:"width-full-xs btn-orange-login btn-login-",isSubmitting:j,loaderClass:"submit-loader",children:"Submit"})})]})})})})]})]})};export{AddPayment as default}; 2//# sourceMappingURL=U-L3AkW3GmOokzQbF-D2r.js.map
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.