PageSourceSearch

https://zinkbakken.dk/theme/89fec0e0143898505c6fffd88afa0419/js/ze…m-horizon.zen-nav-scroller.plugin.f4e838.js

js zinkbakken.dk collected 2026-09-26 07:49:42 UTC 8,163 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[26530],{6530:(t,e,i)=>{i.r(e),i.d(e,{default:()=>r});var o=i(4049),s=i(9610),n=i(3266);class r extends window.PluginBaseClass{init(){let t=this.options;this._list=o.Z.querySelector(this.el,t.listSelector),this._list&&(this._scrollStep="auto"===t.scrollStep?this._list.offsetWidth/2:parseFloat(t.scrollStep),this.initTemplate(),this.registerEvents(),document.fonts.ready.then(()=>{this.updateButtons(),this._activeChild=o.Z.querySelector(this._list,t.activeItemSelector,!1),this._activeChild&&this.jumpToElement(this._activeChild)}))}registerEvents(){let t="click";window.addEventListener("resize",s.Z.debounce(this._onResize.bind(this),this.options.resizeDebounceTime)),this._prevControl.addEventListener(t,this.onPrevControlClick.bind(this)),this._nextControl.addEventListener(t,this.onNextControlClick.bind(this)),this._list.addEventListener("scroll",this.updateButtons.bind(this)),this._list.addEventListener("keydown",t=>{("Tab"===t.code||9===t.keyCode)&&setTimeout(()=>{let t=document.activeElement;this._list.contains(t)&&t.scrollIntoView({behavior:"smooth",block:"end"})},0)})}initTemplate(){let t=this.options,e=o.Z.querySelector(this.el,t.containerSelector,!1);if(this.el.classList.add(t.mainNavigationClass),this._list.classList.add(t.listClass),n.Z.iterate(this._list.children,e=>{e.classList.add(t.itemClass)}),this._prevControl=o.Z.querySelector(this.el,t.prevControlSelector,!1),!this._prevControl){this._prevControl=document.createElement("button");let i=document.createElement("span");i.innerHTML=t.prevControlContent,this._prevControl.appendChild(i),e.appendChild(this._prevControl)}if(this._prevControl.classList.add(...t.prevControlClass),this._nextControl=o.Z.querySelector(this.el,t.nextControlSelector,!1),!this._nextControl){this._nextControl=document.createElement("button");let i=document.createElement("span");i.innerHTML=t.nextControlContent,this._nextControl.appendChild(i),e.appendChild(this._nextControl)}this._nextControl.classList.add(...t.nextControlClass),this.$emitter.publish("onInitTemplate")}updateButtons(){let t=Math.ceil(this._list.getBoundingClientRect().width),e=this._list.scrollWidth,i=this._list.scrollLeft;i>0?this._prevControl.style.display="block":this._prevControl.style.display="none",e>t&&i<e-t?this._nextControl.style.display="block":this._nextControl.style.display="none",this.$emitter.publish("onUpdateButtons")}_onResize(){let t=this.options,e=this._list.getBoundingClientRect().width;"auto"===t.scrollStep&&(this._scrollStep=e/2),this.updateButtons(),this.$emitter.publish("onResize")}onPrevControlClick(t){t.preventDefault(),this.addOffset(-1*this._scrollStep),this.$emitter.publish("onPrevControlClick")}onNextControlClick(t){t.preventDefault(),this.addOffset(this._scrollStep),this.$emitter.publish("onNextControlClick")}addOffset(t){this.setOffset(this._list.scrollLeft+t),this.$emitter.publish("onAddOffset")}setOffset(t,e){let i=this.options.animationSpeed,o=this._list.getBoundingClientRect().width,s=Math.max(0,Math.min(this._list.scrollWidth-o,t));if(!1!==e){this._list.scrollTo({left:s,behavior:"smooth"}),setTimeout(()=>{this.updateButtons()},i);return}this._list.scrollTo({left:s}),this.updateButtons(),this.$emitter.publish("onSetOffset")}jumpToElement(t){let e;let i=this.options,o=this._list.getBoundingClientRect().width,s=this._list.scrollLeft,n=t.getBoundingClientRect(),r=t.offsetLeft,l=r+n.width;e=r>s&&l>s+o?l-o+i.controlOffset:Math.min(r,s),this.setOffset(e,!1),this.$emitter.publish("onJumpToElement")}}r.options={activeItemSelector:".active",mainNavigationClass:"js-main-navigation-scroller",containerSelector:".container",listSelector:".main-navigation-menu",listClass:"js-main-navigation-scroller-menu",itemClass:"js-main-navigation-scroller-link",prevControlSelector:".main-navigation-scroller-controls-prev",nextControlSelector:".main-navigation-scroller-controls-next",prevControlClass:["btn","btn-light","p-0","js-main-navigation-scroller-controls","left-control"],nextControlClass:["btn","btn-light","p-0","js-main-navigation-scroller-controls","right-control"],prevControlContent:"&#10094;",nextControlContent:"&#10095;",scrollStep:"auto",animationSpeed:400,controlOffset:50,resizeDebounceTime:200}},9610:(t,e,i)=>{i.d(e,{Z:()=>o});class o{static debounce(t,e){let i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var s=arguments.length,n=Array(s),r=0;r<s;r++)n[r]=arguments[r];o&&!i&&setTimeout(t.bind(t,...n),0),clearTimeout(i),i=setTimeout(t.bind(t,...n),e)}}}},4049:(t,e,i)=>{i.d(e,{Z:()=>s});var o=i(5140);class s{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!s.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===s.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),r=o.Z.toLowerCamelCase(n,"-");if(!s.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let l=t.dataset[r];if(void 0===l){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return l}return o.Z.parsePrimitive(l)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let o=t.querySelector(e)||!1;if(i&&!1===o)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return o}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let o=t.querySelectorAll(e);if(0===o.length&&(o=!1),i&&!1===o)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return o}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not
1([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},3266:(t,e,i)=>{i.d(e,{Z:()=>o});class o{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>{e(t[i],i)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}},5140:(t,e,i)=>{i.d(e,{Z:()=>o});class o{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=o.toUpperCamelCase(t,e);return o.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>o.ucFirst(t.toLowerCase())).join(""):o.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}}}]);

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.