1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2250],{4487:(e,t,s)=>{s.d(t,{l:()=>a});function a(e,t){let s={};return e?/\S+@\S+\.\S+/.test(e)||(s.email="Enter a valid email address."):s.email="Email is required.",t?t.length<6&&(s.password="Password must be at least 6 characters."):s.password="Password is required.",s}},44177:(e,t,s)=>{s.d(t,{y:()=>a});let a=(0,s(15966).M)()},50229:(e,t,s)=>{s.d(t,{A:()=>p});var a=s(82460),r=s(76304),l=s(2456),i=s(54887),c=s.n(i),n=s(67500),o=s(85659),d=s(74669),m=s(4487),x=s(26022),h=s(3171),u=s(44177);function p(){let[e,t]=(0,r.useState)(""),[s,i]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[f,w]=(0,r.useState)({}),[y,v]=(0,r.useState)(""),[j,b]=(0,r.useState)(!1),N=(0,l.useRouter)(),{user:k,setAuthModalState:S}=(0,n.A)(),C=(0,l.usePathname)(),[P,A]=(0,r.useState)(null),G=async t=>{t.preventDefault(),w({}),v(""),b(!0);let a=(0,m.l)(s,p);if(Object.keys(a).length>0){w(a),b(!1);return}let{data:r,error:l}=await u.y.signUp.email({email:s,password:p,name:e,callbackURL:"/login-register?isVerified=true"});l?w({email:l.message}):(r.user?.email,v("Check your email to confirm your account.")),b(!1)},R=async e=>{await u.y.signIn.social({provider:e,callbackURL:C,errorCallbackURL:"/login-register?error=social_auth_failed"})};function E(){localStorage.setItem("path",C)}if(!k)return(0,a.jsx)("div",{className:" flex items-center justify-center ",children:(0,a.jsxs)("div",{className:"w-full max-w-md bg-white dark:bg-dark-header rounded-2xl p-6 sm:p-8 space-y-6 animate-fade-in",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h2",{className:"text-3xl font-bold dark:text-white",children:"Letâs Get You Started"}),(0,a.jsx)("p",{className:"text-sm dark:text-white/50 mt-1",children:"Start your journey with us"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("button",{onClick:()=>{R("google"),A("Google"),b(!0),E()},disabled:j&&"Google"===P,className:"w-full text-base flex items-center justify-center gap-2 py-3 border dark:border-white/20 rounded-full hover:bg-secondary/10 dark:text-white font-medium transition",children:[j&&"Google"===P?(0,a.jsxs)("div",{className:"custom-spin",children:[" ",(0,a.jsx)(x.A,{className:"size-5 text-primary"})]}):(0,a.jsx)(h.default,{src:"/images/social-icon/google-color.svg",alt:"Google",className:"w-5 h-5",width:"24",height:"24"}),"Google"]}),(0,a.jsxs)("button",{onClick:()=>{R("github"),A("Github"),b(!0),E()},className:"w-full text-base flex items-center justify-center gap-2 py-3 border dark:border-white/20 rounded-full hover:bg-secondary/10 dark:text-white font-medium transition",children:[j&&"Github"===P?(0,a.jsxs)("div",{className:"custom-spin",children:[" ",(0,a.jsx)(x.A,{className:"size-5 text-primary"})]}):(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{fill:"currentcolor",d:"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2",stroke:"#000"})}),"GitHub"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 pt-4",children:[(0,a.jsx)("div",{className:"flex-grow h-px bg-border dark:bg-white/20"}),(0,a.jsx)("p",{className:"text-sm dark:text-white/50",children:"OR"}),(0,a.jsx)("div",{className:"flex-grow h-px bg-border dark:bg-white/20"})]}),y&&(0,a.jsx)("p",{className:"text-sm text-success font-medium text-center p-1.5 px-4 rounded-full bg-success/10 w-fit",children:y}),(0,a.jsxs)("form",{onSubmit:G,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{children:(0,a.jsx)(o.p,{type:"text",placeholder:"Full Name",value:e,name:"name",onChange:e=>t(e.target.value),required:!0})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.p,{type:"email",placeholder:"Email",value:s,name:"email",onChange:e=>i(e.target.value)}),s&&(0,a.jsx)("p",{className:"text-sm text-gray-400 dark:text-white/40 mt-1",children:"We will send verification email so make sure enter correct one."}),f.email&&(0,a.jsx)("p",{className:"text-sm text-red-500 mt-1",children:f.email})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.p,{type:"password",placeholder:"Password",name:"password",value:p,onChange:e=>g(e.target.value)}),f.password&&(0,a.jsx)("p",{className:"text-sm text-red-500 mt-1",children:f.password})]})]}),(0,a.jsxs)(d.$,{size:"lg",type:"submit",className:"w-full mt-4 text-base",disabled:j,children:[j?(0,a.jsxs)("svg",{className:"animate-spin h-5 w-5 mr-2 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}):null,j?"Registering...":"Register"]}),(0,a.jsxs)("p",{className:"flex justify-center gap-1 text-sm text-center mt-8",children:["Already have an account?"," ",(0,a.jsx)("button",{onClick:()=>S("login"),className:"text-forest-black/90 dark:text-white/60 hover:text-primary dark:hover:text-primary",children:"Sign in"})]}),(0,a.jsxs)("p",{className:"flex justify-center gap-1 text-sm text-center text-gray-400 pt-2",children:["By signing up, you agree to"," ",(0,a.jsx)(c(),{prefetch:!1,href:"/terms-condition",className:"text-forest-black/90 dark:text-white/80 hover:text-primary dark:hover:text-primary",children:"Our Terms"})," ","and"," ",(0,a.jsx)(c(),{prefetch:!1,className:"text-forest-black/90 dark:text-white/60 hover:text-primary dark:hover:text-primary",href:"/privacy-policy",children:"Privacy Policy."})]})]})]})});N.push("/")}},51060:(e,t,s)=>{s.d(t,{A:()=>g});var a=s(82460),r=s(76304),l=s(2456),i=s(54887),c=s.n(i),n=s(67500),o=s(85659),d=s(74669),m=s(4487),x=s(44177),h=s(26022),u=s(3171),p=s(14404);function g({setOpen:e}){let[t,s]=(0,r.useState)(""),[i,f]=(0,r.useState)(""),[w,y]=(0,r.useState)({}),[v,j]=(0,r.useState)(""),[b,N]=(0,r.useState)(!1),{user:k,setAuthModalState:S}=(0,n.A)(),C=(0,l.usePathname)(),P=(0,l.useRouter)(),[A,G]=(0,r.useState)(null),R=(0,l.useSearchParams)().get("isVerified");(0,r.useEffect)(()=>{R&&p.oR.success("Your email verified successfully!",{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!1,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",transition:p.br})},[]);let E=async e=>{await x.y.signIn.social({provider:e,callbackURL:C,errorCallbackURL:"/login-register?error=social_auth_failed"})},O=async e=>{e.preventDefault(),y({}),j("");let s=(0,m.l)(t,i);if(Object.keys(s).length>0)return void y(s);N(!0);let{data:a,error:r}=await x.y.signIn.email({email:t,password:i,callbackURL:"/"});if(r)y({password:r.message});else{j("Success! Redirecting...");let e=localStorage.getItem("path")??"/";P.push(e)}N(!1)};function U(){localStorage.setItem("path",C)}if(!k)return(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsxs)("div",{className:"w-full bg-white dark:bg-dark-header rounded-2xl p-6 sm:p-8 space-y-6 animate-fade-in",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h2",{className:"text-3xl font-bold dark:text-white",children:"Welcome to Tailwind Admin"}),(0,a.jsx)("p",{className:"text-sm dark:text-white/60 mt-1",children:"Unlock your profile with Sign In"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("button",{onClick:()=>{E("google"),G("Google"),N(!0),U()},disabled:b&&"Google"===A,className:"w-full text-base flex items-center justify-center gap-2 py-3 border dark:border-white/20 rounded-full hover:bg-secondary/10 dark:text-white font-medium transition",children:[b&&"Google"===A?(0,a.jsxs)("div",{className:"custom-spin",children:[" ",(0,a.jsx)(h.A,{className:"size-5 text-primary"})]}):(0,a.jsx)(u.default,{src:"/images/social-icon/google-color.svg",alt:"Google",className:"w-5 h-5",width:"24",height:"24"}),"Google"]}),(0,a.jsxs)("button",{onClick:()=>{E("github"),G("Github"),N(!0),U()},className:"w-full text-base flex items-center justify-center gap-2 py-3 border dark:border-white/20 rounded-full hover:bg-secondary/10 dark:text-white font-medium transition",children:[b&&"Github"===A?(0,a.jsxs)("div",{className:"custom-spin",children:[" ",(0,a.jsx)(h.A,{className:"size-5 text-primary"})]}):(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{fill:"currentcolor",d:"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03
11.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2",stroke:"#000"})}),"GitHub"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 pt-4",children:[(0,a.jsx)("div",{className:"flex-grow h-px bg-border dark:bg-white/20"}),(0,a.jsx)("p",{className:"text-sm dark:text-white/50",children:"OR"}),(0,a.jsx)("div",{className:"flex-grow h-px bg-border dark:bg-white/20"})]}),v&&(0,a.jsx)("p",{className:"text-sm text-green-600 text-center",children:v}),(0,a.jsx)("div",{className:"flex flex-col gap-4 pt-1",children:(0,a.jsxs)("form",{onSubmit:O,className:"space-y-4 max-w-md",autoComplete:"on",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.p,{type:"email",placeholder:"Email",value:t,name:"email",autoComplete:"email",onChange:e=>s(e.target.value)}),w.email&&(0,a.jsx)("p",{className:"text-sm text-red-500 mt-1",children:w.email})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.p,{type:"password",placeholder:"Password",name:"password",value:i,onChange:e=>f(e.target.value)}),w.password&&(0,a.jsx)("p",{className:"text-sm text-red-500 mt-1",children:w.password})]}),(0,a.jsxs)(d.$,{size:"lg",type:"submit",className:"w-full mt-2 text-base",disabled:b,children:[b?(0,a.jsxs)("svg",{className:"animate-spin h-5 w-5 mr-2 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}):null,b?"Signing In...":"Sign In"]})]})}),(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsxs)("p",{className:"flex gap-1.5 text-sm text-center text-gray-400 pt-2",children:["Donât have an account?"," ",(0,a.jsx)("button",{type:"submit",onClick:()=>S("signup"),className:"text-forest-black/90 dark:text-white/60 hover:text-primary dark:hover:text-primary",children:"Sign up"})]}),(0,a.jsx)(c(),{href:"/forgot-password",prefetch:!1,onClick:()=>e&&e(!1),className:"text-forest-black/90 dark:text-white/60 hover:text-primary dark:hover:text-primary font-normal pb-2 block mb-2 text-sm text-center",children:"Forgot Password?"}),(0,a.jsxs)("p",{className:"flex justify-center gap-1 text-sm text-center text-gray-400 dark:text-white/40 pt-0",children:["By signing in, you agree to"," ",(0,a.jsx)(c(),{prefetch:!1,href:"/terms-condition",className:"text-forest-black/90 dark:text-white/80 hover:text-primary dark:hover:text-primary",children:"Our Terms"})," ","and"," ",(0,a.jsx)(c(),{prefetch:!1,className:"text-forest-black/90 dark:text-white/60 hover:text-primary dark:hover:text-primary",href:"/privacy-policy",children:"Privacy Policy."})]})]})]})});P.push("/")}},67500:(e,t,s)=>{s.d(t,{A:()=>n,AuthProvider:()=>c});var a=s(82460),r=s(76304),l=s(44177);let i=(0,r.createContext)({user:null,isPaidUser:!1,isActivated:!0,logout:async()=>{},authModalState:"",setAuthModalState:()=>{}});function c({children:e}){let{data:t}=l.y.useSession(),[s,n]=(0,r.useState)(null),[o,d]=(0,r.useState)(!1),[m,x]=(0,r.useState)("login"),[h,u]=(0,r.useState)(!0);(0,r.useEffect)(()=>{t?n(t.user):console.log(t,"My Session Data notfound")},[t]);let p=async()=>{await l.y.signOut(),n(null)};async function g(){try{let e=await fetch("/api/order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s?.email})}),t=await e.json();if(t.orders){let e=t.orders.some(e=>e.product.price>0);d(e),u(!1)}}catch(e){console.log(e)}}return(0,r.useEffect)(()=>{s?g():null===s&&u(!1)},[s]),(0,a.jsx)(i.Provider,{value:{user:s,logout:p,authModalState:m,setAuthModalState:x,isPaidUser:o,isActivated:h},children:e})}let n=()=>(0,r.useContext)(i)},85173:(e,t,s)=>{s.d(t,{default:()=>o});var a=s(82460),r=s(76304),l=s(2456),i=s(44177),c=s(74669),n=s(26022);function o(){let[e,t]=(0,r.useState)(""),[s,o]=(0,r.useState)(""),[d,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[u,p]=(0,r.useState)(!0),g=(0,l.useRouter)(),[f,w]=(0,r.useState)(!1),y=(0,l.useSearchParams)().get("token");(0,r.useEffect)(()=>{y||m("Missing access token."),p(!1)},[y]);let v=async t=>{if(t.preventDefault(),m(""),h(""),e!==s)return void m("Passwords do not match.");if(!y)return void alert("Invalid or missing reset token.");try{w(!0);let{data:t,error:s}=await i.y.resetPassword({newPassword:e,token:y});s?m(s.message):(h("Password updated! Redirecting to login..."),setTimeout(()=>g.push("/login-register"),2e3))}catch(e){console.log("Something went wrong")}finally{w(!1)}};return u?(0,a.jsx)("div",{className:"p-8 text-center",children:"Validating link..."}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-full max-w-md dark:bg-dark-header rounded-2xl p-8 space-y-9 animate-fade-in",children:(0,a.jsx)("div",{className:" flex items-center justify-center dark:bg-deepNavy",children:(0,a.jsxs)("div",{className:"w-full max-w-md bg-white dark:bg-dark-header rounded-2xl p-8 space-y-6 animate-fade-in",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h2",{className:"text-3xl font-bold text-primary dark:text-white",children:"Reset Password"}),(0,a.jsxs)("p",{className:"text-sm text-primary/50 dark:text-white/60 mt-1",children:[" ","Enter your new password"]})]}),x&&(0,a.jsx)("p",{className:"text-sm text-green-600 text-center",children:x}),d&&(0,a.jsx)("p",{className:"text-sm text-red-500 text-center",children:d}),(0,a.jsx)("div",{className:"flex flex-col gap-4 pt-1",children:(0,a.jsxs)("form",{onSubmit:v,className:"space-y-4",autoComplete:"on",children:[(0,a.jsx)("input",{type:"password",placeholder:"New Password",value:e,autoComplete:"password",onChange:e=>t(e.target.value),className:"input-style"}),(0,a.jsx)("input",{type:"password",placeholder:"Confirm Password",value:s,autoComplete:"new-password",onChange:e=>o(e.target.value),className:"input-style"}),(0,a.jsxs)(c.$,{type:"submit",disabled:f,className:"w-full py-3 border border-primary bg-primary hover:bg-primary/80 text-white font-semibold rounded-full transition",children:[f&&(0,a.jsx)("div",{className:"animate-spin",children:(0,a.jsx)(n.A,{className:"text-primary"})}),f?"Updating...":"Update Password"]})]})})]})})})})}}}]);
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.