const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B-EDPu3R.js","assets/vendor-query-9i1Av1pr.js","assets/vendor-react-Br0ZiotI.js","assets/vendor-dayjs-BcsA502E.js","assets/vendor-i18n-C54Hc0CQ.js","assets/vendor-antd-core-CbYNMZQB.js","assets/vendor-sentry-Cx26FE6p.js","assets/index-B6o0dbgT.css"])))=>i.map(i=>d[i]);
import{_ as h}from"./vendor-query-9i1Av1pr.js";import{y as g,w as f,q as n,n as e}from"./vendor-react-Br0ZiotI.js";import{aA as j,b6 as _,a3 as S,bs as b,ab as v,H as c,I as m,bz as i,bY as u}from"./index-B-EDPu3R.js";import"./vendor-dayjs-BcsA502E.js";import{S as P}from"./skeleton-DFMLqn_S.js";import{c as N}from"./MarketingShell-byMgDd8J.js";import{u as w}from"./vendor-i18n-C54Hc0CQ.js";import"./vendor-antd-core-CbYNMZQB.js";import"./vendor-sentry-Cx26FE6p.js";import"./zap-Ca_NrEyM.js";import"./globe-SYiMVozm.js";import"./shield-check-BRHQZ8CY.js";import"./users-sM9inbI_.js";import"./file-text-s7xBL7vU.js";import"./SiteFooter-CJ3BLn-3.js";import"./mail-_A6AzEM-.js";import"./building-2-pC_rkZnQ.js";const R=n.lazy(()=>h(()=>import("./index-B-EDPu3R.js").then(r=>r.u),__vite__mapDeps([0,1,2,3,4,5,6,7])));function y(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 F(){const{t:r}=w(),[t]=g(),l=f(),a=t.get("redirect"),s=y(a),[o,d]=n.useState(!0);n.useEffect(()=>{u("login_page_viewed",{hasRedirect:s!==null,rawRedirectBlocked:a!==null&&s===null})},[a,s]);const p=()=>{s?(u("login_redirect_followed",{target:s}),l(s,{replace:!0})):l("/",{replace:!0})},x=()=>{d(!1),l("/",{replace:!0})};return e.jsxs(N,{active:null,containerSize:"base",children:[e.jsxs(j,{children:[e.jsx("title",{children:r("loginPage.meta.title","Вход — Avalog")}),e.jsx("meta",{name:"robots",content:"noindex,follow"})]}),e.jsx(_,{py:"lg",children:e.jsx(S,{size:"base",children:e.jsxs(b,{gap:6,align:"center",className:"max-w-md mx-auto text-center",children:[e.jsx(v,{size:"lg",children:r("loginPage.heading","Вход в Avalog")}),a&&!s?e.jsx(c,{children:e.jsx(m,{className:"py-4",children:e.jsx(i,{className:"text-text-muted text-sm",children:"Параметр redirect был отклонён по соображениям безопасности. После входа вы попадёте на главную."})})}):s?e.jsx(c,{children:e.jsx(m,{className:"py-4",children:e.jsx(i,{className:"text-text-muted text-sm",children:"После входа мы перенаправим вас на запрошенную страницу."})})}):null,e.jsx(n.Suspense,{fallback:e.jsx(P,{className:"h-64 w-full"}),children:e.jsx(R,{isOpen:o,onClose:x,onSuccess:p})}),o?null:e.jsx(i,{className:"text-sm text-text-muted",children:"Окно входа закрыто. Обновите страницу для повтора."})]})})})]})}export{F as default,y as safeRedirectTarget};