const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./WebSystemOutageMessaging-BgrN7nU6.mjs","./CmnEfQIC.js","./entry.Czs9t7YV.css","./WebSystemOutageMessaging.Cd-9fIgR.css"])))=>i.map(i=>d[i]);
import{_ as C,u as T,h as c,by as l,bT as U,ak as M,o as i,b as h,c as d,d as g,s as v,a as o,p as m,t as E,l as u,M as B,N as V,aa as F,q as p,y as I,bY as q,b8 as O,bZ as W,Q as A,K as z,L as K}from"./CmnEfQIC.js";const x=z(()=>K(()=>import("./WebSystemOutageMessaging-BgrN7nU6.mjs"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.default||e)),H={props:{},async setup(){const{$gql:e}=T(),s=await e.query("getReCAPTCHAPublicKey");return{tenantRecaptchaPublicKey:s==null?void 0:s.data}},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=c())==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}=c();this.siteUser=l.getUserInfo(),l.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=U(this.tenantRecaptchaPublicKey),e.email&&(this.loginValues.username=e.email),e.mode==="resetPassword"&&this.setMode("reset-password")},methods:{register(){return l.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,n){this.mode==="login"?(this.loginValues[e]=s,this.loginErrors[e]={errorObj:n}):(this.resetPasswordValues[e]=s,this.resetPasswordErrors[e]={errorObj:n})},submitForm(){this.showErrors=M(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 l.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 l.requestPasswordReset(this.resetPasswordValues.email,c().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 <a href="mailto:customerservice@${this.$ss.general.rootDomain}">customerservice@${this.$ss.general.rootDomain}</a> for further assistance.`}this.processing=!1}catch(e){this.error=e,this.processing=!1}}}},Y={key:0},$={key:1},J={key:0,class:"preface"},Q={class:"submit"},Z={class:"links"};function G(e,s,n,se,r,t){var f,w;const N=x,S=q,D=O,L=W,R=A;return(f=e.$ss.systemOutage)!=null&&f.disableOmeda?(i(),h(N,{key:0})):(i(),d("div",{key:1,ref:"loginForm",class:I(["login-form",e.$ss.useNewDesign?"new-design":""]),style:m({fontFamily:e.$ss.primaryFontFamily,backgroundColor:(w=e.$ss)!=null&&w.useNewDesign?"":"#ffffff"})},[g(R,null,{default:v(()=>{var y,b,_;return[o("h1",{class:"title",style:m({fontFamily:e.$ss.primaryFontFamily,color:(y=e.$ss)!=null&&y.useNewDesign?"var(--color-black)":e.$ss.baseStyles.primaryColor,marginBottom:(b=e.$ss)!=null&&b.useNewDesign?"0":"15px"})},[r.mode==="login"?(i(),d("span",Y,"Login to "+E(e.$ss.general.siteName),1)):u("",!0),r.mode==="reset-password"?(i(),d("span",$,"Reset Password")):u("",!0)],4),o("div",{class:"form-content",style:m({backgroundColor:(_=e.$ss)!=null&&_.useNewDesign?"var(--color-secondary-container)":"#ffffff"})},[g(L,{error:r.error,processing:r.processing,padding:"0",message:r.message,"qualifying-membership":r.qualifyingMembership},{default:v(()=>{var k,P;return[o("form",{class:"form",onSubmit:s[3]||(s[3]=B((...a)=>t.handleSubmit&&t.handleSubmit(...a),["prevent"]))},[r.mode==="login"&&e.$ss.memberships.siteLoginPageText?(i(),d("div",J,[o("p",null,E(e.$ss.memberships.siteLoginPageText),1)])):u("",!0),r.mode==="reset-password"?(i(),d("div",{key:1,class:"preface",style:m({backgroundColor:(k=e.$ss)!=null&&k.useNewDesign?"":"#f0f0f0"})}," Please enter your email address below to reset your password. ",4)):u("",!0),(i(),h(S,{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",Q,[o("div",Z,[V(o("a",{onClick:s[0]||(s[0]=a=>t.setMode("reset-password"))},"Reset Password",512),[[F,r.mode==="login"]]),V(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(" | ")),o("a",{class:"register",onClick:s[2]||(s[2]=(...a)=>t.register&&t.register(...a))},"Join")]),g(D,{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:m({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 X=C(H,[["render",G],["__scopeId","data-v-2fa9d5a0"]]),j={};function ee(e,s){const n=X;return i(),h(n)}const oe=C(j,[["render",ee]]);export{oe as default};