import{r as l,j as e,az as I,e as B}from"./index-CsWJNzvD.js";const S1=t=>l.createElement("svg",{width:24,height:23,viewBox:"0 0 24 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{d:"M17.5 0.916992C16.3739 0.934507 15.2724 1.24885 14.3067 1.82826C13.341 2.40768 12.5453 3.23166 12 4.21699C11.4546 3.23166 10.6589 2.40768 9.6932 1.82826C8.7275 1.24885 7.62601 0.934507 6.49996 0.916992C4.7049 0.994983 3.01366 1.78025 1.79574 3.10122C0.577818 4.4222 -0.0677922 6.17152 -4.17093e-05 7.96699C-4.17093e-05 12.514 4.78596 17.48 8.79996 20.847C9.69618 21.6001 10.8293 22.013 12 22.013C13.1706 22.013 14.3037 21.6001 15.2 20.847C19.214 17.48 24 12.514 24 7.96699C24.0677 6.17152 23.4221 4.4222 22.2042 3.10122C20.9863 1.78025 19.295 0.994983 17.5 0.916992ZM13.915 19.317C13.3789 19.7684 12.7007 20.0159 12 20.0159C11.2992 20.0159 10.621 19.7684 10.085 19.317C4.94696 15.006 1.99996 10.87 1.99996 7.96699C1.9316 6.70171 2.36632 5.46072 3.20932 4.51469C4.05232 3.56866 5.23519 2.99434 6.49996 2.91699C7.76472 2.99434 8.9476 3.56866 9.7906 4.51469C10.6336 5.46072 11.0683 6.70171 11 7.96699C11 8.23221 11.1053 8.48656 11.2929 8.6741C11.4804 8.86164 11.7347 8.96699 12 8.96699C12.2652 8.96699 12.5195 8.86164 12.7071 8.6741C12.8946 8.48656 13 8.23221 13 7.96699C12.9316 6.70171 13.3663 5.46072 14.2093 4.51469C15.0523 3.56866 16.2352 2.99434 17.5 2.91699C18.7647 2.99434 19.9476 3.56866 20.7906 4.51469C21.6336 5.46072 22.0683 6.70171 22 7.96699C22 10.87 19.053 15.006 13.915 19.313V19.317Z",fill:"#31323A"})),j1="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3070_16244)'%3e%3cpath%20d='M17.5%201.91699C16.3739%201.93451%2015.2724%202.24885%2014.3067%202.82826C13.341%203.40768%2012.5453%204.23166%2012%205.21699C11.4546%204.23166%2010.6589%203.40768%209.6932%202.82826C8.7275%202.24885%207.62601%201.93451%206.49996%201.91699C4.7049%201.99498%203.01366%202.78025%201.79574%204.10122C0.577818%205.4222%20-0.0677922%207.17152%20-4.17093e-05%208.96699C-4.17093e-05%2013.514%204.78596%2018.48%208.79996%2021.847C9.69618%2022.6001%2010.8293%2023.013%2012%2023.013C13.1706%2023.013%2014.3037%2022.6001%2015.2%2021.847C19.214%2018.48%2024%2013.514%2024%208.96699C24.0677%207.17152%2023.4221%205.4222%2022.2042%204.10122C20.9863%202.78025%2019.295%201.99498%2017.5%201.91699ZM13.915%2020.317C13.3789%2020.7684%2012.7007%2021.0159%2012%2021.0159C11.2992%2021.0159%2010.621%2020.7684%2010.085%2020.317C4.94696%2016.006%201.99996%2011.87%201.99996%208.96699C1.9316%207.70171%202.36632%206.46072%203.20932%205.51469C4.05232%204.56866%205.23519%203.99434%206.49996%203.91699C7.76472%203.99434%208.9476%204.56866%209.7906%205.51469C10.6336%206.46072%2011.0683%207.70171%2011%208.96699C11%209.23221%2011.1053%209.48656%2011.2929%209.6741C11.4804%209.86164%2011.7347%209.96699%2012%209.96699C12.2652%209.96699%2012.5195%209.86164%2012.7071%209.6741C12.8946%209.48656%2013%209.23221%2013%208.96699C12.9316%207.70171%2013.3663%206.46072%2014.2093%205.51469C15.0523%204.56866%2016.2352%203.99434%2017.5%203.91699C18.7647%203.99434%2019.9476%204.56866%2020.7906%205.51469C21.6336%206.46072%2022.0683%207.70171%2022%208.96699C22%2011.87%2019.053%2016.006%2013.915%2020.313V20.317Z'%20fill='%23FF4B05'/%3e%3cpath%20d='M13.915%2020.317C13.3789%2020.7684%2012.7007%2021.0159%2012%2021.0159C11.2992%2021.0159%2010.621%2020.7684%2010.085%2020.317C4.94696%2016.006%201.99996%2011.87%201.99996%208.96699C1.9316%207.70171%202.36632%206.46072%203.20932%205.51469C4.05232%204.56866%205.23519%203.99434%206.49996%203.91699C7.76472%203.99434%208.9476%204.56866%209.7906%205.51469C10.6336%206.46072%2011.0683%207.70171%2011%208.96699C11%209.23221%2011.1053%209.48656%2011.2929%209.6741C11.4804%209.86164%2011.7347%209.96699%2012%209.96699C12.2652%209.96699%2012.5195%209.86164%2012.7071%209.6741C12.8946%209.48656%2013%209.23221%2013%208.96699C12.9316%207.70171%2013.3663%206.46072%2014.2093%205.51469C15.0523%204.56866%2016.2352%203.99434%2017.5%203.91699C18.7647%203.99434%2019.9476%204.56866%2020.7906%205.51469C21.6336%206.46072%2022.0683%207.70171%2022%208.96699C22%2011.87%2019.053%2016.006%2013.915%2020.313V20.317Z'%20fill='%23FF4B05'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3070_16244'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",P="_overlay_1tlyo_1",L="_closing_1tlyo_14",H="_modal_1tlyo_19",R="_header_1tlyo_32",T="_title_1tlyo_39",A="_closeButton_1tlyo_46",Z="_closeIcon_1tlyo_59",V="_subtitle_1tlyo_63",F="_chartPanel_1tlyo_68",k="_chartPanelHeader_1tlyo_76",D="_matchBadge_1tlyo_84",q="_matchBadgeIcon_1tlyo_96",G="_chartWrapper_1tlyo_100",U="_legend_1tlyo_111",W="_legendItem_1tlyo_121",O="_legendSwatch_1tlyo_127",z="_legendSwatchCandidate_1tlyo_135",X="_legendSwatchRequired_1tlyo_139",n={overlay:P,closing:L,modal:H,header:R,title:T,closeButton:A,closeIcon:Z,subtitle:V,chartPanel:F,chartPanelHeader:k,matchBadge:D,matchBadgeIcon:q,chartWrapper:G,legend:U,legendItem:W,legendSwatch:O,legendSwatchCandidate:z,legendSwatchRequired:X},J=t=>l.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("g",{clipPath:"url(#clip0_15696_112426)"},l.createElement("path",{d:"M1.4 14H2.8C3.57 14 4.2 13.37 4.2 12.6V11.2C4.2 10.43 3.57 9.8 2.8 9.8H1.4C0.63 9.8 0 10.43 0 11.2L0 12.6C0 13.37 0.63 14 1.4 14Z",fill:"white"}),l.createElement("path",{d:"M6.2999 14H7.6999C8.4699 14 9.0999 13.37 9.0999 12.6V7.7C9.0999 6.93 8.4699 6.3 7.6999 6.3H6.2999C5.5299 6.3 4.8999 6.93 4.8999 7.7V12.6C4.8999 13.37 5.5299 14 6.2999 14Z",fill:"white"}),l.createElement("path",{d:"M11.2 14H12.6C13.37 14 14 13.37 14 12.6V1.4C14 0.63 13.37 0 12.6 0L11.2 0C10.43 0 9.80005 0.63 9.80005 1.4V12.6C9.80005 13.37 10.43 14 11.2 14Z",fill:"white"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_15696_112426"},l.createElement("rect",{width:14,height:14,fill:"white"})))),K="_root_v77fr_1",Q="_gridRing_v77fr_8",Y="_axisLine_v77fr_14",e1="_scaleLabel_v77fr_19",a1="_label_v77fr_29",t1="_areaPrimary_v77fr_35",s1="_areaSecondary_v77fr_41",c1="_badge_v77fr_48",l1="_badgePrimary_v77fr_53",n1="_badgeSecondary_v77fr_57",o1="_badgeText_v77fr_61",r1="_badgeTextPrimary_v77fr_66",i1="_badgeTextSecondary_v77fr_70",i={root:K,gridRing:Q,axisLine:Y,scaleLabel:e1,label:a1,areaPrimary:t1,areaSecondary:s1,badge:c1,badgePrimary:l1,badgeSecondary:n1,badgeText:o1,badgeTextPrimary:r1,badgeTextSecondary:i1},d1=[i.areaPrimary,i.areaSecondary],C1=[i.badgePrimary,i.badgeSecondary],h1=[i.badgeTextPrimary,i.badgeTextSecondary],v=180,_1=196,M=24,N=t=>t*Math.PI/180,S=(t,o)=>{const r=360/o;return-90+r/2+t*r},b=(t,o)=>({x:o*Math.cos(N(t)),y:o*Math.sin(N(t))}),m1=({labels:t,series:o,min:r=0,className:g})=>{const C=Math.max(...o.flatMap(c=>c.values.map(a=>a??r))),h=Math.max(Math.ceil(C),1),y=h-r||1,x=c=>{const a=(c-r)/y;return Math.min(Math.max(a,0),1)*v},w=[];for(let c=1;c<=h;c++)w.push(c);const j=o.map(c=>t.map((a,s)=>b(S(s,t.length),x(c.values[s]??r))));return e.jsxs("svg",{viewBox:"-350 -250 700 500",className:`${i.root} ${g||""}`,role:"img","aria-label":"Диаграмма совместимости",children:[w.map(c=>e.jsx("circle",{className:i.gridRing,cx:0,cy:0,r:v*c/h},`grid-${c}`)),t.map((c,a)=>{const s=b(S(a,t.length),v);return e.jsx("line",{className:i.axisLine,x1:0,y1:0,x2:s.x,y2:s.y},`axis-${a}`)}),w.map(c=>{const a=b(-90,v*c/h);return e.jsx("text",{className:i.scaleLabel,x:0,y:a.y,children:c},`scale-${c}`)}),o.map((c,a)=>e.jsx("polygon",{className:d1[a],points:j[a].map(s=>`${s.x},${s.y}`).join(" ")},`area-${c.key}`)),t.map((c,a)=>{const s=S(a,t.length),d=N(s),_=b(s,_1);let f="middle",u=0,p=0;return Math.cos(d)>.1?(f="start",u=4):Math.cos(d)<-.1&&(f="end",u=-4),Math.sin(d)>.1?p=12:Math.sin(d)<-.1&&(p=-4),e.jsx("text",{x:_.x+u,y:_.y+p,className:`${i.label} body-4`,textAnchor:f,dominantBaseline:"central",children:c},`label-${a}`)}),t.map((c,a)=>{const s=o.map(d=>x(d.values[a]??r));if(s.length===2&&Math.abs(s[0]-s[1])<M){const d=(s[0]+s[1])/2,_=s[0]<=s[1]?-1:1;s[0]=d+_*(M/2),s[1]=d-_*(M/2),s[0]=Math.min(Math.max(s[0],18),v+24),s[1]=Math.min(Math.max(s[1],18),v+24)}return o.map((d,_)=>{const u=(d.values[a]??r).toFixed(1),p=b(S(a,t.length),s[_]),E=Math.max(30,u.length*8+6),$=20;return e.jsxs("g",{children:[e.jsx("rect",{className:`${i.badge} ${C1[_]}`,x:p.x-E/2,y:p.y-$/2,width:E,height:$,rx:4}),e.jsx("text",{className:`${i.badgeText} ${h1[_]} body-4`,x:p.x,y:p.y,children:u})]},`badge-${d.key}-${a}`)})})]})},M1=({competencies:t,onClose:o})=>{const[r,g]=l.useState(!1),C=l.useRef(!1);l.useEffect(()=>{const a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[]);const h=()=>{g(!0),setTimeout(o,300)},y=a=>{a.target===a.currentTarget&&(C.current=!0)},x=a=>{a.target===a.currentTarget&&C.current&&h(),C.current=!1},w=t.competencies.map(a=>a.label),j=t.competencies.map(a=>a.candidateScore),c=t.competencies.map(a=>a.requiredScore);return I.createPortal(e.jsx("div",{className:`${n.overlay} ${r?n.closing:""}`,onMouseDown:y,onMouseUp:x,children:e.jsxs("div",{className:n.modal,children:[e.jsxs("div",{className:n.header,children:[e.jsx("h2",{className:`${n.title} h2`,children:"Диаграмма совместимости"}),e.jsx("button",{className:n.closeButton,onClick:h,children:e.jsx(B,{className:n.closeIcon})})]}),e.jsx("p",{className:`${n.subtitle} body-1`,children:"Сравнение профиля соискателя с требованиями вакансии по выбранным компетенциям"}),e.jsxs("div",{className:n.chartPanel,children:[e.jsxs("div",{className:n.chartPanelHeader,children:[e.jsx("span",{className:"body-3",children:"Совпадение с профилем"}),e.jsxs("span",{className:`h3 ${n.matchBadge}`,children:[e.jsx(J,{className:n.matchBadgeIcon}),Math.round(t.matchPercentage),"%"]})]}),e.jsxs("div",{className:n.chartWrapper,children:[e.jsx(m1,{labels:w,min:t.scale.min,series:[{key:"candidate",values:j},{key:"required",values:c}]}),e.jsxs("div",{className:n.legend,children:[e.jsxs("div",{className:n.legendItem,children:[e.jsx("span",{className:`${n.legendSwatch} ${n.legendSwatchCandidate}`}),e.jsx("span",{className:"body-3",children:"Профиль кандидата"})]}),e.jsxs("div",{className:n.legendItem,children:[e.jsx("span",{className:`${n.legendSwatch} ${n.legendSwatchRequired}`}),e.jsx("span",{className:"body-3",children:"Требования вакансии"})]})]})]})]})]})}),document.body)},g1=t=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("g",{clipPath:"url(#clip0_461_3894)"},l.createElement("path",{d:"M7.5 10C8.48891 10 9.45561 9.70676 10.2779 9.15735C11.1001 8.60794 11.741 7.82705 12.1194 6.91342C12.4978 5.99979 12.5969 4.99446 12.4039 4.02455C12.211 3.05465 11.7348 2.16373 11.0355 1.46447C10.3363 0.765206 9.44536 0.289002 8.47545 0.0960758C7.50555 -0.0968503 6.50021 0.00216643 5.58658 0.380605C4.67295 0.759043 3.89206 1.39991 3.34265 2.22215C2.79324 3.0444 2.5 4.0111 2.5 5C2.50132 6.32568 3.02853 7.59668 3.96593 8.53407C4.90332 9.47147 6.17432 9.99868 7.5 10ZM7.5 1.66667C8.15927 1.66667 8.80374 1.86217 9.3519 2.22844C9.90006 2.59471 10.3273 3.1153 10.5796 3.72439C10.8319 4.33348 10.8979 5.0037 10.7693 5.6503C10.6407 6.29691 10.3232 6.89085 9.85702 7.35703C9.39085 7.8232 8.7969 8.14067 8.1503 8.26929C7.5037 8.3979 6.83348 8.33189 6.22439 8.0796C5.6153 7.82731 5.09471 7.40007 4.72843 6.8519C4.36216 6.30374 4.16667 5.65927 4.16667 5C4.16667 4.11595 4.51786 3.2681 5.14298 2.64298C5.7681 2.01786 6.61595 1.66667 7.5 1.66667Z",fill:"#FF4B05"}),l.createElement("path",{d:"M7.5 11.6665C5.51162 11.6689 3.60538 12.4599 2.19938 13.8659C0.793381 15.2719 0.0024258 17.1781 0 19.1665C0 19.3875 0.0877974 19.5995 0.244078 19.7557C0.400358 19.912 0.61232 19.9998 0.833333 19.9998C1.05435 19.9998 1.26631 19.912 1.42259 19.7557C1.57887 19.5995 1.66667 19.3875 1.66667 19.1665C1.66667 17.6194 2.28125 16.1357 3.37521 15.0417C4.46917 13.9477 5.9529 13.3332 7.5 13.3332C9.0471 13.3332 10.5308 13.9477 11.6248 15.0417C12.7188 16.1357 13.3333 17.6194 13.3333 19.1665C13.3333 19.3875 13.4211 19.5995 13.5774 19.7557C13.7337 19.912 13.9457 19.9998 14.1667 19.9998C14.3877 19.9998 14.5996 19.912 14.7559 19.7557C14.9122 19.5995 15 19.3875 15 19.1665C14.9976 17.1781 14.2066 15.2719 12.8006 13.8659C11.3946 12.4599 9.48838 11.6689 7.5 11.6665Z",fill:"#FF4B05"}),l.createElement("path",{d:"M18.3332 6.5625C17.8694 6.5856 17.4337 6.79147 17.1214 7.13506C16.809 7.47864 16.6455 7.93197 16.6666 8.39583C16.6876 7.93197 16.5241 7.47864 16.2117 7.13506C15.8994 6.79147 15.4637 6.5856 14.9999 6.5625C14.5361 6.5856 14.1004 6.79147 13.788 7.13506C13.4757 7.47864 13.3122 7.93197 13.3332 8.39583C13.3332 9.8375 15.2132 11.5267 16.1499 12.2783C16.2965 12.3957 16.4787 12.4597 16.6666 12.4597C16.8544 12.4597 17.0366 12.3957 17.1832 12.2783C18.1199 11.5283 19.9999 9.8375 19.9999 8.39583C20.0209 7.93197 19.8574 7.47864 19.5451 7.13506C19.2327 6.79147 18.797 6.5856 18.3332 6.5625Z",fill:"#FF4B05"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_461_3894"},l.createElement("rect",{width:20,height:20,fill:"white"})))),p1=t=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{d:"M18.3332 12.6533V6.66667C18.3319 5.562 17.8925 4.50296 17.1114 3.72185C16.3302 2.94073 15.2712 2.50132 14.1665 2.5H5.83321C4.72855 2.50132 3.66951 2.94073 2.88839 3.72185C2.10728 4.50296 1.66786 5.562 1.66654 6.66667V12.6533C1.11097 12.849 0.642587 13.235 0.344342 13.7429C0.046097 14.2509 -0.06276 14.848 0.0370517 15.4285C0.136863 16.009 0.438902 16.5354 0.889672 16.9146C1.34044 17.2937 1.91085 17.5011 2.49987 17.5H17.4999C18.0889 17.5011 18.6593 17.2937 19.1101 16.9146C19.5608 16.5354 19.8629 16.009 19.9627 15.4285C20.0625 14.848 19.9537 14.2509 19.6554 13.7429C19.3572 13.235 18.8888 12.849 18.3332 12.6533ZM5.83321 4.16667H14.1665C14.8296 4.16667 15.4655 4.43006 15.9343 4.8989C16.4031 5.36774 16.6665 6.00363 16.6665 6.66667V12.5H13.2074C12.965 12.4998 12.7255 12.5525 12.5056 12.6544C12.2857 12.7563 12.0906 12.905 11.934 13.09L11.7282 13.3333H8.27071L8.06571 13.09C7.90913 12.905 7.71409 12.7563 7.49417 12.6544C7.27425 12.5525 7.03475 12.4998 6.79237 12.5H3.33321V6.66667C3.33321 6.00363 3.5966 5.36774 4.06544 4.8989C4.53428 4.43006 5.17017 4.16667 5.83321 4.16667ZM17.4999 15.8333H2.49987C2.27886 15.8333 2.0669 15.7455 1.91062 15.5893C1.75434 15.433 1.66654 15.221 1.66654 15C1.66654 14.779 1.75434 14.567 1.91062 14.4107C2.0669 14.2545 2.27886 14.1667 2.49987 14.1667H6.79321L6.99821 14.41C7.15469 14.5949 7.34961 14.7435 7.56937 14.8454C7.78913 14.9473 8.02847 15 8.27071 15H11.7282C11.9706 15.0002 12.2101 14.9475 12.43 14.8456C12.6499 14.7437 12.845 14.595 13.0015 14.41L13.2074 14.1667H17.4999C17.7209 14.1667 17.9328 14.2545 18.0891 14.4107C18.2454 14.567 18.3332 14.779 18.3332 15C18.3332 15.221 18.2454 15.433 18.0891 15.5893C17.9328 15.7455 17.7209 15.8333 17.4999 15.8333Z",fill:"#FF4B05"})),x1="_wrapper_1u1to_1",y1="_title_1u1to_16",u1="_chips_1u1to_22",v1="_chip_1u1to_22",w1="_chipIcon_1u1to_47",b1="_chipClickable_1u1to_58",m={wrapper:x1,title:y1,chips:u1,chip:v1,chipIcon:w1,chipClickable:b1},N1=({title:t,softPercent:o,hardPercent:r,onSoftClick:g,onHardClick:C,className:h=""})=>{const y=o!=null,x=r!=null;return!y&&!x?null:e.jsxs("div",{className:`${m.wrapper} ${h}`,children:[e.jsx("p",{className:`${m.title} body-3`,children:t}),e.jsxs("div",{className:m.chips,children:[y&&e.jsxs("div",{className:`${m.chip} ${g?m.chipClickable:""}`,onClick:g,role:g?"button":void 0,tabIndex:g?0:void 0,children:[e.jsx(g1,{className:m.chipIcon}),e.jsx("span",{className:"body-3",children:"Софты"}),e.jsxs("span",{className:"h3",children:[o,"%"]})]}),x&&e.jsxs("div",{className:`${m.chip} ${C?m.chipClickable:""}`,onClick:C,role:C?"button":void 0,tabIndex:C?0:void 0,children:[e.jsx(p1,{className:m.chipIcon}),e.jsx("span",{className:"body-3",children:"Харды"}),e.jsxs("span",{className:"h3",children:[r,"%"]})]})]})]})};export{N1 as C,p1 as S,g1 as a,S1 as b,M1 as c,j1 as l};