"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[754],{166:function(e,t,n){n.d(t,{default:function(){return i.a}});var o=n(5775),i=n.n(o)},5775:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let o=n(7043);n(7437),n(2265);let i=o._(n(5602));function l(e,t){var n;let o={loading:e=>{let{error:t,isLoading:n,pastDelay:o}=e;return null}};"function"==typeof e&&(o.loader=e);let l={...o,...t};return(0,i.default)({...l,modules:null==(n=l.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let o=n(8993);function i(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new o.BailoutToCSRError(t);return n}},5602:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let o=n(7437),i=n(2265),l=n(1523),r=n(49);function s(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},c=function(e){let t={...a,...e},n=(0,i.lazy)(()=>t.loader().then(s)),c=t.loading;function u(e){let s=c?(0,o.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,a=t.ssr?(0,o.jsxs)(o.Fragment,{children:["undefined"==typeof window?(0,o.jsx)(r.PreloadCss,{moduleIds:t.modules}):null,(0,o.jsx)(n,{...e})]}):(0,o.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,o.jsx)(n,{...e})});return(0,o.jsx)(i.Suspense,{fallback:s,children:a})}return u.displayName="LoadableComponent",u}},49:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return l}});let o=n(7437),i=n(544);function l(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,i.getExpectedRequestStore)("next/dynamic css"),l=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));l.push(...t)}}return 0===l.length?null:(0,o.jsx)(o.Fragment,{children:l.map(e=>(0,o.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},631:function(e,t,n){function o(){return typeof window>"u"}function i(e){o()||(Array.isArray(window.dataLayer)?window.dataLayer.push(e):console.log("window.dataLayer does not exist"),Array.isArray(window._mtm)?window._mtm.push(e):console.log("window._mtm does not exist"))}function l(){if(o()){console.warn("Cant initialize tag manager on server side");return}"function"!=typeof window._init_gtm?console.warn("Cant init GTM, please check if GTM script exists"):window._init_gtm(),"function"!=typeof window._init_mtm?console.warn("Cant init MTM, please check if MTM script exists"):window._init_mtm()}n.d(t,{AB:function(){return i},zK:function(){return l}})},2672:function(e,t,n){n.d(t,{C:function(){return q},H:function(){return eD},u:function(){return J}});var o=n(7437),i=n(2265),l=n(684),r=n(5563),s=n(5461),a=n(1994),c=n(7337),u=n(8731),d=n(4246),p=n(2074);let m=(0,p.g)("header","sc"),h=Object.freeze({header:`${m}`,fixed:`${m}__fixed`,hidden:`${m}__fixed--hidden`,transparent:`${m}--transparent`,navigationOpen:`${m}__navigation-open`,container:`${m}__container`,leftRow:`${m}__left-row`,logo:`${m}__logo`,menuItems:`${m}__menu-items`,menuItemActive:`${m}__menu-item-active`,tabletMenuButton:`${m}__tablet-menu-button`,buttonGroup:`${m}__button-group`,chips:`${m}__chips`,menuButton:`${m}__menu-button`,moreButtons:`${m}__more-buttons`,auth:`${m}__auth`,whiteIcons:`${m}__white-icons`,close:`${m}__close`,removed:`${m}__removed`,overlay:`${m}__overlay`,overlayOpening:`${m}__overlay--opening`,overlayClosing:`${m}__overlay--closing`}),f="user_region",w="user_town",g="cb-header",v=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],_=v.reduce((e,t)=>(e[t.id]=t.label,e),{}),x=Object.freeze({mobile:56,desktop:80});var b=n(5487);let y=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let o=document.getElementById("mainHomeBanner"),i=!1,l=0,r=0,s=()=>window.innerWidth<768,a=s(),c=()=>window.scrollY||document.documentElement.scrollTop,u=()=>{let e=document.querySelector(":root");e&&(r=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),l=c())},d=()=>{let e=s();e!==a&&(a=e,r=0)},p=function(){let s=c(),a=document.getElementById("headerNotice"),d=null==a?void 0:a.getAttribute("data-opening");if("true"===d)return;r||u();let p=s<r,m=s<((null==o?void 0:o.clientHeight)||0);if(n&&m||p){i=!1,e(!1),t(!0);return}e(i=s>l),i&&setTimeout(()=>t(!1),50);let h=i?"0px":"false"===d?`${r}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",h),document.documentElement.style.setProperty("--new-header-height-mobile",h),l=s<=0?0:s};return window.addEventListener("scroll",p),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",d)}},j=()=>{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},C=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),k=(e,t,n)=>{let o=new Date;o.setTime(o.getTime()+864e5*n);let i=encodeURIComponent(JSON.stringify(t)),l=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${i};expires=${o.toUTCString()};path=/;SameSite=Lax${l}`},$=()=>{let e=j();e&&!C()&&k("utm_params",e,90),e&&k("utm_last",e,90)},N=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{$()}catch(e){console.error("UTM tracking error:",e)}},0)},O=(e,t,n)=>(0,u.h)({eventCategory:g,eventActionType:e,eventActionText:t,eventLabel:n}),S=(0,p.g)("navigation-chips","sc"),T=Object.freeze({wrapper:`${S}__wrapper`,gray:`${S}__variantGray`,white:`${S}__variantWhite`,container:`${S}__container`,chip:`${S}__chip`,more:`${S}__chip--more`,active:`${S}__chip--active`,label:`${S}__label`,hidden:`${S}__hidden`}),I=(0,p.g)("navigation-content","sc"),A=Object.freeze({contentWrapper:`${I}__content-wrapper`,content:`${I}__content`,contentOpen:`${I}__content--open`,contentHeader:`${I}__content-header`,contentTitle:`${I}__content-title`,contentTitleUrl:`${I}__content-title--url`,contentTitleLink:`${I}__content-title--link`,contentTitleNew:`${I}__content-title--new`,new:`${I}__new`,vip:`${I}__vip`,arrowIcon:`${I}__arrow-icon`,links:`${I}__links`,linksColumns:`${I}__links--columns`,linksTitleless:`${I}__links--titleless`,removed:`${I}__removed`,hidden:`${I}__content--hidden`}),R=({chip:e,hidden:t,onClick:n,refCallback:i,activeChipId:r})=>{let s=!!n,c=()=>{if(s)return null==n?void 0:n(e.url);O(u.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:T.label,children:e.title}),e.arrow&&(0,o.jsx)(l.IconFdsArrowUpRightSmallO,{size:24})]}),p=(0,a.Z)(T.chip,{[T.hidden]:t,[A.new]:!!e.new,[A.vip]:!!e.vip,[T.active]:e.url===r});return s?(0,o.jsx)("button",{type:"button",className:p,onClick:c,ref:i,children:d}):(0,o.jsx)("a",{href:e.url,className:p,onClick:c,ref:i,children:d})},L=({items:e=[],maxNumberOfLines:t,variant:n,className:r,activeChipId:s,onClick:c})=>{let d=(0,i.useRef)(null),p=(0,i.useRef)(null),m=(0,i.useRef)({}),[h,f]=(0,i.useState)(!1),[w,g]=(0,i.useState)(e.length),[v,_]=(0,i.useState)(!1);(0,i.useMemo)(()=>{let t=m.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 x=(0,i.useCallback)(()=>{let n=d.current;if(!n)return;let o=e=>e?e.getBoundingClientRect().width:0,i=o(n),l=Math.max(Number(t)||0,0),r=()=>{g(e.length),_(!1)};if(h||0===l||i<=0){r();return}let s=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),a=o(p.current),c=e.map(e=>o(m.current[e.url]));if(c.some(e=>0===e)){r();return}let u=1,f=0,w=0;for(let e of c){let t=u===l?a+s:0,n=0===f?e:f+s+e;if(n+t<=i-.5)f=n,w++;else{if(++u>l)break;f=e,w++}}_(w<e.length),g(w)},[h,e,t]);(0,i.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(x)});return t.observe(e),requestAnimationFrame(x),()=>{t.disconnect()}},[x]),(0,i.useEffect)(()=>{requestAnimationFrame(x)},[x]);let b=h||(t??0)<=0||!v;return(0,o.jsx)("div",{className:(0,a.Z)(r,T.wrapper,{[T.gray]:"gray"===n,[T.white]:"white"===n}),children:(0,o.jsxs)("div",{ref:d,className:T.container,children:[e.map((e,t)=>(0,o.jsx)(R,{chip:e,hidden:!b&&t>=w,activeChipId:s,onClick:c,refCallback:t=>{m.current[e.url]=t}},e.url)),!b&&v&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,a.Z)(T.chip,T.more),onClick:()=>{O(u.D.chip,"Еще"),f(!0)},children:[(0,o.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:T.label,children:"Еще"})]}),(b||!v)&&(0,o.jsxs)("button",{type:"button",ref:p,className:(0,a.Z)(T.chip,T.more,T.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,o.jsx)(l.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:T.label,children:"Еще"})]})]})})},E=(e,t)=>{if(!(typeof document>"u")){if(!e&&!t){b.a.removeItem(f),b.a.removeItem(w);return}b.a.setItem(f,JSON.stringify(e)||"",{"max-age":31536e3}),b.a.setItem(w,JSON.stringify(t)||"",{"max-age":31536e3})}},P=e=>{if(typeof document>"u")return null;let t=b.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},z=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},M=()=>{if(typeof window>"u")return[];if(Array.isArray(window.allRegions)&&window.allRegions.length>0)return window.allRegions;let e=z("all_regions")||[];return window.allRegions=e,e},B=e=>{let t={};return e.map(({id:e,name:n,towns:o})=>(o.forEach(o=>{o.parentId=e,t[o.name]=t[o.name]||{},t[o.name][o.id]=n}),o)).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},W=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)},D=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},U=(e,t,n)=>{(0,u.h)({eventCategory:G,eventActionType:e,eventActionText:t,eventLabel:n})},F=M(),Z=B(F),V={regions:F,towns:Z,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},G="finkit-widgets-sc-city-select",H=(0,i.createContext)(V);function J(){return(0,i.useContext)(H)}let q=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:l=!0,lastRegionsUpdateUnixTimestamp:r,dadataUrl:s="https://finuslugi.ru/backend/money/dadata"})=>{let a=Number(z("lastRegionsUpdateUnixTimestamp")||0),c=Number(r||0)>a,[d,p]=(0,i.useState)(M()),[{startRegion:m,startTown:h},g]=(0,i.useState)({startRegion:V.startRegion,startTown:V.startTown}),v=t??V.region,_=n??V.town,[{region:x,town:b},y]=(0,i.useState)({region:v,town:_}),[j,C]=(0,i.useState)(V.startPopupVisible),[k,$]=(0,i.useState)(V.popupVisible),N=(0,i.useRef)(""),O=(0,i.useMemo)(()=>B(d),[d.length]),S=(0,i.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)||""),C(!0),g({startRegion:e,startTown:t})},[C,g]),T=(0,i.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||S(e,t)},[S]),I=(0,i.useCallback)(()=>{if(N.current&&!x&&!b){let e=O.find(e=>e.name===N.current)??null;return T(d.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}T(x,b)},[x,b,O,d,T]),A=(0,i.useCallback)(e=>{$(e)},[$]),R=(0,i.useCallback)(e=>{e?U(u.D.icon,"location"):U(u.D.button,(null==b?void 0:b.name)||"Вся Россия"),!l||window.sessionStorage.getItem("start_popup_opened")?A(!0):I()},[l,b,A,I]),L=(0,i.useCallback)((e,t)=>{e||t?(window.localStorage.setItem("all_russia_selected","0"),window.localStorage.setItem(f,JSON.stringify(e)||""),window.localStorage.setItem(w,JSON.stringify(t)||""),E(e||null,t||null)):(window.localStorage.setItem("all_russia_selected","1"),window.localStorage.setItem(f,""),window.localStorage.setItem(w,""),E(null,null)),y({region:e||null,town:t||null}),C(!1),A(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[A]),F=()=>{y({region:P(f)??z(f),town:P(w)??z(w)});let e=async({coords:{latitude:e,longitude:t}})=>{let n=`${s}?lat=${e}&lon=${t}`,o=await D(n);null!=o&&o.location&&(N.current=o.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&l)try{navigator.geolocation.getCurrentPosition(e,()=>null)}catch{}};return(0,i.useEffect)(()=>{if((d.length<1||c)&&W().then(e=>p(e)),window.innerWidth<1024){let e=()=>{F(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{F()},0)},[]),(0,o.jsx)(H.Provider,{value:{regions:d,towns:O,region:x,town:b,startPopupVisible:j,setStartPopupVisible:C,popupVisible:k,handleToggleModal:A,selectCity:L,handleButtonClick:R,startRegion:m,startTown:h},children:e})},Q=()=>{let e=(0,i.useRef)(null),t=(0,i.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,i.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,i.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},Y=(0,p.g)("city-select-modal-body","sc"),K=Object.freeze({wrapper:`${Y}__wrapper`,subtitle:`${Y}__subtitle`,hintWrapper:`${Y}__hint-wrapper`,hintText:`${Y}__hint-text`,input:`${Y}__input`,chips:`${Y}__chips`,townsListWrapper:`${Y}__towns-list-wrapper`,townsList:`${Y}__towns-list`,townsGroup:`${Y}__towns-group`,townsGroupLabel:`${Y}__towns-group-label`,townsGroupList:`${Y}__towns-group-list`,townsName:`${Y}__towns-name`,regionName:`${Y}__region-name`}),X=({groupedTowns:e,chips:t,query:n,setQuery:r,isDrawer:a})=>{var c;let d=J(),p=(0,i.useRef)(null),[m,h]=(0,i.useState)("10000px");(0,i.useEffect)(()=>{if(!a||!p.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,o)=>{let i=n.map(e=>[...e]),l=i.map(e),r=l.reduce((e,t,n)=>t<l[e]?n:e,0);0===r&&i[0].push(i[1].shift()),2===r&&i[2].unshift(i[1].pop()),1===r&&l[0]>l[2]&&i[1].unshift(i[0].pop()),1===r&&l[0]<l[2]&&i[1].push(i[2].shift());let s=Math.max(...i.map(e));return s>=o?o:t(i,s)};new ResizeObserver(()=>{var e;if(!(null!=(e=p.current)&&e.children))return;let n=Array.from(p.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let o=0;try{o=t([[],n,[]],1/0)}catch{o=0}o>0&&h(`${o}px`)}).observe(p.current)},[]);let f=e=>{if(U(u.D.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return d.selectCity();let t=d.regions.find(t=>t.id===Number(e.parentId))||null;d.selectCity(t,e)};return(0,o.jsxs)("div",{className:K.wrapper,children:[(0,o.jsxs)("div",{className:K.subtitle,children:["Покажем предложения рядом с вами",(0,o.jsxs)("div",{className:K.hintWrapper,children:[(0,o.jsx)(l.IconFdsQuestionCircleO,{size:24}),(0,o.jsx)("div",{className:K.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,o.jsx)(s.MA,{className:K.input,value:n,onChange:r,size:"s",placeholder:"Введите название города",icon:n?(0,o.jsx)(l.IconFdsCloseCircleO,{size:24,onClick:()=>r("")}):(0,o.jsx)(l.IconFdsSearchO,{size:24})}),(0,o.jsx)(s.cL,{className:K.chips,chips:t,value:(null==(c=d.town)?void 0:c.id)||0,onChipClick:e=>{f(d.towns.find(t=>t.id===e))}}),(0,o.jsx)("div",{className:K.townsListWrapper,children:(0,o.jsx)("div",{ref:p,className:K.townsList,style:{maxHeight:m},children:e.map(e=>(0,o.jsxs)("div",{className:K.townsGroup,children:[(0,o.jsx)("div",{className:K.townsGroupLabel,children:e.letter}),(0,o.jsx)("div",{className:K.townsGroupList,children:e.towns.map(e=>(0,o.jsxs)("button",{type:"button",onClick:()=>f(e),children:[(0,o.jsx)("div",{className:K.townsName,children:e.name}),(0,o.jsx)("div",{className:K.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},ee=[1095,1096,134,720,189,180],et=()=>{var e;let t=J(),n=(0,s._m)("l"),[l,r]=(0,i.useState)(""),a=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,c=(0,i.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(l.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[l,t.towns.length]),p=(0,i.useMemo)(()=>[{id:0,label:"Вся Россия"},...ee.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]),m=()=>{U(u.D.button,"close"),t.handleToggleModal(!1)};return(0,o.jsxs)(d.P,{children:[!n&&(0,o.jsx)(d.U,{title:a,isOpen:t.popupVisible,onClose:m,full:!0,children:(0,o.jsx)(X,{groupedTowns:c,chips:p,query:l,setQuery:r})}),n&&(0,o.jsx)(d.D,{title:a,isOpen:t.popupVisible,onClose:m,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,o.jsx)(X,{groupedTowns:c,chips:p,query:l,setQuery:r,isDrawer:!0})})]})},en={"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"},eo=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(en,e)?en[e]:en["finuslugi.ru"]},ei=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=`${e}/assets/css/${t}`,document.head.appendChild(n);let o=document.createElement("script");o.src=`${e}/get-bootstrap/${t}`,o.defer=!0,document.body.appendChild(o)},el=()=>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,i.useState)(!1),[n,o]=(0,i.useState)(!1),l=(0,i.useRef)(!1),r=e=>{l.current=e,o(e)};return(0,i.useEffect)(()=>{if(typeof window>"u")return;let e=eo(),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((i,s)=>{if(l.current){s(Error("chat is already opened"));return}o?(o.openWidget(),t(!1),i()):(r(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;o=e;let l=document.querySelector(".webchat");l&&el().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=o.closeWidget),null==o||o.openWidget(),r(!1),t(!1),i()},ei(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}},es=(0,i.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 ea(){return(0,i.useContext)(es)}let ec=e=>{let[t,n]=(0,i.useState)(!1),[l,r]=(0,i.useState)(!1),[s,a]=(0,i.useState)(!!e.isMainBannerPage),{isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p}=er(),[m,h]=(0,i.useState)(null),[f,w]=(0,i.useState)(null),[g,v]=(0,i.useState)(!1),[_,x]=(0,i.useState)(!1),[b,j]=(0,i.useState)(!1),C=(0,i.useRef)(null),k=(0,d.u)(g),$=(0,i.useRef)(null),O=(0,i.useRef)(null),S=(0,i.useRef)(null),T=(0,i.useRef)(null),I=(0,i.useCallback)(()=>{k.current&&k.current.scrollTo({top:0})},[k]),A=(0,i.useCallback)(e=>{w(e),I()},[I]),R=(0,i.useCallback)(e=>{$.current&&clearTimeout($.current),e&&x(!0),e||($.current=setTimeout(()=>{x(!1),A(null)},300))},[A]),L=(0,i.useCallback)((e,t,n)=>{if(t&&A(t),!n&&e===m||!e){R(!g),v(!g);return}h(e),R(!0),v(!0)},[m,A,g,R]),E=(0,i.useCallback)(()=>{O.current&&clearTimeout(O.current),j(!0),O.current=setTimeout(()=>{j(!1)},650)},[]);return(0,i.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=y(r,a,e.isMainBannerPage);return N(),t},[]),(0,o.jsx)("header",{children:(0,o.jsx)(es.Provider,{value:{isAuth:t,isHeaderHidden:l,isHeaderTransparent:s,openedBlock:m,setOpenedBlock:L,openedSection:f,setOpenedSection:A,isNavigationOpen:g,isNavigationMounted:_,navMenuItemsRef:C,navigationRef:k,ignoreClicks:b,setIgnoreClicks:E,isChatModalOpen:c,setIsChatModalOpen:u,isChatLoading:p,fixedContainerRef:S,headerRef:T},children:e.children})})},eu=({label:e,onClick:t,eventActionText:n,eventLabel:i,...l})=>(0,o.jsx)(s.zx,{label:e,onClick:e=>{null==t||t(e),(0,u.h)({eventCategory:g,eventActionType:u.D.button,eventActionText:n||"",eventLabel:i||""})},...l}),ed=(0,p.g)("header-popup","sc"),ep=Object.freeze({popup:`${ed}__popup`,popupHeader:`${ed}__popup-header`,popupClose:`${ed}__popup-close`,body:`${ed}__body`}),em=({isOpen:e,onClose:t,children:n,title:i})=>{let r=(0,s._m)("l");return(0,o.jsxs)(d.P,{children:[!r&&(0,o.jsx)(d.U,{title:i,isOpen:e,onClose:t,children:n}),r&&e&&(0,o.jsxs)("div",{className:ep.popup,children:[(0,o.jsxs)("div",{className:ep.popupHeader,children:[i,(0,o.jsx)(eu,{className:ep.popupClose,iconLeft:(0,o.jsx)(l.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,o.jsx)("div",{className:ep.body,children:n})]})]})},eh=(0,p.g)("start-choice-popup","sc"),ef=Object.freeze({top:`${eh}__top`,progress:`${eh}__progress`,innerCircle:`${eh}__inner-circle`,title:`${eh}__title`,subtitle:`${eh}__subtitle`,actions:`${eh}__actions`}),ew=()=>{var e,t;let n=J(),[l,r]=(0,i.useState)(10),[s,a]=(0,i.useState)(0),c=(0,i.useRef)(void 0),d=()=>{U(u.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,i.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+l).slice(1)),t=1e3*e/100,n=0,o=0;c.current=setInterval(()=>{n++,o+=t,a(3.6*n);let i=e-Math.floor(o/1e3);i<l&&r(i),100===n&&(clearInterval(c.current),d())},t)})():(clearInterval(c.current),r(10),a(0))},[n.startPopupVisible]),(0,o.jsxs)(em,{isOpen:n.startPopupVisible,onClose:d,title:(0,o.jsx)("button",{type:"button",className:ef.progress,style:{background:`conic-gradient(#ff0508 ${s}deg, #e3e7ec 0deg)`},onClick:d,children:(0,o.jsx)("div",{className:ef.innerCircle,children:l})}),children:[(0,o.jsxs)("div",{className:ef.top,children:[(0,o.jsxs)("div",{className:ef.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,o.jsx)("div",{className:ef.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,o.jsxs)("div",{className:ef.actions,children:[(0,o.jsx)(eu,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{U(u.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,o.jsx)(eu,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{U(u.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},eg=(0,p.g)("city-select","sc"),ev=Object.freeze({button:`${eg}__button`,minimal:`${eg}__minimal`,full:`${eg}__full`}),e_=({initialTown:e})=>{var t;let n=J(),r=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:c,isChatModalOpen:u}=ea(),{startPopupVisible:d,setStartPopupVisible:p,popupVisible:m}=n,h=(0,i.useRef)();(0,i.useEffect)(()=>{m&&(h.current="popup")},[m]),(0,i.useEffect)(()=>{u&&(h.current="chat")},[u]),(0,i.useEffect)(()=>{d&&(h.current="startPopup")},[d]),(0,i.useEffect)(()=>{h.current&&("chat"===h.current&&d?p(!1):["startPopup","popup"].includes(h.current)&&u&&c(!1))},[m,u,d,p,c]);let f={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,o.jsx)(l.IconFdsLocationO,{size:24})};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.zx,{...f,className:(0,a.Z)(ev.button,ev.full),label:r}),(0,o.jsx)(s.zx,{...f,className:(0,a.Z)(ev.button,ev.minimal),shape:"icon"}),(0,o.jsx)(et,{}),(0,o.jsx)(ew,{})]})},ex=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,...l})=>(0,o.jsx)(s.rU,{onClick:o=>{null==e||e(o),(0,u.h)({eventCategory:g,eventActionType:t||u.D.link,eventActionText:n||"",eventLabel:i||""})},...l}),eb=(0,p.g)("header-mobile-app-banner","sc"),ey=Object.freeze({wrapper:`${eb}__wrapper`,container:`${eb}__container`,closeButton:`${eb}__close-button`,innerWrapper:`${eb}__inner-wrapper`,imageWrapper:`${eb}__image-wrapper`,image:`${eb}__image`,title:`${eb}__title`,description:`${eb}__description`,callToAction:`${eb}__call-to-action`,scanQr:`${eb}__scan-qr`}),ej=Object.freeze({mobile:56,desktop:68}),eC="headerBannerShownAt",ek=()=>{let e=localStorage.getItem(eC);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},e$=()=>{localStorage.setItem(eC,new Date().toISOString())},eN=()=>{let e=ek();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},eO=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:d,headerRef:p}=ea(),[m,h]=(0,i.useState)(!1),[f,w]=(0,i.useState)(!1),[g,v]=(0,i.useState)(!1),_=(0,i.useCallback)((e="desktop")=>{let t=d.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${ej[e]+x[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${ej.desktop+x.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${ej.mobile+x.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${ej.mobile+x.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${ej.desktop+x.desktop}px`),document.documentElement.style.setProperty("--header-height",`${ej[e]+108}px`))},[]),b=(0,i.useCallback)(()=>{let e=d.current;e&&(document.documentElement.style.removeProperty("--fixed-header-height"),document.documentElement.style.removeProperty("--new-header-height-desktop"),document.documentElement.style.removeProperty("--new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-desktop"),document.documentElement.style.removeProperty("--header-height"),e.style.transform="")},[]);return(0,i.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{f&&h(!1),v(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[f]),(0,i.useEffect)(()=>{eN()&&h(!0)},[]),(0,i.useEffect)(()=>{let e=window.innerWidth<768;m&&(_(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):v(!0));let t=()=>{if(!m)return null;_(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{b(),window.removeEventListener("resize",t)}},[m,_,b]),m?(0,o.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":g,className:(0,a.Z)(ey.wrapper,t),children:(0,o.jsx)(r.W2,{children:(0,o.jsxs)("div",{className:ey.container,children:[(0,o.jsxs)("div",{className:ey.innerWrapper,children:[(0,o.jsxs)("picture",{className:ey.imageWrapper,children:[(0,o.jsx)("source",{srcSet:(0,c.xn)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,o.jsx)("img",{className:ey.image,src:(0,c.xn)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,o.jsxs)("div",{className:ey.scanQr,children:[(0,o.jsx)("div",{className:ey.title,children:"Скачайте приложение Финуслуги"}),(0,o.jsx)("div",{className:ey.description,children:"Сканируйте QR-код"})]}),(0,o.jsxs)("div",{className:ey.callToAction,children:[(0,o.jsxs)("div",{children:["Приложение",(0,o.jsx)("br",{}),"Финуслуги"]}),(0,o.jsx)(s.zx,{onClick:()=>{O(u.D.button,"skachat_mob_prilozheniye_fu"),window.open(n,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,o.jsx)("div",{"aria-label":"Закрыть",role:"button",className:ey.closeButton,onClick:()=>{e$(),b(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):w(!0)},children:(0,o.jsx)(l.IconFdsCloseO,{size:"100%"})})]})})}):null},eS=(0,p.g)("header-chat-modal-body","sc"),eT=Object.freeze({wrapper:`${eS}__wrapper`,cardButton:`${eS}__card-button`,card:`${eS}__card`,cardTitle:`${eS}__card-title`,cardSubtitle:`${eS}__card-subtitle`,button:`${eS}__button`}),eI=()=>{let e=ea();return(0,o.jsxs)("div",{className:eT.wrapper,children:[(0,o.jsx)(eu,{className:eT.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)(r.Zb,{className:eT.card,variant:"secondary",children:[(0,o.jsxs)("div",{className:eT.cardTitle,children:[(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,o.jsxs)("p",{className:eT.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,o.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},eA=({data:e,isMobile:t})=>{let n=ea();return(0,o.jsx)("div",{className:A.contentWrapper,children:e.map(e=>(0,o.jsx)(i.Fragment,{children:e.sections.map(e=>(0,o.jsxs)("div",{className:(0,a.Z)(A.content,{[A.hidden]:n.openedSection!==e.id,[A.contentOpen]:!!n.openedSection}),children:[(0,o.jsx)("div",{className:A.contentHeader,children:(0,o.jsx)("label",{children:e.title})}),e.content.map((n,i)=>{var r,s;return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{children:(0,o.jsx)("a",{className:(0,a.Z)(A.contentTitle,{[A.removed]:!n.title,[A.contentTitleUrl]:!!n.url,[A.contentTitleLink]:!!e.isSeeAllLinkAvailable,[A.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,o.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,o.jsx)("div",{className:A.arrowIcon,children:(0,o.jsx)(l.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(r=n.links)&&r.length)&&(0,o.jsx)(L,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(s=n.links)&&s.length)&&(0,o.jsx)("div",{className:(0,a.Z)(A.links,{[A.linksColumns]:!!n.columns,[A.linksTitleless]:!n.title}),children:n.links.map(e=>(0,o.jsxs)("a",{href:e.url,className:(0,a.Z)({[A.new]:!!e.new}),onClick:()=>O(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,o.jsx)("div",{className:A.arrowIcon,children:(0,o.jsx)(l.IconFdsArrowUpRightSmallO,{})}),(0,o.jsx)("span",{children:e.title})]},e.url))})]},`${n.url}_${i}`)})]},e.id))},e.id))})},eR=(0,p.g)("navigation-section-icon","sc"),eL=Object.freeze({icon:`${eR}`}),eE=({name:e,background:t})=>{let n=(0,i.useMemo)(()=>e&&l[e]||null,[e]);return e&&n?(0,o.jsx)("div",{className:eL.icon,style:{background:t},children:(0,o.jsx)(n,{})}):null},eP=(0,p.g)("navigation","sc"),ez=Object.freeze({navigation:`${eP}`,navigationOpening:`${eP}--opening`,navigationClosing:`${eP}--closing`,wrapper:`${eP}__wrapper`,container:`${eP}__container`,containerOpen:`${eP}__container--open`,sections:`${eP}__sections`,sectionsOpen:`${eP}__sections--open`,citySelectButton:`${eP}__city-select-button`,sectionsTitle:`${eP}__sections-title`,sectionsWrapper:`${eP}__sections-wrapper`,section:`${eP}__section`,sectionArrow:`${eP}__section-arrow`,sectionExtra:`${eP}__section--extra`,sectionActive:`${eP}__section--active`,sectionTitle:`${eP}__section-title`,chatWrapper:`${eP}__chat-wrapper`,chatHeader:`${eP}__chat-header`,backButton:`${eP}__back-button`,useful:`${eP}__useful`,usefulOpen:`${eP}__useful--open`,usefulTitle:`${eP}__useful-title`,usefulGrid:`${eP}__useful-grid`,removed:`${eP}__removed`}),eM=({data:e})=>{var t;let n=ea(),c=J(),d=(0,s.aF)("m"),[p,m]=(0,i.useState)(!0);(0,i.useEffect)(()=>{m(d)},[d]);let h=(0,i.useRef)(null),f=(0,i.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),w=(0,i.useRef)(!1),g=(0,i.useRef)(null),v=(0,i.useCallback)(()=>{p&&(w.current=!0,g.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),f()},window.history.pushState(null,"",window.location.href))},[f,p]),x=(0,i.useCallback)(()=>{w.current=!1,window.onpopstate=g.current,window.history.go(-1)},[]),b=(0,i.useRef)(null),y=(0,i.useCallback)(e=>{if(p||!n.navMenuItemsRef.current||!n.navigationRef.current)return;let t=e.target,o=!n.navMenuItemsRef.current.contains(t)&&!n.navigationRef.current.contains(t);if(o&&!b.current){n.setIgnoreClicks(),b.current=setTimeout(()=>n.setOpenedBlock(null),300);return}!o&&b.current&&(clearTimeout(b.current),b.current=null)},[p,n]),j=(0,i.useRef)(null),C=(0,i.useCallback)(e=>{typeof window>"u"||(e?(j.current=y,window.addEventListener("mousemove",j.current)):j.current&&window.removeEventListener("mousemove",j.current))},[y]);(0,i.useEffect)(()=>{C(n.isNavigationOpen),n.isNavigationOpen&&!w.current&&v(),!n.isNavigationOpen&&w.current&&x()},[n.isNavigationOpen]);let k=(e,t)=>()=>{O(u.D.button,t),n.setOpenedSection(e)},{start:$,clear:N}=Q(),S=(e,t)=>()=>{p||$(k(e,t),150)},T=()=>{p||N()};return(0,o.jsx)("div",{ref:n.navigationRef,className:(0,a.Z)(ez.navigation,{[ez.removed]:!n.isNavigationMounted,[ez.navigationOpening]:n.isNavigationOpen,[ez.navigationClosing]:!n.isNavigationOpen}),children:(0,o.jsx)("div",{className:ez.wrapper,children:(0,o.jsxs)(r.W2,{className:(0,a.Z)(ez.container,{[ez.containerOpen]:!!n.openedSection}),children:[(0,o.jsxs)("div",{className:(0,a.Z)(ez.sections,{[ez.sectionsOpen]:!!n.openedSection}),children:[(0,o.jsx)(s.zx,{className:ez.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>c.handleButtonClick(!1),iconLeft:(0,o.jsx)(l.IconFdsLocationO,{size:24}),label:(null==(t=c.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,o.jsxs)("ul",{className:(0,a.Z)(ez.sectionsWrapper,{[ez.removed]:n.openedBlock!==e.id&&!p}),children:[(0,o.jsx)("div",{className:ez.sectionsTitle,children:_[e.id]}),e.sections.map(e=>(0,o.jsxs)("li",{className:(0,a.Z)(ez.section,{[ez.sectionExtra]:!!e.extra,[ez.sectionActive]:n.openedSection===e.id}),onClick:k(e.id,e.title),onMouseEnter:S(e.id,e.title),onMouseLeave:T,children:[(0,o.jsx)(eE,{name:e.uikitIcon,background:e.uikitIconBg}),(0,o.jsx)("span",{className:ez.sectionTitle,children:e.title}),(0,o.jsx)("div",{className:ez.sectionArrow,children:(0,o.jsx)(l.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,o.jsxs)("div",{className:ez.chatWrapper,children:[(0,o.jsx)("div",{className:ez.chatHeader,children:"Нужна помощь?"}),(0,o.jsx)(eI,{})]})]}),(0,o.jsxs)("button",{type:"button",className:(0,a.Z)(ez.backButton,{[ez.removed]:!n.openedSection}),onClick:()=>{O(u.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,o.jsx)(l.IconFdsChevronLeftO,{size:24}),(0,o.jsx)("span",{children:"Назад"})]}),(0,o.jsx)(eA,{data:e,isMobile:p}),(0,o.jsxs)("div",{className:(0,a.Z)(ez.useful,{[ez.usefulOpen]:!!n.openedSection}),children:[(0,o.jsx)("div",{className:ez.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,o.jsx)(i.Fragment,{children:e.sections.map(e=>(0,o.jsx)("div",{className:(0,a.Z)(ez.usefulGrid,{[ez.removed]:n.openedSection!==e.id}),children:e.useful.map((e,t)=>(0,o.jsxs)("a",{href:e.url,onClick:()=>O(u.D.link,e.title,`${e.title}_${e.url}`),children:[(0,o.jsx)("div",{children:(0,o.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id))},e.id))]})]})})})},eB=(e,t,n)=>{var o,i,l,r,s,a,u;let d=(null==(i=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o.findIndex)?void 0:i.call(o,({id:e})=>"news"===e))||-1,p=(null==(r=null==(l=null==e?void 0:e.NAVIGATOR)?void 0:l[d])?void 0:r.content)||[];if(null!=(u=null==(a=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[d])?void 0:a.content)&&u[0]&&Array.isArray(n)&&p.length){let o=n.map(({title:e,url:n})=>({title:e,url:(0,c.xn)(t||"",n),new:0}));e.NAVIGATOR[d].content[0].links=o}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:[]}]},eW=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:d="https://lk.finuslugi.ru/registration",initialTown:p,isMainBannerPage:m,enableAppHeaderBanner:f=!1,news:w,className:g})=>{let _=ea(),x=(0,i.useMemo)(()=>eB(e,t,w),[e,t,w]),b=null==e?void 0:e.config,y=(0,i.useMemo)(()=>x.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[x]),j=_.isAuth?"Личный кабинет":"Войти",C=m&&_.isHeaderTransparent,k=(e,t,n,o)=>()=>{e!==_.openedBlock?O(u.D.toggle,t,"on"):O(u.D.button,"menu_close","on");let i=n?y[e]:"";_.setOpenedBlock(e,i,!!o)},{start:$,clear:N}=Q(),S=(e,t,n,o)=>()=>{_.isNavigationOpen&&e===_.openedBlock||_.setIgnoreClicks(),$(k(e,t,n,o),200)},T=e=>()=>{_.ignoreClicks||e()},I=e=>_.openedBlock===e&&_.isNavigationOpen;return e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:_.headerRef,className:(0,a.Z)(h.header,g,{[h.transparent]:C}),children:(0,o.jsxs)("div",{ref:_.fixedContainerRef,className:(0,a.Z)(h.fixed,{[h.hidden]:_.isHeaderHidden,[h.navigationOpen]:_.isNavigationOpen}),children:[!!(null!=b&&b.appBannerUrl)&&f&&(0,o.jsx)(eO,{mobileAppUrl:b.appBannerUrl,minioUrl:n}),(0,o.jsxs)(r.W2,{className:h.container,children:[(0,o.jsxs)("div",{className:h.leftRow,children:[(0,o.jsx)(ex,{className:h.logo,href:t,eventActionType:u.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,o.jsxs)("picture",{children:[(0,o.jsx)("source",{srcSet:(0,c.xn)(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,o.jsx)("img",{src:(0,c.xn)(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,o.jsx)("nav",{ref:_.navMenuItemsRef,className:h.menuItems,children:(0,o.jsx)("ul",{children:v.map(({id:e,label:t})=>(0,o.jsx)("li",{children:(0,o.jsx)(s.zx,{className:(0,a.Z)({[h.menuItemActive]:I(e)}),label:t,variant:"white",size:"xs",onClick:T(k(e,t,!0)),onMouseEnter:S(e,t,!0,!0),onMouseLeave:N})},e))})}),(0,o.jsx)(eu,{className:(0,a.Z)(h.tabletMenuButton,{[h.menuItemActive]:_.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,o.jsx)(l.IconFdsChevronDownO,{size:24}),onClick:k("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,o.jsxs)("div",{className:(0,a.Z)(h.buttonGroup,{[h.whiteIcons]:(null==b?void 0:b.iconColorOnMobileMainBanner)==="white"}),children:[(0,o.jsxs)("div",{className:h.chips,children:[(0,o.jsx)(eu,{as:"a",href:d,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${d}`,iconLeft:(0,o.jsx)(l.IconFdsUserO,{size:20})}),(0,o.jsx)(eu,{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,o.jsx)(l.IconFdsChatDotsCircleO,{size:24})})]}),(0,o.jsx)(eu,{className:h.menuButton,size:"xs",shape:C?"icon":"default",appearance:C?"ghost":"fill",label:"Меню",onClick:k("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,o.jsx)(l.IconFdsMenuSkewedO,{size:24})}),(0,o.jsxs)("div",{className:h.moreButtons,children:[(0,o.jsx)(e_,{initialTown:p}),(0,o.jsx)(eu,{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,o.jsx)(l.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,o.jsx)(eu,{as:"a",href:d,size:"xs",eventActionText:j,eventLabel:`${j}_${d}`,label:j})]})]}),(0,o.jsxs)(ex,{className:h.auth,href:d,eventActionText:j,eventLabel:`${j}_${d}`,children:[(0,o.jsx)(eu,{size:"xs",shape:"circle-icon",iconLeft:(0,o.jsx)(l.IconFdsUserO,{}),eventActionText:j,eventLabel:`${j}_${d}`}),(0,o.jsx)("p",{children:j})]}),(0,o.jsx)("div",{className:h.close,children:(0,o.jsx)(eu,{className:h.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,o.jsx)(l.IconFdsCloseO,{}),onClick:()=>_.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,o.jsx)("div",{className:(0,a.Z)(h.overlay,{[h.removed]:!_.isNavigationMounted,[h.overlayOpening]:_.isNavigationOpen,[h.overlayClosing]:!_.isNavigationOpen}),onClick:T(()=>_.setOpenedBlock(null))}),(0,o.jsx)(eM,{data:x,minioUrl:n})]}):null},eD=e=>(0,o.jsx)(ec,{isMainBannerPage:e.isMainBannerPage,children:(0,o.jsx)(eW,{...e})})},4246:function(e,t,n){n.d(t,{D:function(){return I},P:function(){return B},U:function(){return M},u:function(){return b}});var o=n(7437),i=n(2265),l=n(1994),r=n(684),s=n(2074),a=n(4887);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,s.g)("click-outside","sc"),p=Object.freeze({overlay:`${d}__overlay`,open:`${d}--open`,close:`${d}--close`}),m=({onClose:e,onToucheMove:t,isOpen:n,delay:r=c})=>{let s=(0,i.useRef)(null),a=(0,i.useCallback)(()=>{e&&(s.current=setTimeout(()=>{e()},r))},[r,e]),u=(0,i.useCallback)(e=>{"Escape"===e.key&&a()},[a]);return(0,i.useEffect)(()=>(n&&window.addEventListener("keydown",u),()=>{s.current&&clearTimeout(s.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:a})},h=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},f=e=>{e.style.top||(window.prevScrollPosition=window.scrollY)},w=(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`)},g=e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vh")},v=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,i=document.body,l=document.documentElement,r=window.innerWidth-l.clientWidth,s=r>0;if(e&&s)f(i),w(i,l,r),h(o,!0);else if(e)g(i),h(o,!0);else{let e=!x();e&&v(i),e&&_(),h(o,!1)}return()=>{let e=!x();e&&v(i),e&&_()}},[e]),t},y=(0,s.g)("drawer-footer","sc"),j=Object.freeze({footer:`${y}__footer`,hasScroll:`${y}__footer--has-scroll`}),C=({footer:e,hasScroll:t,className:n})=>(0,o.jsx)("div",{className:(0,l.Z)(j.footer,{[j.hasScroll]:t},n),children:"function"==typeof e?e():e}),k=(0,s.g)("drawer-content","sc"),$=Object.freeze({container:`${k}__container`,open:`${k}--open`,close:`${k}--close`,header:`${k}__header`,rowHeader:`${k}__header--row`,title:`${k}__title`,center:`${k}__title--center`,left:`${k}__title--left`,right:`${k}__title--right`,controlContainer:`${k}__control-container`,content:`${k}__content`,footer:`${k}__footer`}),N=({onClose:e,onContentClick:t,children:n,title:s,rowTitle:a,titleAlign:c,isCloseable:u,footer:d,closeButton:p,isOpen:m,contentClassName:h,footerClassName:f,contentStyle:w,width:g})=>{let v=(0,i.useRef)(null),_=(0,i.useRef)(null),[x,b]=(0,i.useState)(!1);(0,i.useEffect)(()=>{var e;if(!_.current||!v.current)return;let t=(null==(e=null==_?void 0:_.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.current,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 y=w||g?{width:g,...w||{}}:void 0;return(0,o.jsxs)("div",{ref:v,style:y,className:(0,l.Z)($.container,{[$.open]:m,[$.close]:!m},h),children:[s||u?(0,o.jsxs)("div",{className:(0,l.Z)($.header,{[$.rowHeader]:a}),children:[u?p?"function"==typeof p?p():p:(0,o.jsx)("button",{type:"button",className:$.controlContainer,onClick:e,children:(0,o.jsx)(r.IconFdsCloseO,{size:24})}):null,s?(0,o.jsx)("h3",{className:(0,l.Z)($.title,{[$[c]]:!0}),children:s}):null]}):null,(0,o.jsx)("div",{ref:_,className:$.content,onClick:t,children:n}),d&&(0,o.jsx)(C,{className:(0,l.Z)($.footer,f),footer:d,hasScroll:x})]})},O=(0,s.g)("drawer-layout","sc"),S=Object.freeze({window:`${O}__window`}),T=({onClose:e,isOpen:t,children:n,withDisabledScroll:r,className:s,...a})=>{let c=(0,i.useCallback)(e=>e.stopPropagation(),[]);return b(t&&r),(0,o.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(S.window,s),children:[(0,o.jsx)(m,{onClose:e,isOpen:t,delay:0}),(0,o.jsx)(N,{onContentClick:c,onClose:e,isOpen:t,...a,children:n})]})},I=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:i=!0,withDisabledScroll:l=!0,...r})=>{let{mounted:s}=u({opened:e});return s?(0,o.jsx)(T,{titleAlign:n,isCloseable:i,isOpen:e,withDisabledScroll:l,...r,children:t}):null};I.displayName="Drawer";let A=(0,s.g)("mobile-modal-footer","sc"),R=Object.freeze({footer:`${A}__footer`,footerWithoutShadow:`${A}__footer--without-shadow`}),L=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,o.jsx)("div",{className:(0,l.Z)(R.footer,t&&R.footerWithoutShadow,n),children:"function"==typeof e?e():e}),E=(0,s.g)("mobile-popup","sc"),P=Object.freeze({mobilePopup:`${E}`,mobilePopupOpen:`${E}--open`,content:`${E}__content`,contentFull:`${E}__content--full`,contentTransition:`${E}__content--transition`,contentTransitionOpen:`${E}__content--transition-open`,contentLine:`${E}__content-line`,contentContainer:`${E}__content-container`,smallContentContainer:`${E}__content-container--small`,min:`${E}__content-container--min`,title:`${E}__title`,closeContainer:`${E}__close-container`,closeButton:`${E}__close-button`}),z=({children:e,footer:t,isOpen:n,isSmallPopup:s,onClose:a,hasCloseButton:c=!0,full:u,touchDistance:d=100,withDisabledScroll:p=!0,contentClassName:h,className:f,title:w,closeButton:g,footerClassName:v})=>{let[_,x]=(0,i.useState)(!1),[y,j]=(0,i.useState)(!1),[C,k]=(0,i.useState)(!0),[$,N]=(0,i.useState)("120%"),O=(0,i.useRef)(null),S=(0,i.useRef)(0),T=(0,i.useRef)(!1),I=e=>{var t,n,o;let i=null==(t=O.current)?void 0:t.offsetTop,l=null==(n=O.current)?void 0:n.offsetHeight;if(T.current=!0,k(!1),i&&l){let t=(null==(o=null==e?void 0:e.touches[0])?void 0:o.clientY)-i,n=0;t>=0&&t<=l+30&&(n=t),t>l+30&&(n=l+30),N(`${n}px`),S.current=n}},A=()=>{T.current&&(S.current>d&&a?null==a||a():N("0"),k(!0),T.current=!1),window.removeEventListener("touchmove",I),window.removeEventListener("touchend",A)};return(0,i.useEffect)(()=>{n&&setTimeout(()=>{x(!0),j(!0),N("0")},100),!n&&y&&(N("120%"),x(!1),j(!1))},[y,n]),b(n&&p),(0,o.jsxs)("div",{"data-portal":!0,className:(0,l.Z)(P.mobilePopup,y&&P.mobilePopupOpen,f),children:[(0,o.jsx)(m,{onClose:()=>{n&&(null==a||a())},onToucheMove:()=>{n&&(x(!1),window.addEventListener("touchmove",I),window.addEventListener("touchend",A))},isOpen:n,delay:0}),(0,o.jsxs)("div",{className:(0,l.Z)(P.content,u&&P.contentFull,C&&P.contentTransition,C&&_&&P.contentTransitionOpen),ref:O,style:{transform:`translateY(${$})`},children:[(0,o.jsx)("div",{className:P.contentLine}),(0,o.jsxs)("div",{className:(0,l.Z)(P.contentContainer,s&&P.smallContentContainer,{[P.min]:!w&&!c},h),children:[!!w&&(0,o.jsx)("div",{className:P.title,children:w}),c?(0,o.jsx)("div",{className:P.closeContainer,children:c?g?"function"==typeof g?g():g:(0,o.jsx)("button",{onClick:a,className:P.closeButton,children:(0,o.jsx)(r.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,o.jsx)(L,{footerClassName:v,isSmallPopup:s,footer:t})]})]})},M=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...i})=>{let{mounted:l}=u({opened:n});return l?(0,o.jsx)(z,{isSmallPopup:t,isOpen:n,...i,children:e}):null};M.displayName="UiMobilePopup";let B=({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,a.createPortal)(e,n):null}},2778:function(e,t,n){n.d(t,{L:function(){return a},g:function(){return s}});var o=n(2265),i=n(631);let l=null,r=e=>{l=e},s=()=>l,a=e=>{let{env:t}=e,n=(0,o.useRef)(!1);return n.current||(r(t),n.current=!0),(0,o.useEffect)(()=>{"production"===t.NODE_ENV&&(0,i.zK)()},[t.NODE_ENV]),null}},5487:function(e,t,n){n.d(t,{a:function(){return o}});let o={getItem:e=>{if(typeof document>"u")return null;let t=document.cookie.split(";").find(t=>t.split("=")[0].trim()===e);return t?t.split("=")[1]??null:null},setItem:(e,t,n={})=>{if(typeof document>"u")return;(n={path:"/",...n}).expires instanceof Date&&(n.expires=n.expires.toUTCString());let o=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;for(let e in n){if(!n.hasOwnProperty(e))continue;o+=`; ${e}`;let t=n[e];!0!==t&&(o+=`=${t}`)}document.cookie=o},removeItem:e=>{o.setItem(e,"",{"max-age":-1})}}},8731:function(e,t,n){let o;n.d(t,{D:function(){return s},h:function(){return c}});var i=n(1620),l=n(631);let r=(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(" ","_")),e.eventLabel||(e.eventLabel="undefined");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 s=((o=s||{}).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 a={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_"},c=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:o})=>{let l={event:"data-event",eventCategory:e,eventAction:a[t]+(0,i.t)(n)};void 0!==o&&(l.eventLabel=(0,i.t)("string"==typeof o?o:o.toString())),r(l)}},1620:function(e,t,n){n.d(t,{t:function(){return i}});let o={а:"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"},i=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in o?o[t]:e}).replaceAll(/[ \u00A0]/g,"_")},7337:function(e,t,n){n.d(t,{jb:function(){return b},pJ:function(){return x},xn:function(){return y}});let o=/#/g,i=/&/g,l=/\//g,r=/=/g,s=/\+/g,a=/%5e/gi,c=/%60/gi,u=/%7c/gi,d=/%20/gi;function p(e){return encodeURI(""+("string"==typeof e?e:JSON.stringify(e))).replace(u,"|").replace(s,"%2B").replace(d,"+").replace(o,"%23").replace(i,"%26").replace(c,"`").replace(a,"^").replace(l,"%2F")}function m(e){return p(e).replace(r,"%3D")}function h(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}let f=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,w=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,g=/^([/\\]\s*){2,}[^/\\]/,v=/^\.?\//;function _(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?f.test(e):w.test(e)||!!t.acceptRelative&&g.test(e)}function x(e,t){if(!t||"/"===t||_(e))return e;let n=function(e="",t){return(!function(e="",t){return e.endsWith("/")}(e)?e:e.slice(0,-1))||"/"}(t);return e.startsWith(n)?e:y(n,e)}function b(e,t){let n=function e(t="",n){let o=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(o){let[,e,t=""]=o;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:"",host:"",search:"",hash:""}}if(!_(t,{acceptRelative:!0}))return n?e(n+t):C(t);let[,i="",l,r=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,s="",a=""]=r.match(/([^#/?]*)(.*)?/)||[];"file:"===i&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:c,search:u,hash:d}=C(a);return{protocol:i.toLowerCase(),auth:l?l.slice(0,Math.max(0,l.length-1)):"",host:s,pathname:c,search:u,hash:d,[j]:!i}}(e),o={...function(e=""){let t=Object.create(null);for(let n of("?"===e[0]&&(e=e.slice(1)),e.split("&"))){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let o=h(e[1].replace(s," "));if("__proto__"===o||"constructor"===o)continue;let i=h((e[2]||"").replace(s," "));void 0===t[o]?t[o]=i:Array.isArray(t[o])?t[o].push(i):t[o]=[t[o],i]}return t}(n.search),...t};return n.search=Object.keys(o).filter(e=>void 0!==o[e]).map(e=>{var t;return(("number"==typeof(t=o[e])||"boolean"==typeof t)&&(t=String(t)),t)?Array.isArray(t)?t.map(t=>`${m(e)}=${p(t)}`).join("&"):`${m(e)}=${p(t)}`:m(e)}).filter(Boolean).join("&"),function(e){let t=e.pathname||"",n=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",o=e.hash||"",i=e.auth?e.auth+"@":"",l=e.host||"";return(e.protocol||e[j]?(e.protocol||"")+"//":"")+i+l+t+n+o}(n)}function y(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(v,"");n=function(e="",t){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}let j=Symbol.for("ufo:protocolRelative");function C(e=""){let[t="",n="",o=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:o}}}}]);