const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CRANE7wv.js","assets/vendor-query-CutdBoCI.js","assets/vendor-react-DfNOgXDS.js","assets/vendor-dayjs-BrZ9gQN4.js","assets/vendor-antd-core-R0BvUBa1.js","assets/vendor-i18n-BWzZRYJm.js","assets/vendor-sentry-BlaL7Aw0.js","assets/index-X5xXe9_K.css"])))=>i.map(i=>d[i]);
import{_ as p}from"./vendor-query-CutdBoCI.js";import{y as h,w as f,q as l,n as e}from"./vendor-react-DfNOgXDS.js";import{al as g,bb as j,P as _,bw as S,Z as v,v as c,w as o,bE as n,c0 as m}from"./index-CRANE7wv.js";import{S as b}from"./skeleton-BLIekBlX.js";import"./vendor-dayjs-BrZ9gQN4.js";import{g as w}from"./MarketingShell-3Ivhn3sU.js";import"./vendor-antd-core-R0BvUBa1.js";import"./vendor-i18n-BWzZRYJm.js";import"./vendor-sentry-BlaL7Aw0.js";import"./zap-DLo9YKtg.js";import"./globe-CZMJX-ig.js";const N=l.lazy(()=>p(()=>import("./index-CRANE7wv.js").then(r=>r.j),__vite__mapDeps([0,1,2,3,4,5,6,7])));function P(r){if(!r)return null;const t=r.trim();return t.length===0||t.length>512||!t.startsWith("/")||t.startsWith("//")||/\b(https?:|javascript:|data:)/i.test(t)?null:t}function I(){const[r]=h(),t=f(),a=r.get("redirect"),s=P(a),[i,u]=l.useState(!0);l.useEffect(()=>{m("login_page_viewed",{hasRedirect:s!==null,rawRedirectBlocked:a!==null&&s===null})},[a,s]);const d=()=>{s?(m("login_redirect_followed",{target:s}),t(s,{replace:!0})):t("/",{replace:!0})},x=()=>{u(!1),t("/",{replace:!0})};return e.jsxs(w,{active:null,containerSize:"base",children:[e.jsxs(g,{children:[e.jsx("title",{children:"Вход — Avalog"}),e.jsx("meta",{name:"robots",content:"noindex,follow"})]}),e.jsx(j,{py:"lg",children:e.jsx(_,{size:"base",children:e.jsxs(S,{gap:6,align:"center",className:"max-w-md mx-auto text-center",children:[e.jsx(v,{size:"lg",children:"Вход в Avalog"}),a&&!s?e.jsx(c,{children:e.jsx(o,{className:"py-4",children:e.jsx(n,{className:"text-text-muted text-sm",children:"Параметр redirect был отклонён по соображениям безопасности. После входа вы попадёте на главную."})})}):s?e.jsx(c,{children:e.jsx(o,{className:"py-4",children:e.jsx(n,{className:"text-text-muted text-sm",children:"После входа мы перенаправим вас на запрошенную страницу."})})}):null,e.jsx(l.Suspense,{fallback:e.jsx(b,{className:"h-64 w-full"}),children:e.jsx(N,{isOpen:i,onClose:x,onSuccess:d})}),i?null:e.jsx(n,{className:"text-sm text-text-muted",children:"Окно входа закрыто. Обновите страницу для повтора."})]})})})]})}export{I as default,P as safeRedirectTarget};