PageSourceSearch

https://hudumacna.com/static/js/8043.b6d16ce0.chunk.js

js hudumacna.com collected 2026-10-09 22:40:09 UTC 5,776 bytes, 2 lines download raw bytes

1/*! For license information please see 8043.b6d16ce0.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[8043],{18043:(e,t,s)=>{s.r(t),s.d(t,{default:()=>h});var a=s(9950),r=s(73814),l=s(90067),n=s(19535),i=s(76591),o=s(56600),c=s(45532),d=s(17638),u=s(11503),m=s(44414);const p="h-11 w-full border border-slate-300 bg-white pl-10 pr-3 text-sm outline-none focus:border-[#123b69] focus:ring-1 focus:ring-[#123b69]";function h(){const{user:e,profile:t,permissionsLoaded:s}=(0,c.As)(),h=(0,r.Zp)(),[g,x]=(0,a.useState)(()=>"signup"===new URLSearchParams(window.location.search).get("mode")?"signup":"signin"),[b,w]=(0,a.useState)(""),[f,j]=(0,a.useState)(""),[y,v]=(0,a.useState)(""),[N,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)(!1);if(e&&s&&t)return(0,m.jsx)(r.C5,{to:(0,u.I)(t),replace:!0});const U=async()=>{var e;await(0,o.Ij)("claimStudentPortalAccount"),await(null===(e=o.j2.currentUser)||void 0===e?void 0:e.getIdToken(!0)),h("/student-portal")};return(0,m.jsx)("div",{className:"min-h-screen bg-slate-50 px-4 py-10 sm:py-14",children:(0,m.jsxs)("div",{className:"mx-auto max-w-md border border-slate-200 bg-white p-7 sm:p-9",children:[(0,m.jsx)("img",{src:"/official-logo.png",alt:"Caregiver Training and Huduma Center",className:"h-16 w-16 object-contain"}),(0,m.jsx)("p",{className:"mt-5 text-xs font-bold uppercase tracking-widest text-slate-500",children:"Student portal"}),(0,m.jsx)("h1",{className:"mt-2 text-2xl font-bold",children:"signup"===g?"Create your account":"Sign in to your account"}),(0,m.jsx)("p",{className:"mt-2 text-sm text-slate-600",children:"Use the same email address registered with the school."}),(0,m.jsx)("div",{className:"mt-6 grid grid-cols-2 border border-slate-200 p-1",children:["signin","signup"].map(e=>(0,m.jsx)("button",{type:"button",onClick:()=>{x(e),v(""),S(!1)},className:"h-9 text-sm font-semibold "+(g===e?"bg-[#123b69] text-white":"text-slate-600"),children:"signin"===e?"Sign in":"Create account"},e))}),y&&(0,m.jsx)("p",{className:"mt-4 border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:y}),k&&(0,m.jsx)("p",{className:"mt-4 border border-green-200 bg-green-50 p-3 text-sm text-green-700",children:"If your account exists, a password email has been sent."}),"signup"===g&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{type:"button",onClick:async()=>{C(!0),v("");try{const e=new l.HF;e.setCustomParameters({prompt:"select_account"}),await(0,l.df)(o.j2,e),await U()}catch(t){var e;o.j2.currentUser&&await(0,l.CI)(o.j2).catch(()=>{}),"auth/popup-closed-by-user"!==(null===t||void 0===t?void 0:t.code)&&v(null!==t&&void 0!==t&&null!==(e=t.message)&&void 0!==e&&e.includes("student record")?t.message:"Google sign-up could not be completed. Choose the Google account registered with the school.")}finally{C(!1)}},disabled:N,className:"mt-6 flex h-11 w-full items-center justify-center gap-3 border border-slate-300 bg-white text-sm font-semibold text-slate-700 hover:bg-slate-50 disabled:opacity-50",children:[(0,m.jsx)("span",{className:"text-lg font-bold text-[#4285f4]",children:"G"}),"Continue with Google"]}),(0,m.jsxs)("div",{className:"my-5 flex items-center gap-3",children:[(0,m.jsx)("span",{className:"h-px flex-1 bg-slate-200"}),(0,m.jsx)("span",{className:"text-xs uppercase tracking-wider text-slate-400",children:"or email"}),(0,m.jsx)("span",{className:"h-px flex-1 bg-slate-200"})]})]}),(0,m.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),C(!0),v("");try{"signup"===g?(await(0,l.eJ)(o.j2,b.trim().toLowerCase(),f),await U()):(await(0,l.x9)(o.j2,b.trim().toLowerCase(),f),h("/student-portal"))}catch(t){"signup"===g&&o.j2.currentUser&&await(0,l.CI)(o.j2).catch(()=>{});const e=(null===t||void 0===t?void 0:t.message)||"";v(e.includes("email-already-in-use")?"An account already exists for this email. Sign in or reset your password.":e.includes("weak-password")?"Use a password with at least 6 characters.":e.includes("student record")?e:"signup"===g?"Unable to create the account. Use the email registered with the school.":"Incorrect email or password. Use the email registered with the school.")}finally{C(!1)}}
2,className:"signup"===g?"space-y-3":"mt-6 space-y-3",children:[(0,m.jsxs)("label",{className:"relative block",children:[(0,m.jsx)(n.A,{className:"absolute left-3 top-3.5 h-4 w-4 text-slate-400"}),(0,m.jsx)("input",{type:"email",autoComplete:"email",required:!0,value:b,onChange:e=>w(e.target.value),placeholder:"Registered email",className:p})]}),(0,m.jsxs)("label",{className:"relative block",children:[(0,m.jsx)(i.A,{className:"absolute left-3 top-3.5 h-4 w-4 text-slate-400"}),(0,m.jsx)("input",{type:"password",autoComplete:"signup"===g?"new-password":"current-password",minLength:6,required:!0,value:f,onChange:e=>j(e.target.value),placeholder:"signup"===g?"Create password":"Password",className:p})]}),(0,m.jsx)("button",{disabled:N,className:"h-11 w-full bg-slate-900 text-sm font-bold text-white disabled:opacity-50",children:N?"Please wait\u2026":"signup"===g?"Create account":"Sign in"})]}),"signin"===g&&(0,m.jsx)("button",{onClick:async()=>{if(!b.trim())return v("Enter your registered email first.");C(!0),v("");try{await(0,d.J1)(b.trim()),S(!0)}catch(e){S(!0)}finally{C(!1)}},disabled:N,className:"mt-4 w-full text-sm font-semibold text-slate-600 underline",children:"Forgot password?"}),(0,m.jsx)("p",{className:"mt-6 border-t pt-5 text-xs leading-5 text-slate-500",children:"Account access is available only when the sign-up email matches an enrolled student record."})]})})}},76591:(e,t,s)=>{s.d(t,{A:()=>a});const a=(0,s(7101).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])}}]);

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.