1/*! 2* Common client JS-dependencies 3* (c) Publish Lab AS 4* https://www.labradorcms.com 5*/ 6(()=>{"use strict";var e,t;!function(){const e=document.querySelectorAll("[data-expandable]"),t=e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget.classList.toggle("expanded")};for(const i of e)i.addEventListener("click",t,!1)}(),function(){function e(e,t,i){if(!e)return"";try{var s=new URL(e,document.baseURI);return s.searchParams.set("width",t),s.searchParams.set("height",i),s.toString()}catch{var n=-1===e.indexOf("?")?"?":"&";return e+n+"width="+t+"&height="+i}}function t(e){var t=(e.naturalWidth||e.width||parseInt(e.getAttribute("width"),10))/(e.naturalHeight||e.height||parseInt(e.getAttribute("height"),10));if(!t)return null;var i=Math.min(1740,window.innerWidth),s=i/t,n=Math.min(1740,window.innerHeight);return s>n&&(i=(s=n)*t),{width:Math.round(1.5*i),height:Math.round(1.5*s),isWide:t>=1}}class i{constructor(e,t){this.sourceFigures=e,this.settings=t||{},this.container=null,this.dialog=null,this.itemsContainer=null,this.slides=[],this.swipeHelper=null,this.currentIndex=0,this.lastFocusedElement=null,this.boundKeydown=this.onKeydown.bind(this)}bindSourceImages(){this.sourceFigures.forEach((e,t)=>{e.classList.add("article-image-carousel-source"),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","Open image "+(t+1)+" of "+this.sourceFigures.length),e.setAttribute("title",this.settings.viewGalleryLabel||"View Gallery"),e.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.open(t,e)},!1),e.addEventListener("keydown",i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.open(t,e))},!1)})}create(){if(!this.container){this.container=document.createElement("div"),this.container.classList.add("imagezoom","article-image-carousel"),this.settings.darkLayout&&this.container.classList.add("article-image-carousel--dark"),this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.setAttribute("aria-label","Article image carousel"),this.dialog=document.createElement("div"),this.dialog.classList.add("article-image-carousel__dialog"),this.dialog.setAttribute("tabindex","-1"),this.itemsContainer=document.createElement("div"),this.itemsContainer.classList.add("article-image-carousel__items","scroll-container","swipehelper","snap-container-x","snap-element-start"),this.sourceFigures.forEach((e,t)=>{var i=this.createSlide(e,t);this.slides.push(i),this.itemsContainer.appendChild(i)});var e=document.createElement("nav");e.classList.add("article-image-carousel__navigation"),e.setAttribute("aria-label","Image navigation");var t=this.createNavigationButton("article-image-carousel__previous arrow left","Previous image"),i=this.createNavigationButton("article-image-carousel__next arrow right","Next image"),s=document.createElement("span");s.classList.add("article-image-carousel__counter"),s.setAttribute("aria-live","polite"),e.appendChild(t),e.appendChild(i);var n=document.createElement("button");n.type="button",n.classList.add("close-btn","article-image-carousel__close"),n.setAttribute("aria-label","Close image carousel"),n.addEventListener("click",()=>this.close(),!1);var r=document.createElement("div");r.classList.add("article-image-carousel__toolbar"),r.appendChild(s),r.appendChild(n),this.dialog.appendChild(r),this.dialog.appendChild(this.itemsContainer),this.dialog.appendChild(e),this.container.appendChild(this.dialog),document.body.appendChild(this.container),this.container.addEventListener("click",e=>{e.target===this.container&&this.close()},!1),this.slides.length<2&&e.classList.add("article-image-carousel__navigation--single")}}initializeSwipeHelper(){this.swipeHelper||this.slides.length<2||!window.Dac||!window.Dac.SwipeHelper||(this.swipeHelper=new window.Dac.SwipeHelper(this.container,{isHorizontal:!0,itemsContainerSelector:".article-image-carousel__items",itemsSelector:".article-image-carousel__slide",navItems:{forwardSelector:".article-image-carousel__next",backwardSelector:".article-image-carousel__previous"},preloadNextImage:!0,autoScroll:{enabled:!1}}),this.swipeHelper.addNavUpdate(e=>this.setCurrentIndex(e)))}createNavigationButton(e,t){var i=document.createElement("button");i.type="button",i.className=e,i.setAttribute("aria-label",t);var s=document.createElement("span");return s.setAttribute("aria-hidden","true"),i.appendChild(s),i}createSlide(e,t){var i=document.createElement("div");i.classList.add("article-image-carousel__slide","scroll-item","snap-element"),i.setAttribute("data-carousel-index",t);var s=document.createElement("figure"),n=document.createElement("div");n.classList.add("article-image-carousel__media","img");var r=e.querySelector(".img picture").cloneNode(!0),a=r.querySelector("img");a.setAttribute("loading","lazy"),a.removeAttribute("fetchpriority"),n.appendChild(r),s.appendChild(n);var o=function(e){if(!e)return null;var t=e.cloneNode(!0);for(var i of(t.removeAttribute("data-expandable"),t.classList.remove("expanded","truncate"),t.querySelectorAll(".caption-toggle")))i.remove();for(var s of t.querySelectorAll("a")){var n=document.createTextNode(s.textContent||"");s.replaceWith(n)}for(var r of t.querySelectorAll("[id]"))r.removeAttribute("id");return t}(function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(i.classList.contains("caption"))return i;if(i.classList.contains("content"))for(var s=0;s<i.children.length;s++)if(i.children[s].classList.contains("caption"))return i.children[s]}var n=e.closest(".articleHeader");if(n)for(var r=0;r<n.children.length;r++)if(n.children[r].classList.contains("caption"))return n.children[r];return null}(e));return o&&(i.classList.add("article-image-carousel__slide--has-caption"),s.appendChild(o)),i.appendChild(s),i}open(e,t){this.lastFocusedElement=t||document.activeElement,this.create(),this.container.hidden=!1,this.container.classList.add("visible"),document.body.classList.add("article-image-carousel-open"),document.addEventListener("keydown",this.boundKeydown,!1),this.setCurrentIndex(e),requestAnimationFrame(()=>{this.initializeSwipeHelper(),this.swipeHelper?this.swipeHelper.navigateToIndex(e,"auto"):this.itemsContainer.scrollLeft=0,this.dialog.focus()})}close(){this.container&&!this.container.hidden&&(this.container.classList.remove("visible"),this.container.hidden=!0,document.body.classList.remove("article-image-carousel-open"),document.removeEventListener("keydown",this.boundKeydown,!1),this.lastFocusedElement&&this.lastFocusedElement.focus&&this.lastFocusedElement.focus())}setCurrentIndex(e){this.slides[e]&&(this.currentIndex=e,this.container.classList.toggle("article-image-carousel--has-caption",this.slides[e].classList.contains("article-image-carousel__slide--has-caption")),this.container.querySelector(".article-image-carousel__counter").textContent=e+1+" / "+this.slides.length,this.slides.forEac
6h((t,i)=>{t.setAttribute("aria-hidden",i===e?"false":"true")}),this.prepareLargeImage(e),this.slides[e+1]&&this.prepareLargeImage(e+1))}prepareLargeImage(i){var s=this.slides[i];if(s&&"true"!==s.dataset.largeImageReady){var n=this.sourceFigures[i],r=n.querySelector(".img picture img"),a=s.querySelector("picture"),o=a.querySelector("img"),l=t(r);if(l){s.dataset.largeImageReady="true",s.classList.add("image-loading"),o.removeAttribute("width"),o.removeAttribute("height"),o.removeAttribute("loading");var c=n.querySelectorAll(".img picture source");a.querySelectorAll("source").forEach((t,i)=>{var s=c[i],n=function(e){return e?e.split(",")[0].trim().split(/\s+/)[0]:""}(s?s.getAttribute("srcset"):r.currentSrc);t.setAttribute("srcset",e(n,l.width,l.height)),t.removeAttribute("width"),t.removeAttribute("height")});var d=r.currentSrc||r.getAttribute("src");o.setAttribute("src",e(d,l.width,l.height));var h=function(){s.classList.remove("image-loading")};o.addEventListener("load",h,{once:!0}),o.addEventListener("error",h,{once:!0}),o.complete&&h()}}}navigateTo(e){var t=Math.max(0,Math.min(e,this.slides.length-1));t!==this.currentIndex&&(this.setCurrentIndex(t),this.swipeHelper&&this.swipeHelper.navigateToIndex(t,"smooth"))}onKeydown(e){if("Escape"===e.key)return e.preventDefault(),void this.close();if("ArrowLeft"===e.key)return e.preventDefault(),void this.navigateTo(this.currentIndex-1);if("ArrowRight"===e.key)return e.preventDefault(),void this.navigateTo(this.currentIndex+1);if("Tab"===e.key){var t=[...this.container.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')].filter(e=>!e.closest('[aria-hidden="true"]'));if(!t.length)return e.preventDefault(),void this.dialog.focus();var i=t[0],s=t[t.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s||(e.preventDefault(),i.focus())}}}document.body.hasAttribute("data-article-image-carousel")?function(){var e=function(){if(!window.dachserData||"function"!=typeof window.dachserData.get)return null;var e=window.dachserData.get("articleImageCarousel");return Array.isArray(e)&&e.length?e[e.length-1]:null}();if(e){var t=function(e){var t=document.querySelector("#main");if(!t||!Array.isArray(e))return[];var i=new Map;for(var s of t.querySelectorAll("figure[data-element-guid]")){var n=s.getAttribute("data-element-guid");n&&!i.has(n)&&i.set(n,s)}var r=[];for(var a of e)if(a&&"string"==typeof a.guid){var o=i.get(a.guid);o&&o.querySelector(".img picture img")&&!r.includes(o)&&r.push(o)}return r}(e.items);t.length&&new i(t,{darkLayout:!0===e.darkLayout,viewGalleryLabel:e.viewGalleryLabel}).bindSourceImages()}}():function(){var i=null,s=null,n=document.querySelectorAll("figure[data-zoomable='1']");if(n.length){var r=function(){i.classList.remove("visible"),document.removeEventListener("keydown",a,!1)},a=function(e){"Escape"===e.key&&r()},o=function(n){i||((i=document.createElement("div")).classList.add("imagezoom"),(s=document.createElement("div")).classList.add("content"),i.appendChild(s),document.body.appendChild(i));var o=n.querySelector("img"),l=o?t(o):null;if(o&&l){var c=n.cloneNode(!0),d=c.querySelector("img"),h=e(o.currentSrc||o.src,l.width,l.height);for(var u of c.querySelectorAll("source"))u.setAttribute("srcset",h);d.setAttribute("src",h),d.removeAttribute("width"),d.removeAttribute("height"),c.classList.add("image-loading");var m=d.getAttribute("style")||"";d.style.width="100vw",d.addEventListener("load",function(){d.setAttribute("style",m),c.classList.remove("image-loading")},!1),d.addEventListener("click",r,!1),s.setAttribute("data-isWide",l.isWide?"true":"false"),s.replaceChildren(c);var g=document.createElement("span");g.setAttribute("title","Close (Escape)"),g.classList.add("close-btn","fi-x"),g.addEventListener("click",r,!1),s.appendChild(g),i.classList.add("visible"),document.addEventListener("keydown",a,!1)}};for(var l of n)l.addEventListener("click",function(e){o(e.currentTarget)},!1)}}()}(),window.Dac||(window.Dac={}),window.Dac.AutoScroller=function(e,t,i){var s=null;if(e){var n=e.querySelector("ul.articles");if(n){var r=n.children;if(r.length){var a=e.querySelector("span.left"),o=e.querySelector("span.right"),l=0,c=r[0].offsetWidth,d=Math.round(n.offsetWidth/c),h=n.offsetWidth/d,u=i||4e3;if(!(d>=r.length)){var m,g=[],p=function(){g=[];for(var e=0;e<r.length;e++)g.push(new f(r[e],h))};window.ResizeObserver&&(m=new ResizeObserver(e=>{for(let i of e)if(i.target===n){var t=r[0].offsetWidth;t!==c&&(c=t,h=n.offsetWidth/d,p(),y(1))}}));var v=e.querySelector("ul.dots"),f=function(e,t){this.element=e,this.slotWidth=t,this.xPos=0,this.step=function(e,t){this.xPos-=this.slotWidth*e,this.move(this.xPos,t)},this.reset=function(){this.xPos=0,this.move(0)},this.move=function(e,t){var i=this.element;t?i.classList.add("transformHidden"):i.classList.remove("transformHidden"),i.style.transform="translateX("+e+"px)"};var i=this;return{step:function(e,t){i.step(e,t)},reset:function(){i.reset()}}},w=function(e,t){var i=l;l+=e,Math.abs(l)>=g.length&&(l=0),g.forEach(function(i){i.step(e,t)}),e>0?b(Math.abs(e)):e<0&&y(Math.abs(e)),S(l,i)},b=function(e){var t=g.shift();t.step(-2-g.length,!0),window.setTimeout(function(){t.step(1)},50),g.push(t),--e>0&&b(e)},y=function(e){var t=g.pop();g.unshift(t),t.step(g.length,!0),--e>0&&y(e)};if(a&&a.addEventListener("click",function(){w(-1),t=!1},!1),o&&o.addEventListener("click",function(){w(1),t=!1},!1),v){for(var I=0;I<v.children.length;I++)v.children[I].addEventListener("click",x,!1);S(0)}p(),y(1),m&&m.observe(n),t&&(s=window.setInterval(function(){t?w(1):window.clearInterval(s)},u))}}}}function x(e){e.preventDefault(),e.stopPropagation();var i,s=(i=this,Array.prototype.slice.call(i.parentNode.children).indexOf(i));s>-1&&w(s-l,!0),t=!1}function S(e,t){if(v){var i=v.children[t];i&&i.classList.remove("selected");var s=v.children[e];s&&s.classList.add("selected")}}},(()=>{window.Dac||(window.Dac={});let{Dac:e}=window;e.SwipeHelper=class{constructor(e,t){this.debug=window.location.toString().includes("debug="),this.log("Creating instance ..."),this.settings={isHorizontal:t.isHorizontal,css:{hidden:"nav-hidden"},navWidth:0,preloadNextImage:!!t.preloadNextImage,intersectionObserver:{threshold:void 0===t.threshold?.5:t.threshold},itemsSelector:t.itemsSelector},this.callbacks={navUpdate:[]};const i=t.navItemsSelector?e.querySelector(t.navItemsSelector):null,s=t.previewItemsSelector?e.querySelector(t.previewItemsSelector):null;if(this.elements={nav:{forward:e.querySelector(t.navItems.forwardSelector),backward:e.querySelector(t.navItems.backwardSelector)},itemsContainer:this.settings.isHorizontal?e.querySelector(t.itemsContainerSelector):document.querySelector(t.itemsContainerSelector),items:e.querySelectorAll(this.settings.itemsSelector),navItems:i?[...i.children]:null,previewItems:s?[...s.children]:null},this.noIndexList=[],this.domIndex=null,t.noIndexItemsSelector){const i=e.querySelectorAll(t.noIndexItemsSelector);if(i&&i.length){this.log(`Will exclude ${i.length} elements from indexing ...`);for(const e of i){const t=Array.from(this.elements.items).indexOf(e);-1!==t&&(this.noIndexList.push(t),this.log(` - Excluding index ${t}`))}this.log(`Did exclude ${this.noIndexList.length} elements from indexing ...`)}}this.validateElement(this.elements.itemsContainer)&&this.validateElement(this.elements.items)?this.elements.items.length<2?this.log("To few elements. No need for the helper.",!0):(this.items=[...this.elements.items].map(e=>({visible:!1,element:e})),this.index=null,this.observer=null,this.observeElements(this.elements.itemsContainer,this.elements.items),this.setupNavigation(),this.autoScrollInterval=null,this.autoScroll=t.autoScroll,this.elementWidth=this.items[0].element.scrollWidth,this.currentLeft=0,this.isAutoscrolling=!1,this.preloadedIndexes=[],this.registerAutoscroll()):this.log("Missing required dom-element(s).",!0)}addNavUpdate(e){this.log("Adding navigation update callback ..."),this.callbacks.navUpdate.push(e)}reflow(){this.log("Will reflow items"),this.unobserve(this.elements.items),this.elements.items=this.elements.itemsContainer.querySelectorAll(this.settings.itemsSelector),this.items=[...this.elements.items].map(e=>({visible:!1,element:e})),this.observeElements(this.elements.itemsContainer,this.elements.items)}log(e,t=!1){t&&console.warn("[SwipeHelper]",e),this.debug&&console.log("[
6SwipeHelper]",e)}validateElement(e){return e&&(e.length||1===e.nodeType)}registerAutoscroll(){if(!this.autoScroll||!this.autoScroll.enabled)return;this.autoScroll.interval||(this.autoScroll.interval=4e3);new IntersectionObserver((e,t)=>{e[0].isIntersecting?this.startAutoScroll():this.stopAutoScroll()},{root:null,rootMargin:"0px",threshold:0}).observe(this.elements.itemsContainer)}startAutoScroll(){if(this.isAutoscrolling||!this.settings.isHorizontal)return;this.isAutoscrolling=!0,this.log("Starting autoscroll ..."),this.autoScrollInterval=setInterval(()=>{this.autoScroll.scrolling=!0,this.autoScroll.reset?(this.elements.itemsContainer.scrollTo({top:0,left:0,behavior:"smooth"}),this.autoScroll.reset=!1):this.elements.itemsContainer.scrollTo({top:0,left:this.elements.itemsContainer.scrollLeft+this.elementWidth,behavior:"smooth"}),setTimeout(()=>{this.autoScroll.scrolling=!1},1e3)},parseInt(this.autoScroll.interval,10));const e=()=>{this.autoScroll.scrolling||(this.log("Will disable autoscroll"),this.stopAutoScroll(),this.elements.itemsContainer.removeEventListener("scroll",e))};this.elements.itemsContainer.addEventListener("scroll",e)}stopAutoScroll(){this.isAutoscrolling&&(this.log("Stopping autoscroll ..."),clearInterval(this.autoScrollInterval),this.autoScrollInterval=null,this.isAutoscrolling=!1)}setupNavigation(){if(this.elements.nav.forward&&this.elements.nav.backward&&(this.log("Will register events for navigation."),this.settings.navWidth=this.elements.nav.backward.offsetWidth,this.elements.nav.backward.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.navigate(-1)},!1),this.elements.nav.forward.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.navigate(1)},!1)),this.elements.navItems)for(const e of this.elements.navItems){const t=this.elements.navItems.indexOf(e);e.addEventListener("click",e=>{this.navigateToIndex(t,"auto")},!1)}if(this.elements.previewItems)for(const e of this.elements.previewItems){const t=this.elements.previewItems.indexOf(e);e.addEventListener("click",e=>{this.navigateToIndex(t,"auto")},!1)}}navigateToIndex(e,t){this.log(`Navigate to index: ${e}`),this.items[e]&&this.navigateToItem(this.items[e],t)}navigate(e){const t=this.items.filter(e=>e.visible);
6if(!t.length)return void this.log("Cannot navigate. Did not find any visible items ...",!0);const i=this.items.indexOf(t.shift())+e;i>=0&&i<this.items.length&&this.navigateToItem(this.items[i])}navigateToItem(e,t="smooth"){if(this.settings.isHorizontal){const i=Math.max(0,e.element.offsetLeft-this.settings.navWidth);this.elements.itemsContainer.scrollTo({top:0,left:i,behavior:t})}else this.elements.itemsContainer===document.body?window.scrollTo({top:e.element.offsetTop,left:0,behavior:t}):this.elements.itemsContainer.scrollTo({top:e.element.offsetTop,left:0,behavior:t})}internalToPublicIndex(e,t=!0){let i=e;if(this.noIndexList.length){let s=0;for(const i of this.noIndexList)(!t&&i<e||t&&i<=e)&&s++;i-=s}return i}publicToInternalIndex(e){let t=e;if(this.noIndexList.length){let e=0;for(const i of this.noIndexList)i<=t+e&&e++;t+=e}return t}observeElements(e,t){this.log(`Will register IntersectionObserver for ${t.length} items`);const i={root:this.settings.isHorizontal?e:null,rootMargin:"0px",threshold:this.settings.intersectionObserver.threshold};this.observer=new IntersectionObserver((e,i)=>{const s=[];let n=null;for(const i of e){const e=Array.from(i.target.parentNode.querySelectorAll(this.settings.itemsSelector)).indexOf(i.target);if(-1===e)return void this.unobserve(t);this.items[e].visible=i.isIntersecting,s.push(e),this.items[e].visible&&(n=e),this.settings.preloadNextImage&&i.isIntersecting&&this.items[e+1]&&!this.preloadedIndexes.includes(e+1)&&this.preloadAtIndex(e+1),this.log(`IntersectionObserver triggered at index ${e}. Setting visibility to ${this.items[e].visible}.`)}if(null!==n){const e=n>=this.domIndex?"next":"prev";let t=null;this.noIndexList.length&&(t=this.noIndexList.map(e=>e-n).filter(t=>"next"===e?t>=0:t<=0),t=t.length?"next"===e?Math.min(...t):Math.max(...t):null),null!==t&&t<0&&(t=Math.abs(t)),this.updateNavItems(this.internalToPublicIndex(n,n>this.index),{originalIndex:n,direction:e,noIndexDistance:t})}(s.includes(0)||s.includes(this.items.length-1))&&(this.updateGui(),this.autoScroll&&this.autoScroll.enabled&&this.items[this.items.length-1].visible&&(this.autoScroll.reset=!0)),this.domIndex=n},i);for(const e of t)this.observer.observe(e)}unobserve(e){this.log(`Will unobserve ${e.length} items`);for(const t of e)this.observer.unobserve(t)}preloadAtIndex(e){if(this.preloadedIndexes.push(e),!this.items[e]||!this.items[e].element)return;const t=this.items[e].element.querySelector("img");t&&(this.log(`Will preload image at index ${e}`),t.removeAttribute("loading"))}updateGui(){this.elements.nav.forward&&this.elements.nav.backward&&(this.log("Updating navigation-GUI ..."),this.items[0].visible?this.elements.nav.backward.classList.add(this.settings.css.hidden):this.elements.nav.backward.classList.remove(this.settings.css.hidden),this.items[this.items.length-1].visible?this.elements.nav.forward.classList.add(this.settings.css.hidden):this.elements.nav.forward.classList.remove(this.settings.css.hidden))}updateNavItems(e,{originalIndex:t,direction:i,noIndexDistance:s}){const n="selected";this.elements.navItems&&(this.elements.navItems[this.index]&&this.elements.navItems[this.index].classList.remove(n),this.elements.navItems[e]&&this.elements.navItems[e].classList.add(n)),this.elements.previewItems&&(this.elements.previewItems[this.index]&&this.elements.previewItems[this.index].classList.remove(n),this.elements.previewItems[e]&&this.elements.previewItems[e].classList.add(n)),this.index=e;for(const e of this.callbacks.navUpdate)e(this.index,{isNoIndex:this.noIndexList.includes(t),direction:i,domIndex:t,noIndexDistance:s})}}})(),window.Dac||(window.Dac={}),window.Dac.Parallax=class{constructor(e){this.container=e.container,this.debug=e.debug,this.log(`Starting Parallax-instance for element "${this.container.classList}".`),this.isAnimating=!1,this.handler=this.scrollHandler.bind(this),this.animator=this.animate.bind(this),this.register(this.container),this.elements=e.elements,this.resizeTimeoutId=null,this.lastYPos=window.scrollY,this.animatedItems=[],this.items=this.registerItems(this.elements),this.decorateStaticAttributes()}registerItems(e){this.log(`Will register ${e.length} item(s)`),document.body.classList.add("dac-reflow");const t=e.map(e=>{const t=this.container.querySelector(e.selector),i=t.getBoundingClientRect();return{index:e.index,element:t,rect:i,animations:e.animations,staticAttributes:e.staticAttributes,style:"",position:{top:parseInt(i.top+window.scrollY,10),bottom:parseInt(i.bottom+window.scrollY,10)}}});return document.body.classList.remove("dac-reflow"),t}reflow(){this.log("Will reflow items"),this.items=this.registerItems(this.elements)}scrollHandler(e){this.requestAnimation()}decorateStaticAttributes(){for(const e of this.items){const t=e.staticAttributes.map(t=>this[`handleStatic_${t.name}`](t,e));e.element.setAttribute("style",`transform: ${t.join(" ")}`)}}
6getItemsByPosition(e,t){return this.items.filter(i=>i.position.top<t&&i.position.bottom>e)}getPercentScroll(e,t){const i=Math.max(e.position.top-window.innerHeight,0);return(t-i)/(e.position.bottom-i)*100}log(e){this.debug&&console.log("Parallax:",e)}requestAnimation(){this.isAnimating||requestAnimationFrame(this.animator),this.isAnimating=!0}activateAnimations(){this.log("Will activate animations"),this.container.classList.add("parallax-js-mode"),window.addEventListener("scroll",this.handler,!1),this.handler()}deactivateAnimations(){this.log("Will deactivate animations"),this.container.style.height="",this.container.classList.remove("parallax-js-mode"),window.removeEventListener("scroll",this.handler,!1)}register(e){this.log("Will register IntersectionObserver"),new IntersectionObserver((t,i)=>{for(const i of t)i.target===e&&(this.log(`IntersectionObserver triggered. Intersecting: ${i.isIntersecting}, ratio: ${i.intersectionRatio}`),i.isIntersecting?this.activateAnimations():this.deactivateAnimations())},{root:null,rootMargin:"0px"}).observe(e),window.addEventListener("resize",e=>{this.log("Window resized"),clearTimeout(this.resizeTimeoutId),this.resizeTimeoutId=setTimeout(()=>{this.reflow()},300)})}getFloat(e,t=2){return parseFloat(e.toFixed(t))}getInt(e){return parseInt(e,10)}getCurrentValue(e,t){return t<e.startScrollPosition?parseFloat(e.startValue):t>=e.endScrollPosition?parseFloat(e.endValue):100/(e.endScrollPosition-e.startScrollPosition)*(t-e.startScrollPosition)/100*(e.endValue-e.startValue)+parseFloat(e.startValue)}animate(){const e=this.getItemsByPosition(window.scrollY,window.scrollY+window.innerHeight);if(this.debug){const t=e.map(e=>`[${e.animations.map(e=>e.name).join(", ")}]`);this.log(`Will animate ${e.length} element(s) ${t.join(", ")}`)}for(const t of this.animatedItems)e.includes(t)||(this.log("Setting start/end state for item outside range."),this.animateItem(t,this.lastYPos<=window.scrollY?100:0),t.element.classList.remove("isAnimating"));for(const t of e){t.element.classList.add("isAnimating");const e=this.getPercentScroll(t,window.scrollY);this.animateItem(t,e)}this.lastYPos=window.scrollY,this.isAnimating=!1,this.animatedItems=e}animateItem(e,t){const i={transform:[],filter:[],definition:[]};for(const s of e.animations){const n=this[`handleAnimation_${s.name}`](s,t,e);i[n.key].push(n.value)}if(i.transform.length&&i.definition.push(`transform: ${i.transform.join(" ")}`),i.filter.length&&i.definition.push(`filter: ${i.filter.join(" ")}`),i.definition.length){const t=i.definition.join("; ");e.style!==t&&(e.element.setAttribute("style",i.definition.join("; ")),e.style=t)}}handleAnimation_perspective(e,t,i){const s=this.getCurrentValue(e,t/100)/100;return{key:"transform",value:`translateZ(${this.getFloat(100*s)}px) scale(${this.getFloat(s)})`}}handleAnimation_scale(e,t,i){const s=this.getCurrentValue(e,t)/100;return{key:"transform",value:`scale(${this.getFloat(s,4)})`}}handleAnimation_opacity(e,t,i){const s=this.getCurrentValue(e,t)/100;return{key:"definition",value:`opacity:${this.getFloat(s)}`}}handleAnimation_rotate(e,t,i){const s=this.getCurrentValue(e,t)/100*360;return{key:"transform",value:`rotate(${this.getInt(s)}deg)`}}handleAnimation_blur(e,t,i){const s=this.getCurrentValue(e,t)/2;return{key:"filter",value:`blur(${this.getFloat(s)}px)`}}handleAnimation_sepia(e,t,i){const s=this.getCurrentValue(e,t);return{key:"filter",value:`sepia(${this.getInt(s)}%)`}}handleAnimation_brightness(e,t,i){const s=this.getCurrentValue(e,t);return{key:"filter",value:`brightness(${this.getInt(s)}%)`}}handleStatic_perspective(e,t){const i=this.getFloat(e.value/100);return{key:"transform",value:`translateZ(${e.value}px) scale(${i})`}}},window.Dac=window.Dac||{},window.Dac.TabNavigation=class{constructor(e){this.index=null,this.debug=!!e.debug,this.canCloseTabs=!!e.canCloseTabs,this.onNavigate=e.onNavigate||(()=>{}),this.log("Creating instance ..."),this.elements={container:null,tabs:null,navigationItems:null},this.setup(e)?(this.activeSelector="selected",this.setupNavigation(),e.defaultIndex&&!isNaN(e.defaultIndex)&&this.setIndex(parseInt(e.defaultIndex,10))):this.log("Missing required dom-elements.",!0)}log(e,t=!1){t?console.warn("TabNavigation:",e):this.debug&&console.log("TabNavigation:",e)}setup(e){return this.elements.container=document.querySelector(e.selector),!!this.elements.container&&(this.elements.tabs=this.elements.container.querySelectorAll(e.tabsSelector),this.elements.navigationItems=this.elements.container.querySelectorAll(e.navigationSelector),this.log(`Found ${this.elements.tabs.length} tab-elements and ${this.elements.navigationItems.length} navigation items.`),this.elements.tabs.length>0&&this.elements.navigationItems.length>0)}setupNavigation(){this.log("Will register events for navigation.");let e=0;for(const t of this.elements.navigationItems)this.setupNavigationItem(t,e),e++}setupNavigationItem(e,t){const i=e=>{e.stopPropagation();const i=this.index;this.setIndex(t),this.onNavigate(this.createCallbackObject(i),this.createCallbackObject(this.index))};e.addEventListener("click",i,!1),e.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i(e))},!1)}createCallbackObject(e){return null===e?null:{tab:this.elements.tabs[e],navigator:this.elements.navigationItems[e]}}setIndex(e){if(this.index===e){if(!this.canCloseTabs)return void this.log(`Index ${e} already defined. No change.`);e=null}e<0||e>=this.elements.tabs.length?this.log(`Index ${e} is out of bounds.`,!0):(this.log(`Will set index ${e}.`),this.index=e,this.updateGui())}updateGui(){for(const e of this.elements.tabs)e.classList.remove(this.activeSelector);for(const e of this.elements.navigationItems)e.classList.remove(this.activeSelector);this.elements.tabs[this.index]&&this.elements.tabs[this.index].classList.add(this.activeSelector),this.elements.navigationItems[this.index]&&this.elements.navigationItems[this.index].classList.add(this.activeSelector)}},window.Dac||(window.Dac={}),window.Dac.ElementAttributeToggler=class{constructor(e={selectors:[]}){this.validate(e),this.options=e,this.selectors=this.getSelectorsElements(),this.setup()}
6setup(){this.selectors.forEach(e=>{this.setInitialAttributes(e),this.addListeners(e)})}getSelectorsElements(){return this.options.selectors.map(e=>({activators:document.querySelectorAll(e.toggleActivator),elements:document.querySelectorAll(e.elementToToggle),attributes:e.attributes}))}setInitialAttributes(e){const t=e.attributes;e.elements.forEach((e,i)=>{for(const i of Object.keys(t||{}))t[i].initial&&this.setAttribute(e,i,t[i].value)})}setAttribute(e,t,i){"className"===t?e.classList.add(i):e[t]=i}addListeners(e){e.activators.forEach((t,i)=>{t.addEventListener("click",t=>{t.preventDefault(),this.segregateAttributeHandlers(e.elements[i],e)})})}segregateAttributeHandlers(e,t){const i=t.attributes;for(const t of Object.keys(i||{}))"className"===t?this.toggleClassName(e,i[t].value):this.toggleAnyAttribute(e,i[t].value,t)}toggleClassName(e,t){e.classList.toggle(t)}toggleAnyAttribute(e,t,i){e[i]===t?e[i]="":e[i]=t}validate(e){return this.validateObject(e)?this.validateArray(e.selectors)?void 0:(console.error("ElementAttributeToggler: Options.selectors is not an array."),!1):(console.error("ElementAttributeToggler: Options is not an object."),!1)}validateObject(e){return"object"==typeof e&&null!==e}validateArray(e){return Array.isArray(e)}},e=void 0,t=function(){var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function i(e){return"function"==typeof e}function s(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function n(e,t){return null!=e&&"object"==typeof e&&t in e}function r(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test,o=/\S/;function l(e){return!function(e,t){return a.call(e,t)}(o,e)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},d=/\s*/,h=/\s+/,u=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function p(e){this.string=e,this.tail=e,this.pos=0}function v(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function f(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}p.prototype.eos=function(){return""===this.tail},p.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},p.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},v.prototype.push=function(e){return new v(e,this)},v.prototype.lookup=function(e){var t,s=this.cache;if(s.hasOwnProperty(e))t=s[e];else{for(var a,o,l,c=this,d=!1;c;){if(e.indexOf(".")>0)for(a=c.view,o=e.split("."),l=0;null!=a&&l<o.length;)l===o.length-1&&(d=n(a,o[l])||r(a,o[l])),a=a[o[l++]];else a=c.view[e],d=n(c.view,e);if(d){t=a;break}c=c.parent}s[e]=t}return i(t)&&(t=t.call(this.view)),t},f.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},f.prototype.parse=function(e,i){var n=this.templateCache,r=e+":"+(i||w.tags).join(":"),a=void 0!==n,o=a?n.get(r):void 0;return null==o&&(o=function(e,i){if(!e)return[];var n,r,a,o=!1,c=[],v=[],f=[],b=!1,y=!1,I="",x=0;function S(){if(b&&!y)for(;f.length;)delete v[f.pop()];else f=[];b=!1,y=!1}function A(e){if("string"==typeof e&&(e=e.split(h,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(s(e[0])+"\\s*"),r=new RegExp("\\s*"+s(e[1])),a=new RegExp("\\s*"+s("}"+e[1]))}A(i||w.tags);for(var L,E,k,C,_,T,q=new p(e);!q.eos();){if(L=q.pos,k=q.scanUntil(n))for(var P=0,N=k.length;P<N;++P)l(C=k.charAt(P))?(f.push(v.length),I+=C):(y=!0,o=!0,I+=" "),v.push(["text",C,L,L+1]),L+=1,"\n"===C&&(S(),I="",x=0,o=!1);if(!q.scan(n))break;if(b=!0,E=q.scan(g)||"name",q.scan(d),"="===E?(k=q.scanUntil(u),q.scan(u),q.scanUntil(r)):"{"===E?(k=q.scanUntil(a),q.scan(m),q.scanUntil(r),E="&"):k=q.scanUntil(r),!q.scan(r))throw new Error("Unclosed tag at "+q.pos);if(_=">"==E?[E,k,L,q.pos,I,x,o]:[E,k,L,q.pos],x++,v.push(_),"#"===E||"^"===E)c.push(_);else if("/"===E){if(!(T=c.pop()))throw new Error('Unopened section "'+k+'" at '+L);if(T[1]!==k)throw new Error('Unclosed section "'+T[1]+'" at '+L)}else"name"===E||"{"===E||"&"===E?y=!0:"="===E&&A(k)}if(S(),T=c.pop())throw new Error('Unclosed section "'+T[1]+'" at '+q.pos);return function(e){for(var t,i=[],s=i,n=[],r=0,a=e.length;r<a;++r)switch((t=e[r])[0]){case"#":case"^":s.push(t),n.push(t),s=t[4]=[];break;case"/":n.pop()[5]=t[2],s=n.length>0?n[n.length-1][4]:i;break;default:s.push(t)}return i}(function(e){for(var t,i,s=[],n=0,r=e.length;n<r;++n)(t=e[n])&&("text"===t[0]&&i&&"text"===i[0]?(i[1]+=t[1],i[3]=t[3]):(s.push(t),i=t));return s}(v))}(e,i),a&&n.set(r,o)),o},f.prototype.render=function(e,t,i,s){var n=this.parse(e,s),r=t instanceof v?t:new v(t,void 0);return this.renderTokens(n,r,i,e,s)},f.prototype.renderTokens=function(e,t,i,s,n){for(var r,a,o,l="",c=0,d=e.length;c<d;++c)o=void 0,"#"===(a=(r=e[c])[0])?o=this.renderSection(r,t,i,s):"^"===a?o=this.renderInverted(r,t,i,s):">"===a?o=this.renderPartial(r,t,i,n):"&"===a?o=this.unescapedValue(r,t):"name"===a?o=this.escapedValue(r,t):"text"===a&&(o=this.rawValue(r)),void 0!==o&&(l+=o);return l},f.prototype.renderSection=function(e,s,n,r){var a=this,o="",l=s.lookup(e[1]);if(l){if(t(l))for(var c=0,d=l.length;c<d;++c)o+=this.renderTokens(e[4],s.push(l[c]),n,r);else if("object"==typeof l||"string"==typeof l||"number"==typeof l)o+=this.renderTokens(e[4],s.push(l),n,r);
6else if(i(l)){if("string"!=typeof r)throw new Error("Cannot use higher-order sections without the original template");null!=(l=l.call(s.view,r.slice(e[3],e[5]),function(e){return a.render(e,s,n)}))&&(o+=l)}else o+=this.renderTokens(e[4],s,n,r);return o}},f.prototype.renderInverted=function(e,i,s,n){var r=i.lookup(e[1]);if(!r||t(r)&&0===r.length)return this.renderTokens(e[4],i,s,n)},f.prototype.indentPartial=function(e,t,i){for(var s=t.replace(/[^ \t]/g,""),n=e.split("\n"),r=0;r<n.length;r++)n[r].length&&(r>0||!i)&&(n[r]=s+n[r]);return n.join("\n")},f.prototype.renderPartial=function(e,t,s,n){if(s){var r=i(s)?s(e[1]):s[e[1]];if(null!=r){var a=e[6],o=e[5],l=e[4],c=r;return 0==o&&l&&(c=this.indentPartial(r,l,a)),this.renderTokens(this.parse(c,n),t,s,c,n)}}},f.prototype.unescapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return i},f.prototype.escapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return"number"==typeof i?String(i):w.escape(i)},f.prototype.rawValue=function(e){return e[1]};var w={name:"mustache.js",version:"4.0.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){b.templateCache=e},get templateCache(){return b.templateCache}},b=new f;return w.clearCache=function(){return b.clearCache()},w.parse=function(e,t){return b.parse(e,t)},w.render=function(e,i,s,n){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(r=e)?"array":typeof r)+'" was given as the first argument for mustache#render(template, view, partials)');var r;return b.render(e,i,s,n)},w.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},w.Scanner=p,w.Context=v,w.Writer=f,w},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Mustache=t(),window.Dac.InfinityScrollAds||(window.Dac.InfinityScrollAds={}),window.Dac.InfinityScrollAds=class{constructor(e){this.articleId=e}reloadSkyscraperAds(){const e=window.innerWidth>1315,t=this.getTags(this.articleId),i=t.split(","),s=this.getPageType(this.articleId),n=this.getSection(this.articleId),r=new CustomEvent("skyscrapersReloading",{detail:{articleId:this.articleId,skyscraperVisible:e,tags:t,context:s,section:n}});if(document.dispatchEvent(r),!e||window.lab_ads&&window.lab_ads.disableSkyscraperReload)return;const a=document.querySelector(".placement-right > div > .adunit"),o=document.querySelector(".placement-left > div > .adunit");a&&o&&window.lwhb.cmd.push(()=>{window.lwhb.removeAdUnit(o.id),window.lwhb.removeAdUnit(a.id);const e=`context_${s}_section_${n}`,r={ext:{data:{tags:i,contextAndSection:e,context:s,section:n}}};window.lwhb.loadAd({tagId:o.id,keywords:{tags:t,contextAndSection:e,context:s,section:n},ortb2:r}),window.lwhb.loadAd({tagId:a.id,keywords:{tags:t,contextAndSection:e,context:s,section:n},ortb2:r})})}updateAdPlacements(){document.querySelectorAll('div[id^="infiniteArticle-"]:not(.adUnitUpdated)').forEach(e=>{const t=e.id.match(/infiniteArticle-(\d+)/);if(t){e.classList.add("adUnitUpdated");const i=t[1];e.querySelectorAll(".adunit").forEach(t=>{t.id.endsWith(`_${i}`)||e.id.endsWith("_/_d+$/")||(t.id=`${t.id}_${i}`)})}})}reloadArticleAds(){const e=document.querySelectorAll('div[id^="infiniteArticle-"]'),t=[];e.forEach(e=>{e.querySelectorAll(".adunit").forEach(e=>t.push(e))}),t.forEach(e=>{if(e.id.endsWith(`_${this.articleId}`)){const t=this.getTags(this.articleId),i=t.split(","),s=`context_${this.getPageType(this.articleId)}_section_${this.getSection(this.articleId)}`,n=this.getPageType(this.articleId),r=this.getSection(this.articleId);window.lwhb.cmd.push(()=>{window.lwhb.loadAd({adUnitName:e.id.replace(`_${this.articleId}`,""),tagId:e.id,ignoreVisibility:!0,keywords:{tags:t,contextAndSection:s,context:n,section:r},ortb2:{ext:{data:{tags:i,contextAndSection:s,context:n,section:r}}}})})}})}getTags(e){if(!window.lab_article_data||!window.lab_article_data[e])return"";const{tagsString:t}=window.lab_article_data[e];return t}getPageType(e){if(!window.lab_article_data||!window.lab_article_data[e])return"";const{pageType:t}=window.lab_article_data[e];return t}getSection(e){if(!window.lab_article_data||!window.lab_article_data[e])return"";const{section:t}=window.lab_article_data[e];return t}},window.Dac=window.Dac||{},window.Dac.Definition=class{constructor(e){this.id=e||"mainArticleSection",this.article=document.getElementById(this.id),this.dfns=this.article?this.article.querySelectorAll("dfn"):[],this.template=document.querySelector("template.definitionTemplate"),this.openPopup=this.openPopup.bind(this),this.closePopup=this.closePopup.bind(this),this.setup()}
6setup(){this.dfns.forEach(e=>{e.addEventListener("click",this.openPopup),e.addEventListener("keydown",this.openPopup)})}closePopup(){const e=document.querySelector(".definitionPopup");e&&e.remove()}openPopup(e){if("click"===e.type||"keydown"===e.type&&"Enter"===e.key){let t;if(e.stopPropagation(),this.closePopup(),"DFN"===e.target.tagName?t=e.target:"SPAN"===e.target.tagName&&"DFN"===e.target.parentElement.tagName&&(t=e.target.parentElement),this.template){const e=this.template.content.firstElementChild.cloneNode(!0);"SPAN"===t.parentNode.tagName?t.parentNode.parentNode.style.position="relative":t.parentNode.style.position="relative",t.after(e);const i=t.textContent;e.querySelector("p").textContent=i;const s=t.getAttribute("title");e.querySelector("span").textContent=s,e.querySelector("button").addEventListener("click",e=>{e.stopPropagation(),this.closePopup()}),document.body.addEventListener("click",t=>{e.contains(t.target)||this.closePopup()}),e.style.display="flex",e.style.top=`${t.offsetTop+t.offsetHeight+10}px`;const n=document.querySelector(".definitionPopup"),r=this.article&&this.article.querySelector(".pageWidth")&&this.article.querySelector(".pageWidth").offsetWidth;r&&(n.clientWidth+t.offsetLeft<r?(e.style.left="unset",e.style.right=r-(n.clientWidth+t.offsetLeft)+"px"):(e.style.left="0.7rem",e.style.right="0.7rem"))}}}}})();
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.