(()=>{var e={};e.id=1235,e.ids=[1235],e.modules={72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},60313:(e,t,a)=>{"use strict";a.r(t),a.d(t,{GlobalError:()=>i.a,__next_app__:()=>p,originalPathname:()=>c,pages:()=>u,routeModule:()=>h,tree:()=>d}),a(50430),a(88242),a(35866);var s=a(23191),r=a(88716),n=a(37922),i=a.n(n),o=a(95231),l={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>o[e]);a.d(t,l);let d=["",{children:["auth",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(a.bind(a,50430)),"/root/ShiftedOffRoad/app/auth/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(a.bind(a,88242)),"/root/ShiftedOffRoad/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(a.t.bind(a,35866,23)),"next/dist/client/components/not-found-error"]}],u=["/root/ShiftedOffRoad/app/auth/page.tsx"],c="/auth/page",p={require:a,loadChunk:()=>Promise.resolve()},h=new s.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/auth/page",pathname:"/auth",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},72464:(e,t,a)=>{Promise.resolve().then(a.bind(a,19026))},99369:(e,t,a)=>{Promise.resolve().then(a.bind(a,6844))},90486:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,12994,23)),Promise.resolve().then(a.t.bind(a,96114,23)),Promise.resolve().then(a.t.bind(a,9727,23)),Promise.resolve().then(a.t.bind(a,79671,23)),Promise.resolve().then(a.t.bind(a,41868,23)),Promise.resolve().then(a.t.bind(a,84759,23))},19026:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>i});var s=a(10326),r=a(17577),n=a(77109);function i(){let[e,t]=(0,r.useState)(""),[a,i]=(0,r.useState)(""),[o,l]=(0,r.useState)(""),[d,u]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[h,m]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[f,v]=(0,r.useState)("storeshifted"),[j,S]=(0,r.useState)(""),[b,P]=(0,r.useState)(!1);async function y(t){t.preventDefault(),u(!0),l("");let s=await (0,n.signIn)("credentials",{email:e,password:a,redirect:!0,callbackUrl:"/connect"});s?.error&&l("Invalid credentials."),u(!1)}async function _(e){e.preventDefault(),P(!0),S("");try{let e=await fetch("/api/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c,email:h,password:g,slug:f})}),t=await e.json();if(!e.ok)throw Error(t.error||"Sign up failed");await (0,n.signIn)("credentials",{email:h,password:g,redirect:!0,callbackUrl:"/connect"})}catch(e){S(e.message||"Sign up failed.")}finally{P(!1)}}return s.jsx("main",{className:"auth-page",children:s.jsx("section",{className:"section",children:(0,s.jsxs)("div",{className:"container auth-page__inner auth-page__inner--wide",children:[s.jsx("h1",{className:"page-title",children:"Sign In / Sign Up"}),(0,s.jsxs)("div",{className:"auth-page__grid",children:[(0,s.jsxs)("form",{className:"auth-card",onSubmit:y,children:[s.jsx("h2",{children:"Sign In"}),s.jsx("input",{type:"email",placeholder:"Email",value:e,onChange:e=>t(e.target.value)}),s.jsx("input",{type:"password",placeholder:"Password",value:a,onChange:e=>i(e.target.value)}),s.jsx("button",{className:"btn",type:"submit",disabled:d,children:d?"Signing in...":"Sign in"}),o?s.jsx("div",{className:"connect-message",children:o}):null]}),(0,s.jsxs)("form",{className:"auth-card",onSubmit:_,children:[s.jsx("h2",{children:"Create Account"}),s.jsx("input",{type:"text",placeholder:"Name",value:c,onChange:e=>p(e.target.value)}),s.jsx("input",{type:"email",placeholder:"Email",value:h,onChange:e=>m(e.target.value)}),s.jsx("input",{type:"password",placeholder:"Password",value:g,onChange:e=>x(e.target.value)}),s.jsx("input",{type:"text",placeholder:"Store slug (e.g. storeshifted)",value:f,onChange:e=>v(e.target.value)}),s.jsx("button",{className:"btn",type:"submit",disabled:b,children:b?"Creating...":"Create account"}),j?s.jsx("div",{className:"connect-message",children:j}):null]})]}),(0,s.jsxs)("div",{className:"connect-muted",style:{marginTop:12},children:["Just shopping? ",s.jsx("a",{href:"/signup/customer",children:"Create a customer account"})]})]})})})}},6844:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var s=a(10326),r=a(77109);function n({children:e}){return s.jsx(r.SessionProvider,{children:e})}},50430:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s});let s=(0,a(68570).createProxy)(String.raw`/root/ShiftedOffRoad/app/auth/page.tsx#default`)},88242:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>i,metadata:()=>n});var s=a(19510);a(7633);let r=(0,a(68570).createProxy)(String.raw`/root/ShiftedOffRoad/components/Providers.tsx#default`),n={title:"ShiftedFDev",description:"Next.js app"};function i({children:e}){return s.jsx("html",{lang:"en",children:s.jsx("body",{children:s.jsx(r,{children:e})})})}},7633:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),s=t.X(0,[9276,1159],()=>a(60313));module.exports=s})();