(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41979ea2"],{3213:function(e,t,r){"use strict";r("3ac1")},"3ac1":function(e,t,r){},d3c3:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-container",[r("v-row",{attrs:{align:"center",justify:"center"}},[r("v-col",{attrs:{cols:"12",sm:"8",md:"6"}},[r("v-card",{staticClass:"elevation-1 mb-15 registration-card"},[r("v-card-title",[r("h3",{staticClass:"text-DarkBlue"},[e._v(e._s(e.$t("registration.title")))])]),r("v-card-text",[r("v-form",{ref:"form",attrs:{"lazy-validation":"",autocomplete:"off","aria-autocomplete":"none"},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[r("v-text-field",{attrs:{dense:"",label:e.$t("registration.lastName"),name:"given-name",rules:e.nameRules,error:e.lastNameError,outlined:"","background-color":"rgb(245, 245, 245)"},model:{value:e.lastName,callback:function(t){e.lastName=t},expression:"lastName"}}),r("v-text-field",{attrs:{dense:"",label:e.$t("registration.firstName"),name:"family-name",rules:e.nameRules,error:e.firstNameError,outlined:"","background-color":"rgb(245, 245, 245)"},model:{value:e.firstName,callback:function(t){e.firstName=t},expression:"firstName"}}),r("v-text-field",{attrs:{dense:"",label:e.$t("registration.middleName"),name:"middle-name",rules:e.nameRules,error:e.middleNameError,outlined:"","background-color":"rgb(245, 245, 245)"},model:{value:e.middleName,callback:function(t){e.middleName=t},expression:"middleName"}}),r("div",{staticClass:"py-3"}),e._l(e.availableContacts,(function(t,a){return r("contact-input",{key:t.id,attrs:{label:t.name,type:e.contactsInfo[t.id].type,"contact-info":t,"contacts-info":e.contacts,error:e.contactErrors[a]},model:{value:e.contacts[a],callback:function(t){e.$set(e.contacts,a,t)},expression:"contacts[i]"}})})),r("div",{staticClass:"py-3"}),r("v-text-field",{attrs:{dense:"",label:e.$t("registration.password"),name:"password",type:e.showPassword?"text":"password",rules:e.passwordRules,error:e.passwordError,"append-icon":e.showPassword?"mdi-eye":"mdi-eye-off",outlined:"","background-color":"rgb(245, 245, 245)"},on:{"click:append":function(t){e.showPassword=!e.showPassword}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),r("v-text-field",{attrs:{dense:"",label:e.$t("registration.secondPassword"),name:"new-password",type:e.showSecondPassword?"text":"password",rules:e.secondPasswordRules,"append-icon":e.showSecondPassword?"mdi-eye":"mdi-eye-off",outlined:"","background-color":"rgb(245, 245, 245)"},on:{"click:append":function(t){e.showSecondPassword=!e.showSecondPassword}},model:{value:e.secondPassword,callback:function(t){e.secondPassword=t},expression:"secondPassword"}}),r("v-checkbox",{attrs:{dense:"",rules:e.checkboxRules},scopedSlots:e._u([{key:"label",fn:function(){return[r("div",[e._v(" "+e._s(e.$t("registration.terms1"))+" "),r("a",{attrs:{href:"https://docs.google.com/document/d/1NLKPb-HcNT696DcLzJmJ-ET9BL6-6fHc/edit?usp=sharing&ouid=115243855287902691660&rtpof=true&sd=true",target:"_blank"},on:{click:function(e){e.stopPropagation()}}},[e._v(" "+e._s(e.$t("registration.terms2"))+" ")]),e._v(" "+e._s(e.$t("registration.terms3"))+" ")])]},proxy:!0}])})],2)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{attrs:{color:"primary",small:"",loading:e.loading},on:{click:e.submit}},[e._v(" "+e._s(e.$t("registration.submit"))+" ")])],1)],1)],1)],1)],1)},n=[],s=(r("cb29"),r("4160"),r("159b"),r("96cf"),r("1da1")),o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-row",{attrs:{dense:""}},[r("v-col",{class:{"col-6":e.flag,"col-12":!e.flag}},[r("v-text-field",{attrs:{dense:"",label:e.contactInfo.name,type:e.type,rules:e.textRules,"error-messages":e.textErrorMessage,error:e.error,outlined:"","background-color":"rgb(245, 245, 245)"},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.sendCode.apply(null,arguments)},change:e.clearError},scopedSlots:e._u([{key:"message",fn:function(t){var a=t.message;return[r("div",{domProps:{innerHTML:e._s(a)}})]}}]),model:{value:e.text,callback:function(t){e.text=t},expression:"text"}})],1),e.flag?r("v-col",{staticClass:"col-6"},[r("v-text-field",{attrs:{dense:"",rules:e.checkTextRules,error:e.error,outlined:"","background-color":"rgb(245, 245, 245)"},on:{change:e.clearError},scopedSlots:e._u([{key:"append-outer",fn:function(){return[r("v-btn",{staticStyle:{transform:"translate(0, -2px)"},attrs:{"x-small":"",height:"28px",color:"primary",disabled:e.disable},on:{click:e.sendCode}},[e._v(" "+e._s(e.disable?e.counter:e.$t("registration.sendCode"))+" ")])]},proxy:!0}],null,!1,2084100397),model:{value:e.checkText,callback:function(t){e.checkText=t},expression:"checkText"}})],1):e._e()],1)},c=[],i=(r("4de4"),r("d81d"),{name:"contactInput",model:{prop:"value",event:"input"},props:{label:String,type:String,contactInfo:Object,contactsInfo:Array,error:Boolean},data:function(){var e=this;return{counter:60,disable:!1,text:null,textErrorMessage:null,checkText:null,textRules:[function(t){return!e.flag||e.thereIsCompletedRequiredContact||!!t||e.$t("registration.contactErr")}],checkTextRules:[function(t){return!e.text||!!t||e.$t("registration.codeErr")}]}},computed:{flag:function(){return this.contactInfo.canBeUsedForNotification},thereIsCompletedRequiredContact:function(){return this.contactsInfo.map((function(e){return e.value})).filter((function(e){return!!e})).length>0}},watch:{text:function(){this.emitValue()},checkText:function(){this.emitValue()}},methods:{sendCode:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.clearError(),!e.disable&&e.text){t.next=3;break}return t.abrupt("return");case 3:return e.disable=!0,r=setInterval((function(){e.counter--,0===e.counter&&(clearInterval(r),e.counter=60,e.disable=!1)}),1e3),t.next=7,e.$store.dispatch("confirmContact",{kindId:e.contactInfo.id,value:e.text});case 7:a=t.sent,a.success||(clearInterval(r),e.counter=60,e.disable=!1,e.textErrorMessage=a.message);case 9:case"end":return t.stop()}}),t)})))()},clearError:function(){this.textErrorMessage=null},emitValue:function(){this.$emit("input",{kind_id:this.contactInfo.id,value:this.text,confirmation_token:this.checkText})}}}),l=i,d=r("2877"),u=r("6544"),m=r.n(u),f=r("8336"),p=r("62ad"),b=r("0fd9b"),h=r("8654"),v=Object(d["a"])(l,o,c,!1,null,"57393602",null),g=v.exports;m()(v,{VBtn:f["a"],VCol:p["a"],VRow:b["a"],VTextField:h["a"]});var x={name:"Registration",components:{ContactInput:g},data:function(){var e=this;return{contactsInfo:{1:{type:"email"},2:{type:"text"},3:{type:"text"}},valid:!1,firstName:null,firstNameError:!1,lastName:null,lastNameError:!1,middleName:null,middleNameError:!1,contacts:[],contactErrors:[],password:null,passwordError:null,showPassword:!1,secondPassword:null,showSecondPassword:!1,nameRules:[function(t){return!!t||e.$t("registration.emptyErr")}],passwordRules:[function(t){return!!t||e.$t("registration.emptyErr")}],secondPasswordRules:[function(t){return!!t||e.$t("registration.emptyErr")},function(t){return t===e.password||e.$t("registration.noMatchErr")}],checkboxRules:[function(t){return!!t||e.$t("registration.termsErr")}],loading:!1}},computed:{availableContacts:function(){return this.$store.getters.getContactTypes}},methods:{validate:function(){this.$refs.form.validate()},resetValidation:function(){this.$refs.form.resetValidation()},submit:function(){var e=this;this.clearErrors(),this.validate(),setTimeout(Object(s["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.valid){t.next=2;break}return t.abrupt("return");case 2:return e.loading=!0,t.prev=3,t.next=6,e.$store.dispatch("signup",{firstName:e.firstName,middleName:e.middleName,lastName:e.lastName,password:e.password,contacts:e.contacts});case 6:if(r=t.sent,!r.success){t.next=13;break}return t.next=10,e.$router.push("/login");case 10:e.$store.commit("setSuccess",e.$t("registration.successMessage")),t.next=15;break;case 13:e.$store.commit("setError",r.message),r.bad_params.forEach((function(t){switch(t.field){case"name":e.firstNameError=!0;break;case"middlename":e.middleNameError=!0;break;case"family":e.lastNameError=!0;break;case"password":e.passwordError=!0;break;case"contacts":t.array_index?e.contactErrors[t.array_index]=!0:e.contactErrors=Array(e.availableContacts.length).fill(!0);break}}));case 15:t.next=20;break;case 17:t.prev=17,t.t0=t["catch"](3),console.error(t.t0);case 20:e.loading=!1;case 21:case"end":return t.stop()}}),t,null,[[3,17]])}))),0)},clearErrors:function(){this.firstNameError=!1,this.middleNameError=!1,this.lastNameError=!1,this.passwordError=!1,this.contactErrors=Array(this.availableContacts.length).fill(!1)}},created:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("fetchContactTypes");case 2:e.clearErrors();case 3:case"end":return t.stop()}}),t)})))()}},w=x,k=(r("3213"),r("b0af")),y=r("99d9"),E=r("ac7c"),N=r("a523"),$=r("4bd4"),C=r("2fa4"),_=Object(d["a"])(w,a,n,!1,null,"2461b24a",null);t["default"]=_.exports;m()(_,{VBtn:f["a"],VCard:k["a"],VCardActions:y["a"],VCardText:y["b"],VCardTitle:y["c"],VCheckbox:E["a"],VCol:p["a"],VContainer:N["a"],VForm:$["a"],VRow:b["a"],VSpacer:C["a"],VTextField:h["a"]})}}]);