import{_ as x}from"./ButtonDefault-CghIUDY0.js";import{_ as N}from"./ClausesKeeper-DVJgfLR3.js";import{_ as P}from"./BlockBalanceAgreement-2iQbaweR.js";import{u as U,r as p,D as f,f as y,g as D,c as C,b as u,a as e,t as E,v as S,I as n,S as r,d as V,x as k,o as B}from"./index-CipWZKo_.js";import{u as A}from"./contracts-CILh9uSu.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./IconClose-ChC2G6HM.js";const R={class:"create-referral"},$={class:"container"},L={class:"section-header"},j={class:"section-label"},H={class:"container"},M={class:"create-referral__data"},T={class:"form-field"},q={class:"form-field"},z={class:"form-field"},F={class:"form-field"},G={class:"container"},J={class:"create-referral__data"},K={__name:"DependUsersCreate",async setup(O){let o,l;const i=U(),_=A(),v=D(),w=V();k("emitter");const d=p(!1),t=p({Email:"",Name:"",Password:"",_Password:""});[o,l]=f(()=>i.fetchUserData()),await o,l(),[o,l]=f(()=>_.fetchContracts()),await o,l(),y(()=>_.contractsList[v.params.id]);function b(){t.value.Email.length>0&&t.value.Password.length>0&&t.value.Name.length>0&&t.value._Password.length>0&&(d.value=!0,i.registerNewUser({...t.value}).then(c=>{const{response:s,error:m}=c;s==="success"&&w.push({path:"/Home"}),d.value=!1}))}return(c,s)=>{const m=P,g=N,h=x;return B(),C("div",R,[u(m),e("section",null,[e("div",$,[e("div",L,[s[5]||(s[5]=e("h1",{class:"section-title"},"Создать реферала",-1)),e("div",j,E(S(i).userInfo.Name),1)]),u(g)])]),e("section",null,[e("div",H,[e("div",M,[e("label",T,[s[6]||(s[6]=e("span",{class:"form-field__label"},"ФИО",-1)),n(e("input",{type:"text",placeholder:"","onUpdate:modelValue":s[0]||(s[0]=a=>t.value.Name=a)},null,512),[[r,t.value.Name]])]),e("label",q,[s[7]||(s[7]=e("span",{class:"form-field__label"},"Email",-1)),n(e("input",{type:"text","onUpdate:modelValue":s[1]||(s[1]=a=>t.value.Email=a)},null,512),[[r,t.value.Email]])]),e("label",z,[s[8]||(s[8]=e("span",{class:"form-field__label"},"Пароль",-1)),n(e("input",{type:"password","onUpdate:modelValue":s[2]||(s[2]=a=>t.value.Password=a)},null,512),[[r,t.value.Password]])]),e("label",F,[s[9]||(s[9]=e("span",{class:"form-field__label"},"Подтвердить пароль",-1)),n(e("input",{type:"password","onUpdate:modelValue":s[3]||(s[3]=a=>t.value._Password=a)},null,512),[[r,t.value._Password]])])])])]),e("section",null,[e("div",G,[e("div",J,[u(h,{class:"btn--wide",label:"Зарегистрировать","is-loading":d.value,onClick:s[4]||(s[4]=a=>b())},null,8,["is-loading"])])])])])}}},te=I(K,[["__scopeId","data-v-51383d17"]]);export{te as default};
