PageSourceSearch

https://www.content.game/assets/LoginWithPasswordAction-DbTL_kDj.js

js content.game collected 2026-10-04 12:34:14 UTC 4,343 bytes, 5 lines download raw bytes

1
2!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&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1e0573aa-2479-59e4-8f65-8f286f7b1da2")}catch(e){}}();
3import{a as e,t}from"./jsx-runtime-CMgEUHpv.js";import{V as n}from"./dist-CAHjj65Z.js";import{t as r}from"./useTranslation-BymTnaHx.js";import{l as i,n as a}from"./components-B8bHjdou.js";import{t as o}from"./Text-B4PqLHDw.js";import{t as s}from"./StatusInputs-Bo_bMqPM.js";import{t as c}from"./useToast-aQCYBESc.js";import{t as l}from"./useIsLoggedIn-hXilkn2W.js";import{t as u}from"./Button-DG1GtAKw.js";import{t as d}from"./usePostSlugRedirect-BUDTYjB0.js";import{t as f}from"./usePublication-i2rJD5VI.js";import{t as p}from"./Input-C6IbD1Sk.js";import{t as m}from"./RedirectToHiddenInput-Dv2ZQtf-.js";var h=e(n(),1),g=t(),_=({emailFieldName:e=`email`,emailFieldType:t=`email`,isSubmitting:n=!1,useMagicLink:i=!0,useOneTimePassword:a=!1,showLoginWithPassword:c=!1})=>{let[l,d]=(0,h.useState)(!0),{t:f}=r(),m=f(i?`login.login_with_email_label`:`login.login_with_otp_label`),_=f(i?`login.send_magic_link_button_label`:`login.send_otp_button_label`),v=(0,g.jsx)(`button`,{type:`button`,onClick:()=>d(!l),children:(0,g.jsx)(o,{as:`span`,size:`xs`,type:`body`,weight:`bold`,theme:`default`,children:l?f(`login.login_with_password_label`):m})});return(0,g.jsxs)(`div`,{className:`flex flex-col w-full space-y-2 sm:space-y-6`,children:[(0,g.jsx)(s,{name:`login`,errorMessage:`${f(`errors.default`)} ${f(`errors.try_later`)}`,successMessage:f(l?`toast.login_link.message`:`login.success.message`)}),(0,g.jsx)(`input`,{type:`hidden`,name:`request_magic_link`,value:i?`true`:`false`}),(0,g.jsx)(`input`,{type:`hidden`,name:`use_one_time_password`,value:a?`true`:`false`}),(0,g.jsxs)(`div`,{className:`flex flex-col w-full text-left gap-y-6`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,g.jsx)(p,{name:e,type:t,required:!0,placeholder:f(`login.email_placeholder`),autoComplete:`email`,label:f(`login.email_label`)}),l&&c?(0,g.jsx)(`div`,{className:`flex justify-end w-full`,children:v}):null]}),l?null:(0,g.jsxs)(`div`,{className:`flex flex-col w-full gap-y-1`,children:[(0,g.jsx)(p,{name:`password`,type:`password`,placeholder:f(`login.password_placeholder`),label:f(`login.password_label`),required:!l}),(0,g.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:v,(0,g.jsx)(o,{as:`p`,size:`xs`,type:`body`,theme:`default`,className:``,children:(0,g.jsx)(`a`,{href:`/reset_password`,className:`underline`,children:(0,g.jsx)(o,{as:`span`,size:`xs`,type:`body`,weight:`bold`,theme:`default`,children:f(`login.set_new_password`)})})})]})]})]}),(0,g.jsx)(u,{disabled:n,type:`submit`,children:l?_:f(`login.login_button_label`)})]})},v=({onSuccess:e,bypassSparkLoopMode:t=!1,showLoginWithPassword:n=!1})=>{let s=l(),{one_time_password_enabled:u}=f(),p=d(),v=i(),y=v.data,b=v.state===`submitting`,{t:x}=r();if((0,h.useEffect)(()=>{localStorage.removeItem(`signup_redirects`)},[]),c(y?.toast,e),s)return null;let S=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=n.get(`login_email`);t&&r&&n.append(`email`,r),v.submit(n,{method:`post`,action:`/login`})};return(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(v.Form,{method:`post`,action:`/login`,className:`w-full`,onSubmit:e=>S(e),children:[(0,g.jsx)(m,{value:p}),(0,g.jsx)(`div`,{className:`flex flex-col w-full space-y-2 sm:space-y-6`,children:t?(0,g.jsx)(_,{emailFieldName:`login_email`,emailFieldType:`text`,isSubmitting:b,useMagicLink:!u,useOneTimePassword:u,showLoginWithPassword:n}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(_,{isSubmitting:b,useMagicLink:!u,useOneTimePassword:u,showLoginWithPassword:n}),(0,g.jsx)(`div`,{className:`flex flex-col`,children:(0,g.jsxs)(o,{as:`p`,size:`xs`,type:`body`,theme:`default`,children:[x(`login.sign_up_label`),` `,(0,g.jsx)(a,{to:`/subscribe`,className:`underline`,children:(0,g.jsx)(o,{as:`span`,size:`xs`,type:`body`,weight:`bold`,theme:`default`,children:x(`shared.cta.sign_up`)})})]})})]})})]})})};export{v as t};
4//# sourceMappingURL=LoginWithPasswordAction-DbTL_kDj.js.map
5//# debugId=1e0573aa-2479-59e4-8f65-8f286f7b1da2

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.