!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4eb8cd86-c5a0-49ea-baee-10432633909e",e._sentryDebugIdIdentifier="sentry-dbid-4eb8cd86-c5a0-49ea-baee-10432633909e")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[720],{23379:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/log-in",function(){return t(17730)}])},17730:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSG:function(){return A}});var i=t(52676),r=t(77934),n=t(79580),a=t(73317),l=t(32702),o=t(38981),c=t(69465),d=t(54401),u=t(70288),m=t(20977),g=t(71376),h=t(292),f=t(69848),p=t(8275),x=t(15638),j=t(11434),w=t(46838),b=t.n(w),N=t(85137),v=t.n(N),y=t(31194),_=t(54594),I=t(75271),E=t(55912),S=t(48991),A=!0;s.default=(0,p.K)(()=>{let e=(0,_.useTranslations)(),s=(0,y.useRouter)(),{logIn:t,error:p,isLoggingIn:w,loginRejected:N,appleSignUpError:A,appleAuthIsLoading:P,clearAppleSignUpError:k,googleSignUpError:C,googleAuthIsLoading:L,clearGoogleSignUpError:U,initializing:z,clearLoginError:G}=(0,h.a)(),T=(0,j.Nq)({redirect_uri:`${window.location.origin}/provider-auth?src=log-in`,ux_mode:"redirect",flow:"auth-code"}),{register:D,handleSubmit:J,reset:R,formState:{errors:X}}=(0,E.cI)({defaultValues:{email:"",password:""},resolver:(0,x.X)(f.gQ)});(0,I.useEffect)(()=>{let e=()=>{G()};return s.events.on("routeChangeStart",e),()=>{s.events.off("routeChangeStart",e)}},[G,s]),(0,I.useEffect)(()=>{R({email:"",password:""})},[N,R]);let H=J(e=>{t(e.email,e.password)}),$=(0,S.EQ)({googleSignUpError:C,appleSignUpError:A,isLoading:L||P||z,loginRejected:N}).with({loginRejected:S.P.string,googleSignUpError:S.P.nullish,appleSignUpError:S.P.nullish,isLoading:!1},e=>(0,i.jsx)(c.K,{status:e.loginRejected})).with({googleSignUpError:S.P.string,isLoading:!1},s=>{let t={body:s.googleSignUpError,button:{action:U,actionName:"Got it! (back from log in error screen)",title:e("Auth.gotIt")}};return(0,i.jsx)(o.G,{content:t})}).with({appleSignUpError:S.P.string,isLoading:!1},s=>{let t={body:s.appleSignUpError,button:{action:k,actionName:"Got it! (back from log in error screen)",title:e("Auth.gotIt")}};return(0,i.jsx)(o.G,{content:t})}).otherwise(()=>(0,i.jsxs)("div",{className:"mx-2 max-w-lg rounded-lg bg-white p-8 sm:mx-auto sm:w-full",children:[(0,i.jsx)("div",{className:"pb-1",children:(0,i.jsx)("h1",{className:"text-2xl font-medium",children:e("Common.logIn")})}),(0,i.jsxs)("div",{className:"flex items-center gap-1 text-sm",children:[e("Auth.noAccount"),(0,i.jsx)(v(),{className:"underline",href:"/sign-up",children:e("Auth.signUpHere")})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 pb-3 pt-8",children:[(0,i.jsx)(r.z,{variant:"inverse",leadingIcon:d._,actionName:"Sign in with Google",onClick:T,className:"bg-white",size:"sm",children:e("Auth.signInWithGoogle")}),(0,i.jsx)(l.X,{actionType:"log-in",className:"bg-white"})]}),(0,i.jsxs)("div",{className:"relative h-14",children:[(0,i.jsx)("div",{className:"absolute left-0 top-1/2 h-px w-full bg-tan-700/20"}),(0,i.jsx)("div",{className:"absolute left-0 top-0 flex size-full items-center justify-center",children:(0,i.jsx)("span",{className:"bg-white px-3 text-center",children:"or"})})]}),(0,i.jsxs)("form",{id:"log-in-form",className:"w-full",onSubmit:e=>{e.preventDefault(),H(e)},children:[(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,i.jsxs)("div",{className:"flex-col items-stretch",children:[(0,i.jsx)(n.II,{id:"email",...D("email"),type:"email",label:e("Auth.forms.email"),autoComplete:n.L$.Email,variant:"border"}),(0,i.jsx)(a.J,{error:X.email?.message})]}),(0,i.jsxs)("div",{className:"flex-col items-stretch",children:[(0,i.jsx)(n.II,{id:"password",...D("password"),type:"password",label:e("Auth.forms.password"),autoComplete:n.L$.CurrentPassword,variant:"border"}),(0,i.jsx)(a.J,{error:X.password?.message})]}),(0,i.jsx)("div",{className:"flex justify-end pr-2",children:(0,i.jsx)(v(),{className:"text-sm underline",href:"/reset-password",children:e("Auth.passwordReset.forgotPassword")})})]}),(0,i.jsx)(r.z,{type:"submit",isLoading:w,loadingText:e("Auth.loggingIn"),actionName:"Log in",size:"sm",children:e("Common.logIn")}),!!p&&(0,i.jsx)("div",{"data-testid":"authError",children:(0,i.jsx)(a.J,{error:p})})]}),(0,i.jsxs)("div",{className:"flex flex-wrap justify-center gap-1 pt-4 align-baseline text-sm",children:["By continuing, I agree to Hume AI's"," ",(0,i.jsx)(v(),{className:"underline",target:"_blank",href:"https://beta.hume.ai/policies/terms-of-use",children:"Terms of Use"})," ","and"," ",(0,i.jsx)(v(),{className:"underline",target:"_blank",href:"https://beta.hume.ai/policies/privacy-policy",children:"Privacy Policy"})]})]})]}));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(b(),{children:[(0,i.jsx)("title",{children:(0,g.JL)`Log in`}),(0,i.jsx)("meta",{name:"description",content:"Sign in or create an account with Hume AI. Enter your email and password. Access the leading developer platform for expressive communication."})]}),(0,i.jsx)(m.h,{children:(0,i.jsx)(r.z,{actionName:"try public demo",href:"/",size:"sm",children:"Try it out"})}),(0,i.jsx)(u.g,{children:$})]})})}},function(e){e.O(0,[390,705,57,633,888,774,179],function(){return e(e.s=23379)}),_N_E=e.O()}]);