PageSourceSearch

https://www.ucalp.edu.ar/miucalp/build/assets/Entry-C1mxUTqg.js

js ucalp.edu.ar collected 2026-10-02 07:53:07 UTC 14,136 bytes, 1 lines download raw bytes

1import{r as g,y as Z,q as ee,W as D,j as e,a as se}from"./app-BZl21zSa.js";import{G as te}from"./GuestLayout-DOELsMMA.js";import{T as G}from"./TextInput-BXWAikdN.js";import{I as A}from"./InputError-JUehfOXp.js";import{P as U}from"./PrimaryButton-BoPiYvtU.js";import{G as re}from"./GoogleLogo-C82tDkKx.js";import"./urlHelper-l-vL0Rcp.js";import"./TopBar-CKlL9BGv.js";import"./index-Be81nlU3.js";import"./Header-BwUD1sHx.js";import"./ApplicationLogo-BYllIY3j.js";function ae(t,{onError:d}={}){g.useEffect(()=>{var i,r;if(!t)return;const o="google-gsi-client",l=()=>{var p,u;(u=(p=window.google)==null?void 0:p.accounts)!=null&&u.id&&(window.google.accounts.id.initialize({client_id:t,use_fedcm_for_prompt:!1,callback:({credential:n})=>{Z.post(route("auth.google.one-tap"),{credential:n},{onError:h=>{d==null||d(h.oneTapError??"Error al autenticar con Google.")}})}}),window.google.accounts.id.prompt())};if(document.getElementById(o)){(r=(i=window.google)==null?void 0:i.accounts)!=null&&r.id?l():document.getElementById(o).addEventListener("load",l,{once:!0});return}const s=document.createElement("script");return s.id=o,s.src="https://accounts.google.com/gsi/client",s.async=!0,s.defer=!0,s.addEventListener("load",l,{once:!0}),document.head.appendChild(s),()=>{var p,u,n,h;(h=(n=(u=(p=window.google)==null?void 0:p.accounts)==null?void 0:u.id)==null?void 0:n.cancel)==null||h.call(n)}},[t])}function ve({carouselImages:t=[],hasSession:d=!1,pendingEmail:o=null}){var _;const l=ee(),s=g.useRef();s.current=l;const[i,r]=g.useState("email"),[p,u]=g.useState(o??""),[n,h]=g.useState(null),[S,L]=g.useState(null),[k,w]=g.useState(null),[W,R]=g.useState(!1),C=g.useRef([]),z=g.useRef(null),O=g.useRef(null),B=g.useRef(null),M=g.useRef(null);ae(l.props.googleClientId,{onError:w});const N=D({email:""}),j=D({code:""}),I=D({}),V=D({}),E=D({password:""}),K=c=>{var y;B.current=c;const a=(((y=O.current)==null?void 0:y.value)??N.data.email).trim().toLowerCase();a!==N.data.email&&N.setData("email",a);const m=a,b=M.current!==null&&M.current===m,f=()=>{const x=B.current;x==="otp"?I.post(route("auth.otp.send"),{preserveScroll:!0,onSuccess:()=>{j.reset(),h(null),R(!1),r("otp"),setTimeout(()=>{var v;return(v=C.current[0])==null?void 0:v.focus()},50)}}):x==="password"?(E.reset(),L(null),r("password")):x==="magic_link"&&V.post(route("auth.magic.send"),{preserveScroll:!0,onSuccess:()=>{var P;const v=(P=s.current.props.flash)==null?void 0:P.magicLinkResult;(v==null?void 0:v.success)!==!1&&r("sent")}})};if(b){f();return}N.transform(x=>({...x,email:a})),N.post(route("auth.identify"),{preserveScroll:!0,onSuccess:()=>{var v;const x=(v=s.current.props.flash)==null?void 0:v.identifyResult;if(x!=null&&x.maskedEmail)u(x.maskedEmail);else if(a.includes("@")){const[P,Y]=a.split("@");u(`${P.slice(0,2)}***@${Y}`)}M.current=m,f()}})},q=c=>{c.preventDefault(),h(null),j.post(route("auth.otp.verify"),{preserveScroll:!0,onError:a=>{var b;const m=(b=s.current.props.flash)==null?void 0:b.otpVerifyResult;h((m==null?void 0:m.message)??a.otpError??"Código incorrecto o expirado."),j.setData("code",""),setTimeout(()=>{var f;return(f=C.current[0])==null?void 0:f.focus()},50)}})},F=c=>{c.preventDefault(),h(null),R(!1),I.post(route("auth.otp.send"),{preserveScroll:!0,onSuccess:()=>R(!0)})},H=c=>{var m;c.preventDefault(),L(null);const a=((m=z.current)==null?void 0:m.value)??E.data.password;E.transform(b=>({...b,password:a})),E.post(route("auth.password"),{preserveScroll:!0,onError:b=>{var y;const f=(y=s.current.props.flash)==null?void 0:y.passwordResult;L((f==null?void 0:f.message)??b.passwordError??"Credenciales incorrectas."),E.reset("password")}})},$=(c,a)=>{var f,y;if(a.length>1){const x=a.replace(/\D/g,"").slice(0,6);j.setData("code",x),(f=C.current[Math.min(x.length,5)])==null||f.focus();return}const m=a.replace(/\D/g,""),b=(j.data.code||"      ").split("");b[c]=m,j.setData("code",b.join("").trimEnd()),m&&c<5&&((y=C.current[c+1])==null||y.focus())},J=(c,a)=>{var m;a.key==="Backspace"&&!j.data.code[c]&&c>0&&((m=C.current[c-1])==null||m.focus())},Q=Array.from({length:6},(c,a)=>j.data.code[a]??""),X=N.processing||I.processing||V.processing;
1return e.jsxs(te,{carouselImages:t,children:[e.jsx(se,{title:"MiUCALP - Ingresá a tu cuenta"}),i==="email"&&e.jsx(oe,{form:N,oneTapError:k,identifying:X,pendingMethod:B,onSubmitWithMethod:K,onEmailChange:()=>{M.current=null},passwordResetResult:((_=l.props.flash)==null?void 0:_.passwordResetResult)??null,inputRef:O}),i==="otp"&&e.jsx(ne,{maskedEmail:p,digits:Q,form:j,otpInputs:C,onDigit:$,onKeyDown:J,onSubmit:q,onResend:F,resending:I.processing,resent:W,onBack:()=>{j.reset(),h(null),R(!1),r("email")},error:n}),i==="sent"&&e.jsx(le,{maskedEmail:p,onBack:()=>r("email")}),i==="password"&&e.jsx(ie,{form:E,onSubmit:H,onBack:()=>r("email"),error:S,maskedEmail:p,inputRef:z})]})}function oe({form:t,oneTapError:d,identifying:o,pendingMethod:l,onSubmitWithMethod:s,onEmailChange:i,passwordResetResult:r,inputRef:p}){const u=n=>o&&l.current===n;return e.jsxs("div",{className:"bg-blue-50 p-6 rounded-xl",children:[e.jsx("h2",{className:"text-md font-semibold text-primario mb-1",children:"Ingresá a MiUCALP"}),e.jsx("p",{className:"text-xs text-gray-500 mb-4",children:"MiUCALP es el sistema de identidad digital de la Universidad Católica de La Plata. Desde acá podés iniciar tu inscripción a la universidad, acceder al campus virtual y gestionar tus trámites académicos e institucionales desde un único lugar."}),(r==null?void 0:r.success)&&e.jsx("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-md text-sm text-green-700",children:r.message}),d&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-sm text-red-600",children:d}),e.jsxs("div",{className:"space-y-3 mb-4",children:[e.jsx(G,{id:"email",type:"text",name:"email",ref:p,value:t.data.email,onChange:n=>{t.setData("email",n.target.value),i()},placeholder:"Email o usuario",className:"block w-full text-sm placeholder:text-gray-500 rounded-md",autoComplete:"username email",isFocused:!0,onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),s("otp"))}}),e.jsx(A,{message:t.errors.email,className:"text-rojo"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium mb-1",children:"¿Cómo querés ingresar?"}),e.jsx(T,{onClick:()=>s("otp"),disabled:o,loading:u("otp"),icon:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),label:"Continuar con código",description:"Te enviamos un código de 6 dígitos"}),e.jsx(T,{onClick:()=>s("password"),disabled:o,loading:u("password"),icon:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),label:"Continuar con contraseña",description:"Ingresá tu contraseña de MiUCALP"}),e.jsx(T,{onClick:()=>s("magic_link"),disabled:o,loading:u("magic_link"),icon:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),label:"Enviar link de acceso",description:"Te enviamos un enlace único por email"}),e.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[e.jsx("div",{className:"flex-1 h-px bg-gray-200"}),e.jsx("span",{className:"text-xs text-gray-400",children:"o ingresá con"}),e.jsx("div",{className:"flex-1 h-px bg-gray-200"})]}),e.jsxs("a",{href:route("oauth.redirect","google"),className:"flex items-center gap-3 w-full border border-gray-300 rounded-lg px-4 py-2.5 text-sm text-gray-700 hover:bg-gray-50 transition bg-white",children:[e.jsx(re,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Continuar con Google"})]})]}),e.jsx("p",{className:"text-xs text-gray-400 text-center mt-4",children:"¿Primera vez? Podés crear tu cuenta con Google o solicitando un código de acceso."})]})}function T({onClick:t,disabled:d,loading:o,icon:l,label:s,description:i}){return e.jsxs("button",{type:"button",onClick:t,disabled:d,className:"flex items-center gap-3 w-full border border-gray-300 rounded-lg px-4 py-2.5 text-sm text-gray-700 hover:bg-white hover:border-primario hover:text-primario transition bg-white disabled:opacity-60 disabled:cursor-not-allowed text-left",children:[e.jsx("span",{className:"flex-shrink-0 text-primario",children:l}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium leading-tight",children:s}),i&&e.jsx("span",{className:"block text-xs text-gray-400 font-normal",children:i})]}),o?e.jsxs("svg",{className:"animate-spin h-4 w-4 text-primario flex-shrink-0",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}):e.jsx("span",{className:"text-gray-400 flex-shrink-0",children:"›"})]})}function ne({maskedEmail:t,digits:d,form:o,otpInputs:l,onDigit:s,onKeyDown:i,onSubmit:r,onResend:p,resending:u,resent:n,onBack:h,error:S}){return e.jsxs("div",{className:"bg-blue-50 p-6 rounded-xl",children:[e.jsx("h2",{className:"text-md font-semibold text-gray-800 mb
1-1",children:"Revisá tu correo"}),e.jsxs("p",{className:"text-sm text-gray-500 mb-1",children:["Enviamos un código de 6 dígitos a ",e.jsx("strong",{children:t}),"."]}),e.jsx("p",{className:"text-xs text-gray-400 mb-5",children:"Expira en 15 minutos."}),S&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-sm text-red-600",children:S}),n&&!S&&e.jsxs("div",{className:"mb-4 text-sm text-green-600",children:["Código reenviado a ",t,"."]}),e.jsxs("form",{onSubmit:r,children:[e.jsx("div",{className:"flex gap-2 justify-center my-4",children:d.map((L,k)=>e.jsx("input",{ref:w=>l.current[k]=w,type:"text",inputMode:"numeric",maxLength:6,value:L,onChange:w=>s(k,w.target.value),onKeyDown:w=>i(k,w),className:"w-11 h-14 text-center text-2xl font-bold border-2 border-gray-300 rounded-lg focus:border-blue-500 focus:ring-1 focus:ring-blue-500 outline-none bg-white"},k))}),e.jsx(U,{type:"submit",className:"w-full bg-azul text-white font-semibold py-2 rounded-md",disabled:o.processing||(o.data.code??"").replace(/\s/g,"").length<6,children:e.jsx("span",{className:"block text-center normal-case w-full text-sm",children:"Verificar código"})})]}),e.jsxs("div",{className:"border-t border-gray-200 mt-5 pt-4 space-y-2",children:[e.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"¿No llegó el código?"}),e.jsx("form",{onSubmit:p,children:e.jsxs("button",{type:"submit",disabled:u,className:"w-full text-left border border-gray-300 rounded-md px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition flex items-center justify-between disabled:opacity-50",children:[e.jsx("span",{children:u?"Reenviando...":"Reenviar código"}),e.jsx("span",{className:"text-gray-400",children:"›"})]})})]}),e.jsx("button",{type:"button",onClick:h,className:"w-full text-center text-xs text-gray-400 hover:text-gray-600 mt-4",children:"← Volver a las opciones de ingreso"})]})}function le({maskedEmail:t,onBack:d}){return e.jsxs("div",{className:"bg-blue-50 p-6 rounded-xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"bg-green-100 rounded-full p-2",children:e.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-md font-semibold text-gray-800",children:"¡Enlace enviado!"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Revisá tu correo ",e.jsx("strong",{children:t})]})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"El enlace expira en 30 minutos y solo puede usarse una vez. Si no lo encontrás, revisá la carpeta de spam."}),e.jsx("button",{type:"button",onClick:d,className:"w-full text-center text-sm text-primario hover:underline",children:"← Volver a las opciones de ingreso"})]})}function ie({form:t,onSubmit:d,onBack:o,error:l,maskedEmail:s,inputRef:i}){return e.jsxs("div",{className:"bg-blue-50 p-6 rounded-xl",children:[e.jsx("h2",{className:"text-md font-semibold text-gray-800 mb-1",children:"Ingresá tu contraseña"}),e.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:["Cuenta: ",e.jsx("strong",{children:s})]}),l&&e.jsx("div",{className:"mb-4 text-sm text-red-600",children:l}),e.jsxs("form",{onSubmit:d,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(G,{id:"password",type:"password",name:"password",ref:i,value:t.data.password,onChange:r=>t.setData("password",r.target.value),placeholder:"Contraseña",className:"block w-full text-sm placeholder:text-gray-500 rounded-md",autoComplete:"current-password",isFocused:!0}),e.jsx(A,{message:t.errors.password,className:"mt-2 text-rojo"})]}),e.jsx(U,{type:"submit",className:"w-full bg-azul text-white font-semibold py-2 rounded-md",disabled:t.processing,children:e.jsx("span",{className:"block text-center normal-case w-full text-sm",children:"Ingresar"})})]}),e.jsx("div",{className:"mt-3 text-center",children:e.jsx("a",{href:route("password.request"),className:"text-xs text-primario hover:underline",children:"¿Olvidaste tu contraseña?"})}),e.jsx("button",{type:"button",onClick:o,className:"w-full text-center text-xs text-gray-400 hover:text-gray-600 mt-3",children:"← Volver a las opciones de ingreso"})]})}
1export{ve as default};

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.