1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86439],{86439:function(e,n,i){i.d(n,{nE:function(){return t},gv:function(){return LogInSignUp},Hr:function(){return LogInSignUpModal}});var o,t,r=i(85893),a=i(48641),s=i(18034),l=i(47741),d=i(41664),c=i.n(d),u=i(67294),m=i(16502),g=i(47503),h=i(45893),x=i(63205),v=i(64570);let EmailSentMessage=e=>(0,r.jsxs)(a.xu,{textAlign:e.center?"center":"left",maxW:"sm",children:[(0,r.jsxs)(a.X6,{size:"md",mb:"4",children:[(0,r.jsx)(v.d,{label:"mail-emoji",symbol:"âï¸",fontSize:"3xl",mb:"2"}),(0,r.jsx)("br",{}),e.headerText]}),(0,r.jsx)(a.xv,{color:"gray.600",children:e.detailText})]});var p=i(82729),j=i(50456),y=i(50319),S=i(3038),w=i(83234),b=i(20979),f=i(87536),I=i(93064);function _templateObject(){let e=(0,p._)(["\n mutation ForgotPasswordForm_RequestResetPassword($email: String!) {\n requestResetPassword(email: $email)\n }\n"]);return _templateObject=function(){return e},e}let P=(0,j.Ps)(_templateObject()),ForgotPasswordForm=e=>{var n;let[i,o]=u.useState(!1),[t,{loading:s,error:d}]=(0,y.D)(P,{onCompleted:()=>o(!0)}),{register:c,handleSubmit:m,formState:{errors:g,isValid:h,isSubmitted:x}}=(0,f.cI)({defaultValues:{email:""}}),onSubmit=async e=>{let{email:n}=e;await t({variables:{email:n}})};return i?(0,r.jsx)(EmailSentMessage,{headerText:"Great! We've sent you an email",detailText:"Check your inbox for an email to reset your password",center:e.modal}):(0,r.jsxs)(a.Kq,{as:"form",spacing:"6",noValidate:!0,onSubmit:m(onSubmit),children:[d&&(0,r.jsxs)(S.bZ,{status:"error",mb:"4",children:[(0,r.jsx)(S.zM,{}),(0,r.jsx)(S.X,{children:"Sorry, there was an error requesting a password reset."})]}),(0,r.jsxs)(a.Kq,{spacing:"4",children:[(0,r.jsx)(a.X6,{size:"md",children:"Reset your Password"}),(0,r.jsx)(a.xv,{color:"gray.600",children:"Enter your email address, and we will send you a link to reset your password."})]}),(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!g.email,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"Email"}
1),(0,r.jsx)(b.II,{autoFocus:!0,type:"email",placeholder:I.cS,...c("email",{required:"Email is required",validate:{email:e=>!e||I.rB.EmailWithTLD.test(e)||"You must enter a valid email address"}})}),(0,r.jsx)(w.J1,{children:null===(n=g.email)||void 0===n?void 0:n.message})]}),(0,r.jsx)(l.zx,{type:"submit",w:"full",mt:"4",isLoading:s,isDisabled:x&&!h,children:"Send Reset Link"}),(0,r.jsx)(l.zx,{variant:"link",colorScheme:"black",onClick:e.onClickLogIn,children:"Log in"})]})};var C=i(11163),O=i(17563),L=i(49517),_=i(16601),E=i(93710),q=i(9041);i(48521);let k=new q.CompositeDecorator([{strategy:(e,n,i)=>{e.findEntityRanges(e=>{let n=e.getEntity();return null!==n&&"LINK"===i.getEntity(n).getType()},n)},component:e=>{let{url:n}=e.contentState.getEntity(e.entityKey).getData();return(0,r.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",style:{color:"#3182ce",textDecoration:"underline"},children:e.children})}}]),LogInForm=e=>{var n,i;let o=(0,C.useRouter)(),[t,s]=u.useState(!1),[d,c]=u.useState(!1),[m,g]=u.useState(!e.ssoProvider),h="string"==typeof o.query.email?o.query.email:"",{register:x,handleSubmit:v,reset:p,formState:{errors:j,isSubmitted:y,isValid:P}}=(0,f.cI)({defaultValues:{email:h,password:""}});u.useEffect(()=>{o.isReady&&h&&p({email:h,password:""})},[h,p,o.isReady]);let onSubmit=async n=>{let{email:i,password:o}=n;e.onSubmitLogin(),s(!0),c(!1);try{await _.X1.login({user:{email:i},password:o});try{{var t,r;let e=(null===(t=window.localStorage)||void 0===t?void 0:t.getItem("Meteor.loginToken"))||(null===(r=window.localStorage)||void 0===r?void 0:r.getItem("meteor_login_token"));e&&E.qj.setItem(E.kN,e)}}catch(e){}e.onLoginOutcome("tw-login-success"),window.location.reload()}catch(n){s(!1),(0,L.H)(n),e.onLoginOutcome("User not found [403]"===n.message?"tw-login-error-wrong-email":"tw-login-error-wrong-pw"),c(!0)}};return(0,r.jsxs)(a.Kq,{as:"form",spacing:"6",noValidate:!0,onSubmit:v(onSubmit),children:[(0,r.jsx)(a.X6,{size:"md",children:"Sign in to your Account"}),!!d&&(0,r.jsxs)(S.bZ,{status:"error",children:[(0,r.jsx)(S.zM,{}),e.ssoProvider?(0,r.jsxs)(S.X,{children:["There was a problem logging into this account. If you already have a membership with ",e.acronym||"the association",", try the"," ",e.acronym||"association"," login method. Otherwise, try a different username or password."]}):(0,r.jsx)(S.X,{children:"There was a problem logging into this account. Try a different username or password."})]}),!!e.header&&(0,r.jsx)(a.xv,{align:"center",color:"gray.500",children:e.header}),!!e.ssoProvider&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.zx,{w:"full",height:"auto",whiteSpace:"normal",py:"2.5",type:"button",onClick:()=>{e.onClickSSO(),o.push("/v1/sso?".concat(O.stringify({redirect:o.asPath})))},children:["Login with your Existing"," ",e.acronym?e.acronym:"Association"," Account"]}),(0,r.jsxs)(a.Kq,{direction:"row",alignItems:"center",children:[(0,r.jsx)(a.iz,{borderColor:"gray.100"}),(0,r.jsx)(a.xv,{textStyle:"compactStrong",color:"gray.500",children:"OR"}),(0,r.jsx)(a.iz,{borderColor:"gray.100"})]})]}),m?(0,r.jsxs)(a.Kq,{spacing:"6",mb:"6",children:[(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!j.email,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"Email"}
1),(0,r.jsx)(b.II,{autoFocus:!0,type:"email",placeholder:I.cS,...x("email",{required:"Email is required",validate:{email:e=>!e||I.rB.EmailWithTLD.test(e)||"You must enter a valid email address"}})}),(0,r.jsx)(w.J1,{children:null===(n=j.email)||void 0===n?void 0:n.message})]}),(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!j.password,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"Password"}),(0,r.jsx)(b.II,{type:"password",placeholder:I.Nw,...x("password",{required:"Password is required"}),autoComplete:"current-password"}),(0,r.jsx)(w.J1,{children:null===(i=j.password)||void 0===i?void 0:i.message})]}),(0,r.jsxs)(a.Kq,{children:[(0,r.jsx)(l.zx,{type:"submit",w:"full",isLoading:t,variant:e.ssoProvider?"outline":"solid",isDisabled:y&&!P,borderColor:"primary.500",children:"Sign In"}),(0,r.jsx)(a.xu,{color:"gray.600",children:(0,r.jsx)(l.zx,{variant:"link",colorScheme:"black",onClick:e.onClickResetPassword,children:"Forgot your Password?"})})]})]}):(0,r.jsx)(l.zx,{variant:"link",colorScheme:"black",fontWeight:"normal",onClick:()=>g(!0),children:"Sign in with your Tradewing Account"}),e.loginContactMessage&&(0,r.jsx)(a.xu,{fontSize:"sm",color:"gray.600",textAlign:"center",width:"100%",mt:4,mx:"auto",children:(()=>{try{let n=JSON.parse(e.loginContactMessage),i=(0,q.convertFromRaw)(n),o=q.EditorState.createWithContent(i,k);return(0,r.jsx)(a.xu,{sx:{".DraftEditor-root":{minHeight:"auto",textAlign:"center"},".public-DraftEditor-content":{minHeight:"auto",display:"inline-block",whiteSpace:"pre-wrap",width:"100%",justifyContent:"center"}},children:(0,r.jsx)(q.Editor,{editorState:o,onChange:()=>{},readOnly:!0,textAlignment:"center"})})}catch(n){return console.error("Error rendering rich text:",n),(0,r.jsx)(a.xv,{textAlign:"center",children:e.loginContactMessage})}})()})]})};function SignUpForm_templateObject(){let e=(0,p._)(["\n mutation signUpForm_signUpProspectUser($input: SignUpProspectUserInput!) {\n signUpProspectUser(data: $input) {\n data {\n _id\n firstName\n lastName\n email\n }\n }\n }\n"]);return SignUpForm_templateObject=function(){return e},e}let F=(0,j.Ps)(SignUpForm_templateObject()),SignUpForm=e=>{var n,i,o;let t=(0,C.useRouter)(),[s,d]=(0,y.D)(F),{register:c,handleSubmit:m,formState:{errors:g,isSubmitted:h,isValid:x},reset:v}=(0,f.cI)({defaultValues:{firstName:"",lastName:"",email:""}}),p=u.useMemo(()=>{if(t.isReady){var e,n;return null!==(n=null===(e=t.query.redirect)||void 0===e?void 0:e.toString())&&void 0!==n?n:t.asPath}},[t]),onSubmit=async n=>{let{firstName:i,lastName:o,email:t}=n;try{await s({variables:{input:{firstName:i,lastName:o,email:t,redirect:p}}}),e.onSubmit(),v()}catch(e){(0,L.H)(e)}};return(0,r.jsxs)(r.Fragment,{children:[d.error&&(0,r.jsxs)(S.bZ,{status:"error",mb:"4",children:[(0,r.jsx)(S.zM,{}),(0,r.jsx)(S.X,{children:d.error.message.includes("An account with that email already exists.")?"An account with that email already exists. Please log in.":"There was an error with your submission. Please try again later."})]}),!!e.header&&(0,r.jsx)(a.xv,{align:"center",color:"gray.500",mb:"8",children:e.header}),(0,r.jsxs)(a.Kq,{as:"form",spacing:"6",noValidate:!0,onSubmit:m(onSubmit),children:[(0,r.jsx)(a.X6,{size:"md",children:"Create an Account"}),(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!g.firstName,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"First Name"}),(0,r.jsx)(b.II,{autoFocus:!0,placeholder:"First name",autoComplete:"given-name",...c("firstName",{required:"First name is required"})}),(0,r.jsx)(w.J1,{children:null===(n=g.firstName)||void 0===n?void 0:n.message})]}),(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!g.lastName,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"Last Name"}),(0,r.jsx)(b.II,{placeholder:"Last name",autoComplete:"family-name",...c("lastName",{required:"Last name is required"})}),(0,r.jsx)(w.J1,{children:null===(i=g.lastName)||void 0===i?void 0:i.message})]}),(0,r.jsxs)(w.NI,{isRequired:!0,isInvalid:!!g.email,children:[(0,r.jsx)(w.lX,{requiredIndicator:(0,r.jsx)(r.Fragment,{}),children:"Email"}
1),(0,r.jsx)(b.II,{type:"email",placeholder:I.cS,autoComplete:"email",...c("email",{required:"Email is required",validate:{email:e=>!e||I.rB.EmailWithTLD.test(e)||"You must enter a valid email address"}})}),(0,r.jsx)(w.J1,{children:null===(o=g.email)||void 0===o?void 0:o.message})]}),(0,r.jsx)(l.zx,{w:"full",isLoading:d.loading,isDisabled:h&&!x,type:"submit",children:"Sign up"})]})]})};(o=t||(t={}))[o.LOGIN_FORM=0]="LOGIN_FORM",o[o.SIGNUP_FORM=1]="SIGNUP_FORM";let LogInSignUp=e=>{var n,i,o,t,d,v,p,j,y,S;let[w,b]=u.useState(!1),[f,I]=u.useState(!1),{isActive:P}=(0,x.U)(),C=(0,h.x)(),O=(null===(n=C.tenant)||void 0===n?void 0:n.accountCreationPermission)===g.YQ.ANYONE,L=(null===(i=C.tenant)||void 0===i?void 0:i.communityAccessConfig)===g.iX.PUBLIC;u.useEffect(()=>{(0,m.d1)({view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider,signupEnabled:O,isPublic:L})},[e.modal,O,e.ssoProvider,L]);let onClickResetPassword=()=>{(0,m.nr)({view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider,signupEnabled:O}),b(!0)},onSubmitLogin=()=>{(0,m.yx)({view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider,signupEnabled:O})},onClickSSO=()=>{(0,m.mh)({ssoProvider:e.ssoProvider||"none",view:e.modal?"modal":"wall",signupEnabled:O})},onLoginOutcome=n=>{(0,m.DQ)({outcome:n,view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider,signupEnabled:O}),n.includes("error")&&(0,m.Q_)({entity_type:"login",entity_id:n,login_outcome:n,view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider,page_type:"membership",page_section:"churn_signal"})},_=(null===(o=e.conferenceOptions)||void 0===o?void 0:o.useConferenceHeaders)?"Log in to ".concat(null===(t=C.tenant)||void 0===t?void 0:t.displayName," to complete your registration for the ").concat(e.conferenceOptions.name,"."):void 0,E=(null===(d=e.conferenceOptions)||void 0===d?void 0:d.useConferenceHeaders)?"Create a new account in ".concat(null===(v=C.tenant)||void 0===v?void 0:v.displayName," to complete your registration for the ").concat(e.conferenceOptions.name,"."):void 0;return f?(0,r.jsx)(EmailSentMessage,{headerText:"We sent you a verification email!",detailText:"Check your email and click the verification link to finish creating your account.",center:e.modal}):w?(0,r.jsx)(ForgotPasswordForm,{onClickLogIn:()=>b(!1),modal:e.modal}):O?(0,r.jsxs)(a.Kq,{spacing:"6",w:"full",children:[(0,r.jsxs)(s.mQ,{defaultIndex:e.initialPromptState,variant:"solid-rounded",align:e.modal?"center":void 0,children:[(0,r.jsxs)(s.td,{mb:"8",children:[(0,r.jsx)(s.OK,{children:"Sign in"}),(0,r.jsx)(s.OK,{children:"Sign up"})]}),(0,r.jsxs)(s.nP,{children:[(0,r.jsx)(s.x4,{children:(0,r.jsx)(LogInForm,{acronym:(null===(p=C.tenant)||void 0===p?void 0:p.acronym)||void 0,onClickResetPassword:onClickResetPassword,header:_,ssoProvider:e.ssoProvider,onSubmitLogin:onSubmitLogin,onLoginOutcome:onLoginOutcome,onClickSSO:onClickSSO,loginContactMessage:(null===(j=C.tenant)||void 0===j?void 0:j.loginContactMessage)||void 0})}),(0,r.jsx)(s.x4,{children:(0,r.jsx)(SignUpForm,{header:E,onSubmit:()=>{I(!0),(0,m.a4)({view:e.modal?"modal":"wall",ssoEnabled:!!e.ssoProvider})}})})]})]}),P&&(0,r.jsx)(c(),{href:"/memberships",children:(0,r.jsx)(l.zx,{w:"full",display:["inherit","none"],variant:"outline",colorScheme:"gray",children:"Explore Memberships"})})]}):(0,r.jsx)(LogInForm,{acronym:(null===(y=C.tenant)||void 0===y?void 0:y.acronym)||void 0,onClickResetPassword:onClickResetPassword,header:_,ssoProvider:e.ssoProvider,onSubmitLogin:onSubmitLogin,onLoginOutcome:onLoginOutcome,onClickSSO:onClickSSO,loginContactMessage:(null===(S=C.tenant)||void 0===S?void 0:S.loginContactMessage)||void 0})};LogInSignUp.defaultProps={initialPromptState:t.LOGIN_FORM};var N=i(2821),R=i(23887),M=i(97467),U=i(70421);function LogInSignUpModal_templateObject(){let e=(0,p._)(["\n query PromptSignUpModal_CurrentUser($imageInput: DynamicImageInput!) {\n currentUser {\n _id\n }\n tenant {\n result {\n _id\n logo {\n _id\n imageProxy(input: $imageInput)\n }\n accountCreationPermission\n displayName\n }\n }\n }\n"]);
1return LogInSignUpModal_templateObject=function(){return e},e}let z=(0,j.Ps)(LogInSignUpModal_templateObject()),LogInSignUpModal=e=>{var n,i,o,a,s,l;let{isOpen:d,onClose:c,initialPromptState:u,conference:m}=e,{ssoMetadata:h,loading:x}=(0,M.d)(),{data:v,loading:p}=(0,U.L)(z,{variables:{imageInput:{h:160}}}),j=null==v?void 0:null===(n=v.currentUser)||void 0===n?void 0:n._id;if(x||p||!v||j)return null;let y=(null==v?void 0:null===(o=v.tenant)||void 0===o?void 0:null===(i=o.result)||void 0===i?void 0:i.accountCreationPermission)===g.YQ.ANYONE,S=y&&u?u:t.LOGIN_FORM,w=null===(a=v.tenant)||void 0===a?void 0:a.result;return(0,r.jsxs)(N.u_,{isOpen:d,onClose:c,children:[(0,r.jsx)(N.ZA,{}),(0,r.jsxs)(N.hz,{children:[(0,r.jsx)(N.ol,{}),(0,r.jsx)(N.xB,{p:"6",children:(null==w?void 0:null===(s=w.logo)||void 0===s?void 0:s.imageProxy)&&(0,r.jsx)(R.Ee,{maxH:"10",maxW:"36",h:"full",w:"auto",mx:"auto",borderRadius:"base",src:null==w?void 0:null===(l=w.logo)||void 0===l?void 0:l.imageProxy,alt:"tenant logo"})}),(0,r.jsx)(N.fe,{p:"6",children:(0,r.jsx)(LogInSignUp,{initialPromptState:S,modal:!0,ssoProvider:h.ssoProvider,conferenceOptions:m})})]})]})}},97467:function(e,n,i){i.d(n,{d:function(){return useSSOProvider}});var o=i(82729),t=i(50456),r=i(70421);function _templateObject(){let e=(0,o._)(["\n query useSSOProvider_tenantQuery {\n tenant {\n result {\n _id\n ssoMetadata {\n ssoProvider\n }\n }\n }\n }\n"]);return _templateObject=function(){return e},e}let a=(0,t.Ps)(_templateObject()),useSSOProvider=()=>{var e,n,i;let{data:o,loading:t,error:s}=(0,r.L)(a),l=null==o?void 0:null===(i=o.tenant)||void 0===i?void 0:null===(n=i.result)||void 0===n?void 0:null===(e=n.ssoMetadata)||void 0===e?void 0:e.ssoProvider;return{ssoMetadata:{ssoProvider:l},loading:t,error:s}}}}]); 2//# sourceMappingURL=86439-5c91678837cd227a.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.