1import{r as e,j as s,a as r,u as t,e as a,L as l}from"./react-vendor-BbMijpWK.js";import{u as n,r as i,a as o,v as d,b as c,P as m,L as u,F as h,c as x,d as g,e as b,g as p,f,h as w,l as j,i as v,j as y,T as N}from"./index-BrUeZY9m.js";import{k}from"./firebase-vendor-BW4_ZEqj.js";import{a as C}from"./auth-DrSBo3yW.js";import{t as P}from"./templateMeta-VdCpAdmY.js";const S=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,L=e=>S.test(e),M=({isOpen:r,onClose:t,onSuccess:a})=>{const{lang:l,path:o}=n(),d=C[l]||C.en,[c,m]=e.useState(""),[u,h]=e.useState(!1),[x,g]=e.useState(!1),[b,p]=e.useState(""),f=()=>{m(""),p(""),g(!1),h(!1),t()};e.useEffect(()=>{if(!r)return;const e=e=>{"Escape"!==e.key||u||f()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,u]),e.useEffect(()=>{if(!x)return;const e=setTimeout(f,4e3);return()=>clearTimeout(e)},[x]);if(!r)return null;const w="emailRequired"===b?d.forgot.emailRequired:b?d.errors[b]||d.errors.default:"",j=!u&&c.trim()&&L(c.trim());return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",onMouseDown:e=>{e.target!==e.currentTarget||u||f()},children:s.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"forgot-password-title",className:"bg-white rounded-2xl shadow-2xl w-full max-w-md mx-auto transform transition-all max-h-[90vh] overflow-y-auto",children:s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-center gap-4 mb-6",children:[s.jsx("h2",{id:"forgot-password-title",className:"text-2xl font-bold text-gray-900",children:d.forgot.title}),s.jsx("button",{type:"button",onClick:f,className:"flex-shrink-0 bg-white border border-gray-900 text-gray-900 hover:bg-gray-50 transition-colors p-1 rounded-lg","aria-label":d.forgot.close,children:s.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("p",{className:"text-gray-600 mb-6",children:d.forgot.intro}),s.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),c.trim())if(L(c.trim())){h(!0),p(""),g(!1);try{const e=await i(c.trim(),{lang:l,continueUrl:`${window.location.origin}${o("auth")}`});e.success||"auth/user-not-found"===e.error?(g(!0),m(""),a&&a()):p(e.error||"auth/unknown")}catch{p("auth/unknown")}finally{h(!1)}}else p("auth/invalid-email");else p("emailRequired")},className:"space-y-4",noValidate:!0,children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"reset-email",className:"block text-sm font-medium text-gray-700 mb-2",children:d.forgot.emailLabel}),s.jsx("input",{id:"reset-email",type:"email",inputMode:"email",autoComplete:"email",value:c,onChange:e=>{m(e.target.value),b&&p("")},placeholder:d.forgot.emailPlaceholder,"aria-invalid":Boolean(b),"aria-describedby":b?"reset-email-error":void 0,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 transition-colors",disabled:u,autoFocus:!0})]}),w&&s.jsx("div",{id:"reset-email-error",className:"p-3 rounded-lg bg-red-50 border border-red-200",role:"alert",children:s.jsxs("p",{className:"text-sm text-red-600 flex items-start",children:[s.jsx("svg",{className:"w-4 h-4 mr-2 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),s.jsx("span",{children:w})]})}),x&&s.jsx("div",{className:"p-3 rounded-lg bg-green-50 border border-green-200",role:"status",children:s.jsxs("p",{className:"text-sm text-green-700 flex items-start",children:[s.jsx("svg",{className:"w-4 h-4 mr-2 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),s.jsx("span",{children:d.forgot.sent})]})}),s.jsxs("div",{className:"flex gap-3 pt-4",children:[s.jsx("button",{type:"button",onClick:f,className:"flex-1 px-4 py-3 bg-white border border-gray-900 text-gray-900 rounded-lg hover:bg-gray-50 transition-colors font-medium",disabled:u,children:d.forgot.cancel}),s.jsx("button",{type:"submit",disabled:!j,className:"flex-1 px-4 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors font-medium flex items-center justify-center",children:u?s.jsxs(s.Fragment,{children:[s.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),d.forgot.sending]}):d.forgot.submit})]})]})]})})})},B="fmcv_has_account",z=()=>{try{localStorage.setItem(B,"1")}catch{}},R=()=>{try{const e=localStorage.getItem("selectedTemplate");return e?JSON.parse(e):null}catch{return null}},F=(e,s={})=>String(e).replace(/\{(\w+)\}/g,(e,r)=>s[r]??""),$=({open:e})=>s.jsx("svg",{className:"h-5 w-5 text-gray-900",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:e?s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"}):s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})}),W=({id:e,children:r})=>s.jsxs("p",{id:e,className:"mt-1 text-sm text-red-600 flex items-start",children:[s.jsx("svg",{className:"w-4 h-4 mr-1 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),s.jsx("span",{children:r})]}),I=()=>s.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),T=(e,s="")=>`block w-full px-4 py-3 rounded-lg border bg-white ${s} ${e?"border-red-300":"border-gray-300"} focus:ring-blue-500 focus:border-blue-500 transition-colors`,q=()=>{const i=r(),S=t(),[L]=a(),{lang:q,path:E}=n(),U=C[q]||C.en,[V,A]=e.useState(()=>{const e=new URLSearchParams(S.search).get("mode"),s=S.state?.mode;return"signup"!==s&&"signup"!==e&&("login"===s||"login"===e||"signin"===e||(()=>{try{return"1"===localStorage.getItem(B)}catch{return!1}})())}),[H,O]=e.useState({name:"",email:"",password:""}),[D,K]=e.useState(!1),[_,J]=e.useState({}),[G]=e.useState(R),[Q,X]=e.useState(!1),[Y,Z]=e.useState(!1),[ee,se]=e.useState(!1),[re,te]=e.useState(""),[ae,le]=e.useState(""),[ne,ie]=e.useState(!1),[oe,de]=e.useState({newPassword:"",confirmPassword:""}),[ce,me]=e.useState(!1),[ue,he]=e.useState(!1),xe=e=>
1e?U.validation[e]||e:"",ge=e=>e?U.errors[e]||U.errors.default:"",be=()=>((e,s,r)=>{if("string"!=typeof e||!e.startsWith("/")||e.startsWith("//"))return r;if("tr"!==s)return e;const t=e.search(/[?#]/),a=-1===t?e:e.slice(0,t),l=-1===t?"":e.slice(t);if("tr"===v(a))return e;const n=y(a,"tr");return n?`${n}${l}`:e})(S.state?.returnTo,q,E("dashboard"));e.useEffect(()=>{const e=L.get("mode"),s=L.get("oobCode");if("resetPassword"!==e||!s)return;if((L.get("lang")||"").toLowerCase().startsWith("tr")&&"tr"!==q)return void i(`${o("auth","tr")}${S.search}`,{replace:!0});let r=!1;return se(!0),te(s),ie(!0),d(s).then(e=>{r||(e.success?(le(e.email),J({})):J({resetCode:e.error||"auth/invalid-action-code"}))}).catch(()=>{r||J({resetCode:"auth/invalid-action-code"})}).finally(()=>{r||ie(!1)}),()=>{r=!0}},[L,q]);const pe=e=>{const{name:s,value:r}=e.target;O(e=>({...e,[s]:r})),(_[s]||_.submit)&&J(e=>({...e,[s]:"",submit:""}))},fe=e=>{const{name:s,value:r}=e.target;de(e=>({...e,[s]:r})),_[s]&&J(e=>({...e,[s]:""}))},we=()=>{se(!1),J({}),i(E("auth"),{replace:!0})},je={blue:{accent:"bg-blue-600",button:"bg-blue-600 hover:bg-blue-700"},purple:{accent:"bg-purple-600",button:"bg-purple-600 hover:bg-purple-700"},gray:{accent:"bg-gray-600",button:"bg-gray-600 hover:bg-gray-700"},teal:{accent:"bg-teal-600",button:"bg-teal-600 hover:bg-teal-700"},red:{accent:"bg-red-600",button:"bg-red-600 hover:bg-red-700"},green:{accent:"bg-green-600",button:"bg-green-600 hover:bg-green-700"}},ve=G&&je[G.color]||je.blue,ye=G&&[G.key,G.templateKey,G.id,G.name].filter(Boolean).map(e=>c(e)).find(Boolean)||null,Ne=ye?(P[q]||P.en)?.[ye]:null,ke=Ne?.name||G?.name,Ce=Ne?.description||G?.description,Pe=Ne?.tags||G?.tags||[],Se=ee?U.heading.reset:V?U.heading.signIn:U.heading.signUp,Le=ee?U.sub.reset:V?U.sub.signIn:F(U.sub.signUp,{credits:x});return s.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-white via-gray-50 to-blue-50",children:[s.jsx(m,{routeKey:"auth",noindex:!0}),s.jsx("div",{className:"flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8 py-12",children:s.jsxs("div",{className:"max-w-md w-full",children:[s.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-10","aria-hidden":"true",children:s.jsxs("svg",{className:"absolute inset-0 h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("pattern",{id:"small-grid",width:"24",height:"24",patternUnits:"userSpaceOnUse",children:[s.jsx("rect",{width:"24",height:"24",fill:"none"}),s.jsx("path",{d:"M 24 0 L 0 0 0 24",fill:"none",stroke:"rgba(59, 130, 246, 0.1)",strokeWidth:"1"})]}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#small-grid)"})]})}),s.jsx("div",{className:"relative bg-white rounded-2xl shadow-xl overflow-hidden",children:s.jsxs("div",{className:"px-8 py-10",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx(l,{to:E("home"),className:"inline-flex items-center justify-center mb-6 w-full",children:s.jsx(u,{size:"lg",alt:U.logoAlt,className:"mx-auto",loading:"eager",fetchpriority:"high",decoding:"async"})}),!ee&&(G?s.jsxs("div",{className:`mb-4 py-2 px-3 rounded-lg border border-gray-100 flex items-center gap-3 shadow-sm ${ve.accent} bg-opacity-10`,children:[s.jsx("svg",{className:"h-6 w-6 text-blue-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("p",{className:"text-sm text-gray-700 font-semibold",children:[U.template.selected," ",s.jsx("span",{className:"font-bold text-gray-900",children:ke})]}),Ce&&s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:Ce}),Pe.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Pe.map(e=>s.jsx("span",{className:"inline-block px-2 py-0.5 text-xs text-blue-700 bg-blue-50 rounded-full border border-blue-100",children:e},e))}),s.jsx("div",{className:"mt-2",children:s.jsx(l,{to:E("templates"),className:"text-xs font-medium text-blue-600 hover:underline",children:U.template.change})})]})]}):s.jsxs("div",{className:"mb-4 py-2 px-3 rounded-lg bg-yellow-50 border border-yellow-100 flex items-center gap-2",children:[s.jsx("svg",{className:"h-5 w-5 text-yellow-500 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01"})}),s.jsxs("span",{className:"text-xs text-yellow-700",children:[U.template.noneTitle," ",s.jsx(l,{to:E("templates"),className:"underline hover:text-yellow-800",children:F(U.template.noneLink,{count:N})}),U.template.noneAfter]})]})),s.jsx("h1",{className:"text-3xl font-bold text-gray-900 leading-tight",children:Se}),s.jsx("p",{className:"mt-2 text-gray-600",children:Le})]}),ee?s.jsx(s.Fragment,{children:ne?s.jsxs("div",{className:"text-center py-8",role:"status",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto","aria-hidden":"true"}),s.jsx("p",{className:"mt-4 text-gray-600",children:U.reset.verifying})]}):_.resetCode?s.jsxs("div",{className:"text-center py-8",children:[s.jsxs("div",{className:"p-4 rounded-lg bg-red-50 border border-red-200",role:"alert",children:[s.jsx("svg",{className:"w-12 h-12 text-red-500 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L3.732 19c-.77.833.192 2.5 1.732 2.5z"})}),s.jsx("h2",{className:"text-lg font-medium text-red-900 mb-2",children:U.reset.invalidTitle}),s.jsx("p",{className:"text-sm text-red-700 mb-4",children:ge(_.resetCode)}),s.jsx("button",{type:"button",onClick:()=>Z(!0),className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 min-h-[44px]",children:U.actions.requestNewLink})]}),s.jsx("button",{type:"button",onClick:we,className:"mt-4 text-sm font-medium text-gray-900 hover:text-gray-700 bg-white hover:bg-gray-50 px-4 py-2 rounded-lg border border-gray-300 transition-colors min-h-[44px]",children:U.actions.backToSignIn})]}):s.jsxs("form",{className:"space-y-6",onSubmit:async e=>{e.preventDefault();const s={};if(oe.newPassword.length<6&&(s.newPassword="passwordShort"),oe.newPassword!==oe.confirmPassword&&(s.confirmPassword="passwordsMismatch"),Object.keys(s).length>0)J(s);else{X(!0);try{const e=await g(re,oe.newPassword);e.success?(b.success(U.reset.success),se(!1),A(!0),de({newPassword:"",confirmPassword:""}),J({}),i(E("auth"),{replace:!0})):J({submit:e.error||"auth/unknown"})}catch(r){J({submit:p(r)})}finally{X(!1)}}},noValidate:!0,children:[s.jsx("div",{className:"mb-4 p-3 rounded-lg bg-green-50 border border-green-200",children:s.jsxs("p",{className:"text-sm text-green-700 flex items-start gap-2",children:[s.jsx("svg",{className:"w-4 h-4 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),s.jsxs("span",{className:"min-w-0 break-words",children:[U.reset.forEmail," ",s.jsx("strong",{children:ae})]})]})}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:U.fields.newPassword}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{id:"newPassword",name:"newPassword",type:ce?"text":"password",value:oe.newPassword,onChange:fe,autoComplete:"new-password","aria-invalid":Boolean(_.newPassword),"aria-describedby":_.newPassword?"newPassword-error":void 0,className:T(_.newPassword,"pr-14"),placeholder:U.fields.newPasswordPlaceholder}),s.jsx("button",{type:"button",onClick:()=>me(!ce),"aria-label":ce?U.fields.hidePassword:U.fields.showPassword,"aria-pressed":ce,className:"absolute inset-y-0 right-0 px-3 flex items-center bg-white rounded-r-lg border-l border-gray-300 hover:border-gray-400",children:s.jsx($,{open:ce})})]}),_.newPassword&&s.jsx(W,{id:"newPassword-error",children:xe(_.newPassword)})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:U.fields.confirmPassword}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{id:"confirmPassword",name:"confirmPassword",type:ue?"text":"password",value:oe.confirmPassword,onChange:fe,autoComplete:"new-password","aria-invalid":Boolean(_.confirmPassword),"aria-describedby":_.confirmPassword?"confirmPassword-error":void 0,className:T(_.confirmPassword,"pr-14"),placeholder:U.fields.confirmPasswordPlaceholder}),s.jsx("button",{type:"button",onClick:()=>he(!ue),"aria-label":ue?U.fields.hidePassword:U.fields.showPassword,"aria-pressed":ue,className:"absolute inset-y-0 right-0 px-3 flex items-center bg-white rounded-r-lg border-l border-gray-300 hover:border-gray-400",children:s.jsx($,{open:ue})})]}),_.confirmPassword&&s.jsx(W,{id:"confirmPassword-error",children:xe(_.confirmPassword)})]}),_.submit&&s.jsx("div",{className:"p-3 rounded-lg bg-red-50 border border-red-200",role:"alert",children:s.jsx("p",{className:"text-sm text-red-600",children:ge(_.submit)})}),s.jsx("div",{className:"pt-2",children:s.jsx("button",{type:"submit",disabled:Q,className:"w-full flex justify-center items-center gap-3 px-6 py-3 border border-transparent roun
1ded-lg shadow-sm text-base font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors "+(Q?"opacity-75 cursor-not-allowed":""),children:Q?s.jsxs(s.Fragment,{children:[s.jsx(I,{}),U.actions.resetting]}):U.actions.resetSubmit})}),s.jsx("div",{className:"text-center mt-4",children:s.jsx("button",{type:"button",onClick:we,className:"text-sm font-medium text-gray-900 hover:text-gray-700 bg-white hover:bg-gray-50 px-4 py-2 rounded-lg border border-gray-300 transition-colors min-h-[44px]",children:U.actions.backToSignIn})})]})}):s.jsxs("form",{className:"space-y-6",onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return H.email?/\S+@\S+\.\S+/.test(H.email)||(e.email="emailInvalid"):e.email="emailRequired",H.password?H.password.length<6&&(e.password="passwordShort"):e.password="passwordRequired",V||H.name.trim()||(e.name="nameRequired"),V||D||(e.terms="termsRequired"),J(e),0===Object.keys(e).length})()){X(!0);try{V?await k(f,H.email,H.password):await w(H.name.trim(),H.email,H.password),z(),i(be())}catch(s){J(e=>({...e,submit:p(s)}))}finally{X(!1)}}},noValidate:!0,children:[!V&&s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:U.fields.name}),s.jsx("input",{id:"name",name:"name",type:"text",value:H.name,onChange:pe,autoComplete:"name","aria-invalid":Boolean(_.name),"aria-describedby":_.name?"name-error":void 0,className:T(_.name),placeholder:U.fields.namePlaceholder}),_.name&&s.jsx(W,{id:"name-error",children:xe(_.name)})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:U.fields.email}),s.jsx("input",{id:"email",name:"email",type:"email",inputMode:"email",value:H.email,onChange:pe,autoComplete:"email","aria-invalid":Boolean(_.email),"aria-describedby":_.email?"email-error":void 0,className:T(_.email),placeholder:U.fields.emailPlaceholder}),_.email&&s.jsx(W,{id:"email-error",children:xe(_.email)})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[s.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:U.fields.password}),V&&s.jsx("button",{type:"button",onClick:()=>Z(!0),className:"text-sm font-medium text-gray-900 hover:text-gray-700 transition-colors bg-transparent hover:bg-gray-100 px-2 py-1 rounded text-right",children:U.actions.forgot})]}),s.jsx("input",{id:"password",name:"password",type:"password",value:H.password,onChange:pe,autoComplete:V?"current-password":"new-password","aria-invalid":Boolean(_.password),"aria-describedby":_.password?"password-error":void 0,className:T(_.password),placeholder:V?"â¢â¢â¢â¢â¢â¢â¢â¢":U.fields.passwordPlaceholder}),_.password&&s.jsx(W,{id:"password-error",children:xe(_.password)})]}),!V&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-start gap-3 text-sm text-gray-700",children:[s.jsx("input",{id:"terms",name:"terms",type:"checkbox",checked:D,onChange:e=>{K(e.target.checked),_.terms&&J(e=>({...e,terms:""}))},"aria-invalid":Boolean(_.terms),"aria-describedby":_.terms?"terms-error":void 0,className:"mt-0.5 h-5 w-5 min-h-0 min-w-0 flex-shrink-0 rounded border-gray-300 text-blue-600 focus:ring-blue-500 cursor-pointer"}),s.jsxs("label",{htmlFor:"terms",className:"min-w-0 leading-6 -mt-0.5 cursor-pointer",children:[U.terms.before,s.jsx(l,{to:`${E("legal")}#terms`,className:"text-blue-700 underline hover:text-blue-800",children:U.terms.termsLink}),U.terms.between,s.jsx(l,{to:`${E("legal")}#privacy`,className:"text-blue-700 underline hover:text-blue-800",children:U.terms.privacyLink}),U.terms.after]})]}),_.terms&&s.jsx("p",{id:"terms-error",className:"mt-1 text-sm text-red-600",children:xe(_.terms)})]}),_.submit&&s.jsx("div",{className:"p-3 rounded-lg bg-red-50 border border-red-200",role:"alert",children:s.jsx("p",{className:"text-sm text-red-600",children:ge(_.submit)})}),s.jsx("div",{className:"pt-2",children:s.jsx("button",{type:"submit",disabled:Q,className:`w-full flex justify-center items-center px-6 py-3 border border-transparent roun
1ded-lg shadow-sm text-base font-medium text-white ${ve.button} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors ${Q?"opacity-75 cursor-not-allowed":""}`,children:Q?s.jsx(I,{}):s.jsxs(s.Fragment,{children:[V?U.actions.signIn:U.actions.signUp,s.jsx("svg",{className:"ml-2 -mr-1 h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})}),s.jsxs("div",{className:"relative my-6",children:[s.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:s.jsx("div",{className:"w-full border-t border-gray-300"})}),s.jsx("div",{className:"relative flex justify-center text-sm",children:s.jsx("span",{className:"px-2 bg-white text-gray-500",children:U.actions.orContinue})})]}),s.jsx("div",{className:"mb-6",children:s.jsxs("button",{type:"button",onClick:async()=>{X(!0),J({});try{const e=await j();e.user?(z(),i(be())):J({submit:e.error||"auth/unknown"})}catch(e){J({submit:p(e)})}finally{X(!1)}},disabled:Q,className:"w-full flex justify-center items-center px-6 py-3 border border-gray-300 rounded-lg shadow-sm bg-white text-gray-700 font-medium hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsxs("svg",{className:"w-5 h-5 mr-3 flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:[s.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),s.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),s.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),s.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),Q?U.actions.googleLoading:U.actions.google]})}),s.jsx("div",{className:"text-center",children:s.jsx("button",{type:"button",onClick:()=>{A(e=>!e),J({})},className:"w-full py-3 px-3 bg-blue-50 text-blue-700 rounded-xl font-medium hover:bg-blue-100 transition",children:V?U.actions.toSignUp:U.actions.toSignIn})})]})]})})]})}),s.jsx(h,{variant:"auth"}),s.jsx(M,{isOpen:Y,onClose:()=>Z(!1)})]})};export{q 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.