(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{273:function(e,t,r){"use strict";r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return d})),r.d(t,"c",(function(){return m}));const o=/^[a-zA-Z0-9àáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'";:\-+*_/!#$@%&()[\]{}]+$/u,n=/^[a-zA-Z0-9àáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+$/u;function l(e,t){if(!e){const e=new Error(t);throw e.kind="validation",e}}function c(e){return"string"==typeof e&&!!e.match(o)}function d(e,t=40){return"string"==typeof e&&e.length<=t&&!!e.match(n)}async function m(e,path,t,r){const o=e.collection(path);return(await o.where(t,"==",r).get()).empty}},276:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var o=r(40),n=r(273);const l=Object(o.debounce)((async function(e,path,t,r){Object(n.d)(await Object(n.c)(e,path,t,r),"Must be unique.")}),1e3)},277:function(e,t,r){"use strict";r.r(t),r.d(t,"required",(function(){return n})),r.d(t,"max",(function(){return l})),r.d(t,"email",(function(){return c})),r.d(t,"name",(function(){return d})),r.d(t,"bool",(function(){return m})),r.d(t,"text",(function(){return text}));var o=r(273);const n=e=>!!e||"Required.",l=e=>t=>t.length<=e||`Max ${e} characters`,c=e=>!e||/^(([^<>()[\]\\.,;:\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,}))$/.test(e)||"Invalid e-mail.",d=e=>Object(o.a)(e)||"Not a valid name",m=e=>"string"==typeof e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())||"Not a valid boolean",text=e=>!e||Object(o.b)(e)||"Not a valid text"},278:function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var o=r(1),n=r(40),l=r(293);class c extends o.a{$emit(e,data,t,time){return super.$emit(e,{id:null!=t?t:Object(n.newUUID)(),message:e,data:data,time:null!=time?time:l.Timer.now()})}$on(e,t){return super.$on(e,t)}$off(e,t){return super.$off(e,t)}$once(e,t){return super.$once(e,t)}}const d=new c},287:function(e,t){},337:function(e,t,r){"use strict";var o=r(287),n=r.n(o);t.default=n.a},369:function(e,t,r){"use strict";r.r(t);var o=r(1),n=r(58),l=r(92),c=r(36),d=r(31),m=r(278),v=r(276),f=r(277),h=function(e,t,r,desc){var o,n=arguments.length,l=n<3?t:null===desc?desc=Object.getOwnPropertyDescriptor(t,r):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,desc);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(l=(n<3?o(l):n>3?o(t,r,l):o(t,r))||l);return n>3&&l&&Object.defineProperty(t,r,l),l};let w=class extends o.a{constructor(){super(...arguments),this.titles={greatBtn:"Great!",logoutBtn:"Logout"},this.errorMessages=[],this.dnErrorMessages=[],this.fnameErrorMessages=[],this.lnameErrorMessages=[],this.allowErrorMessages=[],this.fname="",this.lname="",this.dname="",this.color="#0000FF",this.rules=f,this.allow=!1}isUniqueDN(e){return Object(v.a)(this.$fire.firestore,"profiles","dnamelc",e.toLowerCase()).then((()=>{this.dnErrorMessages=[]})).catch((e=>this.dnErrorMessages=[e.message])),!0}async googleSignUp(){const e=new this.$fireModule.auth.GoogleAuthProvider;try{await this.$fire.auth.signInWithPopup(e)}catch(e){this.displayLoginError(e)}}displayLoginError(e){alert("Oops. "+e.message)}async createAccount(){var e,t;const{fname:r,lname:o,dname:n,color:l,allow:v}=this;if(this.allow){try{await Object(c.l)({fname:r,lname:o,dname:n,color:l,allow:v})}catch(e){return m.a.$emit("error",{message:"unable to create new account"}),void this.displaySignUpError(e)}try{await this.$store.dispatch(d.b,null!==(t=null===(e=this.profile)||void 0===e?void 0:e.uid)&&void 0!==t?t:void 0),this.$router.replace("newaccount")}catch(e){throw m.a.$emit("error",{message:"unable to load new account"}),e}}else this.allowErrorMessages=["You have to check this if you want to continue."]}displaySignUpError(e){alert("Oops. "+e.message)}};h([Object(l.a)("profile")],w.prototype,"profile",void 0),w=h([Object(n.a)({})],w);var y=w,_=r(19),x=r(337),C=r(25),$=r.n(C),E=r(52),O=r(262),j=r(261),k=r(373),M=r(292),A=r(364),V=r(270),L=r(252),N=r(301),component=Object(_.a)(y,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-layout",[e.profile?e._e():r("v-layout",[r("v-card",{staticClass:"mx-auto",attrs:{"min-width":"300","max-width":"500"}},[r("v-card-title",[e._v("Please choose provider")]),e._v(" "),r("v-btn",{on:{click:e.googleSignUp}},[e._v("Register using Google")]),e._v(" "),r("v-card-text",[e._v(" Allready have an account? You can ")]),e._v(" "),r("v-chip",{staticClass:"primary",attrs:{small:"",to:"Login"}},[e._v("sign-in")]),e._v("here.\n "),r("v-card-actions",[r("v-spacer"),e._v(" "),r("v-btn",{staticClass:"error",attrs:{to:"Home"}},[e._v("Cancel")])],1)],1)],1),e._v(" "),e.profile&&e.profile.accountKind?r("v-layout",[r("v-card",{staticClass:"mx-auto",attrs:{"min-width":"300","max-width":"500"}},[r("v-card-title",[e._v("You seem to have an account all ready")]),e._v(" "),r("v-card-actions",[r("v-btn",{staticClass:"primary",attrs:{to:"Home"},domProps:{textContent:e._s(e.titles.greatBtn)}}),e._v(" "),r("v-spacer"),e._v(" "),r("v-btn",{staticClass:"error",attrs:{to:"/logout"},domProps:{textContent:e._s(e.titles.logoutBtn)}})],1)],1)],1):e._e(),e._v(" "),e.profile&&!e.profile.accountKind?r("v-layout",[r("v-card",{staticClass:"mx-auto",attrs:{"min-width":"300","max-width":"500"}},[r("v-card-title",[e._v("Create an account @ battlemaps.online")]),e._v(" "),r("v-text-field",{attrs:{label:"First Name",rules:[e.rules.required,e.rules.name],"error-messages":e.fnameErrorMessages},model:{value:e.fname,callback:function(t){e.fname=t},expression:"fname"}}),e._v(" "),r("v-text-field",{attrs:{label:"Last Name",rules:[e.rules.required,e.rules.name],"error-messages":e.lnameErrorMessages},model:{value:e.lname,callback:function(t){e.lname=t},expression:"lname"}}),e._v(" "),r("v-text-field",{attrs:{label:"Display Name",rules:[e.rules.required,e.rules.name,e.isUniqueDN],"error-messages":e.dnErrorMessages},model:{value:e.dname,callback:function(t){e.dname=t},expression:"dname"}}),e._v(" "),r("v-color-picker",{attrs:{"show-swatches":"","hide-canvas":"","hide-inputs":""},model:{value:e.color,callback:function(t){e.color=t},expression:"color"}}),e._v(" "),r("v-checkbox",{attrs:{label:"I allow battlemaps.online to store personal information such as names, email adresses and preferenses that they need provide their services (the battlemap.online app) to me until I choose to delete my account at which time all of my data will be deleted as well. At no time will my personal information be given to third party without my explicit concent.",rules:[e.rules.required],"error-messages":e.allowErrorMessages},model:{value:e.allow,callback:function(t){e.allow=t},expression:"allow"}}),e._v(" "),r("v-card-actions",[r("v-btn",{staticClass:"primary",on:{click:e.createAccount}},[e._v("Create Account")]),e._v(" "),r("v-spacer"),e._v(" "),r("v-btn",{staticClass:"error",attrs:{to:"/logout"}},[e._v("Cancel")])],1)],1)],1):e._e()],1)}),[],!1,null,null,null);"function"==typeof x.default&&Object(x.default)(component);t.default=component.exports;$()(component,{VBtn:E.a,VCard:O.a,VCardActions:j.a,VCardText:j.b,VCardTitle:j.c,VCheckbox:k.a,VChip:M.a,VColorPicker:A.a,VLayout:V.a,VSpacer:L.a,VTextField:N.a})}}]);