import{_ as c,F as g,a as _}from"./footerB-DAi6c01a.js";import{d as h,o,c as a,b as t,w as u,v as p,t as l,g as d,f as b,a as m,F as M}from"./index-DccGIixi.js";const x={data(){return{formData:{email:"",text:""},isLoading:!1,successMessage:"",errorMessage:""}},methods:{async submitForm(){this.isLoading=!0,this.successMessage="",this.errorMessage="";try{console.log(this.formData),(await h.post("https://yalarba.ru/api/support/support",this.formData)).status===201?(this.successMessage="Сообщение успешно отправлено!",this.formData.email="",this.formData.text=""):this.errorMessage="Произошла ошибка при отправке сообщения."}catch{this.errorMessage="Произошла ошибка при отправке сообщения."}finally{this.isLoading=!1}}}},D={class:"support-form"},y={class:"form-group"},v={class:"form-group"},F=["disabled"],V={key:0,class:"success-message"},w={key:1,class:"error-message"};function L(i,s,f,B,e,n){return o(),a("div",D,[s[5]||(s[5]=t("h2",null,"Техническая поддержка",-1)),t("form",{onSubmit:s[2]||(s[2]=b((...r)=>n.submitForm&&n.submitForm(...r),["prevent"]))},[t("div",y,[s[3]||(s[3]=t("label",{for:"email"},"Ваш email:",-1)),u(t("input",{type:"email",id:"email","onUpdate:modelValue":s[0]||(s[0]=r=>e.formData.email=r),required:"",placeholder:"Введите ваш email"},null,512),[[p,e.formData.email]])]),t("div",v,[s[4]||(s[4]=t("label",{for:"message"},"Сообщение:",-1)),u(t("textarea",{id:"message","onUpdate:modelValue":s[1]||(s[1]=r=>e.formData.text=r),required:"",placeholder:"Опишите вашу проблему"},null,512),[[p,e.formData.text]])]),t("button",{type:"submit",disabled:e.isLoading},l(e.isLoading?"Отправка...":"Отправить"),9,F),e.successMessage?(o(),a("p",V,l(e.successMessage),1)):d("",!0),e.errorMessage?(o(),a("p",w,l(e.errorMessage),1)):d("",!0)],32)])}const k=c(x,[["render",L],["__scopeId","data-v-ba31f826"]]),q={__name:"SupportView",setup(i){return(s,f)=>(o(),a(M,null,[m(g),m(k),m(_)],64))}};export{q as default};
