PageSourceSearch

https://cdn-mef.meforum.org/resource/0000018f-97ee-d484-a5df-b7fed21d0000/411.135013b40d046545b7cd.js

js meforum.org collected 2026-10-01 09:15:39 UTC 5,973 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbundle_default=self.webpackChunkbundle_default||[]).push([[411,488],{411:function(t,e,r){r.r(e),r.d(e,{default:function(){return n}});var i=r(2488);class n extends HTMLElement{connectedCallback(){this.addEventListener("click",this),this.addEventListener(i.events.active,this)}handleEvent(t){"click"===t.type&&this.onClick(t)}onClick(t){t.target.matches(".Book-header, .Book-header *")&&(this.expanded=!this.expanded)}get expanded(){return this.hasAttribute("data-expanded")}set expanded(t){this.toggleAttribute("data-expanded",t)}}},2488:function(t,e,r){r.r(e),r.d(e,{default:function(){return n},events:function(){return i}});const i={active:"Chapter:active"};class n extends HTMLElement{connectedCallback(){document.addEventListener("click",this),this.addEventListener("click",this),document.addEventListener(i.active,this),window.addEventListener("popstate",this),this.setAnchorChaptersBehaviour(),this.isCurrent&&this.emit(i.active)}async setAnchorChaptersBehaviour(){window.addEventListener("scroll",this,!0),window.addEventListener("resize",this),await customElements.whenDefined(this.localName),this.anchorChapters=[...this.childChapters].filter((t=>!!t.anchorTarget)),this.setAnchorChaptersState(),this.anchorChapters.length>0?(window.addEventListener("scroll",this,!0),window.addEventListener("resize",this)):(window.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this))}setAnchorChaptersState(){const t=this.anchorChapters.filter((t=>null!==t.anchorTarget.offsetParent)).reduce(((t,e)=>e.anchorTarget.getBoundingClientRect().top<=this.scrollDisplacement+1?e:t),null);this.querySelectorAll("[data-active]").forEach((t=>{t.removeAttribute("data-active")})),this.anchorChapters.forEach((e=>{e.isCurrent=e===t}))}removeExpandedAttribute(){this.book&&this.book.hasAttribute("expanded")&&(document.body.style.overflow="visible",this.book.removeAttribute("expanded"))}handleEvent(t){"resize"===t.type&&this.onResize(),"scroll"===t.type&&this.onScroll(t),"click"===t.type&&this.onClick(t),"popstate"===t.type&&this.onPopstate(t),t.type===i.active&&this.onActive(t)}get header(){return this.querySelector(":scope > .Chapter-header")}get link(){return this.header.querySelector(".Chapter-title a")}get url(){return this.link&&this.link.href?new URL(this.link.href):null}get book(){return this.closest("bsp-book")}set isCurrent(t){t?this.setAttribute("data-current",""):this.removeAttribute("data-current")}get isCurrent(){return this.hasAttribute("data-current")}get isExternal(){return this.hasAttribute("data-external")}set isExpanded(t){t?this.setAttribute("data-expanded",""):this.removeAttribute("data-expanded")}get isExpanded(){return this.hasAttribute("data-expanded")}get childChapters(){return this.querySelectorAll(":scope > ul > li > bsp-chapter")}get anchorTarget(){if(!this.url)return null;const t=this.url.hash;if(!t)return null;const e=document.querySelector(t);return this.url.pathname===location.pathname&&this.url.hash&&!e?null:e}async getContent(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isCurrent)return;const e=new URL(this.url);e.searchParams.set("fragment",!0);const r=await fetch(e),n=await r.text(),s=(new DOMParser).parseFromString(n,"text/html"),a=s.querySelector("[data-companion-content]"),h=document.querySelector("[data-companion-content]");h.parentNode.replaceChild(a,h);const o=s.querySelector("[data-supplementary-content]"),l=document.querySelector("[data-supplementary-content]");o&&l&&(l.innerHTML=o.innerHTML),document.title=s.title,this.isCurrent=!0,this.emit(i.active);const c=e.hash&&e.hash.length>1?document.querySelector(e.hash):null;if(c)c.scrollIntoView();else{const t=40,e=a.getBoundingClientRect().top+document.documentElement.scrollTop-t;window.scrollY>e&&window.scrollTo(0,e),this.childChapters.length>0&&(this.isExpanded=!0)}document.body.dispatchEvent(new Event("Ajax:Rendered")),t||window.history.pushState({},"",this.url)}onClick(t){if(t.currentTarget===document){if(!this.url)return;const e=t.target.matches(`a[href="${this.url}"]`)?t.target:t.target.closest(`a[href="${this.url}"]`);if(!e)return;if(e.matches('[target="_blank]"'))return;if(location.href.split("#")[0]===e.href.split("#")[0])return;return t.preventDefault(),this.getContent(),void this.removeExpandedAttribute()}if(t.stopPropagation(),t.metaKey||t.ctrlKey)return;if(this.anchorTarget)return void this.removeExpandedAttribute();const e=t.target.matches(".Chapter-icon, .Chapter-icon *"),r=!this.link&&this.childCh
1apters.length>0&&t.target.matches(".Chapter-title, .Chapter-title *"),i=this.link&&this.childChapters.length>0&&t.target.matches(".Chapter-title, .Chapter-title *")&&location.href.split("#")[0]===this.url.href.split("#")[0];if(e||r||i)return i&&t.preventDefault(),void(this.isExpanded=!this.isExpanded);this.book&&this.book.hasAttribute("data-is-no-ajax")||(!this.isExternal&&this.link&&"_blank"!==this.link.getAttribute("target")?this.link&&t.target.matches(".Chapter-title, .Chapter-title *")&&(t.preventDefault(),this.getContent().then((()=>{this.removeExpandedAttribute()})).catch((t=>{console.error(t.message)}))):this.removeExpandedAttribute())}onActive(t){this.isCurrent=t.target===this,(t.target===this||this.contains(t.target))&&(this.isExpanded=!0),[...this.childChapters].includes(t.target)&&t.target.anchorTarget&&(this.isCurrent=!0),this.setAnchorChaptersBehaviour()}onPopstate(t){if(this.url&&this.url.href===location.href){t.stopPropagation();const e=!0;this.getContent(e)}}onScroll(){this.setAnchorChaptersState()}emit(t){const e=new CustomEvent(t,{bubbles:!0,detail:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}});this.dispatchEvent(e)}disconnectedCallback(){document.removeEventListener("click",this),this.removeEventListener("click",this),document.removeEventListener(i.active,this),window.removeEventListener("popstate",this),window.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)}}}}]);

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.