(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74440,22926,45806,10108,e=>{"use strict";var t=e.i(17488);e.s(["Text",()=>t.T],74440);var n=e.i(43476),i=e.i(71645),s=e.i(62965),l=e.i(7670),o=e.i(28133),r=e.i(22468);let a=(0,r.g)("header","sc"),c=Object.freeze({header:`${a}`,fixed:`${a}__fixed`,hidden:`${a}__fixed--hidden`,transparent:`${a}--transparent`,navigationOpen:`${a}__navigation-open`,container:`${a}__container`,leftRow:`${a}__left-row`,logo:`${a}__logo`,menuItems:`${a}__menu-items`,menuItemActive:`${a}__menu-item-active`,tabletMenuButton:`${a}__tablet-menu-button`,buttonGroup:`${a}__button-group`,chips:`${a}__chips`,menuButton:`${a}__menu-button`,moreButtons:`${a}__more-buttons`,auth:`${a}__auth`,whiteIcons:`${a}__white-icons`,close:`${a}__close`,removed:`${a}__removed`,overlay:`${a}__overlay`,overlayOpening:`${a}__overlay--opening`,overlayClosing:`${a}__overlay--closing`}),u="cb-header",d=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],p=d.reduce((e,t)=>(e[t.id]=t.label,e),{}),m=Object.freeze({mobile:56,desktop:80});e.s(["F",0,m,"H",0,u,"U",0,"user_region","a",0,"user_town","b",0,p,"c",0,d,"s",0,c],22926);let h="finuslugi-header-height-change",f=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let s=encodeURIComponent(JSON.stringify(t)),l=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${s};expires=${i.toUTCString()};path=/;SameSite=Lax${l}`},w=(e,t,n)=>(0,o.h)({eventCategory:u,eventActionType:e,eventActionText:t,eventLabel:n});e.s(["H",0,h,"h",0,w,"i",0,()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{let e;(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})())&&!document.cookie.split(";").some(e=>e.trim().startsWith("utm_params="))&&f("utm_params",e,90),e&&f("utm_last",e,90)}catch(e){console.error("UTM tracking error:",e)}},0)},"s",0,(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),s=!1,l=0,o=0,r=window.innerWidth<768,a=()=>window.scrollY||document.documentElement.scrollTop,c=e=>{document.documentElement.style.setProperty("--new-header-height-desktop",e),document.documentElement.style.setProperty("--new-header-height-mobile",e)},u=()=>{let e=window.innerWidth<768;e!==r&&(r=e,o=0)},d=function(){let r=a(),u=document.getElementById("headerNotice");if((null==u?void 0:u.getAttribute("data-opening"))==="true")return;o||(()=>{let e=document.querySelector(":root");if(e){let t=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height"));o=Number.isNaN(t)?0:t,l=a()}})();let d=r<o,p=r<((null==i?void 0:i.clientHeight)||0);if(n&&p||d){s=!1,e(!1),t(!0),c(`${o}px`);return}e(s=r>l),s&&setTimeout(()=>t(!1),50),c(s?"0px":`${o}px`),l=r<=0?0:r},p=()=>{o=0,d()};return window.addEventListener("scroll",d),window.addEventListener("resize",u),window.addEventListener(h,p),()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",u),window.removeEventListener(h,p)}}],45806);let g=(0,r.g)("navigation-chips","sc"),v=Object.freeze({wrapper:`${g}__wrapper`,gray:`${g}__variantGray`,white:`${g}__variantWhite`,container:`${g}__container`,chip:`${g}__chip`,more:`${g}__chip--more`,active:`${g}__chip--active`,icon:`${g}__icon`,label:`${g}__label`,hidden:`${g}__hidden`}),_=(0,r.g)("navigation-content","sc"),x=Object.freeze({contentWrapper:`${_}__content-wrapper`,content:`${_}__content`,contentOpen:`${_}__content--open`,contentHeader:`${_}__content-header`,contentTitle:`${_}__content-title`,contentTitleUrl:`${_}__content-title--url`,contentTitleLink:`${_}__content-title--link`,contentTitleNew:`${_}__content-title--new`,new:`${_}__new`,newInline:`${_}__new-inline`,vip:`${_}__vip`,arrowIcon:`${_}__arrow-icon`,links:`${_}__links`,linksColumns:`${_}__links--columns`,linksTitleless:`${_}__links--titleless`,removed:`${_}__removed`,hidden:`${_}__content--hidden`}),b=({chip:e,hidden:t,onClick:i,refCallback:r,activeChipId:a})=>{let c=!!i,u=()=>{if(c)return null==i?void 0:i(e.url);w(o.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,n.jsxs)(n.Fragment,{children:[e.icon&&(0,n.jsx)("span",{className:v.icon,"aria-hidden":"true",children:e.icon}),(0,n.jsx)("span",{className:v.label,children:e.title}),e.arrow&&(0,n.jsx)(s.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,l.default)(v.chip,{[v.hidden]:t,[x.new]:!!e.new,[x.vip]:!!e.vip,[v.active]:e.url===a});return c?(0,n.jsx)("button",{type:"button",className:p,onClick:u,ref:r,children:d}):(0,n.jsx)("a",{href:e.url,className:p,onClick:u,ref:r,children:d})};e.s(["N",0,({items:e=[],maxNumberOfLines:t,variant:r,className:a,activeChipId:c,onClick:u,moreButtonOptions:d})=>{let p=(0,i.useRef)(null),m=(0,i.useRef)(null),h=(0,i.useRef)({}),f=(null==d?void 0:d.label)??"Еще",g="Еще",_=(null==d?void 0:d.showIcon)??!0,x=(0,l.default)(v.chip,v.more,null==d?void 0:d.className),[C,j]=(0,i.useState)(!1),[y,$]=(0,i.useState)(e.length),[k,N]=(0,i.useState)(!1);(0,i.useMemo)(()=>{let t=h.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(n=>{e.find(e=>String(e.url)===String(n))||delete t[n]})},[e]);let O=(0,i.useCallback)(()=>{let n=p.current;if(!n)return;let i=e=>e?e.getBoundingClientRect().width:0,s=i(n),l=Math.max(Number(t)||0,0),o=()=>{$(e.length),N(!1)};if(C||0===l||s<=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(m.current),c=e.map(e=>i(h.current[e.url]));if(c.some(e=>0===e))return void o();let u=1,d=0,f=0;for(let e of c){let t=u===l?a+r:0,n=0===d?e:d+r+e;if(n+t<=s-.5)d=n,f++;else{if(++u>l)break;d=e,f++}}N(f<e.length),$(f)},[C,e,t]);(0,i.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(O)});return t.observe(e),requestAnimationFrame(O),()=>{t.disconnect()}},[O]),(0,i.useEffect)(()=>{requestAnimationFrame(O)},[O]);let S=C||(t??0)<=0||!k;return(0,n.jsx)("div",{className:(0,l.default)(a,v.wrapper,{[v.gray]:"gray"===r,[v.white]:"white"===r}),children:(0,n.jsxs)("div",{ref:p,className:v.container,children:[e.map((e,t)=>(0,n.jsx)(b,{chip:e,hidden:!S&&t>=y,activeChipId:c,onClick:u,refCallback:t=>{h.current[e.url]=t}},e.url)),!S&&k&&(0,n.jsxs)("button",{type:"button",ref:m,className:x,"aria-label":g,onClick:()=>{w(o.D.chip,g),j(!0)},children:[_&&(0,n.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,n.jsx)("span",{className:v.label,children:f})]}),(S||!k)&&(0,n.jsxs)("button",{type:"button",ref:m,className:(0,l.default)(x,v.hidden),tabIndex:-1,"aria-hidden":"true",children:[_&&(0,n.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,n.jsx)("span",{className:v.label,children:f})]})]})})},"s",0,x],10108)},81795,90762,63288,e=>{"use strict";var t=e.i(43476),n=e.i(71645),i=e.i(62965);e.i(51966);var s=e.i(74006),l=e.i(17488);e.s(["Card",()=>l.h],90762);var l=l,o=e.i(12716),r=e.i(7670),a=e.i(85900),c=e.i(28133),u=e.i(22468),d=e.i(74080);let p=300,m=({opened:e})=>{let[t,i]=(0,n.useState)(!1),s=(0,n.useRef)(null),l=(0,n.useRef)(!1);return(0,n.useEffect)(()=>(e&&!l.current?(l.current=!0,i(!0)):!e&&l.current&&(s.current=setTimeout(()=>{l.current=!1,i(!1)},p)),()=>{s.current&&clearTimeout(s.current)}),[e]),{mounted:t}},h=(0,u.g)("click-outside","sc"),f=Object.freeze({overlay:`${h}__overlay`,open:`${h}--open`,close:`${h}--close`}),w=({onClose:e,onToucheMove:i,isOpen:s,delay:l=p})=>{let o=(0,n.useRef)(null),a=(0,n.useCallback)(()=>{e&&(o.current=setTimeout(()=>{e()},l))},[l,e]),c=(0,n.useCallback)(e=>{"Escape"===e.key&&a()},[a]);return(0,n.useEffect)(()=>(s&&window.addEventListener("keydown",c),()=>{o.current&&clearTimeout(o.current),window.removeEventListener("keydown",c)}),[s,c]),(0,t.jsx)("div",{className:(0,r.default)(f.overlay,{[f.open]:s,[f.close]:!s}),onTouchStart:i,onClick:a})},g=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},v=(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")},_=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},x=()=>document.querySelectorAll("[data-portal]").length>1,b=e=>{let t=(0,n.useRef)(null),i=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(i.current===e)return;i.current=e;let n=t.current,s=document.body,l=document.documentElement,o=window.innerWidth-l.clientWidth;if(e&&o>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 - ${o}px)`),s.style.setProperty("top",`-${window.prevScrollPosition}px`),g(n,!0);else if(e)s.style.setProperty("overflow","hidden"),s.style.setProperty("height","100vh"),g(n,!0);else{let e=!x();e&&v(s,l),e&&_(),g(n,!1)}return()=>{let e=!x();e&&v(s,l),e&&_()}},[e]),t},C=(0,u.g)("drawer-footer","sc"),j=Object.freeze({footer:`${C}__footer`,hasScroll:`${C}__footer--has-scroll`}),y=({footer:e,hasScroll:n,className:i})=>(0,t.jsx)("div",{className:(0,r.default)(j.footer,{[j.hasScroll]:n},i),children:"function"==typeof e?e():e}),$=(0,u.g)("drawer-content","sc"),k=Object.freeze({container:`${$}__container`,open:`${$}--open`,close:`${$}--close`,header:`${$}__header`,rowHeader:`${$}__header--row`,title:`${$}__title`,center:`${$}__title--center`,left:`${$}__title--left`,right:`${$}__title--right`,controlContainer:`${$}__control-container`,content:`${$}__content`,footer:`${$}__footer`}),N=({onClose:e,onContentClick:s,children:l,title:o,rowTitle:a,titleAlign:c,isCloseable:u,footer:d,closeButton:p,isOpen:m,contentClassName:h,footerClassName:f,contentStyle:w,width:g})=>{let v=(0,n.useRef)(null),_=(0,n.useRef)(null),[x,b]=(0,n.useState)(!1);(0,n.useEffect)(()=>{var e;if(!_.current||!v.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.current,i=()=>{let e=null==_?void 0:_.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let C=w||g?{width:g,...w||{}}:void 0;return(0,t.jsxs)("div",{ref:v,style:C,className:(0,r.default)(k.container,{[k.open]:m,[k.close]:!m},h),children:[o||u?(0,t.jsxs)("div",{className:(0,r.default)(k.header,{[k.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,t.jsx)("button",{type:"button",className:k.controlContainer,onClick:e,children:(0,t.jsx)(i.IconFdsCloseO,{size:24})}):null,o?(0,t.jsx)("h3",{className:(0,r.default)(k.title,{[k[c]]:!0}),children:o}):null]}):null,(0,t.jsx)("div",{ref:_,className:k.content,onClick:s,children:l}),d&&(0,t.jsx)(y,{className:(0,r.default)(k.footer,f),footer:d,hasScroll:x})]})},O=(0,u.g)("drawer-layout","sc"),S=Object.freeze({window:`${O}__window`}),T=({onClose:e,isOpen:i,children:s,withDisabledScroll:l,className:o,...a})=>{let c=(0,n.useCallback)(e=>e.stopPropagation(),[]);return b(i&&l),(0,t.jsxs)("div",{"data-portal":!0,className:(0,r.default)(S.window,o),children:[(0,t.jsx)(w,{onClose:e,isOpen:i,delay:0}),(0,t.jsx)(N,{onContentClick:c,onClose:e,isOpen:i,...a,children:s})]})},I=({isOpen:e=!1,children:n,titleAlign:i="center",isCloseable:s=!0,withDisabledScroll:l=!0,...o})=>{let{mounted:r}=m({opened:e});return r?(0,t.jsx)(T,{titleAlign:i,isCloseable:s,isOpen:e,withDisabledScroll:l,...o,children:n}):null};I.displayName="Drawer";let R=(0,u.g)("mobile-modal-footer","sc"),P=Object.freeze({footer:`${R}__footer`,footerWithoutShadow:`${R}__footer--without-shadow`}),E=({footer:e,isSmallPopup:n=!1,footerClassName:i})=>(0,t.jsx)("div",{className:(0,r.default)(P.footer,n&&P.footerWithoutShadow,i),children:"function"==typeof e?e():e}),A=(0,u.g)("mobile-popup","sc"),B=Object.freeze({mobilePopup:`${A}`,mobilePopupOpen:`${A}--open`,content:`${A}__content`,contentFull:`${A}__content--full`,contentTransition:`${A}__content--transition`,contentTransitionOpen:`${A}__content--transition-open`,contentLine:`${A}__content-line`,contentContainer:`${A}__content-container`,smallContentContainer:`${A}__content-container--small`,min:`${A}__content-container--min`,title:`${A}__title`,closeContainer:`${A}__close-container`,closeButton:`${A}__close-button`}),L=({children:e,footer:s,isOpen:l,isSmallPopup:o,onClose:a,hasCloseButton:c=!0,full:u,touchDistance:d=100,withDisabledScroll:p=!0,contentClassName:m,className:h,title:f,closeButton:g,footerClassName:v})=>{let[_,x]=(0,n.useState)(!1),[C,j]=(0,n.useState)(!1),[y,$]=(0,n.useState)(!0),[k,N]=(0,n.useState)("120%"),O=(0,n.useRef)(null),S=(0,n.useRef)(0),T=(0,n.useRef)(!1),I=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(T.current=!0,$(!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(`${n}px`),S.current=n}},R=()=>{T.current&&(S.current>d&&a?null==a||a():N("0"),$(!0),T.current=!1),window.removeEventListener("touchmove",I),window.removeEventListener("touchend",R)};return(0,n.useEffect)(()=>{l&&setTimeout(()=>{x(!0),j(!0),N("0")},100),!l&&C&&(N("120%"),x(!1),j(!1))},[C,l]),b(l&&p),(0,t.jsxs)("div",{"data-portal":!0,className:(0,r.default)(B.mobilePopup,C&&B.mobilePopupOpen,h),children:[(0,t.jsx)(w,{onClose:()=>{l&&(null==a||a())},onToucheMove:()=>{l&&(x(!1),window.addEventListener("touchmove",I),window.addEventListener("touchend",R))},isOpen:l,delay:0}),(0,t.jsxs)("div",{className:(0,r.default)(B.content,u&&B.contentFull,y&&B.contentTransition,y&&_&&B.contentTransitionOpen),ref:O,style:{transform:`translateY(${k})`},children:[(0,t.jsx)("div",{className:B.contentLine}),(0,t.jsxs)("div",{className:(0,r.default)(B.contentContainer,o&&B.smallContentContainer,{[B.min]:!f&&!c},m),children:[!!f&&(0,t.jsx)("div",{className:B.title,children:f}),c?(0,t.jsx)("div",{className:B.closeContainer,children:c?g?"function"==typeof g?g():g:(0,t.jsx)("button",{onClick:a,className:B.closeButton,children:(0,t.jsx)(i.IconFdsCloseO,{size:24})}):null}):null,e]}),s&&(0,t.jsx)(E,{footerClassName:v,isSmallPopup:o,footer:s})]})]})},z=({children:e,isSmallPopup:n=!1,isOpen:i=!1,...s})=>{let{mounted:l}=m({opened:i});return l?(0,t.jsx)(L,{isSmallPopup:n,isOpen:i,...s,children:e}):null};z.displayName="UiMobilePopup";let F=({children:e,id:t="portal-root"})=>{let[i,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=document.getElementById(t);if(e)return void s(e);let n=document.createElement("div");return n.id=t,document.body.appendChild(n),s(n),()=>{document.body.removeChild(n)}},[t]),i?(0,d.createPortal)(e,i):null};e.s(["D",0,I,"P",0,F,"U",0,z,"u",0,b],63288);var U=e.i(45806),M=e.i(22926),D=e.i(24359);let W={userRegion:M.U,userTown:M.a,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},H={userRegion:M.U,userTown:M.a,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},V=(e=!1)=>e?H:W,G=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},q=(e,t,n=!1)=>{if(typeof document>"u")return;let i=V(n);if(!e&&!t){D.a.removeItem(i.userRegion),D.a.removeItem(i.userTown);return}D.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),D.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},Y=e=>{if(typeof document>"u")return null;let t=D.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},J=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},Q=(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=J(V(e).allRegions)||[];return G(n,e),n},K=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),X=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]),[])},Z=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,ee=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},et=(e,t=!1)=>{if(e.length<1)return;let n=V(t);G(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},en=(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}},ei=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),es=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 et(t),t},el=async e=>{let t,n,[i,s]=await Promise.all([ee(Z(e,"/sc/api/v1/cities?all=true&isActive=true")),ee(Z(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,o=(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 K(o)?(et(o,!0),o):[]},eo=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?el(e):es(),er=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},ea=(e,t,n)=>{(0,c.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})};var ec=e.i(10108);let eu=Q(),ed=X(eu),ep={regions:eu,towns:ed,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},em=(0,n.createContext)(ep);function eh(){return(0,n.useContext)(em)}let ef=()=>{let e=(0,n.useRef)(null),t=(0,n.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),i=(0,n.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,n.useEffect)(()=>t,[t]),{start:i,clear:t,pending:!!e.current}},ew={"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"},eg=(0,n.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 ev(){return(0,n.useContext)(eg)}let e_=e=>{let[i,s]=(0,n.useState)(!1),[l,o]=(0,n.useState)(!1),[r,a]=(0,n.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d}=(()=>{let[e,t]=(0,n.useState)(!1),[i,s]=(0,n.useState)(!1),l=(0,n.useRef)(!1),o=e=>{l.current=e,s(e)};return(0,n.useEffect)(()=>{if(typeof window>"u")return;let e=(()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(ew,e)?ew[e]:ew["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((s,r)=>{var a,c;let u,d;l.current?r(Error("chat is already opened")):i?(i.openWidget(),t(!1),s()):(o(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let l=document.querySelector(".webchat");l&&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(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),o(!1),t(!1),s()},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:i}})(),[p,m]=(0,n.useState)(null),[h,f]=(0,n.useState)(null),[w,g]=(0,n.useState)(!1),[v,_]=(0,n.useState)(!1),[x,C]=(0,n.useState)(!1),j=(0,n.useRef)(null),y=b(w),$=(0,n.useRef)(null),k=(0,n.useRef)(null),N=(0,n.useRef)(null),O=(0,n.useRef)(null),S=(0,n.useCallback)(()=>{y.current&&y.current.scrollTo({top:0})},[y]),T=(0,n.useCallback)(e=>{f(e),S()},[S]),I=(0,n.useCallback)(e=>{$.current&&clearTimeout($.current),e&&_(!0),e||($.current=setTimeout(()=>{_(!1),T(null)},300))},[T]),R=(0,n.useCallback)((e,t,n)=>{if(t&&T(t),!n&&e===p||!e){I(!w),g(!w);return}m(e),I(!0),g(!0)},[p,T,w,I]),P=(0,n.useCallback)(()=>{k.current&&clearTimeout(k.current),C(!0),k.current=setTimeout(()=>{C(!1)},650)},[]);return(0,n.useEffect)(()=>{s(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,U.s)(o,a,e.isMainBannerPage);return(0,U.i)(),t},[]),(0,t.jsx)("header",{children:(0,t.jsx)(eg.Provider,{value:{isAuth:i,isHeaderHidden:l,isHeaderTransparent:r,openedBlock:p,setOpenedBlock:R,openedSection:h,setOpenedSection:T,isNavigationOpen:w,isNavigationMounted:v,navMenuItemsRef:j,navigationRef:y,ignoreClicks:x,setIgnoreClicks:P,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d,fixedContainerRef:N,headerRef:O},children:e.children})})},ex=(0,u.g)("certificates-warning-banner","sc"),eb=(0,u.g)("certificates-warning-popup","sc"),eC=Object.freeze({wrapper:`${ex}`,container:`${ex}__container`,content:`${ex}__content`,info:`${ex}__info`,image:`${ex}__image`,text:`${ex}__text`,title:`${ex}__title`,description:`${ex}__description`,details:`${ex}__details`,buttons:`${ex}__buttons`,button:`${ex}__button`,closeButton:`${ex}__close-button`,mobileActivator:`${ex}__mobile-activator`}),ej=Object.freeze({modal:`${eb}__modal`,desktopCloseButton:`${eb}__desktop-close-button`,mobilePopup:`${eb}__mobile-popup`,mobileContentContainer:`${eb}__mobile-content-container`,mobileCloseButton:`${eb}__mobile-close-button`,mobileDialog:`${eb}__mobile-dialog`,content:`${eb}__content`,image:`${eb}__image`,text:`${eb}__text`,title:`${eb}__title`,description:`${eb}__description`,actions:`${eb}__actions`,button:`${eb}__button`,gosuslugiButton:`${eb}__gosuslugi-button`,gosuslugiIcon:`${eb}__gosuslugi-icon`}),ey="fu_certificates_access_confirmed",e$="fu_certificates_banner_dismissed",ek="fu_external_link_warning_shown",eN=["--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"],eO=({onDismiss:e,onClosed:l,onOpenDetails:r,onOpenCertificatesPage:a,onOpenYandexBrowserPage:c})=>{let{fixedContainerRef:u,headerRef:d}=ev(),p=(0,n.useRef)(null),m=(0,n.useRef)(!1),[h,f]=(0,n.useState)(!1),[w,g]=(0,n.useState)(!1),v=(0,n.useCallback)(()=>{let e=p.current,t=u.current;if(!e||!t)return;let n=e.getBoundingClientRect().height,i=n+(window.innerWidth<768?M.F.mobile:M.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=m.current?"translateY(0)":`translateY(-${n}px)`,window.dispatchEvent(new Event(U.H))},[u]),_=(0,n.useCallback)(()=>{let e=u.current;eN.forEach(e=>document.documentElement.style.removeProperty(e)),e&&(e.style.transform=""),window.dispatchEvent(new Event(U.H))},[u]),x=(0,n.useCallback)(()=>{let e=u.current;if(!e)return;let t=window.innerWidth<768?M.F.mobile:M.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(U.H))},[u]);return(0,n.useEffect)(()=>{let e=d.current;if(!e)return;let t=()=>{g(!1),h&&l()};return e.addEventListener("transitionend",t),()=>e.removeEventListener("transitionend",t)},[d,h,l]),(0,n.useLayoutEffect)(()=>{var e;let t=p.current;if(!t)return;v();let n=window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=null;n?(m.current=!0,null==(e=u.current)||e.style.setProperty("transform","translateY(0)")):i=window.requestAnimationFrame(()=>{var e;m.current=!0,null==(e=u.current)||e.style.setProperty("transform","translateY(0)"),g(!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),_()}},[_,v]),(0,t.jsxs)("div",{id:"headerNotice",ref:p,role:"region","aria-label":"Сертификаты Минцифры","data-opening":w,className:eC.wrapper,children:[(0,t.jsx)("button",{className:eC.mobileActivator,type:"button","aria-label":"Подробнее о сертификатах Минцифры",onClick:r}),(0,t.jsx)(s.Container,{children:(0,t.jsxs)("div",{className:eC.container,children:[(0,t.jsxs)("div",{className:eC.content,children:[(0,t.jsxs)("div",{className:eC.info,children:[(0,t.jsx)("div",{className:eC.image,children:(0,t.jsx)(i.IconFdsShieldCheckO,{size:32})}),(0,t.jsxs)("div",{className:eC.text,children:[(0,t.jsx)("h2",{className:eC.title,children:"Для работы российских сайтов нужны сертификаты Минцифры"}),(0,t.jsx)("p",{className:eC.description,children:"Установите их, чтобы пользоваться всеми функциями сайта и оплачивать услуги без сбоев. Или откройте страницу через Яндекс Браузер — в него всё уже встроено"}),(0,t.jsxs)("span",{className:eC.details,children:["Подробнее",(0,t.jsx)(i.IconFdsChevronRightSmallO,{size:16})]})]})]}),(0,t.jsxs)("div",{className:eC.buttons,children:[(0,t.jsx)(o.Button,{className:eC.button,label:"Установить сертификаты",iconLeft:(0,t.jsx)(i.IconFdsGosuslugiColoredO,{size:16}),size:"xs",variant:"white",onClick:a}),(0,t.jsx)(o.Button,{className:eC.button,label:"Открыть в Яндекс Браузере",iconLeft:(0,t.jsx)("img",{src:"https://assets.finuslugi.ru/mp-assets/widgets/CertificatesWarning/yandex-browser.svg",loading:"lazy"}),size:"xs",variant:"white",appearance:"outline",onClick:c})]})]}),(0,t.jsx)("button",{className:eC.closeButton,type:"button","aria-label":"Закрыть",onClick:()=>{if(e(),window.matchMedia("(prefers-reduced-motion: reduce)").matches){_(),l();return}x(),f(!0)},children:(0,t.jsx)(i.IconFdsCloseO,{size:24})})]})})]})},eS=({onOpenCertificatesPage:e,onOpenYandexBrowserPage:s})=>{let l=(0,n.useRef)(null),r=`certificates-warning-gosuslugi-${(0,n.useId)().replaceAll(":","")}`;return(0,n.useLayoutEffect)(()=>{var e,t;let n=null==(e=l.current)?void 0:e.querySelector("linearGradient"),i=null==(t=l.current)?void 0:t.querySelector('path[fill^="url("]');n&&i&&(n.id=r,i.setAttribute("fill",`url(#${r})`))},[r]),(0,t.jsxs)("div",{className:ej.content,children:[(0,t.jsx)("div",{className:ej.image,children:(0,t.jsx)(i.IconFdsShieldCheckO,{size:64})}),(0,t.jsxs)("div",{className:ej.text,children:[(0,t.jsx)("h2",{className:ej.title,children:"Установите сертификаты Минцифры"}),(0,t.jsx)("p",{className:ej.description,children:"Без них российские сайты и оплата услуг могут не работать. Или откройте страницу через Яндекс Браузер — в него всё уже встроено"})]}),(0,t.jsxs)("div",{className:ej.actions,children:[(0,t.jsx)(o.Button,{className:`${ej.button} ${ej.gosuslugiButton}`,label:"Установить сертификаты",iconLeft:(0,t.jsx)("span",{ref:l,className:ej.gosuslugiIcon,children:(0,t.jsx)(i.IconFdsGosuslugiColoredO,{size:20})}),size:"s",stretch:!0,onClick:e}),(0,t.jsx)(o.Button,{className:ej.button,label:"Открыть в Яндекс Браузере",iconLeft:(0,t.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:s})]})]})},eT=({isOpen:e,onClose:s,onOpenCertificatesPage:l,onOpenYandexBrowserPage:r})=>{let a=(0,o.useBreakpointUp)("l"),c=(0,n.useRef)(null),u=(0,t.jsx)(eS,{onOpenCertificatesPage:l,onOpenYandexBrowserPage:r});return(0,n.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.setTimeout(()=>{var e;if(!a){null==(e=c.current)||e.focus();return}let t=document.querySelector(`.${ej.desktopCloseButton}`);null==t||t.focus()},120),i=e=>{a||"Escape"===e.key&&s()};return document.addEventListener("keydown",i),()=>{window.clearTimeout(n),document.removeEventListener("keydown",i),null==t||t.focus()}},[a,e,s]),a?(0,t.jsxs)(o.Modal,{className:ej.modal,open:e,size:"m",noPadding:!0,header:{withoutCloseBtn:!0},"aria-label":"Установите сертификаты Минцифры",onClose:s,children:[(0,t.jsx)("button",{className:ej.desktopCloseButton,type:"button","aria-label":"Закрыть",onClick:s,children:(0,t.jsx)(i.IconFdsCloseO,{size:24})}),u]}):(0,t.jsx)(F,{children:(0,t.jsx)(z,{className:ej.mobilePopup,contentClassName:ej.mobileContentContainer,isOpen:e,isSmallPopup:!0,onClose:s,closeButton:(0,t.jsx)("button",{className:ej.mobileCloseButton,type:"button","aria-label":"Закрыть",onClick:s,children:(0,t.jsx)(i.IconFdsCloseO,{size:24})}),children:(0,t.jsx)("div",{ref:c,className:ej.mobileDialog,role:"dialog","aria-modal":"true","aria-label":"Установите сертификаты Минцифры",tabIndex:-1,children:u})})})},eI=new Map,eR=e=>{if(typeof window>"u")return"1"===eI.get(e);try{return"1"===window.localStorage.getItem(e)||"1"===eI.get(e)}catch{return"1"===eI.get(e)}},eP=e=>{if(eI.set(e,"1"),!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},eE=(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}},eA=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)}},eB=(0,u.g)("city-select-modal-body","sc"),eL=Object.freeze({wrapper:`${eB}__wrapper`,subtitle:`${eB}__subtitle`,hintWrapper:`${eB}__hint-wrapper`,hintText:`${eB}__hint-text`,input:`${eB}__input`,chips:`${eB}__chips`,townsListWrapper:`${eB}__towns-list-wrapper`,townsList:`${eB}__towns-list`,townsGroup:`${eB}__towns-group`,townsGroupLabel:`${eB}__towns-group-label`,townsGroupList:`${eB}__towns-group-list`,townsName:`${eB}__towns-name`,regionName:`${eB}__region-name`}),ez=({groupedTowns:e,chips:s,query:l,setQuery:r,isDrawer:a})=>{var u;let d=eh(),p=(0,n.useRef)(null),[m,h]=(0,n.useState)("10000px");(0,n.useEffect)(()=>{if(!a||!p.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let s=n.map(e=>[...e]),l=s.map(e),o=l.reduce((e,t,n)=>t<l[e]?n:e,0);0===o&&s[0].push(s[1].shift()),2===o&&s[2].unshift(s[1].pop()),1===o&&l[0]>l[2]&&s[1].unshift(s[0].pop()),1===o&&l[0]<l[2]&&s[1].push(s[2].shift());let r=Math.max(...s.map(e));return r>=i?i:t(s,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 f=e=>{if(ea(c.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,t.jsxs)("div",{className:eL.wrapper,children:[(0,t.jsxs)("div",{className:eL.subtitle,children:["Покажем предложения рядом с вами",(0,t.jsxs)("div",{className:eL.hintWrapper,children:[(0,t.jsx)(i.IconFdsQuestionCircleO,{size:24}),(0,t.jsx)("div",{className:eL.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,t.jsx)(o.InputBase,{className:eL.input,value:l,onChange:r,size:"s",placeholder:"Введите название города",icon:l?(0,t.jsx)(i.IconFdsCloseCircleO,{size:24,onClick:()=>r("")}):(0,t.jsx)(i.IconFdsSearchO,{size:24})}),(0,t.jsx)(o.Chips,{className:eL.chips,chips:s,value:(null==(u=d.town)?void 0:u.id)||0,onChipClick:e=>{f(d.towns.find(t=>t.id===e))}}),(0,t.jsx)("div",{className:eL.townsListWrapper,children:(0,t.jsx)("div",{ref:p,className:eL.townsList,style:{maxHeight:m},children:e.map(e=>(0,t.jsxs)("div",{className:eL.townsGroup,children:[(0,t.jsx)("div",{className:eL.townsGroupLabel,children:e.letter}),(0,t.jsx)("div",{className:eL.townsGroupList,children:e.towns.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>f(e),children:[(0,t.jsx)("div",{className:eL.townsName,children:e.name}),(0,t.jsx)("div",{className:eL.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},eF=[1095,1096,134,720,189,180],eU=()=>{var e;let i=eh(),s=(0,o.useBreakpointUp)("l"),[l,r]=(0,n.useState)(""),a=`Ваш выбор: ${(null==(e=i.town)?void 0:e.name)||"Вся Россия"}`,u=(0,n.useMemo)(()=>i.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(l.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[l,i.towns.length]),d=(0,n.useMemo)(()=>[{id:0,label:"Вся Россия"},...eF.map(e=>{let t=i.towns.find(t=>t.id===e);return{id:null==t?void 0:t.id,label:null==t?void 0:t.name}}).filter(e=>(null==e?void 0:e.id)!==void 0)],[i.towns.length]),p=()=>{ea(c.D.button,"close"),i.handleToggleModal(!1)};return(0,t.jsxs)(F,{children:[!s&&(0,t.jsx)(z,{title:a,isOpen:i.popupVisible,onClose:p,full:!0,children:(0,t.jsx)(ez,{groupedTowns:u,chips:d,query:l,setQuery:r})}),s&&(0,t.jsx)(I,{title:a,isOpen:i.popupVisible,onClose:p,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,t.jsx)(ez,{groupedTowns:u,chips:d,query:l,setQuery:r,isDrawer:!0})})]})},eM=({label:e,onClick:n,eventActionText:i,eventLabel:s,...l})=>(0,t.jsx)(o.Button,{label:e,onClick:e=>{null==n||n(e),(0,c.h)({eventCategory:M.H,eventActionType:c.D.button,eventActionText:i||"",eventLabel:s||""})},...l}),eD=(0,u.g)("header-popup","sc"),eW=Object.freeze({popup:`${eD}__popup`,popupHeader:`${eD}__popup-header`,popupClose:`${eD}__popup-close`,body:`${eD}__body`}),eH=({isOpen:e,onClose:n,children:s,title:l})=>{let r=(0,o.useBreakpointUp)("l");return(0,t.jsxs)(F,{children:[!r&&(0,t.jsx)(z,{title:l,isOpen:e,onClose:n,children:s}),r&&e&&(0,t.jsxs)("div",{className:eW.popup,children:[(0,t.jsxs)("div",{className:eW.popupHeader,children:[l,(0,t.jsx)(eM,{className:eW.popupClose,iconLeft:(0,t.jsx)(i.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:n,eventActionText:"IconFdsCloseO"})]}),(0,t.jsx)("div",{className:eW.body,children:s})]})]})},eV=(0,u.g)("start-choice-popup","sc"),eG=Object.freeze({top:`${eV}__top`,progress:`${eV}__progress`,innerCircle:`${eV}__inner-circle`,title:`${eV}__title`,subtitle:`${eV}__subtitle`,actions:`${eV}__actions`}),eq=()=>{var e,i;let s=eh(),[l,o]=(0,n.useState)(10),[r,a]=(0,n.useState)(0),u=(0,n.useRef)(void 0),d=()=>{ea(c.D.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(s.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(s.startRegion)||""),s.setStartPopupVisible(!1)};return(0,n.useEffect)(()=>{let e,t,n,i;s.startPopupVisible?(t=1e3*(e=Number((" "+l).slice(1)))/100,n=0,i=0,u.current=setInterval(()=>{n++,i+=t,a(3.6*n);let s=e-Math.floor(i/1e3);s<l&&o(s),100===n&&(clearInterval(u.current),d())},t)):(clearInterval(u.current),o(10),a(0))},[s.startPopupVisible]),(0,t.jsxs)(eH,{isOpen:s.startPopupVisible,onClose:d,title:(0,t.jsx)("button",{type:"button",className:eG.progress,style:{background:`conic-gradient(#ff0508 ${r}deg, #e3e7ec 0deg)`},onClick:d,children:(0,t.jsx)("div",{className:eG.innerCircle,children:l})}),children:[(0,t.jsxs)("div",{className:eG.top,children:[(0,t.jsxs)("div",{className:eG.title,children:["Ваш город ",(null==(e=s.startTown)?void 0:e.name)||(null==(i=s.startRegion)?void 0:i.name)||"Вся Россия","?"]}),(0,t.jsx)("div",{className:eG.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,t.jsxs)("div",{className:eG.actions,children:[(0,t.jsx)(eM,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{ea(c.D.button,"Да, все верно"),s.selectCity(s.startRegion,s.startTown)},children:"Да, все верно"}),(0,t.jsx)(eM,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{ea(c.D.button,"Нет, изменить"),s.setStartPopupVisible(!1),s.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},eY=(0,u.g)("city-select","sc"),eJ=Object.freeze({button:`${eY}__button`,minimal:`${eY}__minimal`,full:`${eY}__full`}),eQ=({initialTown:e})=>{var s;let l=eh(),a=(null==(s=l.town)?void 0:s.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:u}=ev(),{startPopupVisible:d,setStartPopupVisible:p,popupVisible:m}=l,h=(0,n.useRef)();(0,n.useEffect)(()=>{m&&(h.current="popup")},[m]),(0,n.useEffect)(()=>{u&&(h.current="chat")},[u]),(0,n.useEffect)(()=>{d&&(h.current="startPopup")},[d]),(0,n.useEffect)(()=>{h.current&&("chat"===h.current&&d?p(!1):["startPopup","popup"].includes(h.current)&&u&&c(!1))},[m,u,d,p,c]);let f={appearance:"ghost",size:"xs",onClick:()=>l.handleButtonClick(!1),iconLeft:(0,t.jsx)(i.IconFdsLocationO,{size:24})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{...f,className:(0,r.default)(eJ.button,eJ.full),label:a}),(0,t.jsx)(o.Button,{...f,className:(0,r.default)(eJ.button,eJ.minimal),shape:"icon"}),(0,t.jsx)(eU,{}),(0,t.jsx)(eq,{})]})},eK=({onClick:e,eventActionType:n,eventActionText:i,eventLabel:s,...l})=>(0,t.jsx)(o.Link,{onClick:t=>{null==e||e(t),(0,c.h)({eventCategory:M.H,eventActionType:n||c.D.link,eventActionText:i||"",eventLabel:s||""})},...l}),eX=(0,u.g)("header-mobile-app-banner","sc"),eZ=Object.freeze({wrapper:`${eX}__wrapper`,container:`${eX}__container`,closeButton:`${eX}__close-button`,innerWrapper:`${eX}__inner-wrapper`,imageWrapper:`${eX}__image-wrapper`,image:`${eX}__image`,title:`${eX}__title`,description:`${eX}__description`,callToAction:`${eX}__call-to-action`,scanQr:`${eX}__scan-qr`}),e0=Object.freeze({mobile:56,desktop:68}),e1="headerBannerShownAt",e2=({minioUrl:e,className:l,mobileAppUrl:u})=>{let{fixedContainerRef:d,headerRef:p}=ev(),[m,h]=(0,n.useState)(!1),[f,w]=(0,n.useState)(!1),[g,v]=(0,n.useState)(!1),_=(0,n.useCallback)((e="desktop")=>{let t=d.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${e0[e]+M.F[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${e0.desktop+M.F.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${e0.mobile+M.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${e0.mobile+M.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${e0.desktop+M.F.desktop}px`),document.documentElement.style.setProperty("--header-height",`${e0[e]+108}px`))},[]),x=(0,n.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,n.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{f&&h(!1),v(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[f]),(0,n.useEffect)(()=>{let e;(!(e=(()=>{let e=localStorage.getItem(e1);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,n.useEffect)(()=>{let e=window.innerWidth<768;m&&(_(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):v(!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,t.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":g,className:(0,r.default)(eZ.wrapper,l),children:(0,t.jsx)(s.Container,{children:(0,t.jsxs)("div",{className:eZ.container,children:[(0,t.jsxs)("div",{className:eZ.innerWrapper,children:[(0,t.jsxs)("picture",{className:eZ.imageWrapper,children:[(0,t.jsx)("source",{srcSet:(0,a.joinURL)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,t.jsx)("img",{className:eZ.image,src:(0,a.joinURL)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,t.jsxs)("div",{className:eZ.scanQr,children:[(0,t.jsx)("div",{className:eZ.title,children:"Скачайте приложение Финуслуги"}),(0,t.jsx)("div",{className:eZ.description,children:"Сканируйте QR-код"})]}),(0,t.jsxs)("div",{className:eZ.callToAction,children:[(0,t.jsxs)("div",{children:["Приложение",(0,t.jsx)("br",{}),"Финуслуги"]}),(0,t.jsx)(o.Button,{onClick:()=>{(0,U.h)(c.D.button,"skachat_mob_prilozheniye_fu"),window.open(u,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,t.jsx)("div",{"aria-label":"Закрыть",role:"button",className:eZ.closeButton,onClick:()=>{localStorage.setItem(e1,new Date().toISOString()),x(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):w(!0)},children:(0,t.jsx)(i.IconFdsCloseO,{size:"100%"})})]})})}):null},e4=(0,u.g)("header-chat-modal-body","sc"),e6=Object.freeze({wrapper:`${e4}__wrapper`,cardButton:`${e4}__card-button`,card:`${e4}__card`,cardTitle:`${e4}__card-title`,cardSubtitle:`${e4}__card-subtitle`,button:`${e4}__button`}),e8=()=>{let e=ev();return(0,t.jsxs)("div",{className:e6.wrapper,children:[(0,t.jsx)(eM,{className:e6.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,t.jsxs)(l.h,{className:e6.card,variant:"secondary",children:[(0,t.jsxs)("div",{className:e6.cardTitle,children:[(0,t.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,t.jsxs)("p",{className:e6.cardSubtitle,children:["Виртуальный ассистент доступен 24/7, ",(0,t.jsx)("br",{}),"операторы — с 6:00 до 23:59 мск"]})]})}),!1]})},e3=({data:e,isMobile:s})=>{let l=ev();return(0,t.jsx)("div",{className:ec.s.contentWrapper,children:e.map(e=>(0,t.jsx)(n.Fragment,{children:e.sections.map(e=>{var n;return(0,t.jsxs)("div",{className:(0,r.default)(ec.s.content,{[ec.s.hidden]:l.openedSection!==e.id,[ec.s.contentOpen]:!!l.openedSection}),children:[(0,t.jsx)("div",{className:ec.s.contentHeader,children:(0,t.jsx)("label",{children:e.title})}),null==(n=e.content)?void 0:n.map((n,l)=>{var o,a;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:(0,t.jsx)("a",{className:(0,r.default)(ec.s.contentTitle,{[ec.s.removed]:!n.title,[ec.s.contentTitleUrl]:!!n.url,[ec.s.contentTitleLink]:!!e.isSeeAllLinkAvailable,[ec.s.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,t.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,t.jsx)("div",{className:ec.s.arrowIcon,children:(0,t.jsx)(i.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(o=n.links)&&o.length)&&(0,t.jsx)(ec.N,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:s?3:2}),!!(null!=(a=n.links)&&a.length)&&(0,t.jsx)("div",{className:(0,r.default)(ec.s.links,{[ec.s.linksColumns]:!!n.columns,[ec.s.linksTitleless]:!n.title}),children:n.links.map(e=>(0,t.jsxs)("a",{href:e.url,onClick:()=>(0,U.h)(c.D.link,e.title,`${e.title}_${e.url}`),children:[(0,t.jsx)("div",{className:ec.s.arrowIcon,children:(0,t.jsx)(i.IconFdsArrowUpRightSmallO,{})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{children:e.title}),!!e.new&&(0,t.jsx)("span",{className:(0,r.default)({[ec.s.newInline]:!!e.new})})]})]},e.url))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},e7=(0,u.g)("navigation-section-icon","sc"),e5=Object.freeze({icon:`${e7}`}),e9=({name:e,background:s})=>{let l=(0,n.useMemo)(()=>e&&i[e]||null,[e]);return e&&l?(0,t.jsx)("div",{className:e5.icon,style:{background:s},children:(0,t.jsx)(l,{})}):null},te=(0,u.g)("navigation","sc"),tt=Object.freeze({navigation:`${te}`,navigationOpening:`${te}--opening`,navigationClosing:`${te}--closing`,wrapper:`${te}__wrapper`,container:`${te}__container`,containerOpen:`${te}__container--open`,sections:`${te}__sections`,sectionsOpen:`${te}__sections--open`,citySelectButton:`${te}__city-select-button`,sectionsTitle:`${te}__sections-title`,sectionsWrapper:`${te}__sections-wrapper`,section:`${te}__section`,sectionArrow:`${te}__section-arrow`,sectionExtra:`${te}__section--extra`,sectionActive:`${te}__section--active`,sectionTitle:`${te}__section-title`,chatWrapper:`${te}__chat-wrapper`,chatHeader:`${te}__chat-header`,backButton:`${te}__back-button`,useful:`${te}__useful`,usefulOpen:`${te}__useful--open`,usefulTitle:`${te}__useful-title`,usefulGrid:`${te}__useful-grid`,removed:`${te}__removed`}),tn=({data:e})=>{var l;let a=ev(),u=eh(),d=(0,o.useBreakpointDown)("m"),[p,m]=(0,n.useState)(!0);(0,n.useEffect)(()=>{m(d)},[d]);let h=(0,n.useRef)(null),f=(0,n.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>a.openedSection?a.setOpenedSection(null):a.isNavigationOpen?a.setOpenedBlock(null):void 0,50)},[a]),w=(0,n.useRef)(!1),g=(0,n.useRef)(null),v=(0,n.useCallback)(()=>{p&&(w.current=!0,g.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),f()},window.history.pushState(null,"",window.location.href))},[f,p]),_=(0,n.useCallback)(()=>{w.current=!1,window.onpopstate=g.current,window.history.go(-1)},[]),x=(0,n.useRef)(null),b=(0,n.useCallback)(e=>{if(p||!a.navMenuItemsRef.current||!a.navigationRef.current)return;let t=e.target,n=!a.navMenuItemsRef.current.contains(t)&&!a.navigationRef.current.contains(t);if(n&&!x.current){a.setIgnoreClicks(),x.current=setTimeout(()=>a.setOpenedBlock(null),300);return}!n&&x.current&&(clearTimeout(x.current),x.current=null)},[p,a]),C=(0,n.useRef)(null),j=(0,n.useCallback)(e=>{typeof window>"u"||(e?(C.current=b,window.addEventListener("mousemove",C.current)):C.current&&window.removeEventListener("mousemove",C.current))},[b]);(0,n.useEffect)(()=>{j(a.isNavigationOpen),a.isNavigationOpen&&!w.current&&v(),!a.isNavigationOpen&&w.current&&_()},[a.isNavigationOpen]);let y=(e,t)=>()=>{(0,U.h)(c.D.button,t),a.setOpenedSection(e)},{start:$,clear:k}=ef(),N=()=>{p||k()};return(0,t.jsx)("div",{ref:a.navigationRef,className:(0,r.default)(tt.navigation,{[tt.removed]:!a.isNavigationMounted,[tt.navigationOpening]:a.isNavigationOpen,[tt.navigationClosing]:!a.isNavigationOpen}),children:(0,t.jsx)("div",{className:tt.wrapper,children:(0,t.jsxs)(s.Container,{className:(0,r.default)(tt.container,{[tt.containerOpen]:!!a.openedSection}),children:[(0,t.jsxs)("div",{className:(0,r.default)(tt.sections,{[tt.sectionsOpen]:!!a.openedSection}),children:[(0,t.jsx)(o.Button,{className:tt.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>u.handleButtonClick(!1),iconLeft:(0,t.jsx)(i.IconFdsLocationO,{size:24}),label:(null==(l=u.town)?void 0:l.name)||"Вся Россия"}),e.map(e=>(0,t.jsxs)("ul",{className:(0,r.default)(tt.sectionsWrapper,{[tt.removed]:a.openedBlock!==e.id&&!p}),children:[(0,t.jsx)("div",{className:tt.sectionsTitle,children:M.b[e.id]}),e.sections.map(e=>{let n,s;return(0,t.jsxs)("li",{className:(0,r.default)(tt.section,{[tt.sectionExtra]:!!e.extra,[tt.sectionActive]:a.openedSection===e.id}),onClick:y(e.id,e.title),onMouseEnter:(n=e.id,s=e.title,()=>{p||$(y(n,s),150)}),onMouseLeave:N,children:[(0,t.jsx)(e9,{name:e.uikitIcon,background:e.uikitIconBg}),(0,t.jsx)("span",{className:tt.sectionTitle,children:e.title}),(0,t.jsx)("div",{className:tt.sectionArrow,children:(0,t.jsx)(i.IconFdsChevronRightSmallO,{size:24})})]},e.id)})]},e.id)),(0,t.jsxs)("div",{className:tt.chatWrapper,children:[(0,t.jsx)("div",{className:tt.chatHeader,children:"Нужна помощь?"}),(0,t.jsx)(e8,{})]})]}),(0,t.jsxs)("button",{type:"button",className:(0,r.default)(tt.backButton,{[tt.removed]:!a.openedSection}),onClick:()=>{(0,U.h)(c.D.button,"Назад"),a.setOpenedSection(null)},children:[(0,t.jsx)(i.IconFdsChevronLeftO,{size:24}),(0,t.jsx)("span",{children:"Назад"})]}),(0,t.jsx)(e3,{data:e,isMobile:p}),(0,t.jsxs)("div",{className:(0,r.default)(tt.useful,{[tt.usefulOpen]:!!a.openedSection}),children:[(0,t.jsx)("div",{className:tt.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,t.jsx)(n.Fragment,{children:e.sections.map(e=>{var n;return(0,t.jsx)("div",{className:(0,r.default)(tt.usefulGrid,{[tt.removed]:a.openedSection!==e.id}),children:null==(n=e.useful)?void 0:n.map((e,n)=>(0,t.jsxs)("a",{href:e.url,onClick:()=>(0,U.h)(c.D.link,e.title,`${e.title}_${e.url}`),children:[(0,t.jsx)("div",{children:(0,t.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${n}`))},e.id)})},e.id))]})]})})})},ti=({data:e,showcaseUrl:l="https://finuslugi.ru",minioUrl:u="https://assets.finuslugi.ru/mp-assets",lkUrl:d="https://lk.finuslugi.ru/registration",initialTown:p,isMainBannerPage:m,enableAppHeaderBanner:h=!1,enableCertificatesBanner:f=!1,enableExternalLinkWarning:w=!1,news:g,className:v})=>{let _=ev(),x=(0,n.useMemo)(()=>((e,t,n)=>{var i,s,l,o,r,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==(o=null==(l=null==e?void 0:e.NAVIGATOR)?void 0:l[d])?void 0:o.content)||[];if(null!=(u=null==(c=null==(r=null==e?void 0:e.NAVIGATOR)?void 0:r[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,l,g),[e,l,g]),b=null==e?void 0:e.config,C=(({enableCertificatesBanner:e,enableExternalLinkWarning:t,isMainBannerPage:i})=>{let[s,l]=(0,n.useState)("checking"),[o,r]=(0,n.useState)(!1),[a,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),p=(0,n.useRef)(),m=(0,n.useRef)(!1),h=(0,n.useRef)(!1),f=(0,n.useRef)(null),w=(0,n.useRef)(null),g=e&&i,v=g||t,_=(0,n.useCallback)(e=>{let t=p.current;t?t.call(window,e,"_blank","noopener,noreferrer"):window.open(e,"_blank","noopener,noreferrer")},[]),x=(0,n.useCallback)(()=>{r(!1),w.current=null},[]),b=(0,n.useCallback)(e=>{eP(ek),h.current=!0,w.current=e,r(!0)},[]),C=(0,n.useCallback)(()=>!m.current&&("external"===w.current||!h.current),[]),j=(0,n.useCallback)(()=>{"external"!==w.current&&b("external")},[b]);return(0,n.useEffect)(()=>{p.current=window.open,m.current=eR(ey),h.current=eR(ek),d(m.current),c(!0)},[]),(0,n.useEffect)(()=>{if(a){if(!g)return void l("skipped");l(e=>"shown"===e||"closing"===e||"dismissed"===e?e:u||eR(e$)?"skipped":"shown")}},[u,g,a]),(0,n.useEffect)(()=>{if(!a||!v||m.current)return;let e=new AbortController;return f.current=e,eA("https://www.sberbank.ru/common_static/favicon.ico",1800,e.signal).then(t=>{f.current===e&&(f.current=null,t&&(eP(ey),m.current=!0,d(!0),"external"===w.current&&((e=>{if(eI.delete(e),!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}})(ek),h.current=!1),w.current&&x()))}),()=>{e.abort(),f.current===e&&(f.current=null)}},[x,v,a]),(0,n.useEffect)(()=>{if(!a||!t)return;let e=p.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&&eE(t.href,window.location)&&C()&&(e.preventDefault(),queueMicrotask(()=>{n&&C()&&j()}))},s=(t,n="_blank",i)=>eE(t,window.location)&&C()?(j(),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,a,C,j]),(0,n.useEffect)(()=>{t||"external"===w.current&&x()},[x,t]),(0,n.useEffect)(()=>{g||"banner"===w.current&&x()},[x,g]),(0,n.useEffect)(()=>{v||x()},[x,v]),{bannerStatus:s,isPopupOpen:o,dismissBanner:(0,n.useCallback)(()=>{eP(e$),l("closing")},[]),finishBannerClosing:(0,n.useCallback)(()=>{l("dismissed")},[]),openPopupFromBanner:(0,n.useCallback)(()=>{b("banner")},[b]),closePopup:x,openCertificatesPage:(0,n.useCallback)(()=>{_("https://www.gosuslugi.ru/crt")},[_]),openYandexBrowserPage:(0,n.useCallback)(()=>{_("https://browser.yandex.ru/")},[_])}})({enableCertificatesBanner:!!e&&f,enableExternalLinkWarning:w,isMainBannerPage:!!m}),j="shown"===C.bannerStatus||"closing"===C.bannerStatus,y="skipped"===C.bannerStatus,$=(0,n.useMemo)(()=>x.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[x]),k=_.isAuth?"Личный кабинет":"Войти",N=m&&_.isHeaderTransparent,O=(e,t,n,i)=>()=>{e!==_.openedBlock?(0,U.h)(c.D.toggle,t,"on"):(0,U.h)(c.D.button,"menu_close","on");let s=n?$[e]:"";_.setOpenedBlock(e,s,!!i)},{start:S,clear:T}=ef(),I=e=>()=>{_.ignoreClicks||e()},R=(0,t.jsx)(eT,{isOpen:C.isPopupOpen,onClose:C.closePopup,onOpenCertificatesPage:C.openCertificatesPage,onOpenYandexBrowserPage:C.openYandexBrowserPage});return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:_.headerRef,className:(0,r.default)(M.s.header,v,{[M.s.transparent]:N}),children:(0,t.jsxs)("div",{ref:_.fixedContainerRef,className:(0,r.default)(M.s.fixed,{[M.s.hidden]:_.isHeaderHidden,[M.s.navigationOpen]:_.isNavigationOpen}),children:[j&&(0,t.jsx)(eO,{onDismiss:C.dismissBanner,onClosed:C.finishBannerClosing,onOpenDetails:C.openPopupFromBanner,onOpenCertificatesPage:C.openCertificatesPage,onOpenYandexBrowserPage:C.openYandexBrowserPage}),y&&!!(null!=b&&b.appBannerUrl)&&h&&(0,t.jsx)(e2,{mobileAppUrl:b.appBannerUrl,minioUrl:u}),(0,t.jsxs)(s.Container,{className:M.s.container,children:[(0,t.jsxs)("div",{className:M.s.leftRow,children:[(0,t.jsx)(eK,{className:M.s.logo,href:l,eventActionType:c.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${l}`,children:(0,t.jsxs)("picture",{children:[(0,t.jsx)("source",{srcSet:(0,a.joinURL)(u,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,t.jsx)("img",{src:(0,a.joinURL)(u,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,t.jsx)("nav",{ref:_.navMenuItemsRef,className:M.s.menuItems,children:(0,t.jsx)("ul",{children:M.c.map(({id:e,label:n})=>(0,t.jsx)("li",{children:(0,t.jsx)(o.Button,{className:(0,r.default)({[M.s.menuItemActive]:_.openedBlock===e&&_.isNavigationOpen}),label:n,variant:"white",size:"xs",onClick:I(O(e,n,!0)),onMouseEnter:()=>{_.isNavigationOpen&&e===_.openedBlock||_.setIgnoreClicks(),S(O(e,n,!0,!0),200)},onMouseLeave:T})},e))})}),(0,t.jsx)(eM,{className:(0,r.default)(M.s.tabletMenuButton,{[M.s.menuItemActive]:_.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,t.jsx)(i.IconFdsChevronDownO,{size:24}),onClick:O("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,t.jsxs)("div",{className:(0,r.default)(M.s.buttonGroup,{[M.s.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,t.jsxs)("div",{className:M.s.chips,children:[(0,t.jsx)(eM,{as:"a",href:d,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${d}`,iconLeft:(0,t.jsx)(i.IconFdsUserO,{size:20})}),(0,t.jsx)(eM,{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,t.jsx)(i.IconFdsChatDotsCircleO,{size:24})})]}),(0,t.jsx)(eM,{className:M.s.menuButton,size:"xs",shape:N?"icon":"default",appearance:N?"ghost":"fill",label:"Меню",onClick:O("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,t.jsx)(i.IconFdsMenuSkewedO,{size:24})}),(0,t.jsxs)("div",{className:M.s.moreButtons,children:[(0,t.jsx)(eQ,{initialTown:p}),(0,t.jsx)(eM,{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,t.jsx)(i.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,t.jsx)(eM,{as:"a",href:d,size:"xs",eventActionText:k,eventLabel:`${k}_${d}`,label:k})]})]}),(0,t.jsxs)(eK,{className:M.s.auth,href:d,eventActionText:k,eventLabel:`${k}_${d}`,children:[(0,t.jsx)(eM,{size:"xs",shape:"circle-icon",iconLeft:(0,t.jsx)(i.IconFdsUserO,{}),eventActionText:k,eventLabel:`${k}_${d}`}),(0,t.jsx)("p",{children:k})]}),(0,t.jsx)("div",{className:M.s.close,children:(0,t.jsx)(eM,{className:M.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,t.jsx)(i.IconFdsCloseO,{}),onClick:()=>_.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,t.jsx)("div",{className:(0,r.default)(M.s.overlay,{[M.s.removed]:!_.isNavigationMounted,[M.s.overlayOpening]:_.isNavigationOpen,[M.s.overlayClosing]:!_.isNavigationOpen}),onClick:I(()=>_.setOpenedBlock(null))}),(0,t.jsx)(tn,{data:x,minioUrl:u}),R]}):w?R:null};e.s(["C",0,({children:e,initialRegion:i,initialTown:s,showStartGeoPopup:l=!0,lastRegionsUpdateUnixTimestamp:o,dadataUrl:r="https://finuslugi.ru/backend/money/dadata",showcaseUrl:a="",useNewCitiesApi:u=!1})=>{let d=V(u),p=Number(J(d.lastRegionsUpdateUnixTimestamp)||0),m=Number(o||0)>p,[h,f]=(0,n.useState)(Q(u)),w=(0,n.useRef)(h),[{startRegion:g,startTown:v},_]=(0,n.useState)({startRegion:ep.startRegion,startTown:ep.startTown}),x=i??ep.region,b=s??ep.town,[{region:C,town:j},y]=(0,n.useState)({region:x,town:b}),[$,k]=(0,n.useState)(ep.startPopupVisible),[N,O]=(0,n.useState)(ep.popupVisible),S=(0,n.useRef)(""),T=(0,n.useRef)(!1),I=(0,n.useMemo)(()=>X(h),[h]);(0,n.useEffect)(()=>{w.current=h},[h]);let R=(0,n.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),_({startRegion:e,startTown:t})},[k,_]),P=(0,n.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||R(e,t)},[R]),E=(0,n.useCallback)(()=>{if(S.current&&!C&&!j){let e=I.find(e=>e.name===S.current)??null;return P(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}P(C,j)},[C,j,I,h,P]),A=(0,n.useCallback)(e=>{O(e)},[O]),B=(0,n.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(d.allRussiaSelected,"1"),window.localStorage.setItem(d.userRegion,""),window.localStorage.setItem(d.userTown,""),q(null,null,u);return}window.localStorage.setItem(d.allRussiaSelected,"0"),window.localStorage.setItem(d.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(d.userTown,JSON.stringify(t)||""),q(e||null,t||null,u)},[d,u]),L=(0,n.useCallback)(e=>{e?ea(c.D.icon,"location"):ea(c.D.button,(null==j?void 0:j.name)||"Вся Россия"),!l||window.sessionStorage.getItem("start_popup_opened")?A(!0):E()},[l,j,A,E]),z=(0,n.useCallback)((e,t)=>{B(e,t),y({region:e||null,town:t||null}),k(!1),A(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[A,B]),F=()=>{let e=Y(d.userRegion)??J(d.userRegion),t=Y(d.userTown)??J(d.userTown),n=en(w.current,e,t),i=u&&(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId);i&&(T.current=!0),i&&ei(n.region,n.town)&&(B(n.region,n.town),T.current=!1),y(n);let s=async({coords:{latitude:e,longitude:t}})=>{let n=`${r}?lat=${e}&lon=${t}`,i=await er(n);null!=i&&i.location&&(S.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&l)try{navigator.geolocation.getCurrentPosition(s,()=>null)}catch{}};return(0,n.useEffect)(()=>{(!((e,t=!1)=>!(e.length<1)&&(!t||K(e)))(h,u)||m)&&eo({showcaseUrl:a,useNewCitiesApi:u}).then(e=>{e.length<1||f(e)})},[]),(0,n.useEffect)(()=>{if(!u)return;let e=en(h,C,j);T.current&&ei(e.region,e.town)&&(B(e.region,e.town),T.current=!1),y(e)},[h,C,B,j,u]),(0,n.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{F(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{F()},0)},[]),(0,t.jsx)(em.Provider,{value:{regions:h,towns:I,region:C,town:j,startPopupVisible:$,setStartPopupVisible:k,popupVisible:N,handleToggleModal:A,selectCity:z,handleButtonClick:L,startRegion:g,startTown:v},children:e})},"H",0,e=>(0,t.jsx)(e_,{isMainBannerPage:e.isMainBannerPage,children:(0,t.jsx)(ti,{...e})}),"u",0,eh],81795)}]);