1import{n as k,r as T,m as V,a as y,u as A}from"./index-0aEu82wc.js";import{_ as c,c as m,a as s,b as r,w as l,n as v,r as a,o as d,f,e as C}from"./index-C16zOxzO.js";const L={name:"TurfAccount",setup(){return{v$:A()}},data:function(){return{valid_turfaccount:!0,netid:null,pin:null,conditions:!1,has_turf_account:!1,status_message:"",error:!1}},validations(){return{pin:{required:T,minLength:y(4),maxLength:V(4),numeric:k},conditions:{checked:n=>n===!0}}},mounted(){this.$store.dispatch("GET_USERINFO"),this.$store.dispatch("GET_TURFACCOUNT"),this.$store.watch(()=>this.$store.state.turf.turfaccount,async()=>{const n=this.$store.state.turf.turfaccount;this.netid=n?.netid,this.has_turf_account=n?.has_turf_account})},computed:{isLoggedIn(){return this.$store.getters.isLoggedIn},info(){return this.$store.state.userinformation.information},turfaccount(){return this.$store.state.turf.turfaccount},pinError(){const n=[];return this.v$.pin.$dirty&&(this.v$.pin.required.$invalid&&n.push("Pincode is required"),this.v$.pin.minLength.$invalid&&n.push("Pincode must be 4 digits"),this.v$.pin.maxLength.$invalid&&n.push("Pincode must be 4 digits"),this.v$.pin.numeric.$invalid&&n.push("Pincode must be numeric")),n},conditionsError(){const n=[];return this.v$.conditions.$dirty&&this.v$.conditions.checked.$invalid&&n.push("You must accept the turf conditions"),n}},methods:{clear_status(){this.status_message="",this.error=!1},submitAccount:function(){this.v$.$touch(),this.v$.$invalid?this.submitStatus="ERROR":this.$vvtpApi.post("/turf/turfaccount/",{netid:this.netid.toLowerCase(),pincode:this.pin}).then(n=>{this.error=!1,this.status_message=n.data.data.message,this.$store.dispatch("GET_TURFACCOUNT")}).catch(n=>{this.error=!0,n.response&&n.response.data&&n.response.data.error?this.status_message=n.response.data.error.message:this.status_message="An unknown error occurred."})}}},E={class:"main-content"},N={class:"component-box"},U={key:0,class:"form-container"},w={key:1,class:"form-container"},I={key:2,class:"form-container"},B={class:"modal-content"},R=["innerHTML"];function q(n,t,$,i,g,o){const u=a("v-btn"),p=a("v-text-field"),b=a("v-checkbox"),h=a("v-form");return d(),m("div",E,[s("div",N,[t[31]||(t[31]=s("div",{class:"component-box-title-left"},[s("div",null,"Title")],-1)),o.isLoggedIn?n.has_turf_account?(d(),m("div",w,[t[16]||(t[16]=s("h3",null," Account exists ",-1)),t[17]||(t[17]=s("p",null," You already have a turf account, you feutneus. ",-1)),t[18]||(t[18]=s("p",null," If you forgot your pincode, please contact the board. ",-1)),t[19]||(t[19]=s("br",null,null,-1)),t[20]||(t[20]=s("br",null,null,-1)),r(u,{color:"primary",onClick:t[0]||(t[0]=e=>n.$router.push("/turf"))},{default:l(()=>[...t[14]||(t[14]=[f("Go to Turf",-1)])]),_:1}),r(u,{color:"primary",onClick:t[1]||(t[1]=e=>n.$router.push("/Me"))},{default:l(()=>[...t[15]||(t[15]=[f("Back to the Me page",-1)])]),_:1}),t[21]||(t[21]=s("br",null,null,-1)),t[22]||(t[22]=s("br",null,null,-1))])):(d(),m("div",I,[t[25]||(t[25]=s("h3",null," Create your turf account ",-1)),t[26]||(t[26]=s("p",null," Never be without snacks or gezelligheid ",-1)),t[27]||(t[27]=s("br",null,null,-1)),t[28]||(t[28]=s("br",null,null,-1)),r(h,{modelValue:n.valid_turfaccount,"onUpdate:modelValue":t[10]||(t[10]=e=>
1n.valid_turfaccount=e),"lazy-validation":""},{default:l(()=>[r(p,{modelValue:n.netid,"onUpdate:modelValue":t[2]||(t[2]=e=>n.netid=e),label:"Netid*",disabled:""},null,8,["modelValue"]),r(p,{modelValue:n.pin,"onUpdate:modelValue":t[3]||(t[3]=e=>n.pin=e),label:"Pincode*",type:"password",required:"","error-messages":o.pinError,onInput:t[4]||(t[4]=e=>i.v$.pin.$touch()),onBlur:t[5]||(t[5]=e=>i.v$.pin.$touch())},null,8,["modelValue","error-messages"]),r(b,{modelValue:n.conditions,"onUpdate:modelValue":[t[6]||(t[6]=e=>n.conditions=e),t[7]||(t[7]=e=>i.v$.conditions.$touch())],required:"","error-messages":o.conditionsError,onBlur:t[8]||(t[8]=e=>i.v$.conditions.$touch())},{label:l(()=>[...t[23]||(t[23]=[s("span",null,[f("(*) I accept the turf conditions "),s("br")],-1)])]),_:1},8,["modelValue","error-messages"]),r(u,{color:"primary",onClick:t[9]||(t[9]=e=>o.submitAccount()),disabled:i.v$.$invalid},{default:l(()=>[...t[24]||(t[24]=[f(" Make Turf Account ",-1)])]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),t[29]||(t[29]=s("br",null,null,-1)),t[30]||(t[30]=s("br",null,null,-1))])):(d(),m("div",U,[...t[13]||(t[13]=[s("h3",null," Not logged in ",-1),s("p",null," You must be logged in to create a turf account. ",-1)])]))]),s("div",{class:v(["modal",{"is-active":n.status_message!==""}])},[s("div",{class:"modal-background",onClick:t[11]||(t[11]=e=>o.clear_status())}),s("div",B,[s("div",{class:v(["notification is-success",{"is-success":!n.error,"is-danger":n.error}])},[s("button",{class:"delete",onClick:t[12]||(t[12]=e=>o.clear_status())}),s("div",{innerHTML:n.status_message},null,8,R)],2)])],2)])}const M=c(L,[["render",q],["__scopeId","data-v-505600bb"]]),P={name:"TurfAccountView",components:{TurfAccount:M}};function G(n,t,$,i,g,o){const u=a("TurfAccount",!0);return d(),C(u)}const F=c(P,[["render",G]]);export{F as default};
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.