1"use strict";(self.webpackChunknyp_membership=self.webpackChunknyp_membership||[]).push([[3973],{2508:function(e,t,n){var o=n(2001),s=n.n(o),i=n(935),a=n.n(i)()(s());a.push([e.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]),t.A=a},7054:function(e,t,n){var o=n(2591),s=n.n(o),i=n(1740),a=n.n(i),r=n(8128),l=n.n(r),d=n(855),c=n.n(d),u=n(3051),m=n.n(u),p=n(3656),g=n.n(p),h=n(2508),y={};y.styleTagTransform=g(),y.setAttributes=c(),y.insert=l().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=m(),s()(h.A,y),h.A&&h.A.locals&&h.A.locals},2356:function(e,t,n){n.d(t,{d:function(){return i}});var o=n(3486),s=n(8188);const i=e=>{const t=Object.assign({},e);let n=null;return Object.keys(e).forEach(e=>{"password"===e&&t[e].ref.value&&(t[e].message=o.y.passwordRequirements()),"email"===e&&t[e].type===s.lx&&(n=!0)}),{newErrors:t,userExists:n}}},7341:function(e,t,n){n.d(t,{s:function(){return r}});var o=n(1085),s=(n(4041),n(9067)),i=n.n(s),a=n(7309);const r=({message:e="",onClearForm:t=()=>null,submittedEmail:n=!1})=>(0,o.jsx)("div",{role:"alert",className:"error",children:(0,o.jsxs)("span",{children:[e,n?(0,o.jsx)("button",{type:"button",onClick:t,children:(0,a.__)("Try a different email address?","nypost")}):null]})});r.propTypes={message:i().string,submittedEmail:i().bool,onClearForm:i().func}},3973:function(e,t,n){n.r(t),n.d(t,{LoginPayflow:function(){return N},shouldSetRedirect:function(){return C}});var o=n(1085),s=n(4041),i=n(9067),a=n.n(i),r=n(3657),l=n(7309),d=n(3373),c=n.n(d),u=n(7093),m=n(3486),p=n(2628),g=n(316),h=n(7351),y=n(7296),b=n(7661),_=n(3127),f=n(7682),w=n(8188),v=n(2356),x=n(7341),j=(n(7054),function(e,t,n,o){return new(n||(n=Promise))(function(s,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function r(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,r)}l((o=o.apply(e,t||[])).next())})});const k=({type:e})=>{const{state:{pendingEmail:t=""}}=(0,h.rR)(),[n,i]=(0,s.useState)(null);return(0,o.jsxs)("div",{className:"form-wrapper form-wrapper--login",children:[(0,o.jsx)("h1",{className:"form-wrapper__heading",children:"login"===e?(0,l.__)("Check your email for the link","nypost"):(0,l.__)("Check your email to verify","nypost")}),(0,o.jsx)(f.XN,{tagName:"p",className:"m-top-double m-bottom",html:"login"===e?(0,l.nv)((0,l.__)("Click on the %1$sone-time link%2$s in the email to automatically log you in. If you do not receive the email within the next 3 minutes, please check your spam or junk folder.","nypost"),"<strong>","</strong>"):(0,l.__)("Please verify your registration by clicking on the link sent to your email address. If you do not receive the email within the next 3 minutes, please check your spam or junk folder.","nypost")}),"login"===e?(0,o.jsx)("p",{className:"body body--md",children:(0,l.__)("Existing passwords still work.","nypost")}):null,window.location.hostname.endsWith(".test")?(0,o.jsxs)("p",{className:"body body--lg",children:[(0,o.jsx)("strong",{children:"Note to site developers:"}),(0,o.jsx)("br",{})," ","This passwordless authentication flow will not work on local environments because the cookie being set is against"," ",(0,o.jsx)("code",{children:"alley.ws"})," ","and not"," ",(0,o.jsx)("code",{children:"alley.test"}),"."]}):null,t?(0,o.jsx)("p",{className:"m-bottom",children:(0,o.jsxs)("button",{className:c()({"button button--continue-without-password m-bottom-half":!0,disabled:"sending"===n}),type:"button",onClick:()=>j(void 0,void 0,void 0,function*(){t&&(i("sending"),(0,u.Rv)({email:t,action:e,redirect:"/account/subscribe"}).then(()=>i("sent")).catch(()=>i("error")))}),disabled:"sending"===n,children:[null===n?(0,l.__)("Resend Email","nypost"):null,"sending"===n?(0,l.__)("Sending...","nypost"):null,"sent"===n?(0,l.__)("Sent!","nypost"):null,"error"===n?(0,l.__)("Error Sending Email","nypost"):null]})}):null]})},C=e=>e!==w.th,N=({referralCode:e,isModal:t=!1,desktopHeadline:n,mobileHeadline:i,disclaimerFootnote:a,referrer:d=""})=>{var N,S;const[E,L]=(0,s.useState)(!1),[O,P]=(0,s.useState)(null),[F,A]=(0,s.use
1State)(!0),[W,R]=(0,s.useState)(!1),[I,T]=(0,s.useState)(!1),{operations:J,state:q}=(0,h.bK)(),{execute:B}=(0,h.Vq)(),{dispatch:G}=(0,h.rR)(),{dispatch:H}=(0,h.QW)(),[M,D]=(0,s.useState)(null),V=()=>{D(window.innerWidth>990?n:i)},K=window.matchMedia("(min-width: 990px)");(0,s.useEffect)(()=>{if(V(),!t&&void 0!==window.gtag){window.ga4Dims=window.ga4Dims||{};const e=Object.assign({},window.ga4Dims);e.source_unit="payflow_landing_page",e.event_action="view",e.event_label="login_page",window.gtag("event","ux_engagement",e)}return K.addEventListener("change",V),()=>{K.removeEventListener("change",V)}},[]);const U=(0,l.__)("Loading...","nypost"),X=q.loading?U:(0,l.__)("Continue","nypost");if((0,s.useEffect)(()=>{q.email.current&&q.email.current.focus()},[E]),I)return(0,o.jsx)(k,{type:I});const $=J.register("email",{setValueAs:e=>g.S.plainText(e),required:m.y.validEmail(),pattern:{value:w.Xw,message:m.y.validEmail()}}),{ref:z}=$,Q=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(n[o[s]]=e[o[s]])}return n}($,["ref"]),Y=t?[(0,l.__)("Continue","nypost"),(0,l.__)("Continue With","nypost")]:[(0,l.__)("Continue With","nypost")];return(0,o.jsx)(f.t8,{isModal:t,children:(0,o.jsxs)("div",{className:"form-wrapper form-wrapper--login",children:[(0,o.jsx)("h1",{className:"form-wrapper__heading",children:W?O?t?(0,l.__)("Activate Free Trial","nypost"):(0,l.__)("Create Account","nypost"):t?(0,l.__)("We found an account with this email address","nypost"):(0,l.__)("Log into your account","nypost"):t?(0,l.__)("Activate Free Trial","nypost"):M||(0,l.__)("Log in or create account","nypost")}),(0,o.jsx)("div",{className:"form-wrapper m-top m-bottom-half keep-border-mobile",children:E||t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("form",{onSubmit:J.handleSubmit(t=>j(void 0,void 0,void 0,function*(){if(q.loading)return;if(J.setLoading(!0),!W){try{yield B()}catch(e){return J.setLoading(!1),void J.setError("email",{type:"recaptcha",message:`Error validating reCAPTCHA: ${e.message||""}`})}const e=yield(0,u.v9)(t.email);return P(!e),R(!0),void J.setLoading(!1)}if(O){C(d)&&G((0,b.Be)(window.location.href));const n=yield(0,u.kz)({attributes:{"referral-code":e||void 0},email:q.username,password:t.password,skipForeignKey:!F});if(!n)return J.setLoading(!1),void J.setGeneralRegistrationError();const{status:o}=n;if("failed"===o&&n.type===w.lx)return J.setLoading(!1),void J.setError("email",{type:w.lx,message:m.y.emailInUse()});if("failed"===o&&n.type===w.Js){const e=localStorage.getItem("nyp_id"),t=e?yield(0,u.PB)(e):null;return A(!1),J.setLoading(!1),void J.setError("email",{type:w.Js,message:m.y.nypIdInUse(t)},{shouldFocus:!1})}if("success"===o){const{sessionId:e="",trackingId:t=""}=n;return G((0,b.m)(q.username)),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"user-registration"}),e&&"false"!==e&&t?((0,p.A)(),void J.onSuccessfulLogin(e,t)):void(0,u.Rv)({action:"register",email:q.username,redirect:"/account/subscribe"}).then(()=>{T("register"),J.setLoading(!1)})}return J.setGeneralRegistrationError(),void J.setLoading(!1)}const n={email:q.username,password:t.password},o=yield(0,u.iD)(n);if(J.setLoading(!1),!o)return void J.setGeneralError();const{status:s="failed",type:i=""}=o;if("failed"===s){let e="",t="zephr";switch(i){case"email-not-verified":e=m.y.emailVerified(),t=i;break;case"user-not-found":case"invalid-password":e=m.y.wrongEmailPassword();break;default:e=m.y.unknownError()}return void J.setError("email",{type:t,message:e})}if("success"===s){H((0,_.rE)(!0));const{sessionId:t="",trackingId:n=""}=o;return yield J.onSuccessfulLogin(t,n),void(e&&(yield(0,u.r7)({referralCode:e}))&&G((0,b.Uu)({referralCode:e})))}J.setGeneralError()})),children:[(0,o.jsxs)("div",{className:"floating-label input-container input-container--floating-label",children:[(0,o.jsx)("input",Object.assign({className:c()("floating-label__input",{"input-error":null===(N=q.errors)||void 0===N?void 0:N.email}),id:"email",placeholder:" ",disabled:q.loading||W||q.loadingContinueWithoutPassword},Q,{ref:e=>{z(e),q.email.current=e},required:!0,type:"email","data-empty":!q.username,"data-testid":"email-input",autoComplete:"email"})),(0,o.jsx)("div",{className:"floating-label__label-wrap",children:(0,o.jsx)("label",{className:"floating-label__label",htmlFor:"email",children:(0,l.__)("Email Address","nypost")})})]}),W?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"floating-label input-container input-container--floating-label",children:[(0,o.jsx)("label",{htmlFor:"password",className:"screen-reader-text",children:(0,l.__)("Password","nypost")}),(0,o.jsx)("input",Object.assign({className:c()("floating-label__input",{"input-error":null===(S=q.errors)||void 0===S?void 0:S.password}),id:"password","data-testid":"password",name:"password",placeholder:" "},J.register("password",O?{setValueAs:e=>g.S.plainText(e),required:m.y.enterPassword(),minLength:8,validate:e=>w.QR.test(e)}:{required:m.y.enterPassword()}),{type:"password",disabled:q.loading||q.loadingContinueWithoutPassword,"data-empty":!q.password,autoComplete:"current-password"})),(0,o.jsx)("div",{className:"floating-label__label-wrap",children:(0,o.jsx)("label",{className:"floating-label__label",htmlFor:"email",children:(0,l.__)("Password","nypost")})}),(0,o.jsx)("button",{className:"visibility-toggle",type:"button","aria-label":(0,l.__)("Show or hide your password","nypost"),onClick:y.k})]}),O?null:(0,o.jsx)("p",{className:"form-text form-text--forgot m-bottom t-left",children:(0,o.jsx)(r.N_,{to:"/account/forgot-password",children:(0,l.__)("Forgot your password?","nypost")})})]}):null,(0,o.jsx)(f.dF,{customMessage:e=>
1(0,o.jsx)(x.s,Object.assign({submittedEmail:W,onClearForm:()=>{P(null),R(!1),J.clearErrors()}},e)),errors:O?(0,v.d)(q.errors).newErrors:q.errors}),(0,o.jsx)("div",{className:"input-container",children:(0,o.jsx)("input",{className:c()({disabled:q.loading||q.loadingContinueWithoutPassword}),"data-testid":"login-submit",disabled:q.loading||q.loadingContinueWithoutPassword,type:"submit",value:X,"data-ga4-event":t?JSON.stringify({event_name:"ux_engagement",source_unit:"payflow_modal",event_action:"login",event_label:"continue_with_email"}):JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Login"})})})]}),W&&window.nypMembership.featureFlags.passwordless?(0,o.jsxs)("div",{className:"continue-without-password",children:[(0,o.jsx)("div",{className:"button-wrap-lines button-wrap-lines--divider",children:(0,o.jsx)("div",{className:"button-wrap-lines__inner t-color-black",children:(0,o.jsx)("span",{children:(0,l.__)("Or","nypost")})})}),(0,o.jsx)("button",{className:c()({"button button--continue-without-password m-bottom":!0,disabled:q.loading||q.loadingContinueWithoutPassword}),type:"button",onClick:()=>J.onContinueWithoutPassword(O).then(()=>{G((0,b.K3)()),T(O?"register":"login")}),disabled:q.loading||q.loadingContinueWithoutPassword,"data-testid":"continue-without-password",children:q.loadingContinueWithoutPassword?U:(0,l.__)("Continue without password","nypost")})]}):null]}):(0,o.jsx)("button",{className:"button button--solid m-bottom-half button--continue-with-email",onClick:()=>L(!E),type:"button","data-testid":"continue-with-email",children:(0,l.__)("Continue with Email","nypost")})}),W?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"third-party-wrapper social-login",children:[(0,o.jsx)("p",{className:"text-divider",children:"OR"}),(0,o.jsxs)("button",{className:"button button--solid button--solid--alt button--social",type:"button",onClick:J.onSocialClick("google"),disabled:"google"===q.loadingSocial,"data-ga4-event":t?JSON.stringify({event_name:"ux_engagement",source_unit:"payflow_modal",event_action:"login",event_label:"continue_with_google"}):JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Google"}),children:[(0,o.jsx)("span",{className:"icon-google"}),"google"===q.loadingSocial?U:(0,l.__)("Continue with Google","nypost")]}),(0,o.jsxs)("button",{className:"button button--solid button--solid--alt button--social",type:"button",onClick:J.onSocialClick("facebook"),disabled:"facebook"===q.loadingSocial,"data-ga4-event":t?JSON.stringify({event_name:"ux_engagement",source_unit:"payflow_modal",event_action:"login",event_label:"continue_with_facebook"}):JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Facebook"}),children:[(0,o.jsx)("span",{className:"icon-facebook"}),"facebook"===q.loadingSocial?U:(0,l.__)("Continue with Facebook","nypost")]}),(0,o.jsxs)("button",{className:"button button--solid button--solid--alt button--social",type:"button",onClick:J.onSocialClick("apple"),disabled:"apple"===q.loadingSocial,"data-ga4-event":t?JSON.stringify({event_name:"ux_engagement",source_unit:"payflow_modal",event_action:"login",event_label:"continue_with_apple"}):JSON.stringify({event_name:"ux_engagement",source_unit:"Login to your account",source_position:"Button Click: Continue with Apple"}),children:[(0,o.jsx)("span",{className:"icon-apple"}),"apple"===q.loadingSocial?U:(0,l.__)("Continue with Apple","nypost")]})]}),(0,o.jsx)(f.XN,{className:"form-text form-text--terms",html:m.p.forRegisterAccount(Y),tagName:"p"}),(0,o.jsx)("div",{className:"payflow-hero__footnote_mobile form-text form-text--terms",children:M===i&&(0,o.jsx)(o.Fragment,{children:(e=>{if(!e)return[e];e.trim();const t=/(?<=[.;:])(?=\s)/;return e.match(t)?e.split(t).filter(Boolean):[e]})(a).map((e,t)=>(0,o.jsxs)(s.Fragment,{children:[0!==t&&(0,o.jsx)("br",{}),e]},t))})}),(0,o.jsx)("hr",{}),(0,o.jsx)(f.np,{gaCategory:"Payflow - Login Page"})]})]})})};N.propTypes={referralCode:a().string,desktopHeadline:a().string,mobileHeadline:a().string,disclaimerFootnote:a().string}},7296:function(e,t,n){n.d(t,{k:function(){return o}});const o=e=>{const t=e.target;if(!t.classList.contains("visibility-toggle"))return;const n=t.closest(".input-container").querySelector("#password");n.classList.contains("toggled")?(t.classList.remove("visible"),n.classList.remove("toggled"),n.setAttribute("type","password")):(t.classList.add("visible"),n.classList.add("toggled"),n.setAttribute("type","text"))}}}]); 2//# sourceMappingURL=3973.7af8343ca25e8e16c90d.bundle.min.js.map
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.