import{_ as g}from"./BlockAuthEnter-Dy8-AnaO.js";import{_ as E}from"./ButtonDefault-CghIUDY0.js";import{_ as O}from"./ProtectionCode-CNHtgxlQ.js";import{_ as U}from"./BasicInput-BYe5b9L8.js";import{r as t,u as x,c as B,a as e,b as o,j as N,n as u,d as P,o as S}from"./index-CipWZKo_.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./component-DWBAga-C.js";const k={class:"registration-page"},A={class:"section"},C={class:"container"},j={class:"tw-flex tw-flex-col sm:tw-flex-row sm:tw-mb-4"},y={class:"form-offset_label"},H={__name:"Registration",setup(z){const c=t(!1),a=t(null),_=x(),f=P(),r=t(null),i=t(null),m=t(null),d=t(null),p=t(null);function R(){m.value!==null&&r.value!==null&&i.value!==null&&d.value!==null&&p.value!==null?(c.value=!0,_.registerNewUser({Email:r.value,Password:i.value,_Password:d.value,Name:m.value,Protect:p.value}).then(v=>{const{response:l}=v;l==="success"?f.push({path:"/"}):a.value="ERROR",c.value=!1})):a.value="ERROR"}return(v,l)=>{const n=U,w=O,b=E,V=g;return S(),B("div",k,[e("div",A,[e("div",C,[l[7]||(l[7]=e("div",{class:"section-header"},[e("h1",{class:"section-title"},"Регистрация")],-1)),e("form",{onSubmit:N(R,["prevent"])},[o(n,{label:"Имя",name:"name",modelValue:m.value,"onUpdate:modelValue":l[0]||(l[0]=s=>m.value=s),class:u({"form-field-error":a.value==="ERROR"})},null,8,["modelValue","class"]),o(n,{label:"Email",name:"mail",modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=s=>r.value=s),class:u({"form-field-error":a.value==="ERROR"})},null,8,["modelValue","class"]),o(n,{label:"Пароль",name:"password",modelValue:i.value,"onUpdate:modelValue":l[2]||(l[2]=s=>i.value=s),"is-password":"",class:u({"form-field-error":a.value==="ERROR"})},null,8,["modelValue","class"]),o(n,{label:"Подтвердить пароль",name:"repeat_password",modelValue:d.value,"onUpdate:modelValue":l[3]||(l[3]=s=>d.value=s),"is-password":"",class:u({"form-field-error":a.value==="ERROR"})},null,8,["modelValue","class"]),e("div",j,[l[5]||(l[5]=e("div",{class:"tw-w-64 tw-mr-4"},null,-1)),e("div",null,[o(w)])]),o(n,{label:"Защитный код",name:"code",modelValue:p.value,"onUpdate:modelValue":l[4]||(l[4]=s=>p.value=s),class:u({"form-field-error":a.value==="ERROR"})},null,8,["modelValue","class"]),e("div",y,[o(b,{label:"Зарегистрироваться",type:"submit",class:"btn--blue","is-loading":c.value},null,8,["is-loading"])]),l[6]||(l[6]=e("div",{class:"form-offset_label"},[e("p",null,"Нажимая на кнопку зарегистрироваться я соглашаюсь с условиями договора на оказание услуг")],-1))],32),o(V,{label:"Зарегистрироваться с помощью",class:"tw-mt-6"})])])])}}};export{H as default};
