1import{a1 as k,P as E,j as F,i as I,l as U,o as i,c as d,a as t,s as h,x as y,u as a,t as B,b as $,w as j,_ as q,q as M,a4 as V,B as x,$ as w,a5 as D,L as H,M as P,z as S}from"./BcOX2qyg.js";import{_ as T}from"./BBAu5uNR.js";const z={class:"w-full md:min-h-[600px] flex flex-col justify-center"},L=["disabled"],R={class:"flex justify-between"},N={key:0,class:"text-red-500 text-sm"},G={__name:"form-login",emits:["toggleForm"],setup(b,{emit:u}){const n=E(),o=F(),p=I(),m=u,l=V({email:"",password:""}),r=x(!1),_=x(!1),v=U(()=>o.query.checkout_url||null);function g(s){const{value:e}=s.target,c=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;e.match(c)?_.value=!0:_.value=!1}const A=async()=>{if(n?.userIsLoggedIn){const{data:s}=await w("/api/auth/checkout",{method:"post",body:{email:n.user.email,checkoutUrl:v.value}},"$6EEplWBKHt");window.location=s.value.checkoutUrl}else window.location=v.value};async function C(){const{data:s}=await w("/api/auth/login",{method:"post",body:{...l}},"$9Dn74C0MjG");if(s.value.error)r.value=s.value.error;else{n.setToken(s.value.token);const{data:e}=await w("/api/auth/user",{method:"post",body:{token:s.value.token}},"$vMfyV3zGhl");if(e.value.error)r.value=e.value.error;else if(n.setUser(e.value.user),D("dl_login"),v.value)A();else if(o.query.wishlistHandle)p.push(`/account/wishlist?wishlistHandle=${o.query.wishlistHandle}`);else if(o.query.redirect){const c=decodeURIComponent(o.query.redirect);p.push(c)}else p.push("/account")}}return(s,e)=>{const c=q;return i(),d("div",z,[t("form",{onSubmit:M(C,["prevent"])},[e[5]||(e[5]=t("div",{class:"text-xl"},"Sign In",-1)),e[6]||(e[6]=t("label",{for:"email",class:"sr-only"},"Email Address",-1)),h(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=f=>a(l).email=f),type:"email",autocomplete:"email",placeholder:"Email Address",onKeyup:g,onBlur:g},null,544),[[y,a(l).email]]),e[7]||(e[7]=t("label",{for:"current-password",class:"sr-only"},"Password",-1)),h(t("input",{id:"current-password","onUpdate:modelValue":e[1]||(e[1]=f=>a(l).password=f),placeholder:"Password",type:"password",autocomplete:"current-password"},null,512),[[y,a(l).password]]),t("button",{disabled:!a(_)},"Sign In",8,L),t("div",R,[a(r)?(i(),d("div",N,B(a(r)),1)):(i(),d("div",{key:1,class:"animate-underline show-underline text-sm cursor-pointer",onClick:e[2]||(e[2]=f=>m("toggleForm"))},[...e[3]||(e[3]=[t("div",null,[t("span",null,"Forgot your password?")],-1)])])),t("div",null,[$(c,{class:"animate-underline show-underline text-sm cursor-pointer",to:"/account/create-account"},{default:j(()=>[...e[4]||(e[4]=[t("span",null,"Create an Account",-1)])]),_:1})])])],32)])}}},K=k(G,[["__scopeId","data-v-448bc1ba"]]),Z={class:"w-full min-h-screen-w-header-footer md:flex justify-center items-center pt-8 md:pt-0 max-w-lg mx-auto"},W={class:"w-full flex flex-col md:flex-row gap-24 xl:gap-20 justify-around px-4"},J={key:1,class:"w-full flex flex-col gap-4"},O={__name:"login",setup(b){const u=x(!1),{$setPageMetadata:n}=H();function o(){u.value=!u.value}return P(n({seo:{title:"Login"}})),(p,m)=>{const l=K,r=T;return i(),d("div",Z,[t("div",W,[a(u)?(i(),d("div",J,[$(r,{onToggleForm:o}),t("div",null,[t("div",{class:"text-xs show-underline animate-underline cursor-pointer",onClick:o},[...m[0]||(m[0]=[t("span",null,"Cancel",-1)])])])])):(i(),S(l,{key:0,onToggleForm:o}))])])}}},Y=k(O,[["__scopeId","data-v-9cc415fa"]]);export{Y 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.