1import{u as e,r as t,j as r,o as a}from"./react-vendor-BfcYvH7X.js";import{u as s,a as o,b as n}from"./index-CYnAbKpF.js";import{S as l}from"./SEO-BMKDKKBf.js";import"./vendor-ChIAAe2R.js";import"./supabase-vendor-DqTBqZ2d.js";function d(){const d=e(),{buttonColor:i,textColor:c}=s(),{language:u,t:m}=o();t.useEffect(()=>{const e=new URLSearchParams(d.search).get("ref");e&&localStorage.setItem("referralCode",e)},[d.search]);const[x,b]=t.useState(!1),[g,p]=t.useState(!1),[h,f]=t.useState(""),[y,j]=t.useState(""),[v,w]=t.useState(""),[N,S]=t.useState(""),[k,C]=t.useState(!1),{signUp:I,signIn:P,resetPassword:A}=n();return r.jsxs(r.Fragment,{children:[r.jsx(l,{title:`${m("nav.signIn")} - Taxi Profile`,description:"Sign in to manage your taxi driver profile",canonical:`https://taxiprofile.com/${u}/auth`}),r.jsx("div",{className:"min-h-[calc(100vh-4rem)] flex items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 px-4 pt-16",children:r.jsxs("div",{className:"bg-white shadow-xl p-8 w-full max-w-md rounded-lg",children:[r.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-6",children:[r.jsx(a,{className:"w-10 h-10 text-[#ffd80b]"}),r.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:m(g?"auth.resetPassword":x?"auth.createAccount":"auth.welcomeBack")})]}),!g&&r.jsxs("div",{className:"flex mb-6 border-b border-gray-200",children:[r.jsx("button",{type:"button",onClick:()=>{b(!1),w(""),S("")},className:"flex-1 py-3 text-sm font-semibold transition-colors -mb-px border-b-2 "+(x?"border-transparent text-gray-500 hover:text-gray-700":"border-[#ffd80b] text-gray-900"),children:m("auth.signIn")}),r.jsx("button",{type:"button",onClick:()=>{b(!0),w(""),S("")},className:"flex-1 py-3 text-sm font-semibold transition-colors -mb-px border-b-2 "+(x?"border-[#ffd80b] text-gray-900":"border-transparent text-gray-500 hover:text-gray-700"),children:m("auth.createAccount")})]}),r.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),w(""),S(""),C(!0),g){const{error:e}=await A(h);e?w(e.message):S(m("auth.resetEmailSent"))}else{const{error:e}=x?await I(h,y):await P(h,y);e&&w(e.message)}C(!1)},className:"space-y-6",children:[v&&r.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:v}),N&&r.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("auth.emailAddress")}),r.jsx("input",{type:"email",value:h,onChange:e=>f(e.target.value),required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#ffd80b] focus:border-transparent",placeholder:"[email protected]"})]}),!g&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("auth.password")}),r.jsx("input",{type:"password",value:y,onChange:e=>j(e.target.value),required:!0,minLength:6,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#ffd80b] focus:border-transparent",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),r.jsx("button",{type:"submit",disabled:k,className:"w-full py-3 rounded-lg font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition",style:{backgroundColor:i,
1color:c},children:m(k?"auth.processing":g?"auth.sendResetLink":x?"auth.createAccount":"auth.signIn")})]}),r.jsxs("div",{className:"mt-6 text-center space-y-2",children:[!g&&r.jsx("button",{type:"button",onClick:()=>p(!0),className:"text-gray-700 hover:text-gray-900 text-sm font-medium block w-full",children:m("auth.forgotPassword")}),g&&r.jsx("button",{type:"button",onClick:()=>{p(!1),w(""),S("")},className:"w-full py-3 rounded-lg font-medium transition bg-gray-200 text-gray-800 hover:opacity-90",children:m("auth.backToSignIn")})]})]})})]})}export{d as Auth};
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.