import{_ as m,B as _,aY as r,o as t,c as n,a as o,n as c,d as l,w as g,i,t as h,aZ as y,p as f,m as b}from"./entry.DPwc-EV0.js";import{_ as w}from"./WebFormWrapper-Dq_9vKBT.mjs";const S={props:{},data(){return{error:null,processing:!0,successMessage:null}},computed:{},async mounted(){this.id=_().path.split("/").pop();const e=await r.updateUsername(this.id);e.error&&(this.error=e.message,this.processing=!1),this.successMessage=e.data.message,this.processing=!1,setTimeout(async()=>{await r.logout(),window.location="/account/login"},3e3)},methods:{async handleSubmit(){this.processing=!0,this.error=null;try{await r.logout(),window.location="/account/login"}catch(e){this.error=`Unable to logout: ${e.message}`}}}},a=e=>(f("data-v-f9d2084b"),e=e(),b(),e),v=a(()=>o("div",null,"Change Email",-1)),C=[v],k={key:0,class:"updating"},B={key:1},U={class:"success"},E=a(()=>o("p",null,"You will be automatically logged out.",-1)),F=a(()=>o("p",null,"Please login with your new email address to continue.",-1)),I={key:2,class:"submit"};function W(e,x,M,N,s,p){const u=y,d=w;return t(),n("div",{class:"change-email-confirmation",style:c({fontFamily:e.$ss.primaryFontFamily})},[o("h1",{class:"title",style:c({color:e.$ss.baseStyles.primaryColor})},C,4),l(d,{error:s.error,processing:s.processing,"include-frame":!1},{default:g(()=>[s.processing?(t(),n("div",k,"Updating...please wait.")):i("",!0),!s.error&&!s.processing?(t(),n("div",B,[o("div",U,h(s.successMessage),1),E,F])):i("",!0),s.error?(t(),n("div",I,[l(u,{color:e.$ss.baseStyles.primaryColor,label:"Go to Login",type:"submit",disabled:s.processing,onOnClick:p.handleSubmit},null,8,["color","disabled","onOnClick"])])):i("",!0)]),_:1},8,["error","processing"])],4)}const Y=m(S,[["render",W],["__scopeId","data-v-f9d2084b"]]);export{Y as default};