"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34],{9778:function(e,t,r){r.d(t,{H:function(){return o},a:function(){return i}});var a=r(7437),l=r(2265),n=r(1490);let s=(0,l.createContext)(),o=e=>{let{children:t}=e,[r,o]=(0,l.useState)(!1),[i,c]=(0,l.useState)(null),[d,u]=(0,l.useState)(!1),[m,b]=(0,l.useState)(!1),[g,f]=(0,l.useState)("");return(0,l.useEffect)(()=>{let e=n.Z.get("mobileNumber");e&&(o(!0),c(e))},[]),(0,a.jsx)(s.Provider,{value:{isLoggedIn:r,login:e=>{o(!0),c(e),u(!1),n.Z.set("mobileNumber",e)},logout:()=>{o(!1),c(null),n.Z.remove("mobileNumber"),n.Z.remove("FirstName")},mobileNumber:i,setIsLoggedIn:o,showForm:d,setShowForm:u,setMobileNumber:c,redirect:m,setRedirect:b,formtype:g,setFormType:f},children:t})},i=()=>(0,l.useContext)(s)},379:function(e,t,r){r.d(t,{Z:function(){return x}});var a=r(7437),l=r(2265),n=r(691),s=r(9778),o=r(1490),i=r(1697),c=r(5925),d=r(4033),u=r(8082),m=r(2545),b=function(e){return"object"==typeof e&&null!==e},g=function(e){var t=e.value,r=void 0===t?"":t,a=e.numInputs,n=void 0===a?4:a,s=e.onChange,o=e.onPaste,i=e.renderInput,c=e.shouldAutoFocus,d=void 0!==c&&c,u=e.inputType,m=void 0===u?"text":u,g=e.renderSeparator,f=e.placeholder,x=e.containerStyle,h=e.inputStyle,p=e.skipDefaultStyles,y=void 0!==p&&p,v=l.useState(0),N=v[0],j=v[1],k=l.useRef([]),w=function(){return r?r.toString().split(""):[]},C="number"===m||"tel"===m;l.useEffect(function(){k.current=k.current.slice(0,n)},[n]),l.useEffect(function(){var e;d&&(null===(e=k.current[0])||void 0===e||e.focus())},[d]);var S=function(){if("string"==typeof f){if(f.length===n)return f;f.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},P=function(e){return(C?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},F=function(e){var t=e.target.value;P(t)&&(E(t),D(N+1))},O=function(e){var t=e.nativeEvent,r=e.target.value;P(r)||(r.length!==n||r.split("").some(function(e){return!P(e)})||(T(r.split("")),D(n-1)),null===t.data&&"deleteContentBackward"===t.inputType&&(e.preventDefault(),E(""),D(N-1)),e.target.value="")},L=function(){j(N-1)},A=function(e){var t=w();[e.code,e.key].includes("Backspace")?(e.preventDefault(),E(""),D(N-1)):"Delete"===e.code?(e.preventDefault(),E("")):"ArrowLeft"===e.code?(e.preventDefault(),D(N-1)):"ArrowRight"===e.code?(e.preventDefault(),D(N+1)):e.key===t[N]?(e.preventDefault(),D(N+1)):("Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()},D=function(e){var t,r,a=Math.max(Math.min(n-1,e),0);k.current[a]&&(null===(t=k.current[a])||void 0===t||t.focus(),null===(r=k.current[a])||void 0===r||r.select(),j(a))},E=function(e){var t=w();t[N]=e[0],T(t)},T=function(e){s(e.join(""))},I=function(e){e.preventDefault();var t,r=w(),a=N,l=e.clipboardData.getData("text/plain").slice(0,n-N).split("");if(!(C&&l.some(function(e){return isNaN(Number(e))}))){for(var s=0;s<n;++s)s>=N&&l.length>0&&(r[s]=null!==(t=l.shift())&&void 0!==t?t:"",a++);D(a),T(r)}};return l.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},b(x)&&x),className:"string"==typeof x?x:void 0,onPaste:o},Array.from({length:n},function(e,t){return t}).map(function(e){var t,r,a;return l.createElement(l.Fragment,{key:e},i({value:null!==(t=w()[e])&&void 0!==t?t:"",placeholder:null!==(a=null===(r=S())||void 0===r?void 0:r[e])&&void 0!==a?a:void 0,ref:function(t){return k.current[e]=t},onChange:F,onFocus:function(t){j(e),t.target.select()},onBlur:L,onKeyDown:A,onPaste:I,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(y?{}:{width:"1em",textAlign:"center"},b(h)?h:{}),className:"string"==typeof h?h:void 0,type:m,inputMode:C?"numeric":"text",onInput:O},e),e<n-1&&("function"==typeof g?g(e):g))}))},f=r(2173);r(1396);var x=e=>{let{formOpen:t,otp:r,phoneNumber:b,setUid:x,uid:h,setVerifyOtp:p,verifyOtp:y}=e,{isLoggedIn:v,login:N,logout:j,showForm:k,setShowForm:w,mobileNumber:C,setMobileNumber:S,redirect:P,setRedirect:F,formtype:O}=(0,s.a)(),[L,A]=(0,l.useState)(!1),[D,E]=(0,l.useState)(!0),[T,I]=(0,l.useState)(""),[z,Z]=(0,l.useState)(!1),[q,M]=(0,l.useState)("Guest"),[R,U]=(0,l.useState)(!1),[W,_]=(0,l.useState)(!1),[B,Y]=(0,l.useState)(30),[H,V]=(0,l.useState)(!1),[G,J]=(0,l.useState)(""),[K,X]=(0,l.useState)({firstName:"",lastName:"",email:"",mobile:"",pincode:"",panCard:""});(0,l.useEffect)(()=>{b&&r&&(S(b),I(G),w(!0),Z("OTP"))},[b,r]);let $=(0,d.useRouter)(),Q=(0,d.usePathname)();(0,l.useEffect)(()=>{if(!v){let e=o.Z.get("mobileNumber"),r=o.Z.get("FirstName");e&&(N(e),S(e)),r&&M(r),t&&w(!0)}},[v]);let ee=()=>{"function"==typeof w&&w(!1),"/loan-offers-list"==Q&&$.push("/")};(0,l.useEffect)(()=>{let e=localStorage.getItem("mobileNumber");if(e)S(e);else{let e=o.Z.get("mobileNumber");e&&S(e)}},[]);let et=async e=>{e.preventDefault();try{let e=await fetch(n.qD,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({MobileNumber:C,OTP:G,GeneratedOTP:T.toString()})});if(e){let t=await e.json();if("OTP Verified"==t.message){o.Z.set("mobileNumber",C,{expires:7}),w(!1),Z(""),c.Am.success("OTP verified"),N(),P?w(!1):$.push("/loan-offers-list");let e=t.name;M(e),o.Z.set("mobileNumber",C,{expires:7}),"string"==typeof e&&o.Z.set("FirstName",e,{expires:7}),"string"==typeof e&&o.Z.set("FirstName",e,{expires:7}),h&&(w(!1),x(null),N()),A(!1),p(!0),S(""),J("")}else c.Am.error("Invalid OTP. Please try again")}}catch(e){}};Array.from({length:6},()=>(0,l.useRef)(null));let er=e=>{let t=e.target.value;t=t.replace(/\D/g,"").slice(0,10),/^[6-9]/.test(t)||(t=""),E(/^[6-9]\d{9}$/.test(t)),S(t)},ea=async e=>{e.preventDefault(),D&&C&&el(C,I,Z,ec,U,c.Am,O,"login")},el=async(e,t,r,a,l,s,o,i)=>{try{_(!0);let c=await f.Z.post(n.P,{MobileNumber:e,log:i,type:o});c.data&&c.data.otp?(t(c.data.otp),r("OTP"),s.success("OTP Sent"),_(!1),a()):c.data&&"Not Found"===c.data.status?(_(!1),s.error(c.data.message+" Please Register First"),l(!0)):(_(!1),console.error("Failed to retrieve OTP from the response."))}catch(e){_(!1),console.error("Error:",e)}};(0,l.useEffect)(()=>{C&&!v&&P&&el(C,I,Z,ec,U,c.Am,O,"register")},[C]);let en=e=>{let t=e.target.value,r=(0,u.YF)(t);X({...K,panCard:r})},es=e=>{let t=e.target.value,r=(0,u.Jg)(t);X({...K,mobile:r})},eo=e=>{let t=e.target.value,r=(0,u.HR)(t);X({...K,pincode:r})},ei=async e=>{e.preventDefault(),_(!0);let t=await f.Z.post("./api/userSignup",K);"success"==t.data.status?(c.Am.success(t.data.message),U(!1),_(!1)):"Exist"==t.data.status?(_(!1),(0,c.Am)(t.data.message),U(!1)):(_(!1),(0,c.Am)("Something went Wrong Please try Again")),X({firstName:"",lastName:"",email:"",mobile:"",pincode:"",panCard:""})},ec=()=>{V(!0),Y(30);let e=setInterval(()=>{Y(t=>t>0?t-1:(clearInterval(e),V(!1),0))},1e3)},ed=async()=>{ec();let e=await f.Z.post(n.P,{MobileNumber:C});e.data?e.data.otp?(I(e.data.otp),Z("OTP"),c.Am.success("OTP Sent"),ec()):"Not Found"==e.data.status&&(c.Am.error(e.data.message+" Please Register First"),U(!0)):console.error("Failed to generate OTP:",e.statusText)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:v?"absolute top-0 right-0":"",children:(0,a.jsx)("div",{className:"flex md:order-2 space-x-3 md:space-x-0",children:v?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:" mt-1  bg-red-500 text-white border-gray-200 font-medium rounded-lg text-sm  text-center inline-flex items-center gap-3  ",children:[(0,a.jsxs)("strong",{className:" px-2 ",children:["Welcome, ",q]}),(0,a.jsx)("div",{className:"px-2 py-1 border border-r",children:(0,a.jsx)("button",{onClick:()=>{w(!1),Z(""),ee(),j(),c.Am.success("Logged Out")},children:(0,a.jsx)(i.Iw6,{size:"1.5em"})})})]})}):!h&&!t&&(0,a.jsx)("button",{onClick:()=>w(!0),type:"button",className:"text-white bg-red-500 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded text-sm px-7 py-3 text-center",children:"Login"})})}),k&&!v&&(0,a.jsx)("div",{className:"h-screen w-screen z-50 fixed top-0 bg-zinc-900 bg-opacity-50 flex justify-center items-center right-0 left-0",children:(0,a.jsx)("div",{className:"relative p-4 w-full max-w-md max-h-full",children:(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow dark:bg-gray-700",children:[""==z&&(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 md:px-5 md:my-2 border-b rounded-t bg-red-500 ",children:[(0,a.jsxs)("h3",{className:"text-xl font-semibold text-white dark:text-white ",children:[R?"Sign":"Login"," in to our platform"]}),(0,a.jsxs)("button",{onClick:ee,type:"button",className:"end-2.5 text-white bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white","data-modal-hide":"authentication-modal",children:[(0,a.jsx)("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:(0,a.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),(0,a.jsx)("span",{className:"sr-only",children:"Close modal"})]})]}),(0,a.jsxs)("div",{className:"p-4 md:p-5",children:["OTP"===z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)("button",{type:"button",onClick:e=>Z(""),className:"text-blue-200",children:"❌"})}),(0,a.jsx)("h2",{className:"text-xl font-bold p-4",children:"OTP Validation"}),(0,a.jsx)("p",{className:"font-semibold pb-3",children:"Enter the OTP you received SMS at"}),(0,a.jsxs)("p",{className:"font-semibold pb-4",children:["+91",C]})]}),(0,a.jsxs)("div",{className:"flex gap-4 flex-col",children:[(0,a.jsx)("div",{className:"flex flex-row items-center justify-between mx-auto w-full gap-1",children:(0,a.jsx)(g,{value:G,onChange:J,numInputs:6,inputContainerStyle:e=>({marginRight:e<5?"1rem":0}),containerStyle:"flex gap-4",inputStyle:"!w-[20%] h-12 outline-none rounded-xl border border-gray-200 bg-white focus:bg-gray-50 focus:ring-1 ring-blue-700 appearance-none",renderInput:e=>(0,a.jsx)("input",{...e})})}),(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between text-center text-sm font-medium text-gray-500 mb-4",children:[(0,a.jsxs)("p",{children:[B," : 00"]}),(0,a.jsx)("a",{className:"flex flex-row items-center text-blue-600 ".concat(H?"disabled":""),href:"#",style:H?{color:"gray",cursor:"not-allowed"}:{},onClick:ed,children:"Resend"})]}),(0,a.jsx)("div",{className:"flex flex-col space-y-5",children:(0,a.jsx)("div",{children:(0,a.jsx)("button",{className:"flex flex-row items-center justify-center text-center w-full border rounded outline-none py-3 bg-red-500 hover:bg-red-800 border-none text-white text-sm shadow-sm",onClick:et,children:"Verify Account"})})})]})]}),"/loan-offers-list"!=Q&&""==z&&!h&&(0,a.jsxs)("div",{children:[!R&&(0,a.jsx)("form",{className:"space-y-4",action:"#",children:W?(0,a.jsx)("div",{className:"loader-overlay",children:(0,a.jsx)(m.gy,{height:"50",width:"50",color:"#ef4444",ariaLabel:"tail-spin-loading",radius:"1",wrapperStyle:{},wrapperclassName:"",visible:!0})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{for:"email",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Enter Your Phone No."}),(0,a.jsx)("input",{type:"phone",name:"mobileNumber",id:"mobileNumber",value:C,onChange:er,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white",placeholder:"+91 - 9824******",required:!0}),!D&&(0,a.jsx)("span",{className:"text-red-500",children:"Please Enter a Valid Mobile Number."}),(0,a.jsxs)("p",{className:"mb-5 flex justify-between mt-2",children:["don't have an account"," ",(0,a.jsx)("button",{className:"text-blue-700",onClick:e=>{U(!0)},children:"Signup"})]}),(0,a.jsx)("button",{className:"flex flex-row items-center justify-center text-center w-full border rounded mt-2 outline-none py-3 bg-red-500 hover:bg-red-800 border-none text-white text-sm shadow-sm",onClick:e=>{ea(e)},children:"Login Mobile No"})]})}),R&&(0,a.jsxs)("form",{onSubmit:ei,children:[(0,a.jsxs)("div",{className:"rounded mt-1",children:[(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"firstName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"First Name"}),(0,a.jsx)("input",{type:"text",id:"firstName",name:"firstName",value:K.firstName,onChange:e=>X({...K,firstName:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"lastName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Last Name"}),(0,a.jsx)("input",{type:"text",id:"lastName",name:"lastName",value:K.lastName,onChange:e=>X({...K,lastName:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Email"}),(0,a.jsx)("input",{type:"email",id:"email",name:"email",value:K.email,onChange:e=>X({...K,email:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"cityName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Mobile No."}),(0,a.jsx)("input",{type:"text",id:"mobile",name:"mobile",value:K.mobile,onChange:es,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"cityName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Pincode"}),(0,a.jsx)("input",{type:"text",id:"pincode",name:"pincode",value:K.pincode,onChange:eo,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"panCard",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"PAN card No."}),(0,a.jsx)("input",{type:"text",id:"panCard",name:"panCard",value:K.panCard,onChange:en,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]})]}),(0,a.jsxs)("div",{className:"flex justify-between mt-2 mb-2",children:[(0,a.jsx)("p",{className:"text-sm",children:"Wait, I remember my account.."}),(0,a.jsx)("button",{className:"text-blue-700 text-sm",onClick:e=>{U(!1)},children:"Click here"})]}),W?(0,a.jsx)("div",{className:"loader-overlay",children:(0,a.jsx)(m.gy,{height:"50",width:"50",color:"#ef4444",ariaLabel:"tail-spin-loading",radius:"1",wrapperStyle:{},wrapperclassName:"",visible:!0})}):(0,a.jsx)("button",{type:"submit",className:"flex flex-row items-center justify-center text-center w-full border rounded mt-2 outline-none py-3 bg-red-500 hover:bg-red-800 border-none text-white text-sm shadow-sm",children:R?"Sign Up":"Submit"})]})]}),"/loan-offers-list"==Q&&""==z&&h&&(0,a.jsxs)("div",{children:[!R&&(0,a.jsx)("form",{className:"space-y-4",action:"#",children:W?(0,a.jsx)("div",{className:"loader-overlay",children:(0,a.jsx)(m.gy,{height:"50",width:"50",color:"#ef4444",ariaLabel:"tail-spin-loading",radius:"1",wrapperStyle:{},wrapperclassName:"",visible:!0})}):(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{for:"email",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Enter Your Phone No."}),(0,a.jsx)("input",{type:"phone",name:"mobileNumber",id:"mobileNumber",value:C,onChange:er,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white",placeholder:"+91 - 9824******",required:!0}),!D&&(0,a.jsx)("span",{className:"text-red-500",children:"Please Enter a Valid Mobile Number."}),(0,a.jsxs)("p",{className:"mb-5 flex justify-between mt-2",children:["don't have an account"," ",(0,a.jsx)("button",{className:"text-blue-700",onClick:e=>{U(!0)},children:"Signup"})]}),(0,a.jsx)("button",{className:"flex flex-row items-center justify-center text-center w-full border rounded mt-2 outline-none py-3 bg-red-500 hover:bg-red-800 border-none text-white text-sm shadow-sm",onClick:e=>{ea(e)},children:"Login Mobile No"})]})}),R&&(0,a.jsxs)("form",{onSubmit:ei,children:[(0,a.jsxs)("div",{className:"rounded mt-1",children:[(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"firstName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"First Name"}),(0,a.jsx)("input",{type:"text",id:"firstName",name:"firstName",value:K.firstName,onChange:e=>X({...K,firstName:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"lastName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Last Name"}),(0,a.jsx)("input",{type:"text",id:"lastName",name:"lastName",value:K.lastName,onChange:e=>X({...K,lastName:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Email"}),(0,a.jsx)("input",{type:"email",id:"email",name:"email",value:K.email,onChange:e=>X({...K,email:e.target.value}),className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"cityName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Mobile No."}),(0,a.jsx)("input",{type:"text",id:"mobile",name:"mobile",value:K.mobile,onChange:es,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 md:gap-6",children:[(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"cityName",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Pincode"}),(0,a.jsx)("input",{type:"text",id:"pincode",name:"pincode",value:K.pincode,onChange:eo,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})}),(0,a.jsx)("div",{className:"relative z-0 w-full mb-5 group",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"panCard",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"PAN card No."}),(0,a.jsx)("input",{type:"text",id:"panCard",name:"panCard",value:K.panCard,onChange:en,className:"bg-gray-50 border text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:!0})]})})]})]}),(0,a.jsxs)("div",{className:"flex justify-between mt-2 mb-2",children:[(0,a.jsx)("p",{className:"text-sm",children:"Wait, I remember my account.."}),(0,a.jsx)("button",{className:"text-blue-700 text-sm",onClick:e=>{U(!1)},children:"Click here"})]}),W?(0,a.jsx)("div",{className:"loader-overlay",children:(0,a.jsx)(m.gy,{height:"50",width:"50",color:"#ef4444",ariaLabel:"tail-spin-loading",radius:"1",wrapperStyle:{},wrapperclassName:"",visible:!0})}):(0,a.jsx)("button",{type:"submit",className:"flex flex-row items-center justify-center text-center w-full border rounded mt-2 outline-none py-3 bg-red-500 hover:bg-red-800 border-none text-white text-sm shadow-sm",children:R?"Sign Up":"Submit"})]})]})]})]})})})]})}},691:function(e,t,r){let a;r.d(t,{P:function(){return s},WF:function(){return b},bH:function(){return d},bJ:function(){return i},ly:function(){return m},o5:function(){return u},qD:function(){return o},vz:function(){return c}});var l=r(2601);console.log(window.location.origin),a="http://localhost"==window.location.origin?l.env.NEXT_PUBLIC_API_BASE_URL||"http://localhost:3000":window.location.origin;let n="".concat(a,"/api"),s="".concat(n,"/generateOTP"),o="".concat(n,"/verifyOTP"),i="".concat(n,"/getFilterOffers"),c="".concat(n,"/getCityList"),d="".concat(n,"/insertLeadApi"),u="".concat(n,"/incomeInsertLeadApi"),m="".concat(n,"/getNumber"),b="".concat(n,"/getStateCityList")},8082:function(e,t,r){function a(e){let t=e.replace(/\D/g,"").slice(0,10);return/^[6-9]/.test(t)?t:""}function l(e){let t=e.replace(/\D/g,"").slice(0,2);return/^[0-9]/.test(t)?t:""}function n(e){let t=e.replace(/\D/g,"").slice(0,6);return/^[0-9]/.test(t)?t:""}function s(e){let t=e.replace(/\D/g,"").slice(0,9);return Number(/^[0-9]/.test(t)?t:"").toLocaleString("en-IN")}function o(e){let t=e.replace(/\D/g,"");return Number(/^[0-9]/.test(t)?t:"").toLocaleString("en-IN")}function i(e){let t=e.target.value.replace(/[^0-9]/g,"").slice(0,9);return e.target.value=t,!(t<1e3)}function c(e){return(e=(e=e.trim().toUpperCase()).replace(/[^A-Z0-9]/g,"")).length>10&&(e=e.slice(0,10)),e}function d(e){return e.replace(/[^a-zA-Z0-9]/g,"").toUpperCase().slice(0,15)}function u(e){return e.trim().toLowerCase()}function m(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function b(e,t,r,a){return e.Profession>t&&e.Profession<=r&&Object.values(a).some(e=>e)}function g(){let e="123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",t="";for(let r=0;r<5;r++){let r=Math.floor(Math.random()*e.length);t+=e.charAt(r)}return t}function f(e){let t=new Date(e),r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return"".concat(r,"-").concat(a,"-").concat(l)}function x(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function h(e){switch(e){case"":return"Select Loan Application";case 27:return"Personal Loan";case 33:return"Business Loan";case 29:case 31:return"Income Loan";case 35:return"Term Insurance";case 36:return"GoldLoan";case 37:return"Credit Card";default:return""}}function p(e){return new Intl.NumberFormat("en-IN",{maximumFractionDigits:2,style:"currency",currency:"INR"}).format(e).replace("₹","Rs.").replace(".00","")}r.d(t,{Fg:function(){return d},Gz:function(){return b},HR:function(){return n},Jg:function(){return a},K3:function(){return s},Ln:function(){return i},Rq:function(){return h},W1:function(){return x},YF:function(){return c},Z4:function(){return g},ZY:function(){return o},do:function(){return l},go:function(){return u},oH:function(){return m},p6:function(){return f},zo:function(){return p}})},1172:function(e,t,r){r.d(t,{w_:function(){return i}});var a=r(2265),l={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},n=a.createContext&&a.createContext(l),s=function(){return(s=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var l in t=arguments[r])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},o=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)0>t.indexOf(a[l])&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(r[a[l]]=e[a[l]]);return r};function i(e){return function(t){return a.createElement(c,s({attr:s({},e.attr)},t),function e(t){return t&&t.map(function(t,r){return a.createElement(t.tag,s({key:r},t.attr),e(t.child))})}(e.child))}}function c(e){var t=function(t){var r,l=e.attr,n=e.size,i=e.title,c=o(e,["attr","size","title"]),d=n||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),a.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,l,c,{className:r,style:s(s({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),i&&a.createElement("title",null,i),e.children)};return void 0!==n?a.createElement(n.Consumer,null,function(e){return t(e)}):t(l)}}}]);