1import{r as n,e as y,u as C,j as e,L as _}from"./react-vendor-KcpGDhDO.js";import{A as P}from"./AuthShell-DgFC-YeQ.js";import{e as I,f as c,w as m,I as w,B as U,h as D}from"./index-WFq09cu9.js";import{S as A}from"./SocialLoginButtons-xbmk0SVM.js";import"./supabase-vendor-DqO-ystM.js";import"./ui-vendor-IRxhZ7TT.js";import"./animation-vendor-9EcIC_Dc.js";function H(){const[d,u]=n.useState(""),[p,N]=n.useState(""),[h,f]=n.useState(!1),o=y(),t=C(),[S,k]=n.useState(!1),{signIn:L,isAuthenticated:b,loading:x,currentUser:l}=I(),i=n.useRef(!1);n.useEffect(()=>{if(!x&&b&&!i.current){i.current=!0;const s=new URLSearchParams(t.search).get("proposal_token");if(s){o(`/proposal/${encodeURIComponent(s)}`,{replace:!0});return}const r=c(t.search);if(l&&!l.role_setup_completed&&!l.main_role){o(m("/role-selection",r),{replace:!0});return}const g=l?.main_role==="recruiter"?"/recruiterDashboard":l?.main_role==="candidate"?"/jobs":l?.main_role==="group_partner"?"/partnerDashboard":"/";o(r||g,{replace:!0})}},[b,x,t.search,o,l]),n.useEffect(()=>{const a=new URLSearchParams(t.search),s=a.get("check_email"),r=a.get("email");r&&u(r),k(s==="1")},[t.search]);async function E(a){a.preventDefault(),f(!0);try{const{user:s,profile:r}=await L({email:d,password:p});if(s){i.current=!0;const j=new URLSearchParams(t.search).get("proposal_token");if(j){o(`/proposal/${encodeURIComponent(j)}`,{replace:!0});return}const v=c(t.search);if(r&&!r.role_setup_completed&&!r.main_role){o(m("/role-selection",v),{replace:!0});return}const R=r?.main_role==="recruiter"?"/recruiterDashboard":r?.main_role==="candidate"?"/jobs":r?.main_role==="group_partner"?"/partnerDashboard":"/";o(v||R,{replace:!0})}}catch(s){D("×× ××¡× × ×ש××","×©× ×שת×ש ×× ×¡×ס×× ×©×××××",s),f(!1)}}return e.jsxs(P,{title:"×ת××ר×ת",footer:e.jsxs(e.Fragment,{children:["××× ×× ×ש×××?"," ",e.jsx(_,{to:m("/register",c(t.search)),className:"font-bold text-brand-blue hover:underline",children:"××רש××"})]}),children:[S&&e.jsxs("div",{className:"mb-4 rounded-xl border border-blue-200 bg-blue-50 p-3 text-sm",dir:"rtl",children:[e.jsx("div",{className:"mb-1 font-bold",children:"× ×¨×©×ת ××צ××× - ש××× × ×××× ×××× ×××××ת"}),e.jsxs("div",{className:"mb-2 text-slate-600",children:["××¤×©× ×××× ××ת ",e.jsx("span",{className:"font-mono",children:"[email protected]"}),". ×× ×× ×צ×ת×, ×××§× ×ת××ת ×ספ××."]}),e.jsx("a",{className:"font-semibold text-brand-blue underline",href:"https://mail.google.com/mail/u/0/#search/from:team%40drushimavodot.co.il",target:"_blank",rel:"noreferrer",children:"פת××ת Gmail ×¢× ×¡×× ×× ×ש×××"})]}),e.jsx(A,{}),e.jsxs("form",{onSubmit:E,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-email",className:"mb-1 block text-sm font-semibold text-slate-700",children:"××××"}),e.jsx(w,{id:"login-email",type:"email",value:d,onChange:a=>u(a.target.value),required:!0,className:"text-right",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-password",className:"mb-1 block text-sm font-semibold text-slate-700",children:"ס×ס××"}),e.jsx(w,{id:"login-password",type:"password",value:p,onChange:a=>N(a.target.value),required:!0,className:"text-right",autoComplete:"current-password"})]}),e.jsx(U,{type:"submit",disabled:h,className:"w-full bg-brand-navy hover:bg-brand-navy/90",children:h?"×ת×צעת ×× ×ס×...":"×× ×ס×"}),e.jsx("div",{className:"text-center text-sm",children:e.jsx(_,{to:"/forgot-password",className:"font-semibold text-brand-blue hover:underline",children:"ש××ת ס×ס××?"})})]})]})}export{H 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.