1import{d as e,dB as a,aB as s,r as o,f as t,dw as l,c as r,s as c,D as i,v as n,bb as u,o as d,_ as g}from"#entry";import{u as h}from"./4ffmHDoL.js";const m={class:"auth-callback-container"},v={class:"auth-content"},p={key:0,class:"auth-state"},f={key:1,class:"auth-state"},w={key:2,class:"auth-state"},y=g(e({__name:"google-auth",props:{redirectTo:{default:"/"},autoRedirect:{type:Boolean,default:!0},timeout:{default:3e4}},setup(e){const g=l(),y=e,{loginWithGoogleRedirect:k}=h();a(),s();const b=o(!0),L=o(!1),_=o(null),P=()=>{setTimeout(()=>{window.close()},1e3)};return t(async()=>{{const a=setTimeout(()=>{b.value&&(_.value="Login processing timeout.",b.value=!1,P())},y.timeout);try{(()=>{const e=new URLSearchParams(window.location.search);return e.has("token")||e.has("error")})()?await(async()=>{try{const e=new URLSearchParams(window.location.search),a=e.get("token"),s=e.get("error");if(s)throw new Error(`Google authorization failed: ${s}`);if(!a)throw new Error("No authorization code received.");const{setAuth:o}=u();o(a),localStorage.setItem("google-auth-callback",a),L.value=!0,b.value=!1,sessionStorage.removeItem("oauth_state"),P()}catch(e){console.error("â Google login callback processing failed:",e),_.value=e.message||"Login processing failed.",b.value=!1,P()}})():await k(g.public.googleAuthCallbackUrl)}catch(e){console.error("â Page processing failed:",e),_.value=e.message||"Page loading failed",b.value=!1,P()}finally{clearTimeout(a)}}}),(e,a)=>(d(),r("div",m,[c("div",v,[n(b)?(d(),r("div",p,[...a[0]||(a[0]=[c("div",{class:"spinner"},null,-1),c("p",null,"Processing Login...",-1)])])):n(_)?(d(),r("div",f,[...a[1]||(a[1]=[c("p",{class:"error-message"},"Authentication Failed",-1)])])):n(L)?(d(),r("div",w,[...a[2]||(a[2]=[c("p",{class:"success-message"},"Login Successful!",-1)])])):i("",!0)])]))}}),[["__scopeId","data-v-60d78354"]]);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.