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