const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./WebSystemOutageMessaging-aSWPpFVO.mjs","./D3HgFK3r.js","./entry.DPTkjbUQ.css","./WebSystemOutageMessaging.Cd-9fIgR.css"])))=>i.map(i=>d[i]); import{_ as R,b as f,c as l,o as n,J as M,d as u,v as g,a as o,p as d,l as c,t as V,bX as B,N as I,bY as q,O as C,q as p,aa as F,cf as O,b6 as W,M as z,z as A,bx as m,i as h,ak as x,bS as J,u as K,f as H,cd as Y,L as X}from"./D3HgFK3r.js";const $=M(()=>X(()=>import("./WebSystemOutageMessaging-aSWPpFVO.mjs"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.default||e)),G={props:{},async setup(){const{$gql:e}=K(),{trackRegistration:s}=H(),i=await e.query("getReCAPTCHAPublicKey");return{tenantRecaptchaPublicKey:i==null?void 0:i.data,trackRegistration:s,RegistrationTrigger:Y}},data(){return{mode:"login",siteUser:null,loginValues:{username:"",password:""},resetPasswordValues:{email:""},error:null,showErrors:!1,loginErrors:{},resetPasswordErrors:{},processing:!1,qualifyingMembership:!1,message:null,recaptcha:null}},computed:{returnedFromSSO(){var e,s;return(s=(e=h())==null?void 0:e.query)==null?void 0:s.siteUserToken},submitDisabled(){var e,s;return this.mode==="login"&&(!((e=this.loginValues)!=null&&e.username)||!((s=this.loginValues)!=null&&s.password))||this.mode==="reset-password"&&!this.resetPasswordValues.email},loginFieldInfo(){return{rows:[{fields:{username:{type:"email_input",label:"Email",placeholder:"Enter Email",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0},password:{type:"password",label:"Password",placeholder:"Enter Password",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0}}}]}},resetPasswordFieldInfo(){return{rows:[{fields:{email:{type:"email_input",label:"Email",placeholder:"Enter Email",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0}}}]}}},async mounted(){const{query:e,hash:s}=h();this.siteUser=m.getUserInfo(),m.isLoggedIn()&&(window.location=(e==null?void 0:e.redirectTo)===""||(e==null?void 0:e.redirectTo)===void 0?"/account":`${e==null?void 0:e.redirectTo}${s}`),this.recaptcha=J(this.tenantRecaptchaPublicKey),e.email&&(this.loginValues.username=e.email),e.mode==="resetPassword"&&this.setMode("reset-password")},methods:{register(){return m.getRegistrationLink()},setMode(e){this.mode=e,e==="reset-password"?this.resetPasswordValues.email=this.loginValues.username:e==="login"&&(this.loginValues.username=this.resetPasswordValues.email)},update(e,s,i){this.mode==="login"?(this.loginValues[e]=s,this.loginErrors[e]={errorObj:i}):(this.resetPasswordValues[e]=s,this.resetPasswordErrors[e]={errorObj:i})},submitForm(){this.showErrors=x(this.mode==="login"?this.loginErrors:this.resetPasswordErrors??{})>0},async handleSubmit(){try{this.error="",this.processing=!0;let e=null;if(this.mode==="login"){const s=await this.recaptcha("siteUserLogin");if(e=await m.login(this.loginValues.username,this.loginValues.password,s),e!=null&&e.error)throw new Error(e.message)}if(this.mode==="reset-password"){const s=await this.recaptcha("siteUserResetPassword");e=await m.requestPasswordReset(this.resetPasswordValues.email,h().path,s),this.message=`You will receive an email momentarily if the account exists. Check your spam folder if you don’t see the email. Contact customerservice@${this.$ss.general.rootDomain} for further assistance.`}this.processing=!1}catch(e){this.error=e,this.processing=!1}}}},Q={key:0},Z={key:1},j={key:0,class:"preface"},ee={class:"submit"},se={class:"links"};function re(e,s,i,w,r,t){var _,b;const S=$,L=q,N=O,T=W,D=B,U=z;return(_=e.$ss.systemOutage)!=null&&_.disableOmeda?(n(),f(S,{key:0})):(n(),l("div",{key:1,ref:"loginForm",class:A(["login-form",e.$ss.useNewDesign?"new-design":""]),style:d({fontFamily:e.$ss.primaryFontFamily,backgroundColor:(b=e.$ss)!=null&&b.useNewDesign?"":"#ffffff"})},[u(U,null,{default:g(()=>{var y,k,v;return[o("h1",{class:"title",style:d({fontFamily:e.$ss.primaryFontFamily,color:(y=e.$ss)!=null&&y.useNewDesign?"var(--color-black)":e.$ss.baseStyles.primaryColor,marginBottom:(k=e.$ss)!=null&&k.useNewDesign?"0":"15px"})},[r.mode==="login"?(n(),l("span",Q,"Login to "+V(e.$ss.general.siteName),1)):c("",!0),r.mode==="reset-password"?(n(),l("span",Z,"Reset Password")):c("",!0)],4),o("div",{class:"form-content",style:d({backgroundColor:(v=e.$ss)!=null&&v.useNewDesign?"var(--color-secondary-container)":"#ffffff"})},[u(D,{error:r.error,processing:r.processing,padding:"0",message:r.message,"qualifying-membership":r.qualifyingMembership},{default:g(()=>{var E,P;return[o("form",{class:"form",onSubmit:s[3]||(s[3]=I((...a)=>t.handleSubmit&&t.handleSubmit(...a),["prevent"]))},[r.mode==="login"&&e.$ss.memberships.siteLoginPageText?(n(),l("div",j,[o("p",null,V(e.$ss.memberships.siteLoginPageText),1)])):c("",!0),r.mode==="reset-password"?(n(),l("div",{key:1,class:"preface",style:d({backgroundColor:(E=e.$ss)!=null&&E.useNewDesign?"":"#f0f0f0"})}," Please enter your email address below to reset your password. ",4)):c("",!0),(n(),f(L,{key:r.mode,"field-info":r.mode==="login"?t.loginFieldInfo:t.resetPasswordFieldInfo,"field-values":r.mode==="login"?r.loginValues:r.resetPasswordValues,onUpdate:t.update},null,8,["field-info","field-values","onUpdate"])),o("div",ee,[o("div",se,[C(o("a",{onClick:s[0]||(s[0]=a=>t.setMode("reset-password"))},"Reset Password",512),[[F,r.mode==="login"]]),C(o("a",{onClick:s[1]||(s[1]=a=>t.setMode("login"))},"Return to Login",512),[[F,r.mode==="reset-password"]]),s[4]||(s[4]=p(" | ")),u(N,{event:()=>w.trackRegistration({trigger:w.RegistrationTrigger.ClickLoginFormJoinLink})},{default:g(()=>[o("a",{class:"register",onClick:s[2]||(s[2]=(...a)=>t.register&&t.register(...a))},"Join")]),_:1},8,["event"])]),u(T,{label:r.mode==="login"?"Login":"Reset",disabled:t.submitDisabled,type:"submit",onOnClick:t.submitForm},null,8,["label","disabled","onOnClick"])])],32),o("div",{class:"consent",style:d({backgroundColor:(P=e.$ss)!=null&&P.useNewDesign?"":"#f0f0f0"})},s[5]||(s[5]=[p(" By creating an account, you are agreeing to Endeavor Business Media's "),o("a",{href:"https://www.endeavorbusinessmedia.com/endeavor-terms",target:"_blank",rel:"noopener"},"Terms of Service",-1),p(" and "),o("a",{href:"https://www.endeavorbusinessmedia.com/privacy-policy",target:"_blank",rel:"noopener"},"Privacy Policy",-1)]),4)]}),_:1},8,["error","processing","message","qualifying-membership"])],4)]}),_:1})],6))}const oe=R(G,[["render",re],["__scopeId","data-v-d961c4a4"]]),te={};function ie(e,s){const i=oe;return n(),f(i)}const ae=R(te,[["render",ie]]);export{ae as default};