@schibsted/advertory 2.61.0 → 2.61.2

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.
Files changed (47) hide show
  1. package/core/aftenposten/es/index.css +1 -1
  2. package/core/aftenposten/es/index.js +1 -1
  3. package/core/aftenposten/index.js +1 -1
  4. package/core/aftenpostenv2/es/index.css +1 -0
  5. package/core/aftenpostenv2/es/index.js +1 -0
  6. package/core/aftonbladet/es/index.css +1 -1
  7. package/core/bt/es/index.css +1 -1
  8. package/core/bt/es/index.js +1 -1
  9. package/core/bt/index.js +1 -1
  10. package/core/e24/es/index.css +1 -1
  11. package/core/e24/es/index.js +1 -1
  12. package/core/e24/index.js +1 -1
  13. package/core/koket/es/index.css +1 -1
  14. package/core/sa/es/index.css +1 -1
  15. package/core/sa/es/index.js +1 -1
  16. package/core/sa/index.js +1 -1
  17. package/core/svd/es/index.css +1 -1
  18. package/core/svdv2/es/index.css +1 -1
  19. package/core/tek/index.js +1 -1
  20. package/core/vg/es/index.css +1 -1
  21. package/core/vg/es/index.js +1 -1
  22. package/core/vg/index.js +1 -1
  23. package/core/vgv2/es/index.css +1 -1
  24. package/core/vgv2/es/index.js +1 -1
  25. package/package.json +1 -1
  26. package/sites/aftenposten/es/index.css +1 -1
  27. package/sites/aftenpostenv2/es/index.css +1 -0
  28. package/sites/aftenpostenv2/es/index.js +1 -0
  29. package/sites/aftonbladetv2/es/index.css +1 -1
  30. package/sites/bt/es/index.css +1 -1
  31. package/sites/e24/es/index.css +1 -1
  32. package/sites/e24/index.js +1 -1
  33. package/sites/fotbollskanalen/es/index.css +1 -1
  34. package/sites/sa/es/index.css +1 -1
  35. package/sites/svd/es/index.css +1 -1
  36. package/sites/svdv2/es/index.css +1 -1
  37. package/sites/tv4/es/index.css +1 -1
  38. package/sites/vg/es/index.css +1 -1
  39. package/sites/vgv2/es/index.css +1 -1
  40. package/styles/e24/styles.css +1 -1
  41. package/styles/svdv2/styles.css +1 -1
  42. package/core/aftenpostenv2/index.js +0 -1
  43. package/sites/aftenpostenv2/index.js +0 -1
  44. /package/core/aftenpostenv2/{index.d.ts → es/index.d.ts} +0 -0
  45. /package/core/aftenpostenv2/{package.json → es/package.json} +0 -0
  46. /package/sites/aftenpostenv2/{index.d.ts → es/index.d.ts} +0 -0
  47. /package/sites/aftenpostenv2/{package.json → es/package.json} +0 -0
@@ -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=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!T(e),w=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},b=e=>e.targetId.startsWith("netboard"),E=e=>e.targetId.startsWith("board"),T=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),k=e=>e.targetId.startsWith("midboard"),S=e=>e.targetId.startsWith("widescreen"),C=e=>e.width>=1260&&e.width<=1280,I=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})},$="0123456789abcdefghijklmnopqrstuvwxyz",O=(e,t)=>{e.style.display=t},P=e=>{window.apntag.anq.push(e)},L=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),x=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})}),N=e=>{const{targetId:t}=e,n=document.querySelector(`div[id^="${t}"]`);if(!n)return;const i=n.parentElement;if(!i)return;t.includes("integration_godt-menu")&&j(i)},j=e=>{const t=e.parentElement;t&&(t.style.display="none")},_=()=>{const e=document.querySelector("#advertory-vg-sponsorstripe-info");if(!e)return;const t=document.querySelector(".advertory-vg-ad-native-sponsorstripe-liquidglass");t?(e=>{const t=e.querySelector("#sponsorstripe-info-open-button"),n=e.querySelector("#sponsorstripe-info-close-button"),i=e.querySelector(".ad-wrapper"),r=e.querySelector(".ad-info");i&&r&&(null==t||t.addEventListener("click",()=>{O(i,"none"),O(r,"flex")}),null==n||n.addEventListener("click",()=>{O(i,"flex"),O(r,"none")}))})(t):(e=>{const t=document.querySelector("#sponsorstripe-info-open-button"),n=document.querySelector("#sponsorstripe-info-close-button");null==t||t.addEventListener("click",()=>{O(e,"flex")}),null==n||n.addEventListener("click",()=>{O(e,"none")})})(e)};function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,D;var R=M(function(){if(D)return q;D=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)},{})},q=a}());const B=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],F={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},V=6;class z{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 B){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=R(z.DEFAULT_SITE_HANDLERS,e)}}z.DEFAULT_SITE_HANDLERS={siteEvents:F,initNativeAd:function(){}};const U=new z,H=U.modifyConfigProperties.bind(U);function W(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;class K{initialize(){this.DATA=Object.assign({},K.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)}}K.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const G=new K,J="advertory-wallpaper-background",Y="advertory-with-horseshoe",Z=()=>{const e=document.querySelector(`.${J}`);e&&e.remove()},Q=e=>{const t=e.getBoundingClientRect().top;requestAnimationFrame(()=>(e=>{if(!document.body)return;const t=document.querySelector(`.${J}`);t&&t.style.setProperty("top",`${e}px`)})(t+15))},X=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,ee=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")&&Z())},te=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"))},ne=()=>{const{publisher:e,country:t,finnBlink:n}=U.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:r}}=U.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{te(e),P(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>W(void 0,void 0,void 0,function*(){yield i(e,s,null)}),withFullAdsChain:e=>W(void 0,void 0,void 0,function*(){yield i(e,s,a,()=>{G.getData("horseshoe").isAvailable&&r(e)})})}},ie={Blink:"Blink"},re=(e,...t)=>W(void 0,[e,...t],void 0,function*(e,{timeout:t}={timeout:1e3}){Array.from(document.querySelectorAll('script[type="module"]')).some(t=>{var n;return null===(n=t.textContent)||void 0===n?void 0:n.includes(`import(${JSON.stringify(e)})`)})||(yield new Promise((n,i)=>{const r=document.createElement("script");r.async=!0,r.type="module",r.textContent=`(async () => {\n try {\n const moduleNamespace = await import(${JSON.stringify(e)});\n const allowedExports = ${JSON.stringify(ie)};\n\n for (const key of Object.keys(allowedExports)) {\n const exportedValue = moduleNamespace[key];\n \n if (exportedValue !== undefined) {\n window[allowedExports[key]] = exportedValue;\n }\n }\n } catch (error) {\n console.error('ESM load failed: ', error);\n }\n })();`;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)}))}),oe="https://assets.finn.no/pkg/distribution-fixed/v1/FINNExternalDistribution.modern.js",se=(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},ae={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},de=()=>{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"},le=e=>e===ae.MOBILE,ce=()=>{if(!/iPhone|iPad|iPod/i.test(navigator.platform)||"ios"!==de())return!1;const e=ue();return!!(e&&e>=26)||18===e&&(ve()||pe())},ue=()=>{const e=navigator.userAgent.match(/(?:iPhone )?OS (\d+)_/i);return e?parseInt(e[1],10):null},ve=()=>{const e=navigator.userAgent.match(/Version\/(\d+)\./i);return!!e&&parseInt(e[1],10)>=26},pe=()=>{const e=navigator.userAgent.match(/\(iOS (\d+)\./i);return!!e&&parseInt(e[1],10)>=26},ge="finn-blink",he="native-ad",me=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},ye=()=>W(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)}}),fe=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},we=(e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={}}=U.get(),i=document.createElement("div"),r=document.createElement("div");return r.id=e,i.appendChild(r),se(n,r,ge),me(`Creating blink container for: ${e}`),i},be=(e,t)=>{var n;(me(`Appending ${t.id} after ${e.id}`),e.parentElement&&(n=e.parentElement,!Array.from(n.children).some(e=>e.classList.contains("advertory-finn-blink-wrapper"))))?(e.parentElement.style.display="none",e.parentElement.insertAdjacentElement("afterend",t)):me(`Cannot perform afterend on: ${e.id}`)},Ee=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),Te=e=>{const{source:t}=e;return"csm"===t},ke=e=>{const{deviceType:t}=U.get();navigator&&navigator.userAgent.match(/firefox/i)&&(e=>e===ae.DESKTOP||"tablet"===e)(t)&&Se(e)},Se=e=>{var t,n,i,r,o,s,a,d;const l=Te(e)?1:0,c=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags)||void 0===i?void 0:i[e.targetId];if(null===(d=null===(a=null===(s=null===(o=null===(r=null==c?void 0:c.adResponse)||void 0===r?void 0:r.ads)||void 0===o?void 0:o[l])||void 0===s?void 0:s.rtb)||void 0===a?void 0:a.banner)||void 0===d?void 0:d.content){const e="<style>body { margin:0 !important; }</style>";c.adResponse.ads[l].rtb.banner.content+=e}},Ce={adRequested:()=>{},adAvailable:e=>{f(e)&&(e=>{const t=document.getElementById(e.targetId);t&&t.parentElement&&t.parentElement.classList.add("brandboard-container")})(e),ke(e)},adLoaded:e=>{y(e)&&_()},adNoBid:e=>{const{finnBlink:t}=U.get();N(e),(b(e)||E(e)||f(e))&&((e,t)=>{W(void 0,void 0,void 0,function*(){const{deviceType:n}=U.get();if(!t||!le(n))return;yield re(oe);const{replacementConfig:i}=t,r=document.querySelector(`[id^="${e}"]`);if(!r||!(null==i?void 0:i.sizes))return;const{sizes:o}=i,s=fe(e),a=we(s);r.dataset.finnBlinkId=s,r.dataset.noBidAd="true",be(r,a),ne().withFinnBlinkAd(s)})})(e.targetId,t)},adError:(e,t)=>N(t),adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Ie=e=>new URLSearchParams(window.location.search).get(e),Ae=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 me("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const r=e=>{i||(me("Resolving advertising permission value obtained"),i=!0,t(e))},o=setTimeout(()=>{me("Advertising permission timed out, resolving with false"),r(!1)},3e3);window._tcf_.onTcfReady(()=>{me("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);me("Advertising permission value obtained asynchronously: ",e),r(Boolean(t))})}),$e={NO:"no",SE:"se"},Oe="cmp:loaded";let Pe,Le=!1;const xe=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),r=(null==e?void 0:e.timeout)||3e3,o=Ie("bypass_tcf"),s=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(me("TCF bypass param detected, returning consent: true"),!0):(me("TCF is not enabled, returning consent: true"),!0))(i,o))return!0;if(Le)return null;if(!Pe)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Pe.getConsentedToAllSync();return me(`TCF consented to all is: ${t}`),Pe.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(me("Getting TCF consent manager..."),window._tcf_)return me("TCF consent manager is already available"),Pe=window._tcf_,void e(Pe);me("TCF consent manager is not available");const n=()=>{me("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Pe=window._tcf_,e(Pe)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Oe,n),Le=!0,t(new Error("Timeout waiting for CMP to load"))},r);me("Listening for CMP loaded event..."),document.addEventListener(Oe,n,{once:!0})}):Promise.resolve(null),getConsentSync:s,getConsentAsync:()=>W(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return me(`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===$e.SE,o=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===$e.NO;if(i||o)return me("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield Ae(e);if(!(null==e?void 0:e.enabled))return!0;const a=s();return null!==a?a:yield new Promise((e,t)=>{try{if(!Pe)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(()=>{me("TCF isConsentedToAll timed out, resolving with false"),n(!1)},r);Pe.onTcfReady(()=>{me("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Pe.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},Ne=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},je=()=>{const e=Ne("_pulse2data");return e?e.split(",")[2]:void 0},_e=9826;class Me{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=ae.DESKTOP,isMobileApp:t}=U.get();if(t){return{"aa-sch-supply_type":`app_${e===ae.MOBILE?"phone":ae.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return W(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 W(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 je()}getExternalUid(){return W(this,void 0,void 0,function*(){return yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=xe(e,t,n);if(!(yield i()))return;const r=Ne("_pulse2data");return r?r.split(",")[9]:void 0})})}isTrackingForbidden(){return W(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=_e}=U.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}=U.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return W(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=xe(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=U.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}=U.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 qe=new Me;qe.prepare.bind(qe);const De=["aLOLE","xBqQj","1KaqJ","1nzXzK","opm8zV","4qKXKR","Ad9QgE"];function Re(e){return t=window.location.pathname.split("/").slice(-2,-1).pop()||"",De.includes(t)?{"no-sno-news-section":`${e}_doedsfall`}:{};var t}class Be extends Me{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=ae.DESKTOP}=U.get();return{"no-sno-device":this.getPageOptionsFormatDevice(e)}}}getAppTypeKeywords(){const{deviceType:e,isMobileApp:t}=U.get(),{OS:n,isHybridApp:i}=function(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=de();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}(t);return{"no-sno-apptype":n&&e&&i?`${n}_${this.getPageOptionsFormatDevice()}_hybrid`:"none"}}getObituariesKeywords(e){return Re(e)}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=U.get(),r=null!==(t=null===(e=n.keywords["no-sno-news-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan";return{"no-sno-section-page_type":`${r.split("_").pop()||r}_${"article"===i?"article":"front"}`}}}const Fe=864e5,Ve=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return me("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=Fe)=>{const r={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(r))},getByTimestamp:(t,n=Fe)=>{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 me("Error with parsing localStorage data"),null}}}})(),ze="glimrTags",Ue=["glwe_","glwet_"],He={geofenceTags:[],geoTags:[],weatherTags:[]},We=(e,t,n,...i)=>W(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return me(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return me(`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}=xe(e,t,n);return(yield r())?(me(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(me(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Ke=()=>W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield We(e,t,n,"glimr")}const{getConsentAsync:i}=xe(e,t,n);return yield i()}),Ge=()=>W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get();if(!(yield Ke())||!(null==e?void 0:e.enabled))return void me("No consent for glimr data fetching.");const t=yield(n=500,W(void 0,void 0,void 0,function*(){return yield Promise.race([W(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)=>{Ve.setWithTimestamp(ze,{tags:e,tagMappings:t}),n(!0)})})}catch(e){me(`Error during getting glimr data: ${e}`)}else me("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),Je=()=>{const{country:e}=U.get();return e===$e.NO?"no-sno":"se-generic"},Ye=()=>{const{country:e,publisher:t}=U.get();return`${e}-${t}`},Ze={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"},Qe=e=>Ue.some(t=>e.startsWith(t)),Xe=e=>e.startsWith("glgc_"),et=e=>!Qe(e)&&!Xe(e),tt=e=>{const t=nt();if(!t)return He;const n=((e=[])=>e.filter(Qe))(t),i=((e=[])=>e.filter(Xe))(t),r=((e=[],t)=>{const n=e.filter(et);if(t){const{publisher:e}=U.get(),t=Ze[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},nt=()=>{const e=Ve.getByTimestamp(ze);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},it={get:(e,t)=>W(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)=>W(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()})},rt="advertory:ppids-cache",ot={[$e.SE]:`SCH${$e.SE.toUpperCase()}-EnvHash`,[$e.NO]:`SCH${$e.NO.toUpperCase()}-EnvHash`},st={[$e.SE]:`SCH${$e.SE.toUpperCase()}-UserHash`,[$e.NO]:`SCH${$e.NO.toUpperCase()}-UserHash`},at={[$e.SE]:`sch${$e.SE}-envhash-v3`,[$e.NO]:`sch${$e.NO}-envhash-v3`},dt={[$e.SE]:`sch${$e.SE}-userhash-v3`,[$e.NO]:`sch${$e.NO}-userhash-v3`},lt={[$e.SE]:`'sch${$e.SE}-iosid-v3'`,[$e.NO]:`'sch${$e.NO}-iosid-v3'`},ct={[$e.SE]:`sch${$e.SE}-androidid-v3`,[$e.NO]:`sch${$e.NO}-androidid-v3`},ut={[$e.SE]:"sdrn:schibsted.com:user",[$e.NO]:"sdrn:spid.no:user"};class vt{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 pt=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return W(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||me("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:""}},gt=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return W(this,void 0,void 0,function*(){var n,i,r,o,s,a,d,l,c,u,v;const p=Ve.get(rt),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||me("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}}:{});Ve.set(rt,r)}hashPPIDs(e,t){return W(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield it.post(t,n,e)}catch(e){return me("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return W(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>W(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${ut[t]}:${n}`:null}))(t,n),r=yield(e=>W(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}}},ht=e=>W(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:r}=e;if(!(yield We(n,r,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([pt.processPPIDs(t,null==n?void 0:n.timeout),gt.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){me(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),mt=e=>{const{ppid1:t,ppid2:n}=pt.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=gt.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new vt).add(n,ot[e]).add(t,st[e]).add(r,at[e]).add(i,dt[e]).add(o,lt[e]).add(s,ct[e]).buildEids()}]}},yt=e=>{const{ppid1:t,ppid2:n}=pt.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=gt.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new vt).add(n,ot[e]).add(t,st[e]).add(r,at[e]).add(i,dt[e]).add(o,lt[e]).add(s,ct[e]).buildRyEids()}}]}}};const ft=new class extends Be{prepare(e){return W(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({},this.getCountryCodeKeywords($e.NO)),this.getInventoryTypeKeywords()),this.getPublisherKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),this.getPageTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get(),{addPublisherToGeo:t}={},n=yield Ke();if(!(null==e?void 0:e.enabled)||!n)return me("No consent for getting glimr tags."),{};const i=Je(),r=tt(t);return{[`${i}-geo`]:r.geoTags,[`${i}-weather`]:r.weatherTags,[`${i}-geofence`]:r.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=pt.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({},mt($e.NO)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var wt=ft.prepare.bind(ft);const bt=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},Et={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"},Tt={[Et.VG]:["board","netboard","backfill","outstream"],[Et.AFTONBLADET]:["panorama","outstream"],[Et.GODARE]:["panorama","outstream"],[Et.SVD]:["wph-article-panorama","wph-front-panorama"]},kt=e=>{var t;const{publisher:n}=U.get();return!!Tt[n]&&!!(null===(t=Tt[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},St=()=>(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),Ct=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),It=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=U.get(),r=[`${Je()}-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)}},At=(e,...t)=>W(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)}))}),$t=e=>e.includes("snoap.no"),Ot=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)},Pt=(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()},Lt=Pt([],()=>{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}),xt=e=>{const t=Pt([],()=>{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},Nt=[],jt={},_t=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=qt(e);n?(Mt(i,n),Dt(e,i,t)):(Mt(i,n),Rt(e,i,t))})},Mt=(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}`,"*")},qt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},Dt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),Nt.includes(t)||Nt.push(t),n&&window.addEventListener("scroll",jt[t],{passive:!0})},Rt=(e,t,n)=>{Nt.includes(t)&&(n&&window.removeEventListener("scroll",jt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Bt=(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&&Ft(e,o,r,0),s.length&&Ft(e,s,r,40)}},Ft=(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()})},Vt={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"}};let zt=null;const Ut=(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=`(${Lt})()`,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($t(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=xt(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>$t(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)),$t(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)),Ot(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},Ht=()=>{zt=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`)},Wt=()=>{zt||(zt=window.requestAnimationFrame(Ht))},Kt=(t,n)=>{var i,r,o,s;const{country:a}=U.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=>_t(e,n),{}),r=qt(e);i.observe(e),n&&(jt[r]=Bt(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",Vt[a].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),Wt(),window.addEventListener("resize",Wt),null===(o=window.visualViewport)||void 0===o||o.addEventListener("resize",Wt),null===(s=window.visualViewport)||void 0===s||s.addEventListener("scroll",Wt)},Gt=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=Ot(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=Ot(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ut(t,e))},Jt=()=>W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:r}=U.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=U.getHandlers(),{getConsentAsync:s}=xe(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=St(),{prebid:{relevantCbTimeout:o}={}}=U.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=St(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=St();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Ct();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return me("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=Ct();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=a?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};me("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},yt(n)),It(p,v))),me("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},yt(n)),It(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=>{Yt(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)&&(Kt(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))}}),me("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=>{Yt(e,o)},directRenderFn:()=>{}})})}),Yt=(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},U.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")};let Zt="";const Qt=new Map,Xt=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`)},en=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=G.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},tn=()=>{Z();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{ee(e.id),en(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=fe(e.id)}),P(()=>window.apntag.clearRequest())},nn="noGroupedPlacements",rn=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},on=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},sn=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}=U.get(),o=n[r].filter(on)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=rn(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=an(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=$[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&&G.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}=U.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Zt!==window.location.pathname&&(Qt.clear(),Zt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Qt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${Ye()}-count`]=i,Qt.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)},an=(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},dn=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=U.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=fe(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(fe(e.id)));return n})(e,i),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(fe(e.id))))(e,new Set([...a,...r]));return Object.assign(Object.assign(Object.assign({},s),o),{[nn]:d})},ln=(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])}},cn=["netboard","board"];class un{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 W(this,void 0,void 0,function*(){var t,n;const i=yield this.identityFacade.getIdentityUser(),r=null!==(n=yield null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId())&&void 0!==n?n:"",o=(null==i?void 0:i.userId)?String(i.userId):"",s=this.buildUrl(e,{envId:r,spid:o});try{me("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield it.get(s,e);return me("Fetch operation completed successfully."),t}catch(e){me("Error during fetch operation:",e)}return null})}}let vn=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 W(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 pn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):me("Dr. Edition container does not have a parent element, cannot remove height lock.")};class gn{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return W(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 me(`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?(me("No Dr. Edition ads available to render. Collapsing whole placement."),ee(e.id),void pn(s)):((null==a?void 0:a.itemId)&&o&&(me("Dr. Edition ad available to render as a Xandr backfill."),te(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),pn(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)):pn(s))):(me("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(e),void pn(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:"";te(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 hn{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return W(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=xe(n.tcf,n.isMobileApp,n.country),r=yield i(),o=le(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 mn{constructor(e){this.strategy=e}handle(e,t){return W(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 W(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield At(t)}catch(e){me("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return W(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 yn=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 W(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 W(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 fn extends yn{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 wn=class extends yn{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"}}};const bn={FRONT:"front",ARTICLE:"article",OTHER:"other"},En=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},Tn=e=>W(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)))}))}),kn={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 W(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Bo})})}})}},Sn=(e,t)=>{null==e||e.forEach(e=>{kn[e](t)})};class Cn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){yield W(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);Sn(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 Tn(d);l.once("assetReady",()=>{En(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",()=>W(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===bn.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 In="https://www.aftonbladet.se/video-player-extras/latest/";class An{handleVideo(e,t){return W(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:{[`${In}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${In}external-link.js`]:{name:"ExternalLink"}}};yield Tn(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""}}const $n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class On{handleVideo(e,t){return W(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({},$n(e)?e:{}),{provider:Object.assign(Object.assign({},$n(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 Tn(s);a.once("PulseStats:ready",()=>W(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===bn.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Pn=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const Ln=(e,t,n)=>{var i;const{publisher:r,pageType:o,country:s}=e,a={[Et.VG]:new vn,[Et.E24]:new Cn,[Et.AFTONBLADET]:new An,[Et.SVD]:new On}[r]||new Pn,d=new(s===$e.SE?fn:wn)(n,a,o),l=new un(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new hn(a,d),u=new mn(a);return new gn(l,c,u,d)},xn=()=>W(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 Nn{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 W(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 me("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return W(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 jn=(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=Ln(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))},_n=[],Mn=(e,t)=>W(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 We(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=fe(t.targetId),d=s.find(e=>e.id===a),l=cn.some(e=>a.startsWith(e)),c=_n.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(_n.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 me("Pulse has not been passed as a prop, aborting");const v=yield xn(),p=new Nn(v),g=Ln({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)}),qn="collapseAd",Dn="hideAd",Rn="resizeAd",Bn="renderDrEditionFallback",Fn="wallpaperImageUrl",Vn="wallpaperColor",zn="velvet",Un=[Rn,Fn,Vn,qn,Dn,Bn,zn];let Hn;const Wn=e=>{if("object"==typeof e)return e;if(t=e,X.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:Fn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:Vn,wallpaperColor:t}}if(e.startsWith(Bn)){const t=e.split(":")[1];return{name:Bn,targetId:t}}if(e.startsWith(qn)||e.startsWith(Dn)){const t=e.split(":")[1];return{name:qn,targetId:t}}if(e.includes("name")&&Un.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},Kn=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=Wn(t);if(!n)return;if(!n.name||!Un.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;i===zn&&a&&(a.includes("noScroll")&&(Hn=(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==Hn||Hn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==qn&&i!==Dn||!r||ee(r),i===Rn&&r&&a&&ln(r,a),i===Bn&&r&&(ee(r),Mn(U.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&ln(r,d,!0),i===Fn&&o&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===Vn&&s&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundColor=e)})(s)},Gn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Jn=(e,t)=>{if(w(t))return me(`loading finn blink ad with full ads chain for ${t}`),void ne().withFullAdsChain(t);P(()=>(me("core showTag",{id:t}),e.showTag(t)))},Yn=(e,t)=>W(void 0,void 0,void 0,function*(){yield L,yield x;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);me("core log from intersection observer handler",{targetId:r,element:o}),n(window.apntag,r),o&&(t.unobserve(o),t.disconnect())})})(e,t,Jn),Gn(t));n.observe(e)}),Zn=new Map,Qn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Xn=".brandstudio-premium-content-widget",ei=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),ti=({adWrapper:e,placementContainer:t})=>{const n=ei({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),en(i=t),i.innerHTML=""},ni=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},ii=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=U.get(),i=Qn.includes(n)&&Boolean(t.closest(Xn));const r=i?t.closest(Xn):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 ni(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=r;a&&d.contains(a)?ni(a):d.hasAttribute("style")&&ni(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},ri=(e,t,n,i,r,o)=>{var s;const a=performance.now(),d=null!==(s=Zn.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;a-d>=r&&l&&(Zn.set(t,a),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&ti({adWrapper:i,placementContainer:n}),P(()=>{e.setKeywords([t],{[`${Je()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},oi=(e,t,n,i)=>{const r=new IntersectionObserver((e,t)=>((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,ri,n,i),Gn(t));r.observe(e)},si=(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},ai=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},di=(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;ii({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,s=(new Date).getTime();if(i&&"true"!==i.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:i}=U.get(),r=null==i?void 0:i[n];return((e,t)=>t[e])(null!==(t=e.dataset.priority)&&void 0!==t?t:"normal",(({high:e,normal:t,low:n}={})=>{var i,r,o,s,a,d;return{high:{refreshMargin:null!==(i=null==e?void 0:e.refreshMargin)&&void 0!==i?i:600,renderMargin:null!==(r=null==e?void 0:e.renderMargin)&&void 0!==r?r:300},normal:{refreshMargin:null!==(o=null==t?void 0:t.refreshMargin)&&void 0!==o?o:300,renderMargin:null!==(s=null==t?void 0:t.renderMargin)&&void 0!==s?s:150},low:{refreshMargin:null!==(a=null==n?void 0:n.refreshMargin)&&void 0!==a?a:100,renderMargin:null!==(d=null==n?void 0:n.renderMargin)&&void 0!==d?d:50}}})(r)).refreshMargin})(i);i.dataset.subscribedForRefresh="true",i.dataset.refresh&&oi(i,e,s,o)}},li=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=U.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),gi(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},ci=(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;ai(r,o)&&i&&(Xt(i.id),n.length&&r.classList.remove(...n),gi([i],t))}},ui=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=U.get();t&&(e.forEach(({id:e})=>{const t=vi(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{ci(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),ci(e,!1,t))};n.persisted&&(Ee()?window.addEventListener("scroll",i,{passive:!0}):ci(e,!1,t))})})(e,n))},vi=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},pi=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(vi(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},gi=(e,t=!1)=>{const{requestSize:n=V}=U.get(),i=e.map(({id:e})=>e),r=si(i,n);if(t)for(const t of e){const e=pi(t);window.apntag.modifyTag(t.id,e)}for(const e of r)P(()=>window.apntag.refresh(e))};const hi="#fff",mi="#0098da",yi="splash",fi="welcomePage",wi="topscroller",bi="velvet",Ei="takeover-displayed",Ti="takeover-visit-count",ki=14400,Si=()=>{const e=Ne(Ti);return e?parseInt(e):0},Ci=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=U.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=U.get().takeover)||void 0===e?void 0:e.cookieCapName)||Ei;return"true"===Ne(t)})())&&(!t||Ii()))},Ii=()=>{const e=Si();return 0===e?((()=>{const e=Si(),{takeover:{cookieCapTime:t=ki}={}}=U.get(),n=document.location.hostname;window.document.cookie=`${Ti}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},Ai=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),$i=()=>{const{takeover:e}=U.get();return Boolean(null==e?void 0:e.topscroller)},Oi=()=>W(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=Ei,cookieCapTime:n=ki}={},isMobileApp:i,tcf:r,country:o}=U.get(),s=yield We(r,i,o,"ad-takeover-cookiecap");n&&s&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),Pi=e=>{var t;const n=!!(null===(t=U.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},Li=(e,t)=>{var n;if(t===wi){const{topscroller:t}=e;return null!=t?t:{}}if(t===yi){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},xi=(e,t)=>{t!==yi?(e=>{var t,n,i;const r=null===(n=null===(t=U.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=U.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=U.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)},Ni=Pt([],()=>{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})}),ji=(e,t=!0)=>{(e===fi||e===wi)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},_i=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},Mi=e=>{document.body.style.overflow=e?"initial":"hidden"},qi=e=>{const t=Ri(e),n=Di(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),Mi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},Di=e=>{const t=()=>qi(e);return window.addEventListener("advertory:closeTakeover",t),_i(),t},Ri=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&qi(e)};return _i(),window.addEventListener("keydown",t),t},Bi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(Ri(e),Di(e),_i(),t.addEventListener("click",()=>{qi(e)}),Mi(!1))},Fi=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),Di(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},Vi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>qi(e))})(e)},zi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=U.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=Vt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Ui=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=Vt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Hi=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=Vt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Wi=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},Ki=()=>{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)},Gi=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${Ni})()`,e+t.outerHTML})(e)),n},Ji=e=>{const t=(e=>{const{requests:t}=window.apntag,n=Ot(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=Ot(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Gi(t))},Yi=e=>W(void 0,void 0,void 0,function*(){const{takeover:t}=U.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 Ai(t,n)?yi:A(e,o)?bi:$i()?wi:fi})(e),a=r.offsetHeight,d=window.scrollY>a;r.style.display="block",!d&&ji(s,!1),((e,t)=>{({[fi]:Hi,[yi]:zi,[wi]:Ui,[bi]:Wi})[t](e)})(r,s),Ki(),((e,t)=>{({[fi]:Fi,[wi]:Fi,[yi]:Bi,[bi]:Vi})[t](e)})(r,s),((e,t,n)=>{if(!n)return;({[fi]:()=>{const{buttonLabel:i}=Li(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:"")})},[yi]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:s}=Li(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:hi,"important"),n.style.color=null!=t?t:mi}}})},[wi]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=Li(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:""))})},[bi]:()=>{}})[t]()})(r,s,t),yield Oi(),!d&&ji(s,!0),xi(e,s)}),Zi="advertory-brandmetrics-survey",Qi=()=>W(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=U.get(),r=yield We(i,n,t,"norstat");if(!e||n||!r)return;const o=(e=>{const{ppid1:t,ppid2:n}=pt.getPPIDs(),{ppid1:i,ppid2:r}=gt.getPPIDs(),o=(new vt).add(n,ot[e]).add(t,st[e]).add(r,at[e]).add(i,dt[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{W(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===$e.NO?"schibsted":"schibstedse"}/map/${o}`,"norstat")}),Xi={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&&$i(),splash:e=>p(e)&&Ai(e.width,e.height),welcomePage:p,wallpaper:h,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:C,hFormat:I,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!I(e)&&!C(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:S,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>f(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!k(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>b(e)||E(e),panorama:T,midboard:k},er=({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(Xi))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)},tr=e=>{var t;return(null===(t=Object.entries(Xi).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},nr=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},ir=new Map;ir.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),ir.set("panorama",{scale:.79,transformOrigin:"center center"}),ir.set("outstream",{scale:.79,transformOrigin:"center center"}),ir.set("integration",{scale:.79,transformOrigin:"center center"}),ir.set("toppanorama",{scale:.8,transformOrigin:"left center"});const rr=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=tr(e),r=ir.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")},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}=U.get(),r=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${Ye()}-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,resizeAdParentDiv:p=!1,dynamicSizeWidthCheck:g=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Ci())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!==wi),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),h=Object.assign({invCode:l,sizes:s,targetId:o,keywords:or(a,c),allowedFormats:d,resizeAdParentDiv:p,dynamicSizeWidthCheck:g},v&&{safeframeConfig:v}),m=(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)?(me("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):(me("Tracker state does not contain field pageViewId or it is empty"),""):(me("Tracker state is empty"),""):(me("Tracker is not configured in initAdvertory function"),"")})(i);n&&m&&(me("External Impression ID assigned to defineTag:",sr(m)),h.externalImpId=sr(m));const y=(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"))&&(h.native=y),h},dr=e=>!e.includes("takeover")||Ci(),lr=e=>{const{publisher:t=""}=U.get(),n=document.querySelector(`#${e}`);if(!n)return;const i=`-${t}`;n.classList.remove(`advertory${i}-finn-blink`),n.classList.remove(`advertory${i}-finn-blink-wrapper`)},cr=e=>{if(!e)return e;const t=e[`${Je()}-targetid`],n=t?fe(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Je()}-targetid`]:[n]})},ur=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Je()}-geo`]&&{[`${Je()}-geo`]:["geo-test-value"]}),e[`${Je()}-geofence`]&&{[`${Je()}-geofence`]:["geofence-test-value"]}),e[`${Je()}-weather`]&&{[`${Je()}-weather`]:["weather-test-value"]}),vr=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"})})()},pr=(e,t)=>W(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),gr={arrayMerge:(e,t)=>t},hr=e=>W(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=>W(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 it.get(t,{method:"GET",signal:n.signal})}catch(e){throw me("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=R.all([e.placements,o],gr),l=R(e.pageOptions,{keywords:i},gr),c=R(e.appearanceConfig,{defaultThreshold:s},gr),u=R(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 me("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 kr=!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 Cr{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class Ir{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 W(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 W(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 Ar extends Ir{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 $r="[data-k5a-teaser-analytics]",Or=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const r=new Ar(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($r);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($r);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 Pr{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const i={[Et.VG]:new Sr}[n]||new Cr;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&&(me(`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:"";te(i)}loadKilkayaScript(e){return W(this,void 0,void 0,function*(){yield At(e)})}run(e){return W(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 We(t,n,i,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(r.url),this.handleKilkayaStreamTracking(e))})}}const Lr=e=>{var n,i,r,o,s,a;const{adScaleConfig:d,deviceType:l}=U.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=rn(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;((e,t=window.screen.width)=>{const n=nr(e,t),i=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);i&&(i.style.transform=`scale(${n})`,i.style.transformOrigin="left top")})(e,(g<h?g:h)-v)},xr=1e4,Nr=e=>e.some(e=>e.some(e=>!!e&&ai(e,0))),jr=()=>{const{widescreenSwitching:e}=U.get(),{enabled:t,rotationInterval:n=xr,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const r=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=U.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=Nr(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=Nr(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 _r,Mr=[];const qr=["takeover","wallpaper"],Dr=e=>{const t=(e=>{const t=G.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:s,requestSize:a=V,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=()=>W(void 0,void 0,void 0,function*(){const{pageOptions:e}=U.get(),{preparePageOptions:t}=U.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=U.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 W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();return(yield We(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=G.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=ur(e);G.setData("alertoryConfigKeywords",n)})(r.keywords),P(()=>_r.setPageOpts(r))}),Br=e=>W(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:r}=U.get();Fr(e);const o=yield We(n,i,r,"prebid");(null==t?void 0:t.enabled)&&o?(me("core loadPlacements prebid enabled"),yield Jt()):(me("core load tags invoked without prebid enabled"),Vr(e))}),Fr=e=>{const{prepareTag:t}=U.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=>{me("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:cr(i),sizes:r}})(r);n.push(o),P(()=>(me("core defineTag - add to the queue",{placement:e,preparedTag:r}),_r.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&&P(()=>(me("core loadTags",{placementsIdsToLoad:t}),_r.loadTags([...t])))},zr=(e,t)=>W(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=U.get(),{threshold:r,refresh:o,priority:s="normal"}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),d=null==n?void 0:n.defaultThreshold[i];a&&(me("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:r,deviceDefaultThreshold:d}),yield Yn(a,null!=r?r:d)),a&&o&&(me("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=o.toString(),a.dataset.priority=s)}),Ur=e=>e.some(({id:e})=>qr.some(t=>e.includes(t))),Hr=e=>W(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{requestSize:n=V}=U.get(),i=dn(e);for(const e of Object.keys(i)){const t=i[e],r=si(t,n);for(const e of r)Ur(e)?(me("core loadAds without lazy loading",{placementsToLoad:e}),yield Br(e)):e.length&&(me("core loadAds with lazy loading",{placementsToLoad:e}),yield Wr(e))}}),Wr=e=>W(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=U.get(),i=[];if(!t)return me("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=>{me("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),me("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&&(me("lazy loading - observe element",{placementId:e.id,element:t}),r.observe(t))})}),Kr=()=>W(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:i,adjustAdToHorseshoe:r}}=U.getHandlers(),{wallpaper:o,fullscreenScroll:s}=U.get(),a=[];P(()=>{_r.onEvent("adRequested",()=>{e.adRequested()}),_r.onEvent("adAvailable",n=>W(void 0,void 0,void 0,function*(){var r,a,d,l,v,g;me("core adAvailable start",{placementsAvailable:Mr,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:Te(n),isTakeoverAd:p(n),isCollapseAd:m(n),isWallpaperAd:h(n)});const y=null===(d=null===(a=null===(r=null===window||void 0===window?void 0:window.apntag)||void 0===r?void 0:r.requests)||void 0===a?void 0:a.tags[n.targetId])||void 0===d?void 0:d.adResponse.ads;Te(n)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(n.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(n)&&Gt(n),S(n)&&jr(),c(n)&&!w(n.targetId)&&Kt(n,s),!u(n)||Te(n)||w(n.targetId)||t(n,U.get()),p(n)&&!m(n)&&(Ji(n.targetId),yield Yi(n)),h(n)&&(i(()=>P(()=>window.apntag.showTag(n.targetId)),o),G.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(n)&&G.setData("horseshoe",{isAvailable:!0}),er({adObj:n}),(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)})(n),e.adAvailable(n);const f=Mr.find(({id:e})=>e===n.targetId);f&&(yield zr(f,n),Mr=Mr.filter(e=>e.id!==f.id)),me("core adAvailable stop",{placementsAvailable:Mr,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:Te(n),isTakeoverAd:p(n),isCollapseAd:m(n),isWallpaperAd:h(n)})})),_r.onEvent("adLoaded",i=>{const{refreshConfig:o,appearanceConfig:s}=U.get(),d=document.getElementById(i.targetId);w(i.targetId)&&(e=>{const{fullscreenScroll:t}=U.get(),{initNativeAd:n}=U.getHandlers();c(e)&&Kt(e,t),u(e)&&n(e,U.get())})(i);a.includes(i.targetId)&&u(i)&&(t(i,U.get()),er({adObj:i})),!a.includes(i.targetId)&&Te(i)&&a.push(i.targetId),m(i)&&ee(i.targetId),p(i)&&((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"]})})(_r,i.targetId),v(i)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=U.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`))})(i),(e=>A(e,n))(i)&&(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}={}}=U.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=nr(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"})(i),di(i,o),(null==s?void 0:s.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(i.targetId);var l,g;G.getData("horseshoe").isAvailable&&r(i.targetId),Lr(i),e.adLoaded(i),l=i.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${l}`)&&(null===(g=window.gdpr)||void 0===g?void 0:g.setupButton)&&window.gdpr.setupButton(l),d&&(d.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=U.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")})(d)),rr(i),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:i.targetId,adFormat:tr(i)}}))}),_r.onEvent("adNoBid",t=>W(void 0,void 0,void 0,function*(){ee(t.targetId),yield Mn(U.get(),t),Pi(t)&&(yield Oi()),e.adNoBid(t)})),_r.onEvent("adError",(t,n)=>W(void 0,void 0,void 0,function*(){Pi(n)&&(yield Oi()),e.adError(t,n)})),_r.onEvent("adCollapse",()=>{e.adCollapse()}),_r.onEvent("adRequestFailure",t=>{ee(t.targetId),e.adRequestFailure(t)}),_r.onEvent("adBadRequest",t=>{ee(t.targetId),e.adBadRequest(t)}),_r.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),_r.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Gr=(e,t)=>W(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 tn(),[];r&&(tn(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{te(e.id)})),H(null!=e?e:{}),yield Rr();let a=sn(s);return o&&(a=a.filter(e=>w(e.id))),a.length>0&&(Mr=[...Mr,...a.map(e=>Object.assign({},e))],li(a),ui(a),yield Hr(a)),Mr}),Jr=(e,t)=>W(void 0,void 0,void 0,function*(){var n;U.set(e),U.setHandlers(t),G.initialize(),window.addEventListener("message",Kn,!1),_r=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=_r,me("Apn tag is set up on window"),yield Promise.allSettled([W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();(yield We(e,t,n,"xandr-endpoint"))||_r.setEndpoint("ib.adnxs-simple.com",!0)}),W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=U.get(),r=yield We(t,n,i,"prebid");(null==e?void 0:e.enabled)&&r&&(yield At(null==e?void 0:e.url))}),ht(e),W(void 0,void 0,void 0,function*(){const{astUrl:e}=U.get();yield At(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),W(void 0,void 0,void 0,function*(){const{gptUrl:e}=U.get();yield At(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),W(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:r}=U.get(),{getConsentAsync:o}=xe(n,i,r),s=yield o();if(e&&t&&s){if(yield At(t),document.querySelector(`.${Zi}`))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(Zi)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),Ge(),W(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=U.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield At(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Qi(),me("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,W(void 0,void 0,void 0,function*(){const e=n.map(e=>At(e));yield Promise.all(e)})),yield Kr(),yield Rr(),me("Page options have been set"),Dr(e),me("Advertory is setup on window"),Mr=sn(),li(Mr),ui(Mr),yield Hr(Mr),me("Ads has been loaded",Mr),vr(Mr),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>W(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield We(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield xn(),i=new Nn(n);jn({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)||kr)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=mr}=e,r=document.querySelector(i);if(!r)return;kr=!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=>W(void 0,void 0,void 0,function*(){const t=new Pr;yield t.run(e)}))(e)}),Yr=(e,t)=>W(void 0,void 0,void 0,function*(){yield((e,t)=>W(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=xe(e.tcf,e.isMobileApp,e.country),r=yield hr(e);yield ye(),yield pr(n),yield pr(i),me("TCF resolved successfully"),yield Jr(r,t),me("Run function resolved successfully")}))(e,t)}),Zr="native_override_desc2",Qr=(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)},Xr=(e,t)=>{const n=(i=Zr,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(Zr),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},eo=(e,t)=>{const n=document.querySelector(`#${t}`);if(n)for(const t of Object.keys(e))n.style.setProperty(t,e[t])},to=(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(Et).includes(i);n&&o&&se(i,e,he,r)})(r,n),i())},no=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:[])so(i)}),t.dataset.tracked="true")})},io=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(oo):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},ro=(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:ae.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,io(e),c.disconnect();break}},d);c.observe(r)},oo=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?so(e):window.navigator.sendBeacon(e)},so=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},ao=(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=Xr(e.targetId,l))&&void 0!==i?i:c,v=Vt[t.language||$e.NO],p=Qr(a,v,d);return(a.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);to(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{no(e),ro(e,t)})(e,t)})},lo="viewable",co="adClick";var uo=e=>(t,n,i)=>{const{video:r,img:o,url:s}=t,{publisher:a,productTag:d}=n,{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=vo(r.content,s),h=po({id:u,nodeId:p,poster:v,tagURL:g,publisher:a,productTag:d,videoLoop:c});return go({playerConfig:h,clickUrl:s,pluginsNames:l}),`${e(t,n,p)}`};const vo=(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"}))},po=({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({},$n(e)?e:{}),{provider:Object.assign(Object.assign({},$n(null==e?void 0:e.provider)?e.provider:{}),{productTag:o})})}}),go=e=>W(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:r}=t,o=yield Tn(t);Sn(n),o.once("assetReady",()=>{En(o,n)}),o.on(lo,e=>{const{viewable:t}=e;t?o.play():o.pause()}),o.on(co,()=>{window.open(i,"_blank")}),r&&o.on("pause",()=>{o.play()})}),ho=(e,t,n)=>{const i=e===bn.ARTICLE||e===bn.OTHER?.79:1;return{desktopTitleSize:t?Number(t)*i+"px":"clamp(22px, 3.6rem, 59px)",mobileTitleSize:n?`${n}px`:"clamp(22px, 3.6rem, 59px)"}},mo={0:633,1:395,2:562,3:541,4:630,5:549,6:596,7:493,8:579,9:596,A:702,B:651,C:644,D:724,E:598,F:560,G:690,H:773,I:356,J:344,K:680,L:576,M:897,N:714,O:725,P:618,Q:725,R:675,S:555,T:610,U:710,V:703,W:1004,X:745,Y:684,Z:608,"Æ":906,"Ø":727,"Å":702,a:541,b:595,c:479,d:612,e:480,f:383,g:528,h:629,i:322,j:303,k:603,l:315,m:916,n:636,o:563,p:607,q:595,r:481,s:445,t:367,u:632,v:573,w:815,x:586,y:574,z:540,"æ":743,"ø":569,"ö":563,"å":541,"ä":541,"é":480,"è":480,"(":343,")":343,"«":567,"»":567,".":253,",":257,"!":259,"?":446,"¿":441,"*":410,"&":783,"-":334,"–":545,":":276,";":278,"%":744,$:549,"€":722,"#":519,"+":600,"=":600,'"':389,"'":202,"`":347,"’":237,"\\":395,"/":395,"@":844," ":181,"­":0},yo=(e,t)=>{const n={"É":"E","é":"e","ü":"u"," ":" "};return[...e].reduce((e,i)=>e+(mo[n[i]||i]||mo.m)*t/1e3,0)},fo=(e,t,n=12,i=300)=>{let r=n,o=i,s=n;for(;r<=o;){const n=Math.floor((r+o)/2);yo(e,n)<=t?(s=n,r=n+1):o=n-1}const a=((e,t,n,i)=>{const r=Math.floor(e/t*(n-2));return r<i?i:r})(s,yo(e,s),t,n);return{fontSize:a,content:e}},wo=(e,t)=>{const[n,i]=(e=>{const t=e.trim().split(/\s+/);if(t.length<=1)return[e,""];let n=[e,""],i=1/0;for(let e=1;e<t.length;e++){const r=t.slice(0,e).join(" "),o=t.slice(e).join(" "),s=Math.abs(r.length-o.length);s<i&&(i=s,n=[r,o])}return n})(e);return[fo(n,t),fo(i,t)]},bo=({title:e,options:t})=>{if(!t)return e;const{pageType:n,appearanceConfig:{mainColumnWidth:i}={}}=t,r=n===bn.ARTICLE||n===bn.OTHER?"em":"rem";return wo(e,(i||734)-64).map(({content:e,fontSize:t})=>`<span style="display: block; font-size: ${`${(t||16)/16}${r}`}">${e}</span>`).join("")},Eo=({containerId:e,url:t,adContent:n,logo:i,description:r,title:o,customTitle1:s,customTitle2:a},d,l)=>{const{desktopTitleSize:c,mobileTitleSize:u}=ho(null==d?void 0:d.pageType,s,a),v=bo({title:o,options:d});return eo({"--desktopTitleSize":`${c}`,"--mobileTitleSize":`${u}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${o}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${null!=l?l:0}"></div>\n </div>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-text-container">\n <div class="ad-description">${r}</div>\n <h2 class="ad-title">\n ${v}\n </h2>\n </div>\n </a>\n </div>\n </div>\n </div>\n </article>`},To=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:r,title:o},s,a)=>`<article class="advertory-vg-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>`,ko=({containerId:e,adText:t,url:n},i,r)=>{return`<article class="advertory-vg-ad-native-ukesmeny-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${o=t,o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${r}"></div>\n </div>\n <a class="ad-link" href="${n}" target="_blank"></a>\n </div>\n </div>\n </article>`;var o},So=["IntegrationMenu"],Co={CONTENT:(e,t)=>{const{video:n}=e;return(null==n?void 0:n.content)?uo(Eo)(e,t):(({containerId:e,url:t,adContent:n,logo:i,imgAltText:r,img:o,description:s,title:a,customTitle1:d,customTitle2:l,imgWidth:c,imgHeight:u},v)=>{const{desktopTitleSize:p,mobileTitleSize:g}=ho(null==v?void 0:v.pageType,d,l),h=c?`width="${c}"`:"",m=u?`height="${u}"`:"",y=bo({title:a,options:v});return eo({"--desktopTitleSize":`${p}`,"--mobileTitleSize":`${g}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${a}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <img alt="${r}" class="ad-image" src="${o}" loading="lazy" ${h} ${m} />\n </div>\n <div class="ad-text-container">\n <div class="ad-description">${s}</div>\n <h2 class="ad-title">\n ${y}\n </h2>\n </div>\n </div>\n </a>\n </article>`})(e,t)},INHOUSE:({containerId:e,url:t,title:n,img:i,logo:r,sponsoredBy:o,imgWidth:s,imgHeight:a})=>`<article class="advertory-vg-ad-native-inhouse flexible">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${s?`width="${s}"`:""} ${a?`height="${a}"`:""} />\n ${r&&`<img alt="${o}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">\n <span class="sponsor-name">${o}</span>${o?"- En tjeneste fra VG":""}\n </span>\n <span class="ad-title">${n}</span>\n </div>\n </div>\n </a>\n </article>`,SPONSORSTRIPE:e=>(()=>{if(!ce())return!1;const e=CSS.supports("backdrop-filter: blur(20px)")||CSS.supports("-webkit-backdrop-filter: blur(20px)"),t=CSS.supports("-apple-visual-effect: -apple-system-glass-material");return e||t})()?(({title:e,sponsoredBy:t,logo:n})=>`\n <article class="advertory-vg-ad-native-sponsorstripe-liquidglass">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info"> <button id="sponsorstripe-info-close-button" aria-label="Lukk">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <g clip-path="url(#clip0_115_48295)">\n <path d="M10 19.3741C15.1777 19.3741 19.375 15.1768 19.375 9.99915C19.375 4.82148 15.1777 0.624146 10 0.624146C4.82233 0.624146 0.625 4.82148 0.625 9.99915C0.625 15.1768 4.82233 19.3741 10 19.3741Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6.25 13.7491L13.75 6.24915" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M13.75 13.7491L6.25 6.24915" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n <defs>\n <clipPath id="clip0_115_48295">\n <rect width="20" height="20" fill="white"/>\n </clipPath>\n </defs>\n </svg> \n </button>\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a class="ad-info-link" href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232">\n Les mer\n </a>\n </p>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-info-open-button" aria-label="Sponset innhold - Klikk for detaljer">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <g clip-path="url(#clip0_115_48287)">\n <path d="M11.25 14.375C10.2158 14.375 9.375 13.5342 9.375 12.5V9.375H8.75C8.405 9.375 8.125 9.095 8.125 8.75C8.125 8.405 8.405 8.125 8.75 8.125H9.375C10.0642 8.125 10.625 8.68583 10.625 9.375V12.5C10.625 12.845 10.905 13.125 11.25 13.125H11.875C12.22 13.125 12.5 13.405 12.5 13.75C12.5 14.095 12.22 14.375 11.875 14.375H11.25Z" fill="white"/>\n <path d="M9.6875 6.875C10.2053 6.875 10.625 6.45527 10.625 5.9375C10.625 5.41973 10.2053 5 9.6875 5C9.16973 5 8.75 5.41973 8.75 5.9375C8.75 6.45527 9.16973 6.875 9.6875 6.875Z" fill="white"/>\n <path d="M10 20C4.48583 20 0 15.5142 0 10C0 4.48583 4.48583 0 10 0C15.5142 0 20 4.48583 20 10C20 15.5142 15.5142 20 10 20ZM10 1.25C5.175 1.25 1.25 5.175 1.25 10C1.25 14.825 5.175 18.75 10 18.75C14.825 18.75 18.75 14.825 18.75 10C18.75 5.175 14.825 1.25 10 1.25Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_115_48287">\n <rect width="20" height="20" rx="10" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`)(e):(({title:e,sponsoredBy:t,logo:n})=>`<article class="advertory-vg-ad-native-sponsorstripe">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info">\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a\n href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232"\n class="ad-info-link"\n >\n Les mer\n </a>\n </p>\n <button id="sponsorstripe-info-close-button" aria-label="Lukk">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M6.91075 11.9107L8.8215 9.99999L6.91075 8.08925C6.58532 7.76381 6.58532 7.23618 6.91075 6.91074C7.23619 6.5853 7.76383 6.5853 8.08926 6.91074L10 8.82148L11.9108 6.91074C12.2362 6.5853 12.7638 6.5853 13.0893 6.91074C13.4147 7.23618 13.4147 7.76381 13.0893 8.08925L11.1785 9.99999L13.0893 11.9107C13.4147 12.2362 13.4147 12.7638 13.0893 13.0892C12.7638 13.4147 12.2362 13.4147 11.9108 13.0892L10 11.1785L8.08926 13.0892C7.76383 13.4147 7.23619 13.4147 6.91075 13.0892C6.58532 12.7638 6.58532 12.2362 6.91075 11.9107Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </button>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-open-button" aria-label="Sponset innhold - Klikk for detaljer">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M10 5.83333C9.53977 5.83333 9.16668 6.20642 9.16668 6.66666C9.16668 7.1269 9.53977 7.49999 10 7.49999C10.4602 7.49999 10.8333 7.1269 10.8333 6.66666C10.8333 6.20642 10.4602 5.83333 10 5.83333Z"\n fill="white"\n />\n <path\n d="M9.16668 9.16666C9.16668 8.70642 9.53977 8.33333 10 8.33333C10.4602 8.33333 10.8333 8.70642 10.8333 9.16666V13.3333C10.8333 13.7936 10.4602 14.1667 10 14.1667C9.53977 14.1667 9.16668 13.7936 9.16668 13.3333V9.16666Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`)(e),UKESMENY_SPONSORSTRIPE:({containerId:e,sponsoredBy:t,url:n,logo:i,title:r,customTitle1:o,customTitle2:s},{appearanceConfig:a})=>{const{isDarkModeEnabled:d}=null!=a?a:{},l=o?`${o}px`:"clamp(10px, 2rem, 30px)",c=s?`${s}px`:"clamp(10px, 1.8rem, 30px)",u=((e=":export{}")=>{const[,t]=e.split(":export{"),n=t.slice(0,-1).split(";").map(e=>e.split(":"));return Object.fromEntries(n)})(),v=d?u["c-white-primary"]:u["c-brown-primary"];eo({"--desktopTitleSize":`${l}`,"--mobileTitleSize":`${c}`,"--fontColor":`${v}`},e);const p=`${e}-description`;return`<article class="advertory-vg-ad-native-ukesmeny-sponsor-stripe">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <a class="ad-link" href="${n}" target="_blank">\n <span style="--desktopTitleSize: ${l}; --mobileTitleSize: ${c};" class="title">${r}</span>\n </a>\n <a class="ad-link" href="${n}" target="_blank"> \n <img alt="${t}" class="ad-logo" src="${i}" />\n </a>\n <div class="info-button-wrapper" onClick="${(e=>`\n const adDescription = window.document.getElementById('${e}');\n adDescription.classList.toggle('hide');\n `)(p)}"><div class="info-button"></div></div>\n </div>\n <div id="${p}" class="description hide"> <span>Annonsøren som presenterer ukemenyen har betalt for profilering av logoen på VG-forsiden og Godt.no, og annonsen mellom oppskriftene.</span> <a href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232" target="_blank">Les mer</a></div>\n </div>\n </article>`},UKESMENY:({containerId:e,url:t,imgAltText:n,img:i})=>`<article class="advertory-vg-ad-native-ukesmeny">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>Annonse</span></div>\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" />\n </div>\n </div>\n </a>\n </article>`,UKESMENY_VIDEO:(e,t)=>uo(ko)(e,t,{pluginsNames:So,videoLoop:true}),DEFAULT:({containerId:e,url:t,adText:n,img:i,logo:r,adFrom:o,sponsoredBy:s,title:a,imgWidth:d,imgHeight:l})=>`<article class="advertory-vg-ad-native">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>${n}</span></div>\n <div class="ad-image-container">\n <img alt="${a}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n ${r&&`<img alt="${s}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">${o} ${s}</span>\n <span class="title">${a}</span>\n </div>\n </div>\n </a>\n</article>`,RECIRC:({containerId:e,url:t,title:n,img:i,adText:r,sponsoredBy:o,logo:s,description:a,imgWidth:d,imgHeight:l})=>`<article class="advertory-shared-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n <img alt="${o}" class="ad-logo" src="${s}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="ad-sponsor">${r} ${o}</span>\n <h6 class="ad-title">${n}</h6>\n <span class="ad-description">${a}</span>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-vg-ad-native-podme">\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 <span class="ad-title">${t}</span>\n <span class="ad-description">${n}</span>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo">\n <img alt="Podme logo" src="${r}" loading="lazy" />\n </div>\n </div>\n </div>\n </div>\n </a>\n</article>`,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-vg-ad-native-podme-section">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-text-container">\n <span class="ad-title">\n ${t}\n </span>\n <span class="ad-description">\n ${n}\n </div>\n </div>\n <div class="ad-image-container">\n <img alt="podme-ad" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo-container">\n <img alt="podme-logo" class="ad-logo" src="${r}" loading="lazy" />\n </div>\n </div>\n </a>\n</article>`,FISHFINGER:({img:e,title:t,sponsoredBy:n,logo:i,url:r})=>`<article class="advertory-vg-ad-native-fishfinger">\n <a class="ad-link" href="${r}" rel="noopener noreferrer" target="_blank">\n <div class="ad-content">\n <img class="ad-image" src="${e}" alt="${n}" />\n <span class="ad-title">${t}</span>\n <img class="ad-logo" src="${i}" alt="${n}" />\n </div>\n </a>\n </article>`,SHOPPING:({containerId:e,url:t,logo:n,imgAltText:i,img:r,description:o,title:s,imgWidth:a,imgHeight:d},l)=>`<article class="advertory-vg-ad-native-affiliate">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>ANNONSE</span>\n ${n?`<img alt="${s}" class="ad-logo" src="${n}" loading="lazy" />`:""}\n </div>\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" loading="lazy" ${a?`width="${a}"`:""} ${d?`height="${d}"`:""} />\n </div>\n <div id="testxd" class="ad-text-container">\n ${o?`<div class="ad-description">${o}</div>`:""}\n <h2 id="scalable-text-container" class="ad-title">\n ${bo({title:s,options:l})}\n </h2>\n </div>\n </div>\n </a>\n </article>`,DEFAULT_VIDEO:(e,t)=>uo(To)(e,t),SEAMLESS_IMAGE:({containerId:e,url:t,adText:n,img:i,cta:r,description:o,logo:s,sponsoredBy:a,title:d})=>`<article class="advertory-vg-ad-native-seamless-image">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header">\n <div class="ad-header-text">\n <div class="sponsored-by">${a}</div>\n <div class="ad-annons"><span>${n}</span></div>\n </div>\n ${s&&`<img alt="${a}" class="ad-logo" src="${s}" loading="lazy" />`}\n </div>\n <div class="ad-image-container">\n <img alt="${d}" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="description">${o}</span>\n <button class="ad-action">${r}</button>\n </div>\n </div>\n </a>\n </div>\n </article>`},Io={NATIVE_TEMPLATE:({containerId:e,url:t,sponsoredBy:n,title:i,img:r,adText:o})=>`<article class="advertory-no-ad-native-default">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_RECIRC:({containerId:e,url:t,sponsoredBy:n,title:i,img:r,adText:o})=>`<article class="advertory-no-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`},Ao={displayTemplates:{content:Co.CONTENT,content_internal:Co.CONTENT,inhouse:Co.INHOUSE,sponsorstripe:Co.SPONSORSTRIPE,"ukesmeny-stripe":Co.UKESMENY_SPONSORSTRIPE,ukesmeny:Co.UKESMENY,sponsor:Co.SPONSORSTRIPE,sponsortop:Co.SPONSORSTRIPE,standard:Co.STANDARD,recirc:Co.RECIRC,podme:Co.PODME,podme_section:Co.PODME_SECTION,fishfinger:Co.FISHFINGER,shopping:Co.SHOPPING,native:Io.NATIVE_TEMPLATE,native_recirc:Io.NATIVE_RECIRC,default:Co.DEFAULT,seamless_image:Co.SEAMLESS_IMAGE},videoTemplates:{content:Co.CONTENT,recirc:Co.DEFAULT_VIDEO,default:Co.DEFAULT_VIDEO,menu:Co.UKESMENY_VIDEO}},$o=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},Oo=(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;$o(n,i)})(e.isIntersecting,n,r)),s=new ResizeObserver(()=>((e,t)=>{$o(t,e.offsetHeight)})(n,r));o.observe(n),s.observe(n)},Po=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`),Lo=(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&&Oo(o,i),()=>r&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,r]=t;if(!i)return;const o=()=>{const e=Po(i),t=r?Po(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())},xo=e=>{e.style.removeProperty("min-height"),e.style.removeProperty("min-width")},No={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return me(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){me(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){me(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},jo="finn_blink_id",_o=e=>W(void 0,void 0,void 0,function*(){const{id:t,hashed_email:n,theme:i}=e,r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["id","hashed_email","theme"]),o=window[ie.Blink];if(!o)return;const s=new o({remote:"https://www.finn.no/distribution-front/external/carousel",id:t,hashed_email:n,theme:i});yield s.inject(r)}),Mo=e=>{var t,n;const i=document.querySelector(`[id^="${e}"]`);return null!==(n=null===(t=null==i?void 0:i.dataset)||void 0===t?void 0:t.finnBlinkId)&&void 0!==n?n:e},qo=(e,t)=>{const{finnBlink:{enabled:n}={}}=U.get(),i=(null==t?void 0:t.enabled)||(e=>{var t;const n=document.querySelector(`[id^="${e}"]`);return!!(null===(t=null==n?void 0:n.dataset)||void 0===t?void 0:t.noBidAd)})(e);if(!i||!n)return null;const{limit:r,height:o,requireImage:s,theme:a,rec:d,distributionTypes:l,position:c,offset:u,advertoryTheme:v}=t||{};return{selector:`#${Mo(e)}`,enabled:i,position:null!=c?c:e,distributionTypes:null!=l?l:[],limit:null!=r?r:100,height:null!=o?o:100,offset:null!=u?u:200,requireImage:s,rec:d,theme:"dark"===a?"dark":"light",advertoryTheme:v}},Do=(e,t,n)=>W(void 0,void 0,void 0,function*(){const{placements:i,deviceType:r}=U.get();me(`rendering finn blink ad for ${e}`);const o=fe(e),s=i[r].find(e=>e.id===o),a=qo(e,null==s?void 0:s.finnBlink),{publisher:d,country:l,finnBlink:c}=t,{userId:u,uuid:v,channel:p,theme:g}=null!=c?c:{},h=null!=p?p:`${d}.${l}`,m=(e=>{if(!e){const e=je();return null!=e?e:""}return e})(u),y="dark"===g?"dark":"light";if(!(null==a?void 0:a.enabled))return me(`Finn blink is not enabled on placement: ${e}`),n&&n(e),void lr(e);if((e=>{var t;const n=Mo(e),i=document.querySelector(`[id^="${n}"]`);return!!(null===(t=null==i?void 0:i.classList)||void 0===t?void 0:t.contains("finn"))})(e))me(`Finn blink already loaded ${e}`);else try{const e=yield W(void 0,void 0,void 0,function*(){const{finnBlink:{identifierUrl:e}={}}=U.get(),t=No.get(jo),n=Ie("finncode");if(!e||n)return"";if(!t){const t=yield it.get(e,{credentials:"include"}),{finn_blink_id:n}=t;if(!n)throw new Error("getFinnBlinkIdentifier: No finn_blink_id found");return No.set(jo,n),n}return t});yield _o(Object.assign(Object.assign({},a),{hashed_email:e,channel:h,id:m,theme:y,uuid:v})).then(()=>{((e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={},pageType:i}=U.get(),r=document.querySelector(`#${e}`);if(!r)return;if(r.classList.add("disable-cogwheel"),!n)return;se(n,r,ge,null!=t?t:i),er({preferredTestIdData:{targetId:e,testId:"finn"}})})(a.selector.replace("#",""),a.advertoryTheme)})}catch(t){me(`Finn blink error ${t}`),n&&n(e),!n&&ee(e),lr(e)}}),Ro=((e,t)=>n=>Yr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;u(e)&&xo(i);const{pageType:r=bn.FRONT,nativeTrackingConfig:o,appearanceConfig:s,deviceType:a}=null!=t?t:{},d={language:$e.NO,publisher:Et.VG,deviceType:a,pageType:r,nativeTrackingConfig:o,appearanceConfig:s,productTag:"partnerstudio"};ao(e,d,Ao),Lo(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:(e,t)=>{if(!t)return;const{options:{appMainContainerSelector:n,wallpaperAnchorSelector:i}={}}=t;(e=>{const t=document.querySelector(e||"#application");if(!t)return;Z();const n=document.createElement("div");n.classList.add(J),document.body.insertBefore(n,t.nextSibling),n.style.setProperty("position","fixed"),n.style.setProperty("width","100%"),n.style.setProperty("height","calc(100% - var(--header-height, 0) - 15px)"),n.style.setProperty("background-position","center top"),n.style.setProperty("background-repeat","no-repeat")})(n),(e=>{const t=e||".advertory-wrapper-common-skyscraperleft_1",n=document.querySelector(t);n&&(Q(n),window.addEventListener("scroll",()=>Q(n)))})(i),e()},adjustAdToHorseshoe:e=>{var t;const n=document.querySelector(`#${e}`);n&&(null===(t=n.parentElement)||void 0===t||t.classList.add(Y),n.classList.add(Y))}},loadFinnBlinkAd:(e,t,n,i)=>W(void 0,void 0,void 0,function*(){const{isMobileApp:r}=U.get();if(me(`loadFinnBlinkAd: loading finn blink ad for ${e}`),!(yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=xe(e,t,n),r=yield i();return!(!(null==e?void 0:e.enabled)||!r)||(me("Skip loading finn blink ad due to missing TCF consent."),!1)}))||r)return n&&n(e),void lr(e);yield re(oe),yield Do(e,t,n),i&&i()}),replaceAdsWithFinnBlink:e=>W(void 0,void 0,void 0,function*(){if(!e)return;yield re(oe);const{replacementConfig:t}=e;if(!((()=>{const e=document.getElementById("ads-advertory-anchor");return!(e&&"none"!==getComputedStyle(e).display&&window.advertoryFluepapir)})()&&(null==t?void 0:t.adsToReplace)&&(null==t?void 0:t.sizes)&&e.enabled))return void me(`Finn blink configuration is incorrect: ${JSON.stringify(t)}`);const{adsToReplace:n,sizes:i}=t;n.forEach(([e,t])=>{const n=document.querySelector(`[id^="${e}"]`);if(!n)return;const i=we(t);(e=>{me(`Hiding old ad container: ${e.id}`),e.style.setProperty("display","none","important")})(n),be(n,i),n.dataset.finnBlinkId=t,ne().withFullAdsChain(e)})}),preparePageOptions:wt,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=U.get(),o=((e,t)=>{const{isMobileApp:n}=U.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=`${Je()}-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=`${Je()}-targetid`;return e?{[t]:[e]}:{}})(n),d=bt(),c=(e=>kt(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(i),u=((e,t)=>kt(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(i);return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),s),a),c),d),rendererOptions:u})},siteEvents:Ce,librariesToLoad:[]},{publisherClassName:Et.VG,fullWidthFormatClassName:"netboard"});var Bo=Object.freeze({__proto__:null,default:""});export{Ro as initAdvertoryPackage,Gr 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=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!T(e),w=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},b=e=>e.targetId.startsWith("netboard"),E=e=>e.targetId.startsWith("board"),T=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),k=e=>e.targetId.startsWith("midboard"),I=e=>e.targetId.startsWith("widescreen"),S=e=>e.width>=1260&&e.width<=1280,C=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})},$="0123456789abcdefghijklmnopqrstuvwxyz",O=(e,t)=>{e.style.display=t},P=e=>{window.apntag.anq.push(e)},L=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),x=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})}),N=e=>{const{targetId:t}=e,n=document.querySelector(`div[id^="${t}"]`);if(!n)return;const i=n.parentElement;if(!i)return;t.includes("integration_godt-menu")&&j(i)},j=e=>{const t=e.parentElement;t&&(t.style.display="none")},_=()=>{const e=document.querySelector("#advertory-vg-sponsorstripe-info");if(!e)return;const t=document.querySelector(".advertory-vg-ad-native-sponsorstripe-liquidglass");t?(e=>{const t=e.querySelector("#sponsorstripe-info-open-button"),n=e.querySelector("#sponsorstripe-info-close-button"),i=e.querySelector(".ad-wrapper"),r=e.querySelector(".ad-info");i&&r&&(null==t||t.addEventListener("click",()=>{O(i,"none"),O(r,"flex")}),null==n||n.addEventListener("click",()=>{O(i,"flex"),O(r,"none")}))})(t):(e=>{const t=document.querySelector("#sponsorstripe-info-open-button"),n=document.querySelector("#sponsorstripe-info-close-button");null==t||t.addEventListener("click",()=>{O(e,"flex")}),null==n||n.addEventListener("click",()=>{O(e,"none")})})(e)};function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,D;var R=M(function(){if(D)return q;D=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)},{})},q=a}());const B=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],F={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},V=6;class z{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 B){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=R(z.DEFAULT_SITE_HANDLERS,e)}}z.DEFAULT_SITE_HANDLERS={siteEvents:F,initNativeAd:function(){}};const U=new z,H=U.modifyConfigProperties.bind(U);function W(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;class K{initialize(){this.DATA=Object.assign({},K.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)}}K.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const G=new K,J="advertory-wallpaper-background",Y="advertory-with-horseshoe",Z=()=>{const e=document.querySelector(`.${J}`);e&&e.remove()},Q=e=>{const t=e.getBoundingClientRect().top;requestAnimationFrame(()=>(e=>{if(!document.body)return;const t=document.querySelector(`.${J}`);t&&t.style.setProperty("top",`${e}px`)})(t+15))},X=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,ee=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")&&Z())},te=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"))},ne=()=>{const{publisher:e,country:t,finnBlink:n}=U.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:r}}=U.getHandlers(),o=window.apntag,s={publisher:e,country:t,finnBlink:n},a=e=>{te(e),P(()=>o.showTag(e))};return{withXandrAd:a,withFinnBlinkAd:e=>W(void 0,void 0,void 0,function*(){yield i(e,s,null)}),withFullAdsChain:e=>W(void 0,void 0,void 0,function*(){yield i(e,s,a,()=>{G.getData("horseshoe").isAvailable&&r(e)})})}},ie={Blink:"Blink"},re=new Map,oe=e=>{var t;if(!re.has(e)){const t=import(e).then(e=>(e=>{for(const[t,n]of Object.entries(ie)){const i=e[t];null!=i&&(window[n]=i)}})(e)).catch(t=>{throw re.delete(e),t});re.set(e,t)}return null!==(t=re.get(e))&&void 0!==t?t:Promise.resolve()},se="https://assets.finn.no/pkg/distribution-fixed/v1/FINNExternalDistribution.modern.js",ae=(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},de={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},le=()=>{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"},ce=e=>e===de.MOBILE,ue=()=>{if(!/iPhone|iPad|iPod/i.test(navigator.platform)||"ios"!==le())return!1;const e=ve();return!!(e&&e>=26)||18===e&&(pe()||ge())},ve=()=>{const e=navigator.userAgent.match(/(?:iPhone )?OS (\d+)_/i);return e?parseInt(e[1],10):null},pe=()=>{const e=navigator.userAgent.match(/Version\/(\d+)\./i);return!!e&&parseInt(e[1],10)>=26},ge=()=>{const e=navigator.userAgent.match(/\(iOS (\d+)\./i);return!!e&&parseInt(e[1],10)>=26},he="finn-blink",me="native-ad",ye=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},fe=()=>W(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)}}),we=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},be=(e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={}}=U.get(),i=document.createElement("div"),r=document.createElement("div");return r.id=e,i.appendChild(r),ae(n,r,he),ye(`Creating blink container for: ${e}`),i},Ee=(e,t)=>{var n;(ye(`Appending ${t.id} after ${e.id}`),e.parentElement&&(n=e.parentElement,!Array.from(n.children).some(e=>e.classList.contains("advertory-finn-blink-wrapper"))))?(e.parentElement.style.display="none",e.parentElement.insertAdjacentElement("afterend",t)):ye(`Cannot perform afterend on: ${e.id}`)},Te=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),ke=e=>{const{source:t}=e;return"csm"===t},Ie=e=>{const{deviceType:t}=U.get();navigator&&navigator.userAgent.match(/firefox/i)&&(e=>e===de.DESKTOP||"tablet"===e)(t)&&Se(e)},Se=e=>{var t,n,i,r,o,s,a,d;const l=ke(e)?1:0,c=null===(i=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags)||void 0===i?void 0:i[e.targetId];if(null===(d=null===(a=null===(s=null===(o=null===(r=null==c?void 0:c.adResponse)||void 0===r?void 0:r.ads)||void 0===o?void 0:o[l])||void 0===s?void 0:s.rtb)||void 0===a?void 0:a.banner)||void 0===d?void 0:d.content){const e="<style>body { margin:0 !important; }</style>";c.adResponse.ads[l].rtb.banner.content+=e}},Ce={adRequested:()=>{},adAvailable:e=>{f(e)&&(e=>{const t=document.getElementById(e.targetId);t&&t.parentElement&&t.parentElement.classList.add("brandboard-container")})(e),Ie(e)},adLoaded:e=>{y(e)&&_()},adNoBid:e=>{const{finnBlink:t}=U.get();N(e),(b(e)||E(e)||f(e))&&((e,t)=>{W(void 0,void 0,void 0,function*(){const{deviceType:n}=U.get();if(!t||!ce(n))return;yield oe(se);const{replacementConfig:i}=t,r=document.querySelector(`[id^="${e}"]`);if(!r||!(null==i?void 0:i.sizes))return;const{sizes:o}=i,s=we(e),a=be(s);r.dataset.finnBlinkId=s,r.dataset.noBidAd="true",Ee(r,a),ne().withFinnBlinkAd(s)})})(e.targetId,t)},adError:(e,t)=>N(t),adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Ae=e=>new URLSearchParams(window.location.search).get(e),$e=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 ye("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let i=!1;const r=e=>{i||(ye("Resolving advertising permission value obtained"),i=!0,t(e))},o=setTimeout(()=>{ye("Advertising permission timed out, resolving with false"),r(!1)},3e3);window._tcf_.onTcfReady(()=>{ye("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);ye("Advertising permission value obtained asynchronously: ",e),r(Boolean(t))})}),Oe={NO:"no",SE:"se"},Pe="cmp:loaded";let Le,xe=!1;const Ne=(e,t,n)=>{const i=!!(null==e?void 0:e.enabled),r=(null==e?void 0:e.timeout)||3e3,o=Ae("bypass_tcf"),s=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(ye("TCF bypass param detected, returning consent: true"),!0):(ye("TCF is not enabled, returning consent: true"),!0))(i,o))return!0;if(xe)return null;if(!Le)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=Le.getConsentedToAllSync();return ye(`TCF consented to all is: ${t}`),Le.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(ye("Getting TCF consent manager..."),window._tcf_)return ye("TCF consent manager is already available"),Le=window._tcf_,void e(Le);ye("TCF consent manager is not available");const n=()=>{ye("CMP loaded, resolving consent manager..."),i&&clearTimeout(i),window._tcf_?(Le=window._tcf_,e(Le)):t(new Error("CMP loaded but window._tcf_ is not defined"))},i=setTimeout(()=>{document.removeEventListener(Pe,n),xe=!0,t(new Error("Timeout waiting for CMP to load"))},r);ye("Listening for CMP loaded event..."),document.addEventListener(Pe,n,{once:!0})}):Promise.resolve(null),getConsentSync:s,getConsentAsync:()=>W(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ye(`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===Oe.SE,o=(null==e?void 0:e.schibstedAdChoicesEnabled)&&!t&&n===Oe.NO;if(i||o)return ye("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield $e(e);if(!(null==e?void 0:e.enabled))return!0;const a=s();return null!==a?a:yield new Promise((e,t)=>{try{if(!Le)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(()=>{ye("TCF isConsentedToAll timed out, resolving with false"),n(!1)},r);Le.onTcfReady(()=>{ye("On Tcf Ready called, waiting for consent"),clearTimeout(i)}),Le.isConsentedToAll(t=>{clearTimeout(i),e(t)})}catch(e){t(e)}})})}},je=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},_e=()=>{const e=je("_pulse2data");return e?e.split(",")[2]:void 0},Me=9826;class qe{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=de.DESKTOP,isMobileApp:t}=U.get();if(t){return{"aa-sch-supply_type":`app_${e===de.MOBILE?"phone":de.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(e){return W(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 W(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 _e()}getExternalUid(){return W(this,void 0,void 0,function*(){return yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=Ne(e,t,n);if(!(yield i()))return;const r=je("_pulse2data");return r?r.split(",")[9]:void 0})})}isTrackingForbidden(){return W(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=Me}=U.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}=U.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return W(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=Ne(e,t,n);return{"aa-sch-cmp_advertising":(yield i())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=U.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}=U.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 De=new qe;De.prepare.bind(De);const Re=["aLOLE","xBqQj","1KaqJ","1nzXzK","opm8zV","4qKXKR","Ad9QgE"];function Be(e){return t=window.location.pathname.split("/").slice(-2,-1).pop()||"",Re.includes(t)?{"no-sno-news-section":`${e}_doedsfall`}:{};var t}class Fe extends qe{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=de.DESKTOP}=U.get();return{"no-sno-device":this.getPageOptionsFormatDevice(e)}}}getAppTypeKeywords(){const{deviceType:e,isMobileApp:t}=U.get(),{OS:n,isHybridApp:i}=function(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=le();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}(t);return{"no-sno-apptype":n&&e&&i?`${n}_${this.getPageOptionsFormatDevice()}_hybrid`:"none"}}getObituariesKeywords(e){return Be(e)}getSectionPageTypeKeywords(){var e,t;const{pageOptions:n,pageType:i}=U.get(),r=null!==(t=null===(e=n.keywords["no-sno-news-section"])||void 0===e?void 0:e.toString())&&void 0!==t?t:"ettan";return{"no-sno-section-page_type":`${r.split("_").pop()||r}_${"article"===i?"article":"front"}`}}}const Ve=864e5,ze=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return ye("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=Ve)=>{const r={data:n,expirationTime:(new Date).getTime()+i};t(e,JSON.stringify(r))},getByTimestamp:(t,n=Ve)=>{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 ye("Error with parsing localStorage data"),null}}}})(),Ue="glimrTags",He=["glwe_","glwet_"],We={geofenceTags:[],geoTags:[],weatherTags:[]},Ke=(e,t,n,...i)=>W(void 0,[e,t,n,...i],void 0,function*(e,t,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return ye(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return ye(`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}=Ne(e,t,n);return(yield r())?(ye(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(ye(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Ge=()=>W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield Ke(e,t,n,"glimr")}const{getConsentAsync:i}=Ne(e,t,n);return yield i()}),Je=()=>W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get();if(!(yield Ge())||!(null==e?void 0:e.enabled))return void ye("No consent for glimr data fetching.");const t=yield(n=500,W(void 0,void 0,void 0,function*(){return yield Promise.race([W(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)=>{ze.setWithTimestamp(Ue,{tags:e,tagMappings:t}),n(!0)})})}catch(e){ye(`Error during getting glimr data: ${e}`)}else ye("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:t})}),Ye=()=>{const{country:e}=U.get();return e===Oe.NO?"no-sno":"se-generic"},Ze=()=>{const{country:e,publisher:t}=U.get();return`${e}-${t}`},Qe={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"},Xe=e=>He.some(t=>e.startsWith(t)),et=e=>e.startsWith("glgc_"),tt=e=>!Xe(e)&&!et(e),nt=e=>{const t=it();if(!t)return We;const n=((e=[])=>e.filter(Xe))(t),i=((e=[])=>e.filter(et))(t),r=((e=[],t)=>{const n=e.filter(tt);if(t){const{publisher:e}=U.get(),t=Qe[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},it=()=>{const e=ze.getByTimestamp(Ue);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},rt={get:(e,t)=>W(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)=>W(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()})},ot="advertory:ppids-cache",st={[Oe.SE]:`SCH${Oe.SE.toUpperCase()}-EnvHash`,[Oe.NO]:`SCH${Oe.NO.toUpperCase()}-EnvHash`},at={[Oe.SE]:`SCH${Oe.SE.toUpperCase()}-UserHash`,[Oe.NO]:`SCH${Oe.NO.toUpperCase()}-UserHash`},dt={[Oe.SE]:`sch${Oe.SE}-envhash-v3`,[Oe.NO]:`sch${Oe.NO}-envhash-v3`},lt={[Oe.SE]:`sch${Oe.SE}-userhash-v3`,[Oe.NO]:`sch${Oe.NO}-userhash-v3`},ct={[Oe.SE]:`'sch${Oe.SE}-iosid-v3'`,[Oe.NO]:`'sch${Oe.NO}-iosid-v3'`},ut={[Oe.SE]:`sch${Oe.SE}-androidid-v3`,[Oe.NO]:`sch${Oe.NO}-androidid-v3`},vt={[Oe.SE]:"sdrn:schibsted.com:user",[Oe.NO]:"sdrn:spid.no:user"};class pt{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 gt=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(e){return W(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||ye("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:""}},ht=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(e,t){return W(this,void 0,void 0,function*(){var n,i,r,o,s,a,d,l,c,u,v;const p=ze.get(ot),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||ye("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}}:{});ze.set(ot,r)}hashPPIDs(e,t){return W(this,void 0,void 0,function*(){try{const n=new Headers({"Content-Type":"application/json"});return yield rt.post(t,n,e)}catch(e){return ye("Error with hashing PPIDs",e),null}})}getNewPPIDs(e,t){return W(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield((e,t)=>W(void 0,void 0,void 0,function*(){const n=yield e.getUserId();return n?`${vt[t]}:${n}`:null}))(t,n),r=yield(e=>W(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}}},mt=e=>W(void 0,void 0,void 0,function*(){const{tracker:t,tcf:n,country:i,isMobileApp:r}=e;if(!(yield Ke(n,r,i,"setXandrPPIDs")))return;if(!t)return;(yield Promise.allSettled([gt.processPPIDs(t,null==n?void 0:n.timeout),ht.processPPIDs(t,i)])).forEach((e,t)=>{if("rejected"===e.status){ye(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),yt=e=>{const{ppid1:t,ppid2:n}=gt.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=ht.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new pt).add(n,st[e]).add(t,at[e]).add(r,dt[e]).add(i,lt[e]).add(o,ct[e]).add(s,ut[e]).buildEids()}]}},ft=e=>{const{ppid1:t,ppid2:n}=gt.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:s}=ht.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new pt).add(n,st[e]).add(t,at[e]).add(r,dt[e]).add(i,lt[e]).add(o,ct[e]).add(s,ut[e]).buildRyEids()}}]}}};const wt=new class extends Fe{prepare(e){return W(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({},this.getCountryCodeKeywords(Oe.NO)),this.getInventoryTypeKeywords()),this.getPublisherKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),this.getPageTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),yield this.getAdvertisingConsentKeywords()),this.getHasContextKeywords(e.keywords)),yield W(void 0,void 0,void 0,function*(){const{glimr:e}=U.get(),{addPublisherToGeo:t}={},n=yield Ge();if(!(null==e?void 0:e.enabled)||!n)return ye("No consent for getting glimr tags."),{};const i=Ye(),r=nt(t);return{[`${i}-geo`]:r.geoTags,[`${i}-weather`]:r.weatherTags,[`${i}-geofence`]:r.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=gt.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({},yt(Oe.NO)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var bt=wt.prepare.bind(wt);const Et=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},Tt={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"},kt={[Tt.VG]:["board","netboard","backfill","outstream"],[Tt.AFTONBLADET]:["panorama","outstream"],[Tt.GODARE]:["panorama","outstream"],[Tt.SVD]:["wph-article-panorama","wph-front-panorama"]},It=e=>{var t;const{publisher:n}=U.get();return!!kt[n]&&!!(null===(t=kt[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},St=()=>(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),Ct=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),At=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=U.get(),r=[`${Ye()}-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)}},$t=(e,...t)=>W(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)}))}),Ot=e=>e.includes("snoap.no"),Pt=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)},Lt=(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()},xt=Lt([],()=>{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}),Nt=e=>{const t=Lt([],()=>{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},jt=[],_t={},Mt=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=Dt(e);n?(qt(i,n),Rt(e,i,t)):(qt(i,n),Bt(e,i,t))})},qt=(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}`,"*")},Dt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},Rt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),jt.includes(t)||jt.push(t),n&&window.addEventListener("scroll",_t[t],{passive:!0})},Bt=(e,t,n)=>{jt.includes(t)&&(n&&window.removeEventListener("scroll",_t[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Ft=(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&&Vt(e,o,r,0),s.length&&Vt(e,s,r,40)}},Vt=(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()})},zt={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"}};let Ut=null;const Ht=(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=`(${xt})()`,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(Ot(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=Nt(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>Ot(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)),Ot(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)),Pt(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},Wt=()=>{Ut=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`)},Kt=()=>{Ut||(Ut=window.requestAnimationFrame(Wt))},Gt=(t,n)=>{var i,r,o,s;const{country:a}=U.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=>Mt(e,n),{}),r=Dt(e);i.observe(e),n&&(_t[r]=Ft(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",zt[a].adText),(null==n?void 0:n.moveCogwheelToTheLeft)&&(l.dataset.moveCogwheelToTheLeft="true"),Kt(),window.addEventListener("resize",Kt),null===(o=window.visualViewport)||void 0===o||o.addEventListener("resize",Kt),null===(s=window.visualViewport)||void 0===s||s.addEventListener("scroll",Kt)},Jt=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=Pt(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=Pt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ht(t,e))},Yt=()=>W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:i,fullscreenScroll:r}=U.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=U.getHandlers(),{getConsentAsync:s}=Ne(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=St(),{prebid:{relevantCbTimeout:o}={}}=U.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=St(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=St();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Ct();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!l.loadTags)return ye("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!l.loadTags,condition:"or"}),void d.cleanup();const t=Ct();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const i=a?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};ye("prebid consentManagement",i),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},ft(n)),At(p,v))),ye("core add prebid config",Object.assign(Object.assign({consentManagement:i,enableSendAllBids:!1},ft(n)),At(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=>{Zt(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)&&(Gt(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))}}),ye("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=>{Zt(e,o)},directRenderFn:()=>{}})})}),Zt=(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},U.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")};let Qt="";const Xt=new Map,en=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`)},tn=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=G.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},nn=()=>{Z();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{ee(e.id),tn(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=we(e.id)}),P(()=>window.apntag.clearRequest())},rn="noGroupedPlacements",on=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},sn=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},an=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}=U.get(),o=n[r].filter(sn)||[],s=e?document.querySelector(e):document;if(!s)return[];const a=o.reduce((e,t)=>{const n=on(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=dn(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=$[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&&G.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}=U.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Qt!==window.location.pathname&&(Xt.clear(),Qt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=Xt.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${Ze()}-count`]=i,Xt.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)},dn=(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},ln=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=U.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=we(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(we(e.id)));return n})(e,i),a=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(we(e.id))))(e,new Set([...a,...r]));return Object.assign(Object.assign(Object.assign({},s),o),{[rn]:d})},cn=(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])}},un=["netboard","board"];class vn{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 W(this,void 0,void 0,function*(){var t,n;const i=yield this.identityFacade.getIdentityUser(),r=null!==(n=yield null===(t=this.tracker)||void 0===t?void 0:t.getEnvironmentId())&&void 0!==n?n:"",o=(null==i?void 0:i.userId)?String(i.userId):"",s=this.buildUrl(e,{envId:r,spid:o});try{ye("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield rt.get(s,e);return ye("Fetch operation completed successfully."),t}catch(e){ye("Error during fetch operation:",e)}return null})}}let pn=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 W(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 gn=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):ye("Dr. Edition container does not have a parent element, cannot remove height lock.")};class hn{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(e,t){return W(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 ye(`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?(ye("No Dr. Edition ads available to render. Collapsing whole placement."),ee(e.id),void gn(s)):((null==a?void 0:a.itemId)&&o&&(ye("Dr. Edition ad available to render as a Xandr backfill."),te(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),gn(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)):gn(s))):(ye("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(e),void gn(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:"";te(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 mn{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(e,t,n){return W(this,void 0,void 0,function*(){if(!(null==t?void 0:t.itemId))return;const{getConsentAsync:i}=Ne(n.tcf,n.isMobileApp,n.country),r=yield i(),o=ce(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 yn{constructor(e){this.strategy=e}handle(e,t){return W(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 W(this,void 0,void 0,function*(){const t=e.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${t}"]`);if(t&&!window.autoplayQueue&&!n)try{yield $t(t)}catch(e){ye("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(e,t){return W(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 fn=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 W(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 W(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 wn extends fn{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 bn=class extends fn{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"}}};const En={FRONT:"front",ARTICLE:"article",OTHER:"other"},Tn=(e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})},kn=e=>W(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)))}))}),In={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 W(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Fo})})}})}},Sn=(e,t)=>{null==e||e.forEach(e=>{In[e](t)})};class Cn{handleVideo(e,t){return W(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){yield W(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);Sn(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 kn(d);l.once("assetReady",()=>{Tn(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",()=>W(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===En.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 An="https://www.aftonbladet.se/video-player-extras/latest/";class $n{handleVideo(e,t){return W(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:{[`${An}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${An}external-link.js`]:{name:"ExternalLink"}}};yield kn(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""}}const On=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class Pn{handleVideo(e,t){return W(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({},On(e)?e:{}),{provider:Object.assign(Object.assign({},On(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 kn(s);a.once("PulseStats:ready",()=>W(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===En.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Ln=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const xn=(e,t,n)=>{var i;const{publisher:r,pageType:o,country:s}=e,a={[Tt.VG]:new pn,[Tt.E24]:new Cn,[Tt.AFTONBLADET]:new $n,[Tt.SVD]:new Pn}[r]||new Ln,d=new(s===Oe.SE?wn:bn)(n,a,o),l=new vn(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new mn(a,d),u=new yn(a);return new hn(l,c,u,d)},Nn=()=>W(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 jn{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 W(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 ye("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return W(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 _n=(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=xn(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))},Mn=[],qn=(e,t)=>W(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 Ke(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=we(t.targetId),d=s.find(e=>e.id===a),l=un.some(e=>a.startsWith(e)),c=Mn.includes(a),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(Mn.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 ye("Pulse has not been passed as a prop, aborting");const v=yield Nn(),p=new jn(v),g=xn({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)}),Dn="collapseAd",Rn="hideAd",Bn="resizeAd",Fn="renderDrEditionFallback",Vn="wallpaperImageUrl",zn="wallpaperColor",Un="velvet",Hn=[Bn,Vn,zn,Dn,Rn,Fn,Un];let Wn;const Kn=e=>{if("object"==typeof e)return e;if(t=e,X.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:Vn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:zn,wallpaperColor:t}}if(e.startsWith(Fn)){const t=e.split(":")[1];return{name:Fn,targetId:t}}if(e.startsWith(Dn)||e.startsWith(Rn)){const t=e.split(":")[1];return{name:Dn,targetId:t}}if(e.includes("name")&&Hn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},Gn=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=Kn(t);if(!n)return;if(!n.name||!Hn.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:s,cmd:a,size:d}=n;i===Un&&a&&(a.includes("noScroll")&&(Wn=(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==Wn||Wn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==Dn&&i!==Rn||!r||ee(r),i===Bn&&r&&a&&cn(r,a),i===Fn&&r&&(ee(r),qn(U.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&cn(r,d,!0),i===Vn&&o&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===zn&&s&&(e=>{const t=document.querySelector(`.${J}`);t&&(t.style.backgroundColor=e)})(s)},Jn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),Yn=(e,t)=>{if(w(t))return ye(`loading finn blink ad with full ads chain for ${t}`),void ne().withFullAdsChain(t);P(()=>(ye("core showTag",{id:t}),e.showTag(t)))},Zn=(e,t)=>W(void 0,void 0,void 0,function*(){yield L,yield x;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);ye("core log from intersection observer handler",{targetId:r,element:o}),n(window.apntag,r),o&&(t.unobserve(o),t.disconnect())})})(e,t,Yn),Jn(t));n.observe(e)}),Qn=new Map,Xn=["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}),ni=({adWrapper:e,placementContainer:t})=>{const n=ti({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),tn(i=t),i.innerHTML=""},ii=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},ri=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=U.get(),i=Xn.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 ii(e),void o.disconnect();const a=t.closest('[style*="height"]'),d=r;a&&d.contains(a)?ii(a):d.hasAttribute("style")&&ii(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},oi=(e,t,n,i,r,o)=>{var s;const a=performance.now(),d=null!==(s=Qn.get(t))&&void 0!==s?s:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;a-d>=r&&l&&(Qn.set(t,a),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&ni({adWrapper:i,placementContainer:n}),P(()=>{e.setKeywords([t],{[`${Ye()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},si=(e,t,n,i)=>{const r=new IntersectionObserver((e,t)=>((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,oi,n,i),Jn(t));r.observe(e)},ai=(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},di=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},li=(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;ri({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,s=(new Date).getTime();if(i&&"true"!==i.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:i}=U.get(),r=null==i?void 0:i[n];return((e,t)=>t[e])(null!==(t=e.dataset.priority)&&void 0!==t?t:"normal",(({high:e,normal:t,low:n}={})=>{var i,r,o,s,a,d;return{high:{refreshMargin:null!==(i=null==e?void 0:e.refreshMargin)&&void 0!==i?i:600,renderMargin:null!==(r=null==e?void 0:e.renderMargin)&&void 0!==r?r:300},normal:{refreshMargin:null!==(o=null==t?void 0:t.refreshMargin)&&void 0!==o?o:300,renderMargin:null!==(s=null==t?void 0:t.renderMargin)&&void 0!==s?s:150},low:{refreshMargin:null!==(a=null==n?void 0:n.refreshMargin)&&void 0!==a?a:100,renderMargin:null!==(d=null==n?void 0:n.renderMargin)&&void 0!==d?d:50}}})(r)).refreshMargin})(i);i.dataset.subscribedForRefresh="true",i.dataset.refresh&&si(i,e,s,o)}},ci=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=U.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),hi(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},ui=(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;di(r,o)&&i&&(en(i.id),n.length&&r.classList.remove(...n),hi([i],t))}},vi=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=U.get();t&&(e.forEach(({id:e})=>{const t=pi(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{ui(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),ui(e,!1,t))};n.persisted&&(Te()?window.addEventListener("scroll",i,{passive:!0}):ui(e,!1,t))})})(e,n))},pi=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},gi=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(pi(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},hi=(e,t=!1)=>{const{requestSize:n=V}=U.get(),i=e.map(({id:e})=>e),r=ai(i,n);if(t)for(const t of e){const e=gi(t);window.apntag.modifyTag(t.id,e)}for(const e of r)P(()=>window.apntag.refresh(e))};const mi="#fff",yi="#0098da",fi="splash",wi="welcomePage",bi="topscroller",Ei="velvet",Ti="takeover-displayed",ki="takeover-visit-count",Ii=14400,Si=()=>{const e=je(ki);return e?parseInt(e):0},Ci=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=U.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=U.get().takeover)||void 0===e?void 0:e.cookieCapName)||Ti;return"true"===je(t)})())&&(!t||Ai()))},Ai=()=>{const e=Si();return 0===e?((()=>{const e=Si(),{takeover:{cookieCapTime:t=Ii}={}}=U.get(),n=document.location.hostname;window.document.cookie=`${ki}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},$i=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),Oi=()=>{const{takeover:e}=U.get();return Boolean(null==e?void 0:e.topscroller)},Pi=()=>W(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=Ti,cookieCapTime:n=Ii}={},isMobileApp:i,tcf:r,country:o}=U.get(),s=yield Ke(r,i,o,"ad-takeover-cookiecap");n&&s&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),Li=e=>{var t;const n=!!(null===(t=U.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return p(e)&&n},xi=(e,t)=>{var n;if(t===bi){const{topscroller:t}=e;return null!=t?t:{}}if(t===fi){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},Ni=(e,t)=>{t!==fi?(e=>{var t,n,i;const r=null===(n=null===(t=U.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=U.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=U.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)},ji=Lt([],()=>{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})}),_i=(e,t=!0)=>{(e===wi||e===bi)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},Mi=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},qi=e=>{document.body.style.overflow=e?"initial":"hidden"},Di=e=>{const t=Bi(e),n=Ri(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),qi(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},Ri=e=>{const t=()=>Di(e);return window.addEventListener("advertory:closeTakeover",t),Mi(),t},Bi=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&Di(e)};return Mi(),window.addEventListener("keydown",t),t},Fi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(Bi(e),Ri(e),Mi(),t.addEventListener("click",()=>{Di(e)}),qi(!1))},Vi=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),Ri(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},zi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>Di(e))})(e)},Ui=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=U.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=zt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},Hi=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=zt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},Wi=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=zt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},Ki=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},Gi=()=>{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)},Ji=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${ji})()`,e+t.outerHTML})(e)),n},Yi=e=>{const t=(e=>{const{requests:t}=window.apntag,n=Pt(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=Pt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ji(t))},Zi=e=>W(void 0,void 0,void 0,function*(){const{takeover:t}=U.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 $i(t,n)?fi:A(e,o)?Ei:Oi()?bi:wi})(e),a=r.offsetHeight,d=window.scrollY>a;r.style.display="block",!d&&_i(s,!1),((e,t)=>{({[wi]:Wi,[fi]:Ui,[bi]:Hi,[Ei]:Ki})[t](e)})(r,s),Gi(),((e,t)=>{({[wi]:Vi,[bi]:Vi,[fi]:Fi,[Ei]:zi})[t](e)})(r,s),((e,t,n)=>{if(!n)return;({[wi]:()=>{const{buttonLabel:i}=xi(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:"")})},[fi]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:s}=xi(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:yi}}})},[bi]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=xi(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:""))})},[Ei]:()=>{}})[t]()})(r,s,t),yield Pi(),!d&&_i(s,!0),Ni(e,s)}),Qi="advertory-brandmetrics-survey",Xi=()=>W(void 0,void 0,void 0,function*(){const{norstat:{enabled:e}={},country:t,isMobileApp:n,tcf:i}=U.get(),r=yield Ke(i,n,t,"norstat");if(!e||n||!r)return;const o=(e=>{const{ppid1:t,ppid2:n}=gt.getPPIDs(),{ppid1:i,ppid2:r}=ht.getPPIDs(),o=(new pt).add(n,st[e]).add(t,at[e]).add(r,dt[e]).add(i,lt[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(t);((e,t,...n)=>{W(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===Oe.NO?"schibsted":"schibstedse"}/map/${o}`,"norstat")}),er={nativeAd:e=>u(e)&&!y(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:v,fullscreenScroll:c,topscroller:e=>p(e)&&Oi(),splash:e=>p(e)&&$i(e.width,e.height),welcomePage:p,wallpaper:h,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:S,hFormat:C,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!C(e)&&!S(e),topboard:e=>e.targetId.startsWith("topboard")&&!p(e),widescreen:I,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:y,brandboard:e=>f(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!k(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>b(e)||E(e),panorama:T,midboard:k},tr=({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(er))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)},nr=e=>{var t;return(null===(t=Object.entries(er).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},ir=(e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1},rr=new Map;rr.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),rr.set("panorama",{scale:.79,transformOrigin:"center center"}),rr.set("outstream",{scale:.79,transformOrigin:"center center"}),rr.set("integration",{scale:.79,transformOrigin:"center center"}),rr.set("toppanorama",{scale:.8,transformOrigin:"left center"});const or=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=nr(e),r=rr.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")},sr=(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,ar=e=>`externalImpId:'${e}'`,dr=e=>{var t;const{forwardExternalImpId:n=!1,tracker:i}=U.get(),r=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${Ze()}-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,resizeAdParentDiv:p=!1,dynamicSizeWidthCheck:g=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Ci())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!==bi),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),h=Object.assign({invCode:l,sizes:s,targetId:o,keywords:sr(a,c),allowedFormats:d,resizeAdParentDiv:p,dynamicSizeWidthCheck:g},v&&{safeframeConfig:v}),m=(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)?(ye("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):(ye("Tracker state does not contain field pageViewId or it is empty"),""):(ye("Tracker state is empty"),""):(ye("Tracker is not configured in initAdvertory function"),"")})(i);n&&m&&(ye("External Impression ID assigned to defineTag:",ar(m)),h.externalImpId=ar(m));const y=(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"))&&(h.native=y),h},lr=e=>!e.includes("takeover")||Ci(),cr=e=>{const{publisher:t=""}=U.get(),n=document.querySelector(`#${e}`);if(!n)return;const i=`-${t}`;n.classList.remove(`advertory${i}-finn-blink`),n.classList.remove(`advertory${i}-finn-blink-wrapper`)},ur=e=>{if(!e)return e;const t=e[`${Ye()}-targetid`],n=t?we(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Ye()}-targetid`]:[n]})},vr=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Ye()}-geo`]&&{[`${Ye()}-geo`]:["geo-test-value"]}),e[`${Ye()}-geofence`]&&{[`${Ye()}-geofence`]:["geofence-test-value"]}),e[`${Ye()}-weather`]&&{[`${Ye()}-weather`]:["weather-test-value"]}),pr=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"})})()},gr=(e,t)=>W(void 0,void 0,void 0,function*(){return yield new Promise(t=>{e().then(e=>{t(null!=e?e:null)}).catch(e=>{t(null)})})}),hr={arrayMerge:(e,t)=>t},mr=e=>W(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=>W(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 rt.get(t,{method:"GET",signal:n.signal})}catch(e){throw ye("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=R.all([e.placements,o],hr),l=R(e.pageOptions,{keywords:i},hr),c=R(e.appearanceConfig,{defaultThreshold:s},hr),u=R(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:r},hr);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 ye("Error fetching S3 config, using site config",{error:t}),e}}),yr=".advertory-right-column-track",fr="--advertory-right-column-track-height",wr=e=>e.getBoundingClientRect().top+window.scrollY,br=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},Er=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},Tr=(e,t)=>`${e}-${t}`,kr=(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=wr(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=br(e);Er("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=wr(e),r=Tr(fr,t),o=i-n,s=Tr("--advertory-right-column-split-point-height",t),a=br(e);Er(r,o),Er(s,a)})(e,t+1,s),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Tr("--advertory-right-column-ad-height",t),i=br(e);Er(n,i)})(r[t])});((e,t)=>{const n=wr(e);Er(fr,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 Cr{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 W(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 W(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 $r 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 Or="[data-k5a-teaser-analytics]",Pr=(e,t,n)=>{const i=document.querySelectorAll("k5a-stream");if(!i.length)return;const r=new $r(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(Or);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(Or);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={[Tt.VG]:new Sr}[n]||new Cr;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&&(ye(`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:"";te(i)}loadKilkayaScript(e){return W(this,void 0,void 0,function*(){yield $t(e)})}run(e){return W(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 Ke(t,n,i,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(r.url),this.handleKilkayaStreamTracking(e))})}}const xr=e=>{var n,i,r,o,s,a;const{adScaleConfig:d,deviceType:l}=U.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=on(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;((e,t=window.screen.width)=>{const n=ir(e,t),i=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);i&&(i.style.transform=`scale(${n})`,i.style.transformOrigin="left top")})(e,(g<h?g:h)-v)},Nr=1e4,jr=e=>e.some(e=>e.some(e=>!!e&&di(e,0))),_r=()=>{const{widescreenSwitching:e}=U.get(),{enabled:t,rotationInterval:n=Nr,widescreenIdPrefix:i}=null!=e?e:{};if(!t)return;const r=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=U.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=jr(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=jr(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 Mr,qr=[];const Dr=["takeover","wallpaper"],Rr=e=>{const t=(e=>{const t=G.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:s,requestSize:a=V,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}},Br=()=>W(void 0,void 0,void 0,function*(){const{pageOptions:e}=U.get(),{preparePageOptions:t}=U.getHandlers(),n=(()=>{const{sandboxAdIframeEnabled:e=!0}=U.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 W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();return(yield Ke(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=G.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=vr(e);G.setData("alertoryConfigKeywords",n)})(r.keywords),P(()=>Mr.setPageOpts(r))}),Fr=e=>W(void 0,void 0,void 0,function*(){const{prebid:t,tcf:n,isMobileApp:i,country:r}=U.get();Vr(e);const o=yield Ke(n,i,r,"prebid");(null==t?void 0:t.enabled)&&o?(ye("core loadPlacements prebid enabled"),yield Yt()):(ye("core load tags invoked without prebid enabled"),zr(e))}),Vr=e=>{const{prepareTag:t}=U.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=>{ye("core defineTags",{placement:e});const i=dr(e);if(lr(e.id)){const r=t(i),o=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:ur(i),sizes:r}})(r);n.push(o),P(()=>(ye("core defineTag - add to the queue",{placement:e,preparedTag:r}),Mr.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)},zr=e=>{const t=e.filter(({id:e})=>lr(e)).map(({id:e})=>e);t.length&&P(()=>(ye("core loadTags",{placementsIdsToLoad:t}),Mr.loadTags([...t])))},Ur=(e,t)=>W(void 0,void 0,void 0,function*(){const{appearanceConfig:n,deviceType:i}=U.get(),{threshold:r,refresh:o,priority:s="normal"}=e,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(t),d=null==n?void 0:n.defaultThreshold[i];a&&(ye("core showAd - subscribe for show tag with thresholds",{placement:e,adObj:t,threshold:r,deviceDefaultThreshold:d}),yield Zn(a,null!=r?r:d)),a&&o&&(ye("core showAd - setup refreshing",{placement:e,adObj:t}),a.dataset.refresh=o.toString(),a.dataset.priority=s)}),Hr=e=>e.some(({id:e})=>Dr.some(t=>e.includes(t))),Wr=e=>W(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{requestSize:n=V}=U.get(),i=ln(e);for(const e of Object.keys(i)){const t=i[e],r=ai(t,n);for(const e of r)Hr(e)?(ye("core loadAds without lazy loading",{placementsToLoad:e}),yield Fr(e)):e.length&&(ye("core loadAds with lazy loading",{placementsToLoad:e}),yield Kr(e))}}),Kr=e=>W(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:t=!1,rootMargin:n="200% 0px"}={}}={}}=U.get(),i=[];if(!t)return ye("lazy load is not enabled",{placements:e}),void(yield Fr(e));const r=new IntersectionObserver((t,n)=>{t.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(t=>{ye("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&&Fr(e),ye("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&&(ye("lazy loading - observe element",{placementId:e.id,element:t}),r.observe(t))})}),Gr=()=>W(void 0,void 0,void 0,function*(){const{siteEvents:e,initNativeAd:t,wallpaperHandlers:{initWallpaperAd:i,adjustAdToHorseshoe:r}}=U.getHandlers(),{wallpaper:o,fullscreenScroll:s}=U.get(),a=[];P(()=>{Mr.onEvent("adRequested",()=>{e.adRequested()}),Mr.onEvent("adAvailable",n=>W(void 0,void 0,void 0,function*(){var r,a,d,l,v,g;ye("core adAvailable start",{placementsAvailable:qr,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:ke(n),isTakeoverAd:p(n),isCollapseAd:m(n),isWallpaperAd:h(n)});const y=null===(d=null===(a=null===(r=null===window||void 0===window?void 0:window.apntag)||void 0===r?void 0:r.requests)||void 0===a?void 0:a.tags[n.targetId])||void 0===d?void 0:d.adResponse.ads;ke(n)&&y&&(null===(l=y[1])||void 0===l?void 0:l.rtb)&&(n.banner=null===(g=null===(v=y[1])||void 0===v?void 0:v.rtb)||void 0===g?void 0:g.banner),c(n)&&Jt(n),I(n)&&_r(),c(n)&&!w(n.targetId)&&Gt(n,s),!u(n)||ke(n)||w(n.targetId)||t(n,U.get()),p(n)&&!m(n)&&(Yi(n.targetId),yield Zi(n)),h(n)&&(i(()=>P(()=>window.apntag.showTag(n.targetId)),o),G.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(n)&&G.setData("horseshoe",{isAvailable:!0}),tr({adObj:n}),(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)})(n),e.adAvailable(n);const f=qr.find(({id:e})=>e===n.targetId);f&&(yield Ur(f,n),qr=qr.filter(e=>e.id!==f.id)),ye("core adAvailable stop",{placementsAvailable:qr,adObj:n,isFullscreenScrollAd:c(n),isFinnBlink:w(n.targetId),isNativeAd:u(n),isMediation:ke(n),isTakeoverAd:p(n),isCollapseAd:m(n),isWallpaperAd:h(n)})})),Mr.onEvent("adLoaded",i=>{const{refreshConfig:o,appearanceConfig:s}=U.get(),d=document.getElementById(i.targetId);w(i.targetId)&&(e=>{const{fullscreenScroll:t}=U.get(),{initNativeAd:n}=U.getHandlers();c(e)&&Gt(e,t),u(e)&&n(e,U.get())})(i);a.includes(i.targetId)&&u(i)&&(t(i,U.get()),tr({adObj:i})),!a.includes(i.targetId)&&ke(i)&&a.push(i.targetId),m(i)&&ee(i.targetId),p(i)&&((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"]})})(Mr,i.targetId),v(i)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=U.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`))})(i),(e=>A(e,n))(i)&&(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}={}}=U.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=ir(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"})(i),li(i,o),(null==s?void 0:s.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(i.targetId);var l,g;G.getData("horseshoe").isAvailable&&r(i.targetId),xr(i),e.adLoaded(i),l=i.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${l}`)&&(null===(g=window.gdpr)||void 0===g?void 0:g.setupButton)&&window.gdpr.setupButton(l),d&&(d.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=U.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")})(d)),or(i),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:i.targetId,adFormat:nr(i)}}))}),Mr.onEvent("adNoBid",t=>W(void 0,void 0,void 0,function*(){ee(t.targetId),yield qn(U.get(),t),Li(t)&&(yield Pi()),e.adNoBid(t)})),Mr.onEvent("adError",(t,n)=>W(void 0,void 0,void 0,function*(){Li(n)&&(yield Pi()),e.adError(t,n)})),Mr.onEvent("adCollapse",()=>{e.adCollapse()}),Mr.onEvent("adRequestFailure",t=>{ee(t.targetId),e.adRequestFailure(t)}),Mr.onEvent("adBadRequest",t=>{ee(t.targetId),e.adBadRequest(t)}),Mr.onEvent("adLoadedMediated",t=>e.adLoadedMediated(t)),Mr.onEvent("adNoBidMediated",t=>e.adNoBidMediated(t))})}),Jr=(e,t)=>W(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 nn(),[];r&&(nn(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{te(e.id)})),H(null!=e?e:{}),yield Br();let a=an(s);return o&&(a=a.filter(e=>w(e.id))),a.length>0&&(qr=[...qr,...a.map(e=>Object.assign({},e))],ci(a),vi(a),yield Wr(a)),qr}),Yr=(e,t)=>W(void 0,void 0,void 0,function*(){var n;U.set(e),U.setHandlers(t),G.initialize(),window.addEventListener("message",Gn,!1),Mr=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=Mr,ye("Apn tag is set up on window"),yield Promise.allSettled([W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get();(yield Ke(e,t,n,"xandr-endpoint"))||Mr.setEndpoint("ib.adnxs-simple.com",!0)}),W(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:i}=U.get(),r=yield Ke(t,n,i,"prebid");(null==e?void 0:e.enabled)&&r&&(yield $t(null==e?void 0:e.url))}),mt(e),W(void 0,void 0,void 0,function*(){const{astUrl:e}=U.get();yield $t(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),W(void 0,void 0,void 0,function*(){const{gptUrl:e}=U.get();yield $t(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),W(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i,country:r}=U.get(),{getConsentAsync:o}=Ne(n,i,r),s=yield o();if(e&&t&&s){if(yield $t(t),document.querySelector(`.${Qi}`))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(Qi)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),Je(),W(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=U.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield $t(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Xi(),ye("Libraries have been loaded and trackers have been set"),yield(n=t.librariesToLoad,W(void 0,void 0,void 0,function*(){const e=n.map(e=>$t(e));yield Promise.all(e)})),yield Gr(),yield Br(),ye("Page options have been set"),Rr(e),ye("Advertory is setup on window"),qr=an(),ci(qr),vi(qr),yield Wr(qr),ye("Ads has been loaded",qr),pr(qr),yield t.replaceAdsWithFinnBlink(e.finnBlink),yield(e=>W(void 0,void 0,void 0,function*(){var t;if(!e.drEdition)return;if(!(yield Ke(e.tcf,e.isMobileApp,e.country,"handleDrEdition")))return;const n=yield Nn(),i=new jn(n);_n({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=yr}=e,r=document.querySelector(i);if(!r)return;Ir=!0;const o=()=>{kr(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=>W(void 0,void 0,void 0,function*(){const t=new Lr;yield t.run(e)}))(e)}),Zr=(e,t)=>W(void 0,void 0,void 0,function*(){yield((e,t)=>W(void 0,void 0,void 0,function*(){const{initConsentManager:n,getConsentAsync:i}=Ne(e.tcf,e.isMobileApp,e.country),r=yield mr(e);yield fe(),yield gr(n),yield gr(i),ye("TCF resolved successfully"),yield Yr(r,t),ye("Run function resolved successfully")}))(e,t)}),Qr="native_override_desc2",Xr=(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)},eo=(e,t)=>{const n=(i=Qr,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(Qr),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},to=(e,t)=>{const n=document.querySelector(`#${t}`);if(n)for(const t of Object.keys(e))n.style.setProperty(t,e[t])},no=(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(Tt).includes(i);n&&o&&ae(i,e,me,r)})(r,n),i())},io=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:[])ao(i)}),t.dataset.tracked="true")})},ro=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(so):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},oo=(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:de.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,ro(e),c.disconnect();break}},d);c.observe(r)},so=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?ao(e):window.navigator.sendBeacon(e)},ao=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},lo=(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=eo(e.targetId,l))&&void 0!==i?i:c,v=zt[t.language||Oe.NO],p=Xr(a,v,d);return(a.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);no(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{io(e),oo(e,t)})(e,t)})},co="viewable",uo="adClick";var vo=e=>(t,n,i)=>{const{video:r,img:o,url:s}=t,{publisher:a,productTag:d}=n,{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=po(r.content,s),h=go({id:u,nodeId:p,poster:v,tagURL:g,publisher:a,productTag:d,videoLoop:c});return ho({playerConfig:h,clickUrl:s,pluginsNames:l}),`${e(t,n,p)}`};const po=(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"}))},go=({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({},On(e)?e:{}),{provider:Object.assign(Object.assign({},On(null==e?void 0:e.provider)?e.provider:{}),{productTag:o})})}}),ho=e=>W(void 0,void 0,void 0,function*(){const{playerConfig:t,pluginsNames:n,clickUrl:i}=e,{repeat:r}=t,o=yield kn(t);Sn(n),o.once("assetReady",()=>{Tn(o,n)}),o.on(co,e=>{const{viewable:t}=e;t?o.play():o.pause()}),o.on(uo,()=>{window.open(i,"_blank")}),r&&o.on("pause",()=>{o.play()})}),mo=(e,t,n)=>{const i=e===En.ARTICLE||e===En.OTHER?.79:1;return{desktopTitleSize:t?Number(t)*i+"px":"clamp(22px, 3.6rem, 59px)",mobileTitleSize:n?`${n}px`:"clamp(22px, 3.6rem, 59px)"}},yo={0:633,1:395,2:562,3:541,4:630,5:549,6:596,7:493,8:579,9:596,A:702,B:651,C:644,D:724,E:598,F:560,G:690,H:773,I:356,J:344,K:680,L:576,M:897,N:714,O:725,P:618,Q:725,R:675,S:555,T:610,U:710,V:703,W:1004,X:745,Y:684,Z:608,"Æ":906,"Ø":727,"Å":702,a:541,b:595,c:479,d:612,e:480,f:383,g:528,h:629,i:322,j:303,k:603,l:315,m:916,n:636,o:563,p:607,q:595,r:481,s:445,t:367,u:632,v:573,w:815,x:586,y:574,z:540,"æ":743,"ø":569,"ö":563,"å":541,"ä":541,"é":480,"è":480,"(":343,")":343,"«":567,"»":567,".":253,",":257,"!":259,"?":446,"¿":441,"*":410,"&":783,"-":334,"–":545,":":276,";":278,"%":744,$:549,"€":722,"#":519,"+":600,"=":600,'"':389,"'":202,"`":347,"’":237,"\\":395,"/":395,"@":844," ":181,"­":0},fo=(e,t)=>{const n={"É":"E","é":"e","ü":"u"," ":" "};return[...e].reduce((e,i)=>e+(yo[n[i]||i]||yo.m)*t/1e3,0)},wo=(e,t,n=12,i=300)=>{let r=n,o=i,s=n;for(;r<=o;){const n=Math.floor((r+o)/2);fo(e,n)<=t?(s=n,r=n+1):o=n-1}const a=((e,t,n,i)=>{const r=Math.floor(e/t*(n-2));return r<i?i:r})(s,fo(e,s),t,n);return{fontSize:a,content:e}},bo=(e,t)=>{const[n,i]=(e=>{const t=e.trim().split(/\s+/);if(t.length<=1)return[e,""];let n=[e,""],i=1/0;for(let e=1;e<t.length;e++){const r=t.slice(0,e).join(" "),o=t.slice(e).join(" "),s=Math.abs(r.length-o.length);s<i&&(i=s,n=[r,o])}return n})(e);return[wo(n,t),wo(i,t)]},Eo=({title:e,options:t})=>{if(!t)return e;const{pageType:n,appearanceConfig:{mainColumnWidth:i}={}}=t,r=n===En.ARTICLE||n===En.OTHER?"em":"rem";return bo(e,(i||734)-64).map(({content:e,fontSize:t})=>`<span style="display: block; font-size: ${`${(t||16)/16}${r}`}">${e}</span>`).join("")},To=({containerId:e,url:t,adContent:n,logo:i,description:r,title:o,customTitle1:s,customTitle2:a},d,l)=>{const{desktopTitleSize:c,mobileTitleSize:u}=mo(null==d?void 0:d.pageType,s,a),v=Eo({title:o,options:d});return to({"--desktopTitleSize":`${c}`,"--mobileTitleSize":`${u}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${o}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${null!=l?l:0}"></div>\n </div>\n </div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-text-container">\n <div class="ad-description">${r}</div>\n <h2 class="ad-title">\n ${v}\n </h2>\n </div>\n </a>\n </div>\n </div>\n </div>\n </article>`},ko=({containerId:e,adText:t,url:n,adFrom:i,sponsoredBy:r,title:o},s,a)=>`<article class="advertory-vg-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>`,Io=({containerId:e,adText:t,url:n},i,r)=>{return`<article class="advertory-vg-ad-native-ukesmeny-video">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <span>${o=t,o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}</span>\n </div>\n <div class="ad-image-container">\n <div class="ad-player-wrapper">\n <div id="${r}"></div>\n </div>\n <a class="ad-link" href="${n}" target="_blank"></a>\n </div>\n </div>\n </article>`;var o},So=["IntegrationMenu"],Co={CONTENT:(e,t)=>{const{video:n}=e;return(null==n?void 0:n.content)?vo(To)(e,t):(({containerId:e,url:t,adContent:n,logo:i,imgAltText:r,img:o,description:s,title:a,customTitle1:d,customTitle2:l,imgWidth:c,imgHeight:u},v)=>{const{desktopTitleSize:p,mobileTitleSize:g}=mo(null==v?void 0:v.pageType,d,l),h=c?`width="${c}"`:"",m=u?`height="${u}"`:"",y=Eo({title:a,options:v});return to({"--desktopTitleSize":`${p}`,"--mobileTitleSize":`${g}`},e),`<article class="advertory-vg-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>${n}</span>\n <img alt="${a}" class="ad-logo" src="${i}" loading="lazy" />\n </div>\n <div class="ad-image-container">\n <img alt="${r}" class="ad-image" src="${o}" loading="lazy" ${h} ${m} />\n </div>\n <div class="ad-text-container">\n <div class="ad-description">${s}</div>\n <h2 class="ad-title">\n ${y}\n </h2>\n </div>\n </div>\n </a>\n </article>`})(e,t)},INHOUSE:({containerId:e,url:t,title:n,img:i,logo:r,sponsoredBy:o,imgWidth:s,imgHeight:a})=>`<article class="advertory-vg-ad-native-inhouse flexible">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${s?`width="${s}"`:""} ${a?`height="${a}"`:""} />\n ${r&&`<img alt="${o}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">\n <span class="sponsor-name">${o}</span>${o?"- En tjeneste fra VG":""}\n </span>\n <span class="ad-title">${n}</span>\n </div>\n </div>\n </a>\n </article>`,SPONSORSTRIPE:e=>(()=>{if(!ue())return!1;const e=CSS.supports("backdrop-filter: blur(20px)")||CSS.supports("-webkit-backdrop-filter: blur(20px)"),t=CSS.supports("-apple-visual-effect: -apple-system-glass-material");return e||t})()?(({title:e,sponsoredBy:t,logo:n})=>`\n <article class="advertory-vg-ad-native-sponsorstripe-liquidglass">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info"> <button id="sponsorstripe-info-close-button" aria-label="Lukk">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <g clip-path="url(#clip0_115_48295)">\n <path d="M10 19.3741C15.1777 19.3741 19.375 15.1768 19.375 9.99915C19.375 4.82148 15.1777 0.624146 10 0.624146C4.82233 0.624146 0.625 4.82148 0.625 9.99915C0.625 15.1768 4.82233 19.3741 10 19.3741Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6.25 13.7491L13.75 6.24915" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M13.75 13.7491L6.25 6.24915" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n <defs>\n <clipPath id="clip0_115_48295">\n <rect width="20" height="20" fill="white"/>\n </clipPath>\n </defs>\n </svg> \n </button>\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a class="ad-info-link" href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232">\n Les mer\n </a>\n </p>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-info-open-button" aria-label="Sponset innhold - Klikk for detaljer">\n \n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <g clip-path="url(#clip0_115_48287)">\n <path d="M11.25 14.375C10.2158 14.375 9.375 13.5342 9.375 12.5V9.375H8.75C8.405 9.375 8.125 9.095 8.125 8.75C8.125 8.405 8.405 8.125 8.75 8.125H9.375C10.0642 8.125 10.625 8.68583 10.625 9.375V12.5C10.625 12.845 10.905 13.125 11.25 13.125H11.875C12.22 13.125 12.5 13.405 12.5 13.75C12.5 14.095 12.22 14.375 11.875 14.375H11.25Z" fill="white"/>\n <path d="M9.6875 6.875C10.2053 6.875 10.625 6.45527 10.625 5.9375C10.625 5.41973 10.2053 5 9.6875 5C9.16973 5 8.75 5.41973 8.75 5.9375C8.75 6.45527 9.16973 6.875 9.6875 6.875Z" fill="white"/>\n <path d="M10 20C4.48583 20 0 15.5142 0 10C0 4.48583 4.48583 0 10 0C15.5142 0 20 4.48583 20 10C20 15.5142 15.5142 20 10 20ZM10 1.25C5.175 1.25 1.25 5.175 1.25 10C1.25 14.825 5.175 18.75 10 18.75C14.825 18.75 18.75 14.825 18.75 10C18.75 5.175 14.825 1.25 10 1.25Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_115_48287">\n <rect width="20" height="20" rx="10" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`)(e):(({title:e,sponsoredBy:t,logo:n})=>`<article class="advertory-vg-ad-native-sponsorstripe">\n <div id="advertory-vg-sponsorstripe-info" class="ad-info">\n <p class="ad-info-description">\n Annonsøren som presenterer denne saken har betalt for profilering av logoen i artikler som omhandler ${e.split(" ")[0].toLowerCase()}. \n <a\n href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232"\n class="ad-info-link"\n >\n Les mer\n </a>\n </p>\n <button id="sponsorstripe-info-close-button" aria-label="Lukk">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M6.91075 11.9107L8.8215 9.99999L6.91075 8.08925C6.58532 7.76381 6.58532 7.23618 6.91075 6.91074C7.23619 6.5853 7.76383 6.5853 8.08926 6.91074L10 8.82148L11.9108 6.91074C12.2362 6.5853 12.7638 6.5853 13.0893 6.91074C13.4147 7.23618 13.4147 7.76381 13.0893 8.08925L11.1785 9.99999L13.0893 11.9107C13.4147 12.2362 13.4147 12.7638 13.0893 13.0892C12.7638 13.4147 12.2362 13.4147 11.9108 13.0892L10 11.1785L8.08926 13.0892C7.76383 13.4147 7.23619 13.4147 6.91075 13.0892C6.58532 12.7638 6.58532 12.2362 6.91075 11.9107Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </button>\n </div>\n <div class="ad-wrapper">\n <button id="sponsorstripe-info-open-button" class="ad-open-button" aria-label="Sponset innhold - Klikk for detaljer">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n aria-hidden="true"\n >\n <path\n d="M10 5.83333C9.53977 5.83333 9.16668 6.20642 9.16668 6.66666C9.16668 7.1269 9.53977 7.49999 10 7.49999C10.4602 7.49999 10.8333 7.1269 10.8333 6.66666C10.8333 6.20642 10.4602 5.83333 10 5.83333Z"\n fill="white"\n />\n <path\n d="M9.16668 9.16666C9.16668 8.70642 9.53977 8.33333 10 8.33333C10.4602 8.33333 10.8333 8.70642 10.8333 9.16666V13.3333C10.8333 13.7936 10.4602 14.1667 10 14.1667C9.53977 14.1667 9.16668 13.7936 9.16668 13.3333V9.16666Z"\n fill="white"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M10 19.1667C4.9374 19.1667 0.833344 15.0626 0.833344 9.99999C0.833344 4.93738 4.9374 0.833328 10 0.833328C15.0626 0.833328 19.1667 4.93738 19.1667 9.99999C19.1667 15.0626 15.0626 19.1667 10 19.1667ZM10 17.5C14.1421 17.5 17.5 14.1421 17.5 9.99999C17.5 5.85786 14.1421 2.49999 10 2.49999C5.85787 2.49999 2.50001 5.85786 2.50001 9.99999C2.50001 14.1421 5.85787 17.5 10 17.5Z"\n fill="white"\n />\n </svg>\n </button>\n <span class="ad-title">${e}</span>\n <div class="ad-logo-wrapper">\n <img alt="${t}" class="ad-logo" src="${n}" />\n </div>\n </div>\n </article>`)(e),UKESMENY_SPONSORSTRIPE:({containerId:e,sponsoredBy:t,url:n,logo:i,title:r,customTitle1:o,customTitle2:s},{appearanceConfig:a})=>{const{isDarkModeEnabled:d}=null!=a?a:{},l=o?`${o}px`:"clamp(10px, 2rem, 30px)",c=s?`${s}px`:"clamp(10px, 1.8rem, 30px)",u=((e=":export{}")=>{const[,t]=e.split(":export{"),n=t.slice(0,-1).split(";").map(e=>e.split(":"));return Object.fromEntries(n)})(),v=d?u["c-white-primary"]:u["c-brown-primary"];to({"--desktopTitleSize":`${l}`,"--mobileTitleSize":`${c}`,"--fontColor":`${v}`},e);const p=`${e}-description`;return`<article class="advertory-vg-ad-native-ukesmeny-sponsor-stripe">\n <div class="ad-info" id="${e}-button"></div>\n <div class="ad-content">\n <div class="ad-header">\n <a class="ad-link" href="${n}" target="_blank">\n <span style="--desktopTitleSize: ${l}; --mobileTitleSize: ${c};" class="title">${r}</span>\n </a>\n <a class="ad-link" href="${n}" target="_blank"> \n <img alt="${t}" class="ad-logo" src="${i}" />\n </a>\n <div class="info-button-wrapper" onClick="${(e=>`\n const adDescription = window.document.getElementById('${e}');\n adDescription.classList.toggle('hide');\n `)(p)}"><div class="info-button"></div></div>\n </div>\n <div id="${p}" class="description hide"> <span>Annonsøren som presenterer ukemenyen har betalt for profilering av logoen på VG-forsiden og Godt.no, og annonsen mellom oppskriftene.</span> <a href="https://www.vg.no/informasjon/redaksjonelle-avgjorelser/232" target="_blank">Les mer</a></div>\n </div>\n </article>`},UKESMENY:({containerId:e,url:t,imgAltText:n,img:i})=>`<article class="advertory-vg-ad-native-ukesmeny">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>Annonse</span></div>\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" />\n </div>\n </div>\n </a>\n </article>`,UKESMENY_VIDEO:(e,t)=>vo(Io)(e,t,{pluginsNames:So,videoLoop:true}),DEFAULT:({containerId:e,url:t,adText:n,img:i,logo:r,adFrom:o,sponsoredBy:s,title:a,imgWidth:d,imgHeight:l})=>`<article class="advertory-vg-ad-native">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header"><span>${n}</span></div>\n <div class="ad-image-container">\n <img alt="${a}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n ${r&&`<img alt="${s}" class="ad-logo" src="${r}" loading="lazy" />`}\n </div>\n <div class="ad-text-container">\n <span class="sponsored-by">${o} ${s}</span>\n <span class="title">${a}</span>\n </div>\n </div>\n </a>\n</article>`,RECIRC:({containerId:e,url:t,title:n,img:i,adText:r,sponsoredBy:o,logo:s,description:a,imgWidth:d,imgHeight:l})=>`<article class="advertory-shared-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${n}" class="ad-image" src="${i}" loading="lazy" ${d?`width="${d}"`:""} ${l?`height="${l}"`:""} />\n <img alt="${o}" class="ad-logo" src="${s}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="ad-sponsor">${r} ${o}</span>\n <h6 class="ad-title">${n}</h6>\n <span class="ad-description">${a}</span>\n </div>\n </div>\n </a>\n </article>`,PODME:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-vg-ad-native-podme">\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 <span class="ad-title">${t}</span>\n <span class="ad-description">${n}</span>\n </div>\n <div class="ad-small-image-container">\n <img alt="${t}" class="ad-small-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo">\n <img alt="Podme logo" src="${r}" loading="lazy" />\n </div>\n </div>\n </div>\n </div>\n </a>\n</article>`,PODME_SECTION:({url:e,title:t,description:n,img:i,logo:r})=>`<article class="advertory-vg-ad-native-podme-section">\n <a class="ad-link" href="${e}" target="_blank">\n <div class="ad-content-wrapper">\n <div class="ad-text-container">\n <span class="ad-title">\n ${t}\n </span>\n <span class="ad-description">\n ${n}\n </div>\n </div>\n <div class="ad-image-container">\n <img alt="podme-ad" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-logo-container">\n <img alt="podme-logo" class="ad-logo" src="${r}" loading="lazy" />\n </div>\n </div>\n </a>\n</article>`,FISHFINGER:({img:e,title:t,sponsoredBy:n,logo:i,url:r})=>`<article class="advertory-vg-ad-native-fishfinger">\n <a class="ad-link" href="${r}" rel="noopener noreferrer" target="_blank">\n <div class="ad-content">\n <img class="ad-image" src="${e}" alt="${n}" />\n <span class="ad-title">${t}</span>\n <img class="ad-logo" src="${i}" alt="${n}" />\n </div>\n </a>\n </article>`,SHOPPING:({containerId:e,url:t,logo:n,imgAltText:i,img:r,description:o,title:s,imgWidth:a,imgHeight:d},l)=>`<article class="advertory-vg-ad-native-affiliate">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-header">\n <span>ANNONSE</span>\n ${n?`<img alt="${s}" class="ad-logo" src="${n}" loading="lazy" />`:""}\n </div>\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" loading="lazy" ${a?`width="${a}"`:""} ${d?`height="${d}"`:""} />\n </div>\n <div id="testxd" class="ad-text-container">\n ${o?`<div class="ad-description">${o}</div>`:""}\n <h2 id="scalable-text-container" class="ad-title">\n ${Eo({title:s,options:l})}\n </h2>\n </div>\n </div>\n </a>\n </article>`,DEFAULT_VIDEO:(e,t)=>vo(ko)(e,t),SEAMLESS_IMAGE:({containerId:e,url:t,adText:n,img:i,cta:r,description:o,logo:s,sponsoredBy:a,title:d})=>`<article class="advertory-vg-ad-native-seamless-image">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-content">\n <div class="ad-header">\n <div class="ad-header-text">\n <div class="sponsored-by">${a}</div>\n <div class="ad-annons"><span>${n}</span></div>\n </div>\n ${s&&`<img alt="${a}" class="ad-logo" src="${s}" loading="lazy" />`}\n </div>\n <div class="ad-image-container">\n <img alt="${d}" class="ad-image" src="${i}" loading="lazy" />\n </div>\n <div class="ad-text-container">\n <span class="description">${o}</span>\n <button class="ad-action">${r}</button>\n </div>\n </div>\n </a>\n </div>\n </article>`},Ao={NATIVE_TEMPLATE:({containerId:e,url:t,sponsoredBy:n,title:i,img:r,adText:o})=>`<article class="advertory-no-ad-native-default">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`,NATIVE_RECIRC:({containerId:e,url:t,sponsoredBy:n,title:i,img:r,adText:o})=>`<article class="advertory-no-ad-native-recirc">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_self">\n <div class="ad-content">\n <div class="ad-image-container">\n <img alt="${i}" class="ad-image" src="${r}" />\n </div>\n <div class="ad-text-container">\n <div class="ad-sponsor">\n <span class="ad-label">${o}</span> ${n}\n </div>\n <div class="ad-title">${i}</div>\n </div>\n </div>\n </a>\n </article>`},$o={displayTemplates:{content:Co.CONTENT,content_internal:Co.CONTENT,inhouse:Co.INHOUSE,sponsorstripe:Co.SPONSORSTRIPE,"ukesmeny-stripe":Co.UKESMENY_SPONSORSTRIPE,ukesmeny:Co.UKESMENY,sponsor:Co.SPONSORSTRIPE,sponsortop:Co.SPONSORSTRIPE,standard:Co.STANDARD,recirc:Co.RECIRC,podme:Co.PODME,podme_section:Co.PODME_SECTION,fishfinger:Co.FISHFINGER,shopping:Co.SHOPPING,native:Ao.NATIVE_TEMPLATE,native_recirc:Ao.NATIVE_RECIRC,default:Co.DEFAULT,seamless_image:Co.SEAMLESS_IMAGE},videoTemplates:{content:Co.CONTENT,recirc:Co.DEFAULT_VIDEO,default:Co.DEFAULT_VIDEO,menu:Co.UKESMENY_VIDEO}},Oo=(e,t)=>{e.style.position="fixed",e.style.transform=`translateY(${t}px)`},Po=(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;Oo(n,i)})(e.isIntersecting,n,r)),s=new ResizeObserver(()=>((e,t)=>{Oo(t,e.offsetHeight)})(n,r));o.observe(n),s.observe(n)},Lo=e=>document.querySelector(e)||document.querySelector(`[class*="${e}"]`),xo=(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&&Po(o,i),()=>r&&((e,t)=>{const n=document.querySelector(`#${e}`);if(!n)return;const[i,r]=t;if(!i)return;const o=()=>{const e=Lo(i),t=r?Lo(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())},No=e=>{e.style.removeProperty("min-height"),e.style.removeProperty("min-width")},jo={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return ye(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,t)=>{try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ye(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){ye(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},_o="finn_blink_id",Mo=e=>W(void 0,void 0,void 0,function*(){const{id:t,hashed_email:n,theme:i}=e,r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["id","hashed_email","theme"]),o=window[ie.Blink];if(!o)return;const s=new o({remote:"https://www.finn.no/distribution-front/external/carousel",id:t,hashed_email:n,theme:i});yield s.inject(r)}),qo=e=>{var t,n;const i=document.querySelector(`[id^="${e}"]`);return null!==(n=null===(t=null==i?void 0:i.dataset)||void 0===t?void 0:t.finnBlinkId)&&void 0!==n?n:e},Do=(e,t)=>{const{finnBlink:{enabled:n}={}}=U.get(),i=(null==t?void 0:t.enabled)||(e=>{var t;const n=document.querySelector(`[id^="${e}"]`);return!!(null===(t=null==n?void 0:n.dataset)||void 0===t?void 0:t.noBidAd)})(e);if(!i||!n)return null;const{limit:r,height:o,requireImage:s,theme:a,rec:d,distributionTypes:l,position:c,offset:u,advertoryTheme:v}=t||{};return{selector:`#${qo(e)}`,enabled:i,position:null!=c?c:e,distributionTypes:null!=l?l:[],limit:null!=r?r:100,height:null!=o?o:100,offset:null!=u?u:200,requireImage:s,rec:d,theme:"dark"===a?"dark":"light",advertoryTheme:v}},Ro=(e,t,n)=>W(void 0,void 0,void 0,function*(){const{placements:i,deviceType:r}=U.get();ye(`rendering finn blink ad for ${e}`);const o=we(e),s=i[r].find(e=>e.id===o),a=Do(e,null==s?void 0:s.finnBlink),{publisher:d,country:l,finnBlink:c}=t,{userId:u,uuid:v,channel:p,theme:g}=null!=c?c:{},h=null!=p?p:`${d}.${l}`,m=(e=>{if(!e){const e=_e();return null!=e?e:""}return e})(u),y="dark"===g?"dark":"light";if(!(null==a?void 0:a.enabled))return ye(`Finn blink is not enabled on placement: ${e}`),n&&n(e),void cr(e);if((e=>{var t;const n=qo(e),i=document.querySelector(`[id^="${n}"]`);return!!(null===(t=null==i?void 0:i.classList)||void 0===t?void 0:t.contains("finn"))})(e))ye(`Finn blink already loaded ${e}`);else try{const e=yield W(void 0,void 0,void 0,function*(){const{finnBlink:{identifierUrl:e}={}}=U.get(),t=jo.get(_o),n=Ae("finncode");if(!e||n)return"";if(!t){const t=yield rt.get(e,{credentials:"include"}),{finn_blink_id:n}=t;if(!n)throw new Error("getFinnBlinkIdentifier: No finn_blink_id found");return jo.set(_o,n),n}return t});yield Mo(Object.assign(Object.assign({},a),{hashed_email:e,channel:h,id:m,theme:y,uuid:v})).then(()=>{((e,t)=>{const{siteSpecificConfig:{publisherClassName:n}={},pageType:i}=U.get(),r=document.querySelector(`#${e}`);if(!r)return;if(r.classList.add("disable-cogwheel"),!n)return;ae(n,r,he,null!=t?t:i),tr({preferredTestIdData:{targetId:e,testId:"finn"}})})(a.selector.replace("#",""),a.advertoryTheme)})}catch(t){ye(`Finn blink error ${t}`),n&&n(e),!n&&ee(e),cr(e)}}),Bo=((e,t)=>n=>Zr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;u(e)&&No(i);const{pageType:r=En.FRONT,nativeTrackingConfig:o,appearanceConfig:s,deviceType:a}=null!=t?t:{},d={language:Oe.NO,publisher:Tt.VG,deviceType:a,pageType:r,nativeTrackingConfig:o,appearanceConfig:s,productTag:"partnerstudio"};lo(e,d,$o),xo(e,null==t?void 0:t.sponsorstripe)},wallpaperHandlers:{initWallpaperAd:(e,t)=>{if(!t)return;const{options:{appMainContainerSelector:n,wallpaperAnchorSelector:i}={}}=t;(e=>{const t=document.querySelector(e||"#application");if(!t)return;Z();const n=document.createElement("div");n.classList.add(J),document.body.insertBefore(n,t.nextSibling),n.style.setProperty("position","fixed"),n.style.setProperty("width","100%"),n.style.setProperty("height","calc(100% - var(--header-height, 0) - 15px)"),n.style.setProperty("background-position","center top"),n.style.setProperty("background-repeat","no-repeat")})(n),(e=>{const t=e||".advertory-wrapper-common-skyscraperleft_1",n=document.querySelector(t);n&&(Q(n),window.addEventListener("scroll",()=>Q(n)))})(i),e()},adjustAdToHorseshoe:e=>{var t;const n=document.querySelector(`#${e}`);n&&(null===(t=n.parentElement)||void 0===t||t.classList.add(Y),n.classList.add(Y))}},loadFinnBlinkAd:(e,t,n,i)=>W(void 0,void 0,void 0,function*(){const{isMobileApp:r}=U.get();if(ye(`loadFinnBlinkAd: loading finn blink ad for ${e}`),!(yield W(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=U.get(),{getConsentAsync:i}=Ne(e,t,n),r=yield i();return!(!(null==e?void 0:e.enabled)||!r)||(ye("Skip loading finn blink ad due to missing TCF consent."),!1)}))||r)return n&&n(e),void cr(e);yield oe(se),yield Ro(e,t,n),i&&i()}),replaceAdsWithFinnBlink:e=>W(void 0,void 0,void 0,function*(){if(!e)return;yield oe(se);const{replacementConfig:t}=e;if(!((()=>{const e=document.getElementById("ads-advertory-anchor");return!(e&&"none"!==getComputedStyle(e).display&&window.advertoryFluepapir)})()&&(null==t?void 0:t.adsToReplace)&&(null==t?void 0:t.sizes)&&e.enabled))return void ye(`Finn blink configuration is incorrect: ${JSON.stringify(t)}`);const{adsToReplace:n,sizes:i}=t;n.forEach(([e,t])=>{const n=document.querySelector(`[id^="${e}"]`);if(!n)return;const i=be(t);(e=>{ye(`Hiding old ad container: ${e.id}`),e.style.setProperty("display","none","important")})(n),Ee(n,i),n.dataset.finnBlinkId=t,ne().withFullAdsChain(e)})}),preparePageOptions:bt,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=U.get(),o=((e,t)=>{const{isMobileApp:n}=U.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=`${Ye()}-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=`${Ye()}-targetid`;return e?{[t]:[e]}:{}})(n),d=Et(),c=(e=>It(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(i),u=((e,t)=>It(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(i);return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),s),a),c),d),rendererOptions:u})},siteEvents:Ce,librariesToLoad:[]},{publisherClassName:Tt.VG,fullWidthFormatClassName:"netboard"});var Fo=Object.freeze({__proto__:null,default:""});export{Bo as initAdvertoryPackage,Jr as updateAdvertory};