1import{L as E}from"./main-BMg1Vvng.js";import{O as k,a as $}from"./OpenBook-Dv_F3vwz.js";import{_ as S,L as I,c as a,a as d,b as e,d as m,t as g,e as y,w as G,v as W,F as M,r as L,f as b,g as O,h as l,o as n,i as B}from"./index-6P0cCGxP.js";import{s as C}from"./success-9Yq6lwkD.js";import{_ as F}from"./ContinueWithGoogle-DJBT1zoP.js";import{i as R,s as q}from"./login_redirect-D_ygdD15.js";import"./SiteLogo-CJUXy43L.js";const r={initial:"initial",processing:"processing",error:"error",success:"success"},T={components:{ContinueWithGoogle:F,OpenDoor:$,OpenBook:k,Lottie:I},data(){return{googleSSOError:"",validationMessage:"",currentState:r.initial,errors:[],formResponses:{email:null},sentToEmail:null,signInWithGoogleErrorMessage:null,successAnimation:{animationData:C,loop:!1}}},computed:{processing(){return this.currentState===r.processing},success(){return this.currentState===r.success},error(){return this.currentState===r.error},hasErrors(){return!!this.validationMessage}},mounted(){this.$route.query.error&&(this.googleSSOError=this.$route.query.error),q(this.$route.query.redirectFrom)},methods:{loginRedirect(){const i=this.$route.query.redirectFrom;return R(i)?i:void 0},submit(){var i,t;if(this.currentState!==r.processing){if(this.googleSSOError="",this.errors=[],this.validationMessage=(i=this.$refs.emailInput)!=null&&i.checkValidity()?"":"Enter a valid email address.",this.hasErrors){(t=this.$refs.emailInput)==null||t.focus(),this.currentState=r.initial;return}this.currentState=r.processing,this.$store.dispatch("user/signIn",{email:this.formResponses.email,redirect:this.loginRedirect()}).then(c=>{this.$trackEvent({category:"User",action:"Sign in",label:"Requested"}),this.currentState=r.success,this.sentToEmail=c.email,this.$nextTick(()=>{var h;return(h=this.$refs.successHeading)==null?void 0:h.focus()})}).catch(c=>{c.response&&c.response.data&&c.response.data.errors&&(this.errors=Object.values(c.response.data.errors).flat()),this.currentState=r.error})}},signInWithGoogleSuccess(i){this.currentState!==r.processing&&(this.currentState=r.processing,this.$store.dispatch("user/signInViaGoogle",i).then(()=>{this.$trackEvent({category:"User",action:"Sign in",label:"Via Google"}),this.$trackCustomEvent({event:"ga4_login",method:"Google"}),this.errorStatus=null,this.signInWithGoogleErrorMessage=null,this.$router.push({name:"dashboard"})}).catch(t=>{if(!t.response){this.signInWithGoogleErrorMessage=t.message,this.currentState=r.initial;return}this.currentState=r.initial,t.response.data.pat_status?this.errorStatus=t.response.data.pat_status:t.response.data.message?this.signInWithGoogleErrorMessage=t.response.data.message:this.signInWithGoogleErrorMessage=t.message}))},signInWithGoogleError(i){i.error!=="popup_closed_by_user"&&(this.signInWithGoogleErrorMessage=i.error)},clearErrors(){this.validationMessage="",this.currentState=r.initial,this.errors=[],this.googleSSOError=""}}},V={class:"relative z-20 max-w-xl p-8 mx-auto my-8 text-gray-900 bg-white border border-gray-200 rounded shadow-lg sm:px-24 sm:py-8",style:{"min-height":"325px"}},D={key:0,class:"text-center",role:"status"},N={ref:"successHeading",tabindex:"-1",class:"text-2xl text-gray-600"},j={class:"text-gray-600 text"},A={class:"text-xl font-semibold"},P={key:1},U={class:"mb-4"},z={key:0,role:"alert",class:"mt-2 text-xs text-left text-red-500"},H=["aria-busy"],Q={class:"block"},Z=e("span",{class:"text-gray-600"},"Email",-1),J=["disabled","aria-invalid","aria-describedby"],K={key:0,id:"sign-in-errors",role:"alert",class:"mt-2 text-sm text-red-700"},X={key:1,id:"sign-in-errors",role:"alert",class:"mt-2 text-sm text-red-700"},Y={key:2,id:"sign-in-errors",role:"alert",class:"mt-2 text-sm text-red-700"},ee={class:"flex items-center justify-center mt-10"},te={class:"absolute hidden md:block",style:{bottom:"-50px",left:"-125px"}},se={class:"absolute hidden md:block",style:{bottom:"-100px",right:"-85px"}};function oe(i,t,c,h,s,o){const p=l("Lottie"),_=l("ContinueWithGoogle"),f=l("BaseButton"),x=l("OpenDoor"),v=l("OpenBook");return n(),a("div",V,[o.success?(n(),a("div",D,[d(p,{options:s.successAnimation,class:"w-1/3 h-1/3"},null,8,["options"]),e("h2",N," Check your inbox ",512),e("p",j,[m(" Weâve emailed a link to "),e("span",A,g(s.sentToEmail),1)])])):(n(),a("div",P,[e
1("div",U,[d(_,{onSuccess:o.signInWithGoogleSuccess,onError:o.signInWithGoogleError},null,8,["onSuccess","onError"]),s.googleSSOError||s.signInWithGoogleErrorMessage?(n(),a("p",z,g(s.googleSSOError||s.signInWithGoogleErrorMessage),1)):y("",!0)]),e("form",{novalidate:"",onSubmit:t[2]||(t[2]=O((...u)=>o.submit&&o.submit(...u),["prevent"])),"aria-busy":o.processing},[e("label",Q,[Z,G(e("input",{ref:"emailInput","onUpdate:modelValue":t[0]||(t[0]=u=>s.formResponses.email=u),name:"email",autocomplete:"email",disabled:o.processing,required:"","aria-invalid":o.hasErrors||s.errors.length>0,"aria-describedby":o.hasErrors||o.error?"sign-in-errors":void 0,class:"w-full mt-1 form-input",type:"email",placeholder:"Email",onInput:t[1]||(t[1]=u=>o.clearErrors())},null,40,J),[[W,s.formResponses.email]])]),o.hasErrors?(n(),a("p",K,g(s.validationMessage),1)):y("",!0),s.errors.length?(n(),a("p",X,[(n(!0),a(M,null,L(s.errors,(u,w)=>(n(),a("span",{key:w},g(u),1))),128))])):o.error?(n(),a("p",Y," Sorry, an error occurred. Please try again. ")):y("",!0),e("div",ee,[d(f,{size:"large",variant:"accent",class:"w-56",loading:o.processing,type:"submit",disabled:o.processing},{default:b(()=>[m(" Send magic link ")]),_:1},8,["loading","disabled"])])],40,H)])),e("div",te,[d(x,{class:"w-48 h-48"})]),e("div",se,[d(v,{class:"w-48 h-48"})])])}const re=S(T,[["render",oe]]),ie={components:{Layout:E,SignIn:re},head(){return{title:"Sign in",meta:[{name:"description",content:"Sign in to Fintest"},{rel:"canonical",href:`https://www.fintest.io${this.$route.fullPath}`},{property:"og:title",content:"Sign in"},{property:"og:site_name",content:"Fintest"},{property:"og:url",content:`https://www.fintest.io${this.$route.fullPath}`},{property:"og:image",content:"https://www.fintest.io_app/img/icons/og-card.png"},{property:"og:type",content:"website"},{property:"og:description",content:"Sign in to Fintest"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:"Sign in"},{name:"twitter:description",content:"Sign in to Fintest"},{name:"twitter:image",content:"https://www.fintest.io_app/img/icons/og-card.png"},{name:"robots",content:"noindex"}]}},data(){return{assessments:265,questions:850,siteName:"Fintest"}}},ne={class:"flex-grow bg-gray-200"},ae={class:"bg-block"},ce={class:"relative w-full max-w-screen-xl p-8 pb-0 mx-auto"},le={class:"text-center"},de=e("h1",{class:"text-5xl font-bold text-gray-700"}," Welcome back ",-1),ge={class:"mb-6 text-base text-gray-600"},ue={class:"absolute w-full overflow-hidden transform -translate-y-1/2"},he={viewBox:"0 0 1440 320",preserveAspectRatio:"none",style:{width:"100%",height:"10rem",display:"block"}},me=e("path",{fill:"#E9F2FB","fill-opacity":"1",d:"M0,96L120,85.3C240,75,480,53,720,48C960,43,1200,53,1320,58.7L1440,64L1440,320L1320,320C1200,320,960,320,720,320C480,320,240,320,120,320L0,320Z"},null,-1),pe=[me],_e={class:"bg-gray-200"},fe={class:"relative flex items-center justify-center w-full max-w-lg px-8 py-8 mx-auto text-center sm:py-24"},xe={class:"w-64"},ye=e("p",{class:"block text-lg font-medium tracking-wide uppercase text-tertiary"}," Tests ",-1),be={class:"text-5xl font-bold leading-tight text-gray-700"},Se={class:"w-64"},ve=e("p",{class:"text-lg font-medium tracking-wide uppercase text-tertiary"}," Questions ",-1),we={class:"text-5xl font-bold leading-tight text-gray-700"};function Ee(i,t,c,h,s,o){const p=l("router-link"),_=l("SignIn",!0),f=l("Layout");return n(),B(f,{class:"w-full h-full",onTheme:t[0]||(t[0]=x=>i.theme=x)},{default:b(()=>[e("div",ne,[e("section",ae,[e("div",ce,[e("div",le,[de,e("p",ge,[m(" Donât have a "+g(s.siteName)+" account? ",1),d(p,{to:{name:"sign-up"},class:"font-bold text-accent"},{default:b(()=>[m(" Sign up ")]),_:1})])]),d(_)])]),e("div",ue,[(n(),a("svg",he,pe))]),e("div",_e,[e("div",fe,[e("div",xe,[ye,e("span",be,g(s.assessments),1)]),e("div",Se,[ve,e("span",we,g(s.questions),1)])])])])]),_:1})}const Oe=S(ie,[["render",Ee]]);export{Oe as default};
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.