@schibsted/advertory 2.62.3 → 2.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/aftenposten/es/index.css +1 -1
- package/core/aftenposten/es/index.d.ts +1 -0
- package/core/aftenposten/es/index.js +1 -1
- package/core/aftenposten/index.d.ts +1 -0
- package/core/aftenposten/index.js +1 -1
- package/core/aftenpostenv2/es/index.css +1 -1
- package/core/aftenpostenv2/es/index.d.ts +1 -0
- package/core/aftenpostenv2/es/index.js +1 -1
- package/core/aftonbladet/es/index.css +1 -1
- package/core/aftonbladet/es/index.d.ts +1 -0
- package/core/aftonbladet/es/index.js +1 -1
- package/core/aftonbladet/index.d.ts +1 -0
- package/core/aftonbladet/index.js +1 -1
- package/core/aftonbladetv2/es/index.css +1 -1
- package/core/aftonbladetv2/es/index.d.ts +1 -0
- package/core/aftonbladetv2/es/index.js +1 -1
- package/core/bt/es/index.css +1 -1
- package/core/bt/es/index.d.ts +1 -0
- package/core/bt/es/index.js +1 -1
- package/core/bt/index.d.ts +1 -0
- package/core/bt/index.js +1 -1
- package/core/e24/es/index.css +1 -1
- package/core/e24/es/index.d.ts +1 -0
- package/core/e24/es/index.js +1 -1
- package/core/e24/index.d.ts +1 -0
- package/core/e24/index.js +1 -1
- package/core/fotbollskanalen/es/index.css +1 -1
- package/core/fotbollskanalen/es/index.d.ts +1 -0
- package/core/fotbollskanalen/es/index.js +1 -1
- package/core/fotbollskanalen/index.d.ts +1 -0
- package/core/fotbollskanalen/index.js +1 -1
- package/core/godare/index.d.ts +1 -0
- package/core/godare/index.js +1 -1
- package/core/godt/index.d.ts +1 -0
- package/core/godt/index.js +1 -1
- package/core/klart/index.d.ts +1 -0
- package/core/klart/index.js +1 -1
- package/core/koket/es/index.css +1 -1
- package/core/koket/es/index.d.ts +1 -0
- package/core/koket/es/index.js +1 -1
- package/core/koket/index.d.ts +1 -0
- package/core/koket/index.js +1 -1
- package/core/kompakt/index.d.ts +1 -0
- package/core/kompakt/index.js +1 -1
- package/core/minmote/index.d.ts +1 -0
- package/core/minmote/index.js +1 -1
- package/core/pent/index.d.ts +1 -0
- package/core/pent/index.js +1 -1
- package/core/sa/es/index.css +1 -1
- package/core/sa/es/index.d.ts +1 -0
- package/core/sa/es/index.js +1 -1
- package/core/sa/index.d.ts +1 -0
- package/core/sa/index.js +1 -1
- package/core/svd/es/index.css +1 -1
- package/core/svd/es/index.d.ts +1 -0
- package/core/svd/es/index.js +1 -1
- package/core/svd/index.d.ts +1 -0
- package/core/svd/index.js +1 -1
- package/core/svdv2/es/index.css +1 -1
- package/core/svdv2/es/index.d.ts +1 -0
- package/core/svdv2/es/index.js +1 -1
- package/core/tek/index.d.ts +1 -0
- package/core/tek/index.js +1 -1
- package/core/tv4/es/index.css +1 -1
- package/core/tv4/es/index.d.ts +1 -0
- package/core/tv4/es/index.js +1 -1
- package/core/tv4/index.d.ts +1 -0
- package/core/tv4/index.js +1 -1
- package/core/tvnu/index.d.ts +1 -0
- package/core/tvnu/index.js +1 -1
- package/core/vg/es/index.css +1 -1
- package/core/vg/es/index.d.ts +1 -0
- package/core/vg/es/index.js +1 -1
- package/core/vg/index.d.ts +1 -0
- package/core/vg/index.js +1 -1
- package/core/vgv2/es/index.css +1 -1
- package/core/vgv2/es/index.d.ts +1 -0
- package/core/vgv2/es/index.js +1 -1
- package/features/ad-native/index.d.ts +1 -0
- package/features/ad-native/index.js +1 -1
- package/features/brandmetrics/index.js +1 -1
- package/features/common/es/index.js +1 -1
- package/features/common/index.js +1 -1
- package/features/dr-edition/es/index.d.ts +1 -0
- package/features/dr-edition/index.d.ts +1 -0
- package/features/glimr/index.js +1 -1
- package/features/tracker/index.d.ts +1 -0
- package/package.json +1 -1
- package/sites/aftenposten/es/index.css +1 -1
- package/sites/aftenposten/es/index.js +1 -1
- package/sites/aftenposten/index.js +1 -1
- package/sites/aftenpostenv2/es/index.css +1 -1
- package/sites/aftenpostenv2/es/index.js +1 -1
- package/sites/aftonbladet/es/index.css +1 -1
- package/sites/aftonbladetv2/es/index.css +1 -1
- package/sites/bt/es/index.css +1 -1
- package/sites/bt/es/index.js +1 -1
- package/sites/bt/index.js +1 -1
- package/sites/e24/es/index.css +1 -1
- package/sites/e24/es/index.js +1 -1
- package/sites/e24/index.js +1 -1
- package/sites/fotbollskanalen/es/index.css +1 -1
- package/sites/koket/es/index.css +1 -1
- package/sites/sa/es/index.css +1 -1
- package/sites/sa/es/index.js +1 -1
- package/sites/sa/index.js +1 -1
- package/sites/svd/es/index.css +1 -1
- package/sites/svd/es/index.js +1 -1
- package/sites/svd/index.js +1 -1
- package/sites/svdv2/es/index.css +1 -1
- package/sites/svdv2/es/index.js +1 -1
- package/sites/tv4/es/index.css +1 -1
- package/sites/tvnu/index.js +1 -1
- package/sites/vg/es/index.css +1 -1
- package/sites/vg/es/index.js +1 -1
- package/sites/vg/index.js +1 -1
- package/sites/vgv2/es/index.css +1 -1
- package/sites/vgv2/es/index.js +1 -1
- package/styles/vgv2/styles.css +1 -1
- package/types/core/handlers/ad-server/placement.d.ts +2 -1
- package/types/core/handlers/ad-server/request-grouping.test.d.ts +1 -0
- package/types/core/interface/config.d.ts +1 -0
- package/types/core/interface/observer.d.ts +1 -1
- package/types/features/finn-blink/finn-blink-only-placement.d.ts +3 -0
- package/types/features/finn-blink/index.d.ts +1 -0
- package/types/tests/mock-placement.d.ts +4 -0
package/core/svd/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";const e="ABSOLUTE_FULLSCREEN",t="ANY_FULLSCREEN",n="VERTICAL_FULLWIDTH",i="FULLWIDTH",r="TAKEOVER",o="VELVET_TAKEOVER",s="WALLPAPER",a="COLLAPSE",d={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},l={wallpaper:1600,"l-format":1600},c=e=>{const{banner:n,targetId:i}=e;return!(!n||(null==i?void 0:i.includes("takeover")))&&A(e,t)},u=e=>{const{native:t}=e;return!!t},v=e=>A(e,i),p=e=>{const{targetId:t}=e;return t.includes("takeover")||A(e,r)},g=e=>A(e,r),h=e=>A(e,s),m=e=>A(e,a),y=e=>e.targetId.includes("sponsorstripe"),f=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},w=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),b=e=>e.targetId.startsWith("midboard"),E=e=>e.targetId.startsWith("widescreen"),T=e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,I=e=>e.width>=1260&&e.width<=1280,S=e=>e.width>=1600&&e.width<=1620,A=(e,t)=>{const n=d[t];if(!n)return!1;return!!n.find(t=>{var n,i;const r=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(i=e.banner)||void 0===i?void 0:i.height)||e.height,s=t.width===r,a=!t.height||t.height===o;return s&&a})},C={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}},k={NO:"no",SE:"se"},P="native_override_desc2",O=(e,t,n)=>{var i;const{image:r,icon:o,sponsoredBy:s,title:a,clickUrl:d,cta:l,body:c,desc2:u,video:v,description:p,customTitle1:g,customTitle2:h,customTitle3:m,customTitle4:y,customIcon2:f}=e,w=(e,t="")=>{var n;return e?null!==(n=e.url)&&void 0!==n?n:e:t};return Object.assign({containerId:n,img:w(r),imgWidth:null==r?void 0:r.width,imgHeight:null==r?void 0:r.height,imgAltText:null!=a?a:"",logo:w(o),sponsoredBy:null!=s?s:"",title:null!=a?a:"",url:null!=d?d:"",cta:null!=l?l:"",description:null!==(i=null!=c?c:p)&&void 0!==i?i:"",desc2:null!=u?u:"",video:v,customTitle1:null!=g?g:"",customTitle2:null!=h?h:"",customTitle3:null!=m?m:"",customTitle4:null!=y?y:"",logo2:w(f)},t)},L=(e,t)=>{const n=(i=P,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(P),o=t.includes("native_recirc");return n&&r?r:(null==e?void 0:e.includes("recirc"))?o?"native_recirc":"recirc":(null==e?void 0:e.includes("sponsor"))?"sponsorstripe":null},$="native-ad",x={SVD:"svd",VG:"vg",GODARE:"godare",AFTENPOSTEN:"aftenposten",SA:"sa",BT:"bt",AFTONBLADET:"aftonbladet",E24:"e24",MINMOTE:"minmote",PENT:"pent",GODT:"godt",TEK:"tekno",KLART:"klart",TVNU:"tvnu",POLARIS:"polaris",KOKET:"koket",TV4:"tv4",FOTBOLLSKANALEN:"fotbollskanalen"},N=(e,t,n,i)=>{const r=document.querySelector(`#${e}`);r&&t&&(r.innerHTML=t,((e,t)=>{const n=e.parentElement,{publisher:i,pageType:r}=t,o=i&&Object.values(x).includes(i);n&&o&&((e,t,n,i)=>{const r=t.parentElement;if(!r)return;const o=e?`-${e}`:"",s=i?`__${i}`:"",a=`advertory${o}-${n}${s}`,d=`advertory${o}-${n}-wrapper${s}`;t.classList.remove(...t.classList),r.classList.remove(...r.classList),t.classList.add(a),r.classList.add(d),t.dataset.adType=n})(i,e,$,r)})(r,n),i())},_={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},D=e=>{var t;const n=document.querySelector(`#${e.targetId}`);if(!n||!(null===(t=e.native)||void 0===t?void 0:t.clickTrackers))return;(null==n?void 0:n.querySelectorAll("a.ad-link")).forEach(t=>{"true"!==t.dataset.tracked&&(t.addEventListener("click",()=>{var t,n;for(const i of null!==(n=null===(t=e.native)||void 0===t?void 0:t.clickTrackers)&&void 0!==n?n:[])R(i)}),t.dataset.tracked="true")})},j=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(M):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},q=(e,t)=>{var n;let i=!1;const r=document.querySelector(`#${e.targetId}`);if(!r||!e.native)return;const{deviceType:o,appearanceConfig:s,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:a=!1}={}}=t,d=a?{rootMargin:`${l=null!==(n=null==s?void 0:s.defaultThreshold[null!=o?o:_.DESKTOP])&&void 0!==n?n:0}px 0px ${l}px 0px`}:{};var l;const c=new IntersectionObserver(t=>{if(!i)for(const n of t)if(n.isIntersecting){i=!0,j(e),c.disconnect();break}},d);c.observe(r)},M=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?R(e):window.navigator.sendBeacon(e)},R=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},B=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:r,videoTemplates:o}=n,s="default";if(!e.native)return null;const{native:a,targetId:d}=e,{desc2:l=s}=e.native,c=l.toLowerCase(),u=null!==(i=L(e.targetId,l))&&void 0!==i?i:c,v=C[t.language||k.NO],p=O(a,v,d);return(a.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);N(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{D(e),q(e,t)})(e,t)})},V={CONTENT_DISPLAY:({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,description:o,img:s,adContentFrom:a})=>`<article class="advertory-svd-ad-native-content-display ${o&&"description"}">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-large-image-container">\n <div class="ad-large-image-wrapper">\n <img alt="${r}" class="ad-large-image" src="${s}" />\n </div>\n </div>\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${a} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${r}" class="ad-small-image" src="${s}" />\n </div>\n </div>\n <div class="ad-description">${o}</div>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-svd-ad-native-podme ${n&&"description"}">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${t}</div>\n <div class="ad-description">${n}</div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" />\n </div>\n <div class="ad-logo">\n <img alt="${r}" class="logo" src="${r}" />\n </div>\n </div>\n </div>\n </div>\n </a>\n </article>\n `,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-svd-ad-native-podme-section ${n&&"description"}">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${t}</div>\n <div class="ad-description">${n}</div>\n </div>\n <div class="ad-small-image-container">\n <img alt="podme-ad" class="ad-small-image" src="${i}" />\n </div>\n <div class="ad-logo">\n <img alt="${r}" class="logo" src="${r}"/>\n </div>\n </div>\n </div>\n </div>\n </a>\n </article>\n`,BRAND_STUDIO_CLASSIC:(e,t)=>{const{containerId:n,url:i,adText:r,sponsoredBy:o,title:s,description:a,img:d,desc2:l}=e,{adPlacementFormat:c=""}=t;return(({descriptionClassName:e,isAlcoholAd:t,adPlacementFormat:n,containerId:i,url:r,adText:o,title:s,img:a,sponsoredBy:d,description:l})=>`<article class="advertory-svd-brand-studio-classic ${e} ${t?"advertory-svd-brand-studio-classic-alkohol":""} ${n}">\n <div class="ad-info" id="${i}-button"></div>\n <a class="ad-link" href="${r}">\n <div class="ad-header">\n <div class="ad-label">\n ${o}\n </div> \n <div class="ad-separator">•</div>\n <div class="ad-sponsor">${d}</div>\n </div>\n <div class="ad-content-wrapper">\n <div class="ad-content-row">\n <div class="ad-content-text">\n <h2 class="ad-title">${s}</h2>\n <span class="ad-description">${l}</span>\n </div>\n <div class="ad-image-container">\n <img alt="${s}" class="ad-small-image" src="${a}" />\n </div>\n </div>\n ${t?'<div class="alcohol-warning">Alkohol kan skada din hälsa</div>':""}\n </div>\n </a>\n </article>`)({descriptionClassName:a&&"description",isAlcoholAd:l.endsWith("_alcohol"),adPlacementFormat:c,containerId:n,url:i,adText:r,title:s,img:d,sponsoredBy:o,description:a})},SPONSORSTRIPE:({title:e,sponsoredBy:t,logo:n,url:i})=>`<article class="advertory-ad-sponsorstripe">\n <a class="ad-link" href="${i}" target="_blank">\n <div class="ad-wrapper">\n <span class="ad-title">${e}</span>\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </a>\n </article>`},F={FRONT:"front",ARTICLE:"article"};function U(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{d(i.next(e))}catch(e){o(e)}}function a(e){try{d(i.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const H=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),W="viewable",z="adClick",K=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},G=e=>U(void 0,void 0,void 0,function*(){var t,n;return(null===(t=null===window||void 0===window?void 0:window.SVP)||void 0===t?void 0:t.Player)?new window.SVP.Player(e):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const i=document.createElement("script");i.id=e,i.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",i.async=!0;try{i.src=i.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(i,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(e):yield new Promise(t=>{window.addEventListener("onSvpPlayerReady",()=>t(new window.SVP.Player(e)))}))}),Y={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return U(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Jr})})}})}},J=(e,t)=>{null==e||e.forEach(e=>{Y[e](t)})};const Q=(e,t)=>{const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.querySelector("ClickThrough"),r=n.querySelector("VideoClicks");if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n.createCDATASection(t))}else if(r){const e=n.createElement("ClickThrough");e.appendChild(n.createCDATASection(t)),r.appendChild(e)}return URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(n)],{type:"text/xml"}))},X=({id:e,nodeId:t,poster:n,tagURL:i,publisher:r="",productTag:o="xandr",videoLoop:s=!1})=>({id:e,poster:n,vendor:"appnexus",node:t,mute:!0,autoplay:s,repeat:s,skin:{name:"inventory-player",url:"https://ads.inventory.schibsted.io/styles/player.css"},settings:{jw:{stretching:"fill",advertising:{client:"vast",tag:i}}},pulse:{provider:r.toLowerCase(),decorator:e=>Object.assign(Object.assign({},H(e)?e:{}),{provider:Object.assign(Object.assign({},H(null==e?void 0:e.provider)?e.provider:{}),{productTag:o})})}}),Z=e=>U(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:r}=t,o=yield G(t);J(n),o.once("assetReady",()=>{K(o,n)}),o.on(W,e=>{const{viewable:t}=e;t?o.play():o.pause()}),o.on(z,()=>{window.open(i,"_blank")}),r&&o.on("pause",()=>{o.play()})}),ee=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:r,title:o},s,a)=>`<article class="advertory-shared-ad-native-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${t}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${a}"></div>\n </div>\n </div>\n <a class="ad-link" href="${n}" target="_blank">\n <div class="ad-text-container">\n <span class="sponsored-by">\n ${i} ${r}\n </span>\n <span class="title">${o}</span>\n </div>\n </a>\n </div>\n </article>`,te={CONTENT_DISPLAY_BASIC:(e,{pageType:t})=>t===F.ARTICLE?(({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,logo:o,adContentFrom:s})=>`<article class="advertory-shared-ad-native-content-display-basic article">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-text-container">\n <div class="ad-header-wrapper">\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n </div>\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${s} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${r}"class="ad-small-image" src="${o}" />\n </div>\n </div>\n </div>\n </a>\n </article>`)(e):(({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,img:o,adContentFrom:s,logo:a})=>`<article class="advertory-shared-ad-native-content-display-basic">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-large-image-container">\n <div class="ad-large-image-wrapper">\n <img alt="${r}" class="ad-large-image" src="${o}" />\n </div>\n </div>\n <div class="ad-content">\n <div class="ad-text-container">\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${s} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt=${r} class="ad-small-image" src=${a} />\n </div>\n </div>\n </div>\n </a>\n </article>`)(e),VIDEO:(e,t)=>{return(n=ee,(e,t,i)=>{const{video:r,img:o,url:s}=e,{publisher:a,productTag:d}=t,{pluginsNames:l,videoLoop:c}=i||{};if(!(null==r?void 0:r.content))return null;const u=Math.ceil(1e5*Math.random()),v=o||"https://custom.inventory.schibsted.io/1x1-00000000.png",p=`ad-player-${u}`,g=Q(r.content,s),h=X({id:u,nodeId:p,poster:v,tagURL:g,publisher:a,productTag:d,videoLoop:c});return Z({playerConfig:h,clickUrl:s,pluginsNames:l}),`${n(e,t,p)}`})(e,t);var n}},ne={displayTemplates:{content_display_basic:te.CONTENT_DISPLAY_BASIC,admarket_basic:V.CONTENT_DISPLAY,content_display:V.CONTENT_DISPLAY,podme:V.PODME,podme_section:V.PODME_SECTION,brandstudio_native_ad:V.BRAND_STUDIO_CLASSIC,brandstudio_native_ad_alcohol:V.BRAND_STUDIO_CLASSIC,sponsorstripe:V.SPONSORSTRIPE,default:V.CONTENT_DISPLAY},videoTemplates:{default:te.VIDEO}},ie=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},re=(e,t)=>{const n=document.querySelector(t),i=document.querySelector(`#${e}`);if(!i||!n)return;const r=i.parentElement,o=new IntersectionObserver(([e])=>((e,t,n)=>{const i=e?t.offsetHeight:0;ie(n,i)})(e.isIntersecting,n,r)),s=new ResizeObserver(()=>((e,t)=>{ie(t,e.offsetHeight)})(n,r));o.observe(n),s.observe(n)},oe=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`);function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae,de;var le=se(function(){if(de)return ae;de=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function s(e,t,i){var s={};return i.isMergeableObject(e)&&r(e).forEach(function(t){s[t]=n(e[t],i)}),r(t).forEach(function(r){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(o(e,r)&&i.isMergeableObject(t[r])?s[r]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(r,i)(e[r],t[r],i):s[r]=n(t[r],i))}),s}function a(t,r,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(r);return a===Array.isArray(t)?a?o.arrayMerge(t,r,o):s(t,r,o):n(r,o)}return a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return a(e,n,t)},{})},ae=a}());const ce=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],ue={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},ve=6;class pe{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of ce){const i=e[n];void 0!==i&&(t[n]=i)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=le(pe.DEFAULT_SITE_HANDLERS,e)}}pe.DEFAULT_SITE_HANDLERS={siteEvents:ue,initNativeAd:function(){}};const ge=new pe,he=ge.modifyConfigProperties.bind(ge),me=e=>e===_.MOBILE,ye=(e,t)=>{if(!t||!y(e))return;const{toggleEnabled:n,headerSelector:i,containersSelectors:r}=t,{targetId:o}=e;if(!n)return;const s=document.querySelector(".advertory-takeover-wrapper"),a=[()=>i&&re(o,i),()=>r&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,r]=t;if(!i)return;const o=()=>{const e=oe(i),t=r?oe(r):null,o=n.querySelector("article");if(!o||!e)return;const s=e.getBoundingClientRect().left,a=((e,t)=>{const n=e.getBoundingClientRect(),i=null==t?void 0:t.getBoundingClientRect();return i?i.right-n.left:n.width})(e,t);o.style.left=`${s}px`,o.style.width=`${a}px`};o(),new ResizeObserver(o).observe(document.body)})(o,r),()=>s&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n||!t)return;new IntersectionObserver(([e])=>{n.style.visibility=e.isIntersecting?"hidden":"visible"}).observe(t)})(o,s)];a.forEach(e=>e())},fe=e=>{(null==e?void 0:e.closest(".advertory-panorama"))&&e.parentElement&&(e.parentElement.style.background="none",e.style.background="none")},we="0123456789abcdefghijklmnopqrstuvwxyz",be=()=>Promise.resolve(),Ee=()=>{},Te=e=>{window.apntag.anq.push(e)},Ie=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),Se=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),Ae=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e},Ce=()=>{const{country:e}=ge.get();return e===k.NO?"no-sno":"se-generic"},ke=()=>{const{country:e,publisher:t}=ge.get();return`${e}-${t}`};let Pe="";const Oe=new Map,Le="advertory-wallpaper-background",$e=()=>{const e=document.querySelector(`.${Le}`);e&&e.remove()},xe=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,Ne=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&$e())},_e=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))};class De{initialize(){this.DATA=Object.assign({},De.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}De.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const je=new De,qe=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,i=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${i}px`)},Me=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=je.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=i},Re=()=>{$e();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Ne(e.id),Me(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),i=null==t?void 0:t.getAttribute("data-probable-width");n&&i&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",i+"px"))})(e.id),e.innerHTML="",e.id=Ae(e.id)}),Te(()=>window.apntag.clearRequest())},Be="noGroupedPlacements",Ve=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},Fe=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},Ue=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:i,deviceType:r}=ge.get(),o=n[r].filter(Fe)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=Ve(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),a=(null==i?void 0:i.queryByDataDevice)?`div[id^="${e}"][data-device=${r}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=s.querySelectorAll(a),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{const i=He(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=we[Math.floor(36*Math.random())];return t})(6)}`;return e.id=r,e.setAttribute("data-advertory-ad-rendered","true"),i.finnBlink&&!i.finnBlink.renderOnlyWithAdBlock&&e.setAttribute("data-is-finn-blink-placement","true"),(e=>{var t;const n=e.id;n&&je.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},i),{id:r})});return(e=>{const{keywordsConfig:t}=ge.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Pe!==window.location.pathname&&(Oe.clear(),Pe=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Oe.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${ke()}-count`]=i,Oe.set(n,i+1),e})):e})(l)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(a)},He=(e,t,n)=>{const i=n[t],r=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:o||r},We=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=ge.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=Ae(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),s=((e,t)=>{const n={};for(const[i,r]of Object.entries(t))n[i]=e.filter(e=>r.includes(Ae(e.id)));return n})(e,i),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(Ae(e.id))))(e,new Set([...a,...r]));return Object.assign(Object.assign(Object.assign({},s),o),{[Be]:d})},ze=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},Ke=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return ze("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const r=e=>{i||(ze("Resolving advertising permission value obtained"),i=!0,t(e))},o=setTimeout(()=>{ze("Advertising permission timed out, resolving with false"),r(!1)},3e3);window._tcf_.onTcfReady(()=>{ze("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);ze("Advertising permission value obtained asynchronously: ",e),r(Boolean(t))})}),Ge="cmp:loaded";let Ye,Je=!1;const Qe=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),r=(null==e?void 0:e.timeout)||3e3,o=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const a=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(ze("TCF bypass param detected, returning consent: true"),!0):(ze("TCF is not enabled, returning consent: true"),!0))(i,o))return!0;if(Je)return null;if(!Ye)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Ye.getConsentedToAllSync();return ze(`TCF consented to all is: ${t}`),Ye.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(ze("Getting TCF consent manager..."),window._tcf_)return ze("TCF consent manager is already available"),Ye=window._tcf_,void e(Ye);ze("TCF consent manager is not available");const n=()=>{ze("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Ye=window._tcf_,e(Ye)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Ge,n),Je=!0,t(new Error("Timeout waiting for CMP to load"))},r);ze("Listening for CMP loaded event..."),document.addEventListener(Ge,n,{once:!0})}):Promise.resolve(null),getConsentSync:a,getConsentAsync:()=>U(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ze(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const i=(null==e?void 0:e.schibstedAdChoicesEnabled)&&n===k.SE,o=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===k.NO;if(i||o)return ze("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield Ke(e);if(!(null==e?void 0:e.enabled))return!0;const s=a();return null!==s?s:yield new Promise((e,t)=>{try{if(!Ye)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},i=setTimeout(()=>{ze("TCF isConsentedToAll timed out, resolving with false"),n(!1)},r);Ye.onTcfReady(()=>{ze("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Ye.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},Xe=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Ze={SPLASH:"splash",WELCOME_PAGE:"welcomePage",TOPSCROLLER:"topscroller",VELVET:"velvet"},et=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const i=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),r=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=i.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,r).toString()},tt=(e,t,n,...i)=>U(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return ze(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ze(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${i}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:r}=Qe(e,t,n);return(yield r())?(ze(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(ze(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),nt="takeover-displayed",it="takeover-visit-count",rt=14400,ot=()=>{const e=Xe(it);return e?parseInt(e):0},st=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=ge.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=ge.get().takeover)||void 0===e?void 0:e.cookieCapName)||nt;return"true"===Xe(t)})())&&(!t||at()))},at=()=>{const e=ot();return 0===e?((()=>{const e=ot(),{takeover:{cookieCapTime:t=rt}={}}=ge.get(),n=document.location.hostname;window.document.cookie=`${it}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},dt=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),lt=()=>{const{takeover:e}=ge.get();return Boolean(null==e?void 0:e.topscroller)},ct=()=>U(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=nt,cookieCapTime:n=rt}={},isMobileApp:i,tcf:r,country:o}=ge.get(),s=yield tt(r,i,o,"ad-takeover-cookiecap");n&&s&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),ut=e=>{var t;const n=!!(null===(t=ge.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},vt=(e,t)=>{var n;if(t===Ze.TOPSCROLLER){const{topscroller:t}=e;return null!=t?t:{}}if(t===Ze.SPLASH){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},pt=(e,t)=>{t!==Ze.SPLASH?(e=>{var t,n,i;const r=null===(n=null===(t=ge.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=ge.get().takeover)||void 0===i?void 0:i.topscroller;if(!r||o)return;const s=document.querySelector(r),a=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(s&&a&&l&&d))return;const c=null==s?void 0:s.offsetHeight,u=g(e)?"60svh":`calc(100svh - ${c}px)`,v=g(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;a.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=ge.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),i=document.querySelector(`#${e.targetId}`);if(!n||!i)return;const r=`calc(100svh - ${n.offsetHeight}px)`;i.style.setProperty("height",r,"important")})(e)},gt=et([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),ht={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&<(),splash:e=>p(e)&&dt(e.width,e.height),welcomePage:p,wallpaper:h,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:I,hFormat:S,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!S(e)&&!I(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:E,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!w(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!b(e),outstream:T,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:w,midboard:b},mt=({adObj:e,preferredTestIdData:t})=>{var n,i;const r=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!r)return;const o=null===(i=document.querySelector(`#${r}`))||void 0===i?void 0:i.parentElement;if(!o)return;if(((e,t)=>{var n,i,r,o;const s=null===(o=null===(r=null===(i=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===i?void 0:i.tags)||void 0===r?void 0:r[e])||void 0===o?void 0:o.invCode;s&&(t.dataset.invCode=s)})(r,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const s="DIV"===(null==o?void 0:o.tagName);e&&s&&((e,t)=>{var n,i;for(const[r,o]of Object.entries(ht))if(o(e)){if("nativeAd"===r){const o="default";t.dataset.testid=`${r}-${null!==(i=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==i?i:o}`;break}t.dataset.testid=r;break}})(e,o)},yt=e=>{var t;return(null===(t=Object.entries(ht).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},ft=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},wt=(e,t=window.screen.width,n,i)=>{const r=ft(e,t),o=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);o&&(o.style.transform=`scale(${r})`,o.style.transformOrigin="left top")},bt=new Map;bt.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),bt.set("panorama",{scale:.79,transformOrigin:"center center"}),bt.set("outstream",{scale:.79,transformOrigin:"center center"}),bt.set("integration",{scale:.79,transformOrigin:"center center"}),bt.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Et=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const i=yt(e),r=bt.get(i),o=document.querySelector(`#${e.targetId}`);if(!o||!r)return;if(o.style.transformOrigin=r.transformOrigin,o.style.transform=`scale(${r.scale})`,!(null==r?void 0:r.cogwheelAdjust))return;const s=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),a=null==o?void 0:o.offsetWidth;s&&"number"==typeof a&&!isNaN(a)&&s.style.setProperty("right",String(-1*a*.2)+"px")},Tt={live:16},It=e=>{const t=null==e?void 0:e.querySelector("p");if(!e.className.includes("advertory")&&t)return e;const n=e.nextSibling;return n?It(n):null},St=e=>{var t;const{pageOptions:n,deviceType:i}=ge.get(),r="article"===n.keywords["se-generic-page"],o=n.keywords["se-generic-section"],s=!!Array.isArray(o)&&o.some(e=>"kompakt"===e),a=yt(e);if(Object.values(Ze).some(e=>e===a))return;if(!r||!(e=>e===_.DESKTOP)(i))return;const d=document.querySelector(`#${e.targetId}`),l=null==d?void 0:d.querySelector('[id*="div_utif"]'),c=Number(null===(t=e.banner)||void 0===t?void 0:t.width),u=Number(null==l?void 0:l.style.width.replace("px","")),p=isNaN(c)?u:c;if(!d||!(p<=640))return;if(s)return void(e=>{const t=document.querySelector(".kompakt-svd-main-column-anchor");if(!t)return;const n=t.getBoundingClientRect().left,i=null==e?void 0:e.getBoundingClientRect().left;e.style.transform=`translateX(${n-i}px)`,e.style.maxWidth="unset"})(d);const g=null==d?void 0:d.parentElement,h=g&&It(g),m=null==h?void 0:h.querySelector("p"),y=null==m?void 0:m.getBoundingClientRect().left;g&&y&&(g.style.paddingLeft=`${y}px`,d.style.maxWidth="unset",((e,t)=>{v(e)&&(t.style.maxWidth="650px",t.style.marginLeft="0")})(e,d))},At=e=>{const{source:t}=e;return"csm"===t},Ct={[x.VG]:["board","netboard","backfill","outstream"],[x.AFTONBLADET]:["panorama","outstream"],[x.GODARE]:["panorama","outstream"],[x.SVD]:["wph-article-panorama","wph-front-panorama"]},kt=(e,t)=>(e=>{var t;const{publisher:n}=ge.get();return!!Ct[n]&&!!(null===(t=Ct[n])||void 0===t?void 0:t.some(t=>e.includes(t)))})(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{},Pt={adRequested:()=>{},adAvailable:e=>{T(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`);t&&(t.style.minHeight="unset")})(e);const t=document.querySelector(`#${e.targetId} div[id*="button"]`);t&&(t.id=`${e.targetId}-button`)},adLoaded:e=>U(void 0,void 0,void 0,function*(){(e=>{var t;const{deviceType:n}=ge.get(),i=null===(t=e.targetId)||void 0===t?void 0:t.includes("toppanorama"),r=e.height<320;if(!me(n)||!i||!r)return;const o=document.querySelector(`#${e.targetId}`),s=null==o?void 0:o.parentElement;o&&s&&(o.style.minHeight="unset",s.style.minHeight="unset")})(e),(e=>{var t,n,i;const r=Ve(e.targetId.split("-")[0]);if(!["live"].includes(r))return;const o=null!==(t=Tt[r])&&void 0!==t?t:0,s=null!==(i=null===(n=document.getElementById(`${e.targetId}`))||void 0===n?void 0:n.offsetWidth)&&void 0!==i?i:window.screen.width;wt(e,s-o)})(e),St(e)}),adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Ot=9826;class Lt{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=_.DESKTOP,isMobileApp:t}=ge.get();if(t){return{"aa-sch-supply_type":`app_${e===_.MOBILE?"phone":_.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},e.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return U(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=Xe("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return U(this,void 0,void 0,function*(){return yield U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get(),{getConsentAsync:i}=Qe(e,t,n);if(!(yield i()))return;const r=Xe("_pulse2data");return r?r.split(",")[9]:void 0})})}isTrackingForbidden(){return U(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Ot}=ge.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=ge.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return U(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get(),{getConsentAsync:i}=Qe(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=ge.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=ge.get(),i=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return i?{"no-sno-news-sponsors":i}:{}}}const $t=new Lt;function xt(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),r=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}$t.prepare.bind($t);class Nt extends Lt{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=_.DESKTOP}=ge.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return{width:e||n||0,height:t||i||0}}(),t={width:null!==(i=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==i?i:0,height:null!==(o=null===(r=window.screen)||void 0===r?void 0:r.height)&&void 0!==o?o:0};var n,i,r,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){return U(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}})}getAppTypeKeywords(){const{isMobileApp:e}=ge.get(),{appMode:t,mobileOS:n}=xt(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=ge.get();return{"se-generic-section-page_type":`${null!==(t=null===(e=n.keywords["se-generic-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan"}_${"article"===i?"article":"front"}`}}}const _t=864e5,Dt=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return ze("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,i=_t)=>{const r={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(r))},getByTimestamp:(t,n=_t)=>{const i=e(t);if(!i)return null;if(!n)return i;try{const{expirationTime:e,data:t}=JSON.parse(i);return(new Date).getTime()<=e?t:null}catch(e){return ze("Error with parsing localStorage data"),null}}}})(),jt="glimrTags",qt=["glwe_","glwet_"],Mt={geofenceTags:[],geoTags:[],weatherTags:[]},Rt=()=>U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield tt(e,t,n,"glimr")}const{getConsentAsync:i}=Qe(e,t,n);return yield i()}),Bt=()=>U(void 0,void 0,void 0,function*(){const{glimr:e}=ge.get();if(!(yield Rt())||!(null==e?void 0:e.enabled))return void ze("No consent for glimr data fetching.");const t=yield(n=500,U(void 0,void 0,void 0,function*(){return yield Promise.race([U(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),n))])}));var n;if(t)try{t.setTagCacheTimeInSeconds(300),yield new Promise(n=>{t.getTags(e.clientId,(e,t)=>{Dt.setWithTimestamp(jt,{tags:e,tagMappings:t}),n(!0)})})}catch(e){ze(`Error during getting glimr data: ${e}`)}else ze("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),Vt={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},Ft=e=>qt.some(t=>e.startsWith(t)),Ut=e=>e.startsWith("glgc_"),Ht=e=>!Ft(e)&&!Ut(e),Wt=e=>{const t=zt();if(!t)return Mt;const n=((e=[])=>e.filter(Ft))(t),i=((e=[])=>e.filter(Ut))(t),r=((e=[],t)=>{const n=e.filter(Ht);if(t){const{publisher:e}=ge.get(),t=Vt[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},zt=()=>{const e=Dt.getByTimestamp(jt);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},Kt={get:(e,t)=>U(void 0,void 0,void 0,function*(){const n=yield fetch(e,t);if(!n.ok)throw new Error(n.statusText);return yield n.json()}),post:(e,t,n)=>U(void 0,void 0,void 0,function*(){const i=JSON.stringify(n),r=yield fetch(e,{method:"POST",headers:t,body:i});if(!r.ok)throw new Error(r.statusText);return yield r.json()})},Gt="advertory:ppids-cache",Yt={[k.SE]:`SCH${k.SE.toUpperCase()}-EnvHash`,[k.NO]:`SCH${k.NO.toUpperCase()}-EnvHash`},Jt={[k.SE]:`SCH${k.SE.toUpperCase()}-UserHash`,[k.NO]:`SCH${k.NO.toUpperCase()}-UserHash`},Qt={[k.SE]:`sch${k.SE}-envhash-v3`,[k.NO]:`sch${k.NO}-envhash-v3`},Xt={[k.SE]:`sch${k.SE}-userhash-v3`,[k.NO]:`sch${k.NO}-userhash-v3`},Zt={[k.SE]:`'sch${k.SE}-iosid-v3'`,[k.NO]:`'sch${k.NO}-iosid-v3'`},en={[k.SE]:`sch${k.SE}-androidid-v3`,[k.NO]:`sch${k.NO}-androidid-v3`},tn={[k.SE]:"sdrn:schibsted.com:user",[k.NO]:"sdrn:spid.no:user"};class nn{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:i})=>{t.append(e,`${i}-${n}`)}),t}}const rn=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return U(this,arguments,void 0,function*(e,t=1e4){var n,i;const r=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=r.xandr)||void 0===n?void 0:n.ppId1,null===(i=r.xandr)||void 0===i?void 0:i.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ze("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},on=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return U(this,void 0,void 0,function*(){var n,i,r,o,s,a,d,l,c,u,v;const p=Dt.get(Gt),g=yield this.getNewPPIDs(e,t);if(this.shouldHash(p,g)){const t=null!==(n=e.hasherUrl)&&void 0!==n?n:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,t);return c?(this.cachePPIDs(l,c,null===(i=g.idfv)||void 0===i?void 0:i.plain,null===(r=g.anId)||void 0===r?void 0:r.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(s=c.environmentId)&&void 0!==s?s:"",null===(a=g.idfv)||void 0===a?void 0:a.plain,null===(d=g.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==p?void 0:p.userId.hashed)&&void 0!==l?l:"",null!==(c=null==p?void 0:p.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==g?void 0:g.idfv)||void 0===u?void 0:u.plain,null===(v=null==g?void 0:g.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ze("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,i){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=i?i:null}shouldHash(e,t){var n,i;if(!e)return!0;for(const r in e){if((null===(n=e[r])||void 0===n?void 0:n.plain)!==(null===(i=t[r])||void 0===i?void 0:i.plain))return!0}return!1}cachePPIDs(e,t,n,i){const r=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),i?{anId:{plain:i}}:{});Dt.set(Gt,r)}hashPPIDs(e,t){return U(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield Kt.post(t,n,e)}catch(e){return ze("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return U(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>U(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${tn[t]}:${n}`:null}))(t,n),r=yield(e=>U(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();return t?`sdrn:schibsted:environment:${t}`:null}))(t),o=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:i},environmentId:{plain:r},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},o?{idfv:{plain:o}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:i,environmentId:r}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:i.plain,environmentId:r.plain}}},sn=e=>U(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:r}=e;if(!(yield tt(n,r,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([rn.processPPIDs(t,null==n?void 0:n.timeout),on.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){ze(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),an=e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=on.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]).add(o,Zt[e]).add(s,en[e]).buildEids()}]}},dn=e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=on.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]).add(o,Zt[e]).add(s,en[e]).buildRyEids()}}]}}},ln=e=>U(void 0,void 0,void 0,function*(){const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r}=on.getPPIDs(),o=(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]);return yield new Promise(e=>{e(o.buildVideoEids())})});const cn=new class extends Nt{constructor(){super(...arguments),this.getSDKVersion=()=>U(this,void 0,void 0,function*(){return{"se-generic-sdk-version":"function"==typeof window.apntag.getAstVersion?window.apntag.getAstVersion():""}})}prepare(e){return U(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"se-generic-pagemode":"light"},this.getCountryCodeKeywords(k.SE)),this.getPublisherKeywords()),yield this.getExternalIdSrc()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield this.getSDKVersion()),yield U(void 0,void 0,void 0,function*(){const{glimr:e}=ge.get(),{addPublisherToGeo:t}={},n=yield Rt();if(!(null==e?void 0:e.enabled)||!n)return ze("No consent for getting glimr tags."),{};const i=Ce(),r=Wt(t);return{[`${i}-geo`]:r.geoTags,[`${i}-weather`]:r.weatherTags,[`${i}-geofence`]:r.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=rn.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),e.keywords);return Object.assign(Object.assign({},e),{keywords:t,user:Object.assign(Object.assign({},an(k.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var un=cn.prepare.bind(cn);const vn=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),pn=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),gn=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=ge.get(),r=[`${Ce()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...i?r:[]],s=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),a=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:s}}},a)}},hn=(e,...t)=>U(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,i)=>{const r=document.createElement("script");r.async=!0,r.src=e;const o=()=>{a(),n()},s=()=>{a(),i(new Error(`Failed to load ${e}`))},a=()=>{r.removeEventListener("load",o),r.removeEventListener("error",s),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",s);const d=setTimeout(()=>{a(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),mn=e=>e.includes("snoap.no"),yn=e=>{var t,n,i,r,o;return!!(null===(o=null===(r=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===i?void 0:i.adResponse)||void 0===r?void 0:r.ads[1])||void 0===o?void 0:o.rtb)},fn=et([],()=>{const e=({width:e,height:t})=>{var n;const i=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!i)return;const{clientWidth:r,clientHeight:o}=i,s=e/r,a=t/o;i.style.transform=`scale(${s},${a})`,i.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),wn=e=>{const t=et([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const i=n.contentDocument.createElement("style");i.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(i),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},bn=[],En={},Tn=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=Sn(e);n?(In(i,n),An(e,i,t)):(In(i,n),Cn(e,i,t))})},In=(e,t)=>{var n,i;const r=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!r)return;const o=t?"showFullscreen":"hideFullscreen";null===(i=r.contentWindow)||void 0===i||i.postMessage(`advertory:${o}-${e}`,"*")},Sn=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},An=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),bn.includes(t)||bn.push(t),n&&window.addEventListener("scroll",En[t],{passive:!0})},Cn=(e,t,n)=>{bn.includes(t)&&(n&&window.removeEventListener("scroll",En[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},kn=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:i=[".skyscraper_r"],headerZIndex:r=3}=t,o=[],s=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),i.forEach(e=>{const t=document.querySelector(e);t&&s.push(t)}),()=>{o.length&&Pn(e,o,r,0),s.length&&Pn(e,s,r,40)}},Pn=(e,t,n,i)=>{const r=e.offsetHeight,o=window.scrollY,s=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let a;a=s>o?(s-o)/t-i:(o+t-(s+r))/t;const d=a<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=a.toString()})};let On=null;const Ln=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${fn})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(mn(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=wn(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>mn(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),mn(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),yn(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},$n=()=>{On=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,i=e?e.offsetLeft:0,r=document.documentElement;r.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),r.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),r.style.setProperty("--advertory-fullscreen-scroll-left",`${i}px`)},xn=()=>{On||(On=window.requestAnimationFrame($n))},Nn=(t,n)=>{var i,r,o,s;const{country:a}=ge.get(),{targetId:d}=t;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(i=null==n?void 0:n.iosSafeAreaTopFix)&&void 0!==i?i:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:r="16px 0",beforeContentValue:o=""}=e,s=t/2,a=document.createElement("style");a.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${s}px),\n ${i} calc(50% - ${s}px),\n ${i} calc(50% + ${s}px),\n ${n} calc(50% + ${s}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${r};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,a.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(a)})(null!==(r=null==n?void 0:n.overlayStyles)&&void 0!==r?r:{});const l=document.getElementById(d),c=null==l?void 0:l.parentElement;if(!l||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>Tn(e,n),{}),r=Sn(e);i.observe(e),n&&(En[r]=kn(e,t))})(c,n),l.className="advertory-fullscreen-scroll";const u=A(t,e)?"absolute":"fixed";l.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=d,l.setAttribute("data-ad-label",C[a].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),xn(),window.addEventListener("resize",xn),null===(o=window.visualViewport)||void 0===o||o.addEventListener("resize",xn),null===(s=window.visualViewport)||void 0===s||s.addEventListener("scroll",xn)},_n=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=yn(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,i=yn(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ln(t,e))},Dn=()=>U(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:r}=ge.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=ge.getHandlers(),{getConsentAsync:s}=Qe(t,i,n),a=yield s(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:i=>{const r=vn(),{prebid:{relevantCbTimeout:o}={}}=ge.get(),s="relevantCb"===i&&o?o:n[i].timeout,a=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,r.loadTags&&r.loadTags())},s);t.push(a)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),l=vn(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=vn();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=pn();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return ze("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=pn();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=a?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};ze("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},dn(n)),gn(p,v))),ze("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},dn(n)),gn(p,v))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e)),d.cleanup()}},customNativeRender:e=>{jn(e,o)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:i,adDiv:o}=t||{};if(!o)return;const s=n(t),a=Object.assign(Object.assign({},i),{targetId:o.id,banner:!0});c(a)&&(Nn(a,r),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const i=new MutationObserver(()=>{n()&&i.disconnect()});i.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(s))}}),ze("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e))}},customNativeRender:e=>{jn(e,o)},directRenderFn:()=>{}})})}),jn=(e,t)=>{var n;const{divId:i,native:r,bid:o}=e,s=document.querySelectorAll(`[id^=${i}]`)[0],a=`RY-${s.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(s,a);const d=null===(n=s.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:r,targetId:a},ge.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},qn=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:r}=window,[o,s]=t;if(!i.dataset.lockedsize&&s&&o)i.style.width=`${o}px`,i.style.height=`${s}px`,n&&(r.resizeAd(i.id,[o,s]),i.dataset.lockedsize="true",i.dataset.lockedwidth=o.toString(),i.dataset.lockedheight=s.toString());else if(null==i?void 0:i.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=i.dataset;e&&t&&r.resizeAd(i.id,[e,t])}},Mn=["netboard","board"];class Rn{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,i;const{editionName:r}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),s=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),a=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return a.searchParams.append("editionName",r),o&&a.searchParams.append("urlData",o),s&&a.searchParams.append("excludedItems",s),l&&a.searchParams.append("spid",l),d&&a.searchParams.append("envid",d),a.toString()}fetchData(e){return U(this,void 0,void 0,function*(){var t,n,i;const r=yield this.identityFacade.getIdentityUser(),o=null!==(i=yield null===(n=null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId)||void 0===n?void 0:n.call(t))&&void 0!==i?i:"",s=(null==r?void 0:r.userId)?String(r.userId):"",a=this.buildUrl(e,{envId:o,spid:s});try{ze("Starting fetching DrEdition ad from URL:",a);const e={method:"GET"},t=yield Kt.get(a,e);return ze("Fetch operation completed successfully."),t}catch(e){ze("Error during fetch operation:",e)}return null})}}let Bn=class{getDrEditionUTMParams(e,t){var n;const{title:i="",clientName:r,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:s}=t,a=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:s,utm_campaign:r,utm_medium:a},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const i=this.getDrEditionUTMParams(t,n),r=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(i).forEach(([e,t])=>{r.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const i=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!i)return"";const r=this.getDrEditionUTMParams(e,t),o=new URL(i);return Object.entries(r).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(e,t){return U(this,void 0,void 0,function*(){const{id:n,autoplay:i,mute:r,videoLoop:o,vendor:s}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:s,vgtvAutoplay:i,vgtvMuted:r,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:i,pathname:r}=new URL(n);if(!i.includes("www.vg.no")&&!r.includes("annonsorinnhold"))return[n];const o=r.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const Vn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):ze("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Fn{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return U(this,void 0,void 0,function*(){var n,i;const{drEditionConfig:{containerSelector:r},renderAsBackfill:o=!1}=t,s=e.querySelector(r);if(!s)return void ze(`Container with selector "${r}" not found.`);const a=yield this.drEditionService.fetchData(t);return(null==a?void 0:a.itemId)||o?!(null==a?void 0:a.itemId)&&o?(ze("No Dr. Edition ads available to render. Collapsing whole placement."),Ne(e.id),void Vn(s)):((null==a?void 0:a.itemId)&&o&&(ze("Dr. Edition ad available to render as a Xandr backfill."),_e(e.id)),void(a?(a.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(a.css,"style"),yield this.rendererManager.render(s,a,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(a,t),Vn(s),this.drEditionAds.push(a),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(a.itemId),this.observeAdView(e,a,t),null===(i=e.querySelector("a"))||void 0===i||i.addEventListener("pointerup",()=>null)):Vn(s))):(ze("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(e),void Vn(s))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";_e(i)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const i=e.querySelector(".dr-edition-slider");if(!i)return!1;let r=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(r&&clearTimeout(r),r=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...i.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...i.children].forEach(e=>{o.observe(e)}),!0}}class Un{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return U(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=Qe(n.tcf,n.isMobileApp,n.country),r=yield i(),o=me(n.device)?t.mobileHTML:t.desktopHTML,s=r?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=s,e.querySelectorAll("a").forEach(e=>{var i,r,o;e.search=null!==(o=null===(r=(i=this.newsroomStrategy).getUrlSearchParams)||void 0===r?void 0:r.call(i,e,t,n))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})})}}class Hn{constructor(e){this.strategy=e}handle(e,t){return U(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:i}={}}=e;(n||i)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return U(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield hn(t)}catch(e){ze("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return U(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:i}=e.videoConfiguration,r=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==r||r.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==r?void 0:r.parentNode;if(!o)return;const s=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");s!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,r;const{preview:{url:o,thumbnail:s}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const a=document.querySelector(".dr-edition-preview .preview-video");return!!a&&(a.setAttribute("src",o),a.setAttribute("playsinline",""),!(!a||!s)&&(null===(r=(i=t.drEditionConfig).addPreviewVideo)||void 0===r||r.call(i,a),!0))}}let Wn=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,i){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const i=null==n?void 0:n.textContent;return i?i.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:i}={}}=t,r=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:i}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return U(this,void 0,void 0,function*(){var i,r,o,s,a,d,l,c;if(!this.pulse)return;const u=this.getEventInput(e,t,n,"view");(null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)?null===(o=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===o||o.call(r,u):(null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)?null===(d=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===d||d.call(a,u):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,u)})}trackContentClick(e,t,n){return U(this,void 0,void 0,function*(){var i,r,o,s,a,d;if(!this.pulse)return;const l=this.getEventInput(e,t,n,"click");this.pulse.trackLegacyClickUIElement?null===(r=(i=this.pulse).trackLegacyClickUIElement)||void 0===r||r.call(i,l):this.pulse.trackClickUIElement?null===(s=(o=this.pulse).trackClickUIElement)||void 0===s||s.call(o,l):null===(d=(a=this.pulse).trackElementClick)||void 0===d||d.call(a,l)})}};class zn extends Wn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:i,clientName:r="",creativeId:o}={}}=t,{columnName:s,primaryPosition:a}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:s,primaryPosition:a},"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let Kn=class extends Wn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,r,o,s,a,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulseObjectId)||void 0===o?void 0:o.call(r))&&void 0!==s?s:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(a=this.newsroomStrategy)||void 0===a?void 0:a.getTags)||void 0===d?void 0:d.call(a,e)}}getEventInput(e,t,n,i){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,i),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,i){var r,o,s,a;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(a=null!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getUrlWithParams)||void 0===o?void 0:o.call(r,t,n))&&void 0!==s?s:p)&&void 0!==a?a:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:i,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};class Gn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){yield U(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],a=this.createPlayerOverlay(e);J(s,a);const d={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},l=yield G(d);l.once("assetReady",()=>{K(l,s)}),l.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?a.classList.add("is-playing"):a.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?a.classList.add("is-inactive"):a.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),l.once("PulseStats:ready",()=>U(this,void 0,void 0,function*(){const e=yield l.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===F.FRONT?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:i}=new URL(n),r=i.split("/").filter(Boolean);return r.length?[...r.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const Yn="https://www.aftonbladet.se/video-player-extras/latest/";class Jn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const s={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${Yn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${Yn}external-link.js`]:{name:"ExternalLink"}}};yield G(s),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}class Qn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const s={id:t,node:n,autoplay:i,mute:r,vendor:o,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},H(e)?e:{}),{provider:Object.assign(Object.assign({},H(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${t}`]},requestSettings:{}}}},a=yield G(s);a.once("PulseStats:ready",()=>U(this,void 0,void 0,function*(){const e=yield a.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===F.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Xn=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const Zn=(e,t,n)=>{var i;const{publisher:r,pageType:o,country:s}=e,a={[x.VG]:new Bn,[x.E24]:new Gn,[x.AFTONBLADET]:new Jn,[x.SVD]:new Qn}[r]||new Xn,d=new(s===k.SE?zn:Kn)(n,a,o),l=new Rn(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new Un(a,d),u=new Hn(a);return new Fn(l,c,u,d)},ei=()=>U(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class ti{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return U(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return ze("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return U(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const ni=(e,t,n)=>{const{wrapperSelector:i}=null==e?void 0:e.drEditionConfig,r=document.querySelectorAll(i),o=new IntersectionObserver((i,r)=>((e,t,n,i,r)=>{const o=Zn(n,i,r);e.forEach(e=>{var i,r,s;if(!e.isIntersecting)return;const a=e.target,d=null!==(i=a.dataset.editionName)&&void 0!==i?i:"",l=null!==(r=a.dataset.pulseColumnname)&&void 0!==r?r:"",c=null!==(s=a.dataset.pulsePrimaryposition)&&void 0!==s?s:"";o.fetchAndRenderAd(a,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(a)})})(i,r,e,t,n),{rootMargin:"400% 0px"});r.forEach(e=>o.observe(e))},ii=[],ri=(e,t)=>U(void 0,void 0,void 0,function*(){var n;const{pulse:i,tcf:r,deviceType:o,drEdition:s,publisher:a,pageType:d,country:l,isMobileApp:c}=e;if(!(yield tt(r,c,l,"handleDrEditionBackfill")))return;const u=((e,t)=>{var n;const{deviceType:i,placements:r,drEdition:{fallbackGlobalEditionName:o}={}}=e,s=r[i]||r.desktop,a=Ae(t.targetId),d=s.find(e=>e.id===a),l=Mn.some(e=>a.startsWith(e)),c=ii.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(ii.push(a),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!u)return;if(!(null==i?void 0:i.instance))return void ze("Pulse has not been passed as a prop, aborting");const v=yield ei(),p=new ti(v),g=Zn({publisher:a,pageType:d,country:l},p,null==i?void 0:i.instance),h=document.getElementById(t.targetId);if(!h||!s)return;h.classList.value="";const m=document.createElement("div");m.className=s.containerSelector.replace(/^[.#:[\]]+/,""),h.innerHTML=m.outerHTML;const y={editionName:(null===(n=null==u?void 0:u.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:s,device:o,tcf:r,isMobileApp:c,country:l,renderAsBackfill:!0};yield g.fetchAndRenderAd(h,y)}),oi="collapseAd",si="hideAd",ai="resizeAd",di="renderDrEditionFallback",li="wallpaperImageUrl",ci="wallpaperColor",ui="velvet",vi=[ai,li,ci,oi,si,di,ui];let pi;const gi=e=>{if("object"==typeof e)return e;if(t=e,xe.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:li,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:ci,wallpaperColor:t}}if(e.startsWith(di)){const t=e.split(":")[1];return{name:di,targetId:t}}if(e.startsWith(oi)||e.startsWith(si)){const t=e.split(":")[1];return{name:oi,targetId:t}}if(e.includes("name")&&vi.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},hi=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=gi(t);if(!n)return;if(!n.name||!vi.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;i===ui&&a&&(a.includes("noScroll")&&(pi=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(a.includes("close")||a.includes("ended"))&&(null==pi||pi(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==oi&&i!==si||!r||Ne(r),i===ai&&r&&a&&qn(r,a),i===di&&r&&(Ne(r),ri(ge.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&qn(r,d,!0),i===li&&o&&(e=>{const t=document.querySelector(`.${Le}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===ci&&s&&(e=>{const t=document.querySelector(`.${Le}`);t&&(t.style.backgroundColor=e)})(s)},mi=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),yi=(e,t)=>{if(f(t))return ze(`loading finn blink ad with full ads chain for ${t}`),void(()=>{const{publisher:e,country:t,finnBlink:n}=ge.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:r}}=ge.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{_e(e),Te(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>U(void 0,void 0,void 0,function*(){yield i(e,s,null)}),withFullAdsChain:e=>U(void 0,void 0,void 0,function*(){yield i(e,s,a,()=>{je.getData("horseshoe").isAvailable&&r(e)})})}})().withFullAdsChain(t);Te(()=>(ze("core showTag",{id:t}),e.showTag(t)))},fi=(e,t)=>U(void 0,void 0,void 0,function*(){yield Ie,yield Se;const n=new IntersectionObserver((e,t)=>((e,t,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:i}=e,r=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(i),o=document.getElementById(r);ze("core log from intersection observer handler",{targetId:r,element:o}),n(window.apntag,r),o&&(t.unobserve(o),t.disconnect())})})(e,t,yi),mi(t));n.observe(e)}),wi=new Map,bi=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Ei=".brandstudio-premium-content-widget",Ti=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),Ii=({adWrapper:e,placementContainer:t})=>{const n=Ti({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Me(i=t),i.innerHTML=""},Si=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},Ai=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=ge.get(),i=bi.includes(n)&&Boolean(t.closest(Ei));const r=i?t.closest(Ei):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,s=n&&t.matches("iframe, article")&&e;if(!n||!i&&!s||i&&!r)return;if(s)return Si(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=r;a&&d.contains(a)?Si(a):d.hasAttribute("style")&&Si(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},Ci=(e,t,n,i,r,o)=>{var s;const a=performance.now(),d=null!==(s=wi.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;a-d>=r&&l&&(wi.set(t,a),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&Ii({adWrapper:i,placementContainer:n}),Te(()=>{e.setKeywords([t],{[`${Ce()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},ki=(e,t,n)=>{const i=new IntersectionObserver((e,i)=>((e,t,n,i)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:r,boundingClientRect:o}=e;t(window.apntag,r.id,o.y,n,i,r)})})(e,Ci,t,n),mi(300));i.observe(e)},Pi=(e,t=6)=>{const n=[];for(let i=0;i<e.length;i+=t){const r=e.slice(i,i+t);n.push(r)}return n},Oi=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),Li=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},$i=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=ge.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),ji(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},xi=(e,t,n)=>{const i=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const r of i){const i=e.find(e=>{var t;return e.id===(null===(t=r.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==i?void 0:i.threshold;Li(r,o)&&i&&(qe(i.id),n.length&&r.classList.remove(...n),ji([i],t))}},Ni=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=ge.get();t&&(e.forEach(({id:e})=>{const t=_i(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{xi(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),xi(e,!1,t))};n.persisted&&(Oi()?window.addEventListener("scroll",i,{passive:!0}):xi(e,!1,t))})})(e,n))},_i=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Di=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(_i(t)),r=(e=>1===e[0]&&1===e[1])(i),o={sizes:[i],allowedFormats:r?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return r||(o.native=void 0),o},ji=(e,t=!1)=>{const{requestSize:n=ve}=ge.get(),i=e.map(({id:e})=>e),r=Pi(i,n);if(t)for(const t of e){const e=Di(t);window.apntag.modifyTag(t.id,e)}for(const e of r)Te(()=>window.apntag.refresh(e))};const qi="#fff",Mi="#0098da",Ri=(e,t=!0)=>{(e===Ze.WELCOME_PAGE||e===Ze.TOPSCROLLER)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Bi=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},Vi=e=>{document.body.style.overflow=e?"initial":"hidden"},Fi=e=>{const t=Hi(e),n=Ui(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),Vi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},Ui=e=>{const t=()=>Fi(e);return window.addEventListener("advertory:closeTakeover",t),Bi(),t},Hi=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&Fi(e)};return Bi(),window.addEventListener("keydown",t),t},Wi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(Hi(e),Ui(e),Bi(),t.addEventListener("click",()=>{Fi(e)}),Vi(!1))},zi=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),Ui(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},Ki=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>Fi(e))})(e)},Gi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=ge.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),i=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&i&&(i.style.display="flex",i.innerText=C.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Yi=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=C.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Ji=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=C.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Qi=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},Xi=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},Zi=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${gt})()`,e+t.outerHTML})(e)),n},er=e=>{const t=(e=>{const{requests:t}=window.apntag,n=yn(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,i=yn(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Zi(t))},tr=e=>U(void 0,void 0,void 0,function*(){const{takeover:t}=ge.get(),{targetId:n}=e,i=document.querySelector(`#${n}`),r=document.querySelector(".advertory-takeover-wrapper");if(!i||!r||!t)return;const s=(e=>{const{width:t,height:n}=e;return dt(t,n)?Ze.SPLASH:A(e,o)?Ze.VELVET:lt()?Ze.TOPSCROLLER:Ze.WELCOME_PAGE})(e),a=r.offsetHeight,d=window.scrollY>a;r.style.display="block",!d&&Ri(s,!1),((e,t)=>{({[Ze.WELCOME_PAGE]:Ji,[Ze.SPLASH]:Gi,[Ze.TOPSCROLLER]:Yi,[Ze.VELVET]:Qi})[t](e)})(r,s),Xi(),((e,t)=>{({[Ze.WELCOME_PAGE]:zi,[Ze.TOPSCROLLER]:zi,[Ze.SPLASH]:Wi,[Ze.VELVET]:Ki})[t](e)})(r,s),((e,t,n)=>{if(!n)return;({[Ze.WELCOME_PAGE]:()=>{const{buttonLabel:i}=vt(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=i?i:"")})},[Ze.SPLASH]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:s}=vt(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&s){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&r&&(n.setAttribute("src",r.url),n.setAttribute("alt",r.alt)),".advertory-splash-navbar-wrapper"===t&&i){const{backgroundColor:e,color:t}=i;n.style.setProperty("background-color",null!=e?e:qi,"important"),n.style.color=null!=t?t:Mi}}})},[Ze.TOPSCROLLER]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=vt(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||r||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=i?i:""))})},[Ze.VELVET]:()=>{}})[t]()})(r,s,t),yield ct(),!d&&Ri(s,!0),pt(e,s)}),nr="advertory-brandmetrics-survey",ir=()=>U(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=ge.get(),r=yield tt(i,n,t,"norstat");if(!e||n||!r)return;const o=(e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r}=on.getPPIDs(),o=(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{U(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const i=document.createElement("img");i.src=e,i.id=null!=t?t:"",n&&(i.style.display="none"),document.body.appendChild(i)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===k.NO?"schibsted":"schibstedse"}/map/${o}`,"norstat")}),rr=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,or=e=>`externalImpId:'${e}'`,sr=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=ge.get(),r=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${ke()}-count`],i=e.positionConfig.find(e=>e.adPositionIndex===n);if(!i)return e;const r=i.keywords?Object.assign(Object.assign({},e.keywords),i.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==i?void 0:i.sizes)&&void 0!==t?t:e.sizes,keywords:r})})(e),{id:o,sizes:s,keywords:a,allowedFormats:d,invCode:l,ssa:c=!1,nativeCustomProperties:u,safeframeConfig:v,dynamicSizeWidthCheck:p=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||st())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],i=null==n?void 0:n.filter(e=>e!==Ze.TOPSCROLLER),r=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":i}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:r})})(r),g=Object.assign({invCode:l,sizes:s,targetId:o,keywords:rr(a,c),allowedFormats:d,dynamicSizeWidthCheck:p},v&&{safeframeConfig:v}),h=(e=>{var t,n,i,r,o,s,a;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(i=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===i?void 0:i.pageViewId)?(ze("Tracker state pageViewId is:",null===(o=null===(r=null==e?void 0:e.instance)||void 0===r?void 0:r.state)||void 0===o?void 0:o.pageViewId),null===(a=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===a?void 0:a.pageViewId):(ze("Tracker state does not contain field pageViewId or it is empty"),""):(ze("Tracker state is empty"),""):(ze("Tracker is not configured in initAdvertory function"),"")})(i);n&&h&&(ze("External Impression ID assigned to defineTag:",or(h)),g.externalImpId=or(h));const m=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,i])=>((null==e?void 0:e.includes(n))&&(t[n]=i),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(u);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(g.native=m),g},ar=e=>!e.includes("takeover")||st(),dr=e=>{if(!e)return e;const t=e[`${Ce()}-targetid`],n=t?Ae(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Ce()}-targetid`]:[n]})},lr=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Ce()}-geo`]&&{[`${Ce()}-geo`]:["geo-test-value"]}),e[`${Ce()}-geofence`]&&{[`${Ce()}-geofence`]:["geofence-test-value"]}),e[`${Ce()}-weather`]&&{[`${Ce()}-weather`]:["weather-test-value"]}),cr=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const i=n.split(",")[0].split(":")[0],r=e.find(e=>e.invCode===i),o=document.querySelector(`[id^=${null==r?void 0:r.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},ur=(e,t)=>U(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),vr=()=>U(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),pr={arrayMerge:(e,t)=>t},gr=e=>U(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:i}=e;return Boolean(t&&n&&(null==i?void 0:i.publisherClassName))})(e))return e;try{const t=yield(e=>U(void 0,void 0,void 0,function*(){const t=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(e);if(!t)return null;const n=new AbortController,i=setTimeout(()=>n.abort(),5e3);try{return yield Kt.get(t,{method:"GET",signal:n.signal})}catch(e){throw ze("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(i)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:r,placements:o,threshold:s,batchSize:a}=t,d=le.all([e.placements,o],pr),l=le(e.pageOptions,{keywords:i},pr),c=le(e.appearanceConfig,{defaultThreshold:s},pr),u=le(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:r},pr);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=a?a:e.requestSize,pageOptions:l,appearanceConfig:c,refreshConfig:u})})({siteConfig:e,configOverrides:t}):e}catch(t){return ze("Error fetching S3 config, using site config",{error:t}),e}}),hr=".advertory-right-column-track",mr="--advertory-right-column-track-height",yr=e=>e.getBoundingClientRect().top+window.scrollY,fr=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},wr=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},br=(e,t)=>`${e}-${t}`,Er=(e,t,n)=>{var i;const r=Array.from(null!==(i=e.querySelectorAll(t))&&void 0!==i?i:[]),o=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===o.length)return;const s=yr(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=fr(e);wr("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=yr(e),r=br(mr,t),o=i-n,s=br("--advertory-right-column-split-point-height",t),a=fr(e);wr(r,o),wr(s,a)})(e,t+1,s),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=br("--advertory-right-column-ad-height",t),i=fr(e);wr(n,i)})(r[t])});((e,t)=>{const n=yr(e);wr(mr,n-t)})(o[Math.min(r.length,o.length-1)].point,s)};let Tr=!1;class Ir{getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:i,pathname:r}=new URL(n);if(!i.includes("www.vg.no")&&!r.includes("annonsorinnhold"))return[n];const o=r.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Sr{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class Ar{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:i}=this.parseKilkayaData(e);return{id:i,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return U(this,void 0,void 0,function*(){var t,n,i,r,o,s,a,d;if(!this.pulse)return;const l=this.getEventInput(e,"view");(null===(t=this.pulse)||void 0===t?void 0:t.trackLegacyViewUIElement)?null===(i=null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)||void 0===i||i.call(n,l):(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(s=null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)||void 0===s||s.call(o,l):null===(d=null===(a=this.pulse)||void 0===a?void 0:a.trackElementView)||void 0===d||d.call(a,l)})}trackContentClick(e){return U(this,void 0,void 0,function*(){var t,n,i,r,o,s;if(!this.pulse)return;const a=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,a):this.pulse.trackClickUIElement?null===(r=(i=this.pulse).trackClickUIElement)||void 0===r||r.call(i,a):null===(s=(o=this.pulse).trackElementClick)||void 0===s||s.call(o,a)})}}class Cr extends Ar{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,i,r,o,s;const{clientName:a,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(r=null===(i=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===i?void 0:i.call(n))&&void 0!==r?r:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:a,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(s=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===s?void 0:s.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:i}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const kr="[data-k5a-teaser-analytics]",Pr=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const r=new Cr(e,t,n),o=new WeakMap,s=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},a=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,i=n.querySelector(kr);Boolean(null==i?void 0:i.dataset.k5aTeaserAnalytics)?(r.trackContentView(n),t.unobserve(e.target),s(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(kr);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(r.trackContentView(e),t.unobserve(e),s(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});i.forEach(e=>{a.observe(e),e.addEventListener("click",()=>r.trackContentClick(e))})};class Or{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const i={[x.VG]:new Ir}[n]||new Sr;Pr(e.instance,i,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const i=n.parentElement;i&&(ze(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(i))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";_e(i)}loadKilkayaScript(e){return U(this,void 0,void 0,function*(){yield hn(e)})}run(e){return U(this,void 0,void 0,function*(){const{tcf:t,isMobileApp:n,country:i,kilkaya:r}=e;if(!(null==r?void 0:r.enabled))return;const o=yield tt(t,n,i,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(r.url),this.handleKilkayaStreamTracking(e))})}}const Lr=1e4,$r=e=>e.some(e=>e.some(e=>!!e&&Li(e,0))),xr=()=>{const{widescreenSwitching:e}=ge.get(),{enabled:t,rotationInterval:n=Lr,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const r=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=ge.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(i);let o=0,s=Date.now(),a=$r(r);if(!r.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},l=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(r);const c=((e,t)=>{let n=null;return(...i)=>{null===n&&(e(...i),n=setTimeout(()=>{n=null},t))}})(()=>{a||(a=$r(r)||a,s=Date.now());Date.now()-s>=n&&((()=>{const e=l(o),t=r.map(e=>e[o]),n=r.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),o=l(o),s=Date.now())},1e3);window.addEventListener("scroll",c)};let Nr,_r=[];const Dr=["takeover","wallpaper"],jr=e=>{const t=(e=>{const t=je.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:s,requestSize:a=ve,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:p},takeover:g,fullscreenScroll:h,useAppTabletInvCode:m}=e;return{xandr:{member:p,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:d,country:l,pageType:c,deviceType:u,placements:i,tcf:r,requestSize:a,isMobileApp:v,useAppTabletInvCode:m},o&&{glimr:o}),n&&{queryConfig:n}),s&&{appearanceConfig:s}),g&&{takeover:g}),h&&{fullscreenScroll:h})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},qr=()=>U(void 0,void 0,void 0,function*(){const{pageOptions:e}=ge.get(),{preparePageOptions:t}=ge.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=ge.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),i=yield U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();return(yield tt(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),r=yield t(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}),i));(e=>{const t=je.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=lr(e);je.setData("alertoryConfigKeywords",n)})(r.keywords),Te(()=>Nr.setPageOpts(r))}),Mr=e=>U(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:r}=ge.get();Rr(e);const o=yield tt(n,i,r,"prebid");(null==t?void 0:t.enabled)&&o?(ze("core loadPlacements prebid enabled"),yield Dn()):(ze("core load tags invoked without prebid enabled"),Br(e))}),Rr=e=>{const{prepareTag:t}=ge.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const i=t.findIndex(t=>e.id.includes(t)),r=t.findIndex(e=>n.id.includes(e));return-1!==i&&-1===r?-1:-1===i&&-1!==r?1:i-r})})(e).forEach(e=>{ze("core defineTags",{placement:e});const i=sr(e);if(ar(e.id)){const r=t(i),o=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:dr(i),sizes:r}})(r);n.push(o),Te(()=>(ze("core defineTag - add to the queue",{placement:e,preparedTag:r}),Nr.defineTag(r)))}}),(e=>{var t,n,i;(null===(i=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===i?void 0:i.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Br=e=>{const t=e.filter(({id:e})=>ar(e)).map(({id:e})=>e);t.length&&Te(()=>(ze("core loadTags",{placementsIdsToLoad:t}),Nr.loadTags([...t])))},Vr=(e,t)=>U(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=ge.get(),{threshold:r,refresh:o}=e,s=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),a=null==n?void 0:n.defaultThreshold[i];s&&(ze("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:r,deviceDefaultThreshold:a}),yield fi(s,null!=r?r:a)),s&&o&&(ze("core showAd - setup refreshing",{placement:e,adObj:t}),s.dataset.refresh=o.toString())}),Fr=e=>e.some(({id:e})=>Dr.some(t=>e.includes(t))),Ur=e=>U(void 0,void 0,void 0,function*(){var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return;const n=(e=>{const{requestSize:t=ve,queryConfig:{placementBatches:n}={},deviceType:i}=ge.get(),r=We(e),o=Object.keys((null==n?void 0:n[i])||{}).flatMap(e=>r[e]||[]),s=new Set(o.map(({id:e})=>e)),a=e.filter(({id:e})=>!s.has(e));return[...o.length>0?[o]:[],...Pi(a,t)]})(e);for(const e of n)Fr(e)?(ze("core loadAds without lazy loading",{placementsToLoad:e}),yield Mr(e)):e.length&&(ze("core loadAds with lazy loading",{placementsToLoad:e}),yield Hr(e))}),Hr=e=>U(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=ge.get(),i=[];if(!t)return ze("lazy load is not enabled",{placements:e}),void(yield Mr(e));const r=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{ze("lazy load is enabled - handler start",{loadedPlacementIds:i,placements:e});const r=e.every(e=>i.includes(e.id)),o=e.map(e=>e.id);!r&&i.push(...o),!r&&Mr(e),ze("lazy load is enabled - handler stop",{loadedPlacementIds:i,placements:e,arePlacementsLoaded:r,placementIds:o}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(ze("lazy loading - observe element",{placementId:e.id,element:t}),r.observe(t))})}),Wr=()=>U(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:i,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:o}}=ge.getHandlers(),{wallpaper:s,fullscreenScroll:a}=ge.get(),d=[];Te(()=>{Nr.onEvent("adRequested",()=>{e.adRequested()}),Nr.onEvent("adAvailable",t=>U(void 0,void 0,void 0,function*(){var n,o,d,l,v,g;ze("core adAvailable start",{placementsAvailable:_r,adObj:t,isFullscreenScrollAd:c(t),isFinnBlink:f(t.targetId),isNativeAd:u(t),isMediation:At(t),isTakeoverAd:p(t),isCollapseAd:m(t),isWallpaperAd:h(t)});const y=null===(d=null===(o=null===(n=null===window||void 0===window?void 0:window.apntag)||void 0===n?void 0:n.requests)||void 0===o?void 0:o.tags[t.targetId])||void 0===d?void 0:d.adResponse.ads;At(t)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(t.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(t)&&_n(t),E(t)&&xr(),c(t)&&!f(t.targetId)&&Nn(t,a),!u(t)||At(t)||f(t.targetId)||i(t,ge.get()),p(t)&&!m(t)&&(er(t.targetId),yield tr(t)),h(t)&&(r(()=>Te(()=>window.apntag.showTag(t.targetId)),s),je.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(t)&&je.setData("horseshoe",{isAvailable:!0}),mt({adObj:t}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const i=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;i&&((e,t)=>{const{height:n,width:i,native:r}=e;r?t.dataset.adSizes="[1,1]":n&&i&&(t.dataset.adSizes=`[${i},${n}]`)})(e,i)})(t),e.adAvailable(t);const w=_r.find(({id:e})=>e===t.targetId);w&&(yield Vr(w,t),_r=_r.filter(e=>e.id!==w.id)),ze("core adAvailable stop",{placementsAvailable:_r,adObj:t,isFullscreenScrollAd:c(t),isFinnBlink:f(t.targetId),isNativeAd:u(t),isMediation:At(t),isTakeoverAd:p(t),isCollapseAd:m(t),isWallpaperAd:h(t)})})),Nr.onEvent("adLoaded",r=>{const{refreshConfig:s,appearanceConfig:a}=ge.get(),l=document.getElementById(r.targetId);f(r.targetId)&&(e=>{const{fullscreenScroll:t}=ge.get(),{initNativeAd:n}=ge.getHandlers();c(e)&&Nn(e,t),u(e)&&n(e,ge.get())})(r);d.includes(r.targetId)&&u(r)&&(i(r,ge.get()),mt({adObj:r})),!d.includes(r.targetId)&&At(r)&&d.push(r.targetId),m(r)&&Ne(r.targetId),p(r)&&((e,t)=>{var n;const i="100%",r="100%";e.resizeAd(t,[i,r]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===i&&n===r||(o.style.width=i,o.style.height=r)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(Nr,r.targetId),v(r)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=ge.get();if(!t||!n||!i)return;const r=t.parentElement;r&&(t.classList.add(`advertory-${n}-${i}__full-width-ad`),r.classList.add(`advertory-${n}-${i}-wrapper__full-width-ad`))})(r),(e=>A(e,n))(r)&&(e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),i=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:r,fullWidthFormatClassName:o}={}}=ge.get();if(!t||!n||!i)return;const s=window.innerWidth,a=Math.round(s/1080*1920);t.style.width="100%",t.style.height=`${a}px`,t.classList.add(`advertory-${r}-${o}__vertical-full-width-ad`);const d=ft(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"})(r),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,i=document.querySelector(`#${n}`),r=null==i?void 0:i.parentElement;if(!r||!i)return;Ai({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,s=(new Date).getTime();i&&"true"!==i.dataset.subscribedForRefresh&&(i.dataset.subscribedForRefresh="true",i.dataset.refresh&&ki(i,s,o))})(r,s),(null==a?void 0:a.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(r.targetId);var g,h;je.getData("horseshoe").isAvailable&&o(r.targetId),(e=>{var n,i,r,o,s,a;const{adScaleConfig:d,deviceType:l}=ge.get();if(!(null==d?void 0:d.enabled))return;if(A(e,t))return;const c=null!==(n=d.adsToBeScaled[l])&&void 0!==n?n:[],u=Ve(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(r=null===(i=d.offset)||void 0===i?void 0:i[u])&&void 0!==r?r:0,p=document.getElementById(e.targetId),g=null!==(o=null==p?void 0:p.offsetWidth)&&void 0!==o?o:window.screen.width,h=null!==(a=null===(s=null==p?void 0:p.parentElement)||void 0===s?void 0:s.offsetWidth)&&void 0!==a?a:window.screen.width;wt(e,(g<h?g:h)-v)})(r),e.adLoaded(r),g=r.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${g}`)&&(null===(h=window.gdpr)||void 0===h?void 0:h.setupButton)&&window.gdpr.setupButton(g),l&&(l.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=ge.get(),i=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>i&&e.setAttribute("data-two-column-ad-layout","true")})(l)),Et(r),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:r.targetId,adFormat:yt(r)}}))}),Nr.onEvent("adNoBid",t=>U(void 0,void 0,void 0,function*(){Ne(t.targetId),yield ri(ge.get(),t),ut(t)&&(yield ct()),e.adNoBid(t)})),Nr.onEvent("adError",(t,n)=>U(void 0,void 0,void 0,function*(){ut(n)&&(yield ct()),e.adError(t,n)})),Nr.onEvent("adCollapse",()=>{e.adCollapse()}),Nr.onEvent("adRequestFailure",t=>{Ne(t.targetId),e.adRequestFailure(t)}),Nr.onEvent("adBadRequest",t=>{Ne(t.targetId),e.adBadRequest(t)}),Nr.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Nr.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),zr=(e,t)=>U(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return[];const{clearAds:i,reloadExistingAds:r,renderFinnBlinkPlacements:o,contextSelector:s}=null!=t?t:{};if(i)return Re(),[];r&&(Re(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{_e(e.id)})),he(null!=e?e:{}),yield qr();let a=Ue(s);return o&&(a=a.filter(e=>f(e.id))),a.length>0&&(_r=[..._r,...a.map(e=>Object.assign({},e))],$i(a),Ni(a),yield Ur(a)),_r}),Kr=(e,t)=>U(void 0,void 0,void 0,function*(){var n;ge.set(e),ge.setHandlers(t),je.initialize(),window.addEventListener("message",hi,!1),Nr=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=Nr,ze("Apn tag is set up on window"),yield Promise.allSettled([U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();(yield tt(e,t,n,"xandr-endpoint"))||Nr.setEndpoint("ib.adnxs-simple.com",!0)}),U(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=ge.get(),r=yield tt(t,n,i,"prebid");(null==e?void 0:e.enabled)&&r&&(yield hn(null==e?void 0:e.url))}),sn(e),U(void 0,void 0,void 0,function*(){const{astUrl:e}=ge.get();yield hn(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),U(void 0,void 0,void 0,function*(){const{gptUrl:e}=ge.get();yield hn(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),U(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:r}=ge.get(),{getConsentAsync:o}=Qe(n,i,r),s=yield o();if(e&&t&&s){if(yield hn(t),document.querySelector(`.${nr}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(nr)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),Bt(),U(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=ge.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield hn(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield ir(),ze("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,U(void 0,void 0,void 0,function*(){const e=n.map(e=>hn(e));yield Promise.all(e)})),yield Wr(),yield qr(),ze("Page options have been set"),jr(e),ze("Advertory is setup on window"),_r=Ue(),$i(_r),Ni(_r),yield Ur(_r),ze("Ads has been loaded",_r),cr(_r),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>U(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield tt(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield ei(),i=new ti(n);ni({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},i,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e),(e=>{if(!(null==e?void 0:e.enabled)||Tr)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=hr}=e,r=document.querySelector(i);if(!r)return;Tr=!0;const o=()=>{Er(r,n,t)};o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),window.addEventListener("load",o),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(o)}),new ResizeObserver(o).observe(r)})(e.rightColumnSplit),yield(e=>U(void 0,void 0,void 0,function*(){const t=new Or;yield t.run(e)}))(e)}),Gr=(e,t)=>U(void 0,void 0,void 0,function*(){yield((e,t)=>U(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=Qe(e.tcf,e.isMobileApp,e.country),r=yield gr(e);yield vr(),yield ur(n),yield ur(i),ze("TCF resolved successfully"),yield Kr(r,t),ze("Run function resolved successfully")}))(e,t)}),Yr=((e,t)=>n=>Gr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;const r=null==i?void 0:i.closest(".AdWrapper-inner");r&&(null==r||r.style.removeProperty("min-height")),u(e)&&fe(i);const o=i.dataset.placementFormat,{pageType:s=F.FRONT,deviceType:a,nativeTrackingConfig:d,appearanceConfig:l}=null!=t?t:{},c={language:k.SE,publisher:x.SVD,deviceType:a,pageType:s,nativeTrackingConfig:d,appearanceConfig:l,adPlacementFormat:o};B(e,c,ne),ye(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:Ee,adjustAdToHorseshoe:Ee},loadFinnBlinkAd:be,replaceAdsWithFinnBlink:be,preparePageOptions:un,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=ge.get(),o=((e,t)=>{const{isMobileApp:n}=ge.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,r),s=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${Ce()}-adformat`,r=t?t[i]:[];if(!r)return{};const o=(Array.isArray(r)?r:[r]).filter(e=>!(e in l)||window.innerWidth>=l[e]);return{[i]:n?o:r}})(e),a=(e=>{const t=`${Ce()}-targetid`;return e?{[t]:[e]}:{}})(n),d=(e=>{var t;const[,n]=null!==(t=e.match(/-((w|a)(?:ph|de|tb))-/))&&void 0!==t?t:[];switch(n){case"wde":return{"aa-sch-supply_type":"web_desktop"};case"wtb":return{"aa-sch-supply_type":"web_tablet"};case"wph":return{"aa-sch-supply_type":"web_phone"};case"aph":return{"aa-sch-supply_type":"app_phone"};default:return}})(o),c=Object.assign({},kt(i,{safeFrameAutoInitialSize:!0}));return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t),s),a),d),rendererOptions:c})},siteEvents:Pt,librariesToLoad:[]},{publisherClassName:x.SVD,fullWidthFormatClassName:"panorama"});var Jr=Object.freeze({__proto__:null,default:""});export{ln as getVideoPPIDs,Yr as initAdvertoryPackage,zr as updateAdvertory};
|
|
1
|
+
import"react/jsx-runtime";const e="ABSOLUTE_FULLSCREEN",t="ANY_FULLSCREEN",n="VERTICAL_FULLWIDTH",i="FULLWIDTH",r="TAKEOVER",o="VELVET_TAKEOVER",s="WALLPAPER",a="COLLAPSE",d={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},l={wallpaper:1600,"l-format":1600},c=e=>{const{banner:n,targetId:i}=e;return!(!n||(null==i?void 0:i.includes("takeover")))&&A(e,t)},u=e=>{const{native:t}=e;return!!t},v=e=>A(e,i),p=e=>{const{targetId:t}=e;return t.includes("takeover")||A(e,r)},g=e=>A(e,r),h=e=>A(e,s),m=e=>A(e,a),y=e=>e.targetId.includes("sponsorstripe"),f=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},w=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),b=e=>e.targetId.startsWith("midboard"),E=e=>e.targetId.startsWith("widescreen"),T=e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,I=e=>e.width>=1260&&e.width<=1280,S=e=>e.width>=1600&&e.width<=1620,A=(e,t)=>{const n=d[t];if(!n)return!1;return!!n.find(t=>{var n,i;const r=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(i=e.banner)||void 0===i?void 0:i.height)||e.height,s=t.width===r,a=!t.height||t.height===o;return s&&a})},C={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}},k={NO:"no",SE:"se"},P="native_override_desc2",O=(e,t,n)=>{var i;const{image:r,icon:o,sponsoredBy:s,title:a,clickUrl:d,cta:l,body:c,desc2:u,video:v,description:p,customTitle1:g,customTitle2:h,customTitle3:m,customTitle4:y,customIcon2:f}=e,w=(e,t="")=>{var n;return e?null!==(n=e.url)&&void 0!==n?n:e:t};return Object.assign({containerId:n,img:w(r),imgWidth:null==r?void 0:r.width,imgHeight:null==r?void 0:r.height,imgAltText:null!=a?a:"",logo:w(o),sponsoredBy:null!=s?s:"",title:null!=a?a:"",url:null!=d?d:"",cta:null!=l?l:"",description:null!==(i=null!=c?c:p)&&void 0!==i?i:"",desc2:null!=u?u:"",video:v,customTitle1:null!=g?g:"",customTitle2:null!=h?h:"",customTitle3:null!=m?m:"",customTitle4:null!=y?y:"",logo2:w(f)},t)},L=(e,t)=>{const n=(i=P,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(P),o=t.includes("native_recirc");return n&&r?r:(null==e?void 0:e.includes("recirc"))?o?"native_recirc":"recirc":(null==e?void 0:e.includes("sponsor"))?"sponsorstripe":null},$="native-ad",x={SVD:"svd",VG:"vg",GODARE:"godare",AFTENPOSTEN:"aftenposten",SA:"sa",BT:"bt",AFTONBLADET:"aftonbladet",E24:"e24",MINMOTE:"minmote",PENT:"pent",GODT:"godt",TEK:"tekno",KLART:"klart",TVNU:"tvnu",POLARIS:"polaris",KOKET:"koket",TV4:"tv4",FOTBOLLSKANALEN:"fotbollskanalen"},N=(e,t,n,i)=>{const r=document.querySelector(`#${e}`);r&&t&&(r.innerHTML=t,((e,t)=>{const n=e.parentElement,{publisher:i,pageType:r}=t,o=i&&Object.values(x).includes(i);n&&o&&((e,t,n,i)=>{const r=t.parentElement;if(!r)return;const o=e?`-${e}`:"",s=i?`__${i}`:"",a=`advertory${o}-${n}${s}`,d=`advertory${o}-${n}-wrapper${s}`;t.classList.remove(...t.classList),r.classList.remove(...r.classList),t.classList.add(a),r.classList.add(d),t.dataset.adType=n})(i,e,$,r)})(r,n),i())},_={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},D=e=>{var t;const n=document.querySelector(`#${e.targetId}`);if(!n||!(null===(t=e.native)||void 0===t?void 0:t.clickTrackers))return;(null==n?void 0:n.querySelectorAll("a.ad-link")).forEach(t=>{"true"!==t.dataset.tracked&&(t.addEventListener("click",()=>{var t,n;for(const i of null!==(n=null===(t=e.native)||void 0===t?void 0:t.clickTrackers)&&void 0!==n?n:[])R(i)}),t.dataset.tracked="true")})},j=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(M):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},q=(e,t)=>{var n;let i=!1;const r=document.querySelector(`#${e.targetId}`);if(!r||!e.native)return;const{deviceType:o,appearanceConfig:s,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:a=!1}={}}=t,d=a?{rootMargin:`${l=null!==(n=null==s?void 0:s.defaultThreshold[null!=o?o:_.DESKTOP])&&void 0!==n?n:0}px 0px ${l}px 0px`}:{};var l;const c=new IntersectionObserver(t=>{if(!i)for(const n of t)if(n.isIntersecting){i=!0,j(e),c.disconnect();break}},d);c.observe(r)},M=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?R(e):window.navigator.sendBeacon(e)},R=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},B=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:r,videoTemplates:o}=n,s="default";if(!e.native)return null;const{native:a,targetId:d}=e,{desc2:l=s}=e.native,c=l.toLowerCase(),u=null!==(i=L(e.targetId,l))&&void 0!==i?i:c,v=C[t.language||k.NO],p=O(a,v,d);return(a.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);N(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{D(e),q(e,t)})(e,t)})},F={CONTENT_DISPLAY:({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,description:o,img:s,adContentFrom:a})=>`<article class="advertory-svd-ad-native-content-display ${o&&"description"}">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-large-image-container">\n <div class="ad-large-image-wrapper">\n <img alt="${r}" class="ad-large-image" src="${s}" />\n </div>\n </div>\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${a} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${r}" class="ad-small-image" src="${s}" />\n </div>\n </div>\n <div class="ad-description">${o}</div>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-svd-ad-native-podme ${n&&"description"}">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${t}</div>\n <div class="ad-description">${n}</div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" />\n </div>\n <div class="ad-logo">\n <img alt="${r}" class="logo" src="${r}" />\n </div>\n </div>\n </div>\n </div>\n </a>\n </article>\n `,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-svd-ad-native-podme-section ${n&&"description"}">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-main-content">\n <div class="ad-text-container">\n <div class="ad-title">${t}</div>\n <div class="ad-description">${n}</div>\n </div>\n <div class="ad-small-image-container">\n <img alt="podme-ad" class="ad-small-image" src="${i}" />\n </div>\n <div class="ad-logo">\n <img alt="${r}" class="logo" src="${r}"/>\n </div>\n </div>\n </div>\n </div>\n </a>\n </article>\n`,BRAND_STUDIO_CLASSIC:(e,t)=>{const{containerId:n,url:i,adText:r,sponsoredBy:o,title:s,description:a,img:d,desc2:l}=e,{adPlacementFormat:c=""}=t;return(({descriptionClassName:e,isAlcoholAd:t,adPlacementFormat:n,containerId:i,url:r,adText:o,title:s,img:a,sponsoredBy:d,description:l})=>`<article class="advertory-svd-brand-studio-classic ${e} ${t?"advertory-svd-brand-studio-classic-alkohol":""} ${n}">\n <div class="ad-info" id="${i}-button"></div>\n <a class="ad-link" href="${r}">\n <div class="ad-header">\n <div class="ad-label">\n ${o}\n </div> \n <div class="ad-separator">•</div>\n <div class="ad-sponsor">${d}</div>\n </div>\n <div class="ad-content-wrapper">\n <div class="ad-content-row">\n <div class="ad-content-text">\n <h2 class="ad-title">${s}</h2>\n <span class="ad-description">${l}</span>\n </div>\n <div class="ad-image-container">\n <img alt="${s}" class="ad-small-image" src="${a}" />\n </div>\n </div>\n ${t?'<div class="alcohol-warning">Alkohol kan skada din hälsa</div>':""}\n </div>\n </a>\n </article>`)({descriptionClassName:a&&"description",isAlcoholAd:l.endsWith("_alcohol"),adPlacementFormat:c,containerId:n,url:i,adText:r,title:s,img:d,sponsoredBy:o,description:a})},SPONSORSTRIPE:({title:e,sponsoredBy:t,logo:n,url:i})=>`<article class="advertory-ad-sponsorstripe">\n <a class="ad-link" href="${i}" target="_blank">\n <div class="ad-wrapper">\n <span class="ad-title">${e}</span>\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </a>\n </article>`},V={FRONT:"front",ARTICLE:"article"};function U(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{d(i.next(e))}catch(e){o(e)}}function a(e){try{d(i.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}d((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const H=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),W="viewable",z="adClick",K=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},G=e=>U(void 0,void 0,void 0,function*(){var t,n;return(null===(t=null===window||void 0===window?void 0:window.SVP)||void 0===t?void 0:t.Player)?new window.SVP.Player(e):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const i=document.createElement("script");i.id=e,i.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",i.async=!0;try{i.src=i.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(i,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(e):yield new Promise(t=>{window.addEventListener("onSvpPlayerReady",()=>t(new window.SVP.Player(e)))}))}),Y={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return U(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Xr})})}})}},J=(e,t)=>{null==e||e.forEach(e=>{Y[e](t)})};const Q=(e,t)=>{const n=(new DOMParser).parseFromString(e,"text/xml"),i=n.querySelector("ClickThrough"),r=n.querySelector("VideoClicks");if(i){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n.createCDATASection(t))}else if(r){const e=n.createElement("ClickThrough");e.appendChild(n.createCDATASection(t)),r.appendChild(e)}return URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(n)],{type:"text/xml"}))},X=({id:e,nodeId:t,poster:n,tagURL:i,publisher:r="",productTag:o="xandr",videoLoop:s=!1})=>({id:e,poster:n,vendor:"appnexus",node:t,mute:!0,autoplay:s,repeat:s,skin:{name:"inventory-player",url:"https://ads.inventory.schibsted.io/styles/player.css"},settings:{jw:{stretching:"fill",advertising:{client:"vast",tag:i}}},pulse:{provider:r.toLowerCase(),decorator:e=>Object.assign(Object.assign({},H(e)?e:{}),{provider:Object.assign(Object.assign({},H(null==e?void 0:e.provider)?e.provider:{}),{productTag:o})})}}),Z=e=>U(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:r}=t,o=yield G(t);J(n),o.once("assetReady",()=>{K(o,n)}),o.on(W,e=>{const{viewable:t}=e;t?o.play():o.pause()}),o.on(z,()=>{window.open(i,"_blank")}),r&&o.on("pause",()=>{o.play()})}),ee=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:r,title:o},s,a)=>`<article class="advertory-shared-ad-native-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${t}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${a}"></div>\n </div>\n </div>\n <a class="ad-link" href="${n}" target="_blank">\n <div class="ad-text-container">\n <span class="sponsored-by">\n ${i} ${r}\n </span>\n <span class="title">${o}</span>\n </div>\n </a>\n </div>\n </article>`,te={CONTENT_DISPLAY_BASIC:(e,{pageType:t})=>t===V.ARTICLE?(({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,logo:o,adContentFrom:s})=>`<article class="advertory-shared-ad-native-content-display-basic article">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-content">\n <div class="ad-text-container">\n <div class="ad-header-wrapper">\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n </div>\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${s} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt="${r}"class="ad-small-image" src="${o}" />\n </div>\n </div>\n </div>\n </a>\n </article>`)(e):(({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,img:o,adContentFrom:s,logo:a})=>`<article class="advertory-shared-ad-native-content-display-basic">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-header">\n <span class="ad-label">${n}</span>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-large-image-container">\n <div class="ad-large-image-wrapper">\n <img alt="${r}" class="ad-large-image" src="${o}" />\n </div>\n </div>\n <div class="ad-content">\n <div class="ad-text-container">\n <div class="ad-title">${r}</div>\n <div class="ad-sponsor">\n ${s} ${i}\n </div>\n </div>\n <div class="ad-small-image-container">\n <img alt=${r} class="ad-small-image" src=${a} />\n </div>\n </div>\n </div>\n </a>\n </article>`)(e),VIDEO:(e,t)=>{return(n=ee,(e,t,i)=>{const{video:r,img:o,url:s}=e,{publisher:a,productTag:d}=t,{pluginsNames:l,videoLoop:c}=i||{};if(!(null==r?void 0:r.content))return null;const u=Math.ceil(1e5*Math.random()),v=o||"https://custom.inventory.schibsted.io/1x1-00000000.png",p=`ad-player-${u}`,g=Q(r.content,s),h=X({id:u,nodeId:p,poster:v,tagURL:g,publisher:a,productTag:d,videoLoop:c});return Z({playerConfig:h,clickUrl:s,pluginsNames:l}),`${n(e,t,p)}`})(e,t);var n}},ne={displayTemplates:{content_display_basic:te.CONTENT_DISPLAY_BASIC,admarket_basic:F.CONTENT_DISPLAY,content_display:F.CONTENT_DISPLAY,podme:F.PODME,podme_section:F.PODME_SECTION,brandstudio_native_ad:F.BRAND_STUDIO_CLASSIC,brandstudio_native_ad_alcohol:F.BRAND_STUDIO_CLASSIC,sponsorstripe:F.SPONSORSTRIPE,default:F.CONTENT_DISPLAY},videoTemplates:{default:te.VIDEO}},ie=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},re=(e,t)=>{const n=document.querySelector(t),i=document.querySelector(`#${e}`);if(!i||!n)return;const r=i.parentElement,o=new IntersectionObserver(([e])=>((e,t,n)=>{const i=e?t.offsetHeight:0;ie(n,i)})(e.isIntersecting,n,r)),s=new ResizeObserver(()=>((e,t)=>{ie(t,e.offsetHeight)})(n,r));o.observe(n),s.observe(n)},oe=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`);function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae,de;var le=se(function(){if(de)return ae;de=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function s(e,t,i){var s={};return i.isMergeableObject(e)&&r(e).forEach(function(t){s[t]=n(e[t],i)}),r(t).forEach(function(r){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(o(e,r)&&i.isMergeableObject(t[r])?s[r]=function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a}(r,i)(e[r],t[r],i):s[r]=n(t[r],i))}),s}function a(t,r,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(r);return a===Array.isArray(t)?a?o.arrayMerge(t,r,o):s(t,r,o):n(r,o)}return a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return a(e,n,t)},{})},ae=a}());const ce=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],ue={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},ve=6;class pe{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of ce){const i=e[n];void 0!==i&&(t[n]=i)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.prototype.hasOwnProperty.call(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=le(pe.DEFAULT_SITE_HANDLERS,e)}}pe.DEFAULT_SITE_HANDLERS={siteEvents:ue,initNativeAd:function(){}};const ge=new pe,he=ge.modifyConfigProperties.bind(ge),me=e=>e===_.MOBILE,ye=(e,t)=>{if(!t||!y(e))return;const{toggleEnabled:n,headerSelector:i,containersSelectors:r}=t,{targetId:o}=e;if(!n)return;const s=document.querySelector(".advertory-takeover-wrapper"),a=[()=>i&&re(o,i),()=>r&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,r]=t;if(!i)return;const o=()=>{const e=oe(i),t=r?oe(r):null,o=n.querySelector("article");if(!o||!e)return;const s=e.getBoundingClientRect().left,a=((e,t)=>{const n=e.getBoundingClientRect(),i=null==t?void 0:t.getBoundingClientRect();return i?i.right-n.left:n.width})(e,t);o.style.left=`${s}px`,o.style.width=`${a}px`};o(),new ResizeObserver(o).observe(document.body)})(o,r),()=>s&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n||!t)return;new IntersectionObserver(([e])=>{n.style.visibility=e.isIntersecting?"hidden":"visible"}).observe(t)})(o,s)];a.forEach(e=>e())},fe=e=>{(null==e?void 0:e.closest(".advertory-panorama"))&&e.parentElement&&(e.parentElement.style.background="none",e.style.background="none")},we="0123456789abcdefghijklmnopqrstuvwxyz",be=()=>Promise.resolve(),Ee=()=>{},Te=e=>{window.apntag.anq.push(e)},Ie=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),Se=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),Ae=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e},Ce=()=>{const{country:e}=ge.get();return e===k.NO?"no-sno":"se-generic"},ke=()=>{const{country:e,publisher:t}=ge.get();return`${e}-${t}`};let Pe="";const Oe=new Map,Le="advertory-wallpaper-background",$e=()=>{const e=document.querySelector(`.${Le}`);e&&e.remove()},xe=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,Ne=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&$e())},_e=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))};class De{initialize(){this.DATA=Object.assign({},De.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}De.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const je=new De,qe=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,i=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${i}px`)},Me=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=je.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=i},Re=()=>{$e();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Ne(e.id),Me(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),i=null==t?void 0:t.getAttribute("data-probable-width");n&&i&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",i+"px"))})(e.id),e.innerHTML="",e.id=Ae(e.id)}),Te(()=>window.apntag.clearRequest())},Be="noGroupedPlacements",Fe=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},Ve=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},Ue=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:i,deviceType:r}=ge.get(),o=n[r].filter(Ve)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=Fe(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),a=(null==i?void 0:i.queryByDataDevice)?`div[id^="${e}"][data-device=${r}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=s.querySelectorAll(a),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{var i;const r=He(e,t,n),o=r.finnBlink&&!r.finnBlink.renderOnlyWithAdBlock,s=o&&(null===(i=r.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink),a=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=we[Math.floor(36*Math.random())];return t})(6)}`;return e.id=a,e.setAttribute("data-advertory-ad-rendered","true"),o&&e.setAttribute("data-is-finn-blink-placement","true"),s&&e.setAttribute("data-is-finn-blink-only-placement","true"),(e=>{var t;const n=e.id;n&&je.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},r),{id:a})});return(e=>{const{keywordsConfig:t}=ge.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Pe!==window.location.pathname&&(Oe.clear(),Pe=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Oe.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${ke()}-count`]=i,Oe.set(n,i+1),e})):e})(l)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(a)},He=(e,t,n)=>{const i=n[t],r=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:o||r},We=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=ge.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=Ae(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),s=((e,t)=>{const n={};for(const[i,r]of Object.entries(t))n[i]=e.filter(e=>r.includes(Ae(e.id)));return n})(e,i),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(Ae(e.id))))(e,new Set([...a,...r]));return Object.assign(Object.assign(Object.assign({},s),o),{[Be]:d})},ze=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},Ke=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return ze("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const r=e=>{i||(ze("Resolving advertising permission value obtained"),i=!0,t(e))},o=setTimeout(()=>{ze("Advertising permission timed out, resolving with false"),r(!1)},3e3);window._tcf_.onTcfReady(()=>{ze("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);ze("Advertising permission value obtained asynchronously: ",e),r(Boolean(t))})}),Ge="cmp:loaded";let Ye,Je=!1;const Qe=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),r=(null==e?void 0:e.timeout)||3e3,o=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const a=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(ze("TCF bypass param detected, returning consent: true"),!0):(ze("TCF is not enabled, returning consent: true"),!0))(i,o))return!0;if(Je)return null;if(!Ye)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Ye.getConsentedToAllSync();return ze(`TCF consented to all is: ${t}`),Ye.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(ze("Getting TCF consent manager..."),window._tcf_)return ze("TCF consent manager is already available"),Ye=window._tcf_,void e(Ye);ze("TCF consent manager is not available");const n=()=>{ze("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Ye=window._tcf_,e(Ye)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Ge,n),Je=!0,t(new Error("Timeout waiting for CMP to load"))},r);ze("Listening for CMP loaded event..."),document.addEventListener(Ge,n,{once:!0})}):Promise.resolve(null),getConsentSync:a,getConsentAsync:()=>U(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ze(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const i=(null==e?void 0:e.schibstedAdChoicesEnabled)&&n===k.SE,o=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===k.NO;if(i||o)return ze("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield Ke(e);if(!(null==e?void 0:e.enabled))return!0;const s=a();return null!==s?s:yield new Promise((e,t)=>{try{if(!Ye)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},i=setTimeout(()=>{ze("TCF isConsentedToAll timed out, resolving with false"),n(!1)},r);Ye.onTcfReady(()=>{ze("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Ye.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},Xe=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Ze={SPLASH:"splash",WELCOME_PAGE:"welcomePage",TOPSCROLLER:"topscroller",VELVET:"velvet"},et=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const i=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),r=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=i.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,r).toString()},tt=(e,t,n,...i)=>U(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return ze(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ze(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${i}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:r}=Qe(e,t,n);return(yield r())?(ze(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(ze(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),nt="takeover-displayed",it="takeover-visit-count",rt=14400,ot=()=>{const e=Xe(it);return e?parseInt(e):0},st=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=ge.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=ge.get().takeover)||void 0===e?void 0:e.cookieCapName)||nt;return"true"===Xe(t)})())&&(!t||at()))},at=()=>{const e=ot();return 0===e?((()=>{const e=ot(),{takeover:{cookieCapTime:t=rt}={}}=ge.get(),n=document.location.hostname;window.document.cookie=`${it}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},dt=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),lt=()=>{const{takeover:e}=ge.get();return Boolean(null==e?void 0:e.topscroller)},ct=()=>U(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=nt,cookieCapTime:n=rt}={},isMobileApp:i,tcf:r,country:o}=ge.get(),s=yield tt(r,i,o,"ad-takeover-cookiecap");n&&s&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),ut=e=>{var t;const n=!!(null===(t=ge.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},vt=(e,t)=>{var n;if(t===Ze.TOPSCROLLER){const{topscroller:t}=e;return null!=t?t:{}}if(t===Ze.SPLASH){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},pt=(e,t)=>{t!==Ze.SPLASH?(e=>{var t,n,i;const r=null===(n=null===(t=ge.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=ge.get().takeover)||void 0===i?void 0:i.topscroller;if(!r||o)return;const s=document.querySelector(r),a=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(s&&a&&l&&d))return;const c=null==s?void 0:s.offsetHeight,u=g(e)?"60svh":`calc(100svh - ${c}px)`,v=g(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;a.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=ge.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),i=document.querySelector(`#${e.targetId}`);if(!n||!i)return;const r=`calc(100svh - ${n.offsetHeight}px)`;i.style.setProperty("height",r,"important")})(e)},gt=et([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),ht={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&<(),splash:e=>p(e)&&dt(e.width,e.height),welcomePage:p,wallpaper:h,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:I,hFormat:S,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!S(e)&&!I(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:E,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!w(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!b(e),outstream:T,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:w,midboard:b},mt=({adObj:e,preferredTestIdData:t})=>{var n,i;const r=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!r)return;const o=null===(i=document.querySelector(`#${r}`))||void 0===i?void 0:i.parentElement;if(!o)return;if(((e,t)=>{var n,i,r,o;const s=null===(o=null===(r=null===(i=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===i?void 0:i.tags)||void 0===r?void 0:r[e])||void 0===o?void 0:o.invCode;s&&(t.dataset.invCode=s)})(r,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const s="DIV"===(null==o?void 0:o.tagName);e&&s&&((e,t)=>{var n,i;for(const[r,o]of Object.entries(ht))if(o(e)){if("nativeAd"===r){const o="default";t.dataset.testid=`${r}-${null!==(i=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==i?i:o}`;break}t.dataset.testid=r;break}})(e,o)},yt=e=>{var t;return(null===(t=Object.entries(ht).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},ft=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},wt=(e,t=window.screen.width,n,i)=>{const r=ft(e,t),o=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);o&&(o.style.transform=`scale(${r})`,o.style.transformOrigin="left top")},bt=new Map;bt.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),bt.set("panorama",{scale:.79,transformOrigin:"center center"}),bt.set("outstream",{scale:.79,transformOrigin:"center center"}),bt.set("integration",{scale:.79,transformOrigin:"center center"}),bt.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Et=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const i=yt(e),r=bt.get(i),o=document.querySelector(`#${e.targetId}`);if(!o||!r)return;if(o.style.transformOrigin=r.transformOrigin,o.style.transform=`scale(${r.scale})`,!(null==r?void 0:r.cogwheelAdjust))return;const s=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),a=null==o?void 0:o.offsetWidth;s&&"number"==typeof a&&!isNaN(a)&&s.style.setProperty("right",String(-1*a*.2)+"px")},Tt={live:16},It=e=>{const t=null==e?void 0:e.querySelector("p");if(!e.className.includes("advertory")&&t)return e;const n=e.nextSibling;return n?It(n):null},St=e=>{var t;const{pageOptions:n,deviceType:i}=ge.get(),r="article"===n.keywords["se-generic-page"],o=n.keywords["se-generic-section"],s=!!Array.isArray(o)&&o.some(e=>"kompakt"===e),a=yt(e);if(Object.values(Ze).some(e=>e===a))return;if(!r||!(e=>e===_.DESKTOP)(i))return;const d=document.querySelector(`#${e.targetId}`),l=null==d?void 0:d.querySelector('[id*="div_utif"]'),c=Number(null===(t=e.banner)||void 0===t?void 0:t.width),u=Number(null==l?void 0:l.style.width.replace("px","")),p=isNaN(c)?u:c;if(!d||!(p<=640))return;if(s)return void(e=>{const t=document.querySelector(".kompakt-svd-main-column-anchor");if(!t)return;const n=t.getBoundingClientRect().left,i=null==e?void 0:e.getBoundingClientRect().left;e.style.transform=`translateX(${n-i}px)`,e.style.maxWidth="unset"})(d);const g=null==d?void 0:d.parentElement,h=g&&It(g),m=null==h?void 0:h.querySelector("p"),y=null==m?void 0:m.getBoundingClientRect().left;g&&y&&(g.style.paddingLeft=`${y}px`,d.style.maxWidth="unset",((e,t)=>{v(e)&&(t.style.maxWidth="650px",t.style.marginLeft="0")})(e,d))},At=e=>{const{source:t}=e;return"csm"===t},Ct={[x.VG]:["board","netboard","backfill","outstream"],[x.AFTONBLADET]:["panorama","outstream"],[x.GODARE]:["panorama","outstream"],[x.SVD]:["wph-article-panorama","wph-front-panorama"]},kt=(e,t)=>(e=>{var t;const{publisher:n}=ge.get();return!!Ct[n]&&!!(null===(t=Ct[n])||void 0===t?void 0:t.some(t=>e.includes(t)))})(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{},Pt={adRequested:()=>{},adAvailable:e=>{T(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`);t&&(t.style.minHeight="unset")})(e);const t=document.querySelector(`#${e.targetId} div[id*="button"]`);t&&(t.id=`${e.targetId}-button`)},adLoaded:e=>U(void 0,void 0,void 0,function*(){(e=>{var t;const{deviceType:n}=ge.get(),i=null===(t=e.targetId)||void 0===t?void 0:t.includes("toppanorama"),r=e.height<320;if(!me(n)||!i||!r)return;const o=document.querySelector(`#${e.targetId}`),s=null==o?void 0:o.parentElement;o&&s&&(o.style.minHeight="unset",s.style.minHeight="unset")})(e),(e=>{var t,n,i;const r=Fe(e.targetId.split("-")[0]);if(!["live"].includes(r))return;const o=null!==(t=Tt[r])&&void 0!==t?t:0,s=null!==(i=null===(n=document.getElementById(`${e.targetId}`))||void 0===n?void 0:n.offsetWidth)&&void 0!==i?i:window.screen.width;wt(e,s-o)})(e),St(e)}),adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Ot=9826;class Lt{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=_.DESKTOP,isMobileApp:t}=ge.get();if(t){return{"aa-sch-supply_type":`app_${e===_.MOBILE?"phone":_.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},e.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(e.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return U(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=Xe("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return U(this,void 0,void 0,function*(){return yield U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get(),{getConsentAsync:i}=Qe(e,t,n);if(!(yield i()))return;const r=Xe("_pulse2data");return r?r.split(",")[9]:void 0})})}isTrackingForbidden(){return U(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Ot}=ge.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=ge.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return U(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get(),{getConsentAsync:i}=Qe(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=ge.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=ge.get(),i=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return i?{"no-sno-news-sponsors":i}:{}}}const $t=new Lt;function xt(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),r=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}$t.prepare.bind($t);class Nt extends Lt{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=_.DESKTOP}=ge.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return{width:e||n||0,height:t||i||0}}(),t={width:null!==(i=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==i?i:0,height:null!==(o=null===(r=window.screen)||void 0===r?void 0:r.height)&&void 0!==o?o:0};var n,i,r,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){return U(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}})}getAppTypeKeywords(){const{isMobileApp:e}=ge.get(),{appMode:t,mobileOS:n}=xt(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=ge.get();return{"se-generic-section-page_type":`${null!==(t=null===(e=n.keywords["se-generic-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan"}_${"article"===i?"article":"front"}`}}}const _t=864e5,Dt=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return ze("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,i=_t)=>{const r={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(r))},getByTimestamp:(t,n=_t)=>{const i=e(t);if(!i)return null;if(!n)return i;try{const{expirationTime:e,data:t}=JSON.parse(i);return(new Date).getTime()<=e?t:null}catch(e){return ze("Error with parsing localStorage data"),null}}}})(),jt="glimrTags",qt=["glwe_","glwet_"],Mt={geofenceTags:[],geoTags:[],weatherTags:[]},Rt=()=>U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield tt(e,t,n,"glimr")}const{getConsentAsync:i}=Qe(e,t,n);return yield i()}),Bt=()=>U(void 0,void 0,void 0,function*(){const{glimr:e}=ge.get();if(!(yield Rt())||!(null==e?void 0:e.enabled))return void ze("No consent for glimr data fetching.");const t=yield(n=500,U(void 0,void 0,void 0,function*(){return yield Promise.race([U(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),n))])}));var n;if(t)try{t.setTagCacheTimeInSeconds(300),yield new Promise(n=>{t.getTags(e.clientId,(e,t)=>{Dt.setWithTimestamp(jt,{tags:e,tagMappings:t}),n(!0)})})}catch(e){ze(`Error during getting glimr data: ${e}`)}else ze("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),Ft={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},Vt=e=>qt.some(t=>e.startsWith(t)),Ut=e=>e.startsWith("glgc_"),Ht=e=>!Vt(e)&&!Ut(e),Wt=e=>{const t=zt();if(!t)return Mt;const n=((e=[])=>e.filter(Vt))(t),i=((e=[])=>e.filter(Ut))(t),r=((e=[],t)=>{const n=e.filter(Ht);if(t){const{publisher:e}=ge.get(),t=Ft[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},zt=()=>{const e=Dt.getByTimestamp(jt);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},Kt={get:(e,t)=>U(void 0,void 0,void 0,function*(){const n=yield fetch(e,t);if(!n.ok)throw new Error(n.statusText);return yield n.json()}),post:(e,t,n)=>U(void 0,void 0,void 0,function*(){const i=JSON.stringify(n),r=yield fetch(e,{method:"POST",headers:t,body:i});if(!r.ok)throw new Error(r.statusText);return yield r.json()})},Gt="advertory:ppids-cache",Yt={[k.SE]:`SCH${k.SE.toUpperCase()}-EnvHash`,[k.NO]:`SCH${k.NO.toUpperCase()}-EnvHash`},Jt={[k.SE]:`SCH${k.SE.toUpperCase()}-UserHash`,[k.NO]:`SCH${k.NO.toUpperCase()}-UserHash`},Qt={[k.SE]:`sch${k.SE}-envhash-v3`,[k.NO]:`sch${k.NO}-envhash-v3`},Xt={[k.SE]:`sch${k.SE}-userhash-v3`,[k.NO]:`sch${k.NO}-userhash-v3`},Zt={[k.SE]:`'sch${k.SE}-iosid-v3'`,[k.NO]:`'sch${k.NO}-iosid-v3'`},en={[k.SE]:`sch${k.SE}-androidid-v3`,[k.NO]:`sch${k.NO}-androidid-v3`},tn={[k.SE]:"sdrn:schibsted.com:user",[k.NO]:"sdrn:spid.no:user"};class nn{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:i})=>{t.append(e,`${i}-${n}`)}),t}}const rn=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return U(this,arguments,void 0,function*(e,t=1e4){var n,i;const r=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=r.xandr)||void 0===n?void 0:n.ppId1,null===(i=r.xandr)||void 0===i?void 0:i.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ze("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},on=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return U(this,void 0,void 0,function*(){var n,i,r,o,s,a,d,l,c,u,v;const p=Dt.get(Gt),g=yield this.getNewPPIDs(e,t);if(this.shouldHash(p,g)){const t=null!==(n=e.hasherUrl)&&void 0!==n?n:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,t);return c?(this.cachePPIDs(l,c,null===(i=g.idfv)||void 0===i?void 0:i.plain,null===(r=g.anId)||void 0===r?void 0:r.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(s=c.environmentId)&&void 0!==s?s:"",null===(a=g.idfv)||void 0===a?void 0:a.plain,null===(d=g.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==p?void 0:p.userId.hashed)&&void 0!==l?l:"",null!==(c=null==p?void 0:p.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==g?void 0:g.idfv)||void 0===u?void 0:u.plain,null===(v=null==g?void 0:g.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||ze("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,i){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=i?i:null}shouldHash(e,t){var n,i;if(!e)return!0;for(const r in e){if((null===(n=e[r])||void 0===n?void 0:n.plain)!==(null===(i=t[r])||void 0===i?void 0:i.plain))return!0}return!1}cachePPIDs(e,t,n,i){const r=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),i?{anId:{plain:i}}:{});Dt.set(Gt,r)}hashPPIDs(e,t){return U(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield Kt.post(t,n,e)}catch(e){return ze("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return U(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>U(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${tn[t]}:${n}`:null}))(t,n),r=yield(e=>U(void 0,void 0,void 0,function*(){const t=yield e.getEnvironmentId();return t?`sdrn:schibsted:environment:${t}`:null}))(t),o=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:e},userId:{plain:i},environmentId:{plain:r},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},o?{idfv:{plain:o}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:i,environmentId:r}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:i.plain,environmentId:r.plain}}},sn=e=>U(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:r}=e;if(!(yield tt(n,r,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([rn.processPPIDs(t,null==n?void 0:n.timeout),on.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){ze(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),an=e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=on.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]).add(o,Zt[e]).add(s,en[e]).buildEids()}]}},dn=e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=on.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]).add(o,Zt[e]).add(s,en[e]).buildRyEids()}}]}}},ln=e=>U(void 0,void 0,void 0,function*(){const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r}=on.getPPIDs(),o=(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]);return yield new Promise(e=>{e(o.buildVideoEids())})});const cn=new class extends Nt{constructor(){super(...arguments),this.getSDKVersion=()=>U(this,void 0,void 0,function*(){return{"se-generic-sdk-version":"function"==typeof window.apntag.getAstVersion?window.apntag.getAstVersion():""}})}prepare(e){return U(this,void 0,void 0,function*(){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"se-generic-pagemode":"light"},this.getCountryCodeKeywords(k.SE)),this.getPublisherKeywords()),yield this.getExternalIdSrc()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield this.getSDKVersion()),yield U(void 0,void 0,void 0,function*(){const{glimr:e}=ge.get(),{addPublisherToGeo:t}={},n=yield Rt();if(!(null==e?void 0:e.enabled)||!n)return ze("No consent for getting glimr tags."),{};const i=Ce(),r=Wt(t);return{[`${i}-geo`]:r.geoTags,[`${i}-weather`]:r.weatherTags,[`${i}-geofence`]:r.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=rn.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),e.keywords);return Object.assign(Object.assign({},e),{keywords:t,user:Object.assign(Object.assign({},an(k.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var un=cn.prepare.bind(cn);const vn=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),pn=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),gn=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=ge.get(),r=[`${Ce()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...i?r:[]],s=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),a=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:s}}},a)}},hn=(e,...t)=>U(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,i)=>{const r=document.createElement("script");r.async=!0,r.src=e;const o=()=>{a(),n()},s=()=>{a(),i(new Error(`Failed to load ${e}`))},a=()=>{r.removeEventListener("load",o),r.removeEventListener("error",s),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",s);const d=setTimeout(()=>{a(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),mn=e=>e.includes("snoap.no"),yn=e=>{var t,n,i,r,o;return!!(null===(o=null===(r=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===i?void 0:i.adResponse)||void 0===r?void 0:r.ads[1])||void 0===o?void 0:o.rtb)},fn=et([],()=>{const e=({width:e,height:t})=>{var n;const i=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!i)return;const{clientWidth:r,clientHeight:o}=i,s=e/r,a=t/o;i.style.transform=`scale(${s},${a})`,i.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),wn=e=>{const t=et([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const i=n.contentDocument.createElement("style");i.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(i),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},bn=[],En={},Tn=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=Sn(e);n?(In(i,n),An(e,i,t)):(In(i,n),Cn(e,i,t))})},In=(e,t)=>{var n,i;const r=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!r)return;const o=t?"showFullscreen":"hideFullscreen";null===(i=r.contentWindow)||void 0===i||i.postMessage(`advertory:${o}-${e}`,"*")},Sn=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},An=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),bn.includes(t)||bn.push(t),n&&window.addEventListener("scroll",En[t],{passive:!0})},Cn=(e,t,n)=>{bn.includes(t)&&(n&&window.removeEventListener("scroll",En[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},kn=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:i=[".skyscraper_r"],headerZIndex:r=3}=t,o=[],s=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),i.forEach(e=>{const t=document.querySelector(e);t&&s.push(t)}),()=>{o.length&&Pn(e,o,r,0),s.length&&Pn(e,s,r,40)}},Pn=(e,t,n,i)=>{const r=e.offsetHeight,o=window.scrollY,s=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let a;a=s>o?(s-o)/t-i:(o+t-(s+r))/t;const d=a<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=a.toString()})};let On=null;const Ln=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${fn})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(mn(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=wn(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>mn(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),mn(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),yn(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},$n=()=>{On=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,i=e?e.offsetLeft:0,r=document.documentElement;r.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),r.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),r.style.setProperty("--advertory-fullscreen-scroll-left",`${i}px`)},xn=()=>{On||(On=window.requestAnimationFrame($n))},Nn=(t,n)=>{var i,r,o,s;const{country:a}=ge.get(),{targetId:d}=t;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(i=null==n?void 0:n.iosSafeAreaTopFix)&&void 0!==i?i:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:r="16px 0",beforeContentValue:o=""}=e,s=t/2,a=document.createElement("style");a.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${s}px),\n ${i} calc(50% - ${s}px),\n ${i} calc(50% + ${s}px),\n ${n} calc(50% + ${s}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${r};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,a.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(a)})(null!==(r=null==n?void 0:n.overlayStyles)&&void 0!==r?r:{});const l=document.getElementById(d),c=null==l?void 0:l.parentElement;if(!l||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>Tn(e,n),{}),r=Sn(e);i.observe(e),n&&(En[r]=kn(e,t))})(c,n),l.className="advertory-fullscreen-scroll";const u=A(t,e)?"absolute":"fixed";l.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=d,l.setAttribute("data-ad-label",C[a].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),xn(),window.addEventListener("resize",xn),null===(o=window.visualViewport)||void 0===o||o.addEventListener("resize",xn),null===(s=window.visualViewport)||void 0===s||s.addEventListener("scroll",xn)},_n=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=yn(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,i=yn(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ln(t,e))},Dn=()=>U(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:r}=ge.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=ge.getHandlers(),{getConsentAsync:s}=Qe(t,i,n),a=yield s(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:i=>{const r=vn(),{prebid:{relevantCbTimeout:o}={}}=ge.get(),s="relevantCb"===i&&o?o:n[i].timeout,a=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,r.loadTags&&r.loadTags())},s);t.push(a)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),l=vn(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=vn();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=pn();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return ze("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=pn();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=a?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};ze("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},dn(n)),gn(p,v))),ze("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},dn(n)),gn(p,v))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e)),d.cleanup()}},customNativeRender:e=>{jn(e,o)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:i,adDiv:o}=t||{};if(!o)return;const s=n(t),a=Object.assign(Object.assign({},i),{targetId:o.id,banner:!0});c(a)&&(Nn(a,r),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const i=new MutationObserver(()=>{n()&&i.disconnect()});i.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(s))}}),ze("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,l.loadTags(e))}},customNativeRender:e=>{jn(e,o)},directRenderFn:()=>{}})})}),jn=(e,t)=>{var n;const{divId:i,native:r,bid:o}=e,s=document.querySelectorAll(`[id^=${i}]`)[0],a=`RY-${s.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(s,a);const d=null===(n=s.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:r,targetId:a},ge.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},qn=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:r}=window,[o,s]=t;if(!i.dataset.lockedsize&&s&&o)i.style.width=`${o}px`,i.style.height=`${s}px`,n&&(r.resizeAd(i.id,[o,s]),i.dataset.lockedsize="true",i.dataset.lockedwidth=o.toString(),i.dataset.lockedheight=s.toString());else if(null==i?void 0:i.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=i.dataset;e&&t&&r.resizeAd(i.id,[e,t])}},Mn=["netboard","board"];class Rn{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,i;const{editionName:r}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),s=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),a=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return a.searchParams.append("editionName",r),o&&a.searchParams.append("urlData",o),s&&a.searchParams.append("excludedItems",s),l&&a.searchParams.append("spid",l),d&&a.searchParams.append("envid",d),a.toString()}fetchData(e){return U(this,void 0,void 0,function*(){var t,n,i;const r=yield this.identityFacade.getIdentityUser(),o=null!==(i=yield null===(n=null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId)||void 0===n?void 0:n.call(t))&&void 0!==i?i:"",s=(null==r?void 0:r.userId)?String(r.userId):"",a=this.buildUrl(e,{envId:o,spid:s});try{ze("Starting fetching DrEdition ad from URL:",a);const e={method:"GET"},t=yield Kt.get(a,e);return ze("Fetch operation completed successfully."),t}catch(e){ze("Error during fetch operation:",e)}return null})}}let Bn=class{getDrEditionUTMParams(e,t){var n;const{title:i="",clientName:r,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:s}=t,a=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:s,utm_campaign:r,utm_medium:a},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const i=this.getDrEditionUTMParams(t,n),r=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(i).forEach(([e,t])=>{r.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const i=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!i)return"";const r=this.getDrEditionUTMParams(e,t),o=new URL(i);return Object.entries(r).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(e,t){return U(this,void 0,void 0,function*(){const{id:n,autoplay:i,mute:r,videoLoop:o,vendor:s}=t.videoConfiguration;e.classList.add("vgtv-video-container"),Object.assign(e.dataset,{vgtvVideoId:n,vgtvVendor:s,vgtvAutoplay:i,vgtvMuted:r,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:i,pathname:r}=new URL(n);if(!i.includes("www.vg.no")&&!r.includes("annonsorinnhold"))return[n];const o=r.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const Fn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):ze("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Vn{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return U(this,void 0,void 0,function*(){var n,i;const{drEditionConfig:{containerSelector:r},renderAsBackfill:o=!1}=t,s=e.querySelector(r);if(!s)return void ze(`Container with selector "${r}" not found.`);const a=yield this.drEditionService.fetchData(t);return(null==a?void 0:a.itemId)||o?!(null==a?void 0:a.itemId)&&o?(ze("No Dr. Edition ads available to render. Collapsing whole placement."),Ne(e.id),void Fn(s)):((null==a?void 0:a.itemId)&&o&&(ze("Dr. Edition ad available to render as a Xandr backfill."),_e(e.id)),void(a?(a.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(a.css,"style"),yield this.rendererManager.render(s,a,t),yield null===(n=this.videoManager)||void 0===n?void 0:n.handle(a,t),Fn(s),this.drEditionAds.push(a),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(a.itemId),this.observeAdView(e,a,t),null===(i=e.querySelector("a"))||void 0===i||i.addEventListener("pointerup",()=>null)):Fn(s))):(ze("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(e),void Fn(s))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";_e(i)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const i=e.querySelector(".dr-edition-slider");if(!i)return!1;let r=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(r&&clearTimeout(r),r=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...i.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...i.children].forEach(e=>{o.observe(e)}),!0}}class Un{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return U(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=Qe(n.tcf,n.isMobileApp,n.country),r=yield i(),o=me(n.device)?t.mobileHTML:t.desktopHTML,s=r?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");e.innerHTML=s,e.querySelectorAll("a").forEach(e=>{var i,r,o;e.search=null!==(o=null===(r=(i=this.newsroomStrategy).getUrlSearchParams)||void 0===r?void 0:r.call(i,e,t,n))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,t,n)})})}}class Hn{constructor(e){this.strategy=e}handle(e,t){return U(this,void 0,void 0,function*(){const{videoConfiguration:{id:n,preview:i}={}}=e;(n||i)&&(yield this.importScript(t),yield this.createVideoElement(e,t))})}importScript(e){return U(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield hn(t)}catch(e){ze("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return U(this,void 0,void 0,function*(){const n=document.createElement("div"),{node:i}=e.videoConfiguration,r=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(e,t))return;this.strategy.handleVideo(n,e),null==r||r.appendChild(n),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==r?void 0:r.parentNode;if(!o)return;const s=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");s!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,r;const{preview:{url:o,thumbnail:s}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const a=document.querySelector(".dr-edition-preview .preview-video");return!!a&&(a.setAttribute("src",o),a.setAttribute("playsinline",""),!(!a||!s)&&(null===(r=(i=t.drEditionConfig).addPreviewVideo)||void 0===r||r.call(i,a),!0))}}let Wn=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,i){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const i=null==n?void 0:n.textContent;return i?i.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:i}={}}=t,r=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:i}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e,t,n){return U(this,void 0,void 0,function*(){var i,r,o,s,a,d,l,c;if(!this.pulse)return;const u=this.getEventInput(e,t,n,"view");(null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)?null===(o=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===o||o.call(r,u):(null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)?null===(d=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===d||d.call(a,u):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,u)})}trackContentClick(e,t,n){return U(this,void 0,void 0,function*(){var i,r,o,s,a,d;if(!this.pulse)return;const l=this.getEventInput(e,t,n,"click");this.pulse.trackLegacyClickUIElement?null===(r=(i=this.pulse).trackLegacyClickUIElement)||void 0===r||r.call(i,l):this.pulse.trackClickUIElement?null===(s=(o=this.pulse).trackClickUIElement)||void 0===s||s.call(o,l):null===(d=(a=this.pulse).trackElementClick)||void 0===d||d.call(a,l)})}};class zn extends Wn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:i,clientName:r="",creativeId:o}={}}=t,{columnName:s,primaryPosition:a}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:s,primaryPosition:a},"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let Kn=class extends Wn{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,r,o,s,a,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulseObjectId)||void 0===o?void 0:o.call(r))&&void 0!==s?s:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(a=this.newsroomStrategy)||void 0===a?void 0:a.getTags)||void 0===d?void 0:d.call(a,e)}}getEventInput(e,t,n,i){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,i),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,i){var r,o,s,a;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(a=null!==(s=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getUrlWithParams)||void 0===o?void 0:o.call(r,t,n))&&void 0!==s?s:p)&&void 0!==a?a:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:i,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};class Gn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){yield U(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],a=this.createPlayerOverlay(e);J(s,a);const d={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},l=yield G(d);l.once("assetReady",()=>{K(l,s)}),l.once("ready",()=>{const t=e;new MutationObserver(e=>{e.forEach(({type:e,attributeName:n})=>{"attributes"===e&&"class"===n&&(t.classList.contains("jw-state-playing")?a.classList.add("is-playing"):a.classList.remove("is-playing"),t.classList.contains("jw-flag-user-inactive")?a.classList.add("is-inactive"):a.classList.remove("is-inactive"))})}).observe(t,{attributes:!0,attributeFilter:["class"]})}),l.once("PulseStats:ready",()=>U(this,void 0,void 0,function*(){const e=yield l.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===V.FRONT?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:i}=new URL(n),r=i.split("/").filter(Boolean);return r.length?[...r.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const Yn="https://www.aftonbladet.se/video-player-extras/latest/";class Jn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const s={id:t,node:n,autoplay:i,mute:r,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${Yn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${Yn}external-link.js`]:{name:"ExternalLink"}}};yield G(s),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}class Qn{handleVideo(e,t){return U(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const s={id:t,node:n,autoplay:i,mute:r,vendor:o,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},H(e)?e:{}),{provider:Object.assign(Object.assign({},H(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${t}`]},requestSettings:{}}}},a=yield G(s);a.once("PulseStats:ready",()=>U(this,void 0,void 0,function*(){const e=yield a.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===V.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Xn=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const Zn=(e,t,n)=>{var i;const{publisher:r,pageType:o,country:s}=e,a={[x.VG]:new Bn,[x.E24]:new Gn,[x.AFTONBLADET]:new Jn,[x.SVD]:new Qn}[r]||new Xn,d=new(s===k.SE?zn:Kn)(n,a,o),l=new Rn(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new Un(a,d),u=new Hn(a);return new Vn(l,c,u,d)},ei=()=>U(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class ti{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return U(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return ze("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return U(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const ni=(e,t,n)=>{const{wrapperSelector:i}=null==e?void 0:e.drEditionConfig,r=document.querySelectorAll(i),o=new IntersectionObserver((i,r)=>((e,t,n,i,r)=>{const o=Zn(n,i,r);e.forEach(e=>{var i,r,s;if(!e.isIntersecting)return;const a=e.target,d=null!==(i=a.dataset.editionName)&&void 0!==i?i:"",l=null!==(r=a.dataset.pulseColumnname)&&void 0!==r?r:"",c=null!==(s=a.dataset.pulsePrimaryposition)&&void 0!==s?s:"";o.fetchAndRenderAd(a,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(a)})})(i,r,e,t,n),{rootMargin:"400% 0px"});r.forEach(e=>o.observe(e))},ii=[],ri=(e,t)=>U(void 0,void 0,void 0,function*(){var n;const{pulse:i,tcf:r,deviceType:o,drEdition:s,publisher:a,pageType:d,country:l,isMobileApp:c}=e;if(!(yield tt(r,c,l,"handleDrEditionBackfill")))return;const u=((e,t)=>{var n;const{deviceType:i,placements:r,drEdition:{fallbackGlobalEditionName:o}={}}=e,s=r[i]||r.desktop,a=Ae(t.targetId),d=s.find(e=>e.id===a),l=Mn.some(e=>a.startsWith(e)),c=ii.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(ii.push(a),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(e,t);if(!u)return;if(!(null==i?void 0:i.instance))return void ze("Pulse has not been passed as a prop, aborting");const v=yield ei(),p=new ti(v),g=Zn({publisher:a,pageType:d,country:l},p,null==i?void 0:i.instance),h=document.getElementById(t.targetId);if(!h||!s)return;h.classList.value="";const m=document.createElement("div");m.className=s.containerSelector.replace(/^[.#:[\]]+/,""),h.innerHTML=m.outerHTML;const y={editionName:(null===(n=null==u?void 0:u.drEdition)||void 0===n?void 0:n.editionName)||"",drEditionConfig:s,device:o,tcf:r,isMobileApp:c,country:l,renderAsBackfill:!0};yield g.fetchAndRenderAd(h,y)}),oi="collapseAd",si="hideAd",ai="resizeAd",di="renderDrEditionFallback",li="wallpaperImageUrl",ci="wallpaperColor",ui="velvet",vi=[ai,li,ci,oi,si,di,ui];let pi;const gi=e=>{if("object"==typeof e)return e;if(t=e,xe.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:li,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:ci,wallpaperColor:t}}if(e.startsWith(di)){const t=e.split(":")[1];return{name:di,targetId:t}}if(e.startsWith(oi)||e.startsWith(si)){const t=e.split(":")[1];return{name:oi,targetId:t}}if(e.includes("name")&&vi.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},hi=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=gi(t);if(!n)return;if(!n.name||!vi.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;i===ui&&a&&(a.includes("noScroll")&&(pi=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(a.includes("close")||a.includes("ended"))&&(null==pi||pi(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==oi&&i!==si||!r||Ne(r),i===ai&&r&&a&&qn(r,a),i===di&&r&&(Ne(r),ri(ge.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&qn(r,d,!0),i===li&&o&&(e=>{const t=document.querySelector(`.${Le}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===ci&&s&&(e=>{const t=document.querySelector(`.${Le}`);t&&(t.style.backgroundColor=e)})(s)},mi=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),yi=()=>{const{publisher:e,country:t,finnBlink:n}=ge.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:r}}=ge.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{_e(e),Te(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>U(void 0,void 0,void 0,function*(){yield i(e,s,null)}),withFullAdsChain:e=>U(void 0,void 0,void 0,function*(){yield i(e,s,a,()=>{je.getData("horseshoe").isAvailable&&r(e)})})}},fi=(e,t,n)=>{const i="true"===n.dataset.isFinnBlinkOnlyPlacement;return f(t)&&i?(ze(`loading finn blink ad for blink only placement for ${t}`),void yi().withFinnBlinkAd(t)):f(t)?(ze(`loading finn blink ad with full ads chain for ${t}`),void yi().withFullAdsChain(t)):void Te(()=>(ze("core showTag",{id:t}),e.showTag(t)))},wi=(e,t)=>U(void 0,void 0,void 0,function*(){yield Ie,yield Se;const n=new IntersectionObserver((t,n)=>((e,t,n,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:r}=e,o=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(r),s=document.getElementById(o);ze("core log from intersection observer handler",{targetId:o,element:s}),n(window.apntag,o,i),s&&(t.unobserve(s),t.disconnect())})})(t,n,fi,e),mi(t));n.observe(e)}),bi=new Map,Ei=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Ti=".brandstudio-premium-content-widget",Ii=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),Si=({adWrapper:e,placementContainer:t})=>{const n=Ii({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Me(i=t),i.innerHTML=""},Ai=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},Ci=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=ge.get(),i=Ei.includes(n)&&Boolean(t.closest(Ti));const r=i?t.closest(Ti):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,s=n&&t.matches("iframe, article")&&e;if(!n||!i&&!s||i&&!r)return;if(s)return Ai(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=r;a&&d.contains(a)?Ai(a):d.hasAttribute("style")&&Ai(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},ki=(e,t,n,i,r,o)=>{var s;const a=performance.now(),d=null!==(s=bi.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;a-d>=r&&l&&(bi.set(t,a),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&Si({adWrapper:i,placementContainer:n}),Te(()=>{e.setKeywords([t],{[`${Ce()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},Pi=(e,t,n)=>{const i=new IntersectionObserver((e,i)=>((e,t,n,i)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:r,boundingClientRect:o}=e;t(window.apntag,r.id,o.y,n,i,r)})})(e,ki,t,n),mi(300));i.observe(e)},Oi=(e,t=6)=>{const n=[];for(let i=0;i<e.length;i+=t){const r=e.slice(i,i+t);n.push(r)}return n},Li=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),$i=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},xi=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=ge.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),qi(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Ni=(e,t,n)=>{const i=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const r of i){const i=e.find(e=>{var t;return e.id===(null===(t=r.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==i?void 0:i.threshold;$i(r,o)&&i&&(qe(i.id),n.length&&r.classList.remove(...n),qi([i],t))}},_i=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=ge.get();t&&(e.forEach(({id:e})=>{const t=Di(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{Ni(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),Ni(e,!1,t))};n.persisted&&(Li()?window.addEventListener("scroll",i,{passive:!0}):Ni(e,!1,t))})})(e,n))},Di=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},ji=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(Di(t)),r=(e=>1===e[0]&&1===e[1])(i),o={sizes:[i],allowedFormats:r?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return r||(o.native=void 0),o},qi=(e,t=!1)=>{const{requestSize:n=ve}=ge.get(),i=e.map(({id:e})=>e),r=Oi(i,n);if(t)for(const t of e){const e=ji(t);window.apntag.modifyTag(t.id,e)}for(const e of r)Te(()=>window.apntag.refresh(e))};const Mi="#fff",Ri="#0098da",Bi=(e,t=!0)=>{(e===Ze.WELCOME_PAGE||e===Ze.TOPSCROLLER)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Fi=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},Vi=e=>{document.body.style.overflow=e?"initial":"hidden"},Ui=e=>{const t=Wi(e),n=Hi(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),Vi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},Hi=e=>{const t=()=>Ui(e);return window.addEventListener("advertory:closeTakeover",t),Fi(),t},Wi=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&Ui(e)};return Fi(),window.addEventListener("keydown",t),t},zi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(Wi(e),Hi(e),Fi(),t.addEventListener("click",()=>{Ui(e)}),Vi(!1))},Ki=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),Hi(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},Gi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>Ui(e))})(e)},Yi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=ge.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),i=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&i&&(i.style.display="flex",i.innerText=C.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Ji=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=C.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Qi=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=C.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Xi=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},Zi=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},er=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${gt})()`,e+t.outerHTML})(e)),n},tr=e=>{const t=(e=>{const{requests:t}=window.apntag,n=yn(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,i=yn(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,er(t))},nr=e=>U(void 0,void 0,void 0,function*(){const{takeover:t}=ge.get(),{targetId:n}=e,i=document.querySelector(`#${n}`),r=document.querySelector(".advertory-takeover-wrapper");if(!i||!r||!t)return;const s=(e=>{const{width:t,height:n}=e;return dt(t,n)?Ze.SPLASH:A(e,o)?Ze.VELVET:lt()?Ze.TOPSCROLLER:Ze.WELCOME_PAGE})(e),a=r.offsetHeight,d=window.scrollY>a;r.style.display="block",!d&&Bi(s,!1),((e,t)=>{({[Ze.WELCOME_PAGE]:Qi,[Ze.SPLASH]:Yi,[Ze.TOPSCROLLER]:Ji,[Ze.VELVET]:Xi})[t](e)})(r,s),Zi(),((e,t)=>{({[Ze.WELCOME_PAGE]:Ki,[Ze.TOPSCROLLER]:Ki,[Ze.SPLASH]:zi,[Ze.VELVET]:Gi})[t](e)})(r,s),((e,t,n)=>{if(!n)return;({[Ze.WELCOME_PAGE]:()=>{const{buttonLabel:i}=vt(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=i?i:"")})},[Ze.SPLASH]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:s}=vt(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&s){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&r&&(n.setAttribute("src",r.url),n.setAttribute("alt",r.alt)),".advertory-splash-navbar-wrapper"===t&&i){const{backgroundColor:e,color:t}=i;n.style.setProperty("background-color",null!=e?e:Mi,"important"),n.style.color=null!=t?t:Ri}}})},[Ze.TOPSCROLLER]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=vt(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||r||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=i?i:""))})},[Ze.VELVET]:()=>{}})[t]()})(r,s,t),yield ct(),!d&&Bi(s,!0),pt(e,s)}),ir="advertory-brandmetrics-survey",rr=()=>U(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=ge.get(),r=yield tt(i,n,t,"norstat");if(!e||n||!r)return;const o=(e=>{const{ppid1:t,ppid2:n}=rn.getPPIDs(),{ppid1:i,ppid2:r}=on.getPPIDs(),o=(new nn).add(n,Yt[e]).add(t,Jt[e]).add(r,Qt[e]).add(i,Xt[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{U(void 0,[e,t,...n],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const i=document.createElement("img");i.src=e,i.id=null!=t?t:"",n&&(i.style.display="none"),document.body.appendChild(i)})})(`https://sch-map.norstatsurveys.com/api/nids/${t===k.NO?"schibsted":"schibstedse"}/map/${o}`,"norstat")}),or=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,sr=e=>`externalImpId:'${e}'`,ar=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=ge.get(),r=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${ke()}-count`],i=e.positionConfig.find(e=>e.adPositionIndex===n);if(!i)return e;const r=i.keywords?Object.assign(Object.assign({},e.keywords),i.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==i?void 0:i.sizes)&&void 0!==t?t:e.sizes,keywords:r})})(e),{id:o,sizes:s,keywords:a,allowedFormats:d,invCode:l,ssa:c=!1,nativeCustomProperties:u,safeframeConfig:v,dynamicSizeWidthCheck:p=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||st())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],i=null==n?void 0:n.filter(e=>e!==Ze.TOPSCROLLER),r=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":i}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:r})})(r),g=Object.assign({invCode:l,sizes:s,targetId:o,keywords:or(a,c),allowedFormats:d,dynamicSizeWidthCheck:p},v&&{safeframeConfig:v}),h=(e=>{var t,n,i,r,o,s,a;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(i=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===i?void 0:i.pageViewId)?(ze("Tracker state pageViewId is:",null===(o=null===(r=null==e?void 0:e.instance)||void 0===r?void 0:r.state)||void 0===o?void 0:o.pageViewId),null===(a=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===a?void 0:a.pageViewId):(ze("Tracker state does not contain field pageViewId or it is empty"),""):(ze("Tracker state is empty"),""):(ze("Tracker is not configured in initAdvertory function"),"")})(i);n&&h&&(ze("External Impression ID assigned to defineTag:",sr(h)),g.externalImpId=sr(h));const m=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,i])=>((null==e?void 0:e.includes(n))&&(t[n]=i),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(u);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(g.native=m),g},dr=e=>!e.includes("takeover")||st(),lr=e=>{if(!e)return e;const t=e[`${Ce()}-targetid`],n=t?Ae(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Ce()}-targetid`]:[n]})},cr=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Ce()}-geo`]&&{[`${Ce()}-geo`]:["geo-test-value"]}),e[`${Ce()}-geofence`]&&{[`${Ce()}-geofence`]:["geofence-test-value"]}),e[`${Ce()}-weather`]&&{[`${Ce()}-weather`]:["weather-test-value"]}),ur=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const i=n.split(",")[0].split(":")[0],r=e.find(e=>e.invCode===i),o=document.querySelector(`[id^=${null==r?void 0:r.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},vr=(e,t)=>U(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),pr=()=>U(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),gr={arrayMerge:(e,t)=>t},hr=e=>U(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:i}=e;return Boolean(t&&n&&(null==i?void 0:i.publisherClassName))})(e))return e;try{const t=yield(e=>U(void 0,void 0,void 0,function*(){const t=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(e);if(!t)return null;const n=new AbortController,i=setTimeout(()=>n.abort(),5e3);try{return yield Kt.get(t,{method:"GET",signal:n.signal})}catch(e){throw ze("Failed to fetch S3 config",{error:e,url:t}),e}finally{clearTimeout(i)}}))(e);return t?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:r,placements:o,threshold:s,batchSize:a}=t,d=le.all([e.placements,o],gr),l=le(e.pageOptions,{keywords:i},gr),c=le(e.appearanceConfig,{defaultThreshold:s},gr),u=le(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:r},gr);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=a?a:e.requestSize,pageOptions:l,appearanceConfig:c,refreshConfig:u})})({siteConfig:e,configOverrides:t}):e}catch(t){return ze("Error fetching S3 config, using site config",{error:t}),e}}),mr=".advertory-right-column-track",yr="--advertory-right-column-track-height",fr=e=>e.getBoundingClientRect().top+window.scrollY,wr=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},br=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},Er=(e,t)=>`${e}-${t}`,Tr=(e,t,n)=>{var i;const r=Array.from(null!==(i=e.querySelectorAll(t))&&void 0!==i?i:[]),o=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===o.length)return;const s=fr(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=wr(e);br("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=fr(e),r=Er(yr,t),o=i-n,s=Er("--advertory-right-column-split-point-height",t),a=wr(e);br(r,o),br(s,a)})(e,t+1,s),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Er("--advertory-right-column-ad-height",t),i=wr(e);br(n,i)})(r[t])});((e,t)=>{const n=fr(e);br(yr,n-t)})(o[Math.min(r.length,o.length-1)].point,s)};let Ir=!1;class Sr{getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:i,pathname:r}=new URL(n);if(!i.includes("www.vg.no")&&!r.includes("annonsorinnhold"))return[n];const o=r.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Ar{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class Cr{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:i}=this.parseKilkayaData(e);return{id:i,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return U(this,void 0,void 0,function*(){var t,n,i,r,o,s,a,d;if(!this.pulse)return;const l=this.getEventInput(e,"view");(null===(t=this.pulse)||void 0===t?void 0:t.trackLegacyViewUIElement)?null===(i=null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)||void 0===i||i.call(n,l):(null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)?null===(s=null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)||void 0===s||s.call(o,l):null===(d=null===(a=this.pulse)||void 0===a?void 0:a.trackElementView)||void 0===d||d.call(a,l)})}trackContentClick(e){return U(this,void 0,void 0,function*(){var t,n,i,r,o,s;if(!this.pulse)return;const a=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,a):this.pulse.trackClickUIElement?null===(r=(i=this.pulse).trackClickUIElement)||void 0===r||r.call(i,a):null===(s=(o=this.pulse).trackElementClick)||void 0===s||s.call(o,a)})}}class kr extends Cr{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,i,r,o,s;const{clientName:a,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(r=null===(i=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===i?void 0:i.call(n))&&void 0!==r?r:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:a,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(s=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===s?void 0:s.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:i}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const Pr="[data-k5a-teaser-analytics]",Or=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const r=new kr(e,t,n),o=new WeakMap,s=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},a=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,i=n.querySelector(Pr);Boolean(null==i?void 0:i.dataset.k5aTeaserAnalytics)?(r.trackContentView(n),t.unobserve(e.target),s(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(Pr);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(r.trackContentView(e),t.unobserve(e),s(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});i.forEach(e=>{a.observe(e),e.addEventListener("click",()=>r.trackContentClick(e))})};class Lr{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const i={[x.VG]:new Sr}[n]||new Ar;Or(e.instance,i,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const i=n.parentElement;i&&(ze(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(i))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const i=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";_e(i)}loadKilkayaScript(e){return U(this,void 0,void 0,function*(){yield hn(e)})}run(e){return U(this,void 0,void 0,function*(){const{tcf:t,isMobileApp:n,country:i,kilkaya:r}=e;if(!(null==r?void 0:r.enabled))return;const o=yield tt(t,n,i,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(r.url),this.handleKilkayaStreamTracking(e))})}}const $r=1e4,xr=e=>e.some(e=>e.some(e=>!!e&&$i(e,0))),Nr=()=>{const{widescreenSwitching:e}=ge.get(),{enabled:t,rotationInterval:n=$r,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const r=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=ge.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(i);let o=0,s=Date.now(),a=xr(r);if(!r.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},l=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(r);const c=((e,t)=>{let n=null;return(...i)=>{null===n&&(e(...i),n=setTimeout(()=>{n=null},t))}})(()=>{a||(a=xr(r)||a,s=Date.now());Date.now()-s>=n&&((()=>{const e=l(o),t=r.map(e=>e[o]),n=r.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),o=l(o),s=Date.now())},1e3);window.addEventListener("scroll",c)},_r=e=>document.querySelector(`#${e}`);let Dr,jr=[];const qr=["takeover","wallpaper"],Mr=e=>{const t=(e=>{const t=je.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:s,requestSize:a=ve,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:p},takeover:g,fullscreenScroll:h,useAppTabletInvCode:m}=e;return{xandr:{member:p,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:d,country:l,pageType:c,deviceType:u,placements:i,tcf:r,requestSize:a,isMobileApp:v,useAppTabletInvCode:m},o&&{glimr:o}),n&&{queryConfig:n}),s&&{appearanceConfig:s}),g&&{takeover:g}),h&&{fullscreenScroll:h})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},Rr=()=>U(void 0,void 0,void 0,function*(){const{pageOptions:e}=ge.get(),{preparePageOptions:t}=ge.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=ge.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),i=yield U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();return(yield tt(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),r=yield t(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},e),{renderingManagement:Object.assign({},n)}),i));(e=>{const t=je.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=cr(e);je.setData("alertoryConfigKeywords",n)})(r.keywords),Te(()=>Dr.setPageOpts(r))}),Br=e=>U(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:r}=ge.get();Fr(e);const o=yield tt(n,i,r,"prebid");(null==t?void 0:t.enabled)&&o?(ze("core loadPlacements prebid enabled"),yield Dn()):(ze("core load tags invoked without prebid enabled"),Vr(e))}),Fr=e=>{const{prepareTag:t}=ge.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const i=t.findIndex(t=>e.id.includes(t)),r=t.findIndex(e=>n.id.includes(e));return-1!==i&&-1===r?-1:-1===i&&-1!==r?1:i-r})})(e).forEach(e=>{ze("core defineTags",{placement:e});const i=ar(e);if(dr(e.id)){const r=t(i),o=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:lr(i),sizes:r}})(r);n.push(o),Te(()=>(ze("core defineTag - add to the queue",{placement:e,preparedTag:r}),Dr.defineTag(r)))}}),(e=>{var t,n,i;(null===(i=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===i?void 0:i.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},Vr=e=>{const t=e.filter(({id:e})=>dr(e)).map(({id:e})=>e);t.length&&Te(()=>(ze("core loadTags",{placementsIdsToLoad:t}),Dr.loadTags([...t])))},Ur=(e,t)=>U(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=ge.get(),{threshold:r,refresh:o}=e,s=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),a=null==n?void 0:n.defaultThreshold[i];s&&(ze("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:r,deviceDefaultThreshold:a}),yield wi(s,null!=r?r:a)),s&&o&&(ze("core showAd - setup refreshing",{placement:e,adObj:t}),s.dataset.refresh=o.toString())}),Hr=e=>e.some(({id:e})=>qr.some(t=>e.includes(t))),Wr=e=>U(void 0,void 0,void 0,function*(){var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return;const[n,i]=(e=>e.reduce(([e,t],n)=>{var i;return(null===(i=null==n?void 0:n.finnBlink)||void 0===i?void 0:i.loadOnlyFinnBlink)?[[...e,n],t]:[e,[...t,n]]},[[],[]]))(e),r=(e=>{const{requestSize:t=ve,queryConfig:{placementBatches:n}={},deviceType:i}=ge.get(),r=We(e),o=Object.keys((null==n?void 0:n[i])||{}).map(e=>r[e]||[]).filter(e=>e.length>0),s=new Set(o.flat().map(({id:e})=>e)),a=e.filter(({id:e})=>!s.has(e));return[...o,...Oi(a,t)]})(i);for(const e of r)Hr(e)?(ze("core loadAds without lazy loading",{placementsToLoad:e}),yield Br(e)):e.length&&(ze("core loadAds with lazy loading",{placementsToLoad:e}),yield zr(e));yield(e=>U(void 0,void 0,void 0,function*(){if(!e.length)return;const{appearanceConfig:t,deviceType:n}=ge.get(),i=null==t?void 0:t.defaultThreshold[n];for(const t of e){const{threshold:e,id:n}=t,r=_r(n);r&&(yield wi(r,null!=e?e:i))}}))(n)}),zr=e=>U(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=ge.get(),i=[];if(!t)return ze("lazy load is not enabled",{placements:e}),void(yield Br(e));const r=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{ze("lazy load is enabled - handler start",{loadedPlacementIds:i,placements:e});const r=e.every(e=>i.includes(e.id)),o=e.map(e=>e.id);!r&&i.push(...o),!r&&Br(e),ze("lazy load is enabled - handler stop",{loadedPlacementIds:i,placements:e,arePlacementsLoaded:r,placementIds:o}),n.disconnect()})},{rootMargin:n});e.forEach(e=>{const t=document.getElementById(e.id);t&&(ze("lazy loading - observe element",{placementId:e.id,element:t}),r.observe(t))})}),Kr=()=>U(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:i,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:o}}=ge.getHandlers(),{wallpaper:s,fullscreenScroll:a}=ge.get(),d=[];Te(()=>{Dr.onEvent("adRequested",()=>{e.adRequested()}),Dr.onEvent("adAvailable",t=>U(void 0,void 0,void 0,function*(){var n,o,d,l,v,g;ze("core adAvailable start",{placementsAvailable:jr,adObj:t,isFullscreenScrollAd:c(t),isFinnBlink:f(t.targetId),isNativeAd:u(t),isMediation:At(t),isTakeoverAd:p(t),isCollapseAd:m(t),isWallpaperAd:h(t)});const y=null===(d=null===(o=null===(n=null===window||void 0===window?void 0:window.apntag)||void 0===n?void 0:n.requests)||void 0===o?void 0:o.tags[t.targetId])||void 0===d?void 0:d.adResponse.ads;At(t)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(t.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(t)&&_n(t),E(t)&&Nr(),c(t)&&!f(t.targetId)&&Nn(t,a),!u(t)||At(t)||f(t.targetId)||i(t,ge.get()),p(t)&&!m(t)&&(tr(t.targetId),yield nr(t)),h(t)&&(r(()=>Te(()=>window.apntag.showTag(t.targetId)),s),je.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(t)&&je.setData("horseshoe",{isAvailable:!0}),mt({adObj:t}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const i=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;i&&((e,t)=>{const{height:n,width:i,native:r}=e;r?t.dataset.adSizes="[1,1]":n&&i&&(t.dataset.adSizes=`[${i},${n}]`)})(e,i)})(t),e.adAvailable(t);const w=jr.find(({id:e})=>e===t.targetId);w&&(yield Ur(w,t),jr=jr.filter(e=>e.id!==w.id)),ze("core adAvailable stop",{placementsAvailable:jr,adObj:t,isFullscreenScrollAd:c(t),isFinnBlink:f(t.targetId),isNativeAd:u(t),isMediation:At(t),isTakeoverAd:p(t),isCollapseAd:m(t),isWallpaperAd:h(t)})})),Dr.onEvent("adLoaded",r=>{const{refreshConfig:s,appearanceConfig:a}=ge.get(),l=document.getElementById(r.targetId);f(r.targetId)&&(e=>{const{fullscreenScroll:t}=ge.get(),{initNativeAd:n}=ge.getHandlers();c(e)&&Nn(e,t),u(e)&&n(e,ge.get())})(r);d.includes(r.targetId)&&u(r)&&(i(r,ge.get()),mt({adObj:r})),!d.includes(r.targetId)&&At(r)&&d.push(r.targetId),m(r)&&Ne(r.targetId),p(r)&&((e,t)=>{var n;const i="100%",r="100%";e.resizeAd(t,[i,r]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===i&&n===r||(o.style.width=i,o.style.height=r)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(Dr,r.targetId),v(r)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=ge.get();if(!t||!n||!i)return;const r=t.parentElement;r&&(t.classList.add(`advertory-${n}-${i}__full-width-ad`),r.classList.add(`advertory-${n}-${i}-wrapper__full-width-ad`))})(r),(e=>A(e,n))(r)&&(e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),i=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:r,fullWidthFormatClassName:o}={}}=ge.get();if(!t||!n||!i)return;const s=window.innerWidth,a=Math.round(s/1080*1920);t.style.width="100%",t.style.height=`${a}px`,t.classList.add(`advertory-${r}-${o}__vertical-full-width-ad`);const d=ft(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"})(r),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,i=document.querySelector(`#${n}`),r=null==i?void 0:i.parentElement;if(!r||!i)return;Ci({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,s=(new Date).getTime();i&&"true"!==i.dataset.subscribedForRefresh&&(i.dataset.subscribedForRefresh="true",i.dataset.refresh&&Pi(i,s,o))})(r,s),(null==a?void 0:a.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(r.targetId);var g,h;je.getData("horseshoe").isAvailable&&o(r.targetId),(e=>{var n,i,r,o,s,a;const{adScaleConfig:d,deviceType:l}=ge.get();if(!(null==d?void 0:d.enabled))return;if(A(e,t))return;const c=null!==(n=d.adsToBeScaled[l])&&void 0!==n?n:[],u=Fe(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(r=null===(i=d.offset)||void 0===i?void 0:i[u])&&void 0!==r?r:0,p=document.getElementById(e.targetId),g=null!==(o=null==p?void 0:p.offsetWidth)&&void 0!==o?o:window.screen.width,h=null!==(a=null===(s=null==p?void 0:p.parentElement)||void 0===s?void 0:s.offsetWidth)&&void 0!==a?a:window.screen.width;wt(e,(g<h?g:h)-v)})(r),e.adLoaded(r),g=r.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${g}`)&&(null===(h=window.gdpr)||void 0===h?void 0:h.setupButton)&&window.gdpr.setupButton(g),l&&(l.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=ge.get(),i=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>i&&e.setAttribute("data-two-column-ad-layout","true")})(l)),Et(r),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:r.targetId,adFormat:yt(r)}}))}),Dr.onEvent("adNoBid",t=>U(void 0,void 0,void 0,function*(){Ne(t.targetId),yield ri(ge.get(),t),ut(t)&&(yield ct()),e.adNoBid(t)})),Dr.onEvent("adError",(t,n)=>U(void 0,void 0,void 0,function*(){ut(n)&&(yield ct()),e.adError(t,n)})),Dr.onEvent("adCollapse",()=>{e.adCollapse()}),Dr.onEvent("adRequestFailure",t=>{Ne(t.targetId),e.adRequestFailure(t)}),Dr.onEvent("adBadRequest",t=>{Ne(t.targetId),e.adBadRequest(t)}),Dr.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Dr.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Gr=(e,t)=>U(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return[];const{clearAds:i,reloadExistingAds:r,renderFinnBlinkPlacements:o,contextSelector:s}=null!=t?t:{};if(i)return Re(),[];r&&(Re(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{_e(e.id)})),he(null!=e?e:{}),yield Rr();let a=Ue(s);return o&&(a=a.filter(e=>f(e.id))),a.length>0&&(jr=[...jr,...a.map(e=>Object.assign({},e))],xi(a),_i(a),yield Wr(a)),jr}),Yr=(e,t)=>U(void 0,void 0,void 0,function*(){var n;ge.set(e),ge.setHandlers(t),je.initialize(),window.addEventListener("message",hi,!1),Dr=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=Dr,ze("Apn tag is set up on window"),yield Promise.allSettled([U(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=ge.get();(yield tt(e,t,n,"xandr-endpoint"))||Dr.setEndpoint("ib.adnxs-simple.com",!0)}),U(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=ge.get(),r=yield tt(t,n,i,"prebid");(null==e?void 0:e.enabled)&&r&&(yield hn(null==e?void 0:e.url))}),sn(e),U(void 0,void 0,void 0,function*(){const{astUrl:e}=ge.get();yield hn(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),U(void 0,void 0,void 0,function*(){const{gptUrl:e}=ge.get();yield hn(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),U(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:r}=ge.get(),{getConsentAsync:o}=Qe(n,i,r),s=yield o();if(e&&t&&s){if(yield hn(t),document.querySelector(`.${ir}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(ir)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),Bt(),U(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=ge.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield hn(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield rr(),ze("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,U(void 0,void 0,void 0,function*(){const e=n.map(e=>hn(e));yield Promise.all(e)})),yield Kr(),yield Rr(),ze("Page options have been set"),Mr(e),ze("Advertory is setup on window"),jr=Ue(),xi(jr),_i(jr),yield Wr(jr),ze("Ads has been loaded",jr),ur(jr),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>U(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield tt(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield ei(),i=new ti(n);ni({publisher:e.publisher,drEditionConfig:e.drEdition,device:e.deviceType,pageType:e.pageType,country:e.country},i,null===(t=e.pulse)||void 0===t?void 0:t.instance)}))(e),(e=>{if(!(null==e?void 0:e.enabled)||Ir)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=mr}=e,r=document.querySelector(i);if(!r)return;Ir=!0;const o=()=>{Tr(r,n,t)};o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),window.addEventListener("load",o),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(o)}),new ResizeObserver(o).observe(r)})(e.rightColumnSplit),yield(e=>U(void 0,void 0,void 0,function*(){const t=new Lr;yield t.run(e)}))(e)}),Jr=(e,t)=>U(void 0,void 0,void 0,function*(){yield((e,t)=>U(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=Qe(e.tcf,e.isMobileApp,e.country),r=yield hr(e);yield pr(),yield vr(n),yield vr(i),ze("TCF resolved successfully"),yield Yr(r,t),ze("Run function resolved successfully")}))(e,t)}),Qr=((e,t)=>n=>Jr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;const r=null==i?void 0:i.closest(".AdWrapper-inner");r&&(null==r||r.style.removeProperty("min-height")),u(e)&&fe(i);const o=i.dataset.placementFormat,{pageType:s=V.FRONT,deviceType:a,nativeTrackingConfig:d,appearanceConfig:l}=null!=t?t:{},c={language:k.SE,publisher:x.SVD,deviceType:a,pageType:s,nativeTrackingConfig:d,appearanceConfig:l,adPlacementFormat:o};B(e,c,ne),ye(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:Ee,adjustAdToHorseshoe:Ee},loadFinnBlinkAd:be,replaceAdsWithFinnBlink:be,preparePageOptions:un,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=ge.get(),o=((e,t)=>{const{isMobileApp:n}=ge.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,r),s=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${Ce()}-adformat`,r=t?t[i]:[];if(!r)return{};const o=(Array.isArray(r)?r:[r]).filter(e=>!(e in l)||window.innerWidth>=l[e]);return{[i]:n?o:r}})(e),a=(e=>{const t=`${Ce()}-targetid`;return e?{[t]:[e]}:{}})(n),d=(e=>{var t;const[,n]=null!==(t=e.match(/-((w|a)(?:ph|de|tb))-/))&&void 0!==t?t:[];switch(n){case"wde":return{"aa-sch-supply_type":"web_desktop"};case"wtb":return{"aa-sch-supply_type":"web_tablet"};case"wph":return{"aa-sch-supply_type":"web_phone"};case"aph":return{"aa-sch-supply_type":"app_phone"};default:return}})(o),c=Object.assign({},kt(i,{safeFrameAutoInitialSize:!0}));return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t),s),a),d),rendererOptions:c})},siteEvents:Pt,librariesToLoad:[]},{publisherClassName:x.SVD,fullWidthFormatClassName:"panorama"});var Xr=Object.freeze({__proto__:null,default:""});export{ln as getVideoPPIDs,Qr as initAdvertoryPackage,Gr as updateAdvertory};
|