<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&amp;&amp;(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4b603673-0f8a-5d0f-ab76-8d81df8e5c46")}catch(e){}}();
import{j as e}from"./jsx-runtime-Cf8x2fCZ.js";import{r as x}from"./index-CnhpwU98.js";import{T as n}from"./index-D1H9sqQ-.js";import{u as _}from"./useIsLoggedIn-DLyBBDcB.js";import{u as b}from"./useToast-Z33VfwyX.js";import{u as j}from"./usePublication-Dyad7v54.js";import{B as w}from"./index-76jK7shb.js";import{I as f}from"./Input-DuHNcmkM.js";import{S as y}from"./StatusInputs-C2fwlicj.js";import{u as h}from"./useTranslation-CMWGipsT.js";import{R as v}from"./RedirectToHiddenInput-DwARamz-.js";import{d as N,L as T}from"./components-MUvJN_Vi.js";const g=({emailFieldName:c="email",emailFieldType:r="email",isSubmitting:u=!1,useMagicLink:t=!0,useOneTimePassword:o=!1})=&gt;{const[l,m]=x.useState(!0),{t:s}=h(),d=s(t?"login.login_with_email_label":"login.login_with_otp_label"),a=s(t?"login.send_magic_link_button_label":"login.send_otp_button_label");console.log({toggleLabel:d,actionLabel:a,useMagicLink:t,sendEmail:l});const i=e.jsx("button",{type:"button",onClick:()=&gt;m(!l),children:e.jsx(n,{as:"span",size:"xs",type:"body",weight:"bold",theme:"default",children:l?s("login.login_with_password_label"):d})});return e.jsxs("div",{className:"flex flex-col w-full space-y-2 sm:space-y-6",children:[e.jsx(y,{name:"login",errorMessage:`${s("errors.default")} ${s("errors.try_later")}`,successMessage:s(l?"toast.login_link.message":"login.success.message")}),e.jsx("input",{type:"hidden",name:"request_magic_link",value:t?"true":"false"}),e.jsx("input",{type:"hidden",name:"use_one_time_password",value:o?"true":"false"}),e.jsxs("div",{className:"flex flex-col w-full text-left gap-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-y-1",children:[e.jsx(f,{name:c,type:r,required:!0,placeholder:s("login.email_placeholder"),autoComplete:"email",label:s("login.email_label")}),l?e.jsx("div",{className:"flex justify-end w-full",children:i}):null]}),l?null:e.jsxs("div",{className:"flex flex-col w-full gap-y-1",children:[e.jsx(f,{name:"password",type:"password",placeholder:s("login.password_placeholder"),label:s("login.password_label"),required:!l}),e.jsxs("div",{className:"flex flex-col items-end w-full gap-y-1 sm:flex-row-reverse sm:items-center sm:justify-between",children:[l?null:i,e.jsx(n,{as:"p",size:"xs",type:"body",theme:"default",className:"",children:e.jsx("a",{href:"/reset_password",className:"underline",children:e.jsx(n,{as:"span",size:"xs",type:"body",weight:"bold",theme:"default",children:s("login.set_new_password")})})})]})]})]}),e.jsx(w,{disabled:u,type:"submit",children:l?a:s("login.login_button_label")})]})},C=({onSuccess:c,bypassSparkLoopMode:r=!1})=&gt;{const u=_(),{one_time_password_enabled:t}=j(),o=N(),l=o.data,m=o.state==="submitting",{t:s}=h();if(x.useEffect(()=&gt;{localStorage.removeItem("signup_redirects")},[]),b(l?.toast,c),u)return null;const d=a=&gt;{a.preventDefault();const i=new FormData(a.currentTarget),p=i.get("login_email");r&amp;&amp;p&amp;&amp;i.append("email",p),o.submit(i,{method:"post",action:"/login"})};return e.jsx(e.Fragment,{children:e.jsxs(o.Form,{method:"post",action:"/login",className:"w-full",onSubmit:a=&gt;d(a),children:[e.jsx(v,{}),e.jsx("div",{className:"flex flex-col w-full space-y-2 sm:space-y-6",children:r?e.jsx(g,{emailFieldName:"login_email",emailFieldType:"text",isSubmitting:m,useMagicLink:!t,useOneTimePassword:t}):e.jsxs(e.Fragment,{children:[e.jsx(g,{isSubmitting:m,useMagicLink:!t,useOneTimePassword:t}),e.jsx("div",{className:"flex flex-col",children:e.jsxs(n,{as:"p",size:"xs",type:"body",theme:"default",children:[s("login.sign_up_label")," ",e.jsx(T,{to:"/subscribe",className:"underline",children:e.jsx(n,{as:"span",size:"xs",type:"body",weight:"bold",theme:"default",children:s("shared.cta.sign_up")})})]})})]})})]})})};export{C as L};
//# sourceMappingURL=LoginWithPasswordAction-Bc7FCaWl.js.map

//# debugId=4b603673-0f8a-5d0f-ab76-8d81df8e5c46
</pre></body></html>