import{M as _}from"./ModalMixin-f1c0fe4e.js";import{F as p}from"./Button-067cc918.js";import{_ as f,r as c,o as i,e as h,w as n,c as x,a as e,t as v,k as r,q as g,u as C,g as b,j as k,d as y,f as w}from"./app-9daf7b25.js";const M={props:{league:Object,domain_color:String},components:{FormButton:p},data(){return{accessCode:null,validationErrors:!1,processing:!1}},mixins:[_],methods:{validateAccess(a){this.validationErrors=!1,a?(this.processing=!0,axios.post("/register/apply-access-code/"+this.league.id,{access_code:this.accessCode}).then(s=>{s.data.error?(this.processing=!1,this.validationErrors=!0):(this.closeModal(),this.$emit("code",this.accessCode))})):this.validationErrors=!0}}},A={key:0},E=e("h1",{class:"text-3xl text-center font-bold uppercase mb-8 font-bebe"},"Private League Access Code",-1),B={class:"mb-8 text-gray text-sm"},V={class:"w-full sm_flex-1 mb-2 px-2"},N=e("label",{class:"label"},"Private League Access Code",-1),T={class:"block text-red text-xs font-bold rounded my-1"};function j(a,s,t,S,o,l){const d=c("form-button"),m=c("modal");return i(),h(m,{ref:"modal",clickToClose:!1,escToClose:!0},{default:n(()=>[t.league?(i(),x("div",A,[E,e("p",B,v(t.league.name)+" is invitation-only and requires an access code to join. If you have an access code, enter it below.",1),e("div",V,[N,r(e("input",{type:"text",class:"input","onUpdate:modelValue":s[0]||(s[0]=u=>o.accessCode=u)},null,512),[[g,o.accessCode]]),r(e("span",T,"Invalid Code.",512),[[C,o.validationErrors]])]),b(d,{onClick:k(l.validateAccess,["prevent"]),domain_color:t.domain_color,processing:o.processing},{default:n(()=>[y("Continue")]),_:1},8,["onClick","domain_color","processing"])])):w("",!0)]),_:1},512)}const I=f(M,[["render",j]]);export{I as A};