(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4],{10620:()=>{},22024:(e,t,n)=>{"use strict";n.d(t,{Footer:()=>H});var i=n(95155),l=n(89777),s=n(29722),o=n(17806),r=n(7596),a=n(55579),c=n(17573),u=n(84685),d=n(12115),p=n(32518);let m=(0,r.g)("footer-contacts-block","sc"),h=Object.freeze({contactsWrapper:`${m}__contacts-wrapper`,gray:`${m}__gray`,phones:`${m}__phones`,contactsButtons:`${m}__contacts-buttons`,vkIcon:`${m}__vk-icon`,tgIcon:`${m}__tg-icon`,dzenIcon:`${m}__dzen-icon`,maxIcon:`${m}__max-icon`,link:`${m}__link`}),g=(0,r.g)("footer","sc"),v=Object.freeze({wrapper:`${g}__wrapper`,section:`${g}__section`,container:`${g}__container`,top:`${g}__top`,main:`${g}__main`,links:`${g}__links`,disclaimer:`${g}__disclaimer`,bottom:`${g}__bottom`,bottomLinks:`${g}__bottom-links`,bottomDisclaimer:`${g}__bottom-disclaimer`,compact:`${g}__wrapper--compact`,white:`${g}__wrapper--white`}),w="finkit-widgets-sc-footer",f=[{title:"8 (800) 505-32-32",url:"tel:88005053232"},{title:"8 (800) 700-64-94",url:"tel:88007006494"},{title:"+7 (495) 145-32-32",url:"tel:+74951453232"},{title:"+7 (495) 787-64-94",url:"tel:+74957876494"}],_=[...f,{title:"Онлайн чат",url:void 0}],x=[{type:"vk",className:h.vkIcon,iconName:"vk"},{type:"telegramChannel",className:h.tgIcon,iconName:"telegram"},{type:"dzen",className:h.dzenIcon,iconName:"dzen"},{type:"max",className:h.maxIcon,iconName:"max"}],b=(0,i.jsxs)("p",{children:["На сайте finuslugi.ru предоставляются услуги оператора финансовой платформы ПАО Московская Биржа, а также услуги ООО \xabМБ Маркетплейс\xbb, организации, не являющейся оператором финансовой платформы в соответствии с Федеральным законом от 20.07.2020 №211-ФЗ \xabО совершении финансовых сделок с использованием финансовой платформы\xbb. Услуги оператора финансовой платформы ПАО Московская Биржа обозначены пометкой \xabОткрытие онлайн на Финуслугах\xbb. Иная информация на сайте www.finuslugi.ru считается размещенной ООО \xabМБ Маркетплейс\xbb, если иное явно не следует из существа размещаемой информации. ООО \xabМБ Маркетплейс\xbb входит в Группу \xabМосковская Биржа\xbb.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Группа \xabМосковская Биржа\xbb - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),j=({onClick:e,eventActionText:t,eventLabel:n,...l})=>(0,i.jsx)(a.$n,{onClick:i=>{null==e||e(i),(0,c.h)({eventCategory:w,eventActionType:c.D.button,eventActionText:t||"",eventLabel:n})},...l}),$=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:l,chat:s,...o})=>(0,i.jsx)(a.N_,{onClick:i=>{var o,r,a;null==e||e(i),s&&(null==i||i.preventDefault(),null==(a=null==(r=null==(o=null==window?void 0:window.supportWidget)?void 0:o.craftTalk)?void 0:r.open)||a.call(r)),(0,c.h)({eventCategory:w,eventActionType:t||c.D.link,eventActionText:n||"",eventLabel:l})},...o}),N=({minioUrl:e,blogs:t})=>(0,i.jsxs)("div",{className:h.contactsWrapper,children:[(0,i.jsx)(l.EY,{className:h.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,i.jsx)("div",{className:h.phones,children:_.map(({title:e,url:t})=>(0,i.jsx)($,{href:t,eventActionText:e,chat:!t,children:e},e))}),(0,i.jsx)(l.EY,{className:h.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,i.jsx)("div",{className:h.contactsButtons,children:x.map(({type:n,className:l,iconName:s})=>(0,i.jsx)(j,{as:"a",href:null==t?void 0:t[n],target:"_blank",className:l,iconRight:(0,i.jsx)("img",{width:24,height:24,src:(0,o.oq)(e,`/widgets/footer/${s}.svg`),alt:n,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:n,eventLabel:null==t?void 0:t[n]},n))}),(0,i.jsx)(l.EY,{className:h.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,i.jsx)("div",{className:h.contactsButtons,children:(0,i.jsxs)($,{href:null==t?void 0:t.investTg,target:"_blank",className:h.link,eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg,children:[(0,i.jsx)(j,{className:h.tgIcon,iconRight:(0,i.jsx)("img",{width:24,height:24,src:(0,o.oq)(e,"/widgets/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg}),"Финуслуги Инвест"]})})]}),y=(0,r.g)("footer-disclaimer","sc"),C=Object.freeze({disclaimer:`${y}`}),k=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&(0,c.h)({eventCategory:w,eventActionType:c.D.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,i.jsx)("div",{className:(0,s.A)(e.className,C.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,i.jsx)("div",{className:(0,s.A)(e.className,C.disclaimer),onClick:t,children:e.children})},T=(0,r.g)("footer-modal-body","sc"),A=Object.freeze({wrapper:`${T}__wrapper`,title:`${T}__title`,item:`${T}__item`,label:`${T}__label`,button:`${T}__button`,description:`${T}__description`}),O=({directions:e})=>(0,i.jsxs)("div",{className:A.wrapper,children:[(0,i.jsx)("div",{className:A.title,children:"Направления"}),e.map(e=>(0,i.jsxs)($,{className:A.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:`${e.name}_${e.url}`,children:[(0,i.jsxs)("div",{className:A.label,children:[(0,i.jsx)("span",{children:e.name}),(0,i.jsx)(j,{className:A.button,iconRight:(0,i.jsx)(u.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,i.jsx)("p",{className:A.description,children:e.description})]},e.url))]}),S=(0,r.g)("footer-popup","sc"),I=Object.freeze({wrapper:`${S}__wrapper`,button:`${S}__button`,icon:`${S}__icon`,buttonWrapper:`${S}__button-wrapper`}),R=({directions:e})=>{let t=(0,a.qF)("l"),[n,l]=(0,d.useState)(!1),s=()=>{l(!1)};return(0,i.jsxs)("div",{className:I.wrapper,children:[(0,i.jsx)("div",{className:I.buttonWrapper,children:(0,i.jsx)(j,{className:I.button,appearance:"ghost",variant:"white",onClick:()=>{l(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,i.jsx)("div",{className:I.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,i.jsx)("div",{},e))})})}),(0,i.jsxs)(p.P,{children:[!t&&(0,i.jsx)(p.U,{isOpen:n,onClose:s,full:!0,children:(0,i.jsx)(O,{directions:e})}),t&&(0,i.jsx)(p.D,{isOpen:n,onClose:s,width:"804px",children:(0,i.jsx)(O,{directions:e})})]})]})},L=(0,r.g)("footer-left-column","sc"),E=Object.freeze({leftColumn:`${L}__left-column`,logoWrapper:`${L}__logo-wrapper`,banner:`${L}__banner`,mobAppLink:`${L}__mob-app-link`,br:`${L}__br`}),P=({showcaseUrl:e,minioUrl:t,directions:n,mobAppUrl:s})=>{let r=((e="")=>{let[t,n]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let t=(()=>{let e=new URL(window.location.href),t=new URLSearchParams;return e.searchParams.forEach((e,n)=>{/^utm_/i.test(n)&&t.set(n,e)}),t})();if(!t||0===t.size)return;let[i,l=""]=e.split("?"),s=new URLSearchParams(l);t.forEach((e,t)=>{s.has(t)||s.set(t,e)});let o=s.toString();n(o?`${i}?${o}`:i)},[e]),t})(s);return(0,i.jsxs)("div",{className:E.leftColumn,children:[(0,i.jsx)($,{className:E.logoWrapper,href:e,eventActionType:c.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:(0,i.jsx)("img",{src:(0,o.oq)(t,"/widgets/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,i.jsx)(R,{directions:n??[]}),(0,i.jsx)($,{href:r,target:"_blank",eventActionType:c.D.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:r,className:E.mobAppLink,children:(0,i.jsxs)(l.Zp,{className:E.banner,children:[(0,i.jsxs)(l.EY,{weight:"medium",children:["Управляйте финансами",(0,i.jsx)("br",{}),"через приложение",(0,i.jsx)("br",{className:E.br})," Финуслуг"]}),(0,i.jsx)(j,{iconRight:(0,i.jsx)(u.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,i.jsxs)("picture",{children:[(0,i.jsx)("source",{srcSet:(0,o.oq)(t,"/widgets/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,i.jsx)("img",{src:(0,o.oq)(t,"/widgets/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},z=(0,r.g)("footer-logo","sc"),U=Object.freeze({wrapper:`${z}__wrapper`,link:`${z}__link`,fromMoex:`${z}__from-moex`,logo:`${z}__logo`,white:`${z}__wrapper--white`}),M=({showcaseUrl:e,minioUrl:t,isWhite:n})=>(0,i.jsx)("div",{className:(0,s.A)(U.wrapper,{[U.white]:n}),children:(0,i.jsxs)($,{className:U.link,href:e,eventActionType:c.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:[(0,i.jsx)("img",{className:U.logo,src:`${t}/images/logo-brandmark-common-finuslugi.svg`}),(0,i.jsx)("img",{className:U.fromMoex,src:`${t}/images/fromMoex.svg`})]})});var B=(e=>(e.BLACK="black",e.GRAY="gray",e))(B||{});let D=(0,r.g)("footer-warning","sc"),W=Object.freeze({reservedSpace:`${D}__reserved-space`,wrapper:`${D}__wrapper`,wrapperGray:`${D}__wrapper--gray`,fixed:`${D}__wrapper--fixed`,container:`${D}__container`,text:`${D}__text`,invisibleText:`${D}__text--invisible`}),F=({text:e,variant:t,fixed:n,isPlaceholder:o})=>(0,i.jsx)("div",{className:(0,s.A)(W.wrapper,{[W.wrapperGray]:"gray"===t,[W.fixed]:n&&!o}),children:(0,i.jsx)(l.mc,{className:W.container,children:(0,i.jsx)("div",{className:(0,s.A)(W.text,{[W.invisibleText]:o}),dangerouslySetInnerHTML:{__html:e}})})}),V=({warning:e})=>{let t="string"==typeof e?{text:e}:e,n={text:t.text,fixed:t.fixed??!0,variant:t.variant??B.BLACK};return(0,i.jsxs)("div",{className:W.reservedSpace,children:[(0,i.jsx)(F,{...n,isPlaceholder:n.fixed}),n.fixed&&(0,i.jsx)(F,{...n,fixed:!0})]})},H=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",customDisclaimer:o,variant:r="default",className:a})=>{var c,u;let d=!o&&null!=e&&e.disclaimer?e.disclaimer:void 0,p=r.includes("compact"),m=r.includes("white"),h=null==(c=null==e?void 0:e.bottom)?void 0:c.concat(p?f:[]),g=e&&"warning"in e?e.warning:void 0;return e?(0,i.jsx)("footer",{className:(0,s.A)(v.wrapper,a,{[v.compact]:p,[v.white]:m}),children:(0,i.jsxs)("section",{className:v.section,children:[(0,i.jsxs)(l.mc,{className:v.container,children:[!p&&(0,i.jsx)(P,{showcaseUrl:t,minioUrl:n,directions:null==e?void 0:e.directions,mobAppUrl:null==e?void 0:e.mobAppUrl}),(0,i.jsx)("div",{className:v.wrapper,children:(0,i.jsxs)("div",{className:v.top,children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:v.main,children:[!p&&(0,i.jsx)("div",{className:v.links,children:null==(u=null==e?void 0:e.top)?void 0:u.map(e=>(0,i.jsx)($,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,i.jsx)(M,{showcaseUrl:t,minioUrl:n,isWhite:m}),(0,i.jsx)(k,{className:v.disclaimer,disclaimer:d,children:o||b})]}),(0,i.jsxs)("div",{className:v.bottom,children:[(0,i.jsx)("div",{className:v.bottomLinks,children:null==h?void 0:h.map(e=>(0,i.jsx)($,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,i.jsx)(k,{className:v.bottomDisclaimer,disclaimer:null==e?void 0:e.bottomDisclaimer})]})]}),!p&&(0,i.jsx)(N,{minioUrl:n,blogs:null==e?void 0:e.blogs})]})})]}),p&&!!g&&(0,i.jsx)(V,{warning:g})]})}):null}},29522:(e,t,n)=>{"use strict";n.d(t,{CitySelectProvider:()=>et,Header:()=>eM});var i=n(95155),l=n(12115),s=n(84685),o=n(89777),r=n(55579),a=n(29722),c=n(17806),u=n(17573),d=n(32518),p=n(53730),m=n(7596);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`}),v="user_region",w="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:v,userTown:w,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},$={userRegion:v,userTown:w,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},N=(e=!1)=>e?$:j,y=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},C=(e,t,n=!1)=>{if(typeof document>"u")return;let i=N(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})},k=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},A=(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(N(e).allRegions)||[];return y(n,e),n},O=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),S=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]),[])},I=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,R=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},L=(e,t=!1)=>{if(e.length<1)return;let n=N(t);y(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},E=(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}},P=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),z=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 L(t),t},U=async e=>{let[t,n]=await Promise.all([R(I(e,"/sc/api/v1/cities?all=true&isActive=true")),R(I(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 O(i)?(L(i,!0),i):[]},M=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?U(e):z(),B=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},D=(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}`},F=(e,t,n)=>(0,u.h)({eventCategory:f,eventActionType:e,eventActionText:t,eventLabel:n}),V=(0,m.g)("navigation-chips","sc"),H=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`}),q=(0,m.g)("navigation-content","sc"),G=Object.freeze({contentWrapper:`${q}__content-wrapper`,content:`${q}__content`,contentOpen:`${q}__content--open`,contentHeader:`${q}__content-header`,contentTitle:`${q}__content-title`,contentTitleUrl:`${q}__content-title--url`,contentTitleLink:`${q}__content-title--link`,contentTitleNew:`${q}__content-title--new`,new:`${q}__new`,newInline:`${q}__new-inline`,vip:`${q}__vip`,arrowIcon:`${q}__arrow-icon`,links:`${q}__links`,linksColumns:`${q}__links--columns`,linksTitleless:`${q}__links--titleless`,removed:`${q}__removed`,hidden:`${q}__content--hidden`}),J=({chip:e,hidden:t,onClick:n,refCallback:l,activeChipId:o})=>{let r=!!n,c=()=>{if(r)return null==n?void 0:n(e.url);F(u.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:H.label,children:e.title}),e.arrow&&(0,i.jsx)(s.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,a.A)(H.chip,{[H.hidden]:t,[G.new]:!!e.new,[G.vip]:!!e.vip,[H.active]:e.url===o});return r?(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})},Y=({items:e=[],maxNumberOfLines:t,variant:n,className:o,activeChipId:r,onClick:c})=>{let d=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)({}),[h,g]=(0,l.useState)(!1),[v,w]=(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),o=()=>{w(e.length),_(!1)};if(h||0===s||l<=0)return void o();let r=(()=>{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 o();let u=1,g=0,v=0;for(let e of c){let t=u===s?a+r:0,n=0===g?e:g+r+e;if(n+t<=l-.5)g=n,v++;else{if(++u>s)break;g=e,v++}}_(v<e.length),w(v)},[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)(o,H.wrapper,{[H.gray]:"gray"===n,[H.white]:"white"===n}),children:(0,i.jsxs)("div",{ref:d,className:H.container,children:[e.map((e,t)=>(0,i.jsx)(J,{chip:e,hidden:!b&&t>=v,activeChipId:r,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)(H.chip,H.more),onClick:()=>{F(u.D.chip,"Еще"),g(!0)},children:[(0,i.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:H.label,children:"Еще"})]}),(b||!f)&&(0,i.jsxs)("button",{type:"button",ref:p,className:(0,a.A)(H.chip,H.more,H.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,i.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,i.jsx)("span",{className:H.label,children:"Еще"})]})]})})},Q=A(),K=S(Q),Z={regions:Q,towns:K,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},X=(0,l.createContext)(Z);function ee(){return(0,l.useContext)(X)}let et=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:s=!0,lastRegionsUpdateUnixTimestamp:o,dadataUrl:r="https://finuslugi.ru/backend/money/dadata",showcaseUrl:a="",useNewCitiesApi:c=!1})=>{let d=N(c),p=Number(T(d.lastRegionsUpdateUnixTimestamp)||0),m=Number(o||0)>p,[h,g]=(0,l.useState)(A(c)),v=(0,l.useRef)(h),[{startRegion:w,startTown:f},_]=(0,l.useState)({startRegion:Z.startRegion,startTown:Z.startTown}),x=t??Z.region,b=n??Z.town,[{region:j,town:$},y]=(0,l.useState)({region:x,town:b}),[I,R]=(0,l.useState)(Z.startPopupVisible),[L,z]=(0,l.useState)(Z.popupVisible),U=(0,l.useRef)(""),W=(0,l.useRef)(!1),F=(0,l.useMemo)(()=>S(h),[h]);(0,l.useEffect)(()=>{v.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,_]),H=(0,l.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||V(e,t)},[V]),q=(0,l.useCallback)(()=>{if(U.current&&!j&&!$){let e=F.find(e=>e.name===U.current)??null;return H(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}H(j,$)},[j,$,F,h,H]),G=(0,l.useCallback)(e=>{z(e)},[z]),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,""),C(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)||""),C(e||null,t||null,c)},[d,c]),Y=(0,l.useCallback)(e=>{e?D(u.D.icon,"location"):D(u.D.button,(null==$?void 0:$.name)||"Вся Россия"),!s||window.sessionStorage.getItem("start_popup_opened")?G(!0):q()},[s,$,G,q]),Q=(0,l.useCallback)((e,t)=>{J(e,t),y({region:e||null,town:t||null}),R(!1),G(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[G,J]),K=()=>{let e=k(d.userRegion)??T(d.userRegion),t=k(d.userTown)??T(d.userTown),n=E(v.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&&P(n.region,n.town)&&(J(n.region,n.town),W.current=!1),y(n);let l=async({coords:{latitude:e,longitude:t}})=>{let n=`${r}?lat=${e}&lon=${t}`,i=await B(n);null!=i&&i.location&&(U.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||O(e)))(h,c)||m)&&M({showcaseUrl:a,useNewCitiesApi:c}).then(e=>{e.length<1||g(e)})},[]),(0,l.useEffect)(()=>{if(!c)return;let e=E(h,j,$);W.current&&P(e.region,e.town)&&(J(e.region,e.town),W.current=!1),y(e)},[h,j,J,$,c]),(0,l.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{K(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{K()},0)},[]),(0,i.jsx)(X.Provider,{value:{regions:h,towns:F,region:j,town:$,startPopupVisible:I,setStartPopupVisible:R,popupVisible:L,handleToggleModal:G,selectCity:Q,handleButtonClick:Y,startRegion:w,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:o,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),o=s.reduce((e,t,n)=>t<s[e]?n:e,0);0===o&&l[0].push(l[1].shift()),2===o&&l[2].unshift(l[1].pop()),1===o&&s[0]>s[2]&&l[1].unshift(l[0].pop()),1===o&&s[0]<s[2]&&l[1].push(l[2].shift());let r=Math.max(...l.map(e));return r>=i?i:t(l,r)};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(D(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)(r.Ox,{className:el.input,value:n,onChange:o,size:"s",placeholder:"Введите название города",icon:n?(0,i.jsx)(s.IconFdsCloseCircleO,{size:24,onClick:()=>o("")}):(0,i.jsx)(s.IconFdsSearchO,{size:24})}),(0,i.jsx)(r.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))})})]})},eo=[1095,1096,134,720,189,180],er=()=>{var e;let t=ee(),n=(0,r.qF)("l"),[s,o]=(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:"Вся Россия"},...eo.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=()=>{D(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:o})}),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:o,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,o]=(0,l.useState)(!1),[r,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),o=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,r)=>{if(s.current)return void r(Error("chat is already opened"));i?(i.openWidget(),t(!1),l()):(o(!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(),o(!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,v]=(0,l.useState)(null),[w,f]=(0,l.useState)(!1),[_,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),$=(0,l.useRef)(null),N=(0,d.u)(w),y=(0,l.useRef)(null),C=(0,l.useRef)(null),k=(0,l.useRef)(null),T=(0,l.useRef)(null),A=(0,l.useCallback)(()=>{N.current&&N.current.scrollTo({top:0})},[N]),O=(0,l.useCallback)(e=>{v(e),A()},[A]),S=(0,l.useCallback)(e=>{y.current&&clearTimeout(y.current),e&&x(!0),e||(y.current=setTimeout(()=>{x(!1),O(null)},300))},[O]),I=(0,l.useCallback)((e,t,n)=>{if(t&&O(t),!n&&e===m||!e){S(!w),f(!w);return}h(e),S(!0),f(!0)},[m,O,w,S]),R=(0,l.useCallback)(()=>{C.current&&clearTimeout(C.current),j(!0),C.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,o=0,r=window.innerWidth<768,a=()=>window.scrollY||document.documentElement.scrollTop,c=()=>{let e=window.innerWidth<768;e!==r&&(r=e,o=0)},u=function(){let r=a(),c=document.getElementById("headerNotice"),u=null==c?void 0:c.getAttribute("data-opening");if("true"===u)return;o||(()=>{let e=document.querySelector(":root");e&&(o=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),s=a())})();let d=r<o,p=r<((null==i?void 0:i.clientHeight)||0);if(n&&p||d){l=!1,e(!1),t(!0);return}e(l=r>s),l&&setTimeout(()=>t(!1),50);let m=l?"0px":"false"===u?`${o}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",m),document.documentElement.style.setProperty("--new-header-height-mobile",m),s=r<=0?0:r};return window.addEventListener("scroll",u),window.addEventListener("resize",c),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",c)}})(o,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:r,openedBlock:m,setOpenedBlock:I,openedSection:g,setOpenedSection:O,isNavigationOpen:w,isNavigationMounted:_,navMenuItemsRef:$,navigationRef:N,ignoreClicks:b,setIgnoreClicks:R,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p,fixedContainerRef:k,headerRef:T},children:e.children})})},ep=({label:e,onClick:t,eventActionText:n,eventLabel:l,...s})=>(0,i.jsx)(r.$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 o=(0,r.qF)("l");return(0,i.jsxs)(d.P,{children:[!o&&(0,i.jsx)(d.U,{title:l,isOpen:e,onClose:t,children:n}),o&&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})]})]})},ev=(0,m.g)("start-choice-popup","sc"),ew=Object.freeze({top:`${ev}__top`,progress:`${ev}__progress`,innerCircle:`${ev}__inner-circle`,title:`${ev}__title`,subtitle:`${ev}__subtitle`,actions:`${ev}__actions`}),ef=()=>{var e,t;let n=ee(),[s,o]=(0,l.useState)(10),[r,a]=(0,l.useState)(0),c=(0,l.useRef)(void 0),d=()=>{D(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&&o(l),100===n&&(clearInterval(c.current),d())},t)})():(clearInterval(c.current),o(10),a(0))},[n.startPopupVisible]),(0,i.jsxs)(eg,{isOpen:n.startPopupVisible,onClose:d,title:(0,i.jsx)("button",{type:"button",className:ew.progress,style:{background:`conic-gradient(#ff0508 ${r}deg, #e3e7ec 0deg)`},onClick:d,children:(0,i.jsx)("div",{className:ew.innerCircle,children:s})}),children:[(0,i.jsxs)("div",{className:ew.top,children:[(0,i.jsxs)("div",{className:ew.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,i.jsx)("div",{className:ew.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,i.jsxs)("div",{className:ew.actions,children:[(0,i.jsx)(ep,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{D(u.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,i.jsx)(ep,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{D(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(),o=(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)(r.$n,{...g,className:(0,a.A)(ex.button,ex.full),label:o}),(0,i.jsx)(r.$n,{...g,className:(0,a.A)(ex.button,ex.minimal),shape:"icon"}),(0,i.jsx)(er,{}),(0,i.jsx)(ef,{})]})},ej=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:l,...s})=>(0,i.jsx)(r.N_,{onClick:i=>{null==e||e(i),(0,u.h)({eventCategory:f,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:l||""})},...s}),e$=(0,m.g)("header-mobile-app-banner","sc"),eN=Object.freeze({wrapper:`${e$}__wrapper`,container:`${e$}__container`,closeButton:`${e$}__close-button`,innerWrapper:`${e$}__inner-wrapper`,imageWrapper:`${e$}__image-wrapper`,image:`${e$}__image`,title:`${e$}__title`,description:`${e$}__description`,callToAction:`${e$}__call-to-action`,scanQr:`${e$}__scan-qr`}),ey=Object.freeze({mobile:56,desktop:68}),eC="headerBannerShownAt",ek=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:d,headerRef:p}=eu(),[m,h]=(0,l.useState)(!1),[g,v]=(0,l.useState)(!1),[w,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",`${ey[e]+b[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ey.desktop+b.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ey.mobile+b.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ey.mobile+b.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ey.desktop+b.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ey[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(eC);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":w,className:(0,a.A)(eN.wrapper,t),children:(0,i.jsx)(o.mc,{children:(0,i.jsxs)("div",{className:eN.container,children:[(0,i.jsxs)("div",{className:eN.innerWrapper,children:[(0,i.jsxs)("picture",{className:eN.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:eN.image,src:(0,c.oq)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,i.jsxs)("div",{className:eN.scanQr,children:[(0,i.jsx)("div",{className:eN.title,children:"Скачайте приложение Финуслуги"}),(0,i.jsx)("div",{className:eN.description,children:"Сканируйте QR-код"})]}),(0,i.jsxs)("div",{className:eN.callToAction,children:[(0,i.jsxs)("div",{children:["Приложение",(0,i.jsx)("br",{}),"Финуслуги"]}),(0,i.jsx)(r.$n,{onClick:()=>{F(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:eN.closeButton,onClick:()=>{localStorage.setItem(eC,new Date().toISOString()),x(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):v(!0)},children:(0,i.jsx)(s.IconFdsCloseO,{size:"100%"})})]})})}):null},eT=(0,m.g)("header-chat-modal-body","sc"),eA=Object.freeze({wrapper:`${eT}__wrapper`,cardButton:`${eT}__card-button`,card:`${eT}__card`,cardTitle:`${eT}__card-title`,cardSubtitle:`${eT}__card-subtitle`,button:`${eT}__button`}),eO=()=>{let e=eu();return(0,i.jsxs)("div",{className:eA.wrapper,children:[(0,i.jsx)(ep,{className:eA.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)(o.Zp,{className:eA.card,variant:"secondary",children:[(0,i.jsxs)("div",{className:eA.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:eA.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,i.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eS=({data:e,isMobile:t})=>{let n=eu();return(0,i.jsx)("div",{className:G.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)(G.content,{[G.hidden]:n.openedSection!==e.id,[G.contentOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:G.contentHeader,children:(0,i.jsx)("label",{children:e.title})}),null==(l=e.content)?void 0:l.map((n,l)=>{var o,r;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:(0,a.A)(G.contentTitle,{[G.removed]:!n.title,[G.contentTitleUrl]:!!n.url,[G.contentTitleLink]:!!e.isSeeAllLinkAvailable,[G.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,i.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,i.jsx)("div",{className:G.arrowIcon,children:(0,i.jsx)(s.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(o=n.links)&&o.length)&&(0,i.jsx)(Y,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(r=n.links)&&r.length)&&(0,i.jsx)("div",{className:(0,a.A)(G.links,{[G.linksColumns]:!!n.columns,[G.linksTitleless]:!n.title}),children:n.links.map(e=>(0,i.jsxs)("a",{href:e.url,onClick:()=>F(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,i.jsx)("div",{className:G.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)({[G.newInline]:!!e.new})})]})]},e.url))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},eI=(0,m.g)("navigation-section-icon","sc"),eR=Object.freeze({icon:`${eI}`}),eL=({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},eE=(0,m.g)("navigation","sc"),eP=Object.freeze({navigation:`${eE}`,navigationOpening:`${eE}--opening`,navigationClosing:`${eE}--closing`,wrapper:`${eE}__wrapper`,container:`${eE}__container`,containerOpen:`${eE}__container--open`,sections:`${eE}__sections`,sectionsOpen:`${eE}__sections--open`,citySelectButton:`${eE}__city-select-button`,sectionsTitle:`${eE}__sections-title`,sectionsWrapper:`${eE}__sections-wrapper`,section:`${eE}__section`,sectionArrow:`${eE}__section-arrow`,sectionExtra:`${eE}__section--extra`,sectionActive:`${eE}__section--active`,sectionTitle:`${eE}__section-title`,chatWrapper:`${eE}__chat-wrapper`,chatHeader:`${eE}__chat-header`,backButton:`${eE}__back-button`,useful:`${eE}__useful`,usefulOpen:`${eE}__useful--open`,usefulTitle:`${eE}__useful-title`,usefulGrid:`${eE}__useful-grid`,removed:`${eE}__removed`}),ez=({data:e})=>{var t;let n=eu(),c=ee(),d=(0,r.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]),v=(0,l.useRef)(!1),w=(0,l.useRef)(null),f=(0,l.useCallback)(()=>{p&&(v.current=!0,w.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),g()},window.history.pushState(null,"",window.location.href))},[g,p]),_=(0,l.useCallback)(()=>{v.current=!1,window.onpopstate=w.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]),$=(0,l.useRef)(null),N=(0,l.useCallback)(e=>{typeof window>"u"||(e?($.current=j,window.addEventListener("mousemove",$.current)):$.current&&window.removeEventListener("mousemove",$.current))},[j]);(0,l.useEffect)(()=>{N(n.isNavigationOpen),n.isNavigationOpen&&!v.current&&f(),!n.isNavigationOpen&&v.current&&_()},[n.isNavigationOpen]);let y=(e,t)=>()=>{F(u.D.button,t),n.setOpenedSection(e)},{start:C,clear:k}=en(),T=()=>{p||k()};return(0,i.jsx)("div",{ref:n.navigationRef,className:(0,a.A)(eP.navigation,{[eP.removed]:!n.isNavigationMounted,[eP.navigationOpening]:n.isNavigationOpen,[eP.navigationClosing]:!n.isNavigationOpen}),children:(0,i.jsx)("div",{className:eP.wrapper,children:(0,i.jsxs)(o.mc,{className:(0,a.A)(eP.container,{[eP.containerOpen]:!!n.openedSection}),children:[(0,i.jsxs)("div",{className:(0,a.A)(eP.sections,{[eP.sectionsOpen]:!!n.openedSection}),children:[(0,i.jsx)(r.$n,{className:eP.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)(eP.sectionsWrapper,{[eP.removed]:n.openedBlock!==e.id&&!p}),children:[(0,i.jsx)("div",{className:eP.sectionsTitle,children:x[e.id]}),e.sections.map(e=>{let t,l;return(0,i.jsxs)("li",{className:(0,a.A)(eP.section,{[eP.sectionExtra]:!!e.extra,[eP.sectionActive]:n.openedSection===e.id}),onClick:y(e.id,e.title),onMouseEnter:(t=e.id,l=e.title,()=>{p||C(y(t,l),150)}),onMouseLeave:T,children:[(0,i.jsx)(eL,{name:e.uikitIcon,background:e.uikitIconBg}),(0,i.jsx)("span",{className:eP.sectionTitle,children:e.title}),(0,i.jsx)("div",{className:eP.sectionArrow,children:(0,i.jsx)(s.IconFdsChevronRightSmallO,{size:24})})]},e.id)})]},e.id)),(0,i.jsxs)("div",{className:eP.chatWrapper,children:[(0,i.jsx)("div",{className:eP.chatHeader,children:"Нужна помощь?"}),(0,i.jsx)(eO,{})]})]}),(0,i.jsxs)("button",{type:"button",className:(0,a.A)(eP.backButton,{[eP.removed]:!n.openedSection}),onClick:()=>{F(u.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,i.jsx)(s.IconFdsChevronLeftO,{size:24}),(0,i.jsx)("span",{children:"Назад"})]}),(0,i.jsx)(eS,{data:e,isMobile:p}),(0,i.jsxs)("div",{className:(0,a.A)(eP.useful,{[eP.usefulOpen]:!!n.openedSection}),children:[(0,i.jsx)("div",{className:eP.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)(eP.usefulGrid,{[eP.removed]:n.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,i.jsxs)("a",{href:e.url,onClick:()=>F(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))]})]})})})},eU=({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:v,className:w})=>{let f=eu(),x=(0,l.useMemo)(()=>((e,t,n)=>{var i,l,s,o,r,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==(o=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[d])?void 0:o.content)||[];if(null!=(u=null==(a=null==(r=null==e?void 0:e.NAVIGATOR)?void 0:r[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,v),[e,t,v]),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]),$=f.isAuth?"Личный кабинет":"Войти",N=m&&f.isHeaderTransparent,y=(e,t,n,i)=>()=>{e!==f.openedBlock?F(u.D.toggle,t,"on"):F(u.D.button,"menu_close","on");let l=n?j[e]:"";f.setOpenedBlock(e,l,!!i)},{start:C,clear:k}=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,w,{[g.transparent]:N}),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)(ek,{mobileAppUrl:b.appBannerUrl,minioUrl:n}),(0,i.jsxs)(o.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)(r.$n,{className:(0,a.A)({[g.menuItemActive]:f.openedBlock===e&&f.isNavigationOpen}),label:t,variant:"white",size:"xs",onClick:T(y(e,t,!0)),onMouseEnter:((e,t,n,i)=>()=>{f.isNavigationOpen&&e===f.openedBlock||f.setIgnoreClicks(),C(y(e,t,n,i),200)})(e,t,!0,!0),onMouseLeave:k})},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:y("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:N?"icon":"default",appearance:N?"ghost":"fill",label:"Меню",onClick:y("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:$,eventLabel:`${$}_${d}`,label:$})]})]}),(0,i.jsxs)(ej,{className:g.auth,href:d,eventActionText:$,eventLabel:`${$}_${d}`,children:[(0,i.jsx)(ep,{size:"xs",shape:"circle-icon",iconLeft:(0,i.jsx)(s.IconFdsUserO,{}),eventActionText:$,eventLabel:`${$}_${d}`}),(0,i.jsx)("p",{children:$})]}),(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)(ez,{data:x,minioUrl:n})]}):null},eM=e=>(0,i.jsx)(ed,{isMainBannerPage:e.isMainBannerPage,children:(0,i.jsx)(eU,{...e})})},32518:(e,t,n)=>{"use strict";n.d(t,{D:()=>T,P:()=>P,U:()=>E,u:()=>f});var i=n(95155),l=n(12115),s=n(29722),o=n(84685),r=n(7596),a=n(47650);let c=300,u=({opened:e})=>{let[t,n]=(0,l.useState)(!1),i=(0,l.useRef)(null),s=(0,l.useRef)(!1);return(0,l.useEffect)(()=>(e&&!s.current?(s.current=!0,n(!0)):!e&&s.current&&(i.current=setTimeout(()=>{s.current=!1,n(!1)},c)),()=>{i.current&&clearTimeout(i.current)}),[e]),{mounted:t}},d=(0,r.g)("click-outside","sc"),p=Object.freeze({overlay:`${d}__overlay`,open:`${d}--open`,close:`${d}--close`}),m=({onClose:e,onToucheMove:t,isOpen:n,delay:o=c})=>{let r=(0,l.useRef)(null),a=(0,l.useCallback)(()=>{e&&(r.current=setTimeout(()=>{e()},o))},[o,e]),u=(0,l.useCallback)(e=>{"Escape"===e.key&&a()},[a]);return(0,l.useEffect)(()=>(n&&window.addEventListener("keydown",u),()=>{r.current&&clearTimeout(r.current),window.removeEventListener("keydown",u)}),[n,u]),(0,i.jsx)("div",{className:(0,s.A)(p.overlay,{[p.open]:n,[p.close]:!n}),onTouchStart:t,onClick:a})},h=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},g=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},v=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},w=()=>document.querySelectorAll("[data-portal]").length>1,f=e=>{let t=(0,l.useRef)(null),n=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{if(n.current===e)return;n.current=e;let i=t.current,l=document.body,s=document.documentElement,o=window.innerWidth-s.clientWidth,r=o>0;if(e&&r)l.style.top||(window.prevScrollPosition=window.scrollY),((e,t,n)=>{t.style.setProperty("overflow-y","scroll"),e.classList.toggle("scroll-disable-windows",!0),e.style.setProperty("width",`calc(100vw - ${n}px)`),e.style.setProperty("top",`-${window.prevScrollPosition}px`)})(l,s,o),h(i,!0);else if(e)(e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vh")})(l),h(i,!0);else{let e=!w();e&&g(l),e&&v(),h(i,!1)}return()=>{let e=!w();e&&g(l),e&&v()}},[e]),t},_=(0,r.g)("drawer-footer","sc"),x=Object.freeze({footer:`${_}__footer`,hasScroll:`${_}__footer--has-scroll`}),b=({footer:e,hasScroll:t,className:n})=>(0,i.jsx)("div",{className:(0,s.A)(x.footer,{[x.hasScroll]:t},n),children:"function"==typeof e?e():e}),j=(0,r.g)("drawer-content","sc"),$=Object.freeze({container:`${j}__container`,open:`${j}--open`,close:`${j}--close`,header:`${j}__header`,rowHeader:`${j}__header--row`,title:`${j}__title`,center:`${j}__title--center`,left:`${j}__title--left`,right:`${j}__title--right`,controlContainer:`${j}__control-container`,content:`${j}__content`,footer:`${j}__footer`}),N=({onClose:e,onContentClick:t,children:n,title:r,rowTitle:a,titleAlign:c,isCloseable:u,footer:d,closeButton:p,isOpen:m,contentClassName:h,footerClassName:g,contentStyle:v,width:w})=>{let f=(0,l.useRef)(null),_=(0,l.useRef)(null),[x,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>{var e;if(!_.current||!f.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==f?void 0:f.current,i=()=>{let e=null==_?void 0:_.current;e&&j(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let N=v||w?{width:w,...v||{}}:void 0;return(0,i.jsxs)("div",{ref:f,style:N,className:(0,s.A)($.container,{[$.open]:m,[$.close]:!m},h),children:[r||u?(0,i.jsxs)("div",{className:(0,s.A)($.header,{[$.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,i.jsx)("button",{type:"button",className:$.controlContainer,onClick:e,children:(0,i.jsx)(o.IconFdsCloseO,{size:24})}):null,r?(0,i.jsx)("h3",{className:(0,s.A)($.title,{[$[c]]:!0}),children:r}):null]}):null,(0,i.jsx)("div",{ref:_,className:$.content,onClick:t,children:n}),d&&(0,i.jsx)(b,{className:(0,s.A)($.footer,g),footer:d,hasScroll:x})]})},y=(0,r.g)("drawer-layout","sc"),C=Object.freeze({window:`${y}__window`}),k=({onClose:e,isOpen:t,children:n,withDisabledScroll:o,className:r,...a})=>{let c=(0,l.useCallback)(e=>e.stopPropagation(),[]);return f(t&&o),(0,i.jsxs)("div",{"data-portal":!0,className:(0,s.A)(C.window,r),children:[(0,i.jsx)(m,{onClose:e,isOpen:t,delay:0}),(0,i.jsx)(N,{onContentClick:c,onClose:e,isOpen:t,...a,children:n})]})},T=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:l=!0,withDisabledScroll:s=!0,...o})=>{let{mounted:r}=u({opened:e});return r?(0,i.jsx)(k,{titleAlign:n,isCloseable:l,isOpen:e,withDisabledScroll:s,...o,children:t}):null};T.displayName="Drawer";let A=(0,r.g)("mobile-modal-footer","sc"),O=Object.freeze({footer:`${A}__footer`,footerWithoutShadow:`${A}__footer--without-shadow`}),S=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,i.jsx)("div",{className:(0,s.A)(O.footer,t&&O.footerWithoutShadow,n),children:"function"==typeof e?e():e}),I=(0,r.g)("mobile-popup","sc"),R=Object.freeze({mobilePopup:`${I}`,mobilePopupOpen:`${I}--open`,content:`${I}__content`,contentFull:`${I}__content--full`,contentTransition:`${I}__content--transition`,contentTransitionOpen:`${I}__content--transition-open`,contentLine:`${I}__content-line`,contentContainer:`${I}__content-container`,smallContentContainer:`${I}__content-container--small`,min:`${I}__content-container--min`,title:`${I}__title`,closeContainer:`${I}__close-container`,closeButton:`${I}__close-button`}),L=({children:e,footer:t,isOpen:n,isSmallPopup:r,onClose:a,hasCloseButton:c=!0,full:u,touchDistance:d=100,withDisabledScroll:p=!0,contentClassName:h,className:g,title:v,closeButton:w,footerClassName:_})=>{let[x,b]=(0,l.useState)(!1),[j,$]=(0,l.useState)(!1),[N,y]=(0,l.useState)(!0),[C,k]=(0,l.useState)("120%"),T=(0,l.useRef)(null),A=(0,l.useRef)(0),O=(0,l.useRef)(!1),I=e=>{var t,n,i;let l=null==(t=T.current)?void 0:t.offsetTop,s=null==(n=T.current)?void 0:n.offsetHeight;if(O.current=!0,y(!1),l&&s){let t=(null==(i=null==e?void 0:e.touches[0])?void 0:i.clientY)-l,n=0;t>=0&&t<=s+30&&(n=t),t>s+30&&(n=s+30),k(`${n}px`),A.current=n}},L=()=>{O.current&&(A.current>d&&a?null==a||a():k("0"),y(!0),O.current=!1),window.removeEventListener("touchmove",I),window.removeEventListener("touchend",L)};return(0,l.useEffect)(()=>{n&&setTimeout(()=>{b(!0),$(!0),k("0")},100),!n&&j&&(k("120%"),b(!1),$(!1))},[j,n]),f(n&&p),(0,i.jsxs)("div",{"data-portal":!0,className:(0,s.A)(R.mobilePopup,j&&R.mobilePopupOpen,g),children:[(0,i.jsx)(m,{onClose:()=>{n&&(null==a||a())},onToucheMove:()=>{n&&(b(!1),window.addEventListener("touchmove",I),window.addEventListener("touchend",L))},isOpen:n,delay:0}),(0,i.jsxs)("div",{className:(0,s.A)(R.content,u&&R.contentFull,N&&R.contentTransition,N&&x&&R.contentTransitionOpen),ref:T,style:{transform:`translateY(${C})`},children:[(0,i.jsx)("div",{className:R.contentLine}),(0,i.jsxs)("div",{className:(0,s.A)(R.contentContainer,r&&R.smallContentContainer,{[R.min]:!v&&!c},h),children:[!!v&&(0,i.jsx)("div",{className:R.title,children:v}),c?(0,i.jsx)("div",{className:R.closeContainer,children:c?w?"function"==typeof w?w():w:(0,i.jsx)("button",{onClick:a,className:R.closeButton,children:(0,i.jsx)(o.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,i.jsx)(S,{footerClassName:_,isSmallPopup:r,footer:t})]})]})},E=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...l})=>{let{mounted:s}=u({opened:n});return s?(0,i.jsx)(L,{isSmallPopup:t,isOpen:n,...l,children:e}):null};E.displayName="UiMobilePopup";let P=({children:e,id:t="portal-root"})=>{let[n,i]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=document.getElementById(t);if(e)return void i(e);let n=document.createElement("div");return n.id=t,document.body.appendChild(n),i(n),()=>{document.body.removeChild(n)}},[t]),n?(0,a.createPortal)(e,n):null}},41504:(e,t,n)=>{"use strict";n.d(t,{CookiesPlate:()=>u});var i=n(95155),l=n(12115),s=n(84685),o=n(29722),r=n(53730);let a=(0,n(7596).g)("cookies-plate","sc"),c=Object.freeze({wrapper:"".concat(a,"__wrapper"),contentWrapper:"".concat(a,"__content-wrapper"),visible:"".concat(a,"--visible"),hidden:"".concat(a,"--hidden"),content:"".concat(a,"__content"),text:"".concat(a,"__text"),link:"".concat(a,"__link"),button:"".concat(a,"__button")}),u=e=>{let{className:t,mountDelay:n=3e3,href:a="https://assets.finuslugi.ru/mp-assets/user-agreement.pdf",children:u,closeIcon:d,onMount:p,onLinkClick:m,onClose:h,mountAfterScroll:g=!0}=e,[v,w]=(0,l.useState)(!1),[f,_]=(0,l.useState)(!1),[x,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=()=>{document.removeEventListener("scroll",e),r.a.getItem("Allow-Cookie")||(b(!0),setTimeout(()=>{w(!0),null==p||p()},n))};return g?document.addEventListener("scroll",e):e(),()=>document.removeEventListener("scroll",e)},[]);let j=(0,l.useCallback)(()=>{r.a.setItem("Allow-Cookie","1"),_(!0),null==h||h(),setTimeout(()=>b(!1),1e3)},[h]);return x?(0,i.jsx)("div",{className:c.wrapper,children:(0,i.jsx)("div",{className:(0,o.A)(c.contentWrapper,{[c.visible]:v,[c.hidden]:f}),children:(0,i.jsxs)("div",{className:(0,o.A)(t,c.content),children:[u||(0,i.jsxs)("p",{className:c.text,children:["Мы используем"," ",(0,i.jsx)("a",{className:c.link,href:a,target:"_blank",rel:"noreferrer",onClick:m,children:"cookie"})," ","для лучшей работы сайта"]}),(0,i.jsx)("button",{className:c.button,onClick:j,children:d||(0,i.jsx)(s.IconFdsCloseO,{})})]})})}):(0,i.jsx)(i.Fragment,{})}},48085:()=>{},53730:(e,t,n)=>{"use strict";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})}}},56207:()=>{},63938:()=>{}}]);