PageSourceSearch

https://inscricao.unisanta.br/assets/js/LoginView-DnPexlkR.js

js unisanta.br collected 2026-09-24 20:12:02 UTC 7,547 bytes, 1 lines download raw bytes

1import{r as s,j as t}from"./react-vendor-RAgTqeYh.js";import{F as x}from"./FlutterInput-CdIPkcBL.js";import{u as O,s as R}from"./index-Bc5otjpZ.js";import"./vendor-DLg6GVPO.js";import{i as z}from"./IpapiService-B5BRnzEO.js";import{d as q}from"./router-vendor-DjI2G_af.js";import{u as B}from"./UseScrollToTopUtil-DrfQDtk0.js";import{B as p}from"./ButtonLazaro-_cQKRLcQ.js";function D(){const[e]=q(),d=s.useMemo(()=>({explanationMessage:e.get("explan")?.trim()}),[e]),[i,N]=s.useState(""),[l,k]=s.useState(""),[m,C]=s.useState(!1),[P,n]=s.useState(null),[S,f]=s.useState(!1),[E,u]=s.useState(0),[o,F]=s.useState(""),g=s.useRef(0),a=s.useRef(0),L=O(),{login:h,isLoading:M,resetPassword:b}=L,w=s.useCallback(r=>/^\d{3}\.\d{3}\.\d{3}-\d{2}$/.test(r.trim())?r.replace(/\D/g,""):r.trim(),[]),y=s.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=0),u(0)},[]),j=s.useCallback(()=>{y(),u(20),a.current=window.setInterval(()=>{u(r=>r<=1?(clearInterval(a.current),a.current=0,0):r-1)},1e3)},[y]),T=s.useCallback(()=>{f(!1),n(null)},[]);s.useEffect(()=>()=>{a.current&&clearInterval(a.current)},[]);const c=s.useCallback(r=>r.trim().toLowerCase().includes("@unisanta.br"),[]),A=s.useCallback(async r=>{if(r.preventDefault(),n(null),!c(o))try{await b(o,(await z.buscarIp()).ip),j()}catch{n("Não foi possível enviar o e-mail. Tente novamente.")}},[o,b,j,c]),I=s.useCallback(async()=>{if(i.trim().length===0||l.length===0){n("Preencha usuário e senha válidos");return}n(null);const r=w(i);h(r,l,m).then(()=>{g.current=0}).catch(v=>{g.current+=1,n(v.message),R.recordEvent("multiple_failed_logins",{attempts:g.current,username:i.substring(0,3)+"***"})})},[i,l,m,h,w]),U=async r=>{r.preventDefault(),await I()},_=s.useMemo(()=>c(o),[o,c]);return{tryAgainTimer:E,username:i,setUsername:N,password:l,setPassword:k,keepLogin:m,setKeepLogin:C,loading:M,error:P,isForgotPasswordModalOpen:S,setIsForgotPasswordModalOpen:f,email:o,setEmail:F,setError:n,handleForgotPassword:A,handleSubmit:U,closeForgotPasswordModal:T,queryParams:d,isRecoveryEmailUnisanta:_}}const K="/UNISANTA_logo-536.webp 536w, /UNISANTA_logo-1072.webp 1072w";function V({size:e=16}){return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[t.jsx("path",{d:"M18 6 6 18"}),t.jsx("path",{d:"m6 6 12 12"})]})}const G=()=>{const e=D();return B(),t.jsxs("main",{className:"flex h-screen w-full overflow-hidden","data-page":"login",children:[t.jsx("div",{className:"login-panel-in from-primary to-secondary relative hidden flex-col items-center justify-center bg-gradient-to-br p-12 lg:flex lg:w-1/2",children:t.jsx("div",{className:"relative z-10 text-center",children:t.jsx("img",{src:"/UNISANTA_logo-1072.webp",srcSet:K,sizes:"536px",alt:"UNISANTA Logo",width:536,height:128,fetchPriority:"high",decoding:"async",className:"mx-auto mb-8 h-32 w-auto max-w-full object-contain [aspect-ratio:536/128]"})})}),t.jsx("div",{className:"bg-background-primary flex w-full flex-col items-center justify-center p-8 lg:w-1/2 lg:p-12",children:t.jsxs("div",{className:"w-full max-w-md",children:[t.jsx("h2",{className:"text-x-large text-text mb-2 font-bold",children:"Faça seu login"}),t.jsx("p",{className:"text-text/70 mb-8 text-base",children:"Entre com suas credenciais de acesso"}),t.jsxs("form",{className:"login-form-in space-y-6",onSubmit:e.handleSubmit,children:[t.jsx(x,{label:"E-mail ou CPF",id:"username",value:e.username,valueChanged:e.setUsername}),t.jsx(x,{label:"Senha",type:"password",id:"password",value:e.password,valueChanged:e.setPassword,autocomplete:"current-password"}),t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsxs("label",{htmlFor:"remember-me",className:"text-text flex cursor-pointer select-none items-center gap-2",children:[t.jsx("input",{type:"checkbox",name:"continuarConectado",id:"remember-me",checked:e.keepLogin,onChange:()=>e.setKeepLogin(!e.keepLogin),className:"border-stroke bg-background-primary text-primary checked:border-primary checked:bg-primary focus:border-primary h-4 w-4 cursor-pointer rounded border-2 transition-all duration-200 focus:ring-0"}),"Lembrar-me"]}),t.jsx(p,{style:"light",className:"login-forgot-password-link",onClick:()=>{e.setIsForgotPasswordModalOpen(!0),e.setError(null)},children:"Esqueci minha senha"})]}),t.jsx(p,{isLoading:e.loading,typeButton:"submit",shineEffect:!0,children:"Entrar"}),e.error&&!e.isForgotPasswordModalOpen&&t.jsx("div",{className:"field-status-in flex items-center justify-center rounded-lg bg-red-100 p-4 text-sm text-red-700",children:e.error}),e.queryParams.explanationMessage&&t.jsx("div",{className:"field-status-in flex items-center justify-center rounded-lg bg-green-100 p-4 text-sm text-green-700",children:e.queryParams.explanationMessage})]})]})}),e.isForgotPasswordModalOpen&&t.jsx("div",{className:"modal-fade-in fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:e.closeForgotPasswordModal,children:t.jsxs("div",{className:"modal-scale-in bg-background-primary shadow-strong relative w-full max-w-lg rounded-2xl px-4 py-6 sm:px-8 sm:py-8",onClick:d=>d.stopPropagation(),children:[t.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[t.jsx("h3",{className:"text-x-large text-text pr-12 font-bold",children:"Recuperar Senha"}),t.jsx("button",{type:"button",onClick:e.closeForgotPasswordModal,className:"bg-background-light text-text/60 hover:bg-primary/10 hover:text-primary absolute right-4 top-4 flex !h-8 !min-h-8 !w-8 items-center justify-center !rounded-full !p-0 transition-colors duration-200 hover:rotate-90","aria-label":"Fechar modal",children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"mb-0 sm:mb-6",children:[t.jsx("p",{className:"text-text/70 mb-6 text-base",children:"Digite seu e-mail cadastrado e enviaremos um link para redefinir sua senha. Caso não receba o email, tente novamente após 20 segundos."}),t.jsxs("form",{onSubmit:e.handleForgotPassword,className:"space-y-6",children:[t.jsx(x,{label:"E-mail",id:"recovery-email",value:e.email,valueChanged:e.setEmail,required:!0}),e.isRecoveryEmailUnisanta&&t.jsx("div",{className:"field-status-in flex items-center justify-center rounded-lg bg-amber-50 p-4 text-center text-sm text-amber-900",children:"Para contas com e-mail @unisanta.br, solicite a redefinição de senha ao setor de TI."}),t.jsxs("div",{className:e.isRecoveryEmailUnisanta?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:[t.jsx("button",{type:"button",onClick:e.closeForgotPasswordModal,className:"border-border text-text/70 hover:bg-background-light hover:text-text flex w-full min-w-0 items-center justify-center gap-2 rounded-xl border-2 px-4 py-4 text-base font-semibold transition-all duration-300",children:"Cancelar"}),!e.isRecoveryEmailUnisanta&&t.jsx(p,{disabled:e.tryAgainTimer!=0,typeButton:"submit",shineEffect:!0,className:"min-w-0",children:"Enviar"})]}),e.tryAgainTimer>0&&t.jsxs("div",{className:"forgot-password-success-feedback field-status-in flex items-center justify-center rounded-lg bg-green-100 p-4 text-center text-sm text-green-800",children:["E-mail enviado! Tentar novamente em ",e.tryAgainTimer,"s"]}),e.error&&t.jsx("div",{className:"field-status-in flex items-center justify-center rounded-lg bg-red-100 p-4 text-sm text-red-700",children:e.error})]})]})]})})]})},ee=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));
1export{G as L,ee as a,D as u};

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.