(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[966],{7300:function(e,t,n){Promise.resolve().then(n.bind(n,5059))},5059:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var i=n(7437),r=n(9817),o=n(2286),a=n(2265),s=n(3411),l=n.n(s);function c(){let[e,t]=(0,a.useState)(),[n,s]=(0,a.useState)(),[c,u]=(0,a.useState)(),[d,f]=(0,a.useState)(),[g,h]=(0,a.useState)(!1),p=async()=>{if(h(!0),!e||!n||!c||!d){l().fire({icon:"error",title:"Oops...",text:"Please Fill All Fields!"}),h(!1);return}if(!n.includes("@")){l().fire({icon:"error",title:"Oops...",text:"Please Enter Valid Email Address!"}),h(!1);return}if(c!==d){l().fire({icon:"error",title:"Oops...",text:"Both Passwords Are Not Same!"}),h(!1);return}if(c.length<6||d.length<6){l().fire({icon:"error",title:"Oops...",text:"Please Enter Atleast 6 digits password!"}),h(!1);return}await (0,o.EQ)({name:e,email:n,password:c,confirmpassword:d})};return(0,i.jsx)("div",{className:"w-full h-screen bg-[#0F6DAD] p-3 flex justify-center items-center",children:(0,i.jsxs)("div",{className:"lg:w-1/3 sm:w-1/2 bg-[#E5E7EB] min-w-screen-sm border-black flex flex-col space-y-6 p-5 rounded-xl",children:[(0,i.jsx)("p",{className:"text-2xl text-center font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-teal-400",children:"Sign Up Page"}),(0,i.jsx)(r.Z,{onChange:e=>t(e.target.value),id:"outlined-basic",label:"Full Name",variant:"outlined"}),(0,i.jsx)(r.Z,{onChange:e=>s(e.target.value),id:"outlined-basic",label:"Email",variant:"outlined"}),(0,i.jsx)(r.Z,{onChange:e=>u(e.target.value),id:"outlined-basic",label:"Password",variant:"outlined"}),(0,i.jsx)(r.Z,{onChange:e=>f(e.target.value),id:"outlined-basic",label:"Confirm Password",variant:"outlined"}),g?(0,i.jsx)("button",{className:"w-full p-3 bg-blue-400 rounded-xl text-white",children:(0,i.jsx)("img",{className:"w-7 m-auto",src:"https://i.gifer.com/ZZ5H.gif"})}):(0,i.jsx)("button",{onClick:p,className:"w-full p-3 bg-blue-400 rounded-xl text-white",children:"Sign Up"}),(0,i.jsxs)("p",{className:"text-center",children:["Already have an account ? ",(0,i.jsx)("a",{href:"signin",className:"cursor-pointer font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-teal-400",children:"Sign In"})]})]})})}},2286:function(e,t,n){"use strict";n.d(t,{Aj:function(){return r.Aj},EQ:function(){return u},I8:function(){return l},eM:function(){return f},ii:function(){return d},tw:function(){return g}});var i=n(6142),r=n(2730),o=n(3411),a=n.n(o);let s=(0,i.ZF)({apiKey:"AIzaSyD195F2zoBDofAcRCDuCpFuPCsiunl_Toc",authDomain:"data-echo-prod.firebaseapp.com",projectId:"data-echo-prod",storageBucket:"data-echo-prod.appspot.com",messagingSenderId:"22393559285",appId:"1:22393559285:web:d549056dd6de31a27d4dbc"}),l=(0,r.v0)(s),c=new r.hJ;async function u(e){let{email:t,password:n}=e;await (0,r.Xb)(l,t,n).then(e=>{console.log("user",e.user),a().fire({title:"Good job!",text:"Register Successfull!",icon:"success"}),setTimeout(()=>{window.location.href="signin"},2e3)}).catch(e=>{e.code,e.message,console.log(e.message)})}async function d(e){let{email:t,password:n}=e;await (0,r.e5)(l,t,n).then(e=>{e.user,a().fire({title:"Good job!",text:"Sign In Successfull!",icon:"success"}),setTimeout(()=>{window.location.href="/"},2e3)}).catch(e=>{let t=e.code;if(e.message,"auth/invalid-credential"==t){a().fire({icon:"error",title:"Oops...",text:"User Not Found Sign Up First!"});return}a().fire({icon:"error",title:"Oops...",text:"Something Went Wrong Try Again!"})})}async function f(){try{await (0,r.rh)(l,c),window.location.href="/"}catch(e){console.error("Error Sign In With Google",e)}}async function g(){try{await (0,r.w7)(l),a().fire({title:"Good job!",text:"Sign Out Successfull!",icon:"success"}),setTimeout(()=>{window.location.href="/"},2e3)}catch(e){alert(e.message)}}}},function(e){e.O(0,[50,461,593,817,971,69,744],function(){return e(e.s=7300)}),_N_E=e.O()}]);