"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[113],{22711:function(e,t,n){n.d(t,{H:function(){return eB}});var i=n(57437),s=n(2265),l=n(80684),r=n(35563),a=n(75461),o=n(61994),c=n(77337),d=n(49750),u=n(94246),p=n(52074);let h=(0,p.g)("header","sc"),m=Object.freeze({header:`${h}`,fixed:`${h}__fixed`,hidden:`${h}__fixed--hidden`,transparent:`${h}--transparent`,navigationOpen:`${h}__navigation-open`,container:`${h}__container`,leftRow:`${h}__left-row`,logo:`${h}__logo`,menuItems:`${h}__menu-items`,menuItemActive:`${h}__menu-item-active`,tabletMenuButton:`${h}__tablet-menu-button`,buttonGroup:`${h}__button-group`,chips:`${h}__chips`,menuButton:`${h}__menu-button`,moreButtons:`${h}__more-buttons`,auth:`${h}__auth`,whiteIcons:`${h}__white-icons`,close:`${h}__close`,removed:`${h}__removed`,overlay:`${h}__overlay`,overlayOpening:`${h}__overlay--opening`,overlayClosing:`${h}__overlay--closing`}),v="user_region",g="user_town",_="cb-header",x=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],f=x.reduce((e,t)=>(e[t.id]=t.label,e),{}),w=Object.freeze({mobile:56,desktop:80}),b={userRegion:v,userTown:g,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},j={userRegion:v,userTown:g,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},k=(e=!1)=>e?j:b,y=(e=!1)=>e?window.allRegionsNewApi:window.allRegions,$=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},N=function(e){if(typeof window>"u"||!window.localStorage)return null;let t=window.localStorage.getItem(e);if(!t||"undefined"===t)return null;try{return JSON.parse(t)}catch(t){console.warn(`Invalid object in localStorage for key "${e}": ${t}`)}return null},C=(e,t,n)=>{(0,d.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})},T=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),s=!1,l=0,r=0,a=()=>window.innerWidth<768,o=a(),c=()=>window.scrollY||document.documentElement.scrollTop,d=()=>{let e=document.querySelector(":root");e&&(r=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),l=c())},u=()=>{let e=a();e!==o&&(o=e,r=0)},p=function(){let a=c(),o=document.getElementById("headerNotice"),u=null==o?void 0:o.getAttribute("data-opening");if("true"===u)return;r||d();let p=a<r,h=a<((null==i?void 0:i.clientHeight)||0);if(n&&h||p){s=!1,e(!1),t(!0);return}e(s=a>l),s&&setTimeout(()=>t(!1),50);let m=s?"0px":"false"===u?`${r}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",m),document.documentElement.style.setProperty("--new-header-height-mobile",m),l=a<=0?0:a};return window.addEventListener("scroll",p),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",u)}},O=()=>{let e=new URLSearchParams(window.location.search),t={};for(let[n,i]of Array.from(e.entries()))n.startsWith("utm_")&&(t[n]=i);return Object.keys(t).length>0?t:null},S=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),I=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let s=encodeURIComponent(JSON.stringify(t)),l=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${s};expires=${i.toUTCString()};path=/;SameSite=Lax${l}`},A=()=>{let e=O();e&&!S()&&I("utm_params",e,90),e&&I("utm_last",e,90)},L=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{A()}catch(e){console.error("UTM tracking error:",e)}},0)},R=(e,t,n)=>(0,d.h)({eventCategory:_,eventActionType:e,eventActionText:t,eventLabel:n}),z=(0,p.g)("navigation-chips","sc"),B=Object.freeze({wrapper:`${z}__wrapper`,gray:`${z}__variantGray`,white:`${z}__variantWhite`,container:`${z}__container`,chip:`${z}__chip`,more:`${z}__chip--more`,active:`${z}__chip--active`,label:`${z}__label`,hidden:`${z}__hidden`}),E=(0,p.g)("navigation-content","sc"),M=Object.freeze({contentWrapper:`${E}__content-wrapper`,content:`${E}__content`,contentOpen:`${E}__content--open`,contentHeader:`${E}__content-header`,contentTitle:`${E}__content-title`,contentTitleUrl:`${E}__content-title--url`,contentTitleLink:`${E}__content-title--link`,contentTitleNew:`${E}__content-title--new`,new:`${E}__new`,newInline:`${E}__new-inline`,vip:`${E}__vip`,arrowIcon:`${E}__arrow-icon`,links:`${E}__links`,linksColumns:`${E}__links--columns`,linksTitleless:`${E}__links--titleless`,removed:`${E}__removed`,hidden:`${E}__content--hidden`}),W=({chip:e,hidden:t,onClick:n,refCallback:s,activeChipId:r})=>{let a=!!n,c=()=>{if(a)return null==n?void 0:n(e.url);R(d.D.chip,e.title,`${e.title}_${e.url}`)},u=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:B.label,children:e.title}),e.arrow&&(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,o.Z)(B.chip,{[B.hidden]:t,[M.new]:!!e.new,[M.vip]:!!e.vip,[B.active]:e.url===r});return a?(0,i.jsx)("button",{type:"button",className:p,onClick:c,ref:s,children:u}):(0,i.jsx)("a",{href:e.url,className:p,onClick:c,ref:s,children:u})},P=({items:e=[],maxNumberOfLines:t,variant:n,className:r,activeChipId:a,onClick:c})=>{let u=(0,s.useRef)(null),p=(0,s.useRef)(null),h=(0,s.useRef)({}),[m,v]=(0,s.useState)(!1),[g,_]=(0,s.useState)(e.length),[x,f]=(0,s.useState)(!1);(0,s.useMemo)(()=>{let t=h.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(n=>{e.find(e=>String(e.url)===String(n))||delete t[n]})},[e]);let w=(0,s.useCallback)(()=>{let n=u.current;if(!n)return;let i=e=>e?e.getBoundingClientRect().width:0,s=i(n),l=Math.max(Number(t)||0,0),r=()=>{_(e.length),f(!1)};if(m||0===l||s<=0){r();return}let a=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),o=i(p.current),c=e.map(e=>i(h.current[e.url]));if(c.some(e=>0===e)){r();return}let d=1,v=0,g=0;for(let e of c){let t=d===l?o+a:0,n=0===v?e:v+a+e;if(n+t<=s-.5)v=n,g++;else{if(++d>l)break;v=e,g++}}f(g<e.length),_(g)},[m,e,t]);(0,s.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(w)});return t.observe(e),requestAnimationFrame(w),()=>{t.disconnect()}},[w]),(0,s.useEffect)(()=>{requestAnimationFrame(w)},[w]);let b=m||(t??0)<=0||!x;return(0,i.jsx)("div",{className:(0,o.Z)(r,B.wrapper,{[B.gray]:"gray"===n,[B.white]:"white"===n}),children:(0,i.jsxs)("div",{ref:u,className:B.container,children:[e.map((e,t)=>(0,i.jsx)(W,{chip:e,hidden:!b&&t>=g,activeChipId:a,onClick:c,refCallback:t=>{h.current[e.url]=t}},e.url)),!b&&x&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,o.Z)(B.chip,B.more),onClick:()=>{R(d.D.chip,"Еще"),v(!0)},children:[(0,i.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:B.label,children:"Еще"})]}),(b||!x)&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,o.Z)(B.chip,B.more,B.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,i.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:B.label,children:"Еще"})]})]})})},U=((e=!1)=>{if(typeof window>"u")return[];let t=y(e);if(Array.isArray(t)&&t.length>0)return t;let n=N(k(e).allRegions)||[];return $(n,e),n})(),F=(e=>{let t={};return e.map(({id:e,name:n,towns:i})=>(i.forEach(i=>{i.parentId=e,t[i.name]=t[i.name]||{},t[i.name][i.id]=n}),i)).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])})(U),D=(0,s.createContext)({regions:U,towns:F,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null});function Z(){return(0,s.useContext)(D)}let H=()=>{let e=(0,s.useRef)(null),t=(0,s.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,s.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,s.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},q=(0,p.g)("city-select-modal-body","sc"),G=Object.freeze({wrapper:`${q}__wrapper`,subtitle:`${q}__subtitle`,hintWrapper:`${q}__hint-wrapper`,hintText:`${q}__hint-text`,input:`${q}__input`,chips:`${q}__chips`,townsListWrapper:`${q}__towns-list-wrapper`,townsList:`${q}__towns-list`,townsGroup:`${q}__towns-group`,townsGroupLabel:`${q}__towns-group-label`,townsGroupList:`${q}__towns-group-list`,townsName:`${q}__towns-name`,regionName:`${q}__region-name`}),V=({groupedTowns:e,chips:t,query:n,setQuery:r,isDrawer:o})=>{var c;let u=Z(),p=(0,s.useRef)(null),[h,m]=(0,s.useState)("10000px");(0,s.useEffect)(()=>{if(!o||!p.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let s=n.map(e=>[...e]),l=s.map(e),r=l.reduce((e,t,n)=>t<l[e]?n:e,0);0===r&&s[0].push(s[1].shift()),2===r&&s[2].unshift(s[1].pop()),1===r&&l[0]>l[2]&&s[1].unshift(s[0].pop()),1===r&&l[0]<l[2]&&s[1].push(s[2].shift());let a=Math.max(...s.map(e));return a>=i?i:t(s,a)};new ResizeObserver(()=>{var e;if(!(null!=(e=p.current)&&e.children))return;let n=Array.from(p.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let i=0;try{i=t([[],n,[]],1/0)}catch{i=0}i>0&&m(`${i}px`)}).observe(p.current)},[]);let v=e=>{if(C(d.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return u.selectCity();let t=u.regions.find(t=>t.id===Number(e.parentId))||null;u.selectCity(t,e)};return(0,i.jsxs)("div",{className:G.wrapper,children:[(0,i.jsxs)("div",{className:G.subtitle,children:["Покажем предложения рядом с вами",(0,i.jsxs)("div",{className:G.hintWrapper,children:[(0,i.jsx)(l.IconFdsQuestionCircleO,{size:24}),(0,i.jsx)("div",{className:G.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,i.jsx)(a.MA,{className:G.input,value:n,onChange:r,size:"s",placeholder:"Введите название города",icon:n?(0,i.jsx)(l.IconFdsCloseCircleO,{size:24,onClick:()=>r("")}):(0,i.jsx)(l.IconFdsSearchO,{size:24})}),(0,i.jsx)(a.cL,{className:G.chips,chips:t,value:(null==(c=u.town)?void 0:c.id)||0,onChipClick:e=>{v(u.towns.find(t=>t.id===e))}}),(0,i.jsx)("div",{className:G.townsListWrapper,children:(0,i.jsx)("div",{ref:p,className:G.townsList,style:{maxHeight:h},children:e.map(e=>(0,i.jsxs)("div",{className:G.townsGroup,children:[(0,i.jsx)("div",{className:G.townsGroupLabel,children:e.letter}),(0,i.jsx)("div",{className:G.townsGroupList,children:e.towns.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>v(e),children:[(0,i.jsx)("div",{className:G.townsName,children:e.name}),(0,i.jsx)("div",{className:G.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},Q=[1095,1096,134,720,189,180],J=()=>{var e;let t=Z(),n=(0,a._m)("l"),[l,r]=(0,s.useState)(""),o=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,c=(0,s.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(l.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[l,t.towns.length]),p=(0,s.useMemo)(()=>[{id:0,label:"Вся Россия"},...Q.map(e=>{let n=t.towns.find(t=>t.id===e);return{id:null==n?void 0:n.id,label:null==n?void 0:n.name}}).filter(e=>(null==e?void 0:e.id)!==void 0)],[t.towns.length]),h=()=>{C(d.D.button,"close"),t.handleToggleModal(!1)};return(0,i.jsxs)(u.P,{children:[!n&&(0,i.jsx)(u.U,{title:o,isOpen:t.popupVisible,onClose:h,full:!0,children:(0,i.jsx)(V,{groupedTowns:c,chips:p,query:l,setQuery:r})}),n&&(0,i.jsx)(u.D,{title:o,isOpen:t.popupVisible,onClose:h,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,i.jsx)(V,{groupedTowns:c,chips:p,query:l,setQuery:r,isDrawer:!0})})]})},X={"uat-mp.beta.moex.com":"//chat-marketplace.beta.moex.com","finuslugi.ru":"//chat.finuslugi.ru","dev-rc.beta.moex.com":"//dev-opbot.tech.finuslugi.ru"},Y=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(X,e)?X[e]:X["finuslugi.ru"]},K=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=`${e}/assets/css/${t}`,document.head.appendChild(n);let i=document.createElement("script");i.src=`${e}/get-bootstrap/${t}`,i.defer=!0,document.body.appendChild(i)},ee=()=>new MutationObserver(e=>{e.forEach(e=>{if("style"===e.attributeName){let e=document.querySelector(".webchat"),t=!!e&&"none"!==e.style.display;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.isOpened=t)}})}),et=()=>{let[e,t]=(0,s.useState)(!1),[n,i]=(0,s.useState)(!1),l=(0,s.useRef)(!1),r=e=>{l.current=e,i(e)};return(0,s.useEffect)(()=>{if(typeof window>"u")return;let e=Y(),n="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:t=>{if(t.host&&(e=t.host),t.channel&&(n=t.channel),t.user){let e="function"==typeof t.user?t.user:()=>({...t.user});window.__WebchatUserCallback=e}},open:()=>new Promise(e=>{e()}),close:()=>null,toggle:()=>null}};let i=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((s,a)=>{if(l.current){a(Error("chat is already opened"));return}i?(i.openWidget(),t(!1),s()):(r(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let l=document.querySelector(".webchat");l&&ee().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),r(!1),t(!1),s()},K(e,n))}),window.supportWidget.craftTalk.toggle=()=>{var e,t,n,i;null!=(t=null==(e=window.supportWidget)?void 0:e.craftTalk)&&t.isOpened?window.supportWidget.craftTalk.close():null==(i=null==(n=window.supportWidget)?void 0:n.craftTalk)||i.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:t,isChatLoading:n}},en=(0,s.createContext)({isAuth:!1,isHeaderHidden:!1,isHeaderTransparent:!1,openedBlock:null,setOpenedBlock:()=>null,openedSection:null,setOpenedSection:()=>null,isNavigationOpen:!1,isNavigationMounted:!1,navMenuItemsRef:{current:null},navigationRef:{current:null},ignoreClicks:!1,setIgnoreClicks:()=>null,isChatModalOpen:!1,setIsChatModalOpen:()=>null,isChatLoading:!1,fixedContainerRef:{current:null},headerRef:{current:null}});function ei(){return(0,s.useContext)(en)}let es=e=>{let[t,n]=(0,s.useState)(!1),[l,r]=(0,s.useState)(!1),[a,o]=(0,s.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:d,isChatLoading:p}=et(),[h,m]=(0,s.useState)(null),[v,g]=(0,s.useState)(null),[_,x]=(0,s.useState)(!1),[f,w]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),k=(0,s.useRef)(null),y=(0,u.u)(_),$=(0,s.useRef)(null),N=(0,s.useRef)(null),C=(0,s.useRef)(null),O=(0,s.useRef)(null),S=(0,s.useCallback)(()=>{y.current&&y.current.scrollTo({top:0})},[y]),I=(0,s.useCallback)(e=>{g(e),S()},[S]),A=(0,s.useCallback)(e=>{$.current&&clearTimeout($.current),e&&w(!0),e||($.current=setTimeout(()=>{w(!1),I(null)},300))},[I]),R=(0,s.useCallback)((e,t,n)=>{if(t&&I(t),!n&&e===h||!e){A(!_),x(!_);return}m(e),A(!0),x(!0)},[h,I,_,A]),z=(0,s.useCallback)(()=>{N.current&&clearTimeout(N.current),j(!0),N.current=setTimeout(()=>{j(!1)},650)},[]);return(0,s.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=T(r,o,e.isMainBannerPage);return L(),t},[]),(0,i.jsx)("header",{children:(0,i.jsx)(en.Provider,{value:{isAuth:t,isHeaderHidden:l,isHeaderTransparent:a,openedBlock:h,setOpenedBlock:R,openedSection:v,setOpenedSection:I,isNavigationOpen:_,isNavigationMounted:f,navMenuItemsRef:k,navigationRef:y,ignoreClicks:b,setIgnoreClicks:z,isChatModalOpen:c,setIsChatModalOpen:d,isChatLoading:p,fixedContainerRef:C,headerRef:O},children:e.children})})},el=({label:e,onClick:t,eventActionText:n,eventLabel:s,...l})=>(0,i.jsx)(a.zx,{label:e,onClick:e=>{null==t||t(e),(0,d.h)({eventCategory:_,eventActionType:d.D.button,eventActionText:n||"",eventLabel:s||""})},...l}),er=(0,p.g)("header-popup","sc"),ea=Object.freeze({popup:`${er}__popup`,popupHeader:`${er}__popup-header`,popupClose:`${er}__popup-close`,body:`${er}__body`}),eo=({isOpen:e,onClose:t,children:n,title:s})=>{let r=(0,a._m)("l");return(0,i.jsxs)(u.P,{children:[!r&&(0,i.jsx)(u.U,{title:s,isOpen:e,onClose:t,children:n}),r&&e&&(0,i.jsxs)("div",{className:ea.popup,children:[(0,i.jsxs)("div",{className:ea.popupHeader,children:[s,(0,i.jsx)(el,{className:ea.popupClose,iconLeft:(0,i.jsx)(l.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,i.jsx)("div",{className:ea.body,children:n})]})]})},ec=(0,p.g)("start-choice-popup","sc"),ed=Object.freeze({top:`${ec}__top`,progress:`${ec}__progress`,innerCircle:`${ec}__inner-circle`,title:`${ec}__title`,subtitle:`${ec}__subtitle`,actions:`${ec}__actions`}),eu=()=>{var e,t;let n=Z(),[l,r]=(0,s.useState)(10),[a,o]=(0,s.useState)(0),c=(0,s.useRef)(void 0),u=()=>{C(d.D.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(n.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(n.startRegion)||""),n.setStartPopupVisible(!1)};return(0,s.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+l).slice(1)),t=1e3*e/100,n=0,i=0;c.current=setInterval(()=>{n++,i+=t,o(3.6*n);let s=e-Math.floor(i/1e3);s<l&&r(s),100===n&&(clearInterval(c.current),u())},t)})():(clearInterval(c.current),r(10),o(0))},[n.startPopupVisible]),(0,i.jsxs)(eo,{isOpen:n.startPopupVisible,onClose:u,title:(0,i.jsx)("button",{type:"button",className:ed.progress,style:{background:`conic-gradient(#ff0508 ${a}deg, #e3e7ec 0deg)`},onClick:u,children:(0,i.jsx)("div",{className:ed.innerCircle,children:l})}),children:[(0,i.jsxs)("div",{className:ed.top,children:[(0,i.jsxs)("div",{className:ed.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,i.jsx)("div",{className:ed.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,i.jsxs)("div",{className:ed.actions,children:[(0,i.jsx)(el,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{C(d.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,i.jsx)(el,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{C(d.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},ep=(0,p.g)("city-select","sc"),eh=Object.freeze({button:`${ep}__button`,minimal:`${ep}__minimal`,full:`${ep}__full`}),em=({initialTown:e})=>{var t;let n=Z(),r=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:d}=ei(),{startPopupVisible:u,setStartPopupVisible:p,popupVisible:h}=n,m=(0,s.useRef)();(0,s.useEffect)(()=>{h&&(m.current="popup")},[h]),(0,s.useEffect)(()=>{d&&(m.current="chat")},[d]),(0,s.useEffect)(()=>{u&&(m.current="startPopup")},[u]),(0,s.useEffect)(()=>{m.current&&("chat"===m.current&&u?p(!1):["startPopup","popup"].includes(m.current)&&d&&c(!1))},[h,d,u,p,c]);let v={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,i.jsx)(l.IconFdsLocationO,{size:24})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.zx,{...v,className:(0,o.Z)(eh.button,eh.full),label:r}),(0,i.jsx)(a.zx,{...v,className:(0,o.Z)(eh.button,eh.minimal),shape:"icon"}),(0,i.jsx)(J,{}),(0,i.jsx)(eu,{})]})},ev=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:s,...l})=>(0,i.jsx)(a.rU,{onClick:i=>{null==e||e(i),(0,d.h)({eventCategory:_,eventActionType:t||d.D.link,eventActionText:n||"",eventLabel:s||""})},...l}),eg=(0,p.g)("header-mobile-app-banner","sc"),e_=Object.freeze({wrapper:`${eg}__wrapper`,container:`${eg}__container`,closeButton:`${eg}__close-button`,innerWrapper:`${eg}__inner-wrapper`,imageWrapper:`${eg}__image-wrapper`,image:`${eg}__image`,title:`${eg}__title`,description:`${eg}__description`,callToAction:`${eg}__call-to-action`,scanQr:`${eg}__scan-qr`}),ex=Object.freeze({mobile:56,desktop:68}),ef="headerBannerShownAt",ew=()=>{let e=localStorage.getItem(ef);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},eb=()=>{localStorage.setItem(ef,new Date().toISOString())},ej=()=>{let e=ew();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},ek=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:u,headerRef:p}=ei(),[h,m]=(0,s.useState)(!1),[v,g]=(0,s.useState)(!1),[_,x]=(0,s.useState)(!1),f=(0,s.useCallback)((e="desktop")=>{let t=u.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${ex[e]+w[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ex.desktop+w.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ex.mobile+w.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ex.mobile+w.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ex.desktop+w.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ex[e]+108}px`))},[]),b=(0,s.useCallback)(()=>{let e=u.current;e&&(document.documentElement.style.removeProperty("--fixed-header-height"),document.documentElement.style.removeProperty("--new-header-height-desktop"),document.documentElement.style.removeProperty("--new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-desktop"),document.documentElement.style.removeProperty("--header-height"),e.style.transform="")},[]);return(0,s.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{v&&m(!1),x(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[v]),(0,s.useEffect)(()=>{ej()&&m(!0)},[]),(0,s.useEffect)(()=>{let e=window.innerWidth<768;h&&(f(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?m(!0):x(!0));let t=()=>{if(!h)return null;f(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{b(),window.removeEventListener("resize",t)}},[h,f,b]),h?(0,i.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":_,className:(0,o.Z)(e_.wrapper,t),children:(0,i.jsx)(r.W2,{children:(0,i.jsxs)("div",{className:e_.container,children:[(0,i.jsxs)("div",{className:e_.innerWrapper,children:[(0,i.jsxs)("picture",{className:e_.imageWrapper,children:[(0,i.jsx)("source",{srcSet:(0,c.xn)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{className:e_.image,src:(0,c.xn)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,i.jsxs)("div",{className:e_.scanQr,children:[(0,i.jsx)("div",{className:e_.title,children:"Скачайте приложение Финуслуги"}),(0,i.jsx)("div",{className:e_.description,children:"Сканируйте QR-код"})]}),(0,i.jsxs)("div",{className:e_.callToAction,children:[(0,i.jsxs)("div",{children:["Приложение",(0,i.jsx)("br",{}),"Финуслуги"]}),(0,i.jsx)(a.zx,{onClick:()=>{R(d.D.button,"skachat_mob_prilozheniye_fu"),window.open(n,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,i.jsx)("div",{"aria-label":"Закрыть",role:"button",className:e_.closeButton,onClick:()=>{eb(),b(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?m(!1):g(!0)},children:(0,i.jsx)(l.IconFdsCloseO,{size:"100%"})})]})})}):null},ey=(0,p.g)("header-chat-modal-body","sc"),e$=Object.freeze({wrapper:`${ey}__wrapper`,cardButton:`${ey}__card-button`,card:`${ey}__card`,cardTitle:`${ey}__card-title`,cardSubtitle:`${ey}__card-subtitle`,button:`${ey}__button`}),eN=()=>{let e=ei();return(0,i.jsxs)("div",{className:e$.wrapper,children:[(0,i.jsx)(el,{className:e$.cardButton,variant:"secondary",pending:e.isChatLoading,onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},eventActionText:"Напишите в чат",children:(0,i.jsxs)(r.Zb,{className:e$.card,variant:"secondary",children:[(0,i.jsxs)("div",{className:e$.cardTitle,children:[(0,i.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,i.jsxs)("p",{className:e$.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,i.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eC=({data:e,isMobile:t})=>{let n=ei();return(0,i.jsx)("div",{className:M.contentWrapper,children:e.map(e=>(0,i.jsx)(s.Fragment,{children:e.sections.map(e=>{var s;return(0,i.jsxs)("div",{className:(0,o.Z)(M.content,{[M.hidden]:n.openedSection!==e.id,[M.contentOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:M.contentHeader,children:(0,i.jsx)("label",{children:e.title})}),null==(s=e.content)?void 0:s.map((n,s)=>{var r,a;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:(0,o.Z)(M.contentTitle,{[M.removed]:!n.title,[M.contentTitleUrl]:!!n.url,[M.contentTitleLink]:!!e.isSeeAllLinkAvailable,[M.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,i.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,i.jsx)("div",{className:M.arrowIcon,children:(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(r=n.links)&&r.length)&&(0,i.jsx)(P,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(a=n.links)&&a.length)&&(0,i.jsx)("div",{className:(0,o.Z)(M.links,{[M.linksColumns]:!!n.columns,[M.linksTitleless]:!n.title}),children:n.links.map(e=>(0,i.jsxs)("a",{href:e.url,onClick:()=>R(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{className:M.arrowIcon,children:(0,i.jsx)(l.IconFdsArrowUpRightSmallO,{})}),(0,i.jsxs)("span",{children:[(0,i.jsx)("span",{children:e.title}),!!e.new&&(0,i.jsx)("span",{className:(0,o.Z)({[M.newInline]:!!e.new})})]})]},e.url))})]},`${n.url}_${s}`)})]},e.id)})},e.id))})},eT=(0,p.g)("navigation-section-icon","sc"),eO=Object.freeze({icon:`${eT}`}),eS=({name:e,background:t})=>{let n=(0,s.useMemo)(()=>e&&l[e]||null,[e]);return e&&n?(0,i.jsx)("div",{className:eO.icon,style:{background:t},children:(0,i.jsx)(n,{})}):null},eI=(0,p.g)("navigation","sc"),eA=Object.freeze({navigation:`${eI}`,navigationOpening:`${eI}--opening`,navigationClosing:`${eI}--closing`,wrapper:`${eI}__wrapper`,container:`${eI}__container`,containerOpen:`${eI}__container--open`,sections:`${eI}__sections`,sectionsOpen:`${eI}__sections--open`,citySelectButton:`${eI}__city-select-button`,sectionsTitle:`${eI}__sections-title`,sectionsWrapper:`${eI}__sections-wrapper`,section:`${eI}__section`,sectionArrow:`${eI}__section-arrow`,sectionExtra:`${eI}__section--extra`,sectionActive:`${eI}__section--active`,sectionTitle:`${eI}__section-title`,chatWrapper:`${eI}__chat-wrapper`,chatHeader:`${eI}__chat-header`,backButton:`${eI}__back-button`,useful:`${eI}__useful`,usefulOpen:`${eI}__useful--open`,usefulTitle:`${eI}__useful-title`,usefulGrid:`${eI}__useful-grid`,removed:`${eI}__removed`}),eL=({data:e})=>{var t;let n=ei(),c=Z(),u=(0,a.aF)("m"),[p,h]=(0,s.useState)(!0);(0,s.useEffect)(()=>{h(u)},[u]);let m=(0,s.useRef)(null),v=(0,s.useCallback)(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),g=(0,s.useRef)(!1),_=(0,s.useRef)(null),x=(0,s.useCallback)(()=>{p&&(g.current=!0,_.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),v()},window.history.pushState(null,"",window.location.href))},[v,p]),w=(0,s.useCallback)(()=>{g.current=!1,window.onpopstate=_.current,window.history.go(-1)},[]),b=(0,s.useRef)(null),j=(0,s.useCallback)(e=>{if(p||!n.navMenuItemsRef.current||!n.navigationRef.current)return;let t=e.target,i=!n.navMenuItemsRef.current.contains(t)&&!n.navigationRef.current.contains(t);if(i&&!b.current){n.setIgnoreClicks(),b.current=setTimeout(()=>n.setOpenedBlock(null),300);return}!i&&b.current&&(clearTimeout(b.current),b.current=null)},[p,n]),k=(0,s.useRef)(null),y=(0,s.useCallback)(e=>{typeof window>"u"||(e?(k.current=j,window.addEventListener("mousemove",k.current)):k.current&&window.removeEventListener("mousemove",k.current))},[j]);(0,s.useEffect)(()=>{y(n.isNavigationOpen),n.isNavigationOpen&&!g.current&&x(),!n.isNavigationOpen&&g.current&&w()},[n.isNavigationOpen]);let $=(e,t)=>()=>{R(d.D.button,t),n.setOpenedSection(e)},{start:N,clear:C}=H(),T=(e,t)=>()=>{p||N($(e,t),150)},O=()=>{p||C()};return(0,i.jsx)("div",{ref:n.navigationRef,className:(0,o.Z)(eA.navigation,{[eA.removed]:!n.isNavigationMounted,[eA.navigationOpening]:n.isNavigationOpen,[eA.navigationClosing]:!n.isNavigationOpen}),children:(0,i.jsx)("div",{className:eA.wrapper,children:(0,i.jsxs)(r.W2,{className:(0,o.Z)(eA.container,{[eA.containerOpen]:!!n.openedSection}),children:[(0,i.jsxs)("div",{className:(0,o.Z)(eA.sections,{[eA.sectionsOpen]:!!n.openedSection}),children:[(0,i.jsx)(a.zx,{className:eA.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>c.handleButtonClick(!1),iconLeft:(0,i.jsx)(l.IconFdsLocationO,{size:24}),label:(null==(t=c.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,i.jsxs)("ul",{className:(0,o.Z)(eA.sectionsWrapper,{[eA.removed]:n.openedBlock!==e.id&&!p}),children:[(0,i.jsx)("div",{className:eA.sectionsTitle,children:f[e.id]}),e.sections.map(e=>(0,i.jsxs)("li",{className:(0,o.Z)(eA.section,{[eA.sectionExtra]:!!e.extra,[eA.sectionActive]:n.openedSection===e.id}),onClick:$(e.id,e.title),onMouseEnter:T(e.id,e.title),onMouseLeave:O,children:[(0,i.jsx)(eS,{name:e.uikitIcon,background:e.uikitIconBg}),(0,i.jsx)("span",{className:eA.sectionTitle,children:e.title}),(0,i.jsx)("div",{className:eA.sectionArrow,children:(0,i.jsx)(l.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,i.jsxs)("div",{className:eA.chatWrapper,children:[(0,i.jsx)("div",{className:eA.chatHeader,children:"Нужна помощь?"}),(0,i.jsx)(eN,{})]})]}),(0,i.jsxs)("button",{type:"button",className:(0,o.Z)(eA.backButton,{[eA.removed]:!n.openedSection}),onClick:()=>{R(d.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,i.jsx)(l.IconFdsChevronLeftO,{size:24}),(0,i.jsx)("span",{children:"Назад"})]}),(0,i.jsx)(eC,{data:e,isMobile:p}),(0,i.jsxs)("div",{className:(0,o.Z)(eA.useful,{[eA.usefulOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:eA.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,i.jsx)(s.Fragment,{children:e.sections.map(e=>{var t;return(0,i.jsx)("div",{className:(0,o.Z)(eA.usefulGrid,{[eA.removed]:n.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,i.jsxs)("a",{href:e.url,onClick:()=>R(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{children:(0,i.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id)})},e.id))]})]})})})},eR=(e,t,n)=>{var i,s,l,r,a,o,d;let u=(null==(s=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:s.call(i,({id:e})=>"news"===e))||-1,p=(null==(r=null==(l=null==e?void 0:e.NAVIGATOR)?void 0:l[u])?void 0:r.content)||[];if(null!=(d=null==(o=null==(a=null==e?void 0:e.NAVIGATOR)?void 0:a[u])?void 0:o.content)&&d[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,c.xn)(t||"",n),new:0}));e.NAVIGATOR[u].content[0].links=i}return[{id:"FINPRODUCTS",sections:Array.isArray(null==e?void 0:e.FINPRODUCTS)?null==e?void 0:e.FINPRODUCTS:[]},{id:"NAVIGATOR",sections:Array.isArray(null==e?void 0:e.NAVIGATOR)?null==e?void 0:e.NAVIGATOR:[]},{id:"ABOUT",sections:Array.isArray(null==e?void 0:e.ABOUT)?null==e?void 0:e.ABOUT:[]}]},ez=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:u="https://lk.finuslugi.ru/registration",initialTown:p,isMainBannerPage:h,enableAppHeaderBanner:v=!1,news:g,className:_})=>{let f=ei(),w=(0,s.useMemo)(()=>eR(e,t,g),[e,t,g]),b=null==e?void 0:e.config,j=(0,s.useMemo)(()=>w.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[w]),k=f.isAuth?"Личный кабинет":"Войти",y=h&&f.isHeaderTransparent,$=(e,t,n,i)=>()=>{e!==f.openedBlock?R(d.D.toggle,t,"on"):R(d.D.button,"menu_close","on");let s=n?j[e]:"";f.setOpenedBlock(e,s,!!i)},{start:N,clear:C}=H(),T=(e,t,n,i)=>()=>{f.isNavigationOpen&&e===f.openedBlock||f.setIgnoreClicks(),N($(e,t,n,i),200)},O=e=>()=>{f.ignoreClicks||e()},S=e=>f.openedBlock===e&&f.isNavigationOpen;return e?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:f.headerRef,className:(0,o.Z)(m.header,_,{[m.transparent]:y}),children:(0,i.jsxs)("div",{ref:f.fixedContainerRef,className:(0,o.Z)(m.fixed,{[m.hidden]:f.isHeaderHidden,[m.navigationOpen]:f.isNavigationOpen}),children:[!!(null!=b&&b.appBannerUrl)&&v&&(0,i.jsx)(ek,{mobileAppUrl:b.appBannerUrl,minioUrl:n}),(0,i.jsxs)(r.W2,{className:m.container,children:[(0,i.jsxs)("div",{className:m.leftRow,children:[(0,i.jsx)(ev,{className:m.logo,href:t,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,i.jsxs)("picture",{children:[(0,i.jsx)("source",{srcSet:(0,c.xn)(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{src:(0,c.xn)(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,i.jsx)("nav",{ref:f.navMenuItemsRef,className:m.menuItems,children:(0,i.jsx)("ul",{children:x.map(({id:e,label:t})=>(0,i.jsx)("li",{children:(0,i.jsx)(a.zx,{className:(0,o.Z)({[m.menuItemActive]:S(e)}),label:t,variant:"white",size:"xs",onClick:O($(e,t,!0)),onMouseEnter:T(e,t,!0,!0),onMouseLeave:C})},e))})}),(0,i.jsx)(el,{className:(0,o.Z)(m.tabletMenuButton,{[m.menuItemActive]:f.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,i.jsx)(l.IconFdsChevronDownO,{size:24}),onClick:$("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,i.jsxs)("div",{className:(0,o.Z)(m.buttonGroup,{[m.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,i.jsxs)("div",{className:m.chips,children:[(0,i.jsx)(el,{as:"a",href:u,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${u}`,iconLeft:(0,i.jsx)(l.IconFdsUserO,{size:20})}),(0,i.jsx)(el,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,i.jsx)(l.IconFdsChatDotsCircleO,{size:24})})]}),(0,i.jsx)(el,{className:m.menuButton,size:"xs",shape:y?"icon":"default",appearance:y?"ghost":"fill",label:"Меню",onClick:$("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,i.jsx)(l.IconFdsMenuSkewedO,{size:24})}),(0,i.jsxs)("div",{className:m.moreButtons,children:[(0,i.jsx)(em,{initialTown:p}),(0,i.jsx)(el,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",appearance:"ghost",eventActionText:"IconFdsChatDotsSquareAddO",iconLeft:(0,i.jsx)(l.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,i.jsx)(el,{as:"a",href:u,size:"xs",eventActionText:k,eventLabel:`${k}_${u}`,label:k})]})]}),(0,i.jsxs)(ev,{className:m.auth,href:u,eventActionText:k,eventLabel:`${k}_${u}`,children:[(0,i.jsx)(el,{size:"xs",shape:"circle-icon",iconLeft:(0,i.jsx)(l.IconFdsUserO,{}),eventActionText:k,eventLabel:`${k}_${u}`}),(0,i.jsx)("p",{children:k})]}),(0,i.jsx)("div",{className:m.close,children:(0,i.jsx)(el,{className:m.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,i.jsx)(l.IconFdsCloseO,{}),onClick:()=>f.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,i.jsx)("div",{className:(0,o.Z)(m.overlay,{[m.removed]:!f.isNavigationMounted,[m.overlayOpening]:f.isNavigationOpen,[m.overlayClosing]:!f.isNavigationOpen}),onClick:O(()=>f.setOpenedBlock(null))}),(0,i.jsx)(eL,{data:w,minioUrl:n})]}):null},eB=e=>(0,i.jsx)(es,{isMainBannerPage:e.isMainBannerPage,children:(0,i.jsx)(ez,{...e})})},31511:function(e,t,n){n.d(t,{C:function(){return j}});var i=n(57437),s=n(2265),l=n(35563),r=n(75461),a=n(61994),o=n(31620),c=n(80684),d=n(52074);let u=(0,d.g)("check-all","sc"),p=Object.freeze({wrapper:`${u}__wrapper`,link:`${u}__link`,icon:`${u}__icon`,iconGray:`${u}__icon--gray`}),h=({children:e,className:t,linkClassName:n,iconGrayBackground:s,Link:l,event:o,href:d,dataLayerPush:u})=>{let h=l??r.rU;return(0,i.jsx)("div",{className:(0,a.Z)(p.wrapper,t),onClick:()=>{o&&u(o)},children:(0,i.jsxs)(h,{className:(0,a.Z)(p.link,n),href:d,children:[e,(0,i.jsx)("span",{className:(0,a.Z)(p.icon,{[p.iconGray]:s}),children:(0,i.jsx)(c.IconFdsArrowUpRightSmallO,{size:24})})]})})},m=(0,d.g)("faq-block","sc"),v=Object.freeze({faqBlock:m,titleWrapper:`${m}__title-wrapper`,title:`${m}__title`,accordionWrapper:`${m}__accordion-wrapper`,accordionItems:`${m}__accordion-items`,accordionItemGray:`${m}__accordion-item--gray`,accordionItemContent:`${m}__accordion-item-content`,accordionActiveItemContent:`${m}__accordion-item-content--active`,states:{primary:`${m}--primary`,secondary:`${m}--secondary`,gray:`${m}--gray`}}),g=e=>{e.data.forEach((t,n)=>{"header"===t.type&&(e.headerBlocksCount++,3===e.headerBlocksCount&&("banner"===e.data[n-1].type&&(e.banner=e.data.splice(n-1,1)),"banner"===e.data[n+1].type&&(e.banner=e.data.splice(n+1,1))),e.banner&&4===e.headerBlocksCount&&e.data.splice(n,0,e.banner[0]))})},_=(0,d.g)("faq-content-block","sc"),x=Object.freeze({contentBlocks:`${_}__content-blocks`,blockLink:`${_}__block-link`,keynoteWrapper:`${_}__keynote-wrapper`,keynote:`${_}__keynote`,annotation:`${_}__annotation`,contentTableWrapper:`${_}__content-table-wrapper`}),f=({className:e,data:t})=>{if(!Array.isArray(t))return null;let n=(()=>{let e=[],n=1,s={data:t,headerBlocksCount:0,banner:[]};g(s),g(s);let l={},r=e=>{var t,n,i,s;let r=(null==(t=e.data)?void 0:t.text)??(null==(n=e.data)?void 0:n.url)??(null==(i=e.data)?void 0:i.html)??(null!=(s=e.data)&&s.year?String(e.data.year):"");return l[e.type]=(l[e.type]??0)+1,`${e.type}-${String(r).slice(0,80)}-${l[e.type]}`};return t.forEach(t=>{let s=r(t);switch(t.type){case"header":e.push((0,i.jsx)("h2",{id:`content_header_${n}`,role:"header",children:t.data.text||""},s)),n++;break;case"sub_header":e.push((0,i.jsx)("h3",{role:"sub-header",children:t.data.text||""},s));break;case"paragraph":e.push((0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"paragraph"},s));break;case"link":e.push((0,i.jsx)("div",{className:x.blockLink,children:(0,i.jsx)("a",{target:"_blank",href:t.data.url||"",role:"link",rel:"noreferrer",children:t.data.text||""})},s));break;case"dossier":e.push((0,i.jsxs)("div",{children:[(0,i.jsx)("span",{role:"dossier-year",children:t.data.year||""}),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"dossier-text"})]},s));break;case"html":e.push((0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.html||""},role:"html"},s));break;case"annotation":e.push((0,i.jsx)("div",{className:x.annotation,dangerouslySetInnerHTML:{__html:t.data.text||""},role:"annotation"},s));break;case"company-annotation":e.push((0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:t.data.text||""},role:"company-annotation"},s));break;case"keynote":e.push((0,i.jsx)("div",{className:x.keynoteWrapper,children:(0,i.jsx)("p",{className:x.keynote,dangerouslySetInnerHTML:{__html:t.data.text||""},role:"keynote"})},s));break;case"image":e.push((0,i.jsx)("img",{src:t.data.url||"",alt:"image"},s))}}),e})();return(0,i.jsx)("div",{className:(0,a.Z)(x.contentBlocks,e),role:"blocks",children:n})},w=({question:e,eventCategory:t,dataLayerPush:n,...s})=>(0,i.jsx)(r.Qd,{...s,title:e.question,children:(0,i.jsx)("div",{className:(0,a.Z)(v.accordionItemContent,{[v.accordionActiveItemContent]:s.isActive}),onClick:e=>{e.target instanceof HTMLAnchorElement&&n({event:"data-event",eventCategory:t,eventAction:"click_link",eventLabel:e.target.href})},children:"string"==typeof e.answer?(0,i.jsx)(f,{data:[{type:"html",data:{html:e.answer}}]}):e.answer})}),b=e=>{setTimeout(()=>{let{top:t}=e.getBoundingClientRect();t<80&&e.scrollIntoView({behavior:"smooth",block:"start"})},300)},j=({sectionTitle:e="Частые вопросы",innerTitle:t,questions:n=[],href:c,checkAllText:d,Link:u,className:p,eventCategory:m="cb-faq",multiple:g=!1,variant:_="secondary",dataLayerPush:x,tagTitle:f})=>{let j=g?n.map(e=>e.question):[],[k,y]=(0,s.useState)(j),$="gray"===_;return(0,i.jsx)("section",{className:(0,a.Z)(v.faqBlock,v.states[_],p),children:(0,i.jsxs)(l.W2,{children:[!t&&(0,i.jsx)("div",{className:v.titleWrapper,children:(0,i.jsx)(l.X6,{as:"h2",type:"display",className:v.title,children:e})}),(0,i.jsxs)("div",{className:v.accordionWrapper,children:[t&&(0,i.jsx)(l.X6,{as:"h3",type:"h1",style:{paddingBottom:"12px"},className:(0,a.Z)(v.title,`${v.title}--inner`),children:t}),(0,i.jsx)("div",{className:v.accordionItems,children:(0,i.jsx)(r.UQ,{activeIndex:k,variant:$?"primary":"secondary",withoutOutline:$,onTabToggle:e=>{let t=(null==e?void 0:e.length)>(null==k?void 0:k.length),n=e.filter(e=>!k.includes(e))[0]||k.filter(t=>!e.includes(t))[0];x({event:"data-event",eventCategory:m,eventAction:`click_togg_${t?"on":"off"}`,eventLabel:(0,o.t)(String(n))}),y(e);let i=`[data-accordion-index="${n}"]`,s=document.querySelector(i);s&&b(s)},multiple:g,children:n.map(e=>{let t=`faq-${e.question}`;return(0,i.jsx)(w,{id:t,question:e,dataLayerPush:x,eventCategory:m,className:$?v.accordionItemGray:void 0,tagTitle:f},t)})})}),c&&d&&(0,i.jsx)(h,{href:c,event:{event:"data-event",eventCategory:m,eventAction:"сlick_link_answer-link",eventLabel:c},dataLayerPush:x,...null!=u?{Link:u}:{},iconGrayBackground:!0,children:d||"Читать все вопросы"})]})]})})}}}]);