PageSourceSearch

https://velaflow.com/_next/static/chunks/pages/signup-834f6bf825a838b6.js

js velaflow.com collected 2026-09-24 13:03:29 UTC 16,628 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4252],{3645:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(37876);r(14232);var a=r(96145);let n=()=>(0,s.jsx)("div",{className:"w-full md:w-1/2 flex items-center justify-center bg-loginBackground md:min-h-screen",children:(0,s.jsx)("div",{className:"z-10 flex flex-col items-center p-4",children:(0,s.jsx)(a.Zc,{src:"/images/logo.png",alt:"Velaflow Logo",className:"h-[120px] w-[120px] md:h-[215px] md:w-[215px] mb-4"})})})},42659:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/signup",function(){return r(57261)}])},44858:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(37876),a=r(14232),n=r(53869),l=r(3645),i=r(89099),c=r(81220),o=r(56e3);let d=e=>{let{changepassword:t,email:r,successOTPVerification:d=()=>{},changeEmail:m=()=>{},setIsLoading:u=()=>{},isLoading:x=!1}=e,p=(0,i.useRouter)(),[h,f]=(0,a.useState)(""),[g,b]=(0,a.useState)(null),y=async()=>{let e=new FormData;e.append("email",r),e.append("otp",parseInt(h,10));try{return await (0,c.vJ)(e)}catch(e){return e.response.data}},j=async e=>{if(e.preventDefault(),(null==h?void 0:h.length)===0)return void b("OTP is required");if((null==h?void 0:h.length)<6&&b("Enter complete OTP"),u(!0),t){let e=await y();e.error?b(e.message):p.push("/reset-password?email=".concat(r))}else{let e=await y();e.error?b(e.message):d(),u(!1)}},w=(0,s.jsx)(o.A,{email:r,error:g,setOtpInput:f,submitOTP:j,changepassword:t,changeEmail:m,isLoading:x});return(0,s.jsx)(n.A,{leftSide:(0,s.jsx)(l.A,{}),rightSide:w,rightSideHeading:t?"Enter OTP":"Verify your Email"})}},53869:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(37876);r(14232);var a=r(96145);let n=e=>{let{leftSide:t,rightSide:r,rightSideHeading:n}=e;return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"min-h-screen flex flex-col md:flex-row bg-white overflow-x-hidden",children:[t,(0,s.jsx)("div",{className:"w-full md:w-1/2 mt-10 md:mt-0 flex items-center bg-white min-h-[50vh] md:min-h-screen",children:(0,s.jsxs)("div",{className:"w-full max-w-md px-4 md:px-8 md:ml-10",children:[(0,s.jsx)(a.DZ,{type:"h2",text:n,className:"text-3xl md:text-40 text-black font-normal mb-10 md:mb-20"}),r]})})]})})}},56e3:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var s=r(37876),a=r(14232),n=r(96145),l=r(85480);let i=e=>{let{handleResendOTP:t,isLoading:r=!1,otpActions:a,resendLoading:l=!1,resendSuccessText:i=""}=e,{PRIMARY:c,SECONDARY:o}=a;return(0,s.jsxs)("div",{className:"mt-6 space-y-3 w-full",children:[(0,s.jsx)(n.$n,{type:"submit",disabled:r,className:"w-full h-40 bg-primary text-white rounded-[5px] text-12",children:r?(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)(n.aH,{})}):c}),(0,s.jsx)(n.$n,{type:"button",variant:"outline",className:"w-full h-40 text-12 border border-grey text-black rounded-[5px]",onClick:t,children:l?(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)(n.aH,{className:"text-grey"})}):o}),i&&(0,s.jsx)("span",{className:"flex justify-center text-12 text-green",children:i})]})};var c=r(81220);let o=e=>{let{setOtpInput:t,error:r,email:o,isLoading:d=!1,otpActions:m}=e,[u,x]=(0,a.useState)(!1),[p,h]=(0,a.useState)("");(0,a.useEffect)(()=>{""!==p&&setTimeout(()=>{h("")},5e3)},[p]);let f=async()=>{x(!0);let e=new FormData;e.append("email",o),await (0,c.AJ)(e),h("New OTP sent successfully"),x(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.JU,{className:"mt-6 block text-12 text-black font-medium",children:"Enter OTP"}),(0,s.jsx)(l.A,{setOtpInput:t}),r&&(0,s.jsx)("p",{className:"text-12 text-red",children:r}),(0,s.jsx)(i,{handleResendOTP:f,resendLoading:u,resendSuccessText:p,isLoading:d,otpActions:m})]})},d={PRIMARY:"Proceed",SECONDARY:"Resend OTP"},m=e=>{let{email:t,error:r,setOtpInput:a,submitOTP:l,changepassword:i=!1,changeEmail:c,isLoading:m=!1,otpActions:u=d}=e;return(0,s.jsxs)("form",{className:"mt-6 md:mt-12 w-full max-w-md",onSubmit:l,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-gray-400 text-14",children:[(0,s.jsxs)("span",{children:["OTP sent to ",t]}),!i&&(0,s.jsx)(n.$n,{disabled:m,onClick:c,className:"text-primary hover:underline text-sm",children:"Change"})]}),(0,s.jsx)(o,{isLoading:m,email:t,setOtpInput:a,error:r,otpActions:u})]})}},57261:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var s=r(37876),a=r(14232),n=r(96145),l=r(3645),i=r(53869),c=r(56856),o=r(89099),d=r(91408),m=r(81220),u=r(10841),x=r.n(u),p=r(44858),h=r(10553),f=r(60614),g=r(42264),b=r.n(g);r(11827);let y=d.Ik().shape({first_name:d.Yj().required("First name is required"),last_name:d.Yj().required("Last name is required"),email:d.Yj().required("Email is required").matches(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"Enter a valid email address"),username:d.Yj().required("Username is required").min(3,"Must be at least 3 characters").matches(/^[a-zA-Z0-9-]+$/,"Only letters, numbers and hyphens allowed"),dob:d.p6().nullable().typeError("Invalid date").required("Date of birth is required"),
1country_code:d.Yj().required("Country code is required"),contact_number:d.Yj().required("Phone number is required").min(7,"Phone number is too short").max(15,"Phone number is too long"),password:d.Yj().min(8,"Min 8 characters").required("Password is required"),password_confirmation:d.Yj().oneOf([d.KR("password")],"Passwords must match").required("Confirm password is required"),terms_agreement:d.lc().oneOf([!0],"Please accept the terms")}),j=()=>{let e=(0,o.useRouter)(),[t,r]=(0,a.useState)({first_name:"",last_name:"",email:"",username:"",dob:"",password:"",password_confirmation:"",country_code:"",contact_number:"",terms_agreement:!1}),[d,u]=(0,a.useState)(1),[g,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[v,_]=(0,a.useState)({}),[k,C]=(0,a.useState)(!1),D=new Date,A=new Date;A.setFullYear(D.getFullYear()-18);let S=e=>{let{target:s}=e,{type:a,checked:n,name:l}=s,i="checkbox"===a?n:s.value;r({...t,[l]:i})},P=async()=>{var r;let{first_name:s,last_name:a,email:n,username:l,password:i,dob:c}=t,o=null==(r=t.country_code)?void 0:r.replace("+",""),d=new FormData;d.append("first_name",s),d.append("last_name",a),d.append("email",n),d.append("username",l),d.append("password",i),d.append("password_confirmation",i),d.append("dob",c),d.append("country_code",o),d.append("contact_number",t.contact_number);try{if(!(await (0,m.E_)(d)).error){let t=await (0,h.signIn)("credentials",{redirect:!1,email:n,password:i});(null==t?void 0:t.ok)?e.push("/complete-profile"):(console.error(null==t?void 0:t.error),C(!1))}}catch(e){C(!1)}},O=async()=>{let e=new FormData;e.append("email",T),(await (0,m.AJ)(e)).error||(C(!1),u(2))},E=async e=>{e.preventDefault();try{await y.validate(t,{abortEarly:!1}),_({})}catch(t){let e={};t.inner?t.inner.forEach(t=>{e[t.path]=t.message}):e[t.path]=t.message,_(e);return}C(!0);try{let e=new FormData;e.append("email",t.email);let r=new FormData;r.append("username",t.username);let[s,a]=await Promise.all([(0,m.$O)("email",e),(0,m.$O)("username",r)]),n={};(null==s?void 0:s.error)&&(n.email=s.message),(null==a?void 0:a.error)&&(n.username=a.message),Object.keys(n).length>0?(_(n),C(!1)):(_({}),await O())}catch(e){console.error("Error checking signup details:",e)}},I=async()=>{await P()},{first_name:q,last_name:Y,email:T,username:F,dob:R,password:$,password_confirmation:L,terms_agreement:H}=t,M=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"mt-6 md:mt-12 space-y-4",onSubmit:E,autoComplete:"off",children:[(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"w-1/2",children:[(0,s.jsx)(n.pd,{type:"text",placeholder:"First name",autoComplete:"off",value:q,name:"first_name",onChange:S,className:"w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"name-icn",width:16,height:16,className:"inline-block text-grey"})})}),v.first_name&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.first_name})]}),(0,s.jsxs)("div",{className:"w-1/2",children:[(0,s.jsx)(n.pd,{type:"text",placeholder:"Last name",autoComplete:"off",value:Y,name:"last_name",onChange:S,className:"w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"name-icn",width:16,height:16,className:"inline-block text-grey"})})}),v.last_name&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.last_name})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.pd,{type:"email",placeholder:"Email Address",autoComplete:"off",value:T,name:"email",onChange:S,className:"w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"username-icn",width:16,height:16,className:"inline-block text-grey"})})}),v.email&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.email})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.pd,{type:"text",placeholder:"Username",autoComplete:"off",value:F,name:"username",onChange:S,className:"w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"name-icn",width:16,height:16,className:"inline-block text-grey"})})}),v.username&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.username}),F&&!v.username&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-12 mt-3 text-grey",children:(0,s.jsxs)("p",{children:["Your full user name will be"," ",(0,s.jsxs)("span",{className:"text-black",children:["@","".concat(F)]})]})}),(0,s.jsxs)("div",{className:"mt-3 p-3 text-[10px] rounded-[5px] bg-
1offWHite text-grey",children:[(0,s.jsxs)("span",{className:"block",children:[(0,s.jsx)(n.In,{id:"tick-icn",width:12,height:9,className:"inline-block mr-2 text-grey"}),"Only contains letters, numbers and hyphens"]}),(0,s.jsxs)("span",{className:"block",children:[(0,s.jsx)(n.In,{id:"tick-icn",width:12,height:9,className:"inline-block mr-2 text-grey"}),"Must be at least 3 characters"]})]})]})]}),(0,s.jsxs)("div",{className:" flex flex-col sm:flex-row gap-3",children:[(0,s.jsxs)("div",{className:"w-full md:w-1/2",children:[(0,s.jsx)(b(),{country:"gb",value:"".concat(t.country_code).concat(t.contact_number),enableSearch:!0,countryCodeEditable:!1,inputStyle:{width:"100%",height:"40px",fontSize:"12px"},onChange:(e,t)=>{let s="+".concat(t.dialCode),a=e.replace(t.dialCode,"");r(e=>({...e,country_code:s,contact_number:a}))},containerClass:"w-full",inputClass:" w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary ",buttonClass:"border-grey"}),v.contact_number&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.contact_number})]}),(0,s.jsxs)("div",{className:"w-full md:w-1/2",children:[(0,s.jsx)(c.Ay,{selected:R,onChange:e=>{let s=x()(e).format("MM/DD/YYYY");r({...t,dob:s})},maxDate:A,openToDate:A,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:200,customInput:(0,s.jsx)(f.A,{}),className:"w-full pl-10 h-40 px-4 py-3 text-12 text-black border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",onFocus:e=>e.target.blur(),onChangeRaw:e=>e.preventDefault()}),v.dob&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.dob})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.pd,{type:g?"text":"password",placeholder:"Password",autoComplete:"new-password",value:$,name:"password",onChange:S,className:"w-full pl-10 pr-10 h-40 px-4 py-3 text-black text-12 border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",suffix:(0,s.jsx)("span",{className:"absolute text-center right-4 top-1/2 -translate-y-1/2 cursor-pointer",children:(0,s.jsx)(n.In,{id:g?"eye-cut-icn":"eye-icn",onClick:()=>{j(!g)},width:20,height:16,className:"inline-block text-grey"})}),prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"password-icn",width:16,height:16,className:"inline-block text-grey"})})}),v.password&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.password})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.pd,{type:w?"text":"password",placeholder:"Confirm Password",autoComplete:"new-password",name:"password_confirmation",value:L,onChange:S,className:"w-full pl-10 pr-10 h-40 px-4 py-3 text-black text-12 border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",prefix:(0,s.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,s.jsx)(n.In,{id:"password-icn",width:16,height:16,className:"inline-block text-grey"})}),suffix:(0,s.jsx)("span",{className:"absolute right-4 top-1/2 -translate-y-1/2 cursor-pointer",onClick:()=>N(!w),children:(0,s.jsx)(n.In,{id:w?"eye-cut-icn":"eye-icn",width:20,height:16,className:"inline-block text-grey"})})}),v.password_confirmation&&(0,s.jsx)("p",{className:"pl-2 text-red text-12",children:v.password_confirmation})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3 text-12 text-gray-500 leading-tight",children:[(0,s.jsx)(n.pd,{type:"checkbox",checked:H,name:"terms_agreement",onChange:S,className:"mt-[2px] accent-primary w-[14px] focus:border-none h-[14px]"}),(0,s.jsxs)(n.JU,{className:"text-left",children:["I read and agree to the"," ",(0,s.jsx)(n.N_,{href:"/settings/about/terms-of-services/",target:"_blank",className:"text-primary underline",children:"Terms of service"})," ","and"," ",(0,s.jsx)(n.N_,{href:"/settings/about/privacy-policy/",target:"_blank",className:"text-primary underline",children:"Privacy policy"})]})]}),(null==v?void 0:v.terms_agreement)&&(0,s.jsx)("p",{className:"mt-0 text-red text-12",children:null==v?void 0:v.terms_agreement}),(0,s.jsx)(n.$n,{type:"submit",disabled:k,className:"w-full h-40 mt-2 text-14 bg-primary text-white rounded transition ",children:k?(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)(n.aH,{})}):"Sign up"})]}),(0,s.jsxs)("div",{className:"mt-4 text-14 md:mt-6 text-center justify-center text-grey",children:["Already have an account?"," ",(0,s.jsx)(n.N_,{href:"/login",className:"text-primary hover:underline",children:"Sign in"})]})]});return(0,s.jsx)(s.Fragment,{children:1===d?(0,s.jsx)(i.A,{leftSide:(0,s.jsx)(l.A,{}),rightSide:M,rightSideHeading:"Sign up"}):(0,s.jsx)(p.A,{changeEmail:()=>{u(1)},email:T,successOTPVerification:I,isLoading:k,setIsLoading:C})})};function w(){return(0,s.jsx)(j,{})}},60614:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(37876),a=r(14232),n=r(96145);let l=(0,a.forwardRef)((e,t)=>{let{value:r,onClick:a}=e;return(0,s.jsxs)(n.$n,{onClick:e=>{e.preventDefault(),a(e)},ref:t,type:"button",className:"w-full flex bg-white items-center gap-2 px-4 py-2 h-4
10 text-12 text-black border border-grey rounded focus:outline-none",children:[(0,s.jsx)(n.In,{id:"calender-icn",width:18,height:20,className:"inline-block text-black"}),(0,s.jsx)("span",{className:"text-12 ".concat(r?"text-black":"text-grey"),children:r||"DOB"})]})});l.displayName="CustomDateButton";let i=l},85480:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(37876),a=r(14232);let n=e=>{let{setOtpInput:t}=e,[r,n]=(0,a.useState)(Array(6).fill("")),l=(0,a.useRef)([]);(0,a.useEffect)(()=>{l.current[0]&&l.current[0].focus()},[]);let i=e=>{var s;e.preventDefault();let a=e.clipboardData.getData("Text").trim().replace(/\s/g,"").slice(0,6);if(!/^[0-9a-zA-Z]+$/.test(a))return;let i=[...r];for(let e=0;e<6;e++)i[e]=a[e]||"",l.current[e]&&(l.current[e].value=a[e]||"");n(i),t(i.join(""));let c=a.length<6?a.length:5;null==(s=l.current[c])||s.focus()};return(0,s.jsx)("div",{className:"flex gap-2 mt-4",children:r.map((e,a)=>(0,s.jsx)("input",{type:"text",maxLength:1,value:e,onChange:e=>((e,s)=>{let a=e.target.value;if(!/^[0-9a-zA-Z]?$/.test(a))return;let i=[...r];i[s]=a,n(i),t(i.join("")),a&&s<5&&l.current[s+1].focus()})(e,a),onKeyDown:e=>((e,t)=>{"Backspace"===e.key&&""===r[t]&&t>0&&l.current[t-1].focus()})(e,a),onPaste:i,ref:e=>l.current[a]=e,className:"w-10 h-10 text-black font-normal md:w-12 md:h-12 text-center text-2xl border border-grey rounded focus:outline-none focus:ring-2 focus:ring-primary"},a))})}}},e=>{e.O(0,[3716,1121,6701,1408,3088,636,6593,8792],()=>e(e.s=42659)),_N_E=e.O()}]);

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.