(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40383,e=>{"use strict";var t=e.i(71645);let n=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},i=(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")},l=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},o=()=>document.querySelectorAll("[data-portal]").length>1;e.s(["u",0,e=>{let a=(0,t.useRef)(null),s=(0,t.useRef)(!1);return(0,t.useEffect)(()=>{if(s.current===e)return;s.current=e;let t=a.current,r=document.body,c=document.documentElement,u=window.innerWidth-c.clientWidth;if(e&&u>0)r.style.top||(window.prevScrollPosition=window.scrollY),c.style.setProperty("overflow-y","scroll"),r.classList.toggle("scroll-disable-windows",!0),r.style.setProperty("width",`calc(100vw - ${u}px)`),r.style.setProperty("top",`-${window.prevScrollPosition}px`),n(t,!0);else if(e)r.style.setProperty("overflow","hidden"),r.style.setProperty("height","100vh"),n(t,!0);else{let e=!o();e&&i(r,c),e&&l(),n(t,!1)}return()=>{let e=!o();e&&i(r,c),e&&l()}},[e]),a}])},99974,20841,97713,e=>{"use strict";var t=e.i(71645);let n={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},i={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},l=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M19.03 10.28l-6.5 6.5a.75.75 0 01-1.06 0l-6.5-6.5a.75.75 0 111.06-1.06L12 15.19l5.97-5.97a.75.75 0 111.06 1.06z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function o({className:e,style:a,boxSize:s,size:r,onClick:c}){return t.default.createElement("span",{className:e,style:{...n,...c&&{cursor:"pointer"},...r&&{fontSize:`${r}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...a},...c?{role:"button",tabIndex:"0",onClick:c}:{}},t.default.createElement(l,{viewBox:"0 0 24 24",style:i}))}o.displayName="IconFdsChevronDownO",e.s(["m",0,o],99974);let a={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},s={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},r=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M6.999 7a5 5 0 1110 0 5 5 0 01-10 0zm5-3.5a3.5 3.5 0 100 7 3.5 3.5 0 000-7zM10.012 14h3.974c1.52 0 2.497 0 3.345.337a4.75 4.75 0 011.916 1.402c.579.705.875 1.636 1.335 3.085l.05.159.332 1.04a.75.75 0 11-1.43.455l-.33-1.04c-.53-1.664-.744-2.293-1.117-2.748a3.249 3.249 0 00-1.31-.959c-.547-.217-1.212-.23-2.958-.23h-3.64c-1.746 0-2.41.013-2.957.23a3.249 3.249 0 00-1.311.959c-.373.454-.587 1.084-1.116 2.748l-.331 1.04a.75.75 0 11-1.43-.455l.331-1.04.05-.159c.461-1.449.757-2.38 1.336-3.086a4.752 4.752 0 011.916-1.4C7.515 14 8.492 14 10.012 14z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function c({className:e,style:n,boxSize:i,size:l,onClick:o}){return t.default.createElement("span",{className:e,style:{...a,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...n},...o?{role:"button",tabIndex:"0",onClick:o}:{}},t.default.createElement(r,{viewBox:"0 0 24 24",style:s}))}c.displayName="IconFdsUserO",e.s(["e",0,c],20841);var u=e.i(24359),d=e.i(63687),p=e.i(34650);let f={userRegion:p.U,userTown:p.c,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},h={userRegion:p.U,userTown:p.c,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},g=(e=!1)=>e?h:f,m=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},w=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},v=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),x=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,b=(e,t)=>x(e||"https://finuslugi.ru",t),C=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},_=(e,t=!1)=>{if(e.length<1)return;let n=g(t);m(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},y=async e=>{let t=await C(b(e,"/money_data/Root.json?short=1")),n=Array.isArray(null==t?void 0:t.regions)?t.regions:[];return _(n),n},k=async e=>{let t,n,[i,l]=await Promise.all([C(x(e,"/sc/api/v1/cities?all=true&isActive=true")),C(x(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==i?void 0:i.content)||!Array.isArray(null==l?void 0:l.content))return[];let o=i.content,a=(n=(t=l.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),{}),o.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 v(a)?(_(a,!0),a):[]},I=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?k(e):y(e),S=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null};e.s(["a",0,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]),[])},"b",0,(e,t,n)=>{let i=null,l=null;n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,l=t,!0)});let o=t?e.find(e=>e.id===t.id)??null:null;return{region:i??o??t,town:l??n}},"c",0,(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),"d",0,b,"e",0,g,"f",0,e=>{if(typeof document>"u")return null;let t=u.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},"g",0,(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=w(g(e).allRegions)||[];return m(n,e),n},"h",0,(e,t,n)=>{(0,d.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})},"i",0,(e,t=!1)=>!(e.length<1)&&(!t||v(e)),"j",0,(e,t)=>(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId),"k",0,S,"l",0,I,"p",0,w,"s",0,(e,t,n=!1)=>{if(typeof document>"u")return;let i=g(n);if(!e&&!t){u.a.removeItem(i.userRegion),u.a.removeItem(i.userTown);return}u.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),u.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})}],97713)},3366,e=>{"use strict";var t=e.i(71645);let n={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},i={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},l=e=>t.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M11.28 17.03l4.5-4.5a.75.75 0 000-1.06l-4.5-4.5a.75.75 0 10-1.06 1.06L14.19 12l-3.97 3.97a.75.75 0 101.06 1.06z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function o({className:e,style:a,boxSize:s,size:r,onClick:c}){return t.default.createElement("span",{className:e,style:{...n,...c&&{cursor:"pointer"},...r&&{fontSize:`${r}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...a},...c?{role:"button",tabIndex:"0",onClick:c}:{}},t.default.createElement(l,{viewBox:"0 0 24 24",style:i}))}o.displayName="IconFdsChevronRightSmallO",e.s(["_",0,o])},89867,e=>{"use strict";var t=e.i(43476),n=e.i(71645),i=e.i(70703),l=e.i(86473),o=e.i(99974),a=e.i(30382),s=e.i(20841);e.i(34348);var r=e.i(47611),c=e.i(60822),u=e.i(7670),d=e.i(85900),p=e.i(63687),f=e.i(22468),h=e.i(97713),g=e.i(40383),m=e.i(44437),w=e.i(34650);e.i(46401);var v=e.i(34986),x=e.i(3366),b=e.i(71121),C=e.i(65019),_=e.i(93562),y=e.i(97052);let k={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},I={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},S=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("defs",null,n.createElement("clipPath",{id:"fds-chat-dots-square-add-o_svg__a"},n.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h24v24.001H0z"}))),n.createElement("g",{clipPath:"url(#fds-chat-dots-square-add-o_svg__a)"},n.createElement("path",{d:"M18.25 5.75V8c0 .42.33.75.75.75s.75-.33.75-.75V5.75H22c.42 0 .75-.33.75-.75s-.33-.75-.75-.75h-2.25V2c0-.42-.33-.75-.75-.75s-.75.33-.75.75v2.25H16c-.42 0-.75.33-.75.75s.33.75.75.75h2.25zm-4.546-2.23c-.259-.014-.827-.02-1.704-.02-.676 0-1.129.002-1.358.007a7.963 7.963 0 00-.779.047 7.246 7.246 0 00-2.328.689 7.204 7.204 0 00-4.028 6.4c-.005.228-.007.68-.007 1.357 0 .671.002 1.121.007 1.349.007.324.023.584.047.778.057.474.158.933.303 1.378v.001a7.17 7.17 0 001.76 2.867 7.169 7.169 0 002.92 1.777 7.436 7.436 0 002.108.341c.228.006.68.009 1.355.009.67 0 1.12-.003 1.346-.009a7.12 7.12 0 00.794-.057c.476-.05.96-.162 1.455-.333a.71.71 0 01.685.102c.662.48 1.32.829 1.976 1.047a4.85 4.85 0 001.482.264c.142.002.278-.004.41-.016a10.758 10.758 0 01-.222-.535c-.45-1.164-.676-2.305-.676-3.423a.74.74 0 01.116-.401 7.211 7.211 0 001.08-3.01c.024-.196.04-.456.047-.78.005-.228.007-.678.007-1.349 0-.214.002-.488.006-.822.003-.22.004-.376.004-.468 0-.42.33-.75.75-.75s.75.33.75.75c0 .098-.001.26-.004.486A70.38 70.38 0 0022 12c0 .682-.003 1.142-.008 1.381a9.337 9.337 0 01-.058.93 8.752 8.752 0 01-.393 1.737 8.757 8.757 0 01-.788 1.7c.026.866.217 1.757.571 2.674a8.847 8.847 0 00.6 1.249c.11.224.136.42.078.587-.057.168-.198.306-.423.416-.139.068-.32.13-.543.189a5 5 0 01-1.316.15 6.336 6.336 0 01-1.94-.34 8.598 8.598 0 01-2.064-1.035c-.471.14-.939.236-1.402.286a8.23 8.23 0 01-.93.067c-.24.006-.701.009-1.384.009-.688 0-1.152-.003-1.392-.009a8.222 8.222 0 01-.937-.067 8.672 8.672 0 01-3.989-1.538 8.707 8.707 0 01-2.077-2.078 8.705 8.705 0 01-1.597-4.927A78.972 78.972 0 012 12c0-.687.003-1.15.008-1.39.008-.376.027-.686.057-.93a8.737 8.737 0 01.832-2.806 8.69 8.69 0 013.977-3.977 8.7 8.7 0 012.803-.831c.246-.03.557-.05.933-.058C10.85 2.003 11.313 2 12 2c.902 0 1.495.007 1.779.021.42.021.732.367.712.787a.743.743 0 01-.787.711zm-5.91 9.19a1 1 0 111.412-1.414 1 1 0 01-1.413 1.415zm3.497-1.412a1 1 0 101.418 1.41 1 1 0 00-1.418-1.41zm3.502 1.413a1 1 0 111.414-1.415 1 1 0 01-1.414 1.415z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"})));function O({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...k,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(S,{viewBox:"0 0 24 24",style:I}))}O.displayName="IconFdsChatDotsSquareAddO";let j={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},N={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},R=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("defs",null,n.createElement("clipPath",{id:"fds-menu-skewed-o_svg__a"},n.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h24v24.001H0z"}))),n.createElement("g",{clipPath:"url(#fds-menu-skewed-o_svg__a)"},n.createElement("path",{d:"M7.75 5a.75.75 0 100 1.5h13.5a.75.75 0 100-1.5H7.75zM22 12a.75.75 0 00-.75-.75H2.75a.75.75 0 100 1.5h18.5A.75.75 0 0022 12zm-5.75 5.5a.75.75 0 110 1.5H2.75a.75.75 0 110-1.5h13.5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"})));function $({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...j,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(R,{viewBox:"0 0 24 24",style:N}))}$.displayName="IconFdsMenuSkewedO";let A=e=>{let[t,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{e&&i(!0)},[e]),e||t},T=()=>{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}},E=(0,f.g)("certificates-warning-banner","sc"),B=(0,f.g)("certificates-warning-popup","sc"),P=Object.freeze({wrapper:`${E}`,container:`${E}__container`,content:`${E}__content`,info:`${E}__info`,image:`${E}__image`,text:`${E}__text`,title:`${E}__title`,description:`${E}__description`,details:`${E}__details`,buttons:`${E}__buttons`,button:`${E}__button`,closeButton:`${E}__close-button`,mobileActivator:`${E}__mobile-activator`}),z=Object.freeze({modal:`${B}__modal`,desktopCloseButton:`${B}__desktop-close-button`,mobilePopup:`${B}__mobile-popup`,mobileContentContainer:`${B}__mobile-content-container`,mobileCloseButton:`${B}__mobile-close-button`,mobileDialog:`${B}__mobile-dialog`,content:`${B}__content`,image:`${B}__image`,text:`${B}__text`,title:`${B}__title`,description:`${B}__description`,actions:`${B}__actions`,primaryActions:`${B}__primary-actions`,divider:`${B}__divider`,explanation:`${B}__explanation`,button:`${B}__button`,gosuslugiButton:`${B}__gosuslugi-button`,gosuslugiIcon:`${B}__gosuslugi-icon`}),M="fu_certificates_access_confirmed",F="fu_certificates_banner_dismissed",L="fu_external_link_warning_shown",U=new Map,W=e=>{if(typeof window>"u")return"1"===U.get(e);try{return"1"===window.localStorage.getItem(e)||"1"===U.get(e)}catch{return"1"===U.get(e)}},H=e=>{if(U.set(e,"1"),!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},D=(e,t)=>{if(!e)return null;try{let n,i,l=new URL(e.toString(),t.href);return"http:"!==l.protocol&&"https:"!==l.protocol||(n=l.hostname,i=t.hostname,n===i||"finuslugi.ru"===n||n.endsWith(".finuslugi.ru"))?null:l}catch{return null}},V={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},G={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},J=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M3 9.998a9 9 0 0118 0c0 2.08-.89 4.273-2.029 6.249-1.148 1.991-2.6 3.844-3.826 5.262a4.123 4.123 0 01-6.29 0c-1.227-1.418-2.678-3.271-3.826-5.262C3.889 14.27 3 12.077 3 9.998zm9-7.5a7.5 7.5 0 00-7.5 7.5c0 1.688.737 3.607 1.828 5.5 1.083 1.877 2.468 3.65 3.661 5.029 1.084 1.251 2.938 1.251 4.022 0 1.193-1.379 2.578-3.152 3.66-5.03 1.092-1.893 1.829-3.81 1.829-5.499a7.5 7.5 0 00-7.5-7.5zm-4 7.5a4 4 0 118 0 4 4 0 01-8 0zm4-2.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function q({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...V,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(J,{viewBox:"0 0 24 24",style:G}))}q.displayName="IconFdsLocationO";let Y=(0,h.g)(),K=(0,h.a)(Y),Q={regions:Y,towns:K,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},X=(0,n.createContext)(Q);function Z(){return(0,n.useContext)(X)}let ee={"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"},et=(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 en(){return(0,n.useContext)(et)}let ei=e=>{let[i,l]=(0,n.useState)(!1),[o,a]=(0,n.useState)(!1),[s,r]=(0,n.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d}=(()=>{let[e,t]=(0,n.useState)(!1),[i,l]=(0,n.useState)(!1),o=(0,n.useRef)(!1),a=e=>{o.current=e,l(e)};return(0,n.useEffect)(()=>{if(typeof window>"u")return;let e=(()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(ee,e)?ee[e]:ee["finuslugi.ru"]})(),n="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:t=>{if(t.host&&(e=t.host),t.channel&&(n=t.channel),t.user){let e="function"==typeof t.user?t.user:()=>({...t.user});window.__WebchatUserCallback=e}},open:()=>new Promise(e=>{e()}),close:()=>null,toggle:()=>null}};let i=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((l,s)=>{var r,c;let u,d;o.current?s(Error("chat is already opened")):i?(i.openWidget(),t(!1),l()):(a(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let o=document.querySelector(".webchat");o&&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(o,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),a(!1),t(!1),l()},r=e,c=n,(u=document.createElement("link")).rel="stylesheet",u.type="text/css",u.href=`${r}/assets/css/${c}`,document.head.appendChild(u),(d=document.createElement("script")).src=`${r}/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,f]=(0,n.useState)(null),[h,w]=(0,n.useState)(null),[v,x]=(0,n.useState)(!1),[b,C]=(0,n.useState)(!1),[_,y]=(0,n.useState)(!1),k=(0,n.useRef)(null),I=(0,g.u)(v),S=(0,n.useRef)(null),O=(0,n.useRef)(null),j=(0,n.useRef)(null),N=(0,n.useRef)(null),R=(0,n.useCallback)(()=>{I.current&&I.current.scrollTo({top:0})},[I]),$=(0,n.useCallback)(e=>{w(e),R()},[R]),A=(0,n.useCallback)(e=>{S.current&&clearTimeout(S.current),e&&C(!0),e||(S.current=setTimeout(()=>{C(!1),$(null)},300))},[$]),T=(0,n.useCallback)((e,t,n)=>{if(t&&$(t),!n&&e===p||!e){A(!v),x(!v);return}f(e),A(!0),x(!0)},[p,$,v,A]),E=(0,n.useCallback)(()=>{O.current&&clearTimeout(O.current),y(!0),O.current=setTimeout(()=>{y(!1)},650)},[]);return(0,n.useEffect)(()=>{l(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,m.s)(a,r,e.isMainBannerPage);return(0,m.i)(),t},[]),(0,t.jsx)("header",{children:(0,t.jsx)(et.Provider,{value:{isAuth:i,isHeaderHidden:o,isHeaderTransparent:s,openedBlock:p,setOpenedBlock:T,openedSection:h,setOpenedSection:$,isNavigationOpen:v,isNavigationMounted:b,navMenuItemsRef:k,navigationRef:I,ignoreClicks:_,setIgnoreClicks:E,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d,fixedContainerRef:j,headerRef:N},children:e.children})})},el=(0,f.g)("city-select","sc"),eo=Object.freeze({button:`${el}__button`,minimal:`${el}__minimal`,full:`${el}__full`}),ea=(0,i.default)(()=>e.A(12027).then(e=>e.CitySelectModal),{ssr:!1}),es=(0,i.default)(()=>e.A(71444).then(e=>e.StartChoicePopup),{ssr:!1}),er=({initialTown:e})=>{var i;let l=Z(),o=(null==(i=l.town)?void 0:i.name)||e||"Вся Россия",{setIsChatModalOpen:a,isChatModalOpen:s}=en(),{startPopupVisible:c,setStartPopupVisible:d,popupVisible:p}=l,f=A(p),h=A(c),g=(0,n.useRef)();(0,n.useEffect)(()=>{p&&(g.current="popup")},[p]),(0,n.useEffect)(()=>{s&&(g.current="chat")},[s]),(0,n.useEffect)(()=>{c&&(g.current="startPopup")},[c]),(0,n.useEffect)(()=>{g.current&&("chat"===g.current&&c?d(!1):["startPopup","popup"].includes(g.current)&&s&&a(!1))},[p,s,c,d,a]);let m={appearance:"ghost",size:"xs",onClick:()=>l.handleButtonClick(!1),iconLeft:(0,t.jsx)(q,{size:24})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{...m,className:(0,u.default)(eo.button,eo.full),label:o}),(0,t.jsx)(r.Button,{...m,className:(0,u.default)(eo.button,eo.minimal),shape:"icon"}),f&&(0,t.jsx)(ea,{}),h&&(0,t.jsx)(es,{})]})},ec=({label:e,onClick:n,eventActionText:i,eventLabel:l,...o})=>(0,t.jsx)(r.Button,{label:e,onClick:e=>{null==n||n(e),(0,p.h)({eventCategory:w.H,eventActionType:p.D.button,eventActionText:i||"",eventLabel:l||""})},...o}),eu=({onClick:e,eventActionType:n,eventActionText:i,eventLabel:l,...o})=>(0,t.jsx)(v.Link,{onClick:t=>{null==e||e(t),(0,p.h)({eventCategory:w.H,eventActionType:n||p.D.link,eventActionText:i||"",eventLabel:l||""})},...o}),ed={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},ep={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},ef=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M7.22 12.53a.75.75 0 010-1.06l6.5-6.5a.75.75 0 111.06 1.06L8.81 12l5.97 5.97a.75.75 0 11-1.06 1.06l-6.5-6.5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function eh({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...ed,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...i&&{width:`${i}px`,height:`${i}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(ef,{viewBox:"0 0 24 24",style:ep}))}eh.displayName="IconFdsChevronLeftO";let eg=(0,f.g)("header-chat-modal-body","sc"),em=Object.freeze({wrapper:`${eg}__wrapper`,cardButton:`${eg}__card-button`,card:`${eg}__card`,cardTitle:`${eg}__card-title`,cardSubtitle:`${eg}__card-subtitle`,button:`${eg}__button`}),ew=()=>{let e=en();return(0,t.jsxs)("div",{className:em.wrapper,children:[(0,t.jsx)(ec,{className:em.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)(C.Card,{className:em.card,variant:"secondary",children:[(0,t.jsxs)("div",{className:em.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:em.cardSubtitle,children:["Виртуальный ассистент доступен 24/7, ",(0,t.jsx)("br",{}),"операторы — с 6:00 до 23:59 мск"]})]})}),!1]})},ev=({data:e,isMobile:i})=>{let l=en();return(0,t.jsx)("div",{className:y.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,u.default)(y.s.content,{[y.s.hidden]:l.openedSection!==e.id,[y.s.contentOpen]:!!l.openedSection}),children:[(0,t.jsx)("div",{className:y.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,u.default)(y.s.contentTitle,{[y.s.removed]:!n.title,[y.s.contentTitleUrl]:!!n.url,[y.s.contentTitleLink]:!!e.isSeeAllLinkAvailable,[y.s.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,t.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,t.jsx)("div",{className:y.s.arrowIcon,children:(0,t.jsx)(_.K,{})}),n.title]})})}),!(null!=(o=n.links)&&o.length)&&(0,t.jsx)(y.N,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:i?3:2}),!!(null!=(a=n.links)&&a.length)&&(0,t.jsx)("div",{className:(0,u.default)(y.s.links,{[y.s.linksColumns]:!!n.columns,[y.s.linksTitleless]:!n.title}),children:n.links.map(e=>(0,t.jsxs)("a",{href:e.url,onClick:()=>(0,m.h)(p.D.link,e.title,`${e.title}_${e.url}`),children:[(0,t.jsx)("div",{className:y.s.arrowIcon,children:(0,t.jsx)(_.K,{})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{children:e.title}),!!e.new&&(0,t.jsx)("span",{className:(0,u.default)({[y.s.newInline]:!!e.new})})]})]},e.url))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},ex=(0,f.g)("navigation-section-icon","sc"),eb=Object.freeze({icon:`${ex}`}),eC={IconFdsAcademicCapO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsAcademicCapO),IconFdsBankO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsBankO),IconFdsBookOpenO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsBookOpenO),IconFdsCalculatorO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCalculatorO),IconFdsCardO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCardO),IconFdsChatDotsCircleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsChatDotsCircleO),IconFdsCoinMultipleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsCoinMultipleO),IconFdsDotsHorizontalO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsDotsHorizontalO),IconFdsFlashO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsFlashO),IconFdsGraphO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsGraphO),IconFdsLayoutHorizontalO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsLayoutHorizontalO),IconFdsPortfolioO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsPortfolioO),IconFdsRubleCircleO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsRubleCircleO),IconFdsSafeO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsSafeO),IconFdsShieldCheckO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsShieldCheckO),IconFdsWalletO:()=>e.A(50433).then(({navigationSectionIcons:e})=>e.IconFdsWalletO)},e_=e=>Object.prototype.hasOwnProperty.call(eC,e),ey=({name:e,background:i})=>{let[l,o]=(0,n.useState)(null);if((0,n.useEffect)(()=>{if(!e||!e_(e))return void o(null);let t=!0;return eC[e]().then(n=>{t&&o({name:e,component:n})}).catch(()=>{t&&o(null)}),()=>{t=!1}},[e]),!e||!e_(e))return null;let a=(null==l?void 0:l.name)===e?l.component:null;return(0,t.jsx)("div",{className:eb.icon,style:{background:i},children:a&&(0,t.jsx)(a,{})})},ek=(0,f.g)("navigation","sc"),eI=Object.freeze({navigation:`${ek}`,navigationOpening:`${ek}--opening`,navigationClosing:`${ek}--closing`,wrapper:`${ek}__wrapper`,container:`${ek}__container`,containerOpen:`${ek}__container--open`,sections:`${ek}__sections`,sectionsOpen:`${ek}__sections--open`,citySelectButton:`${ek}__city-select-button`,sectionsTitle:`${ek}__sections-title`,sectionsWrapper:`${ek}__sections-wrapper`,section:`${ek}__section`,sectionArrow:`${ek}__section-arrow`,sectionExtra:`${ek}__section--extra`,sectionActive:`${ek}__section--active`,sectionTitle:`${ek}__section-title`,chatWrapper:`${ek}__chat-wrapper`,chatHeader:`${ek}__chat-header`,backButton:`${ek}__back-button`,useful:`${ek}__useful`,usefulOpen:`${ek}__useful--open`,usefulTitle:`${ek}__useful-title`,usefulGrid:`${ek}__useful-grid`,removed:`${ek}__removed`}),eS=({data:e})=>{var i;let l=en(),o=Z(),a=(0,b.useBreakpointDown)("m"),[s,d]=(0,n.useState)(!0);(0,n.useEffect)(()=>{d(a)},[a]);let f=(0,n.useRef)(null),h=(0,n.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>l.openedSection?l.setOpenedSection(null):l.isNavigationOpen?l.setOpenedBlock(null):void 0,50)},[l]),g=(0,n.useRef)(!1),v=(0,n.useRef)(null),C=(0,n.useCallback)(()=>{s&&(g.current=!0,v.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),h()},window.history.pushState(null,"",window.location.href))},[h,s]),_=(0,n.useCallback)(()=>{g.current=!1,window.onpopstate=v.current,window.history.go(-1)},[]),y=(0,n.useRef)(null),k=(0,n.useCallback)(e=>{if(s||!l.navMenuItemsRef.current||!l.navigationRef.current)return;let t=e.target,n=!l.navMenuItemsRef.current.contains(t)&&!l.navigationRef.current.contains(t);if(n&&!y.current){l.setIgnoreClicks(),y.current=setTimeout(()=>l.setOpenedBlock(null),300);return}!n&&y.current&&(clearTimeout(y.current),y.current=null)},[s,l]),I=(0,n.useRef)(null),S=(0,n.useCallback)(e=>{typeof window>"u"||(e?(I.current=k,window.addEventListener("mousemove",I.current)):I.current&&window.removeEventListener("mousemove",I.current))},[k]);(0,n.useEffect)(()=>{S(l.isNavigationOpen),l.isNavigationOpen&&!g.current&&C(),!l.isNavigationOpen&&g.current&&_()},[l.isNavigationOpen]);let O=(e,t)=>()=>{(0,m.h)(p.D.button,t),l.setOpenedSection(e)},{start:j,clear:N}=T(),R=()=>{s||N()};return(0,t.jsx)("div",{ref:l.navigationRef,className:(0,u.default)(eI.navigation,{[eI.removed]:!l.isNavigationMounted,[eI.navigationOpening]:l.isNavigationOpen,[eI.navigationClosing]:!l.isNavigationOpen}),children:(0,t.jsx)("div",{className:eI.wrapper,children:(0,t.jsxs)(c.Container,{className:(0,u.default)(eI.container,{[eI.containerOpen]:!!l.openedSection}),children:[(0,t.jsxs)("div",{className:(0,u.default)(eI.sections,{[eI.sectionsOpen]:!!l.openedSection}),children:[(0,t.jsx)(r.Button,{className:eI.citySelectButton,variant:"violet",appearance:"ghost",size:"xs",onClick:()=>o.handleButtonClick(!1),iconLeft:(0,t.jsx)(q,{size:24}),label:(null==(i=o.town)?void 0:i.name)||"Вся Россия"}),e.map(e=>(0,t.jsxs)("ul",{className:(0,u.default)(eI.sectionsWrapper,{[eI.removed]:l.openedBlock!==e.id&&!s}),children:[(0,t.jsx)("div",{className:eI.sectionsTitle,children:w.a[e.id]}),e.sections.map(e=>{let n,i;return(0,t.jsxs)("li",{className:(0,u.default)(eI.section,{[eI.sectionExtra]:!!e.extra,[eI.sectionActive]:l.openedSection===e.id}),onClick:O(e.id,e.title),onMouseEnter:(n=e.id,i=e.title,()=>{s||j(O(n,i),150)}),onMouseLeave:R,children:[l.isNavigationMounted&&(0,t.jsx)(ey,{name:e.uikitIcon,background:e.uikitIconBg}),(0,t.jsx)("span",{className:eI.sectionTitle,children:e.title}),(0,t.jsx)("div",{className:eI.sectionArrow,children:(0,t.jsx)(x._,{size:24})})]},e.id)})]},e.id)),(0,t.jsxs)("div",{className:eI.chatWrapper,children:[(0,t.jsx)("div",{className:eI.chatHeader,children:"Нужна помощь?"}),(0,t.jsx)(ew,{})]})]}),(0,t.jsxs)("button",{type:"button",className:(0,u.default)(eI.backButton,{[eI.removed]:!l.openedSection}),onClick:()=>{(0,m.h)(p.D.button,"Назад"),l.setOpenedSection(null)},children:[(0,t.jsx)(eh,{size:24}),(0,t.jsx)("span",{children:"Назад"})]}),(0,t.jsx)(ev,{data:e,isMobile:s}),(0,t.jsxs)("div",{className:(0,u.default)(eI.useful,{[eI.usefulOpen]:!!l.openedSection}),children:[(0,t.jsx)("div",{className:eI.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,t.jsx)(n.Fragment,{children:e.sections.map(e=>{var n;return(0,t.jsx)("div",{className:(0,u.default)(eI.usefulGrid,{[eI.removed]:l.openedSection!==e.id}),children:null==(n=e.useful)?void 0:n.map((e,n)=>(0,t.jsxs)("a",{href:e.url,onClick:()=>(0,m.h)(p.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))]})]})})})},eO=(0,i.default)(()=>e.A(9466).then(e=>e.CertificatesWarningBanner),{ssr:!1}),ej=(0,i.default)(()=>e.A(14496).then(e=>e.CertificatesWarningPopup),{ssr:!1}),eN=(0,i.default)(()=>e.A(64532).then(e=>e.HeaderMobileAppBanner),{ssr:!1}),eR=({data:e,showcaseUrl:i="https://finuslugi.ru",minioUrl:f="https://assets.finuslugi.ru/mp-assets",lkUrl:h="https://lk.finuslugi.ru/registration",initialTown:g,isMainBannerPage:v,enableAppHeaderBanner:x=!1,enableCertificatesBanner:b=!1,enableExternalLinkWarning:C=!1,certificatesWarningProduct:_,news:y,className:k})=>{let I=en(),S=(0,n.useMemo)(()=>((e,t,n)=>{var i,l,o,a,s,r,c;let u=(null==(l=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:l.call(i,({id:e})=>"news"===e))||-1,p=(null==(a=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[u])?void 0:a.content)||[];if(null!=(c=null==(r=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[u])?void 0:r.content)&&c[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,d.joinURL)(t||"",n),new:0}));e.NAVIGATOR[u].content[0].links=i}return[{id:"FINPRODUCTS",sections:Array.isArray(null==e?void 0:e.FINPRODUCTS)?null==e?void 0:e.FINPRODUCTS:[]},{id:"NAVIGATOR",sections:Array.isArray(null==e?void 0:e.NAVIGATOR)?null==e?void 0:e.NAVIGATOR:[]},{id:"ABOUT",sections:Array.isArray(null==e?void 0:e.ABOUT)?null==e?void 0:e.ABOUT:[]}]})(e,i,y),[e,i,y]),j=null==e?void 0:e.config,N=!!e&&b&&!!v,R=(({enableCertificatesBanner:e,enableExternalLinkWarning:t,isMainBannerPage:i})=>{let[l,o]=(0,n.useState)("checking"),[a,s]=(0,n.useState)(!1),[r,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),h=(0,n.useRef)(),g=(0,n.useRef)(!1),m=(0,n.useRef)(!1),w=(0,n.useRef)(!1);(0,n.useRef)(null);let v=(0,n.useRef)(null),x=(0,n.useRef)(null),b=(0,n.useRef)(null),C=e&&i,_=C||t,y=(0,n.useCallback)(e=>{let t=h.current;t?t.call(window,e,"_blank","noopener,noreferrer"):window.open(e,"_blank","noopener,noreferrer")},[]),k=(0,n.useCallback)(()=>{s(!1),w.current=!1,v.current=null,x.current=null,b.current=null,f(!1)},[]),I=(0,n.useCallback)(e=>{H(L),m.current=!0,w.current=!1,v.current=e,f("external"===e&&null!==x.current),s(!0)},[]),S=(0,n.useCallback)(()=>!g.current&&("external"===v.current&&!w.current||!m.current),[]),O=(0,n.useCallback)(()=>{"external"!==v.current&&I("external")},[I]);(0,n.useEffect)(()=>{h.current=window.open;let e=window.navigator.userAgent.includes("YaBrowser/");return e&&H(M),g.current=e||W(M),m.current=W(L),d(g.current),c(!0),()=>{x.current=null,b.current=null}},[]),(0,n.useEffect)(()=>{if(r){if(!C)return void o("skipped");o(e=>"shown"===e||"closing"===e||"dismissed"===e?e:u||W(F)?"skipped":"shown")}},[u,C,r]),(0,n.useEffect)(()=>{},[k,_,r]),(0,n.useEffect)(()=>{if(!r||!t)return;let e=h.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]");if(!t||e.defaultPrevented)return;let i=D(t.href,window.location);if(!i||!S())return;e.preventDefault(),null===x.current&&(x.current=i.href,b.current={source:"external_anchor",host:i.hostname});let l=x.current;queueMicrotask(()=>{n&&S()&&x.current===l&&O()})},l=(t,n="_blank",i)=>{let l=D(t,window.location);return l&&S()?(null===x.current&&(x.current=l.href,b.current={source:"external_window_open",host:l.hostname}),O(),null):e.call(window,t,n,i)};return window.open=l,document.addEventListener("click",i,!0),document.addEventListener("auxclick",i,!0),()=>{n=!1,document.removeEventListener("click",i,!0),document.removeEventListener("auxclick",i,!0),window.open===l&&(window.open=e)}},[t,r,S,O]),(0,n.useEffect)(()=>{var e;t||(x.current=null,(null==(e=b.current)?void 0:e.source)!=="banner"&&(b.current=null),f(!1),"external"===v.current&&k())},[k,t]),(0,n.useEffect)(()=>{C||"banner"===v.current&&k()},[k,C]),(0,n.useEffect)(()=>{_||k()},[k,_]);let j=(0,n.useCallback)(()=>{H(F),o("closing")},[]),N=(0,n.useCallback)(()=>{o("dismissed")},[]),R=(0,n.useCallback)(()=>{x.current=null,b.current={source:"banner"},I("banner")},[I]),$=(0,n.useCallback)(()=>{y("https://www.gosuslugi.ru/crt")},[y]),A=(0,n.useCallback)(()=>{y("https://browser.yandex.ru/")},[y]),T=(0,n.useCallback)(()=>{let e=x.current;e&&(H(L),m.current=!0,w.current=!0,y(e))},[y]);return{bannerStatus:l,isPopupOpen:a,popupAnalyticsContext:b.current,dismissBanner:j,finishBannerClosing:N,openPopupFromBanner:R,closePopup:k,openCertificatesPage:$,openYandexBrowserPage:A,continueToExternalPage:p?T:void 0}})({enableCertificatesBanner:N,enableExternalLinkWarning:C,isMainBannerPage:!!v}),E="shown"===R.bannerStatus||"closing"===R.bannerStatus,B=!N||"skipped"===R.bannerStatus,P=A(R.isPopupOpen),z=(0,n.useMemo)(()=>S.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[S]),U=I.isAuth?"Личный кабинет":"Войти",V=v&&I.isHeaderTransparent,G=(e,t,n,i)=>()=>{e!==I.openedBlock?(0,m.h)(p.D.toggle,t,"on"):(0,m.h)(p.D.button,"menu_close","on");let l=n?z[e]:"";I.setOpenedBlock(e,l,!!i)},{start:J,clear:q}=T(),Y=e=>()=>{I.ignoreClicks||e()},K=P?(0,t.jsx)(ej,{isOpen:R.isPopupOpen,analyticsContext:R.popupAnalyticsContext,certificatesWarningProduct:_,onClose:R.closePopup,onOpenCertificatesPage:R.openCertificatesPage,onOpenYandexBrowserPage:R.openYandexBrowserPage,onContinue:R.continueToExternalPage}):null;return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:I.headerRef,className:(0,u.default)(w.s.header,k,{[w.s.transparent]:V}),children:(0,t.jsxs)("div",{ref:I.fixedContainerRef,className:(0,u.default)(w.s.fixed,{[w.s.hidden]:I.isHeaderHidden,[w.s.navigationOpen]:I.isNavigationOpen}),children:[E&&(0,t.jsx)(eO,{onDismiss:R.dismissBanner,onClosed:R.finishBannerClosing,onOpenDetails:R.openPopupFromBanner,onOpenCertificatesPage:R.openCertificatesPage,onOpenYandexBrowserPage:R.openYandexBrowserPage}),B&&!!(null!=j&&j.appBannerUrl)&&x&&(0,t.jsx)(eN,{mobileAppUrl:j.appBannerUrl,minioUrl:f}),(0,t.jsxs)(c.Container,{className:w.s.container,children:[(0,t.jsxs)("div",{className:w.s.leftRow,children:[(0,t.jsx)(eu,{className:w.s.logo,href:i,eventActionType:p.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${i}`,children:(0,t.jsxs)("picture",{children:[(0,t.jsx)("source",{srcSet:(0,d.joinURL)(f,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,t.jsx)("img",{src:(0,d.joinURL)(f,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,t.jsx)("nav",{ref:I.navMenuItemsRef,className:w.s.menuItems,children:(0,t.jsx)("ul",{children:w.b.map(({id:e,label:n})=>(0,t.jsx)("li",{children:(0,t.jsx)(r.Button,{className:(0,u.default)({[w.s.menuItemActive]:I.openedBlock===e&&I.isNavigationOpen}),label:n,variant:"white",size:"xs",onClick:Y(G(e,n,!0)),onMouseEnter:()=>{I.isNavigationOpen&&e===I.openedBlock||I.setIgnoreClicks(),J(G(e,n,!0,!0),200)},onMouseLeave:q})},e))})}),(0,t.jsx)(ec,{className:(0,u.default)(w.s.tabletMenuButton,{[w.s.menuItemActive]:I.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,t.jsx)(o.m,{size:24}),onClick:G("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,t.jsxs)("div",{className:(0,u.default)(w.s.buttonGroup,{[w.s.whiteIcons]:(null==j?void 0:j.iconColorOnMobileMainBanner)==="white"}),children:[(0,t.jsxs)("div",{className:w.s.chips,children:[(0,t.jsx)(ec,{as:"a",href:h,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${h}`,iconLeft:(0,t.jsx)(s.e,{size:20})}),(0,t.jsx)(ec,{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)(l.G,{size:24})})]}),(0,t.jsx)(ec,{className:w.s.menuButton,size:"xs",shape:V?"icon":"default",appearance:V?"ghost":"fill",label:"Меню",onClick:G("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,t.jsx)($,{size:24})}),(0,t.jsxs)("div",{className:w.s.moreButtons,children:[(0,t.jsx)(er,{initialTown:g}),(0,t.jsx)(ec,{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)(O,{size:24}),children:"Онлайн чат"}),(0,t.jsx)(ec,{as:"a",href:h,size:"xs",eventActionText:U,eventLabel:`${U}_${h}`,label:U})]})]}),(0,t.jsxs)(eu,{className:w.s.auth,href:h,eventActionText:U,eventLabel:`${U}_${h}`,children:[(0,t.jsx)(ec,{size:"xs",shape:"circle-icon",iconLeft:(0,t.jsx)(s.e,{}),eventActionText:U,eventLabel:`${U}_${h}`}),(0,t.jsx)("p",{children:U})]}),(0,t.jsx)("div",{className:w.s.close,children:(0,t.jsx)(ec,{className:w.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,t.jsx)(a.a,{}),onClick:()=>I.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,t.jsx)("div",{className:(0,u.default)(w.s.overlay,{[w.s.removed]:!I.isNavigationMounted,[w.s.overlayOpening]:I.isNavigationOpen,[w.s.overlayClosing]:!I.isNavigationOpen}),onClick:Y(()=>I.setOpenedBlock(null))}),(0,t.jsx)(eS,{data:S,minioUrl:f}),K]}):C?K:null};e.s(["CitySelectProvider",0,({children:e,initialRegion:i,initialTown:l,showStartGeoPopup:o=!0,lastRegionsUpdateUnixTimestamp:a,showcaseUrl:s="",dadataUrl:r=(0,h.d)(s,"/backend/money/dadata"),useNewCitiesApi:c=!1})=>{let u=(0,h.e)(c),d=Number((0,h.p)(u.lastRegionsUpdateUnixTimestamp)||0),f=Number(a||0)>d,[g,m]=(0,n.useState)((0,h.g)(c)),w=(0,n.useRef)(g),[{startRegion:v,startTown:x},b]=(0,n.useState)({startRegion:Q.startRegion,startTown:Q.startTown}),C=i??Q.region,_=l??Q.town,[{region:y,town:k},I]=(0,n.useState)({region:C,town:_}),[S,O]=(0,n.useState)(Q.startPopupVisible),[j,N]=(0,n.useState)(Q.popupVisible),R=(0,n.useRef)(""),$=(0,n.useRef)(!1),A=(0,n.useMemo)(()=>(0,h.a)(g),[g]);(0,n.useEffect)(()=>{w.current=g},[g]);let T=(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)||""),O(!0),b({startRegion:e,startTown:t})},[O,b]),E=(0,n.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||T(e,t)},[T]),B=(0,n.useCallback)(()=>{if(R.current&&!y&&!k){let e=A.find(e=>e.name===R.current)??null;return E(g.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}E(y,k)},[y,k,A,g,E]),P=(0,n.useCallback)(e=>{N(e)},[N]),z=(0,n.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(u.allRussiaSelected,"1"),window.localStorage.setItem(u.userRegion,""),window.localStorage.setItem(u.userTown,""),(0,h.s)(null,null,c);return}window.localStorage.setItem(u.allRussiaSelected,"0"),window.localStorage.setItem(u.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(u.userTown,JSON.stringify(t)||""),(0,h.s)(e||null,t||null,c)},[u,c]),M=(0,n.useCallback)(e=>{e?(0,h.h)(p.D.icon,"location"):(0,h.h)(p.D.button,(null==k?void 0:k.name)||"Вся Россия"),!o||window.sessionStorage.getItem("start_popup_opened")?P(!0):B()},[o,k,P,B]),F=(0,n.useCallback)((e,t)=>{z(e,t),I({region:e||null,town:t||null}),O(!1),P(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[P,z]),L=()=>{let e=(0,h.f)(u.userRegion)??(0,h.p)(u.userRegion),t=(0,h.f)(u.userTown)??(0,h.p)(u.userTown),n=(0,h.b)(w.current,e,t),i=c&&(0,h.j)(e,t);i&&($.current=!0),i&&(0,h.c)(n.region,n.town)&&(z(n.region,n.town),$.current=!1),I(n);let l=async({coords:{latitude:e,longitude:t}})=>{let n=`${r}?lat=${e}&lon=${t}`,i=await (0,h.k)(n);null!=i&&i.location&&(R.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&o)try{navigator.geolocation.getCurrentPosition(l,()=>null)}catch{}};return(0,n.useEffect)(()=>{(!(0,h.i)(g,c)||f)&&(0,h.l)({showcaseUrl:s,useNewCitiesApi:c}).then(e=>{e.length<1||m(e)})},[]),(0,n.useEffect)(()=>{if(!c)return;let e=(0,h.b)(g,y,k);$.current&&(0,h.c)(e.region,e.town)&&(z(e.region,e.town),$.current=!1),I(e)},[g,y,z,k,c]),(0,n.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{L(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{L()},0)},[]),(0,t.jsx)(X.Provider,{value:{regions:g,towns:A,region:y,town:k,startPopupVisible:S,setStartPopupVisible:O,popupVisible:j,handleToggleModal:P,selectCity:F,handleButtonClick:M,startRegion:v,startTown:x},children:e})},"H",0,ec,"Header",0,e=>(0,t.jsx)(ei,{isMainBannerPage:e.isMainBannerPage,children:(0,t.jsx)(eR,{...e})}),"b",0,P,"p",0,z,"u",0,en,"useCitySelectContext",0,Z])}]);