1import{aD as _,bh as v,b8 as k,aM as m,aS as x,aE as u,aG as s,b1 as S,aX as f,aH as E,aF as h}from"./CrsoP7RL.js";import{u as D}from"./BZGIxwCj.js";import{u as C}from"./CtGvocwp.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="ab68a7fd-97dc-4f79-b09f-2ae2acfa5018",r._sentryDebugIdIdentifier="sentry-dbid-ab68a7fd-97dc-4f79-b09f-2ae2acfa5018")}catch{}})();const I={class:"flex h-screen items-center justify-center bg-gray-950 text-white"},B={class:"text-center"},P={key:0,class:"space-y-4"},A={key:1,class:"space-y-4"},L={class:"text-gray-400 text-sm"},M={__name:"confirm",setup(r){_({script:[{innerHTML:` 2 window.$crisp=[]; 3 window.CRISP_WEBSITE_ID="30d15fe3-fa17-4d3d-8eb6-f58560094f9f"; 4 (function(){ 5 d=document; 6 s=d.createElement("script"); 7 s.src="https://client.crisp.chat/l.js"; 8 s.async=1; 9 d.getElementsByTagName("head")[0].appendChild(s); 10 })(); 11 `,type:"text/javascript"}]});const a=D(),t=v(),n=k(),{shouldShowOnboardingForm:g,createUserProfile:p}=C(),l=m(!0),i=m(""),w=()=>{t.push("/login")};return x(async()=>{var d;try{console.log("Confirm page loaded with route query:",n.query),console.log("Confirm page loaded with route hash:",n.hash),await new Promise(o=>setTimeout(o,1e3));const{data:e,error:c}=await a.auth.getSession();if(console.log("Session check result:",{sessionData:e,sessionError:c}),c){console.error("Session error:",c),i.value=c.message||"Session verification failed",l.value=!1;return}if(e.session){console.log("User authenticated successfully");try{await p(),console.log("User profile created/verified")}catch(o){console.error("Error creating user profile:",o)}try{const o=await g();console.log("Onboarding needed:",o),o?(console.log("Redirecting to onboarding..."),t.push("/onboarding-form")):(console.log("Redirecting to dashboard..."),t.push("/dashboard"))}catch(o){console.error("Error checking onboarding:",o),console.log("Falling back to dashboard..."),t.push("/dashboard")}}else{if(console.log("No valid session found after OAuth callback"),n.query.access_token||((d=n.hash)==null?void 0:d.includes("access_token"))){console.log("Auth params found, waiting longer for session to be established..."),await new Promise(b=>setTimeout(b,2e3));const{data:y}=await a.auth.getSession();if(y.session){console.log("Session established after retry"),await p(),await g()?t.push("/onboarding-form"):t.push("/dashboard");return}}console.log("Still no session, redirecting to login"),t.push("/login")}}catch(e){console.error("Unexpected error in confirm page:",e),i.value="An unexpected error occurred during authentication",l.value=!1}}),(d,e)=>(h(),u("div",I,[s("div",B,[f(l)?(h(),u("div",P,e[0]||(e[0]=[s("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto"},null,-1),s("p",null,"Logging in...",-1)]))):f(i)?(h(),u("div",A,[e[1]||(e[1]=s("div",{class:"text-red-400"},[s("svg",{class:"w-8 h-8 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.732 15.5c-.77.833.192 2.5 1.732 2.5z"})])],-1)),e[2]||(e[2]=s("p",{class:"text-red-400"},"Authentication failed",-1)),s("p",L,E(f(i)),1),s("button",{onClick:w,class:"mt-4 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded"}," Back to Login ")])):S("",!0)])]))}};export{M as default}; 12//# sourceMappingURL=D0tzS0pf.js.map
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.