1(()=>{"use strict";class t{static get STICKY_ELEMENTS_SELECTOR(){return".js-scroll-controller-sticky-el"}constructor(){window.MediaSizeBroadcaster=!0,this.stickyElements=[],this._init(),this._bindEvents()}_init(){document.querySelectorAll(t.STICKY_ELEMENTS_SELECTOR).forEach(t=>{const s=t.dataset.scStickySizes,e={element:t};s&&(e.sizes=s.split(",")),this.stickyElements.push(e)})}_bindEvents(){this._onMediaChange=this._onMediaChange.bind(this),window.addEventListener("com.consumeraffairs.styleguide.mediaChange",this._onMediaChange)}_onMediaChange(t){let{detail:s}=t;this._calculateOffset(s.media)}_calculateOffset(t){let s=16;this.stickyElements.forEach(e=>{e.sizes&&!e.sizes.includes(t)||(s+=e.element.getBoundingClientRect().height)}),this.offset=s,window.scrollController&&window.scrollController.setHeaderOffset(s)}}window.scrollController=new class{constructor(){window.SmoothScroller&&(this._bindScope(),this._bindEvents())}_bindScope(){this._onClick=this._onClick.bind(this),this._onLoad=this._onLoad.bind(this)}_bindEvents(){window.addEventListener("click",this._onClick),window.addEventListener("load",this._onLoad)}setActiveHash(t){this._activeHash=t}_hasActiveHash(){return this._activeHash}setOffset(t){this._offset=t}setHeaderOffset(t){this.setOffset(t),this._updateLocalScroll(),this._hasActiveHash()&&this.smoothScroll()}smoothScroll(t){t=t||this._activeHash,this._isInDOM(t)&&(this.setActiveHash(t),this._applyScroll())}_isInDOM(t){return!!this._getElement(t)}_getElement(t){const s=t.replace("#","");return document.getElementById(s)}_applyScroll(){let t=!1;return this._isInDOM(this._activeHash)&&(t=window.SmoothScroller.scrollWindowTo(this._activeHash,{duration:1500,offset:-this._offset})),t}_updateLocalScroll(){let t=!1;return this._activeHash&&(t=window.SmoothScroller.scrollWindowTo(this._activeHash,{duration:500,offset:-this._offset})),t}_onHashChange(t){return(this._isInDOM(t)||t===this._activeHash)&&(this.setActiveHash(t),this._updateLocalScroll()),!1}_onSameHash(t){t&&this._onHashChange(t)}
1_onClick(t){this._onSameHash(t.target.hash)}_onLoad(){const{hash:t}=window.location;return this._isInDOM(t)&&this.setActiveHash(t),this._activeHash&&this._updateLocalScroll(),!1}},new t})();
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.