1(()=>{"use strict";var e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>s});class s{constructor(e,t={}){this.el=e,this.settings=this._mergeSettings(t),this.elements={},this.position={left:0,x:0,dx:0,dxLast:0,time:0,lastTime:0},this.noScroll=!0,this.scrollTimer=null,this.activeObserver=null,this.animationFrame=null,this.focusInfo={inFocus:0,focusUp:0,focusDown:0,snapUp:0,snapDown:0},this._initElements(),this.elements.scroller&&0!==this.elements.items.length?(this._bindEvents(),this.update(),this._updateFocus(),this._initObserver(),this.el.style.opacity="1"):this.el.style.opacity="1"}_mergeSettings(e){const t={arrowScrollMode:"page",updateFocus:!1,dragThreshold:3,preventClickAfterDrag:!0,preventDrag:!1,classes:{inFocus:"nsInFocus",grab:"nsGrab",active:"active",disabled:"nsDisabled",noScroll:"nsNoScroll"},selectors:{arrowLeft:".nsLeftArrow",arrowRight:".nsRightArrow",scroller:".nsContent",items:"",progressTrack:".nsProgressTrack",progressIndicator:".nsProgressIndicator"}};return{...t,...e,classes:{...t.classes,...e.classes||{}},selectors:{...t.selectors,...e.selectors||{}}}}_initElements(){const e=this.settings.selectors;this.elements.arrowLeft=this.el.querySelector(e.arrowLeft),this.elements.arrowRight=this.el.querySelector(e.arrowRight),this.elements.scroller=this.el.querySelector(e.scroller),this.elements.items=e.items?Array.from(this.el.querySelectorAll(e.items)):Array.from(this.elements.scroller.children),this.elements.progressTrack=this.el.querySelector(e.progressTrack),this.elements.progressIndicator=this.el.querySelector(e.progressIndicator)}_bindEvents(){this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOnWheel=this._clearScrollBehaviour.bind(this),this._boundOnTouchStart=this._clearScrollBehaviour.bind(this),this._boundOnMouseDown=this._onMouseDown.bind(this),this._boundOnArrowLeftClick=e=>this._onArrowClick(e,!0),this._boundOnArrowRightClick=e=>this._onArrowClick(e,!1),this._boundResize=this._debounce(()=>this.update(),250);const e=this.elements.scroller;e.addEventListener("scroll",this._boundOnScroll),e.addEventListener("wheel",this._boundOnWheel),e.addEventListener("touchstart",this._boundOnTouchStart),this.elements.arrowLeft?.addEventListener("click",this._boundOnArrowLeftClick),this.elements.arrowRight?.addEventListener("click",this._boundOnArrowRightClick),this.settings.preventDrag||(e.addEventListener("mousedown",this._boundOnMouseDown),this.settings.preventClickAfterDrag&&(this._boundClickDuringDrag=e=>this._onClickDuringDrag(e),e.addEventListener("click",this._boundClickDuringDrag,!0))),window.addEventListener("resize",this._boundResize)}destroy(){const e=this.elements.scroller;e?.removeEventListener("scroll",this._boundOnScroll),e?.removeEventListener("mousedown",this._boundOnMouseDown),e?.removeEventListener("wheel",this._boundOnWheel),e?.removeEventListener("touchstart",this._boundOnTouchStart),window.removeEventListener("resize",this._boundResize),!this.settings.preventDrag&&this.settings.preventClickAfterDrag&&e?.removeEventListener("click",this._boundClickDuringDrag,!0),this.elements.arrowLeft?.removeEventListener("click",this._boundOnArrowLeftClick),this.elements.arrowRight?.removeEventListener("click",this._boundOnArrowRightClick),document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp),clearTimeout(this.scrollTimer),cancelAnimationFrame(this.animationFrame),this.activeObserver?.disconnect(),this.el=null,this.elements=null,this.activeObserver=null}_initObserver(){this.activeObserver=new IntersectionObserver(e=>{for(const t of e){const e=this.settings.classes.active;t.isIntersecting?(t.target.classList.add(e),this.el.dispatchEvent(new CustomEvent("the7-ns:item-active",{detail:t.target}))):(t.target.classList.remove(e),this.el.dispatchEvent(new CustomEvent("the7-ns:item-not-active",{detail:t.target})))}},{root:this.elements.scroller,rootMargin:"100% 0% 100% 0%",threshold:0}
1),this.elements.items.forEach(e=>this.activeObserver.observe(e))}_onScroll(){clearTimeout(this.scrollTimer),this._updateScrollIndicator(),this.scrollTimer=setTimeout(()=>{this._updateFocus(),this._updateScroller(),this.scrollTimer=null},50)}_onArrowClick(e,t){if(!this.scrollTimer)if(e.preventDefault(),this._clearScrollBehaviour(),"page"===this.settings.arrowScrollMode){const e=this.elements.scroller,s=.7*e.clientWidth,i=t?Math.max(e.scrollLeft-s,0):Math.min(e.scrollLeft+s,e.scrollWidth-e.clientWidth);e.scrollTo({left:i,behavior:"smooth"})}else{this._findSnap();const e=t?this.focusInfo.snapDown:this.focusInfo.snapUp;this.elements.scroller.scrollTo({left:e,behavior:"smooth"})}}_onMouseDown(e){this.noScroll||e.target.closest(".is-selected")||(e.preventDefault(),this.position={left:this.elements.scroller.scrollLeft,x:e.clientX,dx:0,dxLast:0,time:Date.now(),lastTime:Date.now()},this.elements.scroller.classList.add(this.settings.classes.grab),this.elements.scroller.style.scrollBehavior="auto",this.elements.scroller.style.scrollSnapType="none",cancelAnimationFrame(this.animationFrame),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp))}_onMouseMove(e){e.preventDefault(),this._latestClientX=e.clientX,this._rafPending=!1;const t=this.position;t.dxLast=t.dx,t.lastTime=t.time,t.time=Date.now(),t.dx=this._latestClientX-t.x,this.elements.scroller.scrollLeft=t.left-t.dx}_onMouseUp(){const e=this.elements.scroller;e.classList.remove(this.settings.classes.grab);const t=this.position;if("none"===this._getSnapAlign()){const s=t.dxLast-t.dx,i=t.time-t.lastTime,o=Math.ceil(s/i*16),n=.85;let r=Math.abs(o);const l=Math.sign(o),c=()=>{r>1&&(e.scrollLeft+=l*r,r*=n,this.animationFrame=requestAnimationFrame(c))};c()}else this._findSnap(),e.style.scrollBehavior="",t.dx<0?e.scrollLeft=this.focusInfo.snapUp:t.dx>0&&(e.scrollLeft=this.focusInfo.snapDown);document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp)}_onClickDuringDrag(e){this.noScroll||Math.abs(this.position.dx)>this.settings.dragThreshold&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}_clearScrollBehaviour(){cancelAnimationFrame(this.animationFrame);const e=this.elements.scroller;e.style.scrollSnapType="",e.style.scrollBehavior=""}update(){this._updateScroller(),this._updateProgress(),this._updateScrollIndicator()}_updateScroller(){const e=this.elements.scroller,t=e.scrollWidth-e.clientWidth;e.scrollWidth>e.clientWidth?(this.el.classList.remove(this.settings.classes.noScroll),this.noScroll=!1,this.settings.preventDrag||(e.style.cursor="grab"),this._toggleDisabled(this.elements.arrowLeft,e.scrollLeft<=0),this._toggleDisabled(this.elements.arrowRight,e.scrollLeft>=t-2)):(this.el.classList.add(this.settings.classes.noScroll),this.noScroll=!0,e.style.cursor="",this._toggleDisabled(this.elements.arrowLeft,!0),this._toggleDisabled(this.elements.arrowRight,!0))}_updateProgress(){const e=this.elements.scroller,t=this.elements.progressIndicator;if(!t)return;const s=e.offsetWidth/e.scrollWidth,i=Math.min(100*s,100);t.style.width=i+"%"}_updateScrollIndicator(){const e=this.elements.scroller,t=this.elements.progressTrack,s=this.elements.progressIndicator;if(!t||!s)return;const i=(t.clientWidth-s.offsetWidth)*(e.scrollWidth>e.clientWidth?e.scrollLeft/(e.scrollWidth-e.clientWidth):0);s.style.setProperty("--ns-progress-bar-translate-x",`${i}px`)}_updateFocus(){if(!this.settings.updateFocus)return;const e=this.elements.items,t=this._getSnapAlign(),s=this.elements.scroller.scrollLeft+this._getSnapPoint(t);let i=0,o=1/0;e.forEach((e,n)=>{const r=Math.abs(s-this._getItemPosition(e,t));r<o&&(o=r,i=n)}),this.elements.items.forEach(e=>e.classList.remove(this.settings.classes.inFocus)),this.elements.items[i].classList.add(this.settings.classes.inFocus)}_getSnapAlign(){return getComputedStyle(this.elements.items[0]).scrollSnapAlign||"start"}_getSnapPoint(e){const t=this.elements.scroller,s=this.elements.items[0];switch(e){case"center":return t.clientWidth/2;case"end":return t.clientWidth-s.offsetLeft;default:return s.offsetLeft}}_getItemPosition(e,t){if(!e)return 0;let s=e.offsetLeft;return"center"===t&&(s+=e.offsetWidth/2),"end"===t&&(s+=e.offsetWidth),s}_findSnap(){const e=this.elements.scroller,t=this.elements.items,s=this._getSnapAlign(),i=this._getSnapPoint(s),o=e.scrollLeft+i;for(let e=0;e<t.length;e++){const n=t[e],r=this._getItemPosition(n,s),l=this._getItemPosition(t[e-1],s),c=this._getItemPosition(t[e+1],s),h=Math.round(r-o);if(h<-1)e<t.length-1?(this.focusInfo.focusDown=e,this.focusInfo.snapDown=r-i,this.focusInfo.focusUp=e+1,this.focusInfo.snapUp=c-i):e===t.length-1&&(this.focusInfo.focusDown=e-1,this.focusInfo.snapDown=l-i,this.focusInfo.focusUp=e,this.focusInfo.snapUp=r-i);else{if(!(h>=-1&&h<=1))break;0===e?(this.focusInfo.focusDown=e,this.focusInfo.snapDown=r-i,this.focusInfo.focusUp=e+1,this.focusInfo.snapUp=c-i):e>0&&e<t.length-1?(this.focusInfo.focusDown=e-1,this.focusInfo.snapDown=l-i,this.focusInfo.focusUp=e+1,this.focusInfo.snapUp=c-i):e===t.length-1&&(this.focusInfo.focusDown=e-1,this.focusInfo.snapDown=l-i,this.focusInfo.focusUp=e,this.focusInfo.snapUp=r-i)}}}snapTo(e){if(e<0||e>=this.elements.items.length)return;const t=this._getSnapAlign(),s=this._getSnapPoint(t),i=this._getItemPosition(this.elements.items[e],t);this.elements.scroller.scrollTo({left:i-s})}_toggleDisabled(e,t){e&&e.classList.toggle(this.settings.classes.disabled,t)}_debounce(e,t){let s;return(...i)=>{clearTimeout(s),s=setTimeout(()=>e.apply(this,i),t)}}}(window.wpbbe=window.wpbbe||{})["multipurpose-scroller"]=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.