import{z as l,m as B,u as f,j as e,n as S,o as r,p as R,q as j,r as y,L as u,s as v,t as o,B as h,v as D,w as V,x as E,y as N,D as q,E as z,C as H,G as L}from"./ui-library-BW7doqqp.js";import{a as w}from"./react-vendor-ERTQd_Nj.js";import{a as U}from"./index-DW_MHI2K.js";import{R as A,a as C}from"./radio-group-CO7Aqkyv.js";import{u as T}from"./use-scroll-top-CJJ8CWfz.js";const I=l.object({type:l.string(),company_name:l.string().min(3,{message:"Название компании должно быть не менее 3 символов"}),representative_name:l.string().min(3,{message:"Имя представителя должно быть не менее 3 символов"}),job_title:l.string().min(3,{message:"Должность должна быть не менее 3 символов"}),participants_number:l.string().min(1,{message:"Укажите количество участников"}),country:l.string().min(3,{message:"Название страны должно быть не менее 3 символов"}),email_address:l.string().email({message:"Укажите корректный email"}),phone_number:l.string().min(8,{message:"Номер телефона должен быть не менее 8 символов"}),website:l.string().optional(),meeting_objective:l.string().min(3,{message:"Укажите цель встречи"}),proposal_description:l.string().optional(),government_agency:l.string().optional(),sector_industry:l.string().optional(),key_services:l.string().optional(),government_experience:l.string().optional(),preferred_meeting_datetime:l.string().optional(),meeting_mode:l.string().optional(),language_preference:l.string().optional(),technical_requirements:l.string().optional(),company_profile:l.custom(s=>s instanceof File,{message:"Выберите корректный файл"}).refine(s=>s&&["image/jpeg","image/png","application/pdf"].includes(s.type),{message:"Допускаются только файлы JPG, PNG и PDF"}).optional(),proposal_presentation:l.custom(s=>s instanceof File,{message:"Выберите корректный файл"}).refine(s=>s&&["image/jpeg","image/png","application/pdf"].includes(s.type),{message:"Допускаются только файлы JPG, PNG и PDF"}).optional(),relevant_certification:l.custom(s=>s instanceof File,{message:"Выберите корректный файл"}).refine(s=>s&&["image/jpeg","image/png","application/pdf"].includes(s.type),{message:"Допускаются только файлы JPG, PNG и PDF"}).optional()}),J={type:"B2B",company_name:"",representative_name:"",job_title:"",participants_number:"",country:"",email_address:"",phone_number:"",website:"",meeting_objective:"",proposal_description:"",government_agency:"",sector_industry:"",key_services:"",government_experience:"",preferred_meeting_datetime:"",meeting_mode:"",language_preference:"",technical_requirements:""},m=[{h2:"Информация об экспоненте:",data:[{label:"Название компании/организации"},{label:"Имя представителя"},{label:"Название должности/позиция"},{label:"Количество участников"},{label:"Страна"},{label:"Email адрес"},{label:"Номер телефона"},{label:"Вебсайт"}]},{h2:"Applicant Information:",data:[{label:"Company/Organization Name"},{label:"Name of Representative"},{label:"Job title/Position"},{label:"Number of the participants"},{label:"Country"},{label:"E-mail address"},{label:"Phone number"},{label:"Website"}]}],p=[{h2:"Цели встречи:",secondH2:"Информация о компании/организации:",data:[{label:"Основная цель встречи"},{label:"Краткое описание вашего предложения/проекта/запроса"},{label:"Соответствующее государственное учреждение/департамент"},{label:"Отраслевая промышленность"},{label:"Ключевые услуги/продукты"},{label:"Предыдущий опыт работы с правительствами (если применимо)"}]},{h2:"Meeting Purpose: ",secondH2:"Company/Organization Profile:",data:[{label:"Primary objective of the meeting"},{label:"Brief description of your proposal/project/request"},{label:"Relevant government agency/department"},{label:"Sector Industry "},{label:"Key Services/Products"},{label:"Previous Experience working with Governments (if applicable)"}]}],c=[{h2:"Логистика встречи:",secondH2:"Логистика встречи:",subtitle:"(Пожалуйста приложите следующие документы, если это необходимо)",data:[{label:"Предпочтительная дата и время"},{label:"Предпочтительный способ проведения встречи (лично, виртуально (через zoom/ teams/другое), гибридный)"},{label:"Предпочитаемый язык (английский, туркменский, русский, другой)"},{label:"Дополнительные технические или логистические требования (например, аудио-видео оборудование, переводчики и т.д.)"},{label:"Название компании/организации"},{label:"Предложение/презентация"},{label:"Соответствующие сертификаты/лицензии"}],button:"Отправить"},{h2:"Приложения:",secondH2:"Attachments",subtitle:"(Please attach the following documents as applicable)",data:[{label:"Preferred date and time for the meeting"},{label:"Preferred mode of meeting (in-person, virtual (via zoom/teams/other), hybrid)"},{label:"Language preference (English, turkmen, Russian, other)"},{label:"Additional technical or logistical requirements (e.g. AV equipment, interpreters, etc)"},{label:"Company/organization profile"},{label:"Proposal presentation"},{label:"Relevant certification/licenses"}],button:"Send"}],O=({handleNext:s})=>{const{control:n,formState:t}=B(),a=f(i=>i.lang);return e.jsxs(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,y:"100%",transition:{duration:.2}},className:"w-full",children:[e.jsx("h2",{className:"h2 mb-8",children:m[r(a)].h2}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(R,{defaultValue:1,control:n,name:"type",render:({field:i})=>e.jsxs(j,{className:"space-y-3",children:[e.jsx(y,{className:"text-xl",children:a===u.RU?"Тип:":"Type:"}),e.jsx(v,{children:e.jsxs(A,{onValueChange:i.onChange,defaultValue:i.value,className:"flex flex-col space-y-4",children:[e.jsxs(j,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(v,{children:e.jsx(C,{value:"B2B",checked:i.value==="B2B"})}),e.jsx(y,{className:"text-base",children:"B2B"})]}),e.jsxs(j,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(v,{children:e.jsx(C,{value:"B2G",checked:i.value==="B2G"})}),e.jsx(y,{className:"text-base",children:"B2G"})]})]})})]})}),e.jsx(o,{control:n,name:"company_name",error:t.errors.company_name,placeholder:"",label:m[r(a)].data[0].label}),e.jsx(o,{control:n,name:"representative_name",error:t.errors.representative_name,placeholder:"",label:m[r(a)].data[1].label}),e.jsx(o,{control:n,name:"job_title",error:t.errors.job_title,placeholder:"",label:m[r(a)].data[2].label}),e.jsx(o,{control:n,name:"participants_number",error:t.errors.participants_number,placeholder:"",label:m[r(a)].data[3].label}),e.jsx(o,{control:n,name:"country",error:t.errors.country,placeholder:"",label:m[r(a)].data[4].label}),e.jsx(o,{control:n,name:"email_address",error:t.errors.email_address,placeholder:"",label:m[r(a)].data[5].label}),e.jsx(o,{control:n,name:"phone_number",error:t.errors.phone_number,placeholder:"",label:m[r(a)].data[6].label}),e.jsx(o,{control:n,name:"website",placeholder:"",label:m[r(a)].data[7].label})]}),e.jsx(h,{variant:"secondary",type:"button",onClick:s,className:"w-full mt-10",children:a===u.RU?"Далее":"Next"})]})},$=({handleNext:s,handlePrev:n})=>{const t=f(x=>x.lang),{control:a,formState:i}=B();return e.jsxs(S.div,{initial:{opacity:0,y:-100},animate:{opacity:1,y:0,transition:{delay:.5,duration:.3}},exit:{opacity:0,y:100},children:[e.jsx("h2",{className:"h2 mb-8",children:p[r(t)].h2}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx(o,{control:a,name:"meeting_objective",error:i.errors.meeting_objective,placeholder:"",label:p[r(t)].data[0].label}),e.jsx(o,{control:a,name:"proposal_description",error:i.errors.proposal_description,placeholder:"",label:p[r(t)].data[1].label}),e.jsx(o,{control:a,name:"government_agency",error:i.errors.government_agency,placeholder:"",label:p[r(t)].data[2].label}),e.jsx("h2",{className:"h2 mt-4",children:p[r(t)].secondH2}),e.jsx(o,{control:a,name:"sector_industry",error:i.errors.sector_industry,placeholder:"",label:p[r(t)].data[3].label}),e.jsx(o,{control:a,name:"key_services",error:i.errors.key_services,placeholder:"",label:p[r(t)].data[4].label}),e.jsx(o,{control:a,name:"government_experience",error:i.errors.government_experience,placeholder:"",label:p[r(t)].data[5].label})]}),e.jsxs("div",{className:"flex items-center gap-6 mt-10",children:[e.jsx(h,{type:"button",onClick:n,variant:"outline",className:"text-on_surface",children:t===u.RU?"Вернуться назад":"Back"}),e.jsx(h,{variant:"secondary",type:"button",onClick:s,className:"w-full",children:t===u.RU?"Далее":"Next"})]})]})},K=({handlePrev:s})=>{const{control:n,formState:t}=B(),a=f(i=>i.lang);return e.jsxs(S.div,{initial:{opacity:0,y:-100},animate:{opacity:1,y:0,transition:{delay:.5,duration:.3}},transition:{duration:1},children:[e.jsx("h2",{className:"h2 mb-8",children:c[r(a)].h2}),e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(o,{control:n,name:"preferred_meeting_datetime",error:t.errors.preferred_meeting_datetime,placeholder:"",label:c[r(a)].data[0].label}),e.jsx(o,{control:n,name:"preferred_mode",error:t.errors.preferred_mode,placeholder:"",label:c[r(a)].data[1].label}),e.jsx(o,{control:n,name:"language_preference",error:t.errors.language_preference,placeholder:"",label:c[r(a)].data[2].label}),e.jsx(o,{control:n,name:"additional_technical",error:t.errors.additional_technical,placeholder:"",label:c[r(a)].data[3].label})]}),e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"h2 mt-10",children:c[r(a)].secondH2}),e.jsx("h5",{className:"text-on_surface_v",children:c[r(a)].subtitle})]}),e.jsx(o,{control:n,name:"company_profile",label:c[r(a)].data[4].label,type:"file",textDark:!0}),e.jsx(o,{control:n,name:"proposal_presentation",label:c[r(a)].data[5].label,type:"file",textDark:!0}),e.jsx(o,{control:n,name:"relevant_certification",label:c[r(a)].data[6].label,type:"file",textDark:!0})]}),e.jsxs("div",{className:"flex items-center gap-6 mt-10",children:[e.jsx(h,{type:"button",onClick:s,variant:"outline",className:"text-on_surface",children:a===u.RU?"Вернуться назад":"Back"}),e.jsx(h,{disabled:t.isSubmitting,type:"submit",className:"w-full",children:t.isSubmitting?e.jsx(D,{className:"animate-spin"}):c[r(a)].button})]})]})},M=({stage:s,setStage:n,success:t,setSuccess:a})=>{const i=V({resolver:z(I),defaultValues:J,mode:"onChange"}),x=d=>{switch(d){case 1:return["type","company_name","representative_name","job_title","participants_number","country","email_address","phone_number","website"];case 2:return["meeting_objective","proposal_description","government_agency","sector_industry","key_services","government_experience"];case 3:return["preferred_meeting_datetime","meeting_mode","language_preference","technical_requirements","company_profile","proposal_presentation","relevant_certification"];default:return[]}},P=async()=>{const d=x(s);await i.trigger(d)&&n(k=>k+1)},F=()=>n(d=>d-1),G=async d=>{try{const b=new FormData;Object.entries(d).forEach(([_,g])=>{g instanceof File?(console.log(`Добавляем файл: ${_}`,g),b.append(_,g)):g!==void 0&&(console.log(`Добавляем поле: ${_}`,g),b.append(_,g))}),(await U.post("https://turkmentextile.turkmenexpo.com/app/api/v1/form",b,{headers:{"Content-Type":"multipart/form-data"}})).status===201&&a(!0)}catch(b){console.error("Ошибка при отправке B2B формы:",b)}};return e.jsx(E,{...i,children:e.jsx("form",{onSubmit:i.handleSubmit(G),children:e.jsxs("div",{className:"relative",children:[e.jsx(N,{children:s===1&&e.jsx(O,{handleNext:P})}),e.jsx(N,{children:s===2&&e.jsx($,{handleNext:P,handlePrev:F})}),e.jsx(N,{children:s===3&&t===!1&&e.jsx(K,{handlePrev:F})}),t&&e.jsx(q,{})]})})})};function ee(){T();const s=f(x=>x.lang),[n,t]=w.useState(1),[a,i]=w.useState(!1);return e.jsxs("div",{className:"pb-[120px]",children:[e.jsx(H,{title:s===u.RU?"B2B | B2G встречи":"B2B | B2G meetings"}),!a&&n!==0&&e.jsx(L,{stage:n}),e.jsx("div",{className:"max-w-[808px] md:mx-auto mx-5",children:e.jsx(M,{success:a,setSuccess:i,stage:n,setStage:t})})]})}export{ee as default};