(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71267,e=>{"use strict";let t;var n=e.i(43476),i=e.i(70703);e.i(51966);var s=e.i(61193),l=e.i(52543),r=e.i(19390),o=e.i(2305),a=e.i(85900),c=e.i(22468),u=e.i(12716),d=e.i(28133),p=e.i(62965),m=e.i(71645),h=e.i(74080);let g=300,f=({opened:e})=>{let[t,n]=(0,m.useState)(!1),i=(0,m.useRef)(null),s=(0,m.useRef)(!1);return(0,m.useEffect)(()=>(e&&!s.current?(s.current=!0,n(!0)):!e&&s.current&&(i.current=setTimeout(()=>{s.current=!1,n(!1)},g)),()=>{i.current&&clearTimeout(i.current)}),[e]),{mounted:t}},w=(0,c.g)("click-outside","sc"),v=Object.freeze({overlay:`${w}__overlay`,open:`${w}--open`,close:`${w}--close`}),x=({onClose:e,onToucheMove:t,isOpen:i,delay:s=g})=>{let l=(0,m.useRef)(null),r=(0,m.useCallback)(()=>{e&&(l.current=setTimeout(()=>{e()},s))},[s,e]),a=(0,m.useCallback)(e=>{"Escape"===e.key&&r()},[r]);return(0,m.useEffect)(()=>(i&&window.addEventListener("keydown",a),()=>{l.current&&clearTimeout(l.current),window.removeEventListener("keydown",a)}),[i,a]),(0,n.jsx)("div",{className:(0,o.default)(v.overlay,{[v.open]:i,[v.close]:!i}),onTouchStart:t,onClick:r})},_=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},b=(e,t)=>{t.style.removeProperty("overflow-y"),e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},j=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},C=()=>document.querySelectorAll("[data-portal]").length>1,y=e=>{let t=(0,m.useRef)(null),n=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{if(n.current===e)return;n.current=e;let i=t.current,s=document.body,l=document.documentElement,r=window.innerWidth-l.clientWidth;if(e&&r>0)s.style.top||(window.prevScrollPosition=window.scrollY),l.style.setProperty("overflow-y","scroll"),s.classList.toggle("scroll-disable-windows",!0),s.style.setProperty("width",`calc(100vw - ${r}px)`),s.style.setProperty("top",`-${window.prevScrollPosition}px`),_(i,!0);else if(e)s.style.setProperty("overflow","hidden"),s.style.setProperty("height","100vh"),_(i,!0);else{let e=!C();e&&b(s,l),e&&j(),_(i,!1)}return()=>{let e=!C();e&&b(s,l),e&&j()}},[e]),t},N=(0,c.g)("drawer-footer","sc"),k=Object.freeze({footer:`${N}__footer`,hasScroll:`${N}__footer--has-scroll`}),$=({footer:e,hasScroll:t,className:i})=>(0,n.jsx)("div",{className:(0,o.default)(k.footer,{[k.hasScroll]:t},i),children:"function"==typeof e?e():e}),O=(0,c.g)("drawer-content","sc"),T=Object.freeze({container:`${O}__container`,open:`${O}--open`,close:`${O}--close`,header:`${O}__header`,rowHeader:`${O}__header--row`,title:`${O}__title`,center:`${O}__title--center`,left:`${O}__title--left`,right:`${O}__title--right`,controlContainer:`${O}__control-container`,content:`${O}__content`,footer:`${O}__footer`}),S=({onClose:e,onContentClick:t,children:i,title:s,rowTitle:l,titleAlign:r,isCloseable:a,footer:c,closeButton:u,isOpen:d,contentClassName:h,footerClassName:g,contentStyle:f,width:w})=>{let v=(0,m.useRef)(null),x=(0,m.useRef)(null),[_,b]=(0,m.useState)(!1);(0,m.useEffect)(()=>{var e;if(!x.current||!v.current)return;let t=(null==(e=null==x?void 0:x.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.current,i=()=>{let e=null==x?void 0:x.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let j=f||w?{width:w,...f||{}}:void 0;return(0,n.jsxs)("div",{ref:v,style:j,className:(0,o.default)(T.container,{[T.open]:d,[T.close]:!d},h),children:[s||a?(0,n.jsxs)("div",{className:(0,o.default)(T.header,{[T.rowHeader]:l}),children:[a?u?"function"==typeof u?u():u:(0,n.jsx)("button",{type:"button",className:T.controlContainer,onClick:e,children:(0,n.jsx)(p.IconFdsCloseO,{size:24})}):null,s?(0,n.jsx)("h3",{className:(0,o.default)(T.title,{[T[r]]:!0}),children:s}):null]}):null,(0,n.jsx)("div",{ref:x,className:T.content,onClick:t,children:i}),c&&(0,n.jsx)($,{className:(0,o.default)(T.footer,g),footer:c,hasScroll:_})]})},R=(0,c.g)("drawer-layout","sc"),A=Object.freeze({window:`${R}__window`}),I=({onClose:e,isOpen:t,children:i,withDisabledScroll:s,className:l,...r})=>{let a=(0,m.useCallback)(e=>e.stopPropagation(),[]);return y(t&&s),(0,n.jsxs)("div",{"data-portal":!0,className:(0,o.default)(A.window,l),children:[(0,n.jsx)(x,{onClose:e,isOpen:t,delay:0}),(0,n.jsx)(S,{onContentClick:a,onClose:e,isOpen:t,...r,children:i})]})},P=({isOpen:e=!1,children:t,titleAlign:i="center",isCloseable:s=!0,withDisabledScroll:l=!0,...r})=>{let{mounted:o}=f({opened:e});return o?(0,n.jsx)(I,{titleAlign:i,isCloseable:s,isOpen:e,withDisabledScroll:l,...r,children:t}):null};P.displayName="Drawer";let L=(0,c.g)("mobile-modal-footer","sc"),E=Object.freeze({footer:`${L}__footer`,footerWithoutShadow:`${L}__footer--without-shadow`}),B=({footer:e,isSmallPopup:t=!1,footerClassName:i})=>(0,n.jsx)("div",{className:(0,o.default)(E.footer,t&&E.footerWithoutShadow,i),children:"function"==typeof e?e():e}),z=(0,c.g)("mobile-popup","sc"),U=Object.freeze({mobilePopup:`${z}`,mobilePopupOpen:`${z}--open`,content:`${z}__content`,contentFull:`${z}__content--full`,contentTransition:`${z}__content--transition`,contentTransitionOpen:`${z}__content--transition-open`,contentLine:`${z}__content-line`,contentContainer:`${z}__content-container`,smallContentContainer:`${z}__content-container--small`,min:`${z}__content-container--min`,title:`${z}__title`,closeContainer:`${z}__close-container`,closeButton:`${z}__close-button`}),M=({children:e,footer:t,isOpen:i,isSmallPopup:s,onClose:l,hasCloseButton:r=!0,full:a,touchDistance:c=100,withDisabledScroll:u=!0,contentClassName:d,className:h,title:g,closeButton:f,footerClassName:w})=>{let[v,_]=(0,m.useState)(!1),[b,j]=(0,m.useState)(!1),[C,N]=(0,m.useState)(!0),[k,$]=(0,m.useState)("120%"),O=(0,m.useRef)(null),T=(0,m.useRef)(0),S=(0,m.useRef)(!1),R=e=>{var t,n,i;let s=null==(t=O.current)?void 0:t.offsetTop,l=null==(n=O.current)?void 0:n.offsetHeight;if(S.current=!0,N(!1),s&&l){let t=(null==(i=null==e?void 0:e.touches[0])?void 0:i.clientY)-s,n=0;t>=0&&t<=l+30&&(n=t),t>l+30&&(n=l+30),$(`${n}px`),T.current=n}},A=()=>{S.current&&(T.current>c&&l?null==l||l():$("0"),N(!0),S.current=!1),window.removeEventListener("touchmove",R),window.removeEventListener("touchend",A)};return(0,m.useEffect)(()=>{i&&setTimeout(()=>{_(!0),j(!0),$("0")},100),!i&&b&&($("120%"),_(!1),j(!1))},[b,i]),y(i&&u),(0,n.jsxs)("div",{"data-portal":!0,className:(0,o.default)(U.mobilePopup,b&&U.mobilePopupOpen,h),children:[(0,n.jsx)(x,{onClose:()=>{i&&(null==l||l())},onToucheMove:()=>{i&&(_(!1),window.addEventListener("touchmove",R),window.addEventListener("touchend",A))},isOpen:i,delay:0}),(0,n.jsxs)("div",{className:(0,o.default)(U.content,a&&U.contentFull,C&&U.contentTransition,C&&v&&U.contentTransitionOpen),ref:O,style:{transform:`translateY(${k})`},children:[(0,n.jsx)("div",{className:U.contentLine}),(0,n.jsxs)("div",{className:(0,o.default)(U.contentContainer,s&&U.smallContentContainer,{[U.min]:!g&&!r},d),children:[!!g&&(0,n.jsx)("div",{className:U.title,children:g}),r?(0,n.jsx)("div",{className:U.closeContainer,children:r?f?"function"==typeof f?f():f:(0,n.jsx)("button",{onClick:l,className:U.closeButton,children:(0,n.jsx)(p.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,n.jsx)(B,{footerClassName:w,isSmallPopup:s,footer:t})]})]})},F=({children:e,isSmallPopup:t=!1,isOpen:i=!1,...s})=>{let{mounted:l}=f({opened:i});return l?(0,n.jsx)(M,{isSmallPopup:t,isOpen:i,...s,children:e}):null};F.displayName="UiMobilePopup";let D=({children:e,id:t="portal-root"})=>{let[n,i]=(0,m.useState)(null);return(0,m.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,h.createPortal)(e,n):null},W=(0,c.g)("footer-contacts-block","sc"),H=Object.freeze({contactsWrapper:`${W}__contacts-wrapper`,gray:`${W}__gray`,phones:`${W}__phones`,contactsButtons:`${W}__contacts-buttons`,vkIcon:`${W}__vk-icon`,tgIcon:`${W}__tg-icon`,dzenIcon:`${W}__dzen-icon`,maxIcon:`${W}__max-icon`,link:`${W}__link`}),G=(0,c.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`}),Y="finkit-widgets-sc-footer",q=[{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"}],J=[...q,{title:"Онлайн чат",url:void 0}],Q=[{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"}],K=(0,n.jsxs)("p",{children:["На сайте finuslugi.ru предоставляются услуги оператора финансовой платформы ПАО Московская Биржа, а также услуги ООО «МБ Маркетплейс», организации, не являющейся оператором финансовой платформы в соответствии с Федеральным законом от 20.07.2020 №211-ФЗ «О совершении финансовых сделок с использованием финансовой платформы». Услуги оператора финансовой платформы ПАО Московская Биржа обозначены пометкой «Открытие онлайн на Финуслугах». Иная информация на сайте www.finuslugi.ru считается размещенной ООО «МБ Маркетплейс», если иное явно не следует из существа размещаемой информации. ООО «МБ Маркетплейс» входит в Группу «Московская Биржа».",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"Группа «Московская Биржа» - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),X=({onClick:e,eventActionText:t,eventLabel:i,...s})=>(0,n.jsx)(u.Button,{onClick:n=>{null==e||e(n),(0,d.h)({eventCategory:Y,eventActionType:d.D.button,eventActionText:t||"",eventLabel:i})},...s}),Z=({onClick:e,eventActionType:t,eventActionText:i,eventLabel:s,chat:l,...r})=>(0,n.jsx)(u.Link,{onClick:n=>{var r,o,a;null==e||e(n),l&&(null==n||n.preventDefault(),null==(a=null==(o=null==(r=null==window?void 0:window.supportWidget)?void 0:r.craftTalk)?void 0:o.open)||a.call(o)),(0,d.h)({eventCategory:Y,eventActionType:t||d.D.link,eventActionText:i||"",eventLabel:s})},...r}),ee=({minioUrl:e,blogs:t})=>(0,n.jsxs)("div",{className:H.contactsWrapper,children:[(0,n.jsx)(s.Text,{className:H.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,n.jsx)("div",{className:H.phones,children:J.map(({title:e,url:t})=>(0,n.jsx)(Z,{href:t,eventActionText:e,chat:!t,children:e},e))}),(0,n.jsx)(s.Text,{className:H.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,n.jsx)("div",{className:H.contactsButtons,children:Q.map(({type:i,className:s,iconName:l})=>(0,n.jsx)(X,{as:"a",href:null==t?void 0:t[i],target:"_blank",className:s,iconRight:(0,n.jsx)("img",{width:24,height:24,src:(0,a.joinURL)(e,`/widgets/footer/${l}.svg`),alt:i,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:i,eventLabel:null==t?void 0:t[i]},i))}),(0,n.jsx)(s.Text,{className:H.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,n.jsx)("div",{className:H.contactsButtons,children:(0,n.jsxs)(Z,{href:null==t?void 0:t.investTg,target:"_blank",className:H.link,eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg,children:[(0,n.jsx)(X,{className:H.tgIcon,iconRight:(0,n.jsx)("img",{width:24,height:24,src:(0,a.joinURL)(e,"/widgets/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg}),"Финуслуги Инвест"]})})]}),et=(0,c.g)("footer-disclaimer","sc"),en=Object.freeze({disclaimer:`${et}`}),ei=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&(0,d.h)({eventCategory:Y,eventActionType:d.D.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,n.jsx)("div",{className:(0,o.default)(e.className,en.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,n.jsx)("div",{className:(0,o.default)(e.className,en.disclaimer),onClick:t,children:e.children})},es=(0,c.g)("footer-modal-body","sc"),el=Object.freeze({wrapper:`${es}__wrapper`,title:`${es}__title`,item:`${es}__item`,label:`${es}__label`,button:`${es}__button`,description:`${es}__description`}),er=({directions:e})=>(0,n.jsxs)("div",{className:el.wrapper,children:[(0,n.jsx)("div",{className:el.title,children:"Направления"}),e.map(e=>(0,n.jsxs)(Z,{className:el.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:`${e.name}_${e.url}`,children:[(0,n.jsxs)("div",{className:el.label,children:[(0,n.jsx)("span",{children:e.name}),(0,n.jsx)(X,{className:el.button,iconRight:(0,n.jsx)(p.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,n.jsx)("p",{className:el.description,children:e.description})]},e.url))]}),eo=(0,c.g)("footer-popup","sc"),ea=Object.freeze({wrapper:`${eo}__wrapper`,button:`${eo}__button`,icon:`${eo}__icon`,buttonWrapper:`${eo}__button-wrapper`}),ec=({directions:e})=>{let t=(0,u.useBreakpointUp)("l"),[i,s]=(0,m.useState)(!1),l=()=>{s(!1)};return(0,n.jsxs)("div",{className:ea.wrapper,children:[(0,n.jsx)("div",{className:ea.buttonWrapper,children:(0,n.jsx)(X,{className:ea.button,appearance:"ghost",variant:"white",onClick:()=>{s(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,n.jsx)("div",{className:ea.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,n.jsx)("div",{},e))})})}),(0,n.jsxs)(D,{children:[!t&&(0,n.jsx)(F,{isOpen:i,onClose:l,full:!0,children:(0,n.jsx)(er,{directions:e})}),t&&(0,n.jsx)(P,{isOpen:i,onClose:l,width:"804px",children:(0,n.jsx)(er,{directions:e})})]})]})},eu=(0,c.g)("footer-left-column","sc"),ed=Object.freeze({leftColumn:`${eu}__left-column`,logoWrapper:`${eu}__logo-wrapper`,banner:`${eu}__banner`,mobAppLink:`${eu}__mob-app-link`,br:`${eu}__br`}),ep=({showcaseUrl:e,minioUrl:t,directions:i,mobAppUrl:r})=>{let o=((e="")=>{let[t,n]=(0,m.useState)(e);return(0,m.useEffect)(()=>{let t,i,s=(t=new URL(window.location.href),i=new URLSearchParams,t.searchParams.forEach((e,t)=>{/^utm_/i.test(t)&&i.set(t,e)}),i);if(!s||0===s.size)return;let[l,r=""]=e.split("?"),o=new URLSearchParams(r);s.forEach((e,t)=>{o.has(t)||o.set(t,e)});let a=o.toString();n(a?`${l}?${a}`:l)},[e]),t})(r);return(0,n.jsxs)("div",{className:ed.leftColumn,children:[(0,n.jsx)(Z,{className:ed.logoWrapper,href:e,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:(0,n.jsx)("img",{src:(0,a.joinURL)(t,"/widgets/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,n.jsx)(ec,{directions:i??[]}),(0,n.jsx)(Z,{href:o,target:"_blank",eventActionType:d.D.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:o,className:ed.mobAppLink,children:(0,n.jsxs)(l.Card,{className:ed.banner,children:[(0,n.jsxs)(s.Text,{weight:"medium",children:["Управляйте финансами",(0,n.jsx)("br",{}),"через приложение",(0,n.jsx)("br",{className:ed.br})," Финуслуг"]}),(0,n.jsx)(X,{iconRight:(0,n.jsx)(p.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{srcSet:(0,a.joinURL)(t,"/widgets/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,n.jsx)("img",{src:(0,a.joinURL)(t,"/widgets/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},em=(0,c.g)("footer-logo","sc"),eh=Object.freeze({wrapper:`${em}__wrapper`,link:`${em}__link`,fromMoex:`${em}__from-moex`,logo:`${em}__logo`,white:`${em}__wrapper--white`}),eg=({showcaseUrl:e,minioUrl:t,isWhite:i})=>(0,n.jsx)("div",{className:(0,o.default)(eh.wrapper,{[eh.white]:i}),children:(0,n.jsxs)(Z,{className:eh.link,href:e,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:[(0,n.jsx)("img",{className:eh.logo,src:`${t}/images/logo-brandmark-common-finuslugi.svg`}),(0,n.jsx)("img",{className:eh.fromMoex,src:`${t}/images/fromMoex.svg`})]})});var ef=((t=ef||{}).BLACK="black",t.GRAY="gray",t);let ew=(0,c.g)("footer-warning","sc"),ev=Object.freeze({reservedSpace:`${ew}__reserved-space`,wrapper:`${ew}__wrapper`,wrapperGray:`${ew}__wrapper--gray`,fixed:`${ew}__wrapper--fixed`,container:`${ew}__container`,text:`${ew}__text`,invisibleText:`${ew}__text--invisible`}),ex=({text:e,variant:t,fixed:i,isPlaceholder:s})=>(0,n.jsx)("div",{className:(0,o.default)(ev.wrapper,{[ev.wrapperGray]:"gray"===t,[ev.fixed]:i&&!s}),children:(0,n.jsx)(r.Container,{className:ev.container,children:(0,n.jsx)("div",{className:(0,o.default)(ev.text,{[ev.invisibleText]:s}),dangerouslySetInnerHTML:{__html:e}})})}),e_=({warning:e})=>{let t="string"==typeof e?{text:e}:e,i={text:t.text,fixed:t.fixed??!0,variant:t.variant??ef.BLACK};return(0,n.jsxs)("div",{className:ev.reservedSpace,children:[(0,n.jsx)(ex,{...i,isPlaceholder:i.fixed}),i.fixed&&(0,n.jsx)(ex,{...i,fixed:!0})]})},eb=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:i="https://assets.finuslugi.ru/mp-assets",customDisclaimer:s,variant:l="default",className:a})=>{var c,u;let d=!s&&null!=e&&e.disclaimer?e.disclaimer:void 0,p=l.includes("compact"),m=l.includes("white"),h=null==(c=null==e?void 0:e.bottom)?void 0:c.concat(p?q:[]),g=e&&"warning"in e?e.warning:void 0;return e?(0,n.jsx)("footer",{className:(0,o.default)(V.wrapper,a,{[V.compact]:p,[V.white]:m}),children:(0,n.jsxs)("section",{className:V.section,children:[(0,n.jsxs)(r.Container,{className:V.container,children:[!p&&(0,n.jsx)(ep,{showcaseUrl:t,minioUrl:i,directions:null==e?void 0:e.directions,mobAppUrl:null==e?void 0:e.mobAppUrl}),(0,n.jsx)("div",{className:V.wrapper,children:(0,n.jsxs)("div",{className:V.top,children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:V.main,children:[!p&&(0,n.jsx)("div",{className:V.links,children:null==(u=null==e?void 0:e.top)?void 0:u.map(e=>(0,n.jsx)(Z,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,n.jsx)(eg,{showcaseUrl:t,minioUrl:i,isWhite:m}),(0,n.jsx)(ei,{className:V.disclaimer,disclaimer:d,children:s||K})]}),(0,n.jsxs)("div",{className:V.bottom,children:[(0,n.jsx)("div",{className:V.bottomLinks,children:null==h?void 0:h.map(e=>(0,n.jsx)(Z,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,n.jsx)(ei,{className:V.bottomDisclaimer,disclaimer:null==e?void 0:e.bottomDisclaimer})]})]}),!p&&(0,n.jsx)(ee,{minioUrl:i,blogs:null==e?void 0:e.blogs})]})})]}),p&&!!g&&(0,n.jsx)(e_,{warning:g})]})}):null};var ej=e.i(45806),eC=e.i(22926),ey=e.i(24359);let eN={userRegion:eC.U,userTown:eC.a,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},ek={userRegion:eC.U,userTown:eC.a,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},e$=(e=!1)=>e?ek:eN,eO=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},eT=(e,t,n=!1)=>{if(typeof document>"u")return;let i=e$(n);if(!e&&!t){ey.a.removeItem(i.userRegion),ey.a.removeItem(i.userTown);return}ey.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),ey.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},eS=e=>{if(typeof document>"u")return null;let t=ey.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},eR=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},eA=(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=eR(e$(e).allRegions)||[];return eO(n,e),n},eI=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),eP=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]),[])},eL=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,eE=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},eB=(e,t=!1)=>{if(e.length<1)return;let n=e$(t);eO(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},ez=(e,t,n)=>{let i=null,s=null;n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,s=t,!0)});let l=t?e.find(e=>e.id===t.id)??null:null;return{region:i??l??t,town:s??n}},eU=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),eM=async()=>{let e=await eE("https://finuslugi.ru/money_data/Root.json?short=1"),t=Array.isArray(null==e?void 0:e.regions)?e.regions:[];return eB(t),t},eF=async e=>{let t,n,[i,s]=await Promise.all([eE(eL(e,"/sc/api/v1/cities?all=true&isActive=true")),eE(eL(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==i?void 0:i.content)||!Array.isArray(null==s?void 0:s.content))return[];let l=i.content,r=(n=(t=s.content.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:[]}))).reduce((e,t)=>(e[t.id]=t,e),{}),l.forEach(e=>{let t=n[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})}),t);return eI(r)?(eB(r,!0),r):[]},eD=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?eF(e):eM(),eW=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},eH=(e,t,n)=>{(0,d.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})};var eG=e.i(10108);let eV=eA(),eY=eP(eV),eq={regions:eV,towns:eY,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},eJ=(0,m.createContext)(eq);function eQ(){return(0,m.useContext)(eJ)}let eK=({children:e,initialRegion:t,initialTown:i,showStartGeoPopup:s=!0,lastRegionsUpdateUnixTimestamp:l,dadataUrl:r="https://finuslugi.ru/backend/money/dadata",showcaseUrl:o="",useNewCitiesApi:a=!1})=>{let c=e$(a),u=Number(eR(c.lastRegionsUpdateUnixTimestamp)||0),p=Number(l||0)>u,[h,g]=(0,m.useState)(eA(a)),f=(0,m.useRef)(h),[{startRegion:w,startTown:v},x]=(0,m.useState)({startRegion:eq.startRegion,startTown:eq.startTown}),_=t??eq.region,b=i??eq.town,[{region:j,town:C},y]=(0,m.useState)({region:_,town:b}),[N,k]=(0,m.useState)(eq.startPopupVisible),[$,O]=(0,m.useState)(eq.popupVisible),T=(0,m.useRef)(""),S=(0,m.useRef)(!1),R=(0,m.useMemo)(()=>eP(h),[h]);(0,m.useEffect)(()=>{f.current=h},[h]);let A=(0,m.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)||""),k(!0),x({startRegion:e,startTown:t})},[k,x]),I=(0,m.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||A(e,t)},[A]),P=(0,m.useCallback)(()=>{if(T.current&&!j&&!C){let e=R.find(e=>e.name===T.current)??null;return I(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}I(j,C)},[j,C,R,h,I]),L=(0,m.useCallback)(e=>{O(e)},[O]),E=(0,m.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(c.allRussiaSelected,"1"),window.localStorage.setItem(c.userRegion,""),window.localStorage.setItem(c.userTown,""),eT(null,null,a);return}window.localStorage.setItem(c.allRussiaSelected,"0"),window.localStorage.setItem(c.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(c.userTown,JSON.stringify(t)||""),eT(e||null,t||null,a)},[c,a]),B=(0,m.useCallback)(e=>{e?eH(d.D.icon,"location"):eH(d.D.button,(null==C?void 0:C.name)||"Вся Россия"),!s||window.sessionStorage.getItem("start_popup_opened")?L(!0):P()},[s,C,L,P]),z=(0,m.useCallback)((e,t)=>{E(e,t),y({region:e||null,town:t||null}),k(!1),L(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[L,E]),U=()=>{let e=eS(c.userRegion)??eR(c.userRegion),t=eS(c.userTown)??eR(c.userTown),n=ez(f.current,e,t),i=a&&(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId);i&&(S.current=!0),i&&eU(n.region,n.town)&&(E(n.region,n.town),S.current=!1),y(n);let l=async({coords:{latitude:e,longitude:t}})=>{let n=`${r}?lat=${e}&lon=${t}`,i=await eW(n);null!=i&&i.location&&(T.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&s)try{navigator.geolocation.getCurrentPosition(l,()=>null)}catch{}};return(0,m.useEffect)(()=>{(!((e,t=!1)=>!(e.length<1)&&(!t||eI(e)))(h,a)||p)&&eD({showcaseUrl:o,useNewCitiesApi:a}).then(e=>{e.length<1||g(e)})},[]),(0,m.useEffect)(()=>{if(!a)return;let e=ez(h,j,C);S.current&&eU(e.region,e.town)&&(E(e.region,e.town),S.current=!1),y(e)},[h,j,E,C,a]),(0,m.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{U(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{U()},0)},[]),(0,n.jsx)(eJ.Provider,{value:{regions:h,towns:R,region:j,town:C,startPopupVisible:N,setStartPopupVisible:k,popupVisible:$,handleToggleModal:L,selectCity:z,handleButtonClick:B,startRegion:w,startTown:v},children:e})},eX=()=>{let e=(0,m.useRef)(null),t=(0,m.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,m.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,m.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},eZ={"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"},e0=(0,m.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 e1(){return(0,m.useContext)(e0)}let e2=e=>{let[t,i]=(0,m.useState)(!1),[s,l]=(0,m.useState)(!1),[r,o]=(0,m.useState)(!!e.isMainBannerPage),{isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u}=(()=>{let[e,t]=(0,m.useState)(!1),[n,i]=(0,m.useState)(!1),s=(0,m.useRef)(!1),l=e=>{s.current=e,i(e)};return(0,m.useEffect)(()=>{if(typeof window>"u")return;let e=(()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(eZ,e)?eZ[e]:eZ["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((r,o)=>{var a,c;let u,d;s.current?o(Error("chat is already opened")):i?(i.openWidget(),t(!1),r()):(l(!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(),l(!1),t(!1),r()},a=e,c=n,(u=document.createElement("link")).rel="stylesheet",u.type="text/css",u.href=`${a}/assets/css/${c}`,document.head.appendChild(u),(d=document.createElement("script")).src=`${a}/get-bootstrap/${c}`,d.defer=!0,document.body.appendChild(d))}),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}})(),[d,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(null),[f,w]=(0,m.useState)(!1),[v,x]=(0,m.useState)(!1),[_,b]=(0,m.useState)(!1),j=(0,m.useRef)(null),C=y(f),N=(0,m.useRef)(null),k=(0,m.useRef)(null),$=(0,m.useRef)(null),O=(0,m.useRef)(null),T=(0,m.useCallback)(()=>{C.current&&C.current.scrollTo({top:0})},[C]),S=(0,m.useCallback)(e=>{g(e),T()},[T]),R=(0,m.useCallback)(e=>{N.current&&clearTimeout(N.current),e&&x(!0),e||(N.current=setTimeout(()=>{x(!1),S(null)},300))},[S]),A=(0,m.useCallback)((e,t,n)=>{if(t&&S(t),!n&&e===d||!e){R(!f),w(!f);return}p(e),R(!0),w(!0)},[d,S,f,R]),I=(0,m.useCallback)(()=>{k.current&&clearTimeout(k.current),b(!0),k.current=setTimeout(()=>{b(!1)},650)},[]);return(0,m.useEffect)(()=>{i(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,ej.s)(l,o,e.isMainBannerPage);return(0,ej.i)(),t},[]),(0,n.jsx)("header",{children:(0,n.jsx)(e0.Provider,{value:{isAuth:t,isHeaderHidden:s,isHeaderTransparent:r,openedBlock:d,setOpenedBlock:A,openedSection:h,setOpenedSection:S,isNavigationOpen:f,isNavigationMounted:v,navMenuItemsRef:j,navigationRef:C,ignoreClicks:_,setIgnoreClicks:I,isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u,fixedContainerRef:$,headerRef:O},children:e.children})})},e4=(0,c.g)("certificates-warning-banner","sc"),e3=(0,c.g)("certificates-warning-popup","sc"),e6=Object.freeze({wrapper:`${e4}`,container:`${e4}__container`,content:`${e4}__content`,info:`${e4}__info`,image:`${e4}__image`,text:`${e4}__text`,title:`${e4}__title`,description:`${e4}__description`,details:`${e4}__details`,buttons:`${e4}__buttons`,button:`${e4}__button`,closeButton:`${e4}__close-button`,mobileActivator:`${e4}__mobile-activator`}),e8=Object.freeze({modal:`${e3}__modal`,desktopCloseButton:`${e3}__desktop-close-button`,mobilePopup:`${e3}__mobile-popup`,mobileContentContainer:`${e3}__mobile-content-container`,mobileCloseButton:`${e3}__mobile-close-button`,mobileDialog:`${e3}__mobile-dialog`,content:`${e3}__content`,image:`${e3}__image`,text:`${e3}__text`,title:`${e3}__title`,description:`${e3}__description`,actions:`${e3}__actions`,button:`${e3}__button`,gosuslugiButton:`${e3}__gosuslugi-button`,gosuslugiIcon:`${e3}__gosuslugi-icon`}),e5="fu_certificates_access_confirmed",e7="fu_certificates_banner_dismissed",e9="fu_external_link_warning_shown",te=["--banner-header-height","--fixed-header-height","--new-header-height-desktop","--new-header-height-mobile","--static-new-header-height-mobile","--static-new-header-height-desktop","--header-height"],tt=({onDismiss:e,onClosed:t,onOpenDetails:i,onOpenCertificatesPage:s,onOpenYandexBrowserPage:l})=>{let{fixedContainerRef:o,headerRef:a}=e1(),c=(0,m.useRef)(null),d=(0,m.useRef)(!1),[h,g]=(0,m.useState)(!1),[f,w]=(0,m.useState)(!1),v=(0,m.useCallback)(()=>{let e=c.current,t=o.current;if(!e||!t)return;let n=e.getBoundingClientRect().height,i=n+(window.innerWidth<768?eC.F.mobile:eC.F.desktop),s=document.documentElement.style;s.setProperty("--banner-header-height",`${n}px`),s.setProperty("--fixed-header-height",`${i}px`),s.setProperty("--new-header-height-desktop",`${i}px`),s.setProperty("--new-header-height-mobile",`${i}px`),s.setProperty("--static-new-header-height-mobile",`${i}px`),s.setProperty("--static-new-header-height-desktop",`${i}px`),s.setProperty("--header-height",`${n+108}px`),t.style.transform=d.current?"translateY(0)":`translateY(-${n}px)`,window.dispatchEvent(new Event(ej.H))},[o]),x=(0,m.useCallback)(()=>{let e=o.current;te.forEach(e=>document.documentElement.style.removeProperty(e)),e&&(e.style.transform=""),window.dispatchEvent(new Event(ej.H))},[o]),_=(0,m.useCallback)(()=>{let e=o.current;if(!e)return;let t=window.innerWidth<768?eC.F.mobile:eC.F.desktop,n=document.documentElement.style;n.setProperty("--fixed-header-height",`${t}px`),n.setProperty("--new-header-height-desktop",`${t}px`),n.setProperty("--new-header-height-mobile",`${t}px`),n.setProperty("--static-new-header-height-mobile",`${t}px`),n.setProperty("--static-new-header-height-desktop",`${t}px`),n.setProperty("--header-height","108px"),e.style.transform="",window.dispatchEvent(new Event(ej.H))},[o]);return(0,m.useEffect)(()=>{let e=a.current;if(!e)return;let n=()=>{w(!1),h&&t()};return e.addEventListener("transitionend",n),()=>e.removeEventListener("transitionend",n)},[a,h,t]),(0,m.useLayoutEffect)(()=>{var e;let t=c.current;if(!t)return;v();let n=window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=null;n?(d.current=!0,null==(e=o.current)||e.style.setProperty("transform","translateY(0)")):i=window.requestAnimationFrame(()=>{var e;d.current=!0,null==(e=o.current)||e.style.setProperty("transform","translateY(0)"),w(!0)});let s=new ResizeObserver(v);return s.observe(t),window.addEventListener("resize",v),()=>{null!==i&&window.cancelAnimationFrame(i),s.disconnect(),window.removeEventListener("resize",v),x()}},[x,v]),(0,n.jsxs)("div",{id:"headerNotice",ref:c,role:"region","aria-label":"Сертификаты Минцифры","data-opening":f,className:e6.wrapper,children:[(0,n.jsx)("button",{className:e6.mobileActivator,type:"button","aria-label":"Подробнее о сертификатах Минцифры",onClick:i}),(0,n.jsx)(r.Container,{children:(0,n.jsxs)("div",{className:e6.container,children:[(0,n.jsxs)("div",{className:e6.content,children:[(0,n.jsxs)("div",{className:e6.info,children:[(0,n.jsx)("div",{className:e6.image,children:(0,n.jsx)(p.IconFdsShieldCheckO,{size:32})}),(0,n.jsxs)("div",{className:e6.text,children:[(0,n.jsx)("h2",{className:e6.title,children:"Для работы российских сайтов нужны сертификаты Минцифры"}),(0,n.jsx)("p",{className:e6.description,children:"Установите их, чтобы пользоваться всеми функциями сайта и оплачивать услуги без сбоев. Или откройте страницу через Яндекс Браузер — в него всё уже встроено"}),(0,n.jsxs)("span",{className:e6.details,children:["Подробнее",(0,n.jsx)(p.IconFdsChevronRightSmallO,{size:16})]})]})]}),(0,n.jsxs)("div",{className:e6.buttons,children:[(0,n.jsx)(u.Button,{className:e6.button,label:"Установить сертификаты",iconLeft:(0,n.jsx)(p.IconFdsGosuslugiColoredO,{size:16}),size:"xs",variant:"white",onClick:s}),(0,n.jsx)(u.Button,{className:e6.button,label:"Открыть в Яндекс Браузере",iconLeft:(0,n.jsx)("img",{src:"https://assets.finuslugi.ru/mp-assets/widgets/CertificatesWarning/yandex-browser.svg",loading:"lazy"}),size:"xs",variant:"white",appearance:"outline",onClick:l})]})]}),(0,n.jsx)("button",{className:e6.closeButton,type:"button","aria-label":"Закрыть",onClick:()=>{if(e(),window.matchMedia("(prefers-reduced-motion: reduce)").matches){x(),t();return}_(),g(!0)},children:(0,n.jsx)(p.IconFdsCloseO,{size:24})})]})})]})},tn=({onOpenCertificatesPage:e,onOpenYandexBrowserPage:t})=>{let i=(0,m.useRef)(null),s=`certificates-warning-gosuslugi-${(0,m.useId)().replaceAll(":","")}`;return(0,m.useLayoutEffect)(()=>{var e,t;let n=null==(e=i.current)?void 0:e.querySelector("linearGradient"),l=null==(t=i.current)?void 0:t.querySelector('path[fill^="url("]');n&&l&&(n.id=s,l.setAttribute("fill",`url(#${s})`))},[s]),(0,n.jsxs)("div",{className:e8.content,children:[(0,n.jsx)("div",{className:e8.image,children:(0,n.jsx)(p.IconFdsShieldCheckO,{size:64})}),(0,n.jsxs)("div",{className:e8.text,children:[(0,n.jsx)("h2",{className:e8.title,children:"Установите сертификаты Минцифры"}),(0,n.jsx)("p",{className:e8.description,children:"Без них российские сайты и оплата услуг могут не работать. Или откройте страницу через Яндекс Браузер — в него всё уже встроено"})]}),(0,n.jsxs)("div",{className:e8.actions,children:[(0,n.jsx)(u.Button,{className:`${e8.button} ${e8.gosuslugiButton}`,label:"Установить сертификаты",iconLeft:(0,n.jsx)("span",{ref:i,className:e8.gosuslugiIcon,children:(0,n.jsx)(p.IconFdsGosuslugiColoredO,{size:20})}),size:"s",stretch:!0,onClick:e}),(0,n.jsx)(u.Button,{className:e8.button,label:"Открыть в Яндекс Браузере",iconLeft:(0,n.jsx)("img",{src:"https://assets.finuslugi.ru/mp-assets/widgets/CertificatesWarning/yandex-browser.svg",loading:"lazy",width:24,height:24}),size:"s",stretch:!0,variant:"secondary",onClick:t})]})]})},ti=({isOpen:e,onClose:t,onOpenCertificatesPage:i,onOpenYandexBrowserPage:s})=>{let l=(0,u.useBreakpointUp)("l"),r=(0,m.useRef)(null),o=(0,n.jsx)(tn,{onOpenCertificatesPage:i,onOpenYandexBrowserPage:s});return(0,m.useEffect)(()=>{if(!e)return;let n=document.activeElement instanceof HTMLElement?document.activeElement:null,i=window.setTimeout(()=>{var e;if(!l){null==(e=r.current)||e.focus();return}let t=document.querySelector(`.${e8.desktopCloseButton}`);null==t||t.focus()},120),s=e=>{l||"Escape"===e.key&&t()};return document.addEventListener("keydown",s),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s),null==n||n.focus()}},[l,e,t]),l?(0,n.jsxs)(u.Modal,{className:e8.modal,open:e,size:"m",noPadding:!0,header:{withoutCloseBtn:!0},"aria-label":"Установите сертификаты Минцифры",onClose:t,children:[(0,n.jsx)("button",{className:e8.desktopCloseButton,type:"button","aria-label":"Закрыть",onClick:t,children:(0,n.jsx)(p.IconFdsCloseO,{size:24})}),o]}):(0,n.jsx)(D,{children:(0,n.jsx)(F,{className:e8.mobilePopup,contentClassName:e8.mobileContentContainer,isOpen:e,isSmallPopup:!0,onClose:t,closeButton:(0,n.jsx)("button",{className:e8.mobileCloseButton,type:"button","aria-label":"Закрыть",onClick:t,children:(0,n.jsx)(p.IconFdsCloseO,{size:24})}),children:(0,n.jsx)("div",{ref:r,className:e8.mobileDialog,role:"dialog","aria-modal":"true","aria-label":"Установите сертификаты Минцифры",tabIndex:-1,children:o})})})},ts=new Map,tl=e=>{if(typeof window>"u")return"1"===ts.get(e);try{return"1"===window.localStorage.getItem(e)||"1"===ts.get(e)}catch{return"1"===ts.get(e)}},tr=e=>{if(ts.set(e,"1"),!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},to=(e,t)=>{if(!e)return null;try{let n,i,s=new URL(e.toString(),t.href);return"http:"!==s.protocol&&"https:"!==s.protocol||(n=s.hostname,i=t.hostname,n===i||"finuslugi.ru"===n||n.endsWith(".finuslugi.ru"))?null:s}catch{return null}},ta=async(e,t,n)=>{let i=new AbortController,s=()=>i.abort(),l=window.setTimeout(s,t);null==n||n.addEventListener("abort",s,{once:!0});try{return await fetch(e,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",referrerPolicy:"no-referrer",signal:i.signal}),!0}catch{return!1}finally{window.clearTimeout(l),null==n||n.removeEventListener("abort",s)}},tc=(0,c.g)("city-select-modal-body","sc"),tu=Object.freeze({wrapper:`${tc}__wrapper`,subtitle:`${tc}__subtitle`,hintWrapper:`${tc}__hint-wrapper`,hintText:`${tc}__hint-text`,input:`${tc}__input`,chips:`${tc}__chips`,townsListWrapper:`${tc}__towns-list-wrapper`,townsList:`${tc}__towns-list`,townsGroup:`${tc}__towns-group`,townsGroupLabel:`${tc}__towns-group-label`,townsGroupList:`${tc}__towns-group-list`,townsName:`${tc}__towns-name`,regionName:`${tc}__region-name`}),td=({groupedTowns:e,chips:t,query:i,setQuery:s,isDrawer:l})=>{var r;let o=eQ(),a=(0,m.useRef)(null),[c,h]=(0,m.useState)("10000px");(0,m.useEffect)(()=>{if(!l||!a.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let s=n.map(e=>[...e]),l=s.map(e),r=l.reduce((e,t,n)=>t<l[e]?n:e,0);0===r&&s[0].push(s[1].shift()),2===r&&s[2].unshift(s[1].pop()),1===r&&l[0]>l[2]&&s[1].unshift(s[0].pop()),1===r&&l[0]<l[2]&&s[1].push(s[2].shift());let o=Math.max(...s.map(e));return o>=i?i:t(s,o)};new ResizeObserver(()=>{var e;if(!(null!=(e=a.current)&&e.children))return;let n=Array.from(a.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(a.current)},[]);let g=e=>{if(eH(d.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return o.selectCity();let t=o.regions.find(t=>t.id===Number(e.parentId))||null;o.selectCity(t,e)};return(0,n.jsxs)("div",{className:tu.wrapper,children:[(0,n.jsxs)("div",{className:tu.subtitle,children:["Покажем предложения рядом с вами",(0,n.jsxs)("div",{className:tu.hintWrapper,children:[(0,n.jsx)(p.IconFdsQuestionCircleO,{size:24}),(0,n.jsx)("div",{className:tu.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,n.jsx)(u.InputBase,{className:tu.input,value:i,onChange:s,size:"s",placeholder:"Введите название города",icon:i?(0,n.jsx)(p.IconFdsCloseCircleO,{size:24,onClick:()=>s("")}):(0,n.jsx)(p.IconFdsSearchO,{size:24})}),(0,n.jsx)(u.Chips,{className:tu.chips,chips:t,value:(null==(r=o.town)?void 0:r.id)||0,onChipClick:e=>{g(o.towns.find(t=>t.id===e))}}),(0,n.jsx)("div",{className:tu.townsListWrapper,children:(0,n.jsx)("div",{ref:a,className:tu.townsList,style:{maxHeight:c},children:e.map(e=>(0,n.jsxs)("div",{className:tu.townsGroup,children:[(0,n.jsx)("div",{className:tu.townsGroupLabel,children:e.letter}),(0,n.jsx)("div",{className:tu.townsGroupList,children:e.towns.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>g(e),children:[(0,n.jsx)("div",{className:tu.townsName,children:e.name}),(0,n.jsx)("div",{className:tu.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},tp=[1095,1096,134,720,189,180],tm=()=>{var e;let t=eQ(),i=(0,u.useBreakpointUp)("l"),[s,l]=(0,m.useState)(""),r=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,o=(0,m.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]),a=(0,m.useMemo)(()=>[{id:0,label:"Вся Россия"},...tp.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]),c=()=>{eH(d.D.button,"close"),t.handleToggleModal(!1)};return(0,n.jsxs)(D,{children:[!i&&(0,n.jsx)(F,{title:r,isOpen:t.popupVisible,onClose:c,full:!0,children:(0,n.jsx)(td,{groupedTowns:o,chips:a,query:s,setQuery:l})}),i&&(0,n.jsx)(P,{title:r,isOpen:t.popupVisible,onClose:c,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,n.jsx)(td,{groupedTowns:o,chips:a,query:s,setQuery:l,isDrawer:!0})})]})},th=({label:e,onClick:t,eventActionText:i,eventLabel:s,...l})=>(0,n.jsx)(u.Button,{label:e,onClick:e=>{null==t||t(e),(0,d.h)({eventCategory:eC.H,eventActionType:d.D.button,eventActionText:i||"",eventLabel:s||""})},...l}),tg=(0,c.g)("header-popup","sc"),tf=Object.freeze({popup:`${tg}__popup`,popupHeader:`${tg}__popup-header`,popupClose:`${tg}__popup-close`,body:`${tg}__body`}),tw=({isOpen:e,onClose:t,children:i,title:s})=>{let l=(0,u.useBreakpointUp)("l");return(0,n.jsxs)(D,{children:[!l&&(0,n.jsx)(F,{title:s,isOpen:e,onClose:t,children:i}),l&&e&&(0,n.jsxs)("div",{className:tf.popup,children:[(0,n.jsxs)("div",{className:tf.popupHeader,children:[s,(0,n.jsx)(th,{className:tf.popupClose,iconLeft:(0,n.jsx)(p.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,n.jsx)("div",{className:tf.body,children:i})]})]})},tv=(0,c.g)("start-choice-popup","sc"),tx=Object.freeze({top:`${tv}__top`,progress:`${tv}__progress`,innerCircle:`${tv}__inner-circle`,title:`${tv}__title`,subtitle:`${tv}__subtitle`,actions:`${tv}__actions`}),t_=()=>{var e,t;let i=eQ(),[s,l]=(0,m.useState)(10),[r,o]=(0,m.useState)(0),a=(0,m.useRef)(void 0),c=()=>{eH(d.D.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(i.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(i.startRegion)||""),i.setStartPopupVisible(!1)};return(0,m.useEffect)(()=>{let e,t,n,r;i.startPopupVisible?(t=1e3*(e=Number((" "+s).slice(1)))/100,n=0,r=0,a.current=setInterval(()=>{n++,r+=t,o(3.6*n);let i=e-Math.floor(r/1e3);i<s&&l(i),100===n&&(clearInterval(a.current),c())},t)):(clearInterval(a.current),l(10),o(0))},[i.startPopupVisible]),(0,n.jsxs)(tw,{isOpen:i.startPopupVisible,onClose:c,title:(0,n.jsx)("button",{type:"button",className:tx.progress,style:{background:`conic-gradient(#ff0508 ${r}deg, #e3e7ec 0deg)`},onClick:c,children:(0,n.jsx)("div",{className:tx.innerCircle,children:s})}),children:[(0,n.jsxs)("div",{className:tx.top,children:[(0,n.jsxs)("div",{className:tx.title,children:["Ваш город ",(null==(e=i.startTown)?void 0:e.name)||(null==(t=i.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,n.jsx)("div",{className:tx.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,n.jsxs)("div",{className:tx.actions,children:[(0,n.jsx)(th,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{eH(d.D.button,"Да, все верно"),i.selectCity(i.startRegion,i.startTown)},children:"Да, все верно"}),(0,n.jsx)(th,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{eH(d.D.button,"Нет, изменить"),i.setStartPopupVisible(!1),i.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},tb=(0,c.g)("city-select","sc"),tj=Object.freeze({button:`${tb}__button`,minimal:`${tb}__minimal`,full:`${tb}__full`}),tC=({initialTown:e})=>{var t;let i=eQ(),s=(null==(t=i.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:l,isChatModalOpen:r}=e1(),{startPopupVisible:a,setStartPopupVisible:c,popupVisible:d}=i,h=(0,m.useRef)();(0,m.useEffect)(()=>{d&&(h.current="popup")},[d]),(0,m.useEffect)(()=>{r&&(h.current="chat")},[r]),(0,m.useEffect)(()=>{a&&(h.current="startPopup")},[a]),(0,m.useEffect)(()=>{h.current&&("chat"===h.current&&a?c(!1):["startPopup","popup"].includes(h.current)&&r&&l(!1))},[d,r,a,c,l]);let g={appearance:"ghost",size:"xs",onClick:()=>i.handleButtonClick(!1),iconLeft:(0,n.jsx)(p.IconFdsLocationO,{size:24})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Button,{...g,className:(0,o.default)(tj.button,tj.full),label:s}),(0,n.jsx)(u.Button,{...g,className:(0,o.default)(tj.button,tj.minimal),shape:"icon"}),(0,n.jsx)(tm,{}),(0,n.jsx)(t_,{})]})},ty=({onClick:e,eventActionType:t,eventActionText:i,eventLabel:s,...l})=>(0,n.jsx)(u.Link,{onClick:n=>{null==e||e(n),(0,d.h)({eventCategory:eC.H,eventActionType:t||d.D.link,eventActionText:i||"",eventLabel:s||""})},...l}),tN=(0,c.g)("header-mobile-app-banner","sc"),tk=Object.freeze({wrapper:`${tN}__wrapper`,container:`${tN}__container`,closeButton:`${tN}__close-button`,innerWrapper:`${tN}__inner-wrapper`,imageWrapper:`${tN}__image-wrapper`,image:`${tN}__image`,title:`${tN}__title`,description:`${tN}__description`,callToAction:`${tN}__call-to-action`,scanQr:`${tN}__scan-qr`}),t$=Object.freeze({mobile:56,desktop:68}),tO="headerBannerShownAt",tT=({minioUrl:e,className:t,mobileAppUrl:i})=>{let{fixedContainerRef:s,headerRef:l}=e1(),[c,h]=(0,m.useState)(!1),[g,f]=(0,m.useState)(!1),[w,v]=(0,m.useState)(!1),x=(0,m.useCallback)((e="desktop")=>{let t=s.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${t$[e]+eC.F[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${t$.desktop+eC.F.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${t$.mobile+eC.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${t$.mobile+eC.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${t$.desktop+eC.F.desktop}px`),document.documentElement.style.setProperty("--header-height",`${t$[e]+108}px`))},[]),_=(0,m.useCallback)(()=>{let e=s.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,m.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{g&&h(!1),v(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[g]),(0,m.useEffect)(()=>{let e;(!(e=(()=>{let e=localStorage.getItem(tO);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t})())||Math.floor((e.getTime()-new Date().getTime())/864e5)>5)&&h(!0)},[]),(0,m.useEffect)(()=>{let e=window.innerWidth<768;c&&(x(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):v(!0));let t=()=>{if(!c)return null;x(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{_(),window.removeEventListener("resize",t)}},[c,x,_]),c?(0,n.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":w,className:(0,o.default)(tk.wrapper,t),children:(0,n.jsx)(r.Container,{children:(0,n.jsxs)("div",{className:tk.container,children:[(0,n.jsxs)("div",{className:tk.innerWrapper,children:[(0,n.jsxs)("picture",{className:tk.imageWrapper,children:[(0,n.jsx)("source",{srcSet:(0,a.joinURL)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,n.jsx)("img",{className:tk.image,src:(0,a.joinURL)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,n.jsxs)("div",{className:tk.scanQr,children:[(0,n.jsx)("div",{className:tk.title,children:"Скачайте приложение Финуслуги"}),(0,n.jsx)("div",{className:tk.description,children:"Сканируйте QR-код"})]}),(0,n.jsxs)("div",{className:tk.callToAction,children:[(0,n.jsxs)("div",{children:["Приложение",(0,n.jsx)("br",{}),"Финуслуги"]}),(0,n.jsx)(u.Button,{onClick:()=>{(0,ej.h)(d.D.button,"skachat_mob_prilozheniye_fu"),window.open(i,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,n.jsx)("div",{"aria-label":"Закрыть",role:"button",className:tk.closeButton,onClick:()=>{localStorage.setItem(tO,new Date().toISOString()),_(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):f(!0)},children:(0,n.jsx)(p.IconFdsCloseO,{size:"100%"})})]})})}):null},tS=(0,c.g)("header-chat-modal-body","sc"),tR=Object.freeze({wrapper:`${tS}__wrapper`,cardButton:`${tS}__card-button`,card:`${tS}__card`,cardTitle:`${tS}__card-title`,cardSubtitle:`${tS}__card-subtitle`,button:`${tS}__button`}),tA=()=>{let e=e1();return(0,n.jsxs)("div",{className:tR.wrapper,children:[(0,n.jsx)(th,{className:tR.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,n.jsxs)(l.Card,{className:tR.card,variant:"secondary",children:[(0,n.jsxs)("div",{className:tR.cardTitle,children:[(0,n.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,n.jsxs)("p",{className:tR.cardSubtitle,children:["Виртуальный ассистент доступен 24/7, ",(0,n.jsx)("br",{}),"операторы — с 6:00 до 23:59 мск"]})]})}),!1]})},tI=({data:e,isMobile:t})=>{let i=e1();return(0,n.jsx)("div",{className:eG.s.contentWrapper,children:e.map(e=>(0,n.jsx)(m.Fragment,{children:e.sections.map(e=>{var s;return(0,n.jsxs)("div",{className:(0,o.default)(eG.s.content,{[eG.s.hidden]:i.openedSection!==e.id,[eG.s.contentOpen]:!!i.openedSection}),children:[(0,n.jsx)("div",{className:eG.s.contentHeader,children:(0,n.jsx)("label",{children:e.title})}),null==(s=e.content)?void 0:s.map((i,s)=>{var l,r;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("a",{className:(0,o.default)(eG.s.contentTitle,{[eG.s.removed]:!i.title,[eG.s.contentTitleUrl]:!!i.url,[eG.s.contentTitleLink]:!!e.isSeeAllLinkAvailable,[eG.s.contentTitleNew]:!!i.new}),href:e.isSeeAllLinkAvailable?i.url:void 0,children:(0,n.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,n.jsx)("div",{className:eG.s.arrowIcon,children:(0,n.jsx)(p.IconFdsArrowUpRightSmallO,{})}),i.title]})})}),!(null!=(l=i.links)&&l.length)&&(0,n.jsx)(eG.N,{items:i.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(r=i.links)&&r.length)&&(0,n.jsx)("div",{className:(0,o.default)(eG.s.links,{[eG.s.linksColumns]:!!i.columns,[eG.s.linksTitleless]:!i.title}),children:i.links.map(e=>(0,n.jsxs)("a",{href:e.url,onClick:()=>(0,ej.h)(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,n.jsx)("div",{className:eG.s.arrowIcon,children:(0,n.jsx)(p.IconFdsArrowUpRightSmallO,{})}),(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{children:e.title}),!!e.new&&(0,n.jsx)("span",{className:(0,o.default)({[eG.s.newInline]:!!e.new})})]})]},e.url))})]},`${i.url}_${s}`)})]},e.id)})},e.id))})},tP=(0,c.g)("navigation-section-icon","sc"),tL=Object.freeze({icon:`${tP}`}),tE=({name:e,background:t})=>{let i=(0,m.useMemo)(()=>e&&p[e]||null,[e]);return e&&i?(0,n.jsx)("div",{className:tL.icon,style:{background:t},children:(0,n.jsx)(i,{})}):null},tB=(0,c.g)("navigation","sc"),tz=Object.freeze({navigation:`${tB}`,navigationOpening:`${tB}--opening`,navigationClosing:`${tB}--closing`,wrapper:`${tB}__wrapper`,container:`${tB}__container`,containerOpen:`${tB}__container--open`,sections:`${tB}__sections`,sectionsOpen:`${tB}__sections--open`,citySelectButton:`${tB}__city-select-button`,sectionsTitle:`${tB}__sections-title`,sectionsWrapper:`${tB}__sections-wrapper`,section:`${tB}__section`,sectionArrow:`${tB}__section-arrow`,sectionExtra:`${tB}__section--extra`,sectionActive:`${tB}__section--active`,sectionTitle:`${tB}__section-title`,chatWrapper:`${tB}__chat-wrapper`,chatHeader:`${tB}__chat-header`,backButton:`${tB}__back-button`,useful:`${tB}__useful`,usefulOpen:`${tB}__useful--open`,usefulTitle:`${tB}__useful-title`,usefulGrid:`${tB}__useful-grid`,removed:`${tB}__removed`}),tU=({data:e})=>{var t;let i=e1(),s=eQ(),l=(0,u.useBreakpointDown)("m"),[a,c]=(0,m.useState)(!0);(0,m.useEffect)(()=>{c(l)},[l]);let h=(0,m.useRef)(null),g=(0,m.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>i.openedSection?i.setOpenedSection(null):i.isNavigationOpen?i.setOpenedBlock(null):void 0,50)},[i]),f=(0,m.useRef)(!1),w=(0,m.useRef)(null),v=(0,m.useCallback)(()=>{a&&(f.current=!0,w.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),g()},window.history.pushState(null,"",window.location.href))},[g,a]),x=(0,m.useCallback)(()=>{f.current=!1,window.onpopstate=w.current,window.history.go(-1)},[]),_=(0,m.useRef)(null),b=(0,m.useCallback)(e=>{if(a||!i.navMenuItemsRef.current||!i.navigationRef.current)return;let t=e.target,n=!i.navMenuItemsRef.current.contains(t)&&!i.navigationRef.current.contains(t);if(n&&!_.current){i.setIgnoreClicks(),_.current=setTimeout(()=>i.setOpenedBlock(null),300);return}!n&&_.current&&(clearTimeout(_.current),_.current=null)},[a,i]),j=(0,m.useRef)(null),C=(0,m.useCallback)(e=>{typeof window>"u"||(e?(j.current=b,window.addEventListener("mousemove",j.current)):j.current&&window.removeEventListener("mousemove",j.current))},[b]);(0,m.useEffect)(()=>{C(i.isNavigationOpen),i.isNavigationOpen&&!f.current&&v(),!i.isNavigationOpen&&f.current&&x()},[i.isNavigationOpen]);let y=(e,t)=>()=>{(0,ej.h)(d.D.button,t),i.setOpenedSection(e)},{start:N,clear:k}=eX(),$=()=>{a||k()};return(0,n.jsx)("div",{ref:i.navigationRef,className:(0,o.default)(tz.navigation,{[tz.removed]:!i.isNavigationMounted,[tz.navigationOpening]:i.isNavigationOpen,[tz.navigationClosing]:!i.isNavigationOpen}),children:(0,n.jsx)("div",{className:tz.wrapper,children:(0,n.jsxs)(r.Container,{className:(0,o.default)(tz.container,{[tz.containerOpen]:!!i.openedSection}),children:[(0,n.jsxs)("div",{className:(0,o.default)(tz.sections,{[tz.sectionsOpen]:!!i.openedSection}),children:[(0,n.jsx)(u.Button,{className:tz.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>s.handleButtonClick(!1),iconLeft:(0,n.jsx)(p.IconFdsLocationO,{size:24}),label:(null==(t=s.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,n.jsxs)("ul",{className:(0,o.default)(tz.sectionsWrapper,{[tz.removed]:i.openedBlock!==e.id&&!a}),children:[(0,n.jsx)("div",{className:tz.sectionsTitle,children:eC.b[e.id]}),e.sections.map(e=>{let t,s;return(0,n.jsxs)("li",{className:(0,o.default)(tz.section,{[tz.sectionExtra]:!!e.extra,[tz.sectionActive]:i.openedSection===e.id}),onClick:y(e.id,e.title),onMouseEnter:(t=e.id,s=e.title,()=>{a||N(y(t,s),150)}),onMouseLeave:$,children:[(0,n.jsx)(tE,{name:e.uikitIcon,background:e.uikitIconBg}),(0,n.jsx)("span",{className:tz.sectionTitle,children:e.title}),(0,n.jsx)("div",{className:tz.sectionArrow,children:(0,n.jsx)(p.IconFdsChevronRightSmallO,{size:24})})]},e.id)})]},e.id)),(0,n.jsxs)("div",{className:tz.chatWrapper,children:[(0,n.jsx)("div",{className:tz.chatHeader,children:"Нужна помощь?"}),(0,n.jsx)(tA,{})]})]}),(0,n.jsxs)("button",{type:"button",className:(0,o.default)(tz.backButton,{[tz.removed]:!i.openedSection}),onClick:()=>{(0,ej.h)(d.D.button,"Назад"),i.setOpenedSection(null)},children:[(0,n.jsx)(p.IconFdsChevronLeftO,{size:24}),(0,n.jsx)("span",{children:"Назад"})]}),(0,n.jsx)(tI,{data:e,isMobile:a}),(0,n.jsxs)("div",{className:(0,o.default)(tz.useful,{[tz.usefulOpen]:!!i.openedSection}),children:[(0,n.jsx)("div",{className:tz.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,n.jsx)(m.Fragment,{children:e.sections.map(e=>{var t;return(0,n.jsx)("div",{className:(0,o.default)(tz.usefulGrid,{[tz.removed]:i.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,n.jsxs)("a",{href:e.url,onClick:()=>(0,ej.h)(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,n.jsx)("div",{children:(0,n.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id)})},e.id))]})]})})})},tM=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:i="https://assets.finuslugi.ru/mp-assets",lkUrl:s="https://lk.finuslugi.ru/registration",initialTown:l,isMainBannerPage:c,enableAppHeaderBanner:h=!1,enableCertificatesBanner:g=!1,enableExternalLinkWarning:f=!1,news:w,className:v})=>{let x=e1(),_=(0,m.useMemo)(()=>((e,t,n)=>{var i,s,l,r,o,c,u;let d=(null==(s=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:s.call(i,({id:e})=>"news"===e))||-1,p=(null==(r=null==(l=null==e?void 0:e.NAVIGATOR)?void 0:l[d])?void 0:r.content)||[];if(null!=(u=null==(c=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[d])?void 0:c.content)&&u[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,a.joinURL)(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=(({enableCertificatesBanner:e,enableExternalLinkWarning:t,isMainBannerPage:n})=>{let[i,s]=(0,m.useState)("checking"),[l,r]=(0,m.useState)(!1),[o,a]=(0,m.useState)(!1),[c,u]=(0,m.useState)(!1),d=(0,m.useRef)(),p=(0,m.useRef)(!1),h=(0,m.useRef)(!1),g=(0,m.useRef)(null),f=(0,m.useRef)(null),w=e&&n,v=w||t,x=(0,m.useCallback)(e=>{let t=d.current;t?t.call(window,e,"_blank","noopener,noreferrer"):window.open(e,"_blank","noopener,noreferrer")},[]),_=(0,m.useCallback)(()=>{r(!1),f.current=null},[]),b=(0,m.useCallback)(e=>{tr(e9),h.current=!0,f.current=e,r(!0)},[]),j=(0,m.useCallback)(()=>!p.current&&("external"===f.current||!h.current),[]),C=(0,m.useCallback)(()=>{"external"!==f.current&&b("external")},[b]);return(0,m.useEffect)(()=>{d.current=window.open,p.current=tl(e5),h.current=tl(e9),u(p.current),a(!0)},[]),(0,m.useEffect)(()=>{if(o){if(!w)return void s("skipped");s(e=>"shown"===e||"closing"===e||"dismissed"===e?e:c||tl(e7)?"skipped":"shown")}},[c,w,o]),(0,m.useEffect)(()=>{if(!o||!v||p.current)return;let e=new AbortController;return g.current=e,ta("https://www.sberbank.ru/common_static/favicon.ico",1800,e.signal).then(t=>{g.current===e&&(g.current=null,t&&(tr(e5),p.current=!0,u(!0),"external"===f.current&&((e=>{if(ts.delete(e),!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}})(e9),h.current=!1),f.current&&_()))}),()=>{e.abort(),g.current===e&&(g.current=null)}},[_,v,o]),(0,m.useEffect)(()=>{if(!o||!t)return;let e=d.current;if(!e)return;let n=!0,i=e=>{if(0!==e.button&&1!==e.button||!(e.target instanceof Element))return;let t=e.target.closest("a[href]");t&&!e.defaultPrevented&&to(t.href,window.location)&&j()&&(e.preventDefault(),queueMicrotask(()=>{n&&j()&&C()}))},s=(t,n="_blank",i)=>to(t,window.location)&&j()?(C(),null):e.call(window,t,n,i);return window.open=s,document.addEventListener("click",i,!0),document.addEventListener("auxclick",i,!0),()=>{n=!1,document.removeEventListener("click",i,!0),document.removeEventListener("auxclick",i,!0),window.open===s&&(window.open=e)}},[t,o,j,C]),(0,m.useEffect)(()=>{t||"external"===f.current&&_()},[_,t]),(0,m.useEffect)(()=>{w||"banner"===f.current&&_()},[_,w]),(0,m.useEffect)(()=>{v||_()},[_,v]),{bannerStatus:i,isPopupOpen:l,dismissBanner:(0,m.useCallback)(()=>{tr(e7),s("closing")},[]),finishBannerClosing:(0,m.useCallback)(()=>{s("dismissed")},[]),openPopupFromBanner:(0,m.useCallback)(()=>{b("banner")},[b]),closePopup:_,openCertificatesPage:(0,m.useCallback)(()=>{x("https://www.gosuslugi.ru/crt")},[x]),openYandexBrowserPage:(0,m.useCallback)(()=>{x("https://browser.yandex.ru/")},[x])}})({enableCertificatesBanner:!!e&&g,enableExternalLinkWarning:f,isMainBannerPage:!!c}),C="shown"===j.bannerStatus||"closing"===j.bannerStatus,y="skipped"===j.bannerStatus,N=(0,m.useMemo)(()=>_.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[_]),k=x.isAuth?"Личный кабинет":"Войти",$=c&&x.isHeaderTransparent,O=(e,t,n,i)=>()=>{e!==x.openedBlock?(0,ej.h)(d.D.toggle,t,"on"):(0,ej.h)(d.D.button,"menu_close","on");let s=n?N[e]:"";x.setOpenedBlock(e,s,!!i)},{start:T,clear:S}=eX(),R=e=>()=>{x.ignoreClicks||e()},A=(0,n.jsx)(ti,{isOpen:j.isPopupOpen,onClose:j.closePopup,onOpenCertificatesPage:j.openCertificatesPage,onOpenYandexBrowserPage:j.openYandexBrowserPage});return e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:x.headerRef,className:(0,o.default)(eC.s.header,v,{[eC.s.transparent]:$}),children:(0,n.jsxs)("div",{ref:x.fixedContainerRef,className:(0,o.default)(eC.s.fixed,{[eC.s.hidden]:x.isHeaderHidden,[eC.s.navigationOpen]:x.isNavigationOpen}),children:[C&&(0,n.jsx)(tt,{onDismiss:j.dismissBanner,onClosed:j.finishBannerClosing,onOpenDetails:j.openPopupFromBanner,onOpenCertificatesPage:j.openCertificatesPage,onOpenYandexBrowserPage:j.openYandexBrowserPage}),y&&!!(null!=b&&b.appBannerUrl)&&h&&(0,n.jsx)(tT,{mobileAppUrl:b.appBannerUrl,minioUrl:i}),(0,n.jsxs)(r.Container,{className:eC.s.container,children:[(0,n.jsxs)("div",{className:eC.s.leftRow,children:[(0,n.jsx)(ty,{className:eC.s.logo,href:t,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{srcSet:(0,a.joinURL)(i,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,n.jsx)("img",{src:(0,a.joinURL)(i,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,n.jsx)("nav",{ref:x.navMenuItemsRef,className:eC.s.menuItems,children:(0,n.jsx)("ul",{children:eC.c.map(({id:e,label:t})=>(0,n.jsx)("li",{children:(0,n.jsx)(u.Button,{className:(0,o.default)({[eC.s.menuItemActive]:x.openedBlock===e&&x.isNavigationOpen}),label:t,variant:"white",size:"xs",onClick:R(O(e,t,!0)),onMouseEnter:()=>{x.isNavigationOpen&&e===x.openedBlock||x.setIgnoreClicks(),T(O(e,t,!0,!0),200)},onMouseLeave:S})},e))})}),(0,n.jsx)(th,{className:(0,o.default)(eC.s.tabletMenuButton,{[eC.s.menuItemActive]:x.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,n.jsx)(p.IconFdsChevronDownO,{size:24}),onClick:O("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,n.jsxs)("div",{className:(0,o.default)(eC.s.buttonGroup,{[eC.s.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,n.jsxs)("div",{className:eC.s.chips,children:[(0,n.jsx)(th,{as:"a",href:s,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${s}`,iconLeft:(0,n.jsx)(p.IconFdsUserO,{size:20})}),(0,n.jsx)(th,{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,n.jsx)(p.IconFdsChatDotsCircleO,{size:24})})]}),(0,n.jsx)(th,{className:eC.s.menuButton,size:"xs",shape:$?"icon":"default",appearance:$?"ghost":"fill",label:"Меню",onClick:O("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,n.jsx)(p.IconFdsMenuSkewedO,{size:24})}),(0,n.jsxs)("div",{className:eC.s.moreButtons,children:[(0,n.jsx)(tC,{initialTown:l}),(0,n.jsx)(th,{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,n.jsx)(p.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,n.jsx)(th,{as:"a",href:s,size:"xs",eventActionText:k,eventLabel:`${k}_${s}`,label:k})]})]}),(0,n.jsxs)(ty,{className:eC.s.auth,href:s,eventActionText:k,eventLabel:`${k}_${s}`,children:[(0,n.jsx)(th,{size:"xs",shape:"circle-icon",iconLeft:(0,n.jsx)(p.IconFdsUserO,{}),eventActionText:k,eventLabel:`${k}_${s}`}),(0,n.jsx)("p",{children:k})]}),(0,n.jsx)("div",{className:eC.s.close,children:(0,n.jsx)(th,{className:eC.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,n.jsx)(p.IconFdsCloseO,{}),onClick:()=>x.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,n.jsx)("div",{className:(0,o.default)(eC.s.overlay,{[eC.s.removed]:!x.isNavigationMounted,[eC.s.overlayOpening]:x.isNavigationOpen,[eC.s.overlayClosing]:!x.isNavigationOpen}),onClick:R(()=>x.setOpenedBlock(null))}),(0,n.jsx)(tU,{data:_,minioUrl:i}),A]}):f?A:null},tF=e=>(0,n.jsx)(e2,{isMainBannerPage:e.isMainBannerPage,children:(0,n.jsx)(tM,{...e})}),tD=(0,c.g)("page-layout","sc"),tW=Object.freeze({main:`${tD}__main`}),tH=(0,i.default)(()=>e.A(56322).then(e=>e.CookiesPlate),{ssr:!1});e.s(["PageLayout",0,function({initialGeo:e,headerData:t,footerData:i,showStartGeoPopup:s=!1,citySelectProviderProps:l,children:r}){let{region:o,town:a}=e??{},c=(null==l?void 0:l.showcaseUrl)??"";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(eK,{...l,showcaseUrl:c,showStartGeoPopup:s,initialRegion:o,initialTown:a,children:[t&&(0,n.jsx)(tF,{...t}),(0,n.jsx)("main",{className:tW.main,children:r}),i&&(0,n.jsx)(eb,{...i})]}),(0,n.jsx)(tH,{})]})}],71267)}]);