1import{_ as g,m as F,j as k,b as p,$ as D,c as U,o as b,g as a,w as r,a as i,f as C,t as c,d as N,e as T,Z as B,a1 as d,a9 as m,a4 as _,as as O,al as M,n as y}from"./index-sUPB-bMu.js";const V={name:"UserData",data(){return{formChildren:{nome:null,sexo:null,sobrenome:null,dataNascimento:null,observacoes:null},formFeedback:{type:null,message:null},userChild:null,birthDate:null}},computed:{...k(["churchData","churchLanguage","userChildEdit","userChildren","userUpdatedChildren"]),datePlaceholder(){switch(this.churchData.pais){case"US":return"MM/DD/YYYY";case"BR":return"DD/MM/AAAA";default:return"DD/MM/YYYY"}}},created(){this.userChildEdit!==null&&(this.formChildren={...this.userChildren[this.userChildEdit]},this.formChildren.dataNascimento&&(this.formChildren.dataNascimento=this.$dayjs(this.userChildEdit.dataNascimento).utc().locale(this.churchLanguage).format("L")))},methods:{...F(["setUserChildren","setUpdatedChildren"]),goBack(){this.$emit("back")},goTop(){window.scrollTo(0,0)},convertDate(){this.formChildren.dataNascimento&&(this.birthDate=this.$dayjs(this.formChildren.dataNascimento,this.$dayjs().locale(this.churchLanguage).localeData().longDateFormat("L"),this.churchLanguage).format("YYYY-MM-DD"))},async handleSubmit(){const{valid:s}=await this.$refs.updateForm.validate();if(s){if(this.convertDate(),this.userChild={...this.formChildren,dataNascimento:this.birthDate,igreja:this.churchData.id},this.$formSending(!0,this.$refs.updateForm.$el),this.userChildEdit!==null)try{const e=this.userChildren[this.userChildEdit]?.id;if(e){const f=this.userUpdatedChildren;f.findIndex(t=>t.id===e)===-1&&(f.push(this.userChild),this.setUpdatedChildren(f))}this.userChildren[this.userChildEdit]=this.userChild,this.formFeedback={type:"success",message:this.$t("USER.USER_DATA.MESSAGE.SUCCESS")},this.goBack()}catch{this.formFeedback={type:"error",message:this.$t("USER.USER_DATA.MESSAGE.ERROR")}}else try{this.setUserChildren([...this.userChildren,this.userChild]),this.formFeedback={type:"success",message:this.$t("USER.USER_DATA.MESSAGE.SUCCESS")},this.goBack()}catch{this.formFeedback={type:"error",message:this.$t("USER.USER_DATA.MESSAGE.ERROR")}}this.$formSending(!1,this.$refs.updateForm.$el)}}}},H={class:"page-user-data"},$={class:"page-user-data__content__inline-content"},w={class:"title"},Y={class:"page-user-data__form"},I={class:"input-item__floated-label"},P=["innerHTML"],j=["placeholder"],G={class:"input-item__floated-label"},X=["innerHTML"],x=["placeholder"],q={class:"input-item__floated-label"},z=["innerHTML"],W=["placeholder"],Z={class:"input-item__floated-label"},J=["innerHTML"],K={class:"radiobuttons"},Q={class:"label"},ee={class:"label"},te={class:"input-item__floated-label"},ie=["innerHTML"],se=["placeholder"];function le(s,e,f,L,t,o){const E=p("SvgElement"),A=p("AlertMessage"),u=p("ErrorMessage"),h=p("Field"),v=p("Form"),R=D("mask");return b(),U("div",H,[a(v,{ref:"updateForm",as:"form",class:"form-styled page-user-data__content",onSubmit:o.handleSubmit},{default:r(({meta:S})=>[i("div",$,[i("button",{class:"go-back",onClick:e[0]||(e[0]=C(l=>o.goBack(),["prevent"]))},[a(E,{name:"ArrowLeft",width:"1.4rem"})]),i("h1",w,c(s.$t("USER.USER_DATA.CHILDREN.TITLE")),1)]),i("div",Y,[i("button",{class:"back-button",onClick:e[1]||(e[1]=C(l=>o.goBack(),["prevent"]))},[a(E,{name:"ArrowLeft",width:"1.4rem"})]),i("div",null,[t.formFeedback.message?(b(),N(A,{key:0,type:t.formFeedback.type},{default:r(()=>[B(c(t.formFeedback.message),1)]),_:1},8,["type"])):T("",!0)]),a(h,{ref:"nameField",key:"name-input",modelValue:t.formChildren.nome,"onUpdate:modelValue":e[3]||(e[3]=l=>t.formChildren.nome=l),name:s.$t("FORM.LABEL.NAME"),class:"input-item",as:"div",rules:"required"},{default:r(({field:l})=>[i("div",I,[i("label",{for:"name",class:"input-item__label input-item__label",innerHTML:`${s.$t("FORM.LABEL.NAME")} *`},null,8,P),d(i("input",m(l,{"onUpdate:modelValue":e[2]||(e[2]=n=>t.formChildren.nome=n),type:"text",name:"name",inputmode:"text",placeholder:s.$t("FORM.PLACEHOLDER.NAME"),class:"input-item__field--normal input-item__field",mode:"aggressive",disabled:!1}),null,16,j),[[_,t.formChildren.nome]])]),a(u,{name:s.$t("FORM.LABEL.NAME"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])]),_:1},8,["modelValue","name"]),a(h,{ref:"lastNameField",key:"last-name-input",modelValue:t.formChildren.sobrenome,"onUpdate:modelValue":e[5]||(e[5]=l=>t.formChildren.sobrenome=l),name:s.$t("FORM.LABEL.SURNAME"),class:"input-item",as:"div"},{default:r(({field:l})=>[i("div",G,[i("label",{for:"last-name",class:"input-item__label input-item__label",innerHTML:s.$t("FORM.LABEL.SURNAME")},null,8,X),d(i("input",m(l,{"onUpdate:modelValue":e[4]||(e[4]=n=>t.formChildren.sobrenome=n),type:"text",name:"name",inputmode:"text",placeholder:s.$t("FORM.PLACEHOLDER.SURNAME"),class:"input-item__field--normal input-item__field",mode:"aggressive",disabled:!1}),null,16,x),[[_,t.formChildren.sobrenome]])]),a(u,{name:s.$t("FORM.LABEL.SURNAME"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])]),_:1},8,["modelValue","name"]),a(h,{ref:"birthDateField",key:"birth-date-input",modelValue:t.formChildren.dataNascimento,"onUpdate:modelValue":e[8]||(e[8]=l=>t.formChildren.dataNascimento=l),name:s.$t("FORM.LABEL.BIRTHDATE"),class:"input-item",as:"div",rules:`birthdate:${s.churchData.idioma}`},{default:r(({field:l})=>[i("div",q,[i("label",{for:"dataNascimento",class:"input-item__label input-item__label",innerHTML:s.$t("FORM.LABEL.BIRTHDATE")},null,8,z),d(i("input",m(l,{"onUpdate:modelValue":e[6]||(e[6]=n=>t.formChildren.dataNascimento=n),name:"dataNascimento",placeholder:o.datePlaceholder,class:"input-item__field--normal input-item__field",onBlur:e[7]||
1(e[7]=(...n)=>o.convertDate&&o.convertDate(...n))}),null,16,W),[[O,t.formChildren.dataNascimento],[R,"##/##/####"]])]),a(u,{name:s.$t("FORM.LABEL.BIRTHDATE"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])]),_:1},8,["modelValue","name","rules"]),a(h,{ref:"sexField",key:"sex-input",modelValue:t.formChildren.sexo,"onUpdate:modelValue":e[11]||(e[11]=l=>t.formChildren.sexo=l),name:s.$t("FORM.LABEL.SEX"),class:"input-item",as:"div",rules:"required"},{default:r(({field:l})=>[i("div",Z,[i("label",{for:"sex",class:"input-item__label input-item__label",innerHTML:`${s.$t("FORM.LABEL.SEX")} *`},null,8,J),i("div",K,[d(i("input",m(l,{"onUpdate:modelValue":e[9]||(e[9]=n=>t.formChildren.sexo=n),type:"radio",value:"M"}),null,16),[[M,t.formChildren.sexo]]),i("p",Q,c(s.$t("FORM.LABEL.SEX_MEN")),1),d(i("input",m(l,{"onUpdate:modelValue":e[10]||(e[10]=n=>t.formChildren.sexo=n),class:"radiobutton",type:"radio",value:"F"}),null,16),[[M,t.formChildren.sexo]]),i("p",ee,c(s.$t("FORM.LABEL.SEX_WOMEN")),1)]),a(u,{name:s.$t("FORM.LABEL.SEX"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])])]),_:1},8,["modelValue","name"]),a(h,{ref:"commentsField",key:"comments-input",modelValue:t.formChildren.observacoes,"onUpdate:modelValue":e[13]||(e[13]=l=>t.formChildren.observacoes=l),name:s.$t("FORM.LABEL.COMMENTS"),class:"input-item",as:"div"},{default:r(({field:l})=>[i("div",te,[i("label",{for:"comments",class:"input-item__label input-item__label",innerHTML:s.$t("FORM.LABEL.COMMENTS")},null,8,ie),d(i("input",m(l,{"onUpdate:modelValue":e[12]||(e[12]=n=>t.formChildren.observacoes=n),type:"text",name:"comments",inputmode:"text",placeholder:s.$t("FORM.PLACEHOLDER.COMMENTS"),class:"input-item__field--normal input-item__field",mode:"aggressive",disabled:!1}),null,16,se),[[_,t.formChildren.observacoes]])]),a(u,{name:s.$t("FORM.LABEL.COMMENTS"),class:"input-item__feedback input-item__feedback--invalid"},null,8,["name"])]),_:1},8,["modelValue","name"]),i("button",{type:"submit",class:y(["btn btn--color-primary",{"btn--disabled-gray":!S.valid}]),onClick:e[14]||(e[14]=l=>o.goTop())},c(s.$t("FORM.BUTTON.SAVE")),3)])]),_:1},8,["onSubmit"])])}const ae=g(V,[["render",le],["__scopeId","data-v-672a73ee"]]);export{ae 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.