"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4981],{61311:(e,t,n)=>{n.d(t,{S:()=>p});var i=n(37876),l=n(14232),s=n(25904),r=n(49995),o=n(86029),a=n(21827);let c="https://assets.finuslugi.ru/mp-assets/user-agreement.pdf",u=(0,a.g)("cookies-plate","sc"),d=Object.freeze({wrapper:`${u}__wrapper`,contentWrapper:`${u}__content-wrapper`,visible:`${u}--visible`,hidden:`${u}--hidden`,content:`${u}__content`,text:`${u}__text`,link:`${u}__link`,button:`${u}__button`}),p=({className:e,mountDelay:t=3e3,href:n=c,children:a,closeIcon:u,onMount:p,onLinkClick:m,onClose:h,mountAfterScroll:g=!0})=>{let[w,v]=(0,l.useState)(!1),[f,_]=(0,l.useState)(!1),[x,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=()=>{document.removeEventListener("scroll",e),o.a.getItem("Allow-Cookie")||(b(!0),setTimeout(()=>{v(!0),null==p||p()},t))};return g?document.addEventListener("scroll",e):e(),()=>document.removeEventListener("scroll",e)},[]);let j=(0,l.useCallback)(()=>{o.a.setItem("Allow-Cookie","1"),_(!0),null==h||h(),setTimeout(()=>b(!1),1e3)},[h]);return x?(0,i.jsx)("div",{className:d.wrapper,children:(0,i.jsx)("div",{className:(0,r.A)(d.contentWrapper,{[d.visible]:w,[d.hidden]:f}),children:(0,i.jsxs)("div",{className:(0,r.A)(e,d.content),children:[a||(0,i.jsxs)("p",{className:d.text,children:["Мы используем"," ",(0,i.jsx)("a",{className:d.link,href:n,target:"_blank",rel:"noreferrer",onClick:m,children:"cookie"})," ","для лучшей работы сайта"]}),(0,i.jsx)("button",{className:d.button,onClick:j,children:u||(0,i.jsx)(s.IconFdsCloseO,{})})]})})}):(0,i.jsx)(i.Fragment,{})}},74055:(e,t,n)=>{n.d(t,{C:()=>et,H:()=>eP,u:()=>ee});var i=n(37876),l=n(14232),s=n(25904),r=n(25972),o=n(20988),a=n(49995),c=n(91273),u=n(8452),d=n(61133),p=n(86029),m=n(21827);let h=(0,m.g)("header","sc"),g=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`}),w="user_region",v="user_town",f="cb-header",_=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],x=_.reduce((e,t)=>(e[t.id]=t.label,e),{}),b=Object.freeze({mobile:56,desktop:80}),j={userRegion:w,userTown:v,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},C={userRegion:w,userTown:v,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},$=(e=!1)=>e?C:j,k=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},y=(e,t,n=!1)=>{if(typeof document>"u")return;let i=$(n);if(!e&&!t){p.a.removeItem(i.userRegion),p.a.removeItem(i.userTown);return}p.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),p.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},N=e=>{if(typeof document>"u")return null;let t=p.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},T=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},O=(e=!1)=>{if(typeof window>"u")return[];let t=((e=!1)=>e?window.allRegionsNewApi:window.allRegions)(e);if(Array.isArray(t)&&t.length>0)return t;let n=T($(e).allRegions)||[];return k(n,e),n},I=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),A=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]),[])},S=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,R=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},E=(e,t=!1)=>{if(e.length<1)return;let n=$(t);k(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},L=(e,t,n)=>{let i=null,l=null;n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,l=t,!0)});let s=t?e.find(e=>e.id===t.id)??null:null;return{region:i??s??t,town:l??n}},M=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),U=async()=>{let e=await R("https://finuslugi.ru/money_data/Root.json?short=1"),t=Array.isArray(null==e?void 0:e.regions)?e.regions:[];return E(t),t},z=async e=>{let[t,n]=await Promise.all([R(S(e,"/sc/api/v1/cities?all=true&isActive=true")),R(S(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==t?void 0:t.content)||!Array.isArray(null==n?void 0:n.content))return[];let i=((e,t)=>{let n=t.filter(e=>e.isActive).map(e=>({id:e.geoRegionId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,region_id:e.geoRegionId,enabled:+!!e.isActive,fiasId:e.fiasId,towns:[]})),i=n.reduce((e,t)=>(e[t.id]=t,e),{});return e.forEach(e=>{let t=i[e.geoRegionId];t&&t.towns.push({id:e.legacyId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,main:+!!e.isRegionalCenter,newId:e.id,fiasId:e.fiasId})}),n})(t.content,n.content);return I(i)?(E(i,!0),i):[]},P=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?z(e):U(),B=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},F=(e,t,n)=>{(0,u.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})},W=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let l=encodeURIComponent(JSON.stringify(t)),s=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${l};expires=${i.toUTCString()};path=/;SameSite=Lax${s}`},D=(e,t,n)=>(0,u.h)({eventCategory:f,eventActionType:e,eventActionText:t,eventLabel:n}),V=(0,m.g)("navigation-chips","sc"),G=Object.freeze({wrapper:`${V}__wrapper`,gray:`${V}__variantGray`,white:`${V}__variantWhite`,container:`${V}__container`,chip:`${V}__chip`,more:`${V}__chip--more`,active:`${V}__chip--active`,label:`${V}__label`,hidden:`${V}__hidden`}),H=(0,m.g)("navigation-content","sc"),q=Object.freeze({contentWrapper:`${H}__content-wrapper`,content:`${H}__content`,contentOpen:`${H}__content--open`,contentHeader:`${H}__content-header`,contentTitle:`${H}__content-title`,contentTitleUrl:`${H}__content-title--url`,contentTitleLink:`${H}__content-title--link`,contentTitleNew:`${H}__content-title--new`,new:`${H}__new`,newInline:`${H}__new-inline`,vip:`${H}__vip`,arrowIcon:`${H}__arrow-icon`,links:`${H}__links`,linksColumns:`${H}__links--columns`,linksTitleless:`${H}__links--titleless`,removed:`${H}__removed`,hidden:`${H}__content--hidden`}),J=({chip:e,hidden:t,onClick:n,refCallback:l,activeChipId:r})=>{let o=!!n,c=()=>{if(o)return null==n?void 0:n(e.url);D(u.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:G.label,children:e.title}),e.arrow&&(0,i.jsx)(s.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,a.A)(G.chip,{[G.hidden]:t,[q.new]:!!e.new,[q.vip]:!!e.vip,[G.active]:e.url===r});return o?(0,i.jsx)("button",{type:"button",className:p,onClick:c,ref:l,children:d}):(0,i.jsx)("a",{href:e.url,className:p,onClick:c,ref:l,children:d})},Q=({items:e=[],maxNumberOfLines:t,variant:n,className:r,activeChipId:o,onClick:c})=>{let d=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)({}),[h,g]=(0,l.useState)(!1),[w,v]=(0,l.useState)(e.length),[f,_]=(0,l.useState)(!1);(0,l.useMemo)(()=>{let t=m.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 x=(0,l.useCallback)(()=>{let n=d.current;if(!n)return;let i=e=>e?e.getBoundingClientRect().width:0,l=i(n),s=Math.max(Number(t)||0,0),r=()=>{v(e.length),_(!1)};if(h||0===s||l<=0)return void r();let o=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),a=i(p.current),c=e.map(e=>i(m.current[e.url]));if(c.some(e=>0===e))return void r();let u=1,g=0,w=0;for(let e of c){let t=u===s?a+o:0,n=0===g?e:g+o+e;if(n+t<=l-.5)g=n,w++;else{if(++u>s)break;g=e,w++}}_(w<e.length),v(w)},[h,e,t]);(0,l.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(x)});return t.observe(e),requestAnimationFrame(x),()=>{t.disconnect()}},[x]),(0,l.useEffect)(()=>{requestAnimationFrame(x)},[x]);let b=h||(t??0)<=0||!f;return(0,i.jsx)("div",{className:(0,a.A)(r,G.wrapper,{[G.gray]:"gray"===n,[G.white]:"white"===n}),children:(0,i.jsxs)("div",{ref:d,className:G.container,children:[e.map((e,t)=>(0,i.jsx)(J,{chip:e,hidden:!b&&t>=w,activeChipId:o,onClick:c,refCallback:t=>{m.current[e.url]=t}},e.url)),!b&&f&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,a.A)(G.chip,G.more),onClick:()=>{D(u.D.chip,"Еще"),g(!0)},children:[(0,i.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:G.label,children:"Еще"})]}),(b||!f)&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,a.A)(G.chip,G.more,G.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,i.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:G.label,children:"Еще"})]})]})})},Y=O(),Z=A(Y),K={regions:Y,towns:Z,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},X=(0,l.createContext)(K);function ee(){return(0,l.useContext)(X)}let et=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:s=!0,lastRegionsUpdateUnixTimestamp:r,dadataUrl:o="https://finuslugi.ru/backend/money/dadata",showcaseUrl:a="",useNewCitiesApi:c=!1})=>{let d=$(c),p=Number(T(d.lastRegionsUpdateUnixTimestamp)||0),m=Number(r||0)>p,[h,g]=(0,l.useState)(O(c)),w=(0,l.useRef)(h),[{startRegion:v,startTown:f},_]=(0,l.useState)({startRegion:K.startRegion,startTown:K.startTown}),x=t??K.region,b=n??K.town,[{region:j,town:C},k]=(0,l.useState)({region:x,town:b}),[S,R]=(0,l.useState)(K.startPopupVisible),[E,U]=(0,l.useState)(K.popupVisible),z=(0,l.useRef)(""),W=(0,l.useRef)(!1),D=(0,l.useMemo)(()=>A(h),[h]);(0,l.useEffect)(()=>{w.current=h},[h]);let V=(0,l.useCallback)((e,t)=>{window.sessionStorage.setItem("start_popup_opened","1"),window.localStorage.setItem("auto_town",JSON.stringify(t)||""),window.localStorage.setItem("auto_region",JSON.stringify(e)||""),R(!0),_({startRegion:e,startTown:t})},[R,_]),G=(0,l.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||V(e,t)},[V]),H=(0,l.useCallback)(()=>{if(z.current&&!j&&!C){let e=D.find(e=>e.name===z.current)??null;return G(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}G(j,C)},[j,C,D,h,G]),q=(0,l.useCallback)(e=>{U(e)},[U]),J=(0,l.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(d.allRussiaSelected,"1"),window.localStorage.setItem(d.userRegion,""),window.localStorage.setItem(d.userTown,""),y(null,null,c);return}window.localStorage.setItem(d.allRussiaSelected,"0"),window.localStorage.setItem(d.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(d.userTown,JSON.stringify(t)||""),y(e||null,t||null,c)},[d,c]),Q=(0,l.useCallback)(e=>{e?F(u.D.icon,"location"):F(u.D.button,(null==C?void 0:C.name)||"Вся Россия"),!s||window.sessionStorage.getItem("start_popup_opened")?q(!0):H()},[s,C,q,H]),Y=(0,l.useCallback)((e,t)=>{J(e,t),k({region:e||null,town:t||null}),R(!1),q(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[q,J]),Z=()=>{let e=N(d.userRegion)??T(d.userRegion),t=N(d.userTown)??T(d.userTown),n=L(w.current,e,t),i=c&&((e,t)=>(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId))(e,t);i&&(W.current=!0),i&&M(n.region,n.town)&&(J(n.region,n.town),W.current=!1),k(n);let l=async({coords:{latitude:e,longitude:t}})=>{let n=`${o}?lat=${e}&lon=${t}`,i=await B(n);null!=i&&i.location&&(z.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&s)try{navigator.geolocation.getCurrentPosition(l,()=>null)}catch{}};return(0,l.useEffect)(()=>{(!((e,t=!1)=>!(e.length<1)&&(!t||I(e)))(h,c)||m)&&P({showcaseUrl:a,useNewCitiesApi:c}).then(e=>{e.length<1||g(e)})},[]),(0,l.useEffect)(()=>{if(!c)return;let e=L(h,j,C);W.current&&M(e.region,e.town)&&(J(e.region,e.town),W.current=!1),k(e)},[h,j,J,C,c]),(0,l.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{Z(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{Z()},0)},[]),(0,i.jsx)(X.Provider,{value:{regions:h,towns:D,region:j,town:C,startPopupVisible:S,setStartPopupVisible:R,popupVisible:E,handleToggleModal:q,selectCity:Y,handleButtonClick:Q,startRegion:v,startTown:f},children:e})},en=()=>{let e=(0,l.useRef)(null),t=(0,l.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,l.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,l.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},ei=(0,m.g)("city-select-modal-body","sc"),el=Object.freeze({wrapper:`${ei}__wrapper`,subtitle:`${ei}__subtitle`,hintWrapper:`${ei}__hint-wrapper`,hintText:`${ei}__hint-text`,input:`${ei}__input`,chips:`${ei}__chips`,townsListWrapper:`${ei}__towns-list-wrapper`,townsList:`${ei}__towns-list`,townsGroup:`${ei}__towns-group`,townsGroupLabel:`${ei}__towns-group-label`,townsGroupList:`${ei}__towns-group-list`,townsName:`${ei}__towns-name`,regionName:`${ei}__region-name`}),es=({groupedTowns:e,chips:t,query:n,setQuery:r,isDrawer:a})=>{var c;let d=ee(),p=(0,l.useRef)(null),[m,h]=(0,l.useState)("10000px");(0,l.useEffect)(()=>{if(!a||!p.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let l=n.map(e=>[...e]),s=l.map(e),r=s.reduce((e,t,n)=>t<s[e]?n:e,0);0===r&&l[0].push(l[1].shift()),2===r&&l[2].unshift(l[1].pop()),1===r&&s[0]>s[2]&&l[1].unshift(l[0].pop()),1===r&&s[0]<s[2]&&l[1].push(l[2].shift());let o=Math.max(...l.map(e));return o>=i?i:t(l,o)};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&&h(`${i}px`)}).observe(p.current)},[]);let g=e=>{if(F(u.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return d.selectCity();let t=d.regions.find(t=>t.id===Number(e.parentId))||null;d.selectCity(t,e)};return(0,i.jsxs)("div",{className:el.wrapper,children:[(0,i.jsxs)("div",{className:el.subtitle,children:["Покажем предложения рядом с вами",(0,i.jsxs)("div",{className:el.hintWrapper,children:[(0,i.jsx)(s.IconFdsQuestionCircleO,{size:24}),(0,i.jsx)("div",{className:el.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,i.jsx)(o.Ox,{className:el.input,value:n,onChange:r,size:"s",placeholder:"Введите название города",icon:n?(0,i.jsx)(s.IconFdsCloseCircleO,{size:24,onClick:()=>r("")}):(0,i.jsx)(s.IconFdsSearchO,{size:24})}),(0,i.jsx)(o.C4,{className:el.chips,chips:t,value:(null==(c=d.town)?void 0:c.id)||0,onChipClick:e=>{g(d.towns.find(t=>t.id===e))}}),(0,i.jsx)("div",{className:el.townsListWrapper,children:(0,i.jsx)("div",{ref:p,className:el.townsList,style:{maxHeight:m},children:e.map(e=>(0,i.jsxs)("div",{className:el.townsGroup,children:[(0,i.jsx)("div",{className:el.townsGroupLabel,children:e.letter}),(0,i.jsx)("div",{className:el.townsGroupList,children:e.towns.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>g(e),children:[(0,i.jsx)("div",{className:el.townsName,children:e.name}),(0,i.jsx)("div",{className:el.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},er=[1095,1096,134,720,189,180],eo=()=>{var e;let t=ee(),n=(0,o.qF)("l"),[s,r]=(0,l.useState)(""),a=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,c=(0,l.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(s.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},[]),[s,t.towns.length]),p=(0,l.useMemo)(()=>[{id:0,label:"Вся Россия"},...er.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]),m=()=>{F(u.D.button,"close"),t.handleToggleModal(!1)};return(0,i.jsxs)(d.P,{children:[!n&&(0,i.jsx)(d.U,{title:a,isOpen:t.popupVisible,onClose:m,full:!0,children:(0,i.jsx)(es,{groupedTowns:c,chips:p,query:s,setQuery:r})}),n&&(0,i.jsx)(d.D,{title:a,isOpen:t.popupVisible,onClose:m,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,i.jsx)(es,{groupedTowns:c,chips:p,query:s,setQuery:r,isDrawer:!0})})]})},ea={"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"},ec=(0,l.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 eu(){return(0,l.useContext)(ec)}let ed=e=>{let[t,n]=(0,l.useState)(!1),[s,r]=(0,l.useState)(!1),[o,a]=(0,l.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p}=(()=>{let[e,t]=(0,l.useState)(!1),[n,i]=(0,l.useState)(!1),s=(0,l.useRef)(!1),r=e=>{s.current=e,i(e)};return(0,l.useEffect)(()=>{if(typeof window>"u")return;let e=(()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(ea,e)?ea[e]:ea["finuslugi.ru"]})(),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((l,o)=>{if(s.current)return void o(Error("chat is already opened"));i?(i.openWidget(),t(!1),l()):(r(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let s=document.querySelector(".webchat");s&&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)}})}).observe(s,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),r(!1),t(!1),l()},((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)})(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}})(),[m,h]=(0,l.useState)(null),[g,w]=(0,l.useState)(null),[v,f]=(0,l.useState)(!1),[_,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),C=(0,l.useRef)(null),$=(0,d.u)(v),k=(0,l.useRef)(null),y=(0,l.useRef)(null),N=(0,l.useRef)(null),T=(0,l.useRef)(null),O=(0,l.useCallback)(()=>{$.current&&$.current.scrollTo({top:0})},[$]),I=(0,l.useCallback)(e=>{w(e),O()},[O]),A=(0,l.useCallback)(e=>{k.current&&clearTimeout(k.current),e&&x(!0),e||(k.current=setTimeout(()=>{x(!1),I(null)},300))},[I]),S=(0,l.useCallback)((e,t,n)=>{if(t&&I(t),!n&&e===m||!e){A(!v),f(!v);return}h(e),A(!0),f(!0)},[m,I,v,A]),R=(0,l.useCallback)(()=>{y.current&&clearTimeout(y.current),j(!0),y.current=setTimeout(()=>{j(!1)},650)},[]);return(0,l.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=((e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),l=!1,s=0,r=0,o=window.innerWidth<768,a=()=>window.scrollY||document.documentElement.scrollTop,c=()=>{let e=window.innerWidth<768;e!==o&&(o=e,r=0)},u=function(){let o=a(),c=document.getElementById("headerNotice"),u=null==c?void 0:c.getAttribute("data-opening");if("true"===u)return;r||(()=>{let e=document.querySelector(":root");e&&(r=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),s=a())})();let d=o<r,p=o<((null==i?void 0:i.clientHeight)||0);if(n&&p||d){l=!1,e(!1),t(!0);return}e(l=o>s),l&&setTimeout(()=>t(!1),50);let m=l?"0px":"false"===u?`${r}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",m),document.documentElement.style.setProperty("--new-header-height-mobile",m),s=o<=0?0:o};return window.addEventListener("scroll",u),window.addEventListener("resize",c),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",c)}})(r,a,e.isMainBannerPage);return setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{(()=>{let e=(()=>{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})();e&&!document.cookie.split(";").some(e=>e.trim().startsWith("utm_params="))&&W("utm_params",e,90),e&&W("utm_last",e,90)})()}catch(e){console.error("UTM tracking error:",e)}},0),t},[]),(0,i.jsx)("header",{children:(0,i.jsx)(ec.Provider,{value:{isAuth:t,isHeaderHidden:s,isHeaderTransparent:o,openedBlock:m,setOpenedBlock:S,openedSection:g,setOpenedSection:I,isNavigationOpen:v,isNavigationMounted:_,navMenuItemsRef:C,navigationRef:$,ignoreClicks:b,setIgnoreClicks:R,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p,fixedContainerRef:N,headerRef:T},children:e.children})})},ep=({label:e,onClick:t,eventActionText:n,eventLabel:l,...s})=>(0,i.jsx)(o.$n,{label:e,onClick:e=>{null==t||t(e),(0,u.h)({eventCategory:f,eventActionType:u.D.button,eventActionText:n||"",eventLabel:l||""})},...s}),em=(0,m.g)("header-popup","sc"),eh=Object.freeze({popup:`${em}__popup`,popupHeader:`${em}__popup-header`,popupClose:`${em}__popup-close`,body:`${em}__body`}),eg=({isOpen:e,onClose:t,children:n,title:l})=>{let r=(0,o.qF)("l");return(0,i.jsxs)(d.P,{children:[!r&&(0,i.jsx)(d.U,{title:l,isOpen:e,onClose:t,children:n}),r&&e&&(0,i.jsxs)("div",{className:eh.popup,children:[(0,i.jsxs)("div",{className:eh.popupHeader,children:[l,(0,i.jsx)(ep,{className:eh.popupClose,iconLeft:(0,i.jsx)(s.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,i.jsx)("div",{className:eh.body,children:n})]})]})},ew=(0,m.g)("start-choice-popup","sc"),ev=Object.freeze({top:`${ew}__top`,progress:`${ew}__progress`,innerCircle:`${ew}__inner-circle`,title:`${ew}__title`,subtitle:`${ew}__subtitle`,actions:`${ew}__actions`}),ef=()=>{var e,t;let n=ee(),[s,r]=(0,l.useState)(10),[o,a]=(0,l.useState)(0),c=(0,l.useRef)(void 0),d=()=>{F(u.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,l.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+s).slice(1)),t=1e3*e/100,n=0,i=0;c.current=setInterval(()=>{n++,i+=t,a(3.6*n);let l=e-Math.floor(i/1e3);l<s&&r(l),100===n&&(clearInterval(c.current),d())},t)})():(clearInterval(c.current),r(10),a(0))},[n.startPopupVisible]),(0,i.jsxs)(eg,{isOpen:n.startPopupVisible,onClose:d,title:(0,i.jsx)("button",{type:"button",className:ev.progress,style:{background:`conic-gradient(#ff0508 ${o}deg, #e3e7ec 0deg)`},onClick:d,children:(0,i.jsx)("div",{className:ev.innerCircle,children:s})}),children:[(0,i.jsxs)("div",{className:ev.top,children:[(0,i.jsxs)("div",{className:ev.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,i.jsx)("div",{className:ev.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,i.jsxs)("div",{className:ev.actions,children:[(0,i.jsx)(ep,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{F(u.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,i.jsx)(ep,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{F(u.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},e_=(0,m.g)("city-select","sc"),ex=Object.freeze({button:`${e_}__button`,minimal:`${e_}__minimal`,full:`${e_}__full`}),eb=({initialTown:e})=>{var t;let n=ee(),r=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:u}=eu(),{startPopupVisible:d,setStartPopupVisible:p,popupVisible:m}=n,h=(0,l.useRef)();(0,l.useEffect)(()=>{m&&(h.current="popup")},[m]),(0,l.useEffect)(()=>{u&&(h.current="chat")},[u]),(0,l.useEffect)(()=>{d&&(h.current="startPopup")},[d]),(0,l.useEffect)(()=>{h.current&&("chat"===h.current&&d?p(!1):["startPopup","popup"].includes(h.current)&&u&&c(!1))},[m,u,d,p,c]);let g={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,i.jsx)(s.IconFdsLocationO,{size:24})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.$n,{...g,className:(0,a.A)(ex.button,ex.full),label:r}),(0,i.jsx)(o.$n,{...g,className:(0,a.A)(ex.button,ex.minimal),shape:"icon"}),(0,i.jsx)(eo,{}),(0,i.jsx)(ef,{})]})},ej=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:l,...s})=>(0,i.jsx)(o.N_,{onClick:i=>{null==e||e(i),(0,u.h)({eventCategory:f,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:l||""})},...s}),eC=(0,m.g)("header-mobile-app-banner","sc"),e$=Object.freeze({wrapper:`${eC}__wrapper`,container:`${eC}__container`,closeButton:`${eC}__close-button`,innerWrapper:`${eC}__inner-wrapper`,imageWrapper:`${eC}__image-wrapper`,image:`${eC}__image`,title:`${eC}__title`,description:`${eC}__description`,callToAction:`${eC}__call-to-action`,scanQr:`${eC}__scan-qr`}),ek=Object.freeze({mobile:56,desktop:68}),ey="headerBannerShownAt",eN=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:d,headerRef:p}=eu(),[m,h]=(0,l.useState)(!1),[g,w]=(0,l.useState)(!1),[v,f]=(0,l.useState)(!1),_=(0,l.useCallback)((e="desktop")=>{let t=d.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${ek[e]+b[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ek.desktop+b.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ek.mobile+b.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ek.mobile+b.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ek.desktop+b.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ek[e]+108}px`))},[]),x=(0,l.useCallback)(()=>{let e=d.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,l.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{g&&h(!1),f(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[g]),(0,l.useEffect)(()=>{(()=>{let e=(()=>{let e=localStorage.getItem(ey);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t})();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5})()&&h(!0)},[]),(0,l.useEffect)(()=>{let e=window.innerWidth<768;m&&(_(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):f(!0));let t=()=>{if(!m)return null;_(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{x(),window.removeEventListener("resize",t)}},[m,_,x]),m?(0,i.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":v,className:(0,a.A)(e$.wrapper,t),children:(0,i.jsx)(r.mc,{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.oq)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{className:e$.image,src:(0,c.oq)(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)(o.$n,{onClick:()=>{D(u.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:()=>{localStorage.setItem(ey,new Date().toISOString()),x(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):w(!0)},children:(0,i.jsx)(s.IconFdsCloseO,{size:"100%"})})]})})}):null},eT=(0,m.g)("header-chat-modal-body","sc"),eO=Object.freeze({wrapper:`${eT}__wrapper`,cardButton:`${eT}__card-button`,card:`${eT}__card`,cardTitle:`${eT}__card-title`,cardSubtitle:`${eT}__card-subtitle`,button:`${eT}__button`}),eI=()=>{let e=eu();return(0,i.jsxs)("div",{className:eO.wrapper,children:[(0,i.jsx)(ep,{className:eO.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.Zp,{className:eO.card,variant:"secondary",children:[(0,i.jsxs)("div",{className:eO.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:eO.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,i.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eA=({data:e,isMobile:t})=>{let n=eu();return(0,i.jsx)("div",{className:q.contentWrapper,children:e.map(e=>(0,i.jsx)(l.Fragment,{children:e.sections.map(e=>{var l;return(0,i.jsxs)("div",{className:(0,a.A)(q.content,{[q.hidden]:n.openedSection!==e.id,[q.contentOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:q.contentHeader,children:(0,i.jsx)("label",{children:e.title})}),null==(l=e.content)?void 0:l.map((n,l)=>{var r,o;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:(0,a.A)(q.contentTitle,{[q.removed]:!n.title,[q.contentTitleUrl]:!!n.url,[q.contentTitleLink]:!!e.isSeeAllLinkAvailable,[q.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,i.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,i.jsx)("div",{className:q.arrowIcon,children:(0,i.jsx)(s.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(r=n.links)&&r.length)&&(0,i.jsx)(Q,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(o=n.links)&&o.length)&&(0,i.jsx)("div",{className:(0,a.A)(q.links,{[q.linksColumns]:!!n.columns,[q.linksTitleless]:!n.title}),children:n.links.map(e=>(0,i.jsxs)("a",{href:e.url,onClick:()=>D(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{className:q.arrowIcon,children:(0,i.jsx)(s.IconFdsArrowUpRightSmallO,{})}),(0,i.jsxs)("span",{children:[(0,i.jsx)("span",{children:e.title}),!!e.new&&(0,i.jsx)("span",{className:(0,a.A)({[q.newInline]:!!e.new})})]})]},e.url))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},eS=(0,m.g)("navigation-section-icon","sc"),eR=Object.freeze({icon:`${eS}`}),eE=({name:e,background:t})=>{let n=(0,l.useMemo)(()=>e&&s[e]||null,[e]);return e&&n?(0,i.jsx)("div",{className:eR.icon,style:{background:t},children:(0,i.jsx)(n,{})}):null},eL=(0,m.g)("navigation","sc"),eM=Object.freeze({navigation:`${eL}`,navigationOpening:`${eL}--opening`,navigationClosing:`${eL}--closing`,wrapper:`${eL}__wrapper`,container:`${eL}__container`,containerOpen:`${eL}__container--open`,sections:`${eL}__sections`,sectionsOpen:`${eL}__sections--open`,citySelectButton:`${eL}__city-select-button`,sectionsTitle:`${eL}__sections-title`,sectionsWrapper:`${eL}__sections-wrapper`,section:`${eL}__section`,sectionArrow:`${eL}__section-arrow`,sectionExtra:`${eL}__section--extra`,sectionActive:`${eL}__section--active`,sectionTitle:`${eL}__section-title`,chatWrapper:`${eL}__chat-wrapper`,chatHeader:`${eL}__chat-header`,backButton:`${eL}__back-button`,useful:`${eL}__useful`,usefulOpen:`${eL}__useful--open`,usefulTitle:`${eL}__useful-title`,usefulGrid:`${eL}__useful-grid`,removed:`${eL}__removed`}),eU=({data:e})=>{var t;let n=eu(),c=ee(),d=(0,o.nu)("m"),[p,m]=(0,l.useState)(!0);(0,l.useEffect)(()=>{m(d)},[d]);let h=(0,l.useRef)(null),g=(0,l.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),w=(0,l.useRef)(!1),v=(0,l.useRef)(null),f=(0,l.useCallback)(()=>{p&&(w.current=!0,v.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),g()},window.history.pushState(null,"",window.location.href))},[g,p]),_=(0,l.useCallback)(()=>{w.current=!1,window.onpopstate=v.current,window.history.go(-1)},[]),b=(0,l.useRef)(null),j=(0,l.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]),C=(0,l.useRef)(null),$=(0,l.useCallback)(e=>{typeof window>"u"||(e?(C.current=j,window.addEventListener("mousemove",C.current)):C.current&&window.removeEventListener("mousemove",C.current))},[j]);(0,l.useEffect)(()=>{$(n.isNavigationOpen),n.isNavigationOpen&&!w.current&&f(),!n.isNavigationOpen&&w.current&&_()},[n.isNavigationOpen]);let k=(e,t)=>()=>{D(u.D.button,t),n.setOpenedSection(e)},{start:y,clear:N}=en(),T=()=>{p||N()};return(0,i.jsx)("div",{ref:n.navigationRef,className:(0,a.A)(eM.navigation,{[eM.removed]:!n.isNavigationMounted,[eM.navigationOpening]:n.isNavigationOpen,[eM.navigationClosing]:!n.isNavigationOpen}),children:(0,i.jsx)("div",{className:eM.wrapper,children:(0,i.jsxs)(r.mc,{className:(0,a.A)(eM.container,{[eM.containerOpen]:!!n.openedSection}),children:[(0,i.jsxs)("div",{className:(0,a.A)(eM.sections,{[eM.sectionsOpen]:!!n.openedSection}),children:[(0,i.jsx)(o.$n,{className:eM.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>c.handleButtonClick(!1),iconLeft:(0,i.jsx)(s.IconFdsLocationO,{size:24}),label:(null==(t=c.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,i.jsxs)("ul",{className:(0,a.A)(eM.sectionsWrapper,{[eM.removed]:n.openedBlock!==e.id&&!p}),children:[(0,i.jsx)("div",{className:eM.sectionsTitle,children:x[e.id]}),e.sections.map(e=>{let t,l;return(0,i.jsxs)("li",{className:(0,a.A)(eM.section,{[eM.sectionExtra]:!!e.extra,[eM.sectionActive]:n.openedSection===e.id}),onClick:k(e.id,e.title),onMouseEnter:(t=e.id,l=e.title,()=>{p||y(k(t,l),150)}),onMouseLeave:T,children:[(0,i.jsx)(eE,{name:e.uikitIcon,background:e.uikitIconBg}),(0,i.jsx)("span",{className:eM.sectionTitle,children:e.title}),(0,i.jsx)("div",{className:eM.sectionArrow,children:(0,i.jsx)(s.IconFdsChevronRightSmallO,{size:24})})]},e.id)})]},e.id)),(0,i.jsxs)("div",{className:eM.chatWrapper,children:[(0,i.jsx)("div",{className:eM.chatHeader,children:"Нужна помощь?"}),(0,i.jsx)(eI,{})]})]}),(0,i.jsxs)("button",{type:"button",className:(0,a.A)(eM.backButton,{[eM.removed]:!n.openedSection}),onClick:()=>{D(u.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,i.jsx)(s.IconFdsChevronLeftO,{size:24}),(0,i.jsx)("span",{children:"Назад"})]}),(0,i.jsx)(eA,{data:e,isMobile:p}),(0,i.jsxs)("div",{className:(0,a.A)(eM.useful,{[eM.usefulOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:eM.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,i.jsx)(l.Fragment,{children:e.sections.map(e=>{var t;return(0,i.jsx)("div",{className:(0,a.A)(eM.usefulGrid,{[eM.removed]:n.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,i.jsxs)("a",{href:e.url,onClick:()=>D(u.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))]})]})})})},ez=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:d="https://lk.finuslugi.ru/registration",initialTown:p,isMainBannerPage:m,enableAppHeaderBanner:h=!1,news:w,className:v})=>{let f=eu(),x=(0,l.useMemo)(()=>((e,t,n)=>{var i,l,s,r,o,a,u;let d=(null==(l=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:l.call(i,({id:e})=>"news"===e))||-1,p=(null==(r=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[d])?void 0:r.content)||[];if(null!=(u=null==(a=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[d])?void 0:a.content)&&u[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,c.oq)(t||"",n),new:0}));e.NAVIGATOR[d].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:[]}]})(e,t,w),[e,t,w]),b=null==e?void 0:e.config,j=(0,l.useMemo)(()=>x.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[x]),C=f.isAuth?"Личный кабинет":"Войти",$=m&&f.isHeaderTransparent,k=(e,t,n,i)=>()=>{e!==f.openedBlock?D(u.D.toggle,t,"on"):D(u.D.button,"menu_close","on");let l=n?j[e]:"";f.setOpenedBlock(e,l,!!i)},{start:y,clear:N}=en(),T=e=>()=>{f.ignoreClicks||e()};return e?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:f.headerRef,className:(0,a.A)(g.header,v,{[g.transparent]:$}),children:(0,i.jsxs)("div",{ref:f.fixedContainerRef,className:(0,a.A)(g.fixed,{[g.hidden]:f.isHeaderHidden,[g.navigationOpen]:f.isNavigationOpen}),children:[!!(null!=b&&b.appBannerUrl)&&h&&(0,i.jsx)(eN,{mobileAppUrl:b.appBannerUrl,minioUrl:n}),(0,i.jsxs)(r.mc,{className:g.container,children:[(0,i.jsxs)("div",{className:g.leftRow,children:[(0,i.jsx)(ej,{className:g.logo,href:t,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,i.jsxs)("picture",{children:[(0,i.jsx)("source",{srcSet:(0,c.oq)(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,i.jsx)("img",{src:(0,c.oq)(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,i.jsx)("nav",{ref:f.navMenuItemsRef,className:g.menuItems,children:(0,i.jsx)("ul",{children:_.map(({id:e,label:t})=>(0,i.jsx)("li",{children:(0,i.jsx)(o.$n,{className:(0,a.A)({[g.menuItemActive]:f.openedBlock===e&&f.isNavigationOpen}),label:t,variant:"white",size:"xs",onClick:T(k(e,t,!0)),onMouseEnter:((e,t,n,i)=>()=>{f.isNavigationOpen&&e===f.openedBlock||f.setIgnoreClicks(),y(k(e,t,n,i),200)})(e,t,!0,!0),onMouseLeave:N})},e))})}),(0,i.jsx)(ep,{className:(0,a.A)(g.tabletMenuButton,{[g.menuItemActive]:f.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,i.jsx)(s.IconFdsChevronDownO,{size:24}),onClick:k("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,i.jsxs)("div",{className:(0,a.A)(g.buttonGroup,{[g.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,i.jsxs)("div",{className:g.chips,children:[(0,i.jsx)(ep,{as:"a",href:d,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${d}`,iconLeft:(0,i.jsx)(s.IconFdsUserO,{size:20})}),(0,i.jsx)(ep,{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)(s.IconFdsChatDotsCircleO,{size:24})})]}),(0,i.jsx)(ep,{className:g.menuButton,size:"xs",shape:$?"icon":"default",appearance:$?"ghost":"fill",label:"Меню",onClick:k("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,i.jsx)(s.IconFdsMenuSkewedO,{size:24})}),(0,i.jsxs)("div",{className:g.moreButtons,children:[(0,i.jsx)(eb,{initialTown:p}),(0,i.jsx)(ep,{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)(s.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,i.jsx)(ep,{as:"a",href:d,size:"xs",eventActionText:C,eventLabel:`${C}_${d}`,label:C})]})]}),(0,i.jsxs)(ej,{className:g.auth,href:d,eventActionText:C,eventLabel:`${C}_${d}`,children:[(0,i.jsx)(ep,{size:"xs",shape:"circle-icon",iconLeft:(0,i.jsx)(s.IconFdsUserO,{}),eventActionText:C,eventLabel:`${C}_${d}`}),(0,i.jsx)("p",{children:C})]}),(0,i.jsx)("div",{className:g.close,children:(0,i.jsx)(ep,{className:g.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,i.jsx)(s.IconFdsCloseO,{}),onClick:()=>f.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,i.jsx)("div",{className:(0,a.A)(g.overlay,{[g.removed]:!f.isNavigationMounted,[g.overlayOpening]:f.isNavigationOpen,[g.overlayClosing]:!f.isNavigationOpen}),onClick:T(()=>f.setOpenedBlock(null))}),(0,i.jsx)(eU,{data:x,minioUrl:n})]}):null},eP=e=>(0,i.jsx)(ed,{isMainBannerPage:e.isMainBannerPage,children:(0,i.jsx)(ez,{...e})})},86029:(e,t,n)=>{n.d(t,{a:()=>i});let i={getItem:e=>{if(typeof document>"u")return null;let t=document.cookie.split(";").find(t=>t.split("=")[0].trim()===e);return t?t.split("=")[1]??null:null},setItem:(e,t,n={})=>{if(typeof document>"u")return;(n={path:"/",...n}).expires instanceof Date&&(n.expires=n.expires.toUTCString());let i=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;for(let e in n){if(!n.hasOwnProperty(e))continue;i+=`; ${e}`;let t=n[e];!0!==t&&(i+=`=${t}`)}document.cookie=i},removeItem:e=>{i.setItem(e,"",{"max-age":-1})}}}}]);