1import{_ as L}from"./DXdjUAWc.js";import{e as V,u as z,f as F,D as H,g as N,c as a,a as t,h as w,i as r,F as P,s as T,v as R,x as E,y as U,n as _,l as p,d as C,t as b,b as D,w as O,k as y,j as W,o as s}from"./DL3KQIdJ.js";import{u as q}from"./gaBxOxve.js";import{s as G}from"./apawmBvM.js";const $={class:"min-h-screen bg-gray-50 flex items-center justify-center px-4 dark:bg-gray-900"},J={class:"max-w-md w-full"},K={class:"bg-white rounded-xl shadow-sm p-8 dark:bg-gray-800 space-y-4"},Q=["disabled"],X=["disabled"],Y={key:0,class:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"},Z={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ee=["disabled"],te={key:0,class:"w-5 h-5",viewBox:"0 0 24 24"},re={key:1,class:"w-5 h-5 border-2 border-gray-300 border-t-primary-600 rounded-full animate-spin"},ae=["disabled"],se={key:0,class:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor"},le={key:1,class:"w-5 h-5 border-2 border-gray-300 border-t-primary-600 rounded-full animate-spin"},oe={key:1,class:"text-center space-y-4"},ne={class:"text-gray-600 mt-1 dark:text-gray-400"},ie={class:"font-medium text-gray-900 dark:text-gray-100"},de={class:"pt-2 space-y-3"},ge=["disabled"],ue={key:0},ye={key:1},ce={key:2},me={key:2,class:"text-red-500 text-sm text-center mt-4"},xe={class:"text-center mt-4"},he=V({__name:"login",setup(pe){z({title:"Sign In",meta:[{name:"robots",content:"noindex,nofollow"}]});const{user:v,initAuth:B,signInWithOAuth:j,requestMagicLink:k}=q(),c=y("email"),g=y(""),n=y(null),l=y(!1),i=y(null),u=y(0);let d=null;const m=()=>{sessionStorage.removeItem("pendingUrl"),W("/dashboard")},M=async()=>{l.value=!0,i.value=null;try{await k(g.value),c.value="sent",f()}catch(o){console.error("Magic link error:",o),i.value=o.message||"Failed to send magic link. Please try again."}finally{l.value=!1}},A=async()=>{l.value=!0,i.value=null;try{await k(g.value),f()}catch(o){console.error("Resend error:",o),i.value=o.message||"Failed to resend. Please try again."}finally{l.value=!1}},f=()=>{u.value=60,d&&clearInterval(d),d=G(()=>{u.value--,u.value<=0&&d&&(clearInterval(d),d=null)},1e3)},S=()=>{c.value="email",i.value=null},h=async o=>{n.value=o,i.value=null;try{await j(o),m()}catch(e){console.error("OAuth error:",e),i.value=e.message||"Authentication failed. Please try again."}finally{n.value=null}};return F(async()=>{await B(),v.value&&m()}),H(v,o=>{o&&m()}),N(()=>{d&&clearInterval(d)}),(o,e)=>{const I=L;return s(),a("div",$,[t("div",J,[e[17]||(e[17]=w('<div class="text-center mb-8"><div class="w-16 h-16 bg-primary-600 rounded-xl flex items-center justify-center mx-auto mb-4 dark:bg-primary-500"><span class="text-white font-bold text-2xl">S</span></div><h1 class="text-3xl font-bold text-gray-900 mb-2 dark:text-gray-100"> Sign In </h1><p class="text-gray-600 dark:text-gray-400"> Choose your preferred sign-in method </p></div>',1)),t("div",K,[r(c)==="email"?(s(),a(P,{key:0},[t("form",{onSubmit:T(M,["prevent"]),class:"space-y-4"},[t("div",null,[e[3]||(e[3]=t("label",{for:"email",class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Email address",-1)),R(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=x=>U(g)?g.value=x:null),type:"email",required:"",placeholder:"[email protected]",disabled:r(l),class:"w-full px-4 py-3 border border-gray-300 rounded-lg text-gray-900 placeholder-gray-400 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 disabled:opacity-50 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100 dark:placeholder-gray-400"},null,8,Q),[[E,r(g)]])]),t("button",{type:"submit",disabled:r(l)||r(n)!==null,class:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition-all disabled:opacity-50 disabled:cursor-not-allowed dark:bg-primary-500 dark:hover:bg-primary-600"},[r(l)?(s(),a("div",Y)):(s(),a("svg",Z,[...e[4]||(e[4]=[t("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"},null,-1),t("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"},null,-1)])])),e[5]||(e[5]=t("span",null,"Send magic link ->",-1))],8,X),e[6]||(e[6]=t("p",{class:"text-sm text-gray-500 text-center dark:text-gray-400"},"We'll send you a secure sign-in link to your email",-1))],32),e[11]||(e[11]=w('<div class="relative"><div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-200 dark:border-gray-600"></div></div><div class="relative flex justify-center text-sm"><span class="px-4 bg-white text-gray-500 dark:bg-gray-800 dark:text-gray-400">or</span></div></div>',1)),t("button",{type:"button",disabled:r(n)!==null||r(l),class:_(["w-full flex items-center justify-center gap-3 px-4 py-3 border border-gray-300 rounded-lg font-medium transition-all",r(n)==="google"?"bg-gray-100 cursor-wait dark:bg-gray-700":"bg-white hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700"]),onClick:e[1]||(e[1]=x=>h("google"))},[r(n)!=="google"?(s(),a("svg",te,[...e[7]||(e[7]=[t("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"},null,-1),t("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"},null,-1),t("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"},null,-1),t("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"},null,-1)])])):(s(),a("div",re)),e[8]||(e[8]=t("span",{class:"text-gray-700 dark:text-gray-200"},"Continue with Google",-1))],10,ee),t("button",{type:"button",disabled:r(n)!==null||r(l),class:_(["w-full flex items-center justify-center gap-3 px-4 py-3 border border-gray-300 rounded-lg font-medium transition-all",r(n)==="github"?"bg-gray-100 cursor-wait dark:bg-gray-700":"bg-white hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700"]),onClick:e[2]||(e[2]=x=>h("github"))},[r(n)!=="github"?(s(),a("svg",se,[...e[9]||(e[9]=[t("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"},null,-1)])])):(s(),a("div",le)),e[10]||(e[10]=t("span",{class:"text-gray-700 dark:text-gray-200"},"Continue with GitHub",-1))],10,ae)],64)):p("",!0),r(c)==="sent"?(s(),a("div",oe,[e[14]||(e[14]=t("div",{class:"w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center mx-auto dark:bg-primary-900/30"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-8 h-8 text-primary-600 dark:text-primary-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),t("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})])],-1)),t("div",null,[e[13]||(e[13]=t("h2",{class:"text-xl font-semibold text-gray-900 dark:text-gray-100"},"Check your email",-1)),t("p",ne,[e[12]||(e[12]=C(" We sent a sign-in link to ",-1)),t("span",ie,b(r(g)),1)])]),e[15]||(e[15]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," Click the link in the email to sign in. The link expires in 5 minutes. ",-1)),t("div",de,[t("button",{type:"button",disabled:r(u)>0||r(l),class:"w-full px-4 py-3 border border-gray-300 rounded-lg font-medium text-gray-700 hover:bg-gray-50 transition-all disabled:opacity-50 disabled:cursor-not-allowed dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700",onClick:A},[r(l)?(s(),a("span",ue,"Sending...")):r(u)>0?(s(),a("span",ye,"Resend in "+b(r(u))+"s",1)):(s(),a("span",ce,"Resend email"))],8,ge),t("button",{type:"button",class:"w-full text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:S}," Use a different email ")])])):p("",!0),r(i)?(s(),a("p",me,b(r(i)),1)):p("",!0)]),e[18]||(e[18]=t("p",{class:"text-center text-sm text-gray-500 mt-6 dark:text-gray-400"}," By signing in, you agree to our Terms of Service and Privacy Policy. ",-1)),t("div",xe,[D(I,{to:"/",class:"inline-flex items-center gap-2 text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors"},{default:O(()=>[...e[16]||(e[16]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"m15 18-6-6 6-6"})],-1),C(" Back to Home ",-1)])]),_:1})])])])}}});
1export{he 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.