1import{_ as B}from"./Ce_v0ILL.js";import{_ as D}from"./e_lGoo9X.js";import{_ as E}from"./jSnsprRA.js";import{e as M,L as b,r as d,c as l,a,b as c,j as r,V as y,aL as k,v as C,t as m,F as A,k as L,l as N,o as i,_ as S}from"./D8PiJXAC.js";import U from"./D401YnWV.js";import{p as T}from"./Cd-7wpi2.js";import"./CoChc7CN.js";const j={class:"form-group"},z={key:0,class:"error-message"},P={class:"form-group"},R={key:0,class:"error-message"},q={class:"form-group"},G={class:"custom-file-label"},H={class:"plus-icon"},J={class:"form-group file-group"},K={key:0,class:"file-list"},O={class:"file-name"},Q=["onClick"],W={key:1,class:"error-message"},X={key:0,class:"success-message"},Y={key:1,class:"error-message"},Z=M({__name:"ContactForm",setup(ee){const s=b({name:"",email:"",description:"",files:[]}),o=b({name:"",email:"",description:"",files:""}),f=d(!1),u=d(""),p=d(""),v=d(!1);function _(t){o[t]&&(o[t]="")}function V(){let t=!0;return o.name="",o.email="",o.description="",o.files="",s.name.trim()||(o.name="ÐбÑзаÑелÑное поле",t=!1),s.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.email)||(o.email="ÐевеÑÐ½Ð°Ñ Ð¿Ð¾ÑÑа",t=!1):(o.email="ÐбÑзаÑелÑное поле",t=!1),s.description.trim()||(o.description="ÐбÑзаÑелÑное поле",t=!1),t}function x(t){const e=t.target;e.files&&(s.files=[...s.files,...Array.from(e.files)])}function F(t){s.files.splice(t,1)}async function h(){if(V()){f.value=!0,u.value="",p.value="";try{const t=new FormData;t.append("name",s.name),t.append("email",s.email),t.append("description",s.description),s.files.forEach(e=>{t.append("files[]",e)}),await T("advertising/order",t).catch(e=>{console.error(e),v.value=!0}),v.value?p.value="ÐÑибка оÑпÑавки заÑвки. ÐопÑобÑйÑе позже.":(u.value="ÐаÑа заÑвка ÑÑпеÑно оÑпÑавлена!",s.name="",s.email="",s.description="",s.files=[])}catch{p.value="ÐÑоизоÑла оÑибка. ÐопÑобÑйÑе позже."}finally{f.value=!1}}}return(t,e)=>{const I=B,$=D,w=E;return i(),l("form",{onSubmit:N(h,["prevent"]),class:"contact-form","aria-label":"ФоÑма конÑакÑа"},[e[9]||(e[9]=a("span",{class:"title-form"},"ÐÑÑавÑÑе заÑвкÑ, и Ð¼Ñ Ð½Ð°Ð¿Ð¸Ñем вам в ÑеÑение 2-Ñ
ÑабоÑиÑ
дней",-1)),a("div",j,[y(a("input",{id:"name",type:"text","onUpdate:modelValue":e[0]||(e[0]=n=>s.name=n),class:C({error:o.name}),placeholder:" ",onInput:e[1]||(e[1]=n=>_("name"))},null,34),[[k,s.name]]),e[6]||(e[6]=a("label",{for:"name"},"Ðак Ð²Ð°Ñ Ð·Ð¾Ð²ÑÑ?",-1)),o.name?(i(),l("span",z,m(o.name),1)):r("",!0)]),a("div",P,[y(a("input",{id:"email",type:"email","onUpdate:modelValue":e[2]||(e[2]=n=>s.email=n),class:C({error:o.email}),placeholder:" ",onInput:e[3]||(e[3]=n=>_("email"))},null,34),[[k,s.email]]),e[7]||(e[7]=a("label",{for:"email"},"ÐаÑа поÑÑа",-1)),o.email?(i(),l("span",R,m(o.email),1)):r("",!0)]),a("div",q,[c(I,{modelValue:s.description,"onUpdate:modelValue":e[4]||(e[4]=n=>s.description=n),error:o.description,label:"РаÑÑкажиÑе о задаÑе",onInput:e[5]||(e[5]=n=>_("description"))},null,8,["modelValue","error"])]),a("label",G,[a("span",H,[c(U)]),e[8]||(e[8]=a("span",{class:"text__add-file"},"ÐобавиÑÑ ÑайлÑ",-1)),a("input",{type:"file",multiple:"",hidden:"",onChange:x},null,32)]),a("div",J,[s.files.length?(i(),l("div",K,[(i(!0),l(A,null,L(s.files,(n,g)=>(i(),l("div",{class:"file-item",key:n.name+g},[a("span",O,m(n.name),1),a("button",{class:"file-remove",type:"button",onClick:se=>F(g),"aria-label":"УдалиÑÑ Ñайл"},[c($)],8,Q)]))),128))])):r("",!0),o.files?(i(),l("span",W,m(o.files),1)):r("",!0)]),c(w,{label:"ÐÑпÑавиÑÑ",disabled:f.value,type:"submit"},null,8,["disabled"]),u.value?(i(),l("div",X,m(u.value),1)):r("",!0),p.value?(i(),l("div",Y,m(p.value),1)):r("",!0)],32)}}}),me=S(Z,[["__scopeId","data-v-6c3b1280"]]);export{me 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.