1import{_ as V}from"./BvcWBDfj.js";import{_ as B}from"./DeJPY2No.js";import{d as S,ab as T,aj as q,r as m,ao as D,B as x,D as t,ap as I,G as n,ah as u,ae as o,ad as f,aq as k,ar as C,as as h,ac as O,ag as W,at as $,ai as j,k as A,C as c,x as G}from"#entry";import"./4C5XkTXZ.js";import"./DlAUqK2U.js";const M={class:"p-5"},P={key:0,class:"my-8 py-4 px-3 bg-blue bg-opacity-90 text-dark"},R={class:""},U={class:""},E={class:"text-sm text-orange"},H={type:"submit",class:"btn w-full text-xl flex justify-center"},L={key:1},z={class:"mt-5 flex flex-col gap-3"},F={class:"!text-dark link text-center"},te=S({__name:"index",setup(J){T({title:"login",meta:[{name:"login",content:"login for easy access to downloads and serial numbers"}]}),q().query.to?.toString();const a=m(""),l=m(""),g=D(),r=m(!1),w=m(!1),d=m("");async function N(){r.value=!0;let{data:i,error:e}=await g.auth.signInWithPassword({email:a.value,password:l.value});if(!i.user){const{data:s,error:v}=await g.functions.invoke("migrate-user",{body:{email:a.value,password:l.value}});if(v&&!i.user){r.value=!1;return}if(s&&s.error){console.log("me",s.error),d.value=s.error,r.value=!1;return}if(s&&s.guest){console.log("guest"),r.value=!1,w.value=!0;return}({data:i,error:e}=await g.auth.signInWithPassword({email:a.value,password:l.value}))}e?d.value=e.message:G("/confirm"),r.value=!1}async function b(i){d.value="";const{error:e}=await g.auth.signInWithOAuth({provider:i,options:{redirectTo:window.location.origin+"/confirm"}});e&&(d.value=e.message)}return(i,e)=>{const s=V,v=B,y=A("font-awesome-icon"),_=j;return c(),x("div",M,[e[14]||(e[14]=t("h2",{class:"mb-5"},"login to your account",-1)),u(w)?(c(),x("div",P,[e[5]||(e[5]=o(" it looks like you made a guest purchase with that email, but haven't created an account yet. to access your purchases, you'll first need to ",-1)),n(s,{class:"text-orange font-bold hover:underline mx-0 px-0",to:{path:"register/email",query:{email:u(a)}}},{default:f(()=>[...e[4]||(e[4]=[o(" sign up",-1)])]),_:1},8,["to"]),e[6]||(e[6]=o(". ",-1))])):I("",!0),t("form",{class:"font-2 flex flex-col gap-3",onSubmit:$(N,["prevent"])},[t("div",R,[e[7]||(e[7]=t("label",{for:"email",class:"block text-lg pb-1"},[o(" email: "),t("span",{class:"text-red-500"},"*")],-1)),k(t("input",{id:"email",class:"w-full",type:"text","onUpdate:modelValue":e[0]||(e[0]=p=>h(a)?a.value=p:null),placeholder:"enter your email address"},null,512),[[C,u(a)]])]),t("div",U,[e[8]||(e[8]=t("label",{for:"email",class:"block text-lg pb-1"},[o(" password: "),t("span",{class:"text-red-500"},"*")],-1)),k(t("input",{class:"w-full",type:"password","onUpdate:modelValue":e[1]||(e[1]=p=>h(l)?l.value=p:null),placeholder:"enter your password"},null,512),[[C,u(l)]])]),t("p",E,O(u(d)),1),t("button",H,[u(r)?(c(),W(v,{key:0,class:"text-white h-6"})):(c(),x("span",L,"log in"))])],32),n(s,{to:"/login/forgot",class:"!text-green font-2 link text-center block w-full mt-3"},{default:f(()=>[...e[9]||(e[9]=[o("forgot password? ",-1)])]),_:1}),e[15]||(e[15]=t("hr",{class:"!mt-2"},null,-1)),t("div",z,[t("button",{class:"btn w-full !bg-green",onClick:e[2]||(e[2]=p=>b("google"))},[n(_,null,{default:f(()=>[n(y,{icon:"fa-brands fa-google"})]),_:1}),e[10]||(e[10]=t("span",{class:"ms-3"},"log in with google",-1))]),t("button",{class:"btn w-full !bg-green",onClick:e[3]||(e[3]=p=>b("discord"))},[t("div",null,[n(_,null,{default:f(()=>[n(y,{icon:"fa-brands fa-discord"})]),_:1}),e[11]||(e[11]=t("span",{class:"ms-3"},"log in with discord",-1))])])]),e[16]||(e[16]=t("hr",null,null,-1)),t("p",F,[e[13]||(e[13]=o("dont have an account yet? ",-1)),n(s,{to:"/register"},{default:f(()=>[...e[12]||(e[12]=[o("register",-1)])]),_:1})])])}}});export{te 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.