(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let i=e.r(32061);function l({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new i.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,n)=>{"use strict";function i(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return i}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return s}});let i=e.r(43476),l=e.r(74080),o=e.r(63599),a=e.r(9885),r=e.r(43369);function s({moduleIds:e}){if("u">typeof window)return null;let t=o.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let i=t.reactLoadableManifest;for(let t of e){if(!i[t])continue;let e=i[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,r.getAssetTokenQuery)();return(0,i.jsx)(i.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,i.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,l.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let i=e.r(43476),l=e.r(71645),o=e.r(67585),a=e.r(52157);function r(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(r(()=>null)),loading:null,ssr:!0},c=function(e){let t={...s,...e},n=(0,l.lazy)(()=>t.loader().then(r)),c=t.loading;function u(e){let r=c?(0,i.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,u=s?l.Suspense:l.Fragment,d=t.ssr?(0,i.jsxs)(i.Fragment,{children:["u"<typeof window?(0,i.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,i.jsx)(n,{...e})]}):(0,i.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(n,{...e})});return(0,i.jsx)(u,{...s?{fallback:r}:{},children:d})}return u.displayName="LoadableComponent",u}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return l}});let i=e.r(55682)._(e.r(69093));function l(e,t){let n={};"function"==typeof e&&(n.loader=e);let l={...n,...t};return(0,i.default)({...l,modules:l.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},85900,e=>{"use strict";let t=/^\.?\//;Symbol.for("ufo:protocolRelative"),e.s(["joinURL",0,function(e,...n){let i=e||"";for(let e of n.filter(e=>e&&"/"!==e))if(i){let n=e.replace(t,"");i=function(e=""){return e.endsWith("/")?e:e+"/"}(i)+n}else i=e;return i}])},65019,e=>{"use strict";var t=e.i(43476),n=e.i(7670);let i=(0,e.i(54061).g)("card"),l={card:i,variants:{primary:`${i}--primary`,secondary:`${i}--secondary`}},o=({as:e,className:i,style:o,children:a,variant:r="primary",dataQa:s,dataId:c,...u})=>(0,t.jsx)(e||"div",{className:(0,n.default)(i,l.card,l.variants[r]),style:o,...u,"data-id":c,"data-qa":s,children:a});o.displayName="Card",e.s(["Card",0,o])},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),r=(0,t.useRef)(!1);return(0,t.useEffect)(()=>{if(r.current===e)return;r.current=e;let t=a.current,s=document.body,c=document.documentElement,u=window.innerWidth-c.clientWidth;if(e&&u>0)s.style.top||(window.prevScrollPosition=window.scrollY),c.style.setProperty("overflow-y","scroll"),s.classList.toggle("scroll-disable-windows",!0),s.style.setProperty("width",`calc(100vw - ${u}px)`),s.style.setProperty("top",`-${window.prevScrollPosition}px`),n(t,!0);else if(e)s.style.setProperty("overflow","hidden"),s.style.setProperty("height","100vh"),n(t,!0);else{let e=!o();e&&i(s,c),e&&l(),n(t,!1)}return()=>{let e=!o();e&&i(s,c),e&&l()}},[e]),a}])},99974,20841,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:r,size:s,onClick:c}){return t.default.createElement("span",{className:e,style:{...n,...c&&{cursor:"pointer"},...s&&{fontSize:`${s}px`},...r&&{width:`${r}px`,height:`${r}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"},r={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},s=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(s,{viewBox:"0 0 24 24",style:r}))}c.displayName="IconFdsUserO",e.s(["e",0,c],20841)},34650,e=>{"use strict";let t=(0,e.i(22468).g)("header","sc"),n=Object.freeze({header:`${t}`,fixed:`${t}__fixed`,hidden:`${t}__fixed--hidden`,transparent:`${t}--transparent`,navigationOpen:`${t}__navigation-open`,container:`${t}__container`,leftRow:`${t}__left-row`,logo:`${t}__logo`,menuItems:`${t}__menu-items`,menuItemActive:`${t}__menu-item-active`,tabletMenuButton:`${t}__tablet-menu-button`,buttonGroup:`${t}__button-group`,chips:`${t}__chips`,menuButton:`${t}__menu-button`,moreButtons:`${t}__more-buttons`,auth:`${t}__auth`,whiteIcons:`${t}__white-icons`,close:`${t}__close`,removed:`${t}__removed`,overlay:`${t}__overlay`,overlayOpening:`${t}__overlay--opening`,overlayClosing:`${t}__overlay--closing`}),i=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],l=i.reduce((e,t)=>(e[t.id]=t.label,e),{}),o=Object.freeze({mobile:56,desktop:80});e.s(["F",0,o,"H",0,"cb-header","U",0,"user_region","a",0,l,"b",0,i,"c",0,"user_town","s",0,n])},83657,e=>{"use strict";var t=e.i(24359),n=e.i(63687),i=e.i(34650);let l={userRegion:i.U,userTown:i.c,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},o={userRegion:i.U,userTown:i.c,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},a=(e=!1)=>e?o:l,r=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},s=e=>Array.isArray(e.towns)?e.towns:[],c=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},u=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),d=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,p=(e,t)=>d(e||"https://finuslugi.ru",t),f=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},h=(e,t=!1)=>{if(e.length<1)return;let n=a(t);r(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},m=async e=>{let t=await f(p(e,"/money_data/Root.json?short=1")),n=Array.isArray(null==t?void 0:t.regions)?t.regions:[];return h(n),n},g=async e=>{let t,n,[i,l]=await Promise.all([f(d(e,"/sc/api/v1/cities?all=true&isActive=true")),f(d(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 u(a)?(h(a,!0),a):[]},w=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?g(e):m(e),v=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;return n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,l=t,!0)}),{region:i??(t?e.find(e=>e.url===t.url)??e.find(e=>e.region_id===t.region_id)??null:null)??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,p,"e",0,a,"f",0,e=>{if(typeof document>"u")return null;let n=t.a.getItem(e)??void 0;if(!n||"undefined"===n)return null;try{return JSON.parse(decodeURIComponent(n))}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=c(a(e).allRegions)||[];return r(n,e),n},"h",0,(e,t,i)=>{(0,n.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:i})},"i",0,(e,t=!1)=>!(e.length<1)&&(!t||u(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,(e,t)=>{if(!e||!t)return!1;if(e.url!==t.url)return!0;let n=s(e);return n.length>1||n.some(({main:e})=>!e)},"l",0,w,"m",0,v,"p",0,c,"s",0,(e,n,i=!1)=>{if(typeof document>"u")return;let l=a(i);if(!e&&!n){t.a.removeItem(l.userRegion),t.a.removeItem(l.userTown);return}t.a.setItem(l.userRegion,JSON.stringify((e=>{if(!e)return null;let t=s(e).find(({main:e})=>!!e);return{...e,towns:t?[t]:[]}})(e))||"",{"max-age":31536e3}),t.a.setItem(l.userTown,JSON.stringify(n)||"",{"max-age":31536e3})}])},44437,e=>{"use strict";var t=e.i(63687),n=e.i(34650);let i="finuslugi-header-height-change",l=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let l=encodeURIComponent(JSON.stringify(t)),o=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${l};expires=${i.toUTCString()};path=/;SameSite=Lax${o}`};e.s(["H",0,i,"h",0,(e,i,l)=>(0,t.h)({eventCategory:n.H,eventActionType:e,eventActionText:i,eventLabel:l}),"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="))&&l("utm_params",e,90),e&&l("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 l=document.getElementById("mainHomeBanner"),o=!1,a=0,r=0,s=window.innerWidth<768,c=()=>window.scrollY||document.documentElement.scrollTop,u=e=>{document.documentElement.style.setProperty("--new-header-height-desktop",e),document.documentElement.style.setProperty("--new-header-height-mobile",e)},d=()=>{let e=window.innerWidth<768;e!==s&&(s=e,r=0)},p=function(){let i=c(),s=document.getElementById("headerNotice");if((null==s?void 0:s.getAttribute("data-opening"))==="true")return;r||(()=>{let e=document.querySelector(":root");if(e){let t=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height"));r=Number.isNaN(t)?0:t,a=c()}})();let d=i<r,p=i<((null==l?void 0:l.clientHeight)||0);if(n&&p||d){o=!1,e(!1),t(!0),u(`${r}px`);return}e(o=i>a),o&&setTimeout(()=>t(!1),50),u(o?"0px":`${r}px`),a=i<=0?0:i},f=()=>{r=0,p()};return window.addEventListener("scroll",p),window.addEventListener("resize",d),window.addEventListener(i,f),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",d),window.removeEventListener(i,f)}}])},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:r,size:s,onClick:c}){return t.default.createElement("span",{className:e,style:{...n,...c&&{cursor:"pointer"},...s&&{fontSize:`${s}px`},...r&&{width:`${r}px`,height:`${r}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),r=e.i(20841);e.i(34348);var s=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(83657),m=e.i(40383),g=e.i(44437),w=e.i(34650);e.i(46401);var v=e.i(34986),b=e.i(3366),_=e.i(71121),x=e.i(65019),y=e.i(93562);let C={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},k={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},$=e=>n.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M12.004 7.246A1.247 1.247 0 0110.75 6a1.25 1.25 0 111.254 1.247zM10.75 12c0 .686.559 1.252 1.254 1.247a1.252 1.252 0 001.246-1.25 1.25 1.25 0 10-2.5.003zm0 6c0 .686.559 1.253 1.254 1.247a1.252 1.252 0 001.246-1.25 1.25 1.25 0 10-2.5.003z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function j({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...C,...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($,{viewBox:"0 0 24 24",style:k}))}j.displayName="IconFdsDotsVerticalO";let O=(0,f.g)("navigation-chips","sc"),I=Object.freeze({wrapper:`${O}__wrapper`,gray:`${O}__variantGray`,white:`${O}__variantWhite`,container:`${O}__container`,chip:`${O}__chip`,more:`${O}__chip--more`,active:`${O}__chip--active`,icon:`${O}__icon`,label:`${O}__label`,hidden:`${O}__hidden`}),S=(0,f.g)("navigation-content","sc"),N=Object.freeze({contentWrapper:`${S}__content-wrapper`,content:`${S}__content`,contentOpen:`${S}__content--open`,contentHeader:`${S}__content-header`,contentTitle:`${S}__content-title`,contentTitleUrl:`${S}__content-title--url`,contentTitleLink:`${S}__content-title--link`,contentTitleNew:`${S}__content-title--new`,new:`${S}__new`,newInline:`${S}__new-inline`,vip:`${S}__vip`,arrowIcon:`${S}__arrow-icon`,links:`${S}__links`,linksColumns:`${S}__links--columns`,linksTitleless:`${S}__links--titleless`,removed:`${S}__removed`,hidden:`${S}__content--hidden`}),R=({chip:e,hidden:n,onClick:i,refCallback:l,activeChipId:o})=>{let a=!!i,r=()=>{if(a)return null==i?void 0:i(e.url);(0,g.h)(p.D.chip,e.title,`${e.title}_${e.url}`)},s=(0,t.jsxs)(t.Fragment,{children:[e.icon&&(0,t.jsx)("span",{className:I.icon,"aria-hidden":"true",children:e.icon}),(0,t.jsx)("span",{className:I.label,children:e.title}),e.arrow&&(0,t.jsx)(y.K,{size:24})]}),c=(0,u.default)(I.chip,{[I.hidden]:n,[N.new]:!!e.new,[N.vip]:!!e.vip,[I.active]:e.url===o});return a?(0,t.jsx)("button",{type:"button",className:c,onClick:r,ref:l,children:s}):(0,t.jsx)("a",{href:e.url,className:c,onClick:r,ref:l,children:s})},T=({items:e=[],maxNumberOfLines:i,variant:l,className:o,activeChipId:a,onClick:r,moreButtonOptions:s})=>{let c=(0,n.useRef)(null),d=(0,n.useRef)(null),f=(0,n.useRef)([]),h=(null==s?void 0:s.label)??"Еще",m="Еще",w=(null==s?void 0:s.showIcon)??!0,v=(0,u.default)(I.chip,I.more,null==s?void 0:s.className),[b,_]=(0,n.useState)(!1),[x,y]=(0,n.useState)(e.length),[C,k]=(0,n.useState)(!1),$=(0,n.useCallback)(()=>{let t=c.current;if(!t)return;let n=e=>e?e.getBoundingClientRect().width:0,l=n(t),o=Math.max(Number(i)||0,0),a=()=>{y(e.length),k(!1)};if(b||0===o||l<=0)return void a();let r=(()=>{try{let e=getComputedStyle(t),n=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(n)?12:n}catch{return 12}})(),s=n(d.current),u=e.map((e,t)=>n(f.current[t]));if(u.some(e=>0===e))return void a();let p=1,h=0,m=0;for(let e of u){let t=p===o?s+r:0,n=0===h?e:h+r+e;if(n+t<=l-.5)h=n,m++;else{if(++p>o)break;h=e,m++}}k(m<e.length),y(m)},[b,e,i]);(0,n.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame($)});return t.observe(e),requestAnimationFrame($),()=>{t.disconnect()}},[$]),(0,n.useEffect)(()=>{requestAnimationFrame($)},[$]);let O=b||(i??0)<=0||!C;return(0,t.jsx)("div",{className:(0,u.default)(o,I.wrapper,{[I.gray]:"gray"===l,[I.white]:"white"===l}),children:(0,t.jsxs)("div",{ref:c,className:I.container,children:[e.map((e,n)=>(0,t.jsx)(R,{chip:e,hidden:!O&&n>=x,activeChipId:a,onClick:r,refCallback:e=>{f.current[n]=e}},`${e.url}_${n}`)),!O&&C&&(0,t.jsxs)("button",{type:"button",ref:d,className:v,"aria-label":m,onClick:()=>{(0,g.h)(p.D.chip,m),_(!0)},children:[w&&(0,t.jsx)(j,{size:20}),(0,t.jsx)("span",{className:I.label,children:h})]}),(O||!C)&&(0,t.jsxs)("button",{type:"button",ref:d,className:(0,u.default)(v,I.hidden),tabIndex:-1,"aria-hidden":"true",children:[w&&(0,t.jsx)(j,{size:20}),(0,t.jsx)("span",{className:I.label,children:h})]})]})})},A={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},E={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},P=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 B({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.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"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},n.default.createElement(P,{viewBox:"0 0 24 24",style:E}))}B.displayName="IconFdsChatDotsSquareAddO";let z={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},M={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},L=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 F({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...z,...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(L,{viewBox:"0 0 24 24",style:M}))}F.displayName="IconFdsMenuSkewedO";let U=e=>{let[t,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{e&&i(!0)},[e]),e||t},W=()=>{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}},H=(0,f.g)("certificates-warning-banner","sc"),D=(0,f.g)("certificates-warning-popup","sc"),V=Object.freeze({wrapper:`${H}`,container:`${H}__container`,content:`${H}__content`,info:`${H}__info`,image:`${H}__image`,text:`${H}__text`,title:`${H}__title`,description:`${H}__description`,details:`${H}__details`,buttons:`${H}__buttons`,button:`${H}__button`,closeButton:`${H}__close-button`,mobileActivator:`${H}__mobile-activator`}),G=Object.freeze({modal:`${D}__modal`,desktopCloseButton:`${D}__desktop-close-button`,mobilePopup:`${D}__mobile-popup`,mobileContentContainer:`${D}__mobile-content-container`,mobileCloseButton:`${D}__mobile-close-button`,mobileDialog:`${D}__mobile-dialog`,content:`${D}__content`,image:`${D}__image`,text:`${D}__text`,title:`${D}__title`,description:`${D}__description`,actions:`${D}__actions`,primaryActions:`${D}__primary-actions`,divider:`${D}__divider`,explanation:`${D}__explanation`,button:`${D}__button`,gosuslugiButton:`${D}__gosuslugi-button`,gosuslugiIcon:`${D}__gosuslugi-icon`}),q="fu_certificates_access_confirmed",J="fu_certificates_banner_dismissed",Y="fu_external_link_warning_shown",K=new Map,Q=e=>{if(typeof window>"u")return"1"===K.get(e);try{return"1"===window.localStorage.getItem(e)||"1"===K.get(e)}catch{return"1"===K.get(e)}},X=e=>{if(K.set(e,"1"),!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},Z=(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}},ee={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},et={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},en=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 ei({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...ee,...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(en,{viewBox:"0 0 24 24",style:et}))}ei.displayName="IconFdsLocationO";let el=(0,h.g)(),eo=(0,h.a)(el),ea={regions:el,towns:eo,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},er=(0,n.createContext)(ea);function es(){return(0,n.useContext)(er)}let ec={"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"},eu=(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 ed(){return(0,n.useContext)(eu)}let ep=e=>{let[i,l]=(0,n.useState)(!1),[o,a]=(0,n.useState)(!1),[r,s]=(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(ec,e)?ec[e]:ec["finuslugi.ru"]})(),n="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:t=>{if(t.host&&(e=t.host),t.channel&&(n=t.channel),t.user){let e="function"==typeof t.user?t.user:()=>({...t.user});window.__WebchatUserCallback=e}},open:()=>new Promise(e=>{e()}),close:()=>null,toggle:()=>null}};let i=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((l,r)=>{var s,c;let u,d;o.current?r(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()},s=e,c=n,(u=document.createElement("link")).rel="stylesheet",u.type="text/css",u.href=`${s}/assets/css/${c}`,document.head.appendChild(u),(d=document.createElement("script")).src=`${s}/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,b]=(0,n.useState)(!1),[_,x]=(0,n.useState)(!1),[y,C]=(0,n.useState)(!1),k=(0,n.useRef)(null),$=(0,m.u)(v),j=(0,n.useRef)(null),O=(0,n.useRef)(null),I=(0,n.useRef)(null),S=(0,n.useRef)(null),N=(0,n.useCallback)(()=>{$.current&&$.current.scrollTo({top:0})},[$]),R=(0,n.useCallback)(e=>{w(e),N()},[N]),T=(0,n.useCallback)(e=>{j.current&&clearTimeout(j.current),e&&x(!0),e||(j.current=setTimeout(()=>{x(!1),R(null)},300))},[R]),A=(0,n.useCallback)((e,t,n)=>{if(t&&R(t),!n&&e===p||!e){T(!v),b(!v);return}f(e),T(!0),b(!0)},[p,R,v,T]),E=(0,n.useCallback)(()=>{O.current&&clearTimeout(O.current),C(!0),O.current=setTimeout(()=>{C(!1)},650)},[]);return(0,n.useEffect)(()=>{l(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,g.s)(a,s,e.isMainBannerPage);return(0,g.i)(),t},[]),(0,t.jsx)("header",{children:(0,t.jsx)(eu.Provider,{value:{isAuth:i,isHeaderHidden:o,isHeaderTransparent:r,openedBlock:p,setOpenedBlock:A,openedSection:h,setOpenedSection:R,isNavigationOpen:v,isNavigationMounted:_,navMenuItemsRef:k,navigationRef:$,ignoreClicks:y,setIgnoreClicks:E,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:d,fixedContainerRef:I,headerRef:S},children:e.children})})},ef=(0,f.g)("city-select","sc"),eh=Object.freeze({button:`${ef}__button`,minimal:`${ef}__minimal`,full:`${ef}__full`}),em=(0,i.default)(()=>e.A(67474).then(e=>e.CitySelectModal),{ssr:!1}),eg=(0,i.default)(()=>e.A(59495).then(e=>e.StartChoicePopup),{ssr:!1}),ew=({initialTown:e})=>{var i;let l=es(),o=(null==(i=l.town)?void 0:i.name)||e||"Вся Россия",{setIsChatModalOpen:a,isChatModalOpen:r}=ed(),{startPopupVisible:c,setStartPopupVisible:d,popupVisible:p}=l,f=U(p),h=U(c),m=(0,n.useRef)();(0,n.useEffect)(()=>{p&&(m.current="popup")},[p]),(0,n.useEffect)(()=>{r&&(m.current="chat")},[r]),(0,n.useEffect)(()=>{c&&(m.current="startPopup")},[c]),(0,n.useEffect)(()=>{m.current&&("chat"===m.current&&c?d(!1):["startPopup","popup"].includes(m.current)&&r&&a(!1))},[p,r,c,d,a]);let g={appearance:"ghost",size:"xs",onClick:()=>l.handleButtonClick(!1),iconLeft:(0,t.jsx)(ei,{size:24})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Button,{...g,className:(0,u.default)(eh.button,eh.full),label:o}),(0,t.jsx)(s.Button,{...g,className:(0,u.default)(eh.button,eh.minimal),shape:"icon"}),f&&(0,t.jsx)(em,{}),h&&(0,t.jsx)(eg,{})]})},ev=({label:e,onClick:n,eventActionText:i,eventLabel:l,...o})=>(0,t.jsx)(s.Button,{label:e,onClick:e=>{null==n||n(e),(0,p.h)({eventCategory:w.H,eventActionType:p.D.button,eventActionText:i||"",eventLabel:l||""})},...o}),eb=({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}),e_={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},ex={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},ey=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 eC({className:e,style:t,boxSize:i,size:l,onClick:o}){return n.default.createElement("span",{className:e,style:{...e_,...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(ey,{viewBox:"0 0 24 24",style:ex}))}eC.displayName="IconFdsChevronLeftO";let ek=(0,f.g)("header-chat-modal-body","sc"),e$=Object.freeze({wrapper:`${ek}__wrapper`,cardButton:`${ek}__card-button`,card:`${ek}__card`,cardTitle:`${ek}__card-title`,cardSubtitle:`${ek}__card-subtitle`,button:`${ek}__button`}),ej=()=>{let e=ed();return(0,t.jsxs)("div",{className:e$.wrapper,children:[(0,t.jsx)(ev,{className:e$.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)(x.Card,{className:e$.card,variant:"secondary",children:[(0,t.jsxs)("div",{className:e$.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:e$.cardSubtitle,children:["Виртуальный ассистент доступен 24/7, ",(0,t.jsx)("br",{}),"операторы — с 6:00 до 23:59 мск"]})]})}),!1]})},eO=({data:e,isMobile:i})=>{let l=ed();return(0,t.jsx)("div",{className:N.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)(N.content,{[N.hidden]:l.openedSection!==e.id,[N.contentOpen]:!!l.openedSection}),children:[(0,t.jsx)("div",{className:N.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)(N.contentTitle,{[N.removed]:!n.title,[N.contentTitleUrl]:!!n.url,[N.contentTitleLink]:!!e.isSeeAllLinkAvailable,[N.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,t.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,t.jsx)("div",{className:N.arrowIcon,children:(0,t.jsx)(y.K,{})}),n.title]})})}),!(null!=(o=n.links)&&o.length)&&(0,t.jsx)(T,{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)(N.links,{[N.linksColumns]:!!n.columns,[N.linksTitleless]:!n.title}),children:n.links.map((e,n)=>(0,t.jsxs)("a",{href:e.url,onClick:()=>(0,g.h)(p.D.link,e.title,`${e.title}_${e.url}`),children:[(0,t.jsx)("div",{className:N.arrowIcon,children:(0,t.jsx)(y.K,{})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{children:e.title}),!!e.new&&(0,t.jsx)("span",{className:(0,u.default)({[N.newInline]:!!e.new})})]})]},`${e.url}_${n}`))})]},`${n.url}_${l}`)})]},e.id)})},e.id))})},eI=(0,f.g)("navigation-section-icon","sc"),eS=Object.freeze({icon:`${eI}`}),eN={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)},eR=e=>Object.prototype.hasOwnProperty.call(eN,e),eT=({name:e,background:i})=>{let[l,o]=(0,n.useState)(null);if((0,n.useEffect)(()=>{if(!e||!eR(e))return void o(null);let t=!0;return eN[e]().then(n=>{t&&o({name:e,component:n})}).catch(()=>{t&&o(null)}),()=>{t=!1}},[e]),!e||!eR(e))return null;let a=(null==l?void 0:l.name)===e?l.component:null;return(0,t.jsx)("div",{className:eS.icon,style:{background:i},children:a&&(0,t.jsx)(a,{})})},eA=(0,f.g)("navigation","sc"),eE=Object.freeze({navigation:`${eA}`,navigationOpening:`${eA}--opening`,navigationClosing:`${eA}--closing`,wrapper:`${eA}__wrapper`,container:`${eA}__container`,containerOpen:`${eA}__container--open`,sections:`${eA}__sections`,sectionsOpen:`${eA}__sections--open`,citySelectButton:`${eA}__city-select-button`,sectionsTitle:`${eA}__sections-title`,sectionsWrapper:`${eA}__sections-wrapper`,section:`${eA}__section`,sectionArrow:`${eA}__section-arrow`,sectionExtra:`${eA}__section--extra`,sectionActive:`${eA}__section--active`,sectionTitle:`${eA}__section-title`,chatWrapper:`${eA}__chat-wrapper`,chatHeader:`${eA}__chat-header`,backButton:`${eA}__back-button`,useful:`${eA}__useful`,usefulOpen:`${eA}__useful--open`,usefulTitle:`${eA}__useful-title`,usefulGrid:`${eA}__useful-grid`,removed:`${eA}__removed`}),eP=({data:e})=>{var i;let l=ed(),o=es(),a=(0,_.useBreakpointDown)("m"),[r,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]),m=(0,n.useRef)(!1),v=(0,n.useRef)(null),x=(0,n.useCallback)(()=>{r&&(m.current=!0,v.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),h()},window.history.pushState(null,"",window.location.href))},[h,r]),y=(0,n.useCallback)(()=>{m.current=!1,window.onpopstate=v.current,window.history.go(-1)},[]),C=(0,n.useRef)(null),k=(0,n.useCallback)(e=>{if(r||!l.navMenuItemsRef.current||!l.navigationRef.current)return;let t=e.target,n=!l.navMenuItemsRef.current.contains(t)&&!l.navigationRef.current.contains(t);if(n&&!C.current){l.setIgnoreClicks(),C.current=setTimeout(()=>l.setOpenedBlock(null),300);return}!n&&C.current&&(clearTimeout(C.current),C.current=null)},[r,l]),$=(0,n.useRef)(null),j=(0,n.useCallback)(e=>{typeof window>"u"||(e?($.current=k,window.addEventListener("mousemove",$.current)):$.current&&window.removeEventListener("mousemove",$.current))},[k]);(0,n.useEffect)(()=>{j(l.isNavigationOpen),l.isNavigationOpen&&!m.current&&x(),!l.isNavigationOpen&&m.current&&y()},[l.isNavigationOpen]);let O=(e,t)=>()=>{(0,g.h)(p.D.button,t),l.setOpenedSection(e)},{start:I,clear:S}=W(),N=()=>{r||S()};return(0,t.jsx)("div",{ref:l.navigationRef,className:(0,u.default)(eE.navigation,{[eE.removed]:!l.isNavigationMounted,[eE.navigationOpening]:l.isNavigationOpen,[eE.navigationClosing]:!l.isNavigationOpen}),children:(0,t.jsx)("div",{className:eE.wrapper,children:(0,t.jsxs)(c.Container,{className:(0,u.default)(eE.container,{[eE.containerOpen]:!!l.openedSection}),children:[(0,t.jsxs)("div",{className:(0,u.default)(eE.sections,{[eE.sectionsOpen]:!!l.openedSection}),children:[(0,t.jsx)(s.Button,{className:eE.citySelectButton,variant:"violet",appearance:"ghost",size:"xs",onClick:()=>o.handleButtonClick(!1),iconLeft:(0,t.jsx)(ei,{size:24}),label:(null==(i=o.town)?void 0:i.name)||"Вся Россия"}),e.map(e=>(0,t.jsxs)("ul",{className:(0,u.default)(eE.sectionsWrapper,{[eE.removed]:l.openedBlock!==e.id&&!r}),children:[(0,t.jsx)("div",{className:eE.sectionsTitle,children:w.a[e.id]}),e.sections.map(e=>{let n,i;return(0,t.jsxs)("li",{className:(0,u.default)(eE.section,{[eE.sectionExtra]:!!e.extra,[eE.sectionActive]:l.openedSection===e.id}),onClick:O(e.id,e.title),onMouseEnter:(n=e.id,i=e.title,()=>{r||I(O(n,i),150)}),onMouseLeave:N,children:[l.isNavigationMounted&&(0,t.jsx)(eT,{name:e.uikitIcon,background:e.uikitIconBg}),(0,t.jsx)("span",{className:eE.sectionTitle,children:e.title}),(0,t.jsx)("div",{className:eE.sectionArrow,children:(0,t.jsx)(b._,{size:24})})]},e.id)})]},e.id)),(0,t.jsxs)("div",{className:eE.chatWrapper,children:[(0,t.jsx)("div",{className:eE.chatHeader,children:"Нужна помощь?"}),(0,t.jsx)(ej,{})]})]}),(0,t.jsxs)("button",{type:"button",className:(0,u.default)(eE.backButton,{[eE.removed]:!l.openedSection}),onClick:()=>{(0,g.h)(p.D.button,"Назад"),l.setOpenedSection(null)},children:[(0,t.jsx)(eC,{size:24}),(0,t.jsx)("span",{children:"Назад"})]}),(0,t.jsx)(eO,{data:e,isMobile:r}),(0,t.jsxs)("div",{className:(0,u.default)(eE.useful,{[eE.usefulOpen]:!!l.openedSection}),children:[(0,t.jsx)("div",{className:eE.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)(eE.usefulGrid,{[eE.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,g.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))]})]})})})},eB=(0,i.default)(()=>e.A(9466).then(e=>e.CertificatesWarningBanner),{ssr:!1}),ez=(0,i.default)(()=>e.A(14496).then(e=>e.CertificatesWarningPopup),{ssr:!1}),eM=(0,i.default)(()=>e.A(64532).then(e=>e.HeaderMobileAppBanner),{ssr:!1}),eL=({data:e,showcaseUrl:i="https://finuslugi.ru",minioUrl:f="https://assets.finuslugi.ru/mp-assets",lkUrl:h="https://lk.finuslugi.ru/registration",initialTown:m,isMainBannerPage:v,enableAppHeaderBanner:b=!1,enableCertificatesBanner:_=!1,enableExternalLinkWarning:x=!1,certificatesWarningProduct:y,news:C,className:k})=>{let $=ed(),j=(0,n.useMemo)(()=>((e,t,n)=>{var i,l,o,a,r,s,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==(s=null==(r=null==e?void 0:e.NAVIGATOR)?void 0:r[u])?void 0:s.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,C),[e,i,C]),O=null==e?void 0:e.config,I=!!e&&_&&!!v,S=(({enableCertificatesBanner:e,enableExternalLinkWarning:t,isMainBannerPage:i})=>{let[l,o]=(0,n.useState)("checking"),[a,r]=(0,n.useState)(!1),[s,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),h=(0,n.useRef)(),m=(0,n.useRef)(!1),g=(0,n.useRef)(!1),w=(0,n.useRef)(!1);(0,n.useRef)(null);let v=(0,n.useRef)(null),b=(0,n.useRef)(null),_=(0,n.useRef)(null),x=e&&i,y=x||t,C=(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)(()=>{r(!1),w.current=!1,v.current=null,b.current=null,_.current=null,f(!1)},[]),$=(0,n.useCallback)(e=>{X(Y),g.current=!0,w.current=!1,v.current=e,f("external"===e&&null!==b.current),r(!0)},[]),j=(0,n.useCallback)(()=>!m.current&&("external"===v.current&&!w.current||!g.current),[]),O=(0,n.useCallback)(()=>{"external"!==v.current&&$("external")},[$]);(0,n.useEffect)(()=>{h.current=window.open;let e=window.navigator.userAgent.includes("YaBrowser/");return e&&X(q),m.current=e||Q(q),g.current=Q(Y),d(m.current),c(!0),()=>{b.current=null,_.current=null}},[]),(0,n.useEffect)(()=>{if(s){if(!x)return void o("skipped");o(e=>"shown"===e||"closing"===e||"dismissed"===e?e:u||Q(J)?"skipped":"shown")}},[u,x,s]),(0,n.useEffect)(()=>{},[k,y,s]),(0,n.useEffect)(()=>{if(!s||!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=Z(t.href,window.location);if(!i||!j())return;e.preventDefault(),null===b.current&&(b.current=i.href,_.current={source:"external_anchor",host:i.hostname});let l=b.current;queueMicrotask(()=>{n&&j()&&b.current===l&&O()})},l=(t,n="_blank",i)=>{let l=Z(t,window.location);return l&&j()?(null===b.current&&(b.current=l.href,_.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,s,j,O]),(0,n.useEffect)(()=>{var e;t||(b.current=null,(null==(e=_.current)?void 0:e.source)!=="banner"&&(_.current=null),f(!1),"external"===v.current&&k())},[k,t]),(0,n.useEffect)(()=>{x||"banner"===v.current&&k()},[k,x]),(0,n.useEffect)(()=>{y||k()},[k,y]);let I=(0,n.useCallback)(()=>{X(J),o("closing")},[]),S=(0,n.useCallback)(()=>{o("dismissed")},[]),N=(0,n.useCallback)(()=>{b.current=null,_.current={source:"banner"},$("banner")},[$]),R=(0,n.useCallback)(()=>{C("https://www.gosuslugi.ru/crt")},[C]),T=(0,n.useCallback)(()=>{C("https://browser.yandex.ru/")},[C]),A=(0,n.useCallback)(()=>{let e=b.current;e&&(X(Y),g.current=!0,w.current=!0,C(e))},[C]);return{bannerStatus:l,isPopupOpen:a,popupAnalyticsContext:_.current,dismissBanner:I,finishBannerClosing:S,openPopupFromBanner:N,closePopup:k,openCertificatesPage:R,openYandexBrowserPage:T,continueToExternalPage:p?A:void 0}})({enableCertificatesBanner:I,enableExternalLinkWarning:x,isMainBannerPage:!!v}),N="shown"===S.bannerStatus||"closing"===S.bannerStatus,R=!I||"skipped"===S.bannerStatus,T=U(S.isPopupOpen),A=(0,n.useMemo)(()=>j.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[j]),E=$.isAuth?"Личный кабинет":"Войти",P=v&&$.isHeaderTransparent,z=(e,t,n,i)=>()=>{e!==$.openedBlock?(0,g.h)(p.D.toggle,t,"on"):(0,g.h)(p.D.button,"menu_close","on");let l=n?A[e]:"";$.setOpenedBlock(e,l,!!i)},{start:M,clear:L}=W(),H=e=>()=>{$.ignoreClicks||e()},D=T?(0,t.jsx)(ez,{isOpen:S.isPopupOpen,analyticsContext:S.popupAnalyticsContext,certificatesWarningProduct:y,onClose:S.closePopup,onOpenCertificatesPage:S.openCertificatesPage,onOpenYandexBrowserPage:S.openYandexBrowserPage,onContinue:S.continueToExternalPage}):null;return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:$.headerRef,className:(0,u.default)(w.s.header,k,{[w.s.transparent]:P}),children:(0,t.jsxs)("div",{ref:$.fixedContainerRef,className:(0,u.default)(w.s.fixed,{[w.s.hidden]:$.isHeaderHidden,[w.s.navigationOpen]:$.isNavigationOpen}),children:[N&&(0,t.jsx)(eB,{onDismiss:S.dismissBanner,onClosed:S.finishBannerClosing,onOpenDetails:S.openPopupFromBanner,onOpenCertificatesPage:S.openCertificatesPage,onOpenYandexBrowserPage:S.openYandexBrowserPage}),R&&!!(null!=O&&O.appBannerUrl)&&b&&(0,t.jsx)(eM,{mobileAppUrl:O.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)(eb,{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:$.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)(s.Button,{className:(0,u.default)({[w.s.menuItemActive]:$.openedBlock===e&&$.isNavigationOpen}),label:n,variant:"white",size:"xs",onClick:H(z(e,n,!0)),onMouseEnter:()=>{$.isNavigationOpen&&e===$.openedBlock||$.setIgnoreClicks(),M(z(e,n,!0,!0),200)},onMouseLeave:L})},e))})}),(0,t.jsx)(ev,{className:(0,u.default)(w.s.tabletMenuButton,{[w.s.menuItemActive]:$.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,t.jsx)(o.m,{size:24}),onClick:z("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,t.jsxs)("div",{className:(0,u.default)(w.s.buttonGroup,{[w.s.whiteIcons]:(null==O?void 0:O.iconColorOnMobileMainBanner)==="white"}),children:[(0,t.jsxs)("div",{className:w.s.chips,children:[(0,t.jsx)(ev,{as:"a",href:h,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${h}`,iconLeft:(0,t.jsx)(r.e,{size:20}),"aria-label":E}),(0,t.jsx)(ev,{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}),"aria-label":"Онлайн чат"})]}),(0,t.jsx)(ev,{className:w.s.menuButton,size:"xs",shape:P?"icon":"default",appearance:P?"ghost":"fill",label:"Меню",onClick:z("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,t.jsx)(F,{size:24})}),(0,t.jsxs)("div",{className:w.s.moreButtons,children:[(0,t.jsx)(ew,{initialTown:m}),(0,t.jsx)(ev,{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)(B,{size:24}),children:"Онлайн чат"}),(0,t.jsx)(ev,{as:"a",href:h,size:"xs",eventActionText:E,eventLabel:`${E}_${h}`,label:E})]})]}),(0,t.jsxs)(eb,{className:w.s.auth,href:h,eventActionText:E,eventLabel:`${E}_${h}`,children:[(0,t.jsx)(ev,{size:"xs",shape:"circle-icon",iconLeft:(0,t.jsx)(r.e,{}),eventActionText:E,eventLabel:`${E}_${h}`}),(0,t.jsx)("p",{children:E})]}),(0,t.jsx)("div",{className:w.s.close,children:(0,t.jsx)(ev,{className:w.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,t.jsx)(a.a,{}),onClick:()=>$.setOpenedBlock(null),eventActionText:"IconFdsCloseO","aria-label":"Закрыть"})})]})]})}),(0,t.jsx)("div",{className:(0,u.default)(w.s.overlay,{[w.s.removed]:!$.isNavigationMounted,[w.s.overlayOpening]:$.isNavigationOpen,[w.s.overlayClosing]:!$.isNavigationOpen}),onClick:H(()=>$.setOpenedBlock(null))}),(0,t.jsx)(eP,{data:j,minioUrl:f}),D]}):x?D:null};e.s(["CitySelectProvider",0,({children:e,initialRegion:i,initialTown:l,showStartGeoPopup:o=!0,lastRegionsUpdateUnixTimestamp:a,showcaseUrl:r="",dadataUrl:s=(0,h.d)(r,"/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,[m,g]=(0,n.useState)((0,h.g)(c)),w=(0,n.useRef)(m),[{startRegion:v,startTown:b},_]=(0,n.useState)({startRegion:ea.startRegion,startTown:ea.startTown}),x=i??ea.region,y=l??ea.town,[{region:C,town:k},$]=(0,n.useState)({region:x,town:y}),[j,O]=(0,n.useState)(ea.startPopupVisible),[I,S]=(0,n.useState)(ea.popupVisible),N=(0,n.useRef)(""),R=(0,n.useRef)(!1),T=(0,n.useMemo)(()=>(0,h.a)(m),[m]);(0,n.useEffect)(()=>{w.current=m},[m]);let A=(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),_({startRegion:e,startTown:t})},[O,_]),E=(0,n.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||A(e,t)},[A]),P=(0,n.useCallback)(()=>{if(N.current&&!C&&!k){let e=T.find(e=>e.name===N.current)??null;return E(m.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}E(C,k)},[C,k,T,m,E]),B=(0,n.useCallback)(e=>{S(e)},[S]),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")?B(!0):P()},[o,k,B,P]),L=(0,n.useCallback)((e,t)=>{z(e,t),$({region:e||null,town:t||null}),O(!1),B(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[B,z]),F=()=>{let e=(0,h.f)(u.userRegion),t=e??(0,h.p)(u.userRegion),n=(0,h.f)(u.userTown)??(0,h.p)(u.userTown),i=(0,h.b)(w.current,t,n),l=c&&(0,h.j)(t,n);(0,h.k)(e,i.region)&&(0,h.s)(i.region,i.town,c),l&&(R.current=!0),l&&(0,h.c)(i.region,i.town)&&(z(i.region,i.town),R.current=!1),$(i);let a=async({coords:{latitude:e,longitude:t}})=>{let n=`${s}?lat=${e}&lon=${t}`,i=await (0,h.m)(n);null!=i&&i.location&&(N.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&o)try{navigator.geolocation.getCurrentPosition(a,()=>null)}catch{}};return(0,n.useEffect)(()=>{(!(0,h.i)(m,c)||f)&&(0,h.l)({showcaseUrl:r,useNewCitiesApi:c}).then(e=>{e.length<1||g(e)})},[]),(0,n.useEffect)(()=>{let e=(0,h.b)(m,C,k);R.current&&(0,h.c)(e.region,e.town)&&(z(e.region,e.town),R.current=!1),$(e)},[m,C,z,k]),(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)(er.Provider,{value:{regions:m,towns:T,region:C,town:k,startPopupVisible:j,setStartPopupVisible:O,popupVisible:I,handleToggleModal:B,selectCity:L,handleButtonClick:M,startRegion:v,startTown:b},children:e})},"H",0,ev,"Header",0,e=>(0,t.jsx)(ep,{isMainBannerPage:e.isMainBannerPage,children:(0,t.jsx)(eL,{...e})}),"b",0,V,"p",0,G,"u",0,ed,"useCitySelectContext",0,es],89867)}]);