"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8818],{682:function(e,t,n){n.d(t,{D:function(){return A},P:function(){return z},U:function(){return P},u:function(){return b}});var o=n(57437),l=n(34734),i=n(2265),s=n(26094),a=n(63919),r=n(54887);let c=300,u=({opened:e})=>{let[t,n]=(0,i.useState)(!1),o=(0,i.useRef)(null),l=(0,i.useRef)(!1);return(0,i.useEffect)(()=>(e&&!l.current?(l.current=!0,n(!0)):!e&&l.current&&(o.current=setTimeout(()=>{l.current=!1,n(!1)},c)),()=>{o.current&&clearTimeout(o.current)}),[e]),{mounted:t}},d=(0,a.g)("click-outside","sc"),p=Object.freeze({overlay:`${d}__overlay`,open:`${d}--open`,close:`${d}--close`}),h=({onClose:e,onToucheMove:t,isOpen:n,delay:s=c})=>{let a=(0,i.useRef)(null),r=(0,i.useCallback)(()=>{e&&(a.current=setTimeout(()=>{e()},s))},[s,e]),u=(0,i.useCallback)(e=>{"Escape"===e.key&&r()},[r]);return(0,i.useEffect)(()=>(n&&window.addEventListener("keydown",u),()=>{a.current&&clearTimeout(a.current),window.removeEventListener("keydown",u)}),[n,u]),(0,o.jsx)("div",{className:(0,l.Z)(p.overlay,{[p.open]:n,[p.close]:!n}),onTouchStart:t,onClick:r})},m=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},v=e=>{e.style.top||(window.prevScrollPosition=window.scrollY)},g=(e,t,n)=>{t.style.setProperty("overflow-y","scroll"),e.classList.toggle("scroll-disable-windows",!0),e.style.setProperty("width",`calc(100vw - ${n}px)`),e.style.setProperty("top",`-${window.prevScrollPosition}px`)},f=e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vw")},w=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},_=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},x=()=>document.querySelectorAll("[data-portal]").length>1,b=e=>{let t=(0,i.useRef)(null),n=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{if(n.current===e)return;n.current=e;let o=t.current,l=document.body,i=document.documentElement,s=window.innerWidth-i.clientWidth,a=s>0;if(e&&a)v(l),g(l,i,s),m(o,!0);else if(e)f(l),m(o,!0);else{let e=!x();e&&w(l),e&&_(),m(o,!1)}return()=>{let e=!x();e&&w(l),e&&_()}},[e]),t},j=(0,a.g)("drawer-footer","sc"),C=Object.freeze({footer:`${j}__footer`,hasScroll:`${j}__footer--has-scroll`}),k=({footer:e,hasScroll:t,className:n})=>(0,o.jsx)("div",{className:(0,l.Z)(C.footer,{[C.hasScroll]:t},n),children:"function"==typeof e?e():e}),y=(0,a.g)("drawer-content","sc"),N=Object.freeze({container:`${y}__container`,open:`${y}--open`,close:`${y}--close`,header:`${y}__header`,rowHeader:`${y}__header--row`,title:`${y}__title`,center:`${y}__title--center`,left:`${y}__title--left`,right:`${y}__title--right`,controlContainer:`${y}__control-container`,content:`${y}__content`,footer:`${y}__footer`}),O=({onClose:e,onContentClick:t,children:n,title:a,rowTitle:r,titleAlign:c,isCloseable:u,footer:d,closeButton:p,isOpen:h,contentClassName:m,footerClassName:v,contentStyle:g,width:f})=>{let w=(0,i.useRef)(null),_=(0,i.useRef)(null),[x,b]=(0,i.useState)(!1);(0,i.useEffect)(()=>{var e;if(!_.current||!w.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==w?void 0:w.current,o=()=>{let e=null==_?void 0:_.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",o,!1),()=>{null==n||n.removeEventListener("scroll",o,!1)}},[]);let j=g||f?{width:f,...g||{}}:void 0;return(0,o.jsxs)("div",{ref:w,style:j,className:(0,l.Z)(N.container,{[N.open]:h,[N.close]:!h},m),children:[a||u?(0,o.jsxs)("div",{className:(0,l.Z)(N.header,{[N.rowHeader]:r}),children:[u?p?"function"==typeof p?p():p:(0,o.jsx)("button",{type:"button",className:N.controlContainer,onClick:e,children:(0,o.jsx)(s.IconFdsCloseO,{size:24})}):null,a?(0,o.jsx)("h3",{className:(0,l.Z)(N.title,{[N[c]]:!0}),children:a}):null]}):null,(0,o.jsx)("div",{ref:_,className:N.content,onClick:t,children:n}),d&&(0,o.jsx)(k,{className:(0,l.Z)(N.footer,v),footer:d,hasScroll:x})]})},T=(0,a.g)("drawer-layout","sc"),S=Object.freeze({window:`${T}__window`}),I=({onClose:e,isOpen:t,children:n,withDisabledScroll:s,className:a,...r})=>{let c=(0,i.useCallback)(e=>e.stopPropagation(),[]);return b(t&&s),(0,o.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(S.window,a),children:[(0,o.jsx)(h,{onClose:e,isOpen:t,delay:0}),(0,o.jsx)(O,{onContentClick:c,onClose:e,isOpen:t,...r,children:n})]})},A=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:l=!0,withDisabledScroll:i=!0,...s})=>{let{mounted:a}=u({opened:e});return a?(0,o.jsx)(I,{titleAlign:n,isCloseable:l,isOpen:e,withDisabledScroll:i,...s,children:t}):null};A.displayName="Drawer";let $=(0,a.g)("mobile-modal-footer","sc"),L=Object.freeze({footer:`${$}__footer`,footerWithoutShadow:`${$}__footer--without-shadow`}),Z=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,o.jsx)("div",{className:(0,l.Z)(L.footer,t&&L.footerWithoutShadow,n),children:"function"==typeof e?e():e}),R=(0,a.g)("mobile-popup","sc"),M=Object.freeze({mobilePopup:`${R}`,mobilePopupOpen:`${R}--open`,content:`${R}__content`,contentFull:`${R}__content--full`,contentTransition:`${R}__content--transition`,contentTransitionOpen:`${R}__content--transition-open`,contentLine:`${R}__content-line`,contentContainer:`${R}__content-container`,smallContentContainer:`${R}__content-container--small`,min:`${R}__content-container--min`,title:`${R}__title`,closeContainer:`${R}__close-container`,closeButton:`${R}__close-button`}),E=({children:e,footer:t,isOpen:n,isSmallPopup:a,onClose:r,hasCloseButton:c=!0,full:u,touchDistance:d=100,withDisabledScroll:p=!0,contentClassName:m,className:v,title:g,closeButton:f,footerClassName:w})=>{let[_,x]=(0,i.useState)(!1),[j,C]=(0,i.useState)(!1),[k,y]=(0,i.useState)(!0),[N,O]=(0,i.useState)("120%"),T=(0,i.useRef)(null),S=(0,i.useRef)(0),I=(0,i.useRef)(!1),A=e=>{var t,n,o;let l=null==(t=T.current)?void 0:t.offsetTop,i=null==(n=T.current)?void 0:n.offsetHeight;if(I.current=!0,y(!1),l&&i){let t=(null==(o=null==e?void 0:e.touches[0])?void 0:o.clientY)-l,n=0;t>=0&&t<=i+30&&(n=t),t>i+30&&(n=i+30),O(`${n}px`),S.current=n}},$=()=>{I.current&&(S.current>d&&r?null==r||r():O("0"),y(!0),I.current=!1),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",$)};return(0,i.useEffect)(()=>{n&&setTimeout(()=>{x(!0),C(!0),O("0")},100),!n&&j&&(O("120%"),x(!1),C(!1))},[j,n]),b(n&&p),(0,o.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(M.mobilePopup,j&&M.mobilePopupOpen,v),children:[(0,o.jsx)(h,{onClose:()=>{n&&(null==r||r())},onToucheMove:()=>{n&&(x(!1),window.addEventListener("touchmove",A),window.addEventListener("touchend",$))},isOpen:n,delay:0}),(0,o.jsxs)("div",{className:(0,l.Z)(M.content,u&&M.contentFull,k&&M.contentTransition,k&&_&&M.contentTransitionOpen),ref:T,style:{transform:`translateY(${N})`},children:[(0,o.jsx)("div",{className:M.contentLine}),(0,o.jsxs)("div",{className:(0,l.Z)(M.contentContainer,a&&M.smallContentContainer,{[M.min]:!g&&!c},m),children:[!!g&&(0,o.jsx)("div",{className:M.title,children:g}),c?(0,o.jsx)("div",{className:M.closeContainer,children:c?f?"function"==typeof f?f():f:(0,o.jsx)("button",{onClick:r,className:M.closeButton,children:(0,o.jsx)(s.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,o.jsx)(Z,{footerClassName:w,isSmallPopup:a,footer:t})]})]})},P=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...l})=>{let{mounted:i}=u({opened:n});return i?(0,o.jsx)(E,{isSmallPopup:t,isOpen:n,...l,children:e}):null};P.displayName="UiMobilePopup";let z=({children:e,id:t="portal-root"})=>{let[n,o]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=document.getElementById(t);if(e){o(e);return}let n=document.createElement("div");return n.id=t,document.body.appendChild(n),o(n),()=>{document.body.removeChild(n)}},[t]),n?(0,r.createPortal)(e,n):null}},63919:function(e,t,n){n.d(t,{g:function(){return o}});function o(e,t){return`finkit-widgets-${t}-${e}`}},3455:function(e,t,n){n.d(t,{D:function(){return r},h:function(){return u}});var o,l=n(60915);let i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sch",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"},s=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in i?i[t]:e}).replaceAll(/[ \u00A0]/g,"_"),a=(e,t)=>{if(typeof window>"u")return;let n=sessionStorage.getItem("pushedEvents"),o=n?JSON.parse(n):[];e.event||(e.event="data-event"),"string"==typeof e.eventAction&&(e.eventAction=e.eventAction.toLowerCase().replaceAll(" ","_")),"string"==typeof e.eventLabel&&(e.eventLabel=e.eventLabel.toLowerCase().replaceAll(" ","_"));let i=o.find(n=>n.eventCategory===e.eventCategory&&n.eventAction===e.eventAction&&n.eventLabel===e.eventLabel&&("all"===t||"url"===t&&window.location.pathname===n.url));if(!t||!i){if(t){let t={...e};t.url=window.location.pathname,o.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(o))}(0,l.AB)(e)}};var r=((o=r||{}).icon="icon",o.chip="chip",o.accordion="accordion",o.button="button",o.checkbox="checkbox",o.radio="radio",o.select="select",o.toggle="toggle",o.tooltip="tooltip",o.link="link",o.banner="banner",o.tag="tag",o.date="date",o.field="field",o.offer="offer",o.tab="tab",o.submitButton="submitButton",o.popup="popup",o.block="block",o);let c={icon:"click_icon_",chip:"click_chip_",accordion:"show_acc_",button:"click_button_",checkbox:"click_check_",radio:"click_radio_",select:"click_sel_",toggle:"click_togg_",tooltip:"click_tip_",link:"click_link_",banner:"click_bnr_",tag:"click_tag_",date:"input_date_",field:"input_field_",offer:"click_offer_",tab:"click_tab_",submitButton:"form_button_",popup:"show_pop_up_",block:"click_block_"},u=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:o})=>{let l={event:"data-event",eventCategory:e,eventAction:c[t]+s(n)};void 0!==o&&(l.eventLabel=s("string"==typeof o?o:o.toString())),a(l)}},18818:function(e,t,n){n.d(t,{sM:function(){return Z},h4:function(){return eL},ar:function(){return L}});var o=n(57437),l=n(2265),i=n(3455),s=n(26094),a=n(32833),r=n(34734),c=n(61810),u=n(682),d=n(63919);let p=(0,d.g)("navigation","sc"),h=Object.freeze({navigation:`${p}`,navigationOpening:`${p}--opening`,navigationClosing:`${p}--closing`,wrapper:`${p}__wrapper`,container:`${p}__container`,containerOpen:`${p}__container--open`,sections:`${p}__sections`,sectionsOpen:`${p}__sections--open`,citySelectButton:`${p}__city-select-button`,sectionsTitle:`${p}__sections-title`,sectionsWrapper:`${p}__sections-wrapper`,section:`${p}__section`,sectionArrow:`${p}__section-arrow`,sectionExtra:`${p}__section--extra`,sectionActive:`${p}__section--active`,sectionTitle:`${p}__section-title`,chatWrapper:`${p}__chat-wrapper`,chatHeader:`${p}__chat-header`,backButton:`${p}__back-button`,useful:`${p}__useful`,usefulOpen:`${p}__useful--open`,usefulTitle:`${p}__useful-title`,usefulGrid:`${p}__useful-grid`,removed:`${p}__removed`}),m=(e,t,n)=>{(0,i.h)({eventCategory:"finkit-widgets-sc-navigation",eventActionType:e,eventActionText:t,eventLabel:n})},v=(0,d.g)("navigation-chips","sc"),g=Object.freeze({wrapper:`${v}__wrapper`,gray:`${v}__variantGray`,white:`${v}__variantWhite`,container:`${v}__container`,chip:`${v}__chip`,more:`${v}__chip--more`,active:`${v}__chip--active`,label:`${v}__label`,hidden:`${v}__hidden`}),f=(0,d.g)("navigation-content","sc"),w=Object.freeze({contentWrapper:`${f}__content-wrapper`,content:`${f}__content`,contentOpen:`${f}__content--open`,contentHeader:`${f}__content-header`,contentTitle:`${f}__content-title`,contentTitleUrl:`${f}__content-title--url`,contentTitleLink:`${f}__content-title--link`,contentTitleNew:`${f}__content-title--new`,new:`${f}__new`,vip:`${f}__vip`,arrowIcon:`${f}__arrow-icon`,links:`${f}__links`,linksColumns:`${f}__links--columns`,linksTitleless:`${f}__links--titleless`,removed:`${f}__removed`,hidden:`${f}__content--hidden`}),_=({chip:e,hidden:t,onClick:n,refCallback:l,activeChipId:a})=>{let c=!!n,u=()=>{if(c)return null==n?void 0:n(e.url);m(i.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:g.label,children:e.title}),e.arrow&&(0,o.jsx)(s.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,r.Z)(g.chip,{[g.hidden]:t,[w.new]:!!e.new,[w.vip]:!!e.vip,[g.active]:e.url===a});return c?(0,o.jsx)("button",{type:"button",className:p,onClick:u,ref:l,children:d}):(0,o.jsx)("a",{href:e.url,className:p,onClick:u,ref:l,children:d})},x=({items:e=[],maxNumberOfLines:t,variant:n,className:a,activeChipId:c,onClick:u})=>{let d=(0,l.useRef)(null),p=(0,l.useRef)(null),h=(0,l.useRef)({}),[v,f]=(0,l.useState)(!1),[w,x]=(0,l.useState)(e.length),[b,j]=(0,l.useState)(!1);(0,l.useMemo)(()=>{let t=h.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(n=>{e.find(e=>String(e.url)===String(n))||delete t[n]})},[e]);let C=(0,l.useCallback)(()=>{let n=d.current;if(!n)return;let o=e=>e?e.getBoundingClientRect().width:0,l=o(n),i=Math.max(Number(t)||0,0),s=()=>{x(e.length),j(!1)};if(v||0===i||l<=0){s();return}let a=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),r=o(p.current),c=e.map(e=>o(h.current[e.url]));if(c.some(e=>0===e)){s();return}let u=1,m=0,g=0;for(let e of c){let t=u===i?r+a:0,n=0===m?e:m+a+e;if(n+t<=l-.5)m=n,g++;else{if(++u>i)break;m=e,g++}}j(g<e.length),x(g)},[v,e,t]);(0,l.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(C)});return t.observe(e),requestAnimationFrame(C),()=>{t.disconnect()}},[C]),(0,l.useEffect)(()=>{requestAnimationFrame(C)},[C]);let k=v||(t??0)<=0||!b;return(0,o.jsx)("div",{className:(0,r.Z)(a,g.wrapper,{[g.gray]:"gray"===n,[g.white]:"white"===n}),children:(0,o.jsxs)("div",{ref:d,className:g.container,children:[e.map((e,t)=>(0,o.jsx)(_,{chip:e,hidden:!k&&t>=w,activeChipId:c,onClick:u,refCallback:t=>{h.current[e.url]=t}},e.url)),!k&&b&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,r.Z)(g.chip,g.more),onClick:()=>{m(i.D.chip,"Еще"),f(!0)},children:[(0,o.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:g.label,children:"Еще"})]}),(k||!b)&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,r.Z)(g.chip,g.more,g.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,o.jsx)(s.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:g.label,children:"Еще"})]})]})})};var b=n(24866);let j=function(e){if(typeof window>"u"||!window.localStorage)return null;let t=window.localStorage.getItem(e);if(!t||"undefined"===t)return null;try{return JSON.parse(t)}catch(t){console.warn('Invalid object in localStorage for key "'.concat(e,'": ').concat(t))}return null},C=()=>{if(typeof window>"u")return[];if(Array.isArray(window.allRegions)&&window.allRegions.length>0)return window.allRegions;let e=j("all_regions")||[];return window.allRegions=e,e},k=e=>{let t={};return e.map(e=>{let{id:n,name:o,towns:l}=e;return l.forEach(e=>{e.parentId=n,t[e.name]=t[e.name]||{},t[e.name][e.id]=o}),l}).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},y=async()=>{let e={regions:[]};try{e=await (await fetch("https://finuslugi.ru/money_data/Root.json?short=1")).json()}catch(e){console.warn(e)}let t=null!=e&&e.regions?e.regions:[];return t.length<1?[]:(window.allRegions=t,window.localStorage.setItem("all_regions",JSON.stringify(t)),window.localStorage.setItem("lastRegionsUpdateUnixTimestamp",JSON.stringify(Date.now())),t)},N=async e=>{let t=null;try{t=await (await fetch("".concat(e),{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},O=(e,t,n)=>{(0,i.h)({eventCategory:A,eventActionType:e,eventActionText:t,eventLabel:n})},T=C(),S=k(T),I={regions:T,towns:S,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},A="finkit-widgets-sc-city-select",$=(0,l.createContext)(I);function L(){return(0,l.useContext)($)}let Z=e=>{let{children:t,showStartGeoPopup:n=!0,lastRegionsUpdateUnixTimestamp:s,dadataUrl:a="https://finuslugi.ru/backend/money/dadata"}=e,r=Number(j("lastRegionsUpdateUnixTimestamp")||0),c=Number(s||0)>r,[u,d]=(0,l.useState)(C()),[{startRegion:p,startTown:h},m]=(0,l.useState)({startRegion:I.startRegion,startTown:I.startTown}),[{region:v,town:g},f]=(0,l.useState)({region:I.region,town:I.town}),[w,_]=(0,l.useState)(I.startPopupVisible),[x,b]=(0,l.useState)(I.popupVisible),T=(0,l.useRef)(""),S=(0,l.useMemo)(()=>k(u),[u.length]),A=(0,l.useCallback)((e,t)=>{window.sessionStorage.setItem("start_popup_opened","1"),window.localStorage.setItem("auto_town",JSON.stringify(t)||""),window.localStorage.setItem("auto_region",JSON.stringify(e)||""),_(!0),m({startRegion:e,startTown:t})},[_,m]),L=(0,l.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||A(e,t)},[A]),Z=(0,l.useCallback)(()=>{if(T.current&&!v&&!g){var e,t;let n=null!==(e=S.find(e=>e.name===T.current))&&void 0!==e?e:null;return L(null!==(t=u.find(e=>e.id===(null==n?void 0:n.parentId)))&&void 0!==t?t:null,n)}L(v,g)},[v,g,S,u,L]),R=(0,l.useCallback)(e=>{b(e)},[b]),M=(0,l.useCallback)(e=>{e?O(i.D.icon,"location"):O(i.D.button,(null==g?void 0:g.name)||"Вся Россия"),!n||window.sessionStorage.getItem("start_popup_opened")?R(!0):Z()},[n,g,R,Z]),E=(0,l.useCallback)((e,t)=>{e||t?(window.localStorage.setItem("all_russia_selected","0"),window.localStorage.setItem("user_region",JSON.stringify(e)||""),window.localStorage.setItem("user_town",JSON.stringify(t)||"")):(window.localStorage.setItem("all_russia_selected","1"),window.localStorage.setItem("user_region",""),window.localStorage.setItem("user_town","")),f({region:e||null,town:t||null}),_(!1),R(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[R]),P=()=>{f({region:j("user_region"),town:j("user_town")});let e=async e=>{let{coords:{latitude:t,longitude:n}}=e,o="".concat(a,"?lat=").concat(t,"&lon=").concat(n),l=await N(o);null!=l&&l.location&&(T.current=l.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&n)try{navigator.geolocation.getCurrentPosition(e,()=>null)}catch(e){}};return(0,l.useEffect)(()=>{if((u.length<1||c)&&y().then(e=>d(e)),window.innerWidth<1024){let e=()=>{P(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{P()},0)},[]),(0,o.jsx)($.Provider,{value:{regions:u,towns:S,region:v,town:g,startPopupVisible:w,setStartPopupVisible:_,popupVisible:x,handleToggleModal:R,selectCity:E,handleButtonClick:M,startRegion:p,startTown:h},children:t})},R=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:186,height:48,fill:"none",...e},l.createElement("path",{fill:"#FF0508",d:"M90 0H31v21H0v27h90V0Z"}),l.createElement("path",{fill:"#FFF",d:"m44.97 9.66-.63.03c-2.44.13-3.95 1.64-3.95 4.12 0 2.41 1.48 4.08 3.95 4.21l.63.03V9.66Zm0 12.07v-1.16l-.63-.03c-4.1-.19-6.63-2.57-6.63-6.72 0-4.4 2.6-6.43 6.63-6.62l.63-.03V6h2.7v1.15l.64.03c4.13.19 6.66 2.15 6.66 6.63 0 4.15-2.53 6.53-6.66 6.72l-.64.03v1.15h-2.7v.02Zm2.69-3.67.64-.03c2.41-.12 3.97-1.86 3.97-4.21 0-2.41-1.56-3.99-3.97-4.11l-.64-.03v8.38Zm.19 21.2h1.57c.51 0 .93-.22 1.09-.64L45.9 27.59h3.02l3.11 8.52h.51l3.07-8.52h2.95l-4.2 10.16c-.95 2.32-2.33 3.89-5.03 3.89h-1.48v-2.38Zm9.39-18.4V6.8h2.79v11.52h.51L63.71 6.8h5.22v14.06h-2.78V9.31h-.52l-3.07 11.55h-5.32Zm14.03 20.78V27.58h2.79V39.1h.51l3.17-11.52H83v14.06h-2.79V30.12h-.51l-3.11 11.52h-5.32Zm-43.6-4.8 2.79.39c-.71 2.99-3.05 4.77-6.09 4.77-4.52 0-6.63-3.31-6.63-7.44 0-4.21 2.24-7.33 6.76-7.33 2.76 0 4.87 1.35 5.83 3.96l-2.66 1.19c-.61-1.45-1.63-2.57-3.3-2.57-2.78 0-3.75 2.28-3.75 4.76 0 2.51 1.02 4.86 3.88 4.86 1.7-.01 2.76-1.01 3.17-2.59Zm44.15-15.98V6.8h2.78v5.69h5.6V6.8h2.79v14.06H80.2v-5.82h-5.6v5.82h-2.78ZM31.39 41.64v-2.71h.87c1.22 0 1.66-.68 1.7-2.67l.16-8.62v-.07h9.81v14.06h-2.77V30.12h-4.42l-.13 5.95c-.1 3.89-1.31 5.57-4.04 5.57h-1.18Zm29.15 0V27.58h8.91v2.54h-6.12v11.52h-2.79ZM6.95 39.26h1.56c.52 0 .93-.22 1.09-.64L5 27.59h3.01l3.11 8.52h.51l3.07-8.52h2.95l-4.19 10.16c-.96 2.32-2.34 3.89-5.04 3.89H6.95v-2.38Z"}),l.createElement("path",{d:"M102.13 13.43c1.54 0 2.56-1.16 2.56-3.07s-1.02-3.07-2.56-3.07h-.12c-1.55 0-2.56 1.16-2.56 3.07s1.01 3.07 2.56 3.07h.12ZM102.07 6c2.36-.03 4.09 1.68 4.07 4.36.02 2.68-1.71 4.39-4.07 4.36-2.37.03-4.1-1.68-4.07-4.36-.03-2.68 1.7-4.39 4.07-4.36Zm7.45 1.42h-2.98V6.11h7.41v1.31h-2.98v7.19h-1.45V7.42Zm-1.87 12.39v8.49h-1.43v-7.03l-2.28 7.03h-1.69l-2.34-7.02v7.02h-1.43v-8.49h2.32l2.31 6.96 2.24-6.96h2.3Zm5.78 7.31c1.55 0 2.56-1.16 2.56-3.07 0-1.9-1.01-3.06-2.56-3.06h-.12c-1.54 0-2.55 1.16-2.55 3.06 0 1.91 1.01 3.07 2.55 3.07h.12Zm-.06-7.43c2.37-.03 4.09 1.69 4.07 4.36.02 2.68-1.7 4.4-4.07 4.37-2.37.03-4.1-1.69-4.07-4.37-.03-2.67 1.7-4.39 4.07-4.36Zm9.28 0c2.01-.02 3.39 1.21 3.49 2.86h-1.46c-.07-.49-.29-.86-.64-1.14-.35-.28-.79-.42-1.33-.42h-.12c-1.53-.03-2.54 1.26-2.53 3.06-.01 1.81 1 3.1 2.53 3.07h.12c.54 0 .98-.13 1.33-.41.35-.28.57-.65.64-1.15h1.46c-.1 1.68-1.48 2.88-3.49 2.86-2.5.02-4.06-1.81-4.04-4.37-.02-2.54 1.54-4.39 4.04-4.36Zm7.81 4.7-1.27 1.32v2.59h-1.46v-8.49h1.46v3.98l3.85-3.98h1.83l-3.37 3.5 3.44 4.99h-1.81l-2.67-3.91Zm8.79 2.73c1.55 0 2.56-1.16 2.56-3.07 0-1.9-1.01-3.06-2.56-3.06h-.11c-1.55 0-2.56 1.16-2.56 3.06 0 1.91 1.01 3.07 2.56 3.07h.11Zm-.05-7.43c2.36-.03 4.08 1.69 4.06 4.36.02 2.68-1.7 4.4-4.06 4.37-2.37.03-4.11-1.69-4.08-4.37-.03-2.67 1.71-4.39 4.08-4.36Zm9.33 7.31c.85 0 1.38-.42 1.38-1.19 0-.76-.53-1.18-1.38-1.18h-2.16V27h2.16Zm-.1-3.64c.81 0 1.29-.41 1.29-1.13 0-.71-.48-1.12-1.29-1.12h-2.06v2.25h2.06Zm-3.52-3.55h3.73c1.49-.02 2.56.95 2.54 2.22 0 .48-.13.9-.39 1.24-.26.35-.61.59-1.03.73.93.17 1.6.91 1.6 2.03.02 1.29-1.14 2.29-2.59 2.27h-3.86v-8.49Zm11.69-.12c2.01-.02 3.4 1.21 3.49 2.86h-1.46c-.07-.49-.29-.86-.64-1.14-.35-.28-.79-.42-1.33-.42h-.12c-1.53-.03-2.54 1.26-2.52 3.06-.02 1.81.99 3.1 2.52 3.07h.12c.54 0 .98-.13 1.34-.41.34-.28.56-.65.63-1.15h1.46c-.1 1.68-1.47 2.88-3.49 2.86-2.5.02-4.06-1.81-4.03-4.37-.03-2.54 1.53-4.39 4.03-4.36Zm7.81 4.7-1.27 1.32v2.59h-1.46v-8.49h1.46v3.98l3.85-3.98h1.83l-3.36 3.5 3.43 4.99h-1.81l-2.67-3.91Zm8.8 2.73c1.54 0 2.55-1.16 2.55-3.07 0-1.9-1.01-3.06-2.55-3.06h-.12c-1.55 0-2.56 1.16-2.56 3.06 0 1.91 1.01 3.07 2.56 3.07h.12Zm-.06-7.43c2.36-.03 4.09 1.69 4.06 4.36.03 2.68-1.7 4.4-4.06 4.37-2.37.03-4.11-1.69-4.08-4.37-.03-2.67 1.71-4.39 4.08-4.36Zm8.29-2.17c.05.47.4.71.94.71.54 0 .91-.24.96-.71h1.19c-.02 1.07-.78 1.65-2.15 1.65-1.37 0-2.11-.58-2.13-1.65h1.19Zm4.56 2.29v8.49h-1.45v-6.6l-3.86 6.6h-1.82v-8.49h1.45v6.58l3.84-6.58H186ZM102.07 40.7c.85 0 1.4-.52 1.4-1.36 0-.84-.52-1.28-1.39-1.28h-2.14v2.64h2.13Zm-3.59-7.2h5.87l.01 1.31h-4.42v1.99h2.23c1.95 0 2.75 1.1 2.75 2.47.01 1.52-.89 2.74-2.66 2.72h-3.78V33.5Zm15.12 0v8.49h-1.45v-6.6l-3.86 6.6h-1.82V33.5h1.46v6.58l3.83-6.58h1.84Zm5.66 3.96c.95 0 1.46-.49 1.46-1.33 0-.83-.51-1.32-1.46-1.32h-2.07v2.65h2.07Zm-3.53-3.96h3.72c1.6-.02 2.74 1 2.72 2.63.02 1.64-1.12 2.65-2.72 2.64h-2.26v3.22h-1.46V33.5Zm14.85 4.35-1.43 1.69v2.45h-1.41v-2.44l-1.51-1.68-2.28 4.12h-1.74l2.96-5.27-2.74-3.22h1.69l3.62 4.23V33.5h1.41v4.24l3.64-4.24h1.68l-2.8 3.26 3 5.23h-1.72l-2.37-4.14Zm12.36-4.35v8.49h-1.45v-6.6l-3.86 6.6h-1.82V33.5h1.46v6.58l3.83-6.58h1.84Z",fill:"#1F242E"})),M=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 88 48",...e},l.createElement("path",{fill:"#FF0508",d:"M90 0H31v21H0v27h90V0Z"}),l.createElement("path",{fill:"#FFF",d:"m44.97 9.66-.63.03c-2.44.13-3.95 1.64-3.95 4.12 0 2.41 1.48 4.08 3.95 4.21l.63.03V9.66Zm0 12.07v-1.16l-.63-.03c-4.1-.19-6.63-2.57-6.63-6.72 0-4.4 2.6-6.43 6.63-6.62l.63-.03V6h2.7v1.15l.64.03c4.13.19 6.66 2.15 6.66 6.63 0 4.15-2.53 6.53-6.66 6.72l-.64.03v1.15h-2.7v.02Zm2.69-3.67.64-.03c2.41-.12 3.97-1.86 3.97-4.21 0-2.41-1.56-3.99-3.97-4.11l-.64-.03v8.38Zm.19 21.2h1.57c.51 0 .93-.22 1.09-.64L45.9 27.59h3.02l3.11 8.52h.51l3.07-8.52h2.95l-4.2 10.16c-.95 2.32-2.33 3.89-5.03 3.89h-1.48v-2.38Zm9.39-18.4V6.8h2.79v11.52h.51L63.71 6.8h5.22v14.06h-2.78V9.31h-.52l-3.07 11.55h-5.32Zm14.03 20.78V27.58h2.79V39.1h.51l3.17-11.52H83v14.06h-2.79V30.12h-.51l-3.11 11.52h-5.32Zm-43.6-4.8 2.79.39c-.71 2.99-3.05 4.77-6.09 4.77-4.52 0-6.63-3.31-6.63-7.44 0-4.21 2.24-7.33 6.76-7.33 2.76 0 4.87 1.35 5.83 3.96l-2.66 1.19c-.61-1.45-1.63-2.57-3.3-2.57-2.78 0-3.75 2.28-3.75 4.76 0 2.51 1.02 4.86 3.88 4.86 1.7-.01 2.76-1.01 3.17-2.59Zm44.15-15.98V6.8h2.78v5.69h5.6V6.8h2.79v14.06H80.2v-5.82h-5.6v5.82h-2.78ZM31.39 41.64v-2.71h.87c1.22 0 1.66-.68 1.7-2.67l.16-8.62v-.07h9.81v14.06h-2.77V30.12h-4.42l-.13 5.95c-.1 3.89-1.31 5.57-4.04 5.57h-1.18Zm29.15 0V27.58h8.91v2.54h-6.12v11.52h-2.79ZM6.95 39.26h1.56c.52 0 .93-.22 1.09-.64L5 27.59h3.01l3.11 8.52h.51l3.07-8.52h2.95l-4.19 10.16c-.96 2.32-2.34 3.89-5.04 3.89H6.95v-2.38Z"})),E=()=>{let e=(0,l.useRef)(null),t=(0,l.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,l.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,l.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},P=(0,d.g)("city-select-modal-body","sc"),z=Object.freeze({wrapper:"".concat(P,"__wrapper"),subtitle:"".concat(P,"__subtitle"),hintWrapper:"".concat(P,"__hint-wrapper"),hintText:"".concat(P,"__hint-text"),input:"".concat(P,"__input"),chips:"".concat(P,"__chips"),townsListWrapper:"".concat(P,"__towns-list-wrapper"),townsList:"".concat(P,"__towns-list"),townsGroup:"".concat(P,"__towns-group"),townsGroupLabel:"".concat(P,"__towns-group-label"),townsGroupList:"".concat(P,"__towns-group-list"),townsName:"".concat(P,"__towns-name"),regionName:"".concat(P,"__region-name")}),F=e=>{var t;let{groupedTowns:n,chips:a,query:r,setQuery:u,isDrawer:d}=e,p=L(),h=(0,l.useRef)(null),[m,v]=(0,l.useState)("10000px");(0,l.useEffect)(()=>{if(!d||!h.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,o)=>{let l=n.map(e=>[...e]),i=l.map(e),s=i.reduce((e,t,n)=>t<i[e]?n:e,0);0===s&&l[0].push(l[1].shift()),2===s&&l[2].unshift(l[1].pop()),1===s&&i[0]>i[2]&&l[1].unshift(l[0].pop()),1===s&&i[0]<i[2]&&l[1].push(l[2].shift());let a=Math.max(...l.map(e));return a>=o?o:t(l,a)};new ResizeObserver(()=>{var e;if(!(null!=(e=h.current)&&e.children))return;let n=Array.from(h.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let o=0;try{o=t([[],n,[]],1/0)}catch(e){o=0}o>0&&v("".concat(o,"px"))}).observe(h.current)},[]);let g=e=>{if(O(i.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return p.selectCity();let t=p.regions.find(t=>t.id===Number(e.parentId))||null;p.selectCity(t,e)};return(0,o.jsxs)("div",{className:z.wrapper,children:[(0,o.jsxs)("div",{className:z.subtitle,children:["Покажем предложения рядом с вами",(0,o.jsxs)("div",{className:z.hintWrapper,children:[(0,o.jsx)(s.IconFdsQuestionCircleO,{size:24}),(0,o.jsx)("div",{className:z.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,o.jsx)(c.MA,{className:z.input,value:r,onChange:u,size:"s",placeholder:"Введите название города",icon:r?(0,o.jsx)(s.IconFdsCloseCircleO,{size:24,onClick:()=>u("")}):(0,o.jsx)(s.IconFdsSearchO,{size:24})}),(0,o.jsx)(c.cL,{className:z.chips,chips:a,value:(null==(t=p.town)?void 0:t.id)||0,onChipClick:e=>{g(p.towns.find(t=>t.id===e))}}),(0,o.jsx)("div",{className:z.townsListWrapper,children:(0,o.jsx)("div",{ref:h,className:z.townsList,style:{maxHeight:m},children:n.map(e=>(0,o.jsxs)("div",{className:z.townsGroup,children:[(0,o.jsx)("div",{className:z.townsGroupLabel,children:e.letter}),(0,o.jsx)("div",{className:z.townsGroupList,children:e.towns.map(e=>(0,o.jsxs)("button",{type:"button",onClick:()=>g(e),children:[(0,o.jsx)("div",{className:z.townsName,children:e.name}),(0,o.jsx)("div",{className:z.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},V=[1095,1096,134,720,189,180],B=()=>{var e;let t=L(),n=(0,c._m)("l"),[s,a]=(0,l.useState)(""),r="Ваш выбор: ".concat((null==(e=t.town)?void 0:e.name)||"Вся Россия"),d=(0,l.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(s.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[s,t.towns.length]),p=(0,l.useMemo)(()=>[{id:0,label:"Вся Россия"},...V.map(e=>{let n=t.towns.find(t=>t.id===e);return{id:null==n?void 0:n.id,label:null==n?void 0:n.name}}).filter(e=>(null==e?void 0:e.id)!==void 0)],[t.towns.length]),h=()=>{O(i.D.button,"close"),t.handleToggleModal(!1)};return(0,o.jsxs)(u.P,{children:[!n&&(0,o.jsx)(u.U,{title:r,isOpen:t.popupVisible,onClose:h,full:!0,children:(0,o.jsx)(F,{groupedTowns:d,chips:p,query:s,setQuery:a})}),n&&(0,o.jsx)(u.D,{title:r,isOpen:t.popupVisible,onClose:h,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,o.jsx)(F,{groupedTowns:d,chips:p,query:s,setQuery:a,isDrawer:!0})})]})},D=(0,d.g)("header","sc"),W=Object.freeze({header:"".concat(D),fixed:"".concat(D,"__fixed"),hidden:"".concat(D,"__fixed--hidden"),transparent:"".concat(D,"--transparent"),navigationOpen:"".concat(D,"__navigation-open"),container:"".concat(D,"__container"),leftRow:"".concat(D,"__left-row"),logo:"".concat(D,"__logo"),logoMobile:"".concat(D,"__logo-mobile"),logoDesk:"".concat(D,"__logo-desk"),menuItems:"".concat(D,"__menu-items"),menuItemActive:"".concat(D,"__menu-item-active"),tabletMenuButton:"".concat(D,"__tablet-menu-button"),buttonGroup:"".concat(D,"__button-group"),chips:"".concat(D,"__chips"),menuButton:"".concat(D,"__menu-button"),moreButtons:"".concat(D,"__more-buttons"),auth:"".concat(D,"__auth"),close:"".concat(D,"__close"),removed:"".concat(D,"__removed"),overlay:"".concat(D,"__overlay"),overlayOpening:"".concat(D,"__overlay--opening"),overlayClosing:"".concat(D,"__overlay--closing")}),U="finkit-widgets-sc-header",H=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],G=H.reduce((e,t)=>(e[t.id]=t.label,e),{}),J=e=>{let{label:t,onClick:n,eventActionText:l,eventLabel:s,...a}=e;return(0,o.jsx)(c.zx,{label:t,onClick:e=>{null==n||n(e),(0,i.h)({eventCategory:U,eventActionType:i.D.button,eventActionText:l||"",eventLabel:s||""})},...a})},q=(0,d.g)("header-popup","sc"),Q=Object.freeze({popup:"".concat(q,"__popup"),popupHeader:"".concat(q,"__popup-header"),popupClose:"".concat(q,"__popup-close"),body:"".concat(q,"__body")}),Y=e=>{let{isOpen:t,onClose:n,children:l,title:i}=e,a=(0,c._m)("l");return(0,o.jsxs)(u.P,{children:[!a&&(0,o.jsx)(u.U,{title:i,isOpen:t,onClose:n,children:l}),a&&t&&(0,o.jsxs)("div",{className:Q.popup,children:[(0,o.jsxs)("div",{className:Q.popupHeader,children:[i,(0,o.jsx)(J,{className:Q.popupClose,iconLeft:(0,o.jsx)(s.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:n,eventActionText:"IconFdsCloseO"})]}),(0,o.jsx)("div",{className:Q.body,children:l})]})]})},K=(0,d.g)("start-choice-popup","sc"),X=Object.freeze({top:"".concat(K,"__top"),progress:"".concat(K,"__progress"),innerCircle:"".concat(K,"__inner-circle"),title:"".concat(K,"__title"),subtitle:"".concat(K,"__subtitle"),actions:"".concat(K,"__actions")}),ee=()=>{var e,t;let n=L(),[s,a]=(0,l.useState)(10),[r,c]=(0,l.useState)(0),u=(0,l.useRef)(void 0),d=()=>{O(i.D.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(n.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(n.startRegion)||""),n.setStartPopupVisible(!1)};return(0,l.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+s).slice(1)),t=1e3*e/100,n=0,o=0;u.current=setInterval(()=>{n++,o+=t,c(3.6*n);let l=e-Math.floor(o/1e3);l<s&&a(l),100===n&&(clearInterval(u.current),d())},t)})():(clearInterval(u.current),a(10),c(0))},[n.startPopupVisible]),(0,o.jsxs)(Y,{isOpen:n.startPopupVisible,onClose:d,title:(0,o.jsx)("button",{type:"button",className:X.progress,style:{background:"conic-gradient(#ff0508 ".concat(r,"deg, #e3e7ec 0deg)")},onClick:d,children:(0,o.jsx)("div",{className:X.innerCircle,children:s})}),children:[(0,o.jsxs)("div",{className:X.top,children:[(0,o.jsxs)("div",{className:X.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,o.jsx)("div",{className:X.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,o.jsxs)("div",{className:X.actions,children:[(0,o.jsx)(J,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{O(i.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,o.jsx)(J,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{O(i.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},et=(0,d.g)("city-select","sc"),en=Object.freeze({button:"".concat(et,"__button")}),eo=e=>{var t;let{initialTown:n}=e,l=L(),i=(null==(t=l.town)?void 0:t.name)||n||"Вся Россия";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.zx,{className:en.button,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>l.handleButtonClick(!1),iconLeft:(0,o.jsx)(s.IconFdsLocationO,{size:16}),label:i}),(0,o.jsx)(B,{}),(0,o.jsx)(ee,{})]})},el={"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"},ei=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(el,e)?el[e]:el["finuslugi.ru"]},es=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href="".concat(e,"/assets/css/").concat(t),document.head.appendChild(n);let o=document.createElement("script");o.src="".concat(e,"/get-bootstrap/").concat(t),o.defer=!0,document.body.appendChild(o)},ea=()=>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)}})}),er=()=>{let[e,t]=(0,l.useState)(!1),[n,o]=(0,l.useState)(!1),i=(0,l.useRef)(!1),s=e=>{i.current=e,o(e)};return(0,l.useEffect)(()=>{if(typeof window>"u")return;let e=ei(),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 o=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((l,a)=>{if(i.current){a(Error("chat is already opened"));return}o?(o.openWidget(),t(!1),l()):(s(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;o=e;let i=document.querySelector(".webchat");i&&ea().observe(i,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=o.closeWidget),null==o||o.openWidget(),s(!1),t(!1),l()},es(e,n))}),window.supportWidget.craftTalk.toggle=()=>{var e,t,n,o;null!=(t=null==(e=window.supportWidget)?void 0:e.craftTalk)&&t.isOpened?window.supportWidget.craftTalk.close():null==(o=null==(n=window.supportWidget)?void 0:n.craftTalk)||o.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:t,isChatLoading:n}},ec=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let o=document.getElementById("mainHomeBanner"),l=!1,i=0;window.addEventListener("scroll",function(){let s=window.scrollY||document.documentElement.scrollTop,a=window.innerWidth<768?55:80,r=s<((null==o?void 0:o.clientHeight)||0);if(n&&r||s<a){l=!1,e(!1),t(!0);return}l=s>i,e(s>i),l&&setTimeout(()=>t(!1),50);let c=l?"0px":"";document.documentElement.style.setProperty("--new-header-height-desktop",c),document.documentElement.style.setProperty("--new-header-height-mobile",c),i=s<=0?0:s})},eu=()=>{let e=new URLSearchParams(window.location.search),t={};for(let[n,o]of Array.from(e.entries()))n.startsWith("utm_")&&(t[n]=o);return Object.keys(t).length>0?t:null},ed=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),ep=(e,t)=>{let n=new Date;n.setTime(n.getTime()+864e5*t);let o=encodeURIComponent(JSON.stringify(e));document.cookie="utm_params=".concat(o,";expires=").concat(n.toUTCString(),";path=/;SameSite=Lax")},eh=()=>{if(ed())return;let e=eu();e&&ep(e,90)},em=()=>{setTimeout(()=>{if(!(typeof document>"u"||!document.cookie))try{eh()}catch(e){console.error("UTM tracking error:",e)}},0)},ev=(e,t,n)=>(0,i.h)({eventCategory:U,eventActionType:e,eventActionText:t,eventLabel:n}),eg=(0,l.createContext)({isAuth:!1,isHeaderHidden:!1,isHeaderTransparent:!1,openedBlock:null,setOpenedBlock:()=>null,openedSection:null,setOpenedSection:()=>null,isNavigationOpen:!1,isNavigationMounted:!1,navMenuItemsRef:{current:null},navigationRef:{current:null},ignoreClicks:!1,setIgnoreClicks:()=>null,isChatModalOpen:!1,setIsChatModalOpen:()=>null,isChatLoading:!1});function ef(){return(0,l.useContext)(eg)}let ew=e=>{let[t,n]=(0,l.useState)(!1),[i,s]=(0,l.useState)(!1),[a,r]=(0,l.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:d,isChatLoading:p}=er(),[h,m]=(0,l.useState)(null),[v,g]=(0,l.useState)(null),[f,w]=(0,l.useState)(!1),[_,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),C=(0,l.useRef)(null),k=(0,u.u)(f),y=(0,l.useRef)(null),N=(0,l.useRef)(null),O=(0,l.useCallback)(()=>{k.current&&k.current.scrollTo({top:0})},[k]),T=(0,l.useCallback)(e=>{g(e),O()},[O]),S=(0,l.useCallback)(e=>{y.current&&clearTimeout(y.current),e&&x(!0),e||(y.current=setTimeout(()=>{x(!1),T(null)},300))},[T]),I=(0,l.useCallback)((e,t,n)=>{if(t&&T(t),!n&&e===h||!e){S(!f),w(!f);return}m(e),S(!0),w(!0)},[h,T,f,S]),A=(0,l.useCallback)(()=>{N.current&&clearTimeout(N.current),j(!0),N.current=setTimeout(()=>{j(!1)},650)},[]);return(0,l.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id")),ec(s,r,e.isMainBannerPage),em()},[]),(0,o.jsx)("div",{children:(0,o.jsx)(eg.Provider,{value:{isAuth:t,isHeaderHidden:i,isHeaderTransparent:a,openedBlock:h,setOpenedBlock:I,openedSection:v,setOpenedSection:T,isNavigationOpen:f,isNavigationMounted:_,navMenuItemsRef:C,navigationRef:k,ignoreClicks:b,setIgnoreClicks:A,isChatModalOpen:c,setIsChatModalOpen:d,isChatLoading:p},children:e.children})})},e_=(0,d.g)("header-chat-modal-body","sc"),ex=Object.freeze({wrapper:"".concat(e_,"__wrapper"),cardButton:"".concat(e_,"__card-button"),card:"".concat(e_,"__card"),cardTitle:"".concat(e_,"__card-title"),cardSubtitle:"".concat(e_,"__card-subtitle"),button:"".concat(e_,"__button")}),eb=()=>{let e=ef();return(0,o.jsxs)("div",{className:ex.wrapper,children:[(0,o.jsx)(J,{className:ex.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,o.jsxs)(a.Zb,{className:ex.card,variant:"secondary",children:[(0,o.jsxs)("div",{className:ex.cardTitle,children:[(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat"}),"Напишите в чат"]}),(0,o.jsxs)("p",{className:ex.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,o.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),(0,o.jsx)(J,{as:"a",href:"https://finuslugi.ru/landing/fingpt",target:"_blank",className:ex.button,variant:"secondary",size:"s",iconLeft:(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/robot_icon_hover.svg",alt:"robot"}),eventActionText:"Новости от ФинGPT",children:"Новости от ФинGPT"})]})},ej=(0,d.g)("header-chat-modal","sc"),eC=Object.freeze({wrapper:"".concat(ej,"__wrapper")}),ek=()=>{let e=ef();return(0,o.jsx)(u.P,{children:(0,o.jsx)(Y,{isOpen:e.isChatModalOpen,onClose:()=>e.setIsChatModalOpen(!1),title:"Нужна помощь?",children:(0,o.jsx)("div",{className:eC.wrapper,children:(0,o.jsx)(eb,{})})})})},ey=e=>{let{onClick:t,eventActionType:n,eventActionText:l,eventLabel:s,...a}=e;return(0,o.jsx)(c.rU,{onClick:e=>{null==t||t(e),(0,i.h)({eventCategory:U,eventActionType:n||i.D.link,eventActionText:l||"",eventLabel:s||""})},...a})},eN=e=>{let{data:t,isMobile:n}=e,a=ef();return(0,o.jsx)("div",{className:w.contentWrapper,children:t.map(e=>(0,o.jsx)(l.Fragment,{children:e.sections.map(e=>(0,o.jsxs)("div",{className:(0,r.Z)(w.content,{[w.hidden]:a.openedSection!==e.id,[w.contentOpen]:!!a.openedSection}),children:[(0,o.jsx)("div",{className:w.contentHeader,children:(0,o.jsx)("label",{children:e.title})}),e.content.map((t,l)=>{var a,c;return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{children:(0,o.jsx)("a",{className:(0,r.Z)(w.contentTitle,{[w.removed]:!t.title,[w.contentTitleUrl]:!!t.url,[w.contentTitleLink]:!!e.isSeeAllLinkAvailable,[w.contentTitleNew]:!!t.new}),href:e.isSeeAllLinkAvailable?t.url:void 0,children:(0,o.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,o.jsx)("div",{className:w.arrowIcon,children:(0,o.jsx)(s.IconFdsArrowUpRightSmallO,{})}),t.title]})})}),!(null!=(a=t.links)&&a.length)&&(0,o.jsx)(x,{items:t.chips||[],maxNumberOfLines:e.content.length<=1?99:n?3:2}),!!(null!=(c=t.links)&&c.length)&&(0,o.jsx)("div",{className:(0,r.Z)(w.links,{[w.linksColumns]:!!t.columns,[w.linksTitleless]:!t.title}),children:t.links.map(e=>(0,o.jsxs)("a",{href:e.url,className:(0,r.Z)({[w.new]:!!e.new}),onClick:()=>m(i.D.link,e.title,"".concat(e.title,"_").concat(e.url)),children:[(0,o.jsx)("div",{className:w.arrowIcon,children:(0,o.jsx)(s.IconFdsArrowUpRightSmallO,{})}),(0,o.jsx)("span",{children:e.title})]},e.url))})]},"".concat(t.url,"_").concat(l))})]},e.id))},e.id))})},eO=(0,d.g)("navigation-section-icon","sc"),eT=Object.freeze({icon:"".concat(eO)}),eS=e=>{let{name:t,background:n}=e,i=(0,l.useMemo)(()=>t&&s[t]||null,[t]);return t&&i?(0,o.jsx)("div",{className:eT.icon,style:{background:n},children:(0,o.jsx)(i,{})}):null},eI=e=>{var t;let{data:n}=e,u=ef(),d=L(),p=(0,c.aF)("m"),[v,g]=(0,l.useState)(!0);(0,l.useEffect)(()=>{g(p)},[p]);let f=(0,l.useRef)(null),w=(0,l.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u.openedSection?u.setOpenedSection(null):u.isNavigationOpen?u.setOpenedBlock(null):void 0,50)},[u]),_=(0,l.useRef)(!1),x=(0,l.useRef)(null),b=(0,l.useCallback)(()=>{v&&(_.current=!0,x.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),w()},window.history.pushState(null,"",window.location.href))},[w,v]),j=(0,l.useCallback)(()=>{_.current=!1,window.onpopstate=x.current,window.history.go(-1)},[]),C=(0,l.useRef)(null),k=(0,l.useCallback)(e=>{if(v||!u.navMenuItemsRef.current||!u.navigationRef.current)return;let t=e.target,n=!u.navMenuItemsRef.current.contains(t)&&!u.navigationRef.current.contains(t);if(n&&!C.current){u.setIgnoreClicks(),C.current=setTimeout(()=>u.setOpenedBlock(null),300);return}!n&&C.current&&(clearTimeout(C.current),C.current=null)},[v,u]),y=(0,l.useRef)(null),N=(0,l.useCallback)(e=>{typeof window>"u"||(e?(y.current=k,window.addEventListener("mousemove",y.current)):y.current&&window.removeEventListener("mousemove",y.current))},[k]);(0,l.useEffect)(()=>{N(u.isNavigationOpen),u.isNavigationOpen&&!_.current&&b(),!u.isNavigationOpen&&_.current&&j()},[u.isNavigationOpen]);let O=(e,t)=>()=>{m(i.D.button,t),u.setOpenedSection(e)},{start:T,clear:S}=E(),I=(e,t)=>()=>{v||T(O(e,t),200)},A=()=>{v||S()};return(0,o.jsx)("div",{ref:u.navigationRef,className:(0,r.Z)(h.navigation,{[h.removed]:!u.isNavigationMounted,[h.navigationOpening]:u.isNavigationOpen,[h.navigationClosing]:!u.isNavigationOpen}),children:(0,o.jsx)("div",{className:h.wrapper,children:(0,o.jsxs)(a.W2,{className:(0,r.Z)(h.container,{[h.containerOpen]:!!u.openedSection}),children:[(0,o.jsxs)("div",{className:(0,r.Z)(h.sections,{[h.sectionsOpen]:!!u.openedSection}),children:[(0,o.jsx)(c.zx,{className:h.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>d.handleButtonClick(!1),iconLeft:(0,o.jsx)(s.IconFdsLocationO,{size:24}),label:(null==(t=d.town)?void 0:t.name)||"Вся Россия"}),n.map(e=>(0,o.jsxs)("ul",{className:(0,r.Z)(h.sectionsWrapper,{[h.removed]:u.openedBlock!==e.id&&!v}),children:[(0,o.jsx)("div",{className:h.sectionsTitle,children:G[e.id]}),e.sections.map(e=>(0,o.jsxs)("li",{className:(0,r.Z)(h.section,{[h.sectionExtra]:!!e.extra,[h.sectionActive]:u.openedSection===e.id}),onClick:O(e.id,e.title),onMouseEnter:I(e.id,e.title),onMouseLeave:A,children:[(0,o.jsx)(eS,{name:e.uikitIcon,background:e.uikitIconBg}),(0,o.jsx)("span",{className:h.sectionTitle,children:e.title}),(0,o.jsx)("div",{className:h.sectionArrow,children:(0,o.jsx)(s.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,o.jsxs)("div",{className:h.chatWrapper,children:[(0,o.jsx)("div",{className:h.chatHeader,children:"Нужна помощь?"}),(0,o.jsx)(eb,{})]})]}),(0,o.jsxs)("button",{type:"button",className:(0,r.Z)(h.backButton,{[h.removed]:!u.openedSection}),onClick:()=>{m(i.D.button,"Назад"),u.setOpenedSection(null)},children:[(0,o.jsx)(s.IconFdsChevronLeftO,{size:24}),(0,o.jsx)("span",{children:"Назад"})]}),(0,o.jsx)(eN,{data:n,isMobile:v}),(0,o.jsxs)("div",{className:(0,r.Z)(h.useful,{[h.usefulOpen]:!!u.openedSection}),children:[(0,o.jsx)("div",{className:h.usefulTitle,children:"Полезное на Финуслугах"}),n.map(e=>(0,o.jsx)(l.Fragment,{children:e.sections.map(e=>(0,o.jsx)("div",{className:(0,r.Z)(h.usefulGrid,{[h.removed]:u.openedSection!==e.id}),children:e.useful.map((e,t)=>(0,o.jsxs)("a",{href:e.url,onClick:()=>m(i.D.link,e.title,"".concat(e.title,"_").concat(e.url)),children:[(0,o.jsx)("div",{children:(0,o.jsx)("img",{src:e.icon,srcSet:e.icon2?"".concat(e.icon,", ").concat(e.icon2," 2x"):void 0,alt:"icon",loading:"lazy"})}),(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},"".concat(e.title,"_").concat(t)))},e.id))},e.id))]})]})})})},eA=(e,t,n)=>{var o,l,i;let s=(null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o.findIndex(e=>{let{id:t}=e;return"news"===t}))||-1,a=(null==(i=null==(l=null==e?void 0:e.NAVIGATOR)?void 0:l[s])?void 0:i.content)||[];if(e&&Array.isArray(n)&&a.length){let o=n.map(e=>{let{title:n,url:o}=e;return{title:n,url:(0,b.xn)(t||"",o),new:0}});e.NAVIGATOR[s].content[0].links=o}return[{id:"FINPRODUCTS",sections:(null==e?void 0:e.FINPRODUCTS)||[]},{id:"NAVIGATOR",sections:(null==e?void 0:e.NAVIGATOR)||[]},{id:"ABOUT",sections:(null==e?void 0:e.ABOUT)||[]}]},e$=e=>{let{data:t,showcaseUrl:n="https://finuslugi.ru",minioUrl:c="https://assets.finuslugi.ru/mp-assets",lkUrl:u="https://lk.finuslugi.ru/registration",initialTown:d,isMainBannerPage:p,news:h}=e,m=ef(),v=eA(t,n,h),g=(0,l.useMemo)(()=>v.reduce((e,t)=>(e[t.id]=t.sections[0].id,e),{}),[v]),f=m.isAuth?"Личный кабинет":"Войти",w=p&&m.isHeaderTransparent,_=(e,t,n,o)=>()=>{ev(i.D.toggle,t,String(e!==m.openedBlock));let l=n?g[e]:"";m.setOpenedBlock(e,l,!!o)},{start:x,clear:b}=E(),j=(e,t,n,o)=>()=>{m.isNavigationOpen&&e===m.openedBlock||m.setIgnoreClicks(),x(_(e,t,n,o),200)},C=e=>()=>{m.ignoreClicks||e()},k=e=>m.openedBlock===e&&m.isNavigationOpen;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("header",{className:(0,r.Z)(W.header,{[W.transparent]:w}),children:(0,o.jsx)("div",{className:(0,r.Z)(W.fixed,{[W.hidden]:m.isHeaderHidden,[W.navigationOpen]:m.isNavigationOpen}),children:(0,o.jsxs)(a.W2,{className:W.container,children:[(0,o.jsxs)("div",{className:W.leftRow,children:[(0,o.jsxs)(ey,{className:W.logo,href:n,eventActionType:i.D.icon,eventActionText:"finuslugi_logo",eventLabel:"finuslugi_logo_".concat(n),children:[(0,o.jsx)(M,{className:W.logoMobile}),(0,o.jsx)(R,{className:W.logoDesk})]}),(0,o.jsx)("nav",{ref:m.navMenuItemsRef,className:W.menuItems,children:(0,o.jsx)("ul",{children:H.map(e=>{let{id:t,label:n}=e;return(0,o.jsx)("li",{children:(0,o.jsx)(J,{className:(0,r.Z)({[W.menuItemActive]:k(t)}),label:n,eventActionText:n,variant:"white",size:"xs",onClick:C(_(t,n,!0)),onMouseEnter:j(t,n,!0,!0),onMouseLeave:b})},t)})})}),(0,o.jsx)(J,{className:(0,r.Z)(W.tabletMenuButton,{[W.menuItemActive]:m.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,o.jsx)(s.IconFdsChevronDownO,{size:24}),onClick:_("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,o.jsxs)("div",{className:W.buttonGroup,children:[(0,o.jsxs)("div",{className:W.chips,children:[(0,o.jsx)(J,{onClick:()=>m.setIsChatModalOpen(!m.isChatModalOpen),size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,o.jsx)(s.IconFdsChatDotsCircleO,{size:24})}),(0,o.jsx)(J,{as:"a",href:u,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:"profile_".concat(u),iconLeft:(0,o.jsx)(s.IconFdsUserO,{size:24})})]}),(0,o.jsx)(J,{className:W.menuButton,size:"xs",shape:w?"icon":"default",appearance:w?"ghost":"fill",label:"Меню",onClick:_("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,o.jsx)(s.IconFdsMenuSkewedO,{size:24})}),(0,o.jsxs)("div",{className:W.moreButtons,children:[(0,o.jsx)(eo,{initialTown:d}),(0,o.jsx)(ek,{}),(0,o.jsx)(J,{onClick:()=>m.setIsChatModalOpen(!m.isChatModalOpen),size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,o.jsx)(s.IconFdsChatDotsCircleO,{size:24})}),(0,o.jsx)(J,{as:"a",href:u,size:"xs",eventActionText:f,eventLabel:"".concat(f,"_").concat(u),label:f})]})]}),(0,o.jsxs)(ey,{className:W.auth,href:u,eventActionText:f,eventLabel:"".concat(f,"_").concat(u),children:[(0,o.jsx)(J,{size:"xs",shape:"circle-icon",iconLeft:(0,o.jsx)(s.IconFdsUserO,{}),eventActionText:f,eventLabel:"".concat(f,"_").concat(u)}),(0,o.jsx)("p",{children:f})]}),(0,o.jsx)("div",{className:W.close,children:(0,o.jsx)(J,{className:W.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,o.jsx)(s.IconFdsCloseO,{}),onClick:()=>m.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})})}),(0,o.jsx)("div",{className:(0,r.Z)(W.overlay,{[W.removed]:!m.isNavigationMounted,[W.overlayOpening]:m.isNavigationOpen,[W.overlayClosing]:!m.isNavigationOpen}),onClick:C(()=>m.setOpenedBlock(null))}),(0,o.jsx)(eI,{data:v,minioUrl:c})]})},eL=e=>(0,o.jsx)(ew,{isMainBannerPage:e.isMainBannerPage,children:(0,o.jsx)(e$,{...e})})}}]);