1import{b1 as w,bD as M,eR as v,bK as _,cA as b,bN as f,b0 as I,bz as C,aU as r,aP as a,aX as s,bE as y,aV as T,bB as h,b4 as g,b5 as k,aW as m,bF as N,aQ as $}from"./v7.12-VpakeqIi.js";import"./v7.12-CApw0dbM.js";import{w as B}from"./v7.12-BL80EfKC.js";const O='<svg fill="none" height="17" viewBox="0 0 16 17" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m12.7275 6.86373-4.36373 4.36377-4.36374-4.36377" stroke="#2962f9" stroke-linecap="round" stroke-width="2"/></svg>',p=50,F=p*2,S=10,L="widgets-renderer",P=w({name:"TableOfContents",components:{SvgAsset:M},props:{elem:{type:Object,required:!0}},data:()=>({isInView:!1,isMenuOpened:!1,activeIndex:-1,title:"Ðглавление",scrolling:!0,scrollEndTimeout:null,breakpoints:null}),computed:{isMobile(){var e;return["mobile","tablet"].includes(((e=this.breakpoints)==null?void 0:e.breakpointCurrent)||"")},dropdown:()=>O,headings(){return this.elem.attributes.headings},headersNodes(){return document.querySelectorAll('main h2[id^="id"]')},articleElem(){return document.querySelector("article")},beforeHeaderParagraphElements(){return Array.from(this.headersNodes).map(e=>{let t=e.previousElementSibling;for(;t!=null&&t.previousElementSibling&&t.className===L;)t=t.previousElementSibling;return t||e})}},watch:{async isMenuOpened(e){e?(f.disable(),await this.$nextTick(),this.scrollToMenuItem()):f.enable()},isMobile(e){e?(this.setIsNavPartiallyInViewPort(),document.addEventListener("scroll",this.throttledScrollForNav(),{passive:!0})):document.removeEventListener("scroll",this.throttledScrollForNav())}},mounted(){this.breakpoints=new B,document.addEventListener("scroll",this.throttledScrollForMenu(),{passive:!0}),"scrollend"in window?document.addEventListener("scrollend",this.debouncedSetEnd()):document.addEventListener("scroll",this.setUpScrollEnd),(this._.provides[b]||this.$route).hash&&setTimeout(()=>{var e;(e=document.getElementById((this._.provides[b]||this.$route).hash.slice(1)))==null||e.scrollIntoView(!0)},0)},beforeUnmount(){document.removeEventListener("scroll",this.throttledScrollForMenu()),document.removeEventListener("scroll",this.throttledScrollForNav()),document.removeEventListener("scrollend",this.debouncedSetEnd())},methods:{setUpScrollEnd(){this.scrollEndTimeout&&clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.setScrollend()},100)},debouncedSetEnd(){return _(700,!1,this.setScrollend)},setScrollend(){this.scrolling=!1,this.scrollToMenuItem()},throttledScrollForMenu(){return v(200,this.checkMenuItem)},throttledScrollForNav(){return v(200,this.setIsNavPartiallyInViewPort)},handleClick(e,t){document.readyState!=="complete"&&(e.preventDefault(),setTimeout(()=>{this.headersNodes[t].scrollIntoView({block:"start",behavior:"smooth"})},0),history.replaceState({},"",`#id${t+1}`)),this.scrolling=!0,this.isMenuOpened=!1,this.sendAnalytics(this.headings[t])},sendAnalytics(e){this.$sendYandexMetrika({level1:"Ðглавление_вÑÐ±Ð¾Ñ Ð¿ÑнкÑа",level4:e.link,level5:e.content})},checkMenuItem(){var i;if(!this.headersNodes)return;if(this.headersNodes[0].getBoundingClientRect().bottom>=window.innerHeight||(((i=this.articleElem)==null?void 0:i.getBoundingClientRect().bottom)||0)<0){this.activeIndex=-1;return}let e=0;const t=this.isMobile?F:p;this.beforeHeaderParagraphElements.forEach((o,c)=>{const{bottom:d=0}=o.getBoundingClientRect()||{};d>t||(e=c)}),this.activeIndex=e,!this.isMobile&&this.scrollToMenuItem()},scrollToMenuItem(){const e=this.isMobile?this.$refs.mobileScrollbar:this.$refs.wrapper;if(this.activeIndex<0||!e||this.scrolling)return;const t=this.headings[this.activeIndex].link,i=e.querySelector(`a[href*="${t}"]`);if(!i)return;const o=i.getBoundingClientRect().top-e.getBoundingClientRect().top,c=i.offsetHeight;if(o>0&&o+c<e.offsetHeight)return;const d=o>0?o+c-e.offsetHeight+e.scrollTop+S:e.scrollTop+o-S;e.scrollTo({top:d,behavior:this.isMobile?"auto":"smooth"})},setIsNavPartiallyInViewPort(){if(!this.$refs.navContainer||!this.isMobile)return;const e=this.$refs.wrapper.getBoundingClientRect();this.isInView=e.bottom>=p+40},toggleMenu(){this.isMenuOpened=!this.isMenuOpened;const e=this.isMenuOpened?"РазвеÑнÑÑÑ":"СвеÑнÑÑÑ";this.$sendYandexMetrika({level1:"Ðглавление_клик",level4:"Ðез пеÑеÑ
ода",level5:e})}}},"$CxuBQteY65"),V={ref:"navContainer",class:"table-of-contents"},A={ref:"wrapper",class:"table-of-contents__block-wrapper"},H={class:"table-of-contents__title"},R=["href","onClick"],D={class:"table-of-contents__title sticky-nav__title"},q={class:"sticky-nav__icon-wrapper"},U={ref:"mobileScrollbar",class:"mobile-scrollbar"},Y=["href","onClick"];function z(e,t,i,o,c,d){const E=C("SvgAsset");
1return a(),r("nav",V,[s("div",A,[s("span",H,h(e.title),1),s("ol",null,[(a(!0),r(g,null,k(e.headings,(n,l)=>(a(),r("li",{key:`desktop-nav-heading-${l}`,class:m({active:e.activeIndex===l&&!e.isMobile})},[s("a",{class:"table-of-contents__link",href:n.link,onClick:u=>e.handleClick(u,l)},h(n.content),9,R)],2))),128))])],512),y(s("div",{class:m([{"sticky-nav--opened":e.isMenuOpened},"sticky-nav"])},[s("div",{class:"sticky-nav__title-wrapper",onClick:t[0]||(t[0]=(...n)=>e.toggleMenu&&e.toggleMenu(...n))},[s("span",D,h(e.title),1),s("div",q,[$(E,{class:"sticky-nav__icon",content:e.dropdown},null,8,["content"])])]),s("div",U,[s("ol",null,[(a(!0),r(g,null,k(e.headings,(n,l)=>(a(),r("li",{key:`mobile-nav-heading-${l}`,class:m({active:e.activeIndex===l})},[s("a",{class:"table-of-contents__link",href:n.link,onClick:u=>e.handleClick(u,l)},h(n.content),9,Y)],2))),128))])],512)],2),[[N,!e.isInView&&e.isMobile]]),e.isMenuOpened?(a(),r("div",{key:0,class:"dark-background",onClick:t[1]||(t[1]=(...n)=>e.toggleMenu&&e.toggleMenu(...n))})):T("",!0)],512)}const W=I(P,[["render",z],["__scopeId","data-v-b9e8fa6c"]]);export{W as default}; 2//# sourceMappingURL=v7.12-NbFgxhw6.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.