PageSourceSearch

https://axethrowing.org/assets/siteAddVenue-DcJ65Vub.js

js axethrowing.org collected 2026-09-24 11:39:04 UTC 14,766 bytes, 1 lines download raw bytes

1import{_ as e,al as t,m as a,n as o,t as n,e as s,q as i,f as l,r,C as d,a0 as u,F as c,v as m,y as p,x as h,$ as v,z as y,ad as g,E as f,G as b,W as x,Q as V,R as P,S as C,h as k,N as E,a2 as w,M as U,bJ as X,b4 as _,b5 as W,b6 as S,g as I}from"./index-Ce7SucYs.js";import{C as M}from"./customInput-D9eG0Iee.js";import{t as q}from"./tz-Cmg6Vs-R.js";import{c as A}from"./createPlayer-_kIUfCu0.js";import{s as O}from"./setCustomClaims-CJhtbm3S.js";const z={class:"phone-container"},F={label:"Other countries"},j=["data-countryCode","value"],Y=["value"],K={key:1,class:"text-center pa-5"},R={key:2,class:"text-center pa-5"};const L=e({components:{CustomInput:M},props:["subpage"],data:()=>({existingPlayer:!1,existingPlayerCode:"",chosenPlayer:{},thankYou:!1,venue:{type:"watl-affiliated",country:"United States"},selectedCountryCode:"1",error:"",emailReg:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,validationErrors:{company:"",city:"",state:"",postcode:"",email:"",phone:"",firstname:"",lastname:"",adminemail:""},countriesInfo:X}),computed:{getCountries:()=>S(),addressDB(){return this.venue.address.replace(/\n/g,", ")},getPhoneMask:()=>W(),phonePlaceholder(){if(this.selectedCountryCode){const e=X.find(e=>e.code==this.selectedCountryCode);if(e)return _(e.name)}return{code:"+1",mask:"(XXX) XXX XXXX"}}},watch:{existingPlayer(e){e||(this.venue.firstname="",this.venue.lastname="",this.venue.adminemail="",this.existingPlayerCode="",this.chosenPlayer={})}},methods:{applyPhoneMask:t,stateHandler(e){let t=e.target.value;this.venue.state=t.replace(/[^a-zA-Z]+/g,"")},postcodeHandler(e){let t=e.target.value;this.venue.postcode=t.replace(/[^A-Za-z0-9\s-]/,"")},setOwnerVenueAccess(e,t){w(U("/venues/".concat(e,"/access/").concat(t)),{admin:!0,host:!0,master:!1,owner:!0})},setOwnerForVenue(){E(V(b("/watl/players"),C("code"),P(this.existingPlayerCode.toUpperCase())),e=>{if(e.exists()){let t=e.val(),a=Object.values(t)[0];this.chosenPlayer={...a,".key":Object.keys(t)[0]},this.venue.firstname=a.first,this.venue.lastname=a.last,this.venue.adminemail=a.email}else this.$notify({group:"notifyMessages",type:"error",title:"Oops",text:"Player with code ".concat(this.existingPlayerCode.toUpperCase()," not exists"),duration:2e3}),this.existingPlayerCode=""})},slug:e=>e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),checkField(e){var t,a;this.validationErrors[e]="","phone"===e&&(this.venue.phone=null==(t=this.venue.phone)?void 0:t.replace(/[^0-9-+]/g,"")),["firstname","lastname"].includes(e)&&(this.venue[e]=null==(a=this.venue[e])?void 0:a.replace(/\d+/,""))},isValid(){const{company:e="",city:t="",email:a="",phone:o="",firstname:n="",state:s="",postcode:i="",lastname:l="",adminemail:r=""}=this.venue,d=a.length&&this.emailReg.test(a),u=r.length&&this.emailReg.test(r);return!e.length&&(this.validationErrors.company="Company name is required"),!t.length&&(this.validationErrors.city="Location is required"),!a.length&&(this.validationErrors.email="Public Company Email is required"),a.length&&!this.emailReg.test(a)&&(this.validationErrors.email="Invalid email"),!o.length&&(this.validationErrors.phone="Public Company phone is required"),!n.length&&(this.validationErrors.firstname="First name is required"),!l.length&&(this.validationErrors.lastname="Last name is required"),!r.length&&(this.validationErrors.adminemail="Email is required"),!s.length&&(this.validationErrors.state="State is required"),!i.length&&(this.validationErrors.postcode="ZIP code is required"),r.length&&!this.emailReg.test(r)&&(this.validationErrors.adminemail="Invalid email"),![e,t,o,n,l,s,i].some(e=>!e.length)&&d&&u},async geocodeAddress(){const{address:e="",city:t="",country:a="",state:o="",postcode:n=""}=this.venue;let s="".concat(e,"+").concat(t,"+").concat(o,"+").concat(n,"+").concat(a);return await g.get("https://nominatim.openstreetmap.org/search?q=".concat(s,"&format=json")).then(e=>{var t;if(null==(t=e.data[0])?void 0:t.lat)return this.thankYou=!0,{lat:+e.data[0].lat,lon:+e.data[0].lon};this.thankYou=!1,k(()=>{},"Your address is not correct. Please edit the address or contact support for assistance.","error","Ok",!0)})},async checkIfPlayerExists(e){return await x(V(b("/watl/players"),C("email"),P(e.toLowerCase()))).then(e=>{let t=e.exists();if(t){let t=e.val(),a=Object.values(t)[0];this.chosenPlayer={...a,".key":Object.keys(t)[0]}}return t})},async save(){var e,t;if(!this.isValid())return;if(this.venue.geocode=await this.geocodeAddress(),void 0===this.venue.geocode)return;(null==(e=this.venue.geocode)?void 0:e.lat)&&(null==(t=this.venue.geocode)?void 0:t.lon)&&(this.venue.timezone=q(this.venue.geocode.lat,this.venue.geocode.lon));let a="watl-affiliated"===this.venue.type?"https://firebasestorage.googleapis.com/v0/b/forged-7adb7.appspot.com/o/global%2Fvenue-logos%2F1569244739239_venue-logosWATL-logo.png?alt=media&token=0f58cbea-6ef3-418f-9962-1221b5014a17":"https://firebasestorage.googleapis.com/v0/b/forged-7adb7.appspot.com/o/global%2FDefault%20venue.png?alt=media&token=9a974454-d438-45a0-9ca1-7461898ef324";if("custom"!==this.venue.type)g.post("https://us-central1-forged-7adb7.cloudfunctions.net/venueSignUp",{city:this.venue.city,rules:"watl",company:this.venue.company,email:this.venue.email,phone:this.venue.phone,timezone:this.venue.timezone||"",address:this.venue.address,state:this.venue.state,postcode:this.venue.postcode,logo:a,country:this.venue.country,adminfirst:this.venue.firstname,adminlast:this.venue.lastname,adminemail:this.venue.adminemail,geocode:this.venue.geocode||"",type:this.venue.type}).then(()=>{this.thankYou=!0}).catch(e=>{this.error=e});else{let e=this.slug(this.venue.company+"-"+this.venue.city);f(b("/venues/".concat(e)),{status:"Active",city:this.venue.city,rules:"axeThrowing",company:this.venue.company,email:this.venue.email,phone:this.venue.phone,timezone:this.venue.timezone||"",address:this.venue.address,state:this.venue.state,postcode:this.venue.postcode,logo:a,country:this.venue.country,geocode:this.venue.geocode||"",adminfirst:this.venue.firstname,adminlast:this.venue.lastname,adminemail:this.venue.adminemail,type:"custom",paymentMethod:"subscription",activated:Date.now()}).then(async()=>{const t={first:this.venue.firstname,last:this.venue.lastname,email:this.venue.adminemail,venue:e,venueAcce
1ss:"owner"};await this.checkIfPlayerExists(this.venue.adminemail)||this.existingPlayer&&this.existingPlayerCode?(this.setOwnerVenueAccess(e,this.chosenPlayer[".key"]),O({".key":this.chosenPlayer[".key"],venueAccess:"owner",email:this.chosenPlayer.email},e),this.$notify({group:"notifyMessages",type:"success",title:"Venue created successfully.",text:"User with current email already exists, please check appropriate access to the venue.",duration:5e3})):A(t,{venues:{[e]:"owner"},zipcode:(this.venue.postcode||"").trim()}).then(a=>{this.$notify({group:"notifyMessages",type:"success",title:"Venue created successfully",text:"Please check you email to proceed",duration:5e3}),this.setOwnerVenueAccess(e,a.key),window.localStorage.setItem("emailForSignIn",t.email)}),g.post("https://us-central1-forged-7adb7.cloudfunctions.net/venueSignUp/sendEmail",{backUrl:"https://axethrowing.org",email:this.venue.adminemail,adminName:"".concat(this.venue.firstname," ").concat(this.venue.lastname),venueName:this.venue.company}).catch(e=>{this.error=e}),this.thankYou=!0})}}}},[["render",function(e,t,g,f,b,x){const V=r("v-col"),P=r("custom-input"),C=r("v-checkbox"),k=r("v-btn"),E=r("v-row"),w=r("v-card-text"),U=r("v-container");return I(),a(U,{class:"container-custom container-padding"},{default:o(()=>[t[33]||(t[33]=n("h1",{class:"text-center"},"Venue Owner Sign Up",-1)),b.thankYou||b.error?i("",!0):(I(),s("form",{key:0,id:"formVenue",onSubmit:t[24]||(t[24]=v(e=>x.save(),["prevent"]))},[l(w,{style:{color:"var(--theme-text)"}},{default:o(()=>[l(E,null,{default:o(()=>[l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[t[26]||(t[26]=n("div",{class:"input-label"},"Venue type *",-1)),d(n("select",{required:"","onUpdate:modelValue":t[0]||(t[0]=e=>b.venue.type=e),class:"formSelect"},[...t[25]||(t[25]=[n("option",{value:"watl-affiliated"},"WATL",-1),n("option",{value:"custom"},"Unaffiliated",-1)])],512),[[u,b.venue.type]])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"Company Name *required",modelValue:b.venue.company,"onUpdate:modelValue":t[1]||(t[1]=e=>b.venue.company=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.company,onKeyUp:t[2]||(t[2]=e=>b.validationErrors.company="")},null,8,["modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[t[28]||(t[28]=n("div",{class:"input-label"},"Public Company phone number ex: 565-555-5656, *required",-1)),n("div",z,[d(n("select",{name:"countryCode",class:"phoneCodeSelect","onUpdate:modelValue":t[3]||(t[3]=e=>b.selectedCountryCode=e)},[t[27]||(t[27]=n("option",{"data-countryCode":"US",value:"1"},"USA (+1)",-1)),n("optgroup",F,[(I(!0),s(c,null,m(b.countriesInfo,e=>(I(),s("option",{"data-countryCode":e.iso,value:e.code,key:e.code},y(e.name)+" "+y("(+".concat(e.code,")")),9,j))),128))])],512),[[u,b.selectedCountryCode]]),l(P,{class:"phoneInput",variant:"outlined",modelValue:b.venue.phone,"onUpdate:modelValue":t[4]||(t[4]=e=>b.venue.phone=e),modelModifiers:{trim:!0},placeholder:x.phonePlaceholder.mask||"XXX XXX XX XX",bottomWarning:b.validationErrors.phone,onInput:t[5]||(t[5]=e=>b.venue.phone=x.applyPhoneMask(e.target.value,x.phonePlaceholder.mask||"XXX XXX XX XX"))},null,8,["modelValue","placeholder","bottomWarning"])])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"Public Company Email *required",modelValue:b.venue.email,"onUpdate:modelValue":t[6]||(t[6]=e=>b.venue.email=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.email,onKeyUp:t[7]||(t[7]=e=>b.validationErrors.email="")},null,8,["modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[t[29]||(t[29]=n("div",{class:"input-label"},"Country",-1)),d(n("select",{"onUpdate:modelValue":t[8]||(t[8]=e=>b.venue.country=e),class:"formSelect"},[(I(!0),s(c,null,m(x.getCountries,e=>(I(),s("option",{key:e.code,value:e.name},y(e.name),9,Y))),128))],512),[[u,b.venue.country]])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"City *required",modelValue:b.venue.city,"onUpdate:modelValue":t[9]||(t[9]=e=>b.venue.city=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.city,placeholder:"City",onKeyUp:t[10]||(t[10]=()=>b.validationErrors.city="")},null,8,["modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"State/Province/Region*",placeholder:"State/Province/Region",onInput:x.stateHandler,modelValue:b.venue.state,"onUpdate:modelValue":t[11]||(t[11]=e=>b.venue.state=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.state,onKeyUp:t[12]||(t[12]=e=>b.validationErrors.state="")},null,8,["onInput","modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"ZIP/Postal code*",placeholder:"ZIP/Postal code",onInput:x.postcodeHandler,modelValue:b.venue.postcode,"onUpdate:modelValue":t[13]||(t[13]=e=>b.venue.postcode=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.postcode,onKeyUp:t[14]||(t[14]=e=>b.validationErrors.postcode="")},null,8,["onInput","modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"Street Address*",placeholder:"Main Street, 123",modelValue:b.venue.address,"onUpdate:modelValue":t[15]||(t[15]=e=>b.venue.address=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.address},null,8,["modelValue","bottomWarning"])]),_:1}),l(V,{cols:"12",class:"pa-3"},{default:o(()=>[...t[30]||(t[30]=[n("h1",{class:"text-center"},"Owner",-1)])]),_:1}),l(V,{cols:"12",class:"pa-3"},{default:o(()=>
1[l(C,{dark:"",color:"var(--clr-blue)",label:"Choose existing player","false-value":!1,"true-value":!0,modelValue:b.existingPlayer,"onUpdate:modelValue":t[16]||(t[16]=e=>b.existingPlayer=e)},null,8,["modelValue"])]),_:1}),b.existingPlayer?(I(),a(V,{key:0,cols:"12"},{default:o(()=>[l(E,{class:"align-end"},{default:o(()=>[l(V,{cols:"12",sm:"4",class:"pa-0"},{default:o(()=>[l(P,{"top-text":"Player code",variant:"outlined",maxlength:4,placeholder:"Enter player code (ex.XY12)",modelValue:b.existingPlayerCode,"onUpdate:modelValue":t[17]||(t[17]=e=>b.existingPlayerCode=e),modelModifiers:{trim:!0}},null,8,["modelValue"])]),_:1}),l(V,{cols:"12",sm:"2",class:p(["pa-0 text-center",{"mt-5":e.$vuetify.display.xs}])},{default:o(()=>[l(k,{onClick:x.setOwnerForVenue,variant:"outlined",class:"my-0",disabled:4!==b.existingPlayerCode.length},{default:o(()=>[...t[31]||(t[31]=[h(" find player ",-1)])]),_:1},8,["onClick","disabled"])]),_:1},8,["class"])]),_:1})]),_:1})):i("",!0),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"First name *required",modelValue:b.venue.firstname,"onUpdate:modelValue":t[18]||(t[18]=e=>b.venue.firstname=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.firstname,onKeyUp:t[19]||(t[19]=e=>x.checkField("firstname")),readonly:b.existingPlayer},null,8,["modelValue","bottomWarning","readonly"])]),_:1}),l(V,{cols:"12",sm:"6",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"Last name *required",modelValue:b.venue.lastname,"onUpdate:modelValue":t[20]||(t[20]=e=>b.venue.lastname=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.lastname,onKeyUp:t[21]||(t[21]=e=>x.checkField("lastname")),readonly:b.existingPlayer},null,8,["modelValue","bottomWarning","readonly"])]),_:1}),l(V,{cols:"12",class:"pa-3"},{default:o(()=>[l(P,{variant:"outlined","top-text":"Email address *required",modelValue:b.venue.adminemail,"onUpdate:modelValue":t[22]||(t[22]=e=>b.venue.adminemail=e),modelModifiers:{trim:!0},bottomWarning:b.validationErrors.adminemail,onKeyUp:t[23]||(t[23]=e=>b.validationErrors.adminemail=""),readonly:b.existingPlayer},null,8,["modelValue","bottomWarning","readonly"])]),_:1}),l(V,{cols:"12",class:"pa-3 text-center"},{default:o(()=>[...t[32]||(t[32]=[n("button",{class:"v-btn primary",type:"submit",form:"formVenue"}," Send ",-1)])]),_:1})]),_:1})]),_:1})],32)),b.thankYou?(I(),s("h2",K," Thank you! Please check your email for further instructions. ")):i("",!0),b.error?(I(),s("h2",R," Something went wrong: "+y(b.error)+". ",1)):i("",!0)]),_:1})}],["__scopeId","data-v-19f4e7dc"]]);export{L 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.