const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["scripts/VacancyDisplay-Tlr2xOyl.js","scripts/index-qazYPOM_.js","scripts/ErrorTooltip-CvjJMd6x.js","scripts/Suggestion-BzeFLwDg.js","scripts/heart_icon-CNI-J_gl.js","scripts/heart_icon_active-B9yak902.js","scripts/star_icon-lyM3mNbV.js","scripts/company_icon-DSi_vN5a.js","scripts/BreadcrumbNav-GYSyRF7g.js","scripts/Skeleton-iZakU_NP.js","scripts/SEO-BqYEj9ea.js"])))=>i.map(i=>d[i]);
import{j as e,c as A,u as H,b as B,a as g,r as h,e as W,W as V,X as K,Y as X,_ as z}from"./index-qazYPOM_.js";import{B as G}from"./BreadcrumbNav-GYSyRF7g.js";import{E as R}from"./ErrorTooltip-CvjJMd6x.js";import{S as t}from"./Skeleton-iZakU_NP.js";import{S as q}from"./SEO-BqYEj9ea.js";const O=()=>e.jsxs("div",{className:"vacancy__display-container",children:[e.jsxs("div",{className:"vacancy__header",children:[e.jsxs("div",{className:"vacancy__header-info",children:[e.jsx("div",{className:"vacancy__display-header",children:e.jsx("div",{className:"vacancy__header-text",children:e.jsx(t,{width:"240px",height:"28px",style:{marginTop:8}})})}),e.jsxs("div",{className:"vacancy__info",children:[e.jsx(t,{width:"160px",height:"20px"}),e.jsx(t,{width:"140px",height:"20px",style:{marginTop:8}}),e.jsx(t,{width:"120px",height:"20px",style:{marginTop:8}})]})]}),e.jsxs("div",{className:"vacancy__header-additional",children:[e.jsxs("div",{className:"vacancy__additional-header",children:[e.jsx("div",{className:"company__image-container",children:e.jsx(t,{variant:"circle",width:"64px",height:"64px"})}),e.jsxs("div",{className:"company__info",children:[e.jsx(t,{width:"120px",height:"24px"}),e.jsx(t,{width:"95px",height:"16px",style:{marginTop:8}}),e.jsx("div",{className:"company__raiting-container",style:{marginTop:8},children:e.jsx(t,{width:"80px",height:"16px"})})]})]}),e.jsxs("div",{className:"vacancy__button-container",children:[e.jsx(t,{width:"95%",height:"40px"}),e.jsx(t,{variant:"circle",width:"40px",height:"40px"})]})]})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx(t,{width:"100%",height:"60px",style:{marginTop:12}})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx(t,{width:"100%",height:"60px",style:{marginTop:12}})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx(t,{width:"100%",height:"60px",style:{marginTop:12}})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx(t,{width:"100%",height:"60px",style:{marginTop:12}})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx("div",{className:"tags__list",style:{display:"flex",gap:8,marginTop:12},children:Array.from({length:4}).map((o,a)=>e.jsx("li",{className:"tags__list-item",style:{padding:0,border:"none"},children:e.jsx(t,{width:`${90+a*10}px`,height:"32px",style:{borderRadius:"16px"}})},`static-skill-skel-${a}`))})]}),e.jsxs("div",{className:"vacancy__section",children:[e.jsx(t,{width:"180px",height:"28px"}),e.jsx("div",{className:"tags__list",style:{display:"flex",gap:8,marginTop:12},children:Array.from({length:3}).map((o,a)=>e.jsx("li",{className:"tags__list-item",style:{padding:0,border:"none"},children:e.jsx(t,{width:`${90+a*10}px`,height:"32px",style:{borderRadius:"16px"}})},`static-skill-skel-${a}`))})]}),e.jsx(t,{width:"220px",height:"44px",style:{marginTop:24}})]}),J=h.lazy(()=>z(()=>import("./VacancyDisplay-Tlr2xOyl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])));function ie(){var v;const{vacancyId:o}=A(),a=H(),w=B(),{userId:m}=g(i=>i.auth),{currentVacancy:s,isLoading:j,error:f}=g(i=>i.vacancy),{coefficients:x}=g(i=>i.user);h.useEffect(()=>{m&&!x&&a(W(m))},[m,x,a]),h.useEffect(()=>(o&&a(V({vacancyId:o,applicantId:m})),()=>{a(K())}),[o,m,a]);const S=i=>{i.preventDefault(),window.opener&&!window.opener.closed?window.opener.focus():w("/vacancies")},T=h.useMemo(()=>!s||!x?s:{...s,coefficient:x[s.id]},[s,x]),b=[{label:"Вакансии",href:"/vacancies",onClick:S},{label:j?e.jsx(X,{size:"small"}):(s==null?void 0:s.title)||"Детали вакансии",isCurrent:!0}],C=(i,r,l="RUB")=>{const d={RUB:"₽"}[l]||l,_=p=>{if(typeof p=="number")return p;if(typeof p=="string"){const I=parseInt(p,10);return isNaN(I)?void 0:I}},c=_(i),n=_(r);if(!c&&!n)return"з/п не указана";const y=p=>p.toLocaleString("ru-RU");return c&&n?`${y(c)} - ${y(n)} ${d}`:c?`от ${y(c)} ${d}`:n?`до ${y(n)} ${d}`:"з/п не указана"},N=i=>{const r="Опыт не указан";return i&&{EXPERIENCE_WITHOUT:"Нет опыта",EXPERIENCE_1_TO_3_YEARS:"От 1 года до 3 лет",EXPERIENCE_3_TO_6_YEARS:"От 3 до 6 лет",EXPERIENCE_6_YEARS:"Более 6 лет"}[i]||r},F=i=>{const r="Формат работы не указан";return i&&{OFFICE_TYPE_REMOTE:"Удалённо",OFFICE_TYPE_HYBRID:"Гибридный формат",OFFICE_TYPE_OFFICE:"Офис"}[i]||r},P=s!=null&&s.title?`${s.title} в ${((v=s.company)==null?void 0:v.companyName)||"компании"} ${s.city?`, ${s.city}`:""} | HT Platform`:"Вакансия | HT Platform",L=C(s==null?void 0:s.salaryFrom,s==null?void 0:s.salaryTo,s==null?void 0:s.salaryCurrency),D=N(s==null?void 0:s.workingExperience),M=F(s==null?void 0:s.officeType),k=s!=null&&s.description?s.description.split(".")[0]:"",u=[L,s==null?void 0:s.city,M,D,k].filter(Boolean).join(", "),U=u.length>160?u.substring(0,157)+"...":u,Y=h.useMemo(()=>{var d,_,c;if(!s)return null;const i=s.salaryFrom||s.salaryTo,r=s.salaryCurrency||"RUB",l=n=>{switch(n){case"WORKING_SCHEDULE_FULL_TIME":return"FULL_TIME";case"WORKING_SCHEDULE_PART_TIME":return"PART_TIME";case"WORKING_SCHEDULE_INTERNSHIP":return"INTERNSHIP";case"WORKING_SCHEDULE_PROJECT_WORK":return"CONTRACTOR";default:return"FULL_TIME"}},E=n=>{switch(n){case"OFFICE_TYPE_REMOTE":return"REMOTE";case"OFFICE_TYPE_HYBRID":return"HYBRID";case"OFFICE_TYPE_OFFICE":return"ON_SITE";case"OFFICE_TYPE_FIELD_WORK":return"ON_SITE";default:return"ON_SITE"}};return{"@context":"https://schema.org","@type":"JobPosting",title:s.title,description:s.description||"",datePosted:s.createdAt?new Date(s.createdAt).toISOString():new Date().toISOString(),hiringOrganization:{"@type":"Organization",name:((d=s.company)==null?void 0:d.companyName)||"Неизвестная компания",logo:((_=s.company)==null?void 0:_.imageUrl)||void 0},jobLocation:{"@type":"Place",address:{"@type":"PostalAddress",addressLocality:s.city||"Не указан",addressCountry:"RU"}},...E(s.officeType)==="REMOTE"&&{jobLocationType:"TELECOMMUTE"},...E(s.officeType)==="HYBRID"&&{jobLocationType:"HYBRID"},baseSalary:i?{"@type":"MonetaryAmount",currency:r,value:{"@type":"QuantitativeValue",value:i,unitText:"MONTH"}}:void 0,employmentType:l(s.workingSchedule),experienceRequirements:N(s.workingExperience)||void 0,skills:((c=s.skills)==null?void 0:c.map(n=>n.skillName).join(", "))||void 0,qualifications:s.requirements||void 0,responsibilities:s.objectives||void 0}},[s]),$=`https://ht-platform.ru/vacancies/detail/${o}`;return e.jsxs("div",{className:"vacancy-detail-page-layout",children:[e.jsx(q,{title:P,description:U,canonicalUrl:$,type:"jobposting",jsonLd:Y||void 0}),e.jsxs("main",{className:"main__content-details",children:[e.jsx("div",{className:"vacancy__details-breadcrumbnav-container",children:e.jsx(G,{className:"vacancy__details-breadcrumbnav",items:b})}),j?e.jsx(O,{}):f?e.jsx(R,{message:f}):T?e.jsx(h.Suspense,{fallback:e.jsx(O,{}),children:e.jsx(J,{vacancy:T})}):e.jsx(R,{title:"Вакансия не найдена"})]})]})}export{ie as VacancyDetailsPage};