import{a as e,n as t,t as n}from"./jsx-runtime-CutOxEx1.js";import{l as r}from"./chunk-6CSD65Y2-BjfinoX-.js";var i=e(t(),1),a=n();function o(){let e=r(),[t,n]=(0,i.useState)(`processing`),[o,s]=(0,i.useState)(``);return(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{try{let e=new URL(window.location.href);e.search=``,String(e.pathname||``).startsWith(`/auth-relay`)||(e.pathname=`/auth-relay`),window.history.replaceState({},``,e.toString())}catch{}if(!e)return;n(`error`),s(`该登录中继方式已停用（避免 token 通过 URL 传递）。请返回登录页重新登录。`)}catch(t){if(!e)return;n(`error`),s(String(t?.message||`登录信息无效`))}})(),()=>{e=!1}},[e]),(0,a.jsx)(`div`,{className:`w-full min-h-screen bg-gray-50 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`w-full max-w-sm text-center px-6`,children:t===`processing`?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`mx-auto w-8 h-8 border-2 border-gray-300 border-t-gray-900 rounded-full animate-spin`}),(0,a.jsx)(`div`,{className:`mt-4 text-sm text-gray-600`,children:`正在同步登录状态…`})]}):t===`success`?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`mx-auto w-10 h-10 rounded-full bg-gray-100 border border-gray-300 flex items-center justify-center text-gray-900 text-lg font-bold`,children:`✓`}),(0,a.jsx)(`div`,{className:`mt-3 text-sm font-medium text-gray-900`,children:o})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`mx-auto w-10 h-10 rounded-full bg-rose-50 border border-rose-200 flex items-center justify-center text-rose-600 text-lg font-bold`,children:`!`}),(0,a.jsx)(`div`,{className:`mt-3 text-sm font-medium text-gray-900`,children:o}),(0,a.jsx)(`button`,{type:`button`,onClick:()=>e(`/auth`),className:`mt-5 h-9 px-5 rounded-lg bg-gray-900 text-white text-xs font-medium hover:bg-black transition-colors`,children:`返回登录页`})]})})})}export{o as default};