@schibsted/advertory 2.54.13 → 2.55.0

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 (105) hide show
  1. package/core/aftenposten/es/index.css +1 -1
  2. package/core/aftenposten/es/index.d.ts +4 -3
  3. package/core/aftenposten/es/index.js +1 -1
  4. package/core/aftenposten/index.d.ts +4 -3
  5. package/core/aftenposten/index.js +1 -1
  6. package/core/aftonbladet/es/index.css +1 -1
  7. package/core/aftonbladet/es/index.d.ts +4 -3
  8. package/core/aftonbladet/es/index.js +1 -1
  9. package/core/aftonbladet/index.d.ts +4 -3
  10. package/core/aftonbladet/index.js +1 -1
  11. package/core/aftonbladetv2/es/index.css +1 -1
  12. package/core/aftonbladetv2/es/index.d.ts +4 -3
  13. package/core/aftonbladetv2/es/index.js +1 -1
  14. package/core/bt/es/index.css +1 -1
  15. package/core/bt/es/index.d.ts +4 -3
  16. package/core/bt/es/index.js +1 -1
  17. package/core/bt/index.d.ts +4 -3
  18. package/core/bt/index.js +1 -1
  19. package/core/e24/es/index.css +1 -1
  20. package/core/e24/es/index.d.ts +4 -3
  21. package/core/e24/es/index.js +1 -1
  22. package/core/e24/index.d.ts +4 -3
  23. package/core/e24/index.js +1 -1
  24. package/core/e24v2/es/index.css +1 -1
  25. package/core/e24v2/es/index.d.ts +4 -3
  26. package/core/e24v2/es/index.js +1 -1
  27. package/core/fotbollskanalen/es/index.d.ts +4 -3
  28. package/core/fotbollskanalen/es/index.js +1 -1
  29. package/core/fotbollskanalen/index.d.ts +4 -3
  30. package/core/fotbollskanalen/index.js +1 -1
  31. package/core/godare/index.d.ts +4 -3
  32. package/core/godare/index.js +1 -1
  33. package/core/godt/index.d.ts +4 -3
  34. package/core/godt/index.js +1 -1
  35. package/core/klart/index.d.ts +4 -3
  36. package/core/klart/index.js +1 -1
  37. package/core/koket/es/index.css +1 -1
  38. package/core/koket/es/index.d.ts +4 -3
  39. package/core/koket/es/index.js +1 -1
  40. package/core/koket/index.d.ts +4 -3
  41. package/core/koket/index.js +1 -1
  42. package/core/kompakt/index.d.ts +4 -3
  43. package/core/kompakt/index.js +1 -1
  44. package/core/minmote/index.d.ts +4 -3
  45. package/core/minmote/index.js +1 -1
  46. package/core/pent/index.d.ts +4 -3
  47. package/core/pent/index.js +1 -1
  48. package/core/sa/es/index.css +1 -1
  49. package/core/sa/es/index.d.ts +4 -3
  50. package/core/sa/es/index.js +1 -1
  51. package/core/sa/index.d.ts +4 -3
  52. package/core/sa/index.js +1 -1
  53. package/core/svd/es/index.css +1 -1
  54. package/core/svd/es/index.d.ts +4 -3
  55. package/core/svd/es/index.js +1 -1
  56. package/core/svd/index.d.ts +4 -3
  57. package/core/svd/index.js +1 -1
  58. package/core/svdv2/es/index.css +1 -1
  59. package/core/svdv2/es/index.d.ts +4 -3
  60. package/core/svdv2/es/index.js +1 -1
  61. package/core/tek/index.d.ts +4 -3
  62. package/core/tek/index.js +1 -1
  63. package/core/tv4/es/index.d.ts +4 -3
  64. package/core/tv4/es/index.js +1 -1
  65. package/core/tv4/index.d.ts +4 -3
  66. package/core/tv4/index.js +1 -1
  67. package/core/tvnu/index.d.ts +4 -3
  68. package/core/tvnu/index.js +1 -1
  69. package/core/vg/es/index.css +1 -1
  70. package/core/vg/es/index.d.ts +4 -3
  71. package/core/vg/es/index.js +1 -1
  72. package/core/vg/index.d.ts +4 -3
  73. package/core/vg/index.js +1 -1
  74. package/core/vgv2/es/index.css +1 -1
  75. package/core/vgv2/es/index.d.ts +4 -3
  76. package/core/vgv2/es/index.js +1 -1
  77. package/features/ad-native/index.d.ts +4 -3
  78. package/features/dr-edition/es/index.d.ts +4 -3
  79. package/features/dr-edition/es/index.js +1 -1
  80. package/features/dr-edition/index.d.ts +4 -3
  81. package/features/dr-edition/index.js +1 -1
  82. package/features/tracker/index.d.ts +4 -3
  83. package/package.json +1 -1
  84. package/sites/aftenposten/es/index.css +1 -1
  85. package/sites/aftonbladet/es/index.css +1 -1
  86. package/sites/aftonbladetv2/es/index.css +1 -1
  87. package/sites/bt/es/index.css +1 -1
  88. package/sites/e24/es/index.css +1 -1
  89. package/sites/e24v2/es/index.css +1 -1
  90. package/sites/koket/es/index.css +1 -1
  91. package/sites/sa/es/index.css +1 -1
  92. package/sites/svd/es/index.css +1 -1
  93. package/sites/svdv2/es/index.css +1 -1
  94. package/sites/svdv2/es/index.d.ts +4 -4
  95. package/sites/svdv2/es/index.js +1 -1
  96. package/sites/tv4/es/index.css +1 -1
  97. package/sites/tvnu/index.js +1 -1
  98. package/sites/vg/es/index.css +1 -1
  99. package/sites/vgv2/es/index.css +1 -1
  100. package/styles/svdv2/styles.css +1 -1
  101. package/types/features/interface/tracker.d.ts +4 -3
  102. package/types/sites/svdv2/formats/Insider/index.d.ts +1 -1
  103. package/types/sites/svdv2/formats/Panorama/index.d.ts +1 -1
  104. package/types/sites/svdv2/formats/Toppanorama/index.d.ts +1 -1
  105. package/types/sites/svdv2/formats/Widescreen/index.d.ts +1 -1
@@ -1 +1 @@
1
- "use strict";function e(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{d(i.next(e))}catch(e){o(e)}}function s(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(a,s)}d((i=i.apply(e,t||[])).next())})}require("react/jsx-runtime"),"function"==typeof SuppressedError&&SuppressedError;const t=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},n=e=>new Promise(n=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void n(!1);const i=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const n=Number(e);return t("Advertising permission value obtained synchronously: ",e),Boolean(n)})();if(null!==i)return void n(i);let r=!1;const o=e=>{r||(t("Resolving advertising permission value obtained"),r=!0,n(e))},a=setTimeout(()=>{t("Advertising permission timed out, resolving with false"),o(!1)},3e3);window._tcf_.onTcfReady(()=>{t("On Tcf Ready called, waiting for permission"),clearTimeout(a)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(a);const n=Number(e);t("Advertising permission value obtained asynchronously: ",e),o(Boolean(n))})}),i="cmp:loaded";let r,o=!1;const a=(a,s)=>{const d=!!(null==a?void 0:a.enabled),l=(null==a?void 0:a.timeout)||3e3,c=(u="bypass_tcf",new URLSearchParams(window.location.search).get(u));var u;const v=()=>{if(!(null==a?void 0:a.enabled))return!0;if(((e,n)=>e?!!n&&(t("TCF bypass param detected, returning consent: true"),!0):(t("TCF is not enabled, returning consent: true"),!0))(d,c))return!0;if(o)return null;if(!r)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const e=r.getConsentedToAllSync();return t(`TCF consented to all is: ${e}`),r.getConsentedToAllSync()};return{initConsentManager:()=>(null==a?void 0:a.enabled)?new Promise((e,n)=>{if(t("Getting TCF consent manager..."),window._tcf_)return t("TCF consent manager is already available"),r=window._tcf_,void e(r);t("TCF consent manager is not available");const a=()=>{t("CMP loaded, resolving consent manager..."),s&&clearTimeout(s),window._tcf_?(r=window._tcf_,e(r)):n(new Error("CMP loaded but window._tcf_ is not defined"))},s=setTimeout(()=>{document.removeEventListener(i,a),o=!0,n(new Error("Timeout waiting for CMP to load"))},l);t("Listening for CMP loaded event..."),document.addEventListener(i,a,{once:!0})}):Promise.resolve(null),getConsentSync:v,getConsentAsync:()=>e(void 0,void 0,void 0,function*(){if(null==a?void 0:a.schibstedAdChoicesOverrideValue)return t(`Schibsted Ad Choices override value is set, returning override value: ${a.schibstedAdChoicesOverrideValue}`),Boolean(Number(a.schibstedAdChoicesOverrideValue));if(null==a?void 0:a.schibstedAdChoicesEnabled)return t("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield n(a);if(!(null==a?void 0:a.enabled))return!0;const e=v();return null!==e?e:yield new Promise((e,t)=>{try{if(!r)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");r.isConsentedToAll(t=>{e(t)})}catch(e){t(e)}})})}};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,l;var c=s(function(){if(l)return d;l=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)?s((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 a(e,t,i){var a={};return i.isMergeableObject(e)&&r(e).forEach(function(t){a[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])?a[r]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(r,i)(e[r],t[r],i):a[r]=n(t[r],i))}),a}function s(t,r,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(r);return s===Array.isArray(t)?s?o.arrayMerge(t,r,o):a(t,r,o):n(r,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},d=s}());const u=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],v={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},p=6;class g{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 u){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=c(g.DEFAULT_SITE_HANDLERS,e)}}g.DEFAULT_SITE_HANDLERS={siteEvents:v,initNativeAd:function(){}};const h=new g,m=h.modifyConfigProperties.bind(h),y=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},f={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},w=9826;class b{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=f.DESKTOP,isMobileApp:t}=h.get();if(t){return{"aa-sch-supply_type":`app_${e===f.MOBILE?"phone":f.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(t){return e(this,void 0,void 0,function*(){return Object.assign(Object.assign({},t),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(t.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=y("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return e(this,void 0,void 0,function*(){return yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get(),{getConsentAsync:n}=a(e);if(!(yield n()))return;const i=y("_pulse2data");return i?i.split(",")[9]:void 0})})}isTrackingForbidden(){return e(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=w}=h.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}=h.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get(),{getConsentAsync:n}=a(e);return{"aa-sch-cmp_advertising":(yield n())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=h.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}=h.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 E=new b;E.prepare.bind(E);function k(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),r=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}class I extends b{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=f.DESKTOP}=h.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return{width:e||n||0,height:t||i||0}}(),t={width:null!==(i=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==i?i:0,height:null!==(o=null===(r=window.screen)||void 0===r?void 0:r.height)&&void 0!==o?o:0};var n,i,r,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}})}getAppTypeKeywords(){const{isMobileApp:e}=h.get(),{appMode:t,mobileOS:n}=k(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}}const A=864e5,x=(()=>{const e=e=>{const n=window.localStorage.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch(e){return t("Error with parsing localStorage data"),null}},n=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:n,setWithTimestamp:(e,t,i=A)=>{const r={data:t,expirationTime:(new Date).getTime()+i};n(e,JSON.stringify(r))},getByTimestamp:(n,i=A)=>{const r=e(n);if(!r)return null;if(!i)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return t("Error with parsing localStorage data"),null}}}})(),T={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return t(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,n)=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch(e){t(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){t(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},S={NO:"no",SE:"se"},C="advertory:ppids-cache",P={[S.SE]:`SCH${S.SE.toUpperCase()}-EnvHash`,[S.NO]:`SCH${S.NO.toUpperCase()}-EnvHash`},O={[S.SE]:`SCH${S.SE.toUpperCase()}-UserHash`,[S.NO]:`SCH${S.NO.toUpperCase()}-UserHash`},L={[S.SE]:`sch${S.SE}-envhash-v3`,[S.NO]:`sch${S.NO}-envhash-v3`},$={[S.SE]:`sch${S.SE}-userhash-v3`,[S.NO]:`sch${S.NO}-userhash-v3`},j={[S.SE]:`'sch${S.SE}-iosid-v3'`,[S.NO]:`'sch${S.NO}-iosid-v3'`},N={[S.SE]:`sch${S.SE}-androidid-v3`,[S.NO]:`sch${S.NO}-androidid-v3`},_={[S.SE]:"sdrn:schibsted.com:user",[S.NO]:"sdrn:spid.no:user"},D=t=>e(void 0,void 0,void 0,function*(){const e=yield t.getEnvironmentId();if(!e)return null;return`sdrn:schibsted:environment:${e}`}),M=(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield t.getUserId();if(!e)return null;return`${_[n]}:${e}`}),q=()=>e(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 R{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 e(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 t("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return e(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 B="advertory-session",F=e=>{const{privacyBroker:{storageKeyPrefix:t=B}={}}=h.get();return t+"-"+e},z=()=>{const{privacyBroker:{storageKeyPrefix:e=B}={}}=h.get(),t=sessionStorage;for(const n in t)0===n.indexOf(e+"-")&&T.remove(n)},H={LOCAL:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",DEV:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",PRE:"https://user-permissions.privacy-pre.schibsted.io/privacy/v2",PRO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_NO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_FI:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_DK:"https://user-permissions.privacy.schibsted.com/privacy/v2"},V={get:(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield fetch(t,n);if(!e.ok)throw new Error(e.statusText);return yield e.json()}),post:(t,n,i)=>e(void 0,void 0,void 0,function*(){const e=JSON.stringify(i),r=yield fetch(t,{method:"POST",headers:n,body:e});if(!r.ok)throw new Error(r.statusText);return yield r.json()})},U=n=>e(void 0,[n],void 0,function*({endpoint:n,identityFacade:i,environment:r}){var o;z();const a=yield(t=>e(void 0,void 0,void 0,function*(){const e=new Headers;e.set("Content-Type","application/json");const n=yield t.getIdentityUser();return n&&e.set("Authorization",`SPIDSIG ${n.sig}`),e}))(i);try{const e=null!==(o=H[r])&&void 0!==o?o:H.PRO;return yield V.get(`${e}${n}`,{headers:a})}catch(e){return t("[PrivacyBroker] Failed to fetch permissions",e),null}}),W=()=>e(void 0,void 0,void 0,function*(){var n,i;const{privacyBroker:{enabled:r,clientId:o}={},tracker:{instance:a}={},country:s,tcf:{schibstedAdChoicesEnabled:d}={}}=h.get();if(d)return t("[Privacy Broker]: Schibsted Ad Choices enabled, skipping permissions fetching"),null;if(!r||!a||!o)return t("[Privacy Broker]: Data not present",{enabled:r,trackerInstance:a}),null;const l=yield q(),c=new R(l);if(!l||!c)return t("[Privacy Broker]: Data not present",{identity:l,identityFacade:c}),null;const u=yield c.isUserLoggedIn();c.onIdentityLogout(()=>{t("[Privacy Broker]: clearPermissions"),z()}),t("[Privacy Broker]: Creating endpoint for fetching permissions started");const v=null!==(n=yield M(a,s))&&void 0!==n?n:"",p=null!==(i=yield D(a))&&void 0!==i?i:"",g=u?v:p,m=yield((t,n,i)=>e(void 0,void 0,void 0,function*(){const e=`/schacc/${n}/user/${i}/permissions`,r=`/anonymous/${n}/user/${i}/permissions`;return(yield t.getIdentityUser())?e:r}))(c,o,g);t(`[Privacy Broker]: Endpoint created ${m}`);const y=(e=>!!T.get(F(e)))(g),f=F(g);if(y){t("[Privacy Broker]: SessionStorage cached",{key:f,permissions:sessionStorage.getItem(f)});return T.get(f)}t("[Privacy Broker]: Fetching permissions...");const w=yield(t=>e(void 0,[t],void 0,function*({endpoint:e,timeout:t,identityFacade:n,environment:i}){return yield Promise.race([U({endpoint:e,environment:i,identityFacade:n}),new Promise(e=>setTimeout(()=>e(null),t))])}))({endpoint:m,timeout:500,identityFacade:c,environment:l.env});return w?(t("[Privacy Broker]: Permissions fetched",w),E=g,(null==(b=w)?void 0:b.permissions)&&T.set(F(E),b.permissions),w):(t("[Privacy Broker]: Permissions not found",{permissions:w,isLoggedIn:u,identifiedId:g,country:s}),null);var b,E}),K="glimrTags",G=["glwe_","glwet_"],J={geofenceTags:[],geoTags:[],weatherTags:[]},Y=(n,i,...r)=>e(void 0,[n,i,...r],void 0,function*(e,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return t(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return t(`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}=a(e);return(yield r())?(t(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(t(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Q=()=>e(void 0,void 0,void 0,function*(){const{privacyBroker:n,tcf:i,isMobileApp:r}=h.get();if(null==i?void 0:i.schibstedAdChoicesEnabled){return yield Y(i,r,"glimr")}if(null==n?void 0:n.enabled){const n=(e=>{const n=null==e?void 0:e.find(e=>e.purpose.includes("targeted_advertising"));if(t("targeted_advertising permissions",n),!(null==n?void 0:n.data)||!Array.isArray(null==n?void 0:n.data))return!1;const i=null==n?void 0:n.data.find(e=>e.includes("geolocation"));return t("geolocation permission",i),!!i})(yield e(void 0,void 0,void 0,function*(){var e,n;const{country:i,tracker:{instance:r}={}}=h.get(),o=yield q();if(!r||!o)return t("[Privacy Broker] No tracker found."),null;const a=new R(o),s=yield a.isUserLoggedIn(),d=null!==(e=yield M(r,i))&&void 0!==e?e:"",l=null!==(n=yield D(r))&&void 0!==n?n:"",c=F(s?d:l);return T.get(c)||null}));return n}return!0}),X=()=>e(void 0,void 0,void 0,function*(){const{glimr:n}=h.get();if(!(yield Q())||!(null==n?void 0:n.enabled))return void t("No consent for glimr data fetching.");const i=yield(r=500,e(void 0,void 0,void 0,function*(){return yield Promise.race([e(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),r))])}));var r;if(i)try{i.setTagCacheTimeInSeconds(300),yield new Promise(e=>{i.getTags(n.clientId,(t,n)=>{x.setWithTimestamp(K,{tags:t,tagMappings:n}),e(!0)})})}catch(e){t(`Error during getting glimr data: ${e}`)}else t("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:i})}),Z=()=>{const{country:e}=h.get();return e===S.NO?"no-sno":"se-generic"},ee=()=>{const{country:e,publisher:t}=h.get();return`${e}-${t}`},te={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"},ne=e=>G.some(t=>e.startsWith(t)),ie=e=>e.startsWith("glgc_"),re=e=>!ne(e)&&!ie(e),oe=e=>{const t=ae();if(!t)return J;const n=((e=[])=>e.filter(ne))(t),i=((e=[])=>e.filter(ie))(t),r=((e=[],t)=>{const n=e.filter(re);if(t){const{publisher:e}=h.get(),t=te[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},ae=()=>{const e=x.getByTimestamp(K);return e&&"string"!=typeof e?null==e?void 0:e.tags:null};class se{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 de=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(t){return e(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,n;return null!==this.ppid1&&null!==this.ppid2||t("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(n=this.ppid2)&&void 0!==n?n:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},le=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(t,n){return e(this,void 0,void 0,function*(){var e,i,r,o,a,s,d,l,c,u,v;const p=x.get(C),g=yield this.getNewPPIDs(t,n);if(this.shouldHash(p,g)){const n=null!==(e=t.hasherUrl)&&void 0!==e?e:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,n);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!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=g.idfv)||void 0===s?void 0:s.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,n;return null!==this.ppid1&&null!==this.ppid2||t("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(n=this.ppid2)&&void 0!==n?n:"",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}}:{});x.set(C,r)}hashPPIDs(n,i){return e(this,void 0,void 0,function*(){try{const e=new Headers({"Content-Type":"application/json"});return yield V.post(i,e,n)}catch(e){return t("Error with hashing PPIDs",e),null}})}getNewPPIDs(t,n){return e(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield M(t,n),r=yield D(t),o=window.advertory_idfv,a=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}}:{}),a?{anId:{plain:a}}:{})})}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}}},ce=n=>e(void 0,void 0,void 0,function*(){const{tracker:e,tcf:i,country:r,isMobileApp:o}=n;if(!(yield Y(i,o,"setXandrPPIDs")))return;if(!e)return;(yield Promise.allSettled([de.processPPIDs(e,null==i?void 0:i.timeout),le.processPPIDs(e,r)])).forEach((e,n)=>{if("rejected"===e.status){t(`Cannot fetch PPIDs v${n+2}`,e.reason)}})}),ue=e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:a}=le.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]).add(o,j[e]).add(a,N[e]).buildEids()}]}},ve=e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:a}=le.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]).add(o,j[e]).add(a,N[e]).buildRyEids()}}]}}};const pe=new class extends I{prepare(n){return e(this,void 0,void 0,function*(){const i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":S.SE},this.getPublisherKeywords()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield this.getAdvertisingConsentKeywords()),this.getAnalyticsConsentKeywords()),yield this.getExternalIdSrc()),this.getHasContextKeywords(n.keywords)),yield e(void 0,void 0,void 0,function*(){const{glimr:e}=h.get(),{addPublisherToGeo:n}={},i=yield Q();if(!(null==e?void 0:e.enabled)||!i)return t("No consent for getting glimr tags."),{};const r=Z(),o=oe(n);return{[`${r}-geo`]:o.geoTags,[`${r}-weather`]:o.weatherTags,[`${r}-geofence`]:o.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=de.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),n.keywords);return Object.assign(Object.assign({},n),{keywords:i,user:Object.assign(Object.assign({},ue(S.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var ge=pe.prepare.bind(pe);const he={adRequested:()=>{},adAvailable:()=>{},adLoaded:e=>{(e=>{var t;const n=null===(t=document.getElementById(`${e.targetId}`))||void 0===t?void 0:t.parentElement;n&&e.width>=1260&&e.width<=1280&&n.classList.add("advertory-klart-l-format")})(e)},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},me={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"},ye={publisherClassName:me.KLART,fullWidthFormatClassName:"panorama",classesToRemoveOnRefresh:["advertory-klart-l-format"]};class fe{initialize(){this.DATA=Object.assign({},fe.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)}}fe.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const we=new fe,be=()=>(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),Ee=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),ke=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=h.get(),r=[`${Z()}-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:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},Ie=(t,...n)=>e(void 0,[t,...n],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=()=>{s(),n()},a=()=>{s(),i(new Error(`Failed to load ${e}`))},s=()=>{r.removeEventListener("load",o),r.removeEventListener("error",a),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",a);const d=setTimeout(()=>{s(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),Ae=()=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:n,country:i,isMobileApp:r}=h.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=h.getHandlers(),{getConsentAsync:s}=a(n),d=yield s(),l=(()=>{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=be(),{prebid:{relevantCbTimeout:o}={}}=h.get(),a="relevantCb"===i&&o?o:n[i].timeout,s=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,r.loadTags&&r.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),c=be(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=be();return{user:e,keywords:t}})();l.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Ee();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(l.getCancel()||!c.loadTags)return t("core loadTags() call was cancelled",{cancel:l.getCancel(),apnTagLoadTags:!c.loadTags,condition:"or"}),void l.cleanup();const n=Ee();l.events.relevantCb.done=!0,l.failsafeOnTimeout("auctionCb");const r=d?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};t("prebid consentManagement",r),n.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},ve(i)),ke(p,v))),t("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},ve(i)),ke(p,v))),n.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{l.getCancel()||(l.events.auctionCb.done=!0,c.loadTags(e)),l.cleanup()}},customNativeRender:e=>{xe(e,o)}}),t("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{l.getCancel()||(l.events.auctionCb.done=!0,c.loadTags(e))}},customNativeRender:e=>{xe(e,o)}})})}),xe=(e,t)=>{var n;const{divId:i,native:r,bid:o}=e,a=document.querySelectorAll(`[id^=${i}]`)[0],s=`RY-${a.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)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:r,targetId:s},h.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},Te="0123456789abcdefghijklmnopqrstuvwxyz",Se=()=>Promise.resolve(),Ce=()=>{},Pe=e=>{window.apntag.anq.push(e)},Oe=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),Le=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})}),$e="ABSOLUTE_FULLSCREEN",je="ANY_FULLSCREEN",Ne="VERTICAL_FULLWIDTH",_e="FULLWIDTH",De="TAKEOVER",Me="VELVET_TAKEOVER",qe="WALLPAPER",Re="COLLAPSE",Be={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}]},Fe={wallpaper:1600,"l-format":1600},ze=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&nt(e,je)},He=e=>{const{native:t}=e;return!!t},Ve=e=>nt(e,_e),Ue=e=>{const{targetId:t}=e;return t.includes("takeover")||nt(e,De)},We=e=>nt(e,De),Ke=e=>nt(e,qe),Ge=e=>nt(e,Re),Je=e=>e.targetId.includes("sponsorstripe"),Ye=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},Qe=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),Xe=e=>e.targetId.startsWith("midboard"),Ze=e=>e.width>=1260&&e.width<=1280,et=e=>e.width>=1600&&e.width<=1620,tt=e=>{var t,n;return"string"==typeof(null===(t=e.native)||void 0===t?void 0:t.desc2)&&(null===(n=e.native)||void 0===n?void 0:n.desc2.endsWith("_alcohol"))},nt=(e,t)=>{const n=Be[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,a=t.width===r,s=!t.height||t.height===o;return a&&s})},it=e=>e.includes("snoap.no"),rt=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)},ot=(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()},at=ot([],()=>{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,a=e/r,s=t/o;i.style.transform=`scale(${a},${s})`,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}),st=e=>{const t=ot([],()=>{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},dt=[],lt={},ct=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=vt(e);n?(ut(i,n),pt(e,i,t)):(ut(i,n),gt(e,i,t))})},ut=(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}`,"*")},vt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},pt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),dt.includes(t)||dt.push(t),n&&window.addEventListener("scroll",lt[t],{passive:!0})},gt=(e,t,n)=>{dt.includes(t)&&(n&&window.removeEventListener("scroll",lt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},ht=(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=[],a=[];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&&a.push(t)}),()=>{o.length&&mt(e,o,r,0),a.length&&mt(e,a,r,40)}},mt=(e,t,n,i)=>{const r=e.offsetHeight,o=window.scrollY,a=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>o?(a-o)/t-i:(o+t-(a+r))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})};function yt(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}yt('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const ft={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 wt=null;const bt=(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=`(${at})()`,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(it(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=st(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>it(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)),it(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)),rt(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},Et=()=>{wt=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=()=>{wt||(wt=window.requestAnimationFrame(Et))},It=(e,t)=>{var n,i,r,o;const{country:a}=h.get(),{targetId:s}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:r="16px 0",beforeContentValue:o=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${i} calc(50% - ${a}px),\n ${i} calc(50% + ${a}px),\n ${n} calc(50% + ${a}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 }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(i=null==t?void 0:t.overlayStyles)&&void 0!==i?i:{});const d=document.getElementById(s),l=null==d?void 0:d.parentElement;d&&l&&(((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>ct(e,n),{}),r=vt(e);i.observe(e),n&&(lt[r]=ht(e,t))})(l,t),d.className="advertory-fullscreen-scroll",nt(e,$e)&&(d.style.position="absolute"),l.className="advertory-fullscreen-scroll-wrapper",l.dataset.showTagSubscribeId=s,d.setAttribute("data-ad-label",ft[a].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),kt(),window.addEventListener("resize",kt),null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",kt),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",kt))},At=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=rt(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=rt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,bt(t,e))},xt=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};let Tt="";const St=new Map,Ct="advertory-wallpaper-background",Pt=()=>{const e=document.querySelector(`.${Ct}`);e&&e.remove()},Ot=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,Lt=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")&&Pt())},$t=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"))},jt=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`)},Nt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=we.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},_t=()=>{Pt();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Lt(e.id),Nt(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=xt(e.id)}),Pe(()=>window.apntag.clearRequest())},Dt="noGroupedPlacements",Mt=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},qt=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}=h.get(),o=n[r].filter(Mt)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=o.reduce((e,t)=>{const n=(e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t})(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)),s=(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=a.querySelectorAll(s),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{const i=Rt(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=Te[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&&we.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}=h.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Tt!==window.location.pathname&&(St.clear(),Tt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=St.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${ee()}-count`]=i,St.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))})(s)},Rt=(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},Bt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=h.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=xt(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[i,r]of Object.entries(t))n[i]=e.filter(e=>r.includes(xt(e.id)));return n})(e,i),s=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(xt(e.id))))(e,new Set([...s,...r]));return Object.assign(Object.assign(Object.assign({},a),o),{[Dt]:d})},Ft=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:r}=window,[o,a]=t;if(!i.dataset.lockedsize&&a&&o)i.style.width=`${o}px`,i.style.height=`${a}px`,n&&(r.resizeAd(i.id,[o,a]),i.dataset.lockedsize="true",i.dataset.lockedwidth=o.toString(),i.dataset.lockedheight=a.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])}},zt=["netboard","board"];class Ht{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")||""})(),a=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",r),o&&s.searchParams.append("urlData",o),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(n){return e(this,void 0,void 0,function*(){var e,i;const r=yield this.identityFacade.getIdentityUser(),o=null!==(i=yield null===(e=this.tracker)||void 0===e?void 0:e.getEnvironmentId())&&void 0!==i?i:"",a=(null==r?void 0:r.userId)?String(r.userId):"",s=this.buildUrl(n,{envId:o,spid:a});try{t("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},n=yield V.get(s,e);return t("Fetch operation completed successfully."),n}catch(e){t("Error during fetch operation:",e)}return null})}}class Vt{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:a}=t,s=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:r,utm_medium:s},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(t,n){return e(this,void 0,void 0,function*(){const{id:e,autoplay:i,mute:r,videoLoop:o,vendor:a}=n.videoConfiguration;t.classList.add("vgtv-video-container"),Object.assign(t.dataset,{vgtvVideoId:e,vgtvVendor:a,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 Ut=e=>{const n=e.parentElement;n?n.classList.remove("dr-edition-lock-height"):t("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Wt{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(n,i){return e(this,void 0,void 0,function*(){var e,r;const{drEditionConfig:{containerSelector:o},renderAsBackfill:a=!1}=i,s=n.querySelector(o);if(!s)return void t(`Container with selector "${o}" not found.`);const d=yield this.drEditionService.fetchData(i);return(null==d?void 0:d.itemId)||a?!(null==d?void 0:d.itemId)&&a?(t("No Dr. Edition ads available to render. Collapsing whole placement."),Lt(n.id),void Ut(s)):((null==d?void 0:d.itemId)&&a&&(t("Dr. Edition ad available to render as a Xandr backfill."),$t(n.id)),void(d?(d.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(d.css,"style"),yield this.rendererManager.render(s,d,i),yield null===(e=this.videoManager)||void 0===e?void 0:e.handle(d,i),Ut(s),this.drEditionAds.push(d),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(d.itemId),this.observeAdView(n,d,i),null===(r=n.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)):Ut(s))):(t("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(n),void Ut(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:"";$t(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 Kt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(t,n,i){return e(this,void 0,void 0,function*(){if(!(null==n?void 0:n.itemId))return;const{getConsentAsync:e}=a(i.tcf,i.isMobileApp),r=yield e(),o=i.device===f.MOBILE?n.mobileHTML:n.desktopHTML;const s=r?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");t.innerHTML=s,t.querySelectorAll("a").forEach(e=>{var t,r,o;e.search=null!==(o=null===(r=(t=this.newsroomStrategy).getUrlSearchParams)||void 0===r?void 0:r.call(t,e,n,i))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,n,i)})})}}class Gt{constructor(e){this.strategy=e}handle(t,n){return e(this,void 0,void 0,function*(){const{videoConfiguration:{id:e,preview:i}={}}=t;(e||i)&&(yield this.importScript(n),yield this.createVideoElement(t,n))})}importScript(n){return e(this,void 0,void 0,function*(){const e=n.drEditionConfig.videoScriptUrl,i=document.querySelector(`script[src="${e}"]`);if(e&&!window.autoplayQueue&&!i)try{yield Ie(e)}catch(e){t("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(t,n){return e(this,void 0,void 0,function*(){const e=document.createElement("div"),{node:i}=t.videoConfiguration,r=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(t,n))return;this.strategy.handleVideo(e,t),null==r||r.appendChild(e),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==r?void 0:r.parentNode;if(!o)return;const a=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,r;const{preview:{url:o,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("playsinline",""),!(!s||!a)&&(null===(r=(i=t.drEditionConfig).addPreviewVideo)||void 0===r||r.call(i,s),!0))}}class Jt{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(t,n,i){return e(this,void 0,void 0,function*(){var e,r,o,a,s;if(!this.pulse)return;const d=this.getEventInput(t,n,i,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackViewUIElement)?null===(o=null===(r=this.pulse)||void 0===r?void 0:r.trackViewUIElement)||void 0===o||o.call(r,d):null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackElementView)||void 0===s||s.call(a,d)})}trackContentClick(t,n,i){return e(this,void 0,void 0,function*(){var e,r,o,a;if(!this.pulse)return;const s=this.getEventInput(t,n,i,"click");this.pulse.trackClickUIElement?null===(r=(e=this.pulse).trackClickUIElement)||void 0===r||r.call(e,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class Yt extends Jt{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:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:a,primaryPosition:s},"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)}}}class Qt extends Jt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,r,o,a,s,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!==(a=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulseObjectId)||void 0===o?void 0:o.call(r))&&void 0!==a?a: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===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,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,a,s;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!==(s=null!==(a=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!==a?a:p)&&void 0!==s?s:"";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 Xt={FRONT:"front"},Zt=t=>e(void 0,void 0,void 0,function*(){var e,n;return(null===(e=null===window||void 0===window?void 0:window.SVP)||void 0===e?void 0:e.Player)?new window.SVP.Player(t):((()=>{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(t):yield new Promise(e=>{window.addEventListener("onSvpPlayerReady",()=>e(new window.SVP.Player(t)))}))}),en={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 e(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Pr})})}})}};class tn{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:i,autoplay:r,mute:o,vendor:a}}){yield e(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"],d=this.createPlayerOverlay(t);var l,c;c=d,null==(l=s)||l.forEach(e=>{en[e](c)});const u={id:n,node:i,autoplay:r,mute:o,vendor:a,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},v=yield Zt(u);v.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(v,s)}),v.once("ready",()=>{const e=t;new MutationObserver(t=>{t.forEach(({type:t,attributeName:n})=>{"attributes"===t&&"class"===n&&(e.classList.contains("jw-state-playing")?d.classList.add("is-playing"):d.classList.remove("is-playing"),e.classList.contains("jw-flag-user-inactive")?d.classList.add("is-inactive"):d.classList.remove("is-inactive"))})}).observe(e,{attributes:!0,attributeFilter:["class"]})}),v.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield v.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===Xt.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 nn="https://www.aftonbladet.se/video-player-extras/latest/";class rn{handleVideo(t,n){return e(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const a={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:{[`${nn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${nn}external-link.js`]:{name:"ExternalLink"}}};yield Zt(a),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 an{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:i,autoplay:r,mute:o,vendor:a}}){const s={id:n,node:i,autoplay:r,mute:o,vendor:a,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-${n}`]},requestSettings:{}}}},d=yield Zt(s);d.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield d.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===Xt.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class sn{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const dn=(e,t,n)=>{const{publisher:i,pageType:r,country:o}=e,a={[me.VG]:new Vt,[me.E24]:new tn,[me.AFTONBLADET]:new rn,[me.SVD]:new an}[i]||new sn,s=new(o===S.SE?Yt:Qt)(n,a,r),d=new Ht(t,null==n?void 0:n.pulseTracker),l=new Kt(a,s),c=new Gt(a);return new Wt(d,l,c,s)},ln=(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=dn(n,i,r);e.forEach(e=>{var i,r,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(i=s.dataset.editionName)&&void 0!==i?i:"",l=null!==(r=s.dataset.pulseColumnname)&&void 0!==r?r:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";o.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(i,r,e,t,n),{rootMargin:"400% 0px"});r.forEach(e=>o.observe(e))},cn=[],un=(n,i)=>e(void 0,void 0,void 0,function*(){var e;const{pulse:r,tcf:o,deviceType:a,drEdition:s,publisher:d,pageType:l,country:c,isMobileApp:u}=n;if(!(yield Y(o,u,"handleDrEditionBackfill")))return;const v=((e,t)=>{var n;const{deviceType:i,placements:r,drEdition:{fallbackGlobalEditionName:o}={}}=e,a=r[i]||r.desktop,s=xt(t.targetId),d=a.find(e=>e.id===s),l=zt.some(e=>s.startsWith(e)),c=cn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(cn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(n,i);if(!v)return;if(!(null==r?void 0:r.instance))return void t("Pulse has not been passed as a prop, aborting");const p=yield q(),g=new R(p),h=dn({publisher:d,pageType:l,country:c},g,null==r?void 0:r.instance),m=document.getElementById(i.targetId);if(!m||!s)return;m.classList.value="";const y=document.createElement("div");y.className=s.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=y.outerHTML;const f={editionName:(null===(e=null==v?void 0:v.drEdition)||void 0===e?void 0:e.editionName)||"",drEditionConfig:s,device:a,tcf:o,isMobileApp:u,renderAsBackfill:!0};yield h.fetchAndRenderAd(m,f)}),vn="collapseAd",pn="hideAd",gn="resizeAd",hn="renderDrEditionFallback",mn="wallpaperImageUrl",yn="wallpaperColor",fn="velvet",wn=[gn,mn,yn,vn,pn,hn,fn];let bn;const En=e=>{if("object"==typeof e)return e;if(t=e,Ot.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:mn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:yn,wallpaperColor:t}}if(e.startsWith(hn)){const t=e.split(":")[1];return{name:hn,targetId:t}}if(e.startsWith(vn)||e.startsWith(pn)){const t=e.split(":")[1];return{name:vn,targetId:t}}if(e.includes("name")&&wn.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=En(t);if(!n)return;if(!n.name||!wn.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:a,cmd:s,size:d}=n;i===fn&&s&&(s.includes("noScroll")&&(bn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==bn||bn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==vn&&i!==pn||!r||Lt(r),i===gn&&r&&s&&Ft(r,s),i===hn&&r&&(Lt(r),un(h.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&Ft(r,d,!0),i===mn&&o&&(e=>{const t=document.querySelector(`.${Ct}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===yn&&a&&(e=>{const t=document.querySelector(`.${Ct}`);t&&(t.style.backgroundColor=e)})(a)},In=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),An=(n,i)=>{if(Ye(i))return t(`loading finn blink ad with full ads chain for ${i}`),void(()=>{const{publisher:t,country:n,finnBlink:i}=h.get(),{loadFinnBlinkAd:r,wallpaperHandlers:{adjustAdToHorseshoe:o}}=h.getHandlers(),a=window.apntag,s={publisher:t,country:n,finnBlink:i},d=e=>{$t(e),Pe(()=>a.showTag(e))};return{withXandrAd:d,withFinnBlinkAd:t=>e(void 0,void 0,void 0,function*(){yield r(t,s,null)}),withFullAdsChain:t=>e(void 0,void 0,void 0,function*(){yield r(t,s,d,()=>{we.getData("horseshoe").isAvailable&&o(t)})})}})().withFullAdsChain(i);Pe(()=>(t("core showTag",{id:i}),n.showTag(i)))},xn=(n,i)=>e(void 0,void 0,void 0,function*(){yield Oe,yield Le;const e=new IntersectionObserver((e,n)=>((e,n,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:r}=e,o=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(r),a=document.getElementById(o);t("core log from intersection observer handler",{targetId:o,element:a}),i(window.apntag,o),a&&(n.unobserve(a),n.disconnect())})})(e,n,An),In(i));e.observe(n)}),Tn=new Map,Sn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Cn=".brandstudio-premium-content-widget",Pn=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),On=({adWrapper:e,placementContainer:t})=>{const n=Pn({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Nt(i=t),i.innerHTML=""},Ln=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},$n=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=h.get(),i=Sn.includes(n)&&Boolean(t.closest(Cn));const r=i?t.closest(Cn):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!i&&!a||i&&!r)return;if(a)return Ln(e),void o.disconnect();const s=t.closest('[style*="height"]'),d=r;s&&d.contains(s)?Ln(s):d.hasAttribute("style")&&Ln(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},jn=(e,t,n,i,r,o)=>{var a;const s=performance.now(),d=null!==(a=Tn.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;s-d>=r&&l&&(Tn.set(t,s),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&On({adWrapper:i,placementContainer:n}),Pe(()=>{e.setKeywords([t],{[`${Z()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},Nn=(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,jn,n,i),In(t));r.observe(e)},_n=(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},Dn=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),Mn=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},qn=(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;$n({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,a=(new Date).getTime();if(i&&"true"!==i.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:i}=h.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,a,s,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!==(a=null==t?void 0:t.renderMargin)&&void 0!==a?a:150},low:{refreshMargin:null!==(s=null==n?void 0:n.refreshMargin)&&void 0!==s?s: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&&Nn(i,e,a,o)}},Rn=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=h.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Vn(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Bn=(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;Mn(r,o)&&i&&(jt(i.id),n.length&&r.classList.remove(...n),Vn([i],t))}},Fn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=h.get();t&&(e.forEach(({id:e})=>{const t=zn(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{Bn(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),Bn(e,!1,t))};n.persisted&&(Dn()?window.addEventListener("scroll",i,{passive:!0}):Bn(e,!1,t))})})(e,n))},zn=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Hn=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(zn(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},Vn=(e,t=!1)=>{const{requestSize:n=p}=h.get(),i=e.map(({id:e})=>e),r=_n(i,n);if(t)for(const t of e){const e=Hn(t);window.apntag.modifyTag(t.id,e)}for(const e of r)Pe(()=>window.apntag.refresh(e))};const Un="#fff",Wn="#0098da",Kn="splash",Gn="welcomePage",Jn="topscroller",Yn="velvet",Qn="takeover-displayed",Xn=()=>{const{takeover:{enabled:e=!1}={}}=h.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||e&&!Zn())},Zn=()=>{var e;const t=(null===(e=h.get().takeover)||void 0===e?void 0:e.cookieCapName)||Qn;return"true"===y(t)},ei=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),ti=()=>{const{takeover:e}=h.get();return Boolean(null==e?void 0:e.topscroller)},ni=()=>e(void 0,void 0,void 0,function*(){const e=14400,t=document.location.hostname,{takeover:{cookieCapName:n=Qn,cookieCapTime:i=e}={},isMobileApp:r,tcf:o}=h.get(),a=yield Y(o,r,"ad-takeover-cookiecap");i&&a&&(window.document.cookie=`${n}=true; max-age=${i}; domain=${t}; path=/`)}),ii=e=>{var t;const n=!!(null===(t=h.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return Ue(e)&&n},ri=(e,t)=>{var n;if(t===Jn){const{topscroller:t}=e;return null!=t?t:{}}if(t===Kn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},oi=(e,t)=>{t!==Kn?(e=>{var t,n,i;const r=null===(n=null===(t=h.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=h.get().takeover)||void 0===i?void 0:i.topscroller;if(!r||o)return;const a=document.querySelector(r),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&l&&d))return;const c=null==a?void 0:a.offsetHeight,u=We(e)?"60svh":`calc(100svh - ${c}px)`,v=We(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;s.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=h.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)},ai=ot([],()=>{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})}),si=(e,t=!0)=>{(e===Gn||e===Jn)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},di=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},li=e=>{document.body.style.overflow=e?"initial":"hidden"},ci=e=>{const t=vi(e),n=ui(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),li(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},ui=e=>{const t=()=>ci(e);return window.addEventListener("advertory:closeTakeover",t),di(),t},vi=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&ci(e)};return di(),window.addEventListener("keydown",t),t},pi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(vi(e),ui(e),di(),t.addEventListener("click",()=>{ci(e)}),li(!1))},gi=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),ui(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},hi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>ci(e))})(e)},mi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=h.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=ft.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},yi=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=ft.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},fi=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=ft.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},wi=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},bi=()=>{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)},Ei=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${ai})()`,e+t.outerHTML})(e)),n},ki=e=>{const t=(e=>{const{requests:t}=window.apntag,n=rt(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=rt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ei(t))},Ii=t=>e(void 0,void 0,void 0,function*(){const{takeover:e}=h.get(),{targetId:n}=t,i=document.querySelector(`#${n}`),r=document.querySelector(".advertory-takeover-wrapper");if(!i||!r||!e)return;const o=(e=>{const{width:t,height:n}=e;return ei(t,n)?Kn:nt(e,Me)?Yn:ti()?Jn:Gn})(t),a=r.offsetHeight,s=window.scrollY>a;r.style.display="block",!s&&si(o,!1),((e,t)=>{({[Gn]:fi,[Kn]:mi,[Jn]:yi,[Yn]:wi})[t](e)})(r,o),bi(),((e,t)=>{({[Gn]:gi,[Jn]:gi,[Kn]:pi,[Yn]:hi})[t](e)})(r,o),((e,t,n)=>{if(!n)return;({[Gn]:()=>{const{buttonLabel:i}=ri(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:"")})},[Kn]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:a}=ri(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&&a){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:Un,"important"),n.style.color=null!=t?t:Wn}}})},[Jn]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=ri(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:""))})},[Yn]:()=>{}})[t]()})(r,o,e),yield ni(),!s&&si(o,!0),oi(t,o)});yt(".advertory-brandmetrics-survey{width:100%}");const Ai="advertory-brandmetrics-survey",xi=()=>e(void 0,void 0,void 0,function*(){const{norstat:{enabled:t}={},country:n,isMobileApp:i,tcf:r}=h.get(),o=yield Y(r,i,"norstat");if(!t||i||!o)return;const a=(e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r}=le.getPPIDs(),o=(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(n);((t,n,...i)=>{e(void 0,[t,n,...i],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/${n===S.NO?"schibsted":"schibstedse"}/map/${a}`,"norstat")}),Ti={nativeAd:e=>He(e)&&!Je(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:Ve,fullscreenScroll:ze,topscroller:e=>Ue(e)&&ti(),splash:e=>Ue(e)&&ei(e.width,e.height),welcomePage:Ue,wallpaper:Ke,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:Ze,hFormat:et,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!et(e)&&!Ze(e),topboard:e=>e.targetId.startsWith("topboard")&&!Ue(e),widescreen:e=>e.targetId.startsWith("widescreen"),insider:e=>e.targetId.startsWith("insider"),sponsorstripe:Je,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!Qe(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!Xe(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:Qe,midboard:Xe},Si=({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 a=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;a&&(t.dataset.invCode=a)})(r,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const a="DIV"===(null==o?void 0:o.tagName);e&&a&&((e,t)=>{var n,i;for(const[r,o]of Object.entries(Ti))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)},Ci=e=>{var t;return(null===(t=Object.entries(Ti).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Pi=new Map;Pi.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Pi.set("panorama",{scale:.79,transformOrigin:"center center"}),Pi.set("outstream",{scale:.79,transformOrigin:"center center"}),Pi.set("integration",{scale:.79,transformOrigin:"center center"}),Pi.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Oi=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=Ci(e),r=Pi.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 a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==o?void 0:o.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},Li=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}={}}=h.get();if(!t||!n||!i)return;const a=window.innerWidth,s=Math.round(a/1080*1920);t.style.width="100%",t.style.height=`${s}px`,t.classList.add(`advertory-${r}-${o}__vertical-full-width-ad`);const d=((e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1})(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"},$i=(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,ji=e=>`externalImpId:'${e}'`,Ni=e=>{var n;const{forwardExternalImpId:i=!1,tracker:r}=h.get(),o=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${ee()}-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:a,sizes:s,keywords:d,allowedFormats:l,invCode:c,ssa:u=!1,nativeCustomProperties:v,safeframeConfig:p,resizeAdParentDiv:g=!1,dynamicSizeWidthCheck:m=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Xn())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!==Jn),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})})(o),y=Object.assign({invCode:c,sizes:s,targetId:a,keywords:$i(d,u),allowedFormats:l,resizeAdParentDiv:g,dynamicSizeWidthCheck:m},p&&{safeframeConfig:p}),f=(e=>{var n,i,r,o,a,s,d;return e?(null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)?(null===(r=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===r?void 0:r.pageViewId)?(t("Tracker state pageViewId is:",null===(a=null===(o=null==e?void 0:e.instance)||void 0===o?void 0:o.state)||void 0===a?void 0:a.pageViewId),null===(d=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===d?void 0:d.pageViewId):(t("Tracker state does not contain field pageViewId or it is empty"),""):(t("Tracker state is empty"),""):(t("Tracker is not configured in initAdvertory function"),"")})(r);i&&f&&(t("External Impression ID assigned to defineTag:",ji(f)),y.externalImpId=ji(f));const w=(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}}))(v);return(null===(n=e.allowedFormats)||void 0===n?void 0:n.includes("native"))&&(y.native=w),y},_i=e=>{const{source:t}=e;return"csm"===t},Di="native-ad",Mi=e=>{if(!e)return e;const t=e[`${Z()}-targetid`],n=t?xt(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Z()}-targetid`]:[n]})},qi=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Z()}-geo`]&&{[`${Z()}-geo`]:["geo-test-value"]}),e[`${Z()}-geofence`]&&{[`${Z()}-geofence`]:["geofence-test-value"]}),e[`${Z()}-weather`]&&{[`${Z()}-weather`]:["weather-test-value"]}),Ri=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"})})()},Bi=(t,n)=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{t().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})}),Fi=()=>e(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)}}),zi={arrayMerge:(e,t)=>t},Hi=n=>e(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))})(n))return n;try{const i=yield(n=>e(void 0,void 0,void 0,function*(){const e=(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})(n);if(!e)return null;const i=new AbortController,r=setTimeout(()=>i.abort(),5e3);try{return yield V.get(e,{method:"GET",signal:i.signal})}catch(n){throw t("Failed to fetch S3 config",{error:n,url:e}),n}finally{clearTimeout(r)}}))(n);return i?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:r,placements:o,threshold:a,batchSize:s}=t,d=c.all([e.placements,o],zi),l=c(e.pageOptions,{keywords:i},zi),u=c(e.appearanceConfig,{defaultThreshold:a},zi),v=c(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:r},zi);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=s?s:e.requestSize,pageOptions:l,appearanceConfig:u,refreshConfig:v})})({siteConfig:n,configOverrides:i}):n}catch(e){return t("Error fetching S3 config, using site config",{error:e}),n}}),Vi=".advertory-right-column-track",Ui="--advertory-right-column-track-height",Wi=e=>e.getBoundingClientRect().top+window.scrollY,Ki=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},Gi=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},Ji=(e,t)=>`${e}-${t}`,Yi=(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 a=Wi(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=Ki(e);Gi("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=Wi(e),r=Ji(Ui,t),o=i-n,a=Ji("--advertory-right-column-split-point-height",t),s=Ki(e);Gi(r,o),Gi(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Ji("--advertory-right-column-ad-height",t),i=Ki(e);Gi(n,i)})(r[t])});((e,t)=>{const n=Wi(e);Gi(Ui,n-t)})(o[o.length-1].point,a)};let Qi=!1;let Xi,Zi=[];const er=["takeover","wallpaper"],tr=e=>{const t=(e=>{const t=we.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:a,requestSize:s=p,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m,useAppTabletInvCode:y}=e;return{xandr:{member:g,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:s,isMobileApp:v,useAppTabletInvCode:y},o&&{glimr:o}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},nr=()=>e(void 0,void 0,void 0,function*(){const{pageOptions:t}=h.get(),{preparePageOptions:n}=h.getHandlers(),i=(()=>{const{sandboxAdIframeEnabled:e=!0}=h.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"]}})(),r=yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get();return(yield Y(e,t,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield n(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},t),{renderingManagement:Object.assign({},i)}),r));(e=>{const t=we.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=qi(e);we.setData("alertoryConfigKeywords",n)})(o.keywords),Pe(()=>Xi.setPageOpts(o))}),ir=n=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:i,isMobileApp:r}=h.get();rr(n);const o=yield Y(i,r,"prebid");(null==e?void 0:e.enabled)&&o?(t("core loadPlacements prebid enabled"),yield Ae()):(t("core load tags invoked without prebid enabled"),or(n))}),rr=e=>{const{prepareTag:n}=h.getHandlers(),i=[];(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=>{t("core defineTags",{placement:e});const r=Ni(e);if(!e.id.includes("takeover")||Xn()){const o=n(r),a=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:Mi(i),sizes:r}})(o);i.push(a),Pe(()=>(t("core defineTag - add to the queue",{placement:e,preparedTag:o}),Xi.defineTag(o)))}}),(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)})(i)},or=e=>{const n=e.map(({id:e})=>e);Pe(()=>(t("core loadTags",{placementsIdsToLoad:n}),Xi.loadTags([...n])))},ar=(n,i)=>e(void 0,void 0,void 0,function*(){const{appearanceConfig:e,deviceType:r}=h.get(),{threshold:o,refresh:a,priority:s="normal"}=n,d=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(i),l=null==e?void 0:e.defaultThreshold[r];d&&(t("core showAd - subscribe for show tag with thresholds",{placement:n,adObj:i,threshold:o,deviceDefaultThreshold:l}),yield xn(d,null!=o?o:l)),d&&a&&(t("core showAd - setup refreshing",{placement:n,adObj:i}),d.dataset.refresh=a.toString(),d.dataset.priority=s)}),sr=e=>e.some(({id:e})=>er.some(t=>e.includes(t))),dr=n=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return;const{requestSize:i=p}=h.get(),r=Bt(n);for(const e of Object.keys(r)){const n=r[e],o=_n(n,i);for(const e of o)sr(e)?(t("core loadAds without lazy loading",{placementsToLoad:e}),yield ir(e)):e.length&&(t("core loadAds with lazy loading",{placementsToLoad:e}),yield lr(e))}}),lr=n=>e(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:e=!1,rootMargin:i="200% 0px"}={}}={}}=h.get(),r=[];if(!e)return t("lazy load is not enabled",{placements:n}),void(yield ir(n));const o=new IntersectionObserver((e,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{t("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:n});const o=n.every(e=>r.includes(e.id)),a=n.map(e=>e.id);!o&&r.push(...a),!o&&ir(n),t("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:n,arePlacementsLoaded:o,placementIds:a}),i.disconnect()})},{rootMargin:i});n.forEach(e=>{const n=document.getElementById(e.id);n&&(t("lazy loading - observe element",{placementId:e.id,element:n}),o.observe(n))})}),cr=()=>e(void 0,void 0,void 0,function*(){const{siteEvents:n,initNativeAd:i,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:o}}=h.getHandlers(),{wallpaper:a,fullscreenScroll:s}=h.get(),d=[];Pe(()=>{Xi.onEvent("adRequested",()=>{n.adRequested()}),Xi.onEvent("adAvailable",o=>e(void 0,void 0,void 0,function*(){var e,d,l,c,u,v;t("core adAvailable start",{placementsAvailable:Zi,adObj:o,isFullscreenScrollAd:ze(o),isFinnBlink:Ye(o.targetId),isNativeAd:He(o),isMediation:_i(o),isTakeoverAd:Ue(o),isCollapseAd:Ge(o),isWallpaperAd:Ke(o)});const p=null===(l=null===(d=null===(e=null===window||void 0===window?void 0:window.apntag)||void 0===e?void 0:e.requests)||void 0===d?void 0:d.tags[o.targetId])||void 0===l?void 0:l.adResponse.ads;_i(o)&&p&&(null===(c=p[1])||void 0===c?void 0:c.rtb)&&(o.banner=null===(v=null===(u=p[1])||void 0===u?void 0:u.rtb)||void 0===v?void 0:v.banner),ze(o)&&At(o),ze(o)&&!Ye(o.targetId)&&It(o,s),!He(o)||_i(o)||Ye(o.targetId)||i(o,h.get()),Ue(o)&&!Ge(o)&&(ki(o.targetId),yield Ii(o)),Ke(o)&&(r(()=>Pe(()=>window.apntag.showTag(o.targetId)),a),we.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(o)&&we.setData("horseshoe",{isAvailable:!0}),Si({adObj:o}),(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)})(o),n.adAvailable(o);const g=Zi.find(({id:e})=>e===o.targetId);g&&(yield ar(g,o),Zi=Zi.filter(e=>e.id!==g.id)),t("core adAvailable stop",{placementsAvailable:Zi,adObj:o,isFullscreenScrollAd:ze(o),isFinnBlink:Ye(o.targetId),isNativeAd:He(o),isMediation:_i(o),isTakeoverAd:Ue(o),isCollapseAd:Ge(o),isWallpaperAd:Ke(o)})})),Xi.onEvent("adLoaded",e=>{const{refreshConfig:t,appearanceConfig:r}=h.get(),a=document.getElementById(e.targetId);Ye(e.targetId)&&(e=>{const{fullscreenScroll:t}=h.get(),{initNativeAd:n}=h.getHandlers();ze(e)&&It(e,t),He(e)&&n(e,h.get())})(e);d.includes(e.targetId)&&He(e)&&(i(e,h.get()),Si({adObj:e})),!d.includes(e.targetId)&&_i(e)&&d.push(e.targetId),Ge(e)&&Lt(e.targetId),Ue(e)&&((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"]})})(Xi,e.targetId),Ve(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=h.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`))})(e),(e=>nt(e,Ne))(e)&&Li(e),qn(e,t),(null==r?void 0:r.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(e.targetId);var s,l;we.getData("horseshoe").isAvailable&&o(e.targetId),n.adLoaded(e),s=e.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${s}`)&&(null===(l=window.gdpr)||void 0===l?void 0:l.setupButton)&&window.gdpr.setupButton(s),a&&a.classList.add("ad-loaded"),Oi(e),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:e.targetId,adFormat:Ci(e)}}))}),Xi.onEvent("adNoBid",t=>e(void 0,void 0,void 0,function*(){Lt(t.targetId),yield un(h.get(),t),ii(t)&&(yield ni()),n.adNoBid(t)})),Xi.onEvent("adError",(t,i)=>e(void 0,void 0,void 0,function*(){ii(i)&&(yield ni()),n.adError(t,i)})),Xi.onEvent("adCollapse",()=>{n.adCollapse()}),Xi.onEvent("adRequestFailure",e=>{Lt(e.targetId),n.adRequestFailure(e)}),Xi.onEvent("adBadRequest",e=>{Lt(e.targetId),n.adBadRequest(e)}),Xi.onEvent("adLoadedMediated",e=>n.adLoadedMediated(e)),Xi.onEvent("adNoBidMediated",e=>n.adNoBidMediated(e))})}),ur=(n,i)=>e(void 0,void 0,void 0,function*(){var r;h.set(n),h.setHandlers(i),we.initialize(),window.addEventListener("message",kn,!1),Xi=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=Xi,t("Apn tag is set up on window"),yield W(),t("Fetching permissions has been resolved"),yield Promise.allSettled([e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get();(yield Y(e,t,"xandr-endpoint"))||Xi.setEndpoint("ib.adnxs-simple.com",!0)}),e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n}=h.get(),i=yield Y(t,n,"prebid");(null==e?void 0:e.enabled)&&i&&(yield Ie(null==e?void 0:e.url))}),ce(n),e(void 0,void 0,void 0,function*(){const{astUrl:e}=h.get();yield Ie(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),e(void 0,void 0,void 0,function*(){const{gptUrl:e}=h.get();yield Ie(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),e(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i}=h.get(),{getConsentAsync:r}=a(n),o=yield r();if(e&&t&&o){if(yield Ie(t),document.querySelector(`.${Ai}`))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(Ai)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),X(),e(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=h.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Ie(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield xi(),t("Libraries have been loaded and trackers have been set"),yield(r=i.librariesToLoad,e(void 0,void 0,void 0,function*(){const e=r.map(e=>Ie(e));yield Promise.all(e)})),yield cr(),yield nr(),t("Page options have been set"),tr(n),t("Advertory is setup on window"),Zi=qt(),Rn(Zi),Fn(Zi),yield dr(Zi),t("Ads has been loaded",Zi),Ri(Zi),yield i.replaceAdsWithFinnBlink(n.finnBlink),yield(t=>e(void 0,void 0,void 0,function*(){var e;if(!t.drEdition)return;if(!(yield Y(t.tcf,t.isMobileApp,"handleDrEdition")))return;const n=yield q(),i=new R(n);ln({publisher:t.publisher,drEditionConfig:t.drEdition,device:t.deviceType,pageType:t.pageType,country:t.country},i,null===(e=t.pulse)||void 0===e?void 0:e.instance)}))(n),(e=>{if(!(null==e?void 0:e.enabled)||Qi)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=Vi}=e,r=document.querySelector(i);if(!r)return;Qi=!0;const o=()=>{Yi(r,n,t)};o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),window.addEventListener("load",o),new ResizeObserver(o).observe(r)})(n.rightColumnSplit)}),vr=(n,i)=>e(void 0,void 0,void 0,function*(){yield((n,i)=>e(void 0,void 0,void 0,function*(){const{initConsentManager:e,getConsentAsync:r}=a(n.tcf,n.isMobileApp),o=yield Hi(n);yield Fi(),yield Bi(e),yield Bi(r),t("TCF resolved successfully"),yield ur(o,i),t("Run function resolved successfully")}))(n,i)}),pr=()=>{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},gr="native_override_desc2",hr=(e,t,n)=>{var i;const{image:r,icon:o,sponsoredBy:a,title:s,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!=s?s:"",logo:w(o),sponsoredBy:null!=a?a:"",title:null!=s?s:"",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)},mr=(e,t)=>{const n=(i=gr,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(gr),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},yr=(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(me).includes(i);n&&o&&((e,t,n,i)=>{const r=t.parentElement;if(!r)return;const o=e?`-${e}`:"",a=i?`__${i}`:"",s=`advertory${o}-${n}${a}`,d=`advertory${o}-${n}-wrapper${a}`;t.classList.remove(...t.classList),r.classList.remove(...r.classList),t.classList.add(s),r.classList.add(d),t.dataset.adType=n})(i,e,Di,r)})(r,n),i())},fr=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:[])kr(i)}),t.dataset.tracked="true")})},wr=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(Er):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},br=(e,t)=>{var n;let i=!1;const r=document.querySelector(`#${e.targetId}`);if(!r||!e.native)return;const{deviceType:o,appearanceConfig:a,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:s=!1}={}}=t,d=s?{rootMargin:`${l=null!==(n=null==a?void 0:a.defaultThreshold[null!=o?o:f.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,wr(e),c.disconnect();break}},d);c.observe(r)},Er=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?kr(e):window.navigator.sendBeacon(e)},kr=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},Ir=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:r,videoTemplates:o}=n,a="default";if(!e.native)return null;const{native:s,targetId:d}=e,{desc2:l=a}=e.native,c=l.toLowerCase(),u=null!==(i=mr(e.targetId,l))&&void 0!==i?i:c,v=ft[t.language||S.NO],p=hr(s,v,d);return(s.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);yr(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{fr(e),br(e,t)})(e,t)})};yt('@import"https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap";.advertory-klart-ad-native-content{position:relative;font-family:Roboto,sans-serif;font-style:normal;background-color:#e4f0ff;font-size:12px;margin-top:8px;width:100%;box-shadow:rgba(0,0,0,.05) 0 2px 2px 0}.advertory-klart-ad-native-content .ad-info{position:absolute;right:5px;top:2px;height:26px;width:26px;z-index:50;border-bottom-left-radius:13px;border-top-right-radius:13px}.advertory-klart-ad-native-content .ad-info svg path{fill:#fff}.advertory-klart-ad-native-content .ad-link{color:inherit;text-decoration:none}.advertory-klart-ad-native-content .ad-link .ad-header{position:absolute;z-index:9;width:100%;box-sizing:border-box;font-family:Roboto,sans-serif;background-color:rgba(42,114,221,.7);border:1px solid rgba(34,34,34,.1);border-bottom:none}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-header{position:relative}}.advertory-klart-ad-native-content .ad-link .ad-header .ad-annonse{display:inline-block;font-weight:bold;color:#fff;line-height:15px;background-color:#2a72dd;padding:6px 16px}.advertory-klart-ad-native-content .ad-link .ad-content{display:flex;flex-direction:column;background-color:#fff;padding:0}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content{display:flex;flex-direction:row;justify-content:space-between;padding:10px 16px 12px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content{display:flex;flex-direction:column;justify-content:space-between;order:2;margin:8px 16px;width:calc(100% - 32px)}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content{order:1;margin:0;width:inherit}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-subtitle{order:3;padding:10px 16px 0 0;font-size:14px;line-height:16px;color:#444}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-subtitle{order:2;padding:10px 16px 16px 0}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-sponsored{order:1;margin-bottom:4px;color:#2a72dd;font-family:Roboto,sans-serif;font-style:normal;font-weight:bold;line-height:13px;text-transform:uppercase}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-sponsored{order:3;margin-top:8px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-title{color:#222;font-size:22px;font-style:normal;font-weight:bold;line-height:25px;order:2}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-title{font-size:24px;line-height:28px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container{order:1}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container{order:2}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container .ad-image{position:relative;margin-top:0;width:100%;height:auto;aspect-ratio:1200/628}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container .ad-image{width:268px;max-height:140px;margin:0 0 10px 0}}.advertory-klart-ad-native-content .ad-link .ad-gambling{display:flex;justify-content:space-between;border-top:1px solid #ccc;padding-top:8px;padding-bottom:8px;margin:0 16px 0 16px}.advertory-klart-ad-native-content .ad-link .ad-gambling .ad-gambling-text{line-height:14px;color:#6a6a6a}.advertory-klart-ad-native-content .ad-link .ad-gambling .ad-gambling-link{line-height:14px;color:#0078bd;text-decoration:underline !important}.advertory-klart-ad-native-content.article{border-left:4px solid #2a72dd}@media screen and (min-width: 768px){.advertory-klart-ad-native-content.article{border-left:unset}}.advertory-klart-ad-native-content.article .ad-content{display:flex;flex-direction:row-reverse;align-items:center}@media screen and (min-width: 768px){.advertory-klart-ad-native-content.article .ad-content{flex-direction:unset}}.advertory-klart-ad-native-content.article .ad-content .ad-data-content{display:flex;margin:0 10px 0 0}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-annonse{order:1;color:#fff;background-color:#0366b4;font-size:12px;padding:2px 4px;text-transform:uppercase;font-weight:bold;margin-bottom:unset;width:fit-content}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-title{order:2;line-height:23px;font-size:15px}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-subtitle{order:3;font-size:15px}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-sponsored{order:4;color:gray}.advertory-klart-ad-native-content.article .ad-content .ad-image-container{width:150px;margin:10px}');yt('@import"https://fonts.googleapis.com/css?family=Roboto:400&display=swap";.advertory-klart-ad-native-classic{border-top:4px solid #2a72dd;position:relative;font-family:Roboto,sans-serif;font-style:normal;background-color:#fff;color:#000;width:100%}.advertory-klart-ad-native-classic .ad-info{top:2px;right:0;position:absolute;height:26px;width:26px;z-index:1000;border-bottom-left-radius:13px;border-top-right-radius:13px}.advertory-klart-ad-native-classic .ad-link{color:inherit;text-decoration:none;display:block}.advertory-klart-ad-native-classic .ad-link .ad-content{border-left:1px solid rgba(34,34,34,.1);border-right:1px solid rgba(34,34,34,.1);border-bottom:1px solid rgba(34,34,34,.1);display:flex;flex-direction:column}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-header{display:flex;padding:8px 16px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-header .ad-annonse{font-size:14px;font-weight:bold;color:#2a72dd;content:"ANNONS";display:inline-block;text-align:left;vertical-align:middle}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content{padding:8px 16px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-subtitle{font-family:Roboto,sans-serif;font-size:15px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-subtitle .ad-sponsored{color:#2a72dd;font-weight:bold;text-transform:uppercase}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-title{font-weight:bold;font-size:30px;letter-spacing:-1px;line-height:1.08;margin:0 0 4px}@media screen and (min-width: 768px){.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-title{font-size:54px;letter-spacing:-1.8px;font-weight:bold}}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-image-container .ad-image{position:relative;width:100%;height:100%;aspect-ratio:2.8;object-fit:cover;object-position:center}.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:24px;font-weight:700;border:5px solid #000;padding:10px 0;text-align:center;justify-content:center;background:#fff;font-family:Roboto,sans-serif;color:#000;display:flex;flex-direction:column;box-sizing:border-box}@media screen and (min-width: 440px){.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:30px}}@media screen and (min-width: 768px){.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:48px}}[data-theme=dark] .advertory-klart-ad-native-classic{background-color:#222;color:#fff}');const Ar={CONTENT_DISPLAY:({containerId:e,url:t,adContentFrom:n,adText:i,sponsoredBy:r,title:o,img:a,description:s,desc2:d})=>`<article class="advertory-klart-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-header">\n <span class="ad-annonse">${i}</span>\n </div>\n <div class="ad-content">\n <div class="ad-data-content">\n <div class="ad-title">${o}</div>\n ${s&&`<div class="ad-subtitle">${s}</div>`}\n <div class="ad-sponsored">${n} ${r}</div> \n </div>\n <div class="ad-image-container">\n <img alt="${o}" class="ad-image" src="${a}" />\n </div>\n </div>\n ${"gambling"===d?'<div class="ad-gambling">\n <div class="ad-gambling-text">Åldersgräns för spel är 18 år.</div>\n <div class="ad-gambling-link">www.stodlinjen.se</div>\n </div>':""}\n </a>\n </article>`,CLASSIC:({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,img:o,description:a,desc2:s},d)=>{const l=tt({native:{desc2:s}}),c=l?"advertory-klart-ad-native-classic-alcohol":"",u=l?'<div class="alcohol-warning">Alkohol&nbsp;kan skada&nbsp;din&nbsp;hälsa</div>':"",{deviceType:v}=d,p=(e=>e===f.DESKTOP)(v)?"":' target="_blank" rel="noopener"';return`<article class="advertory-klart-ad-native-classic ${c}">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}"${p}>\n <div class="ad-content">\n <div class="ad-header">\n <span class="ad-annonse">${n}</span>\n </div>\n <div class="ad-image-container">\n <img alt="${r}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-data-content">\n <div class="ad-title">${r}</div>\n <div class="ad-subtitle">\n <span class="ad-sponsored">${i}</span> ${a}\n </div>\n </div>\n </div>\n ${u}\n </a>\n </article>`}},xr={displayTemplates:{brandstudio_native_ad:Ar.CLASSIC,brandstudio_native_ad_alcohol:Ar.CLASSIC,default:Ar.CONTENT_DISPLAY,gambling:Ar.CONTENT_DISPLAY},videoTemplates:{}},Tr=e=>{const t=e.querySelector(".advertory-klart-ad-native-classic-alcohol");if(!t)return;const n=t.querySelector(".ad-content"),i=t.querySelector(".alcohol-warning");if(!i||!n)return;const r=(e=>{const t=e.getBoundingClientRect().height;return Math.floor(.25*t)})(n);i.style.height=`${r}px`};yt(".advertory-klart-native-ad-wrapper__front{align-items:center;clear:both;display:flex;justify-content:center;overflow:hidden}.advertory-klart-native-ad-wrapper__front .advertory-klart-native-ad__front{position:relative;width:100%;min-height:120px;z-index:10}");const Sr=((e,t)=>n=>vr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;const{pageType:r=Xt.FRONT,deviceType:o,nativeTrackingConfig:a,appearanceConfig:s}=null!=t?t:{},d={language:S.SE,publisher:me.KLART,deviceType:o,pageType:r,nativeTrackingConfig:a,appearanceConfig:s};Ir(e,d,xr),tt(e)&&Tr(i)},wallpaperHandlers:{initWallpaperAd:Ce,adjustAdToHorseshoe:Ce},loadFinnBlinkAd:Se,replaceAdsWithFinnBlink:Se,preparePageOptions:ge,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=h.get(),o=((e,t)=>{const{isMobileApp:n}=h.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,r),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${Z()}-adformat`,r=t?t[i]:[];if(!r)return{};const o=(Array.isArray(r)?r:[r]).filter(e=>!(e in Fe)||window.innerWidth>=Fe[e]);return{[i]:n?o:r}})(e),s=(e=>{const t=`${Z()}-targetid`;return e?{[t]:[e]}:{}})(n),d=(e=>{var t;const[,n]=null!==(t=e.match(/-((w|a)(?:ph|de|tb))-/))&&void 0!==t?t:[];switch(n){case"wde":return{"aa-sch-supply_type":"web_desktop"};case"wtb":return{"aa-sch-supply_type":"web_tablet"};case"wph":return{"aa-sch-supply_type":"web_phone"};case"aph":return{"aa-sch-supply_type":"app_phone"};default:return}})(o),l=pr();return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),d),l)})},siteEvents:he,librariesToLoad:[]},ye),Cr=yt("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var Pr=Object.freeze({__proto__:null,default:Cr});exports.getVideoPPIDs=t=>e(void 0,void 0,void 0,function*(){const{ppid1:e,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r}=le.getPPIDs(),o=(new se).add(n,P[t]).add(e,O[t]).add(r,L[t]).add(i,$[t]);return yield new Promise(e=>{e(o.buildVideoEids())})}),exports.initAdvertoryPackage=Sr,exports.updateAdvertory=(t,n)=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return[];const{clearAds:i,reloadExistingAds:r,renderFinnBlinkPlacements:o,contextSelector:a}=null!=n?n:{};if(i)return _t(),[];r&&(_t(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{$t(e.id)})),m(null!=t?t:{}),yield nr();let s=qt(a);return o&&(s=s.filter(e=>Ye(e.id))),s.length>0&&(Zi=[...Zi,...s.map(e=>Object.assign({},e))],Rn(s),Fn(s),yield dr(s)),Zi});
1
+ "use strict";function e(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{d(i.next(e))}catch(e){o(e)}}function s(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(a,s)}d((i=i.apply(e,t||[])).next())})}require("react/jsx-runtime"),"function"==typeof SuppressedError&&SuppressedError;const t=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},n=e=>new Promise(n=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void n(!1);const i=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const n=Number(e);return t("Advertising permission value obtained synchronously: ",e),Boolean(n)})();if(null!==i)return void n(i);let r=!1;const o=e=>{r||(t("Resolving advertising permission value obtained"),r=!0,n(e))},a=setTimeout(()=>{t("Advertising permission timed out, resolving with false"),o(!1)},3e3);window._tcf_.onTcfReady(()=>{t("On Tcf Ready called, waiting for permission"),clearTimeout(a)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(a);const n=Number(e);t("Advertising permission value obtained asynchronously: ",e),o(Boolean(n))})}),i="cmp:loaded";let r,o=!1;const a=(a,s)=>{const d=!!(null==a?void 0:a.enabled),l=(null==a?void 0:a.timeout)||3e3,c=(u="bypass_tcf",new URLSearchParams(window.location.search).get(u));var u;const v=()=>{if(!(null==a?void 0:a.enabled))return!0;if(((e,n)=>e?!!n&&(t("TCF bypass param detected, returning consent: true"),!0):(t("TCF is not enabled, returning consent: true"),!0))(d,c))return!0;if(o)return null;if(!r)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const e=r.getConsentedToAllSync();return t(`TCF consented to all is: ${e}`),r.getConsentedToAllSync()};return{initConsentManager:()=>(null==a?void 0:a.enabled)?new Promise((e,n)=>{if(t("Getting TCF consent manager..."),window._tcf_)return t("TCF consent manager is already available"),r=window._tcf_,void e(r);t("TCF consent manager is not available");const a=()=>{t("CMP loaded, resolving consent manager..."),s&&clearTimeout(s),window._tcf_?(r=window._tcf_,e(r)):n(new Error("CMP loaded but window._tcf_ is not defined"))},s=setTimeout(()=>{document.removeEventListener(i,a),o=!0,n(new Error("Timeout waiting for CMP to load"))},l);t("Listening for CMP loaded event..."),document.addEventListener(i,a,{once:!0})}):Promise.resolve(null),getConsentSync:v,getConsentAsync:()=>e(void 0,void 0,void 0,function*(){if(null==a?void 0:a.schibstedAdChoicesOverrideValue)return t(`Schibsted Ad Choices override value is set, returning override value: ${a.schibstedAdChoicesOverrideValue}`),Boolean(Number(a.schibstedAdChoicesOverrideValue));if(null==a?void 0:a.schibstedAdChoicesEnabled)return t("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield n(a);if(!(null==a?void 0:a.enabled))return!0;const e=v();return null!==e?e:yield new Promise((e,t)=>{try{if(!r)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");r.isConsentedToAll(t=>{e(t)})}catch(e){t(e)}})})}};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,l;var c=s(function(){if(l)return d;l=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)?s((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 a(e,t,i){var a={};return i.isMergeableObject(e)&&r(e).forEach(function(t){a[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])?a[r]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(r,i)(e[r],t[r],i):a[r]=n(t[r],i))}),a}function s(t,r,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(r);return s===Array.isArray(t)?s?o.arrayMerge(t,r,o):a(t,r,o):n(r,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},d=s}());const u=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],v={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},p=6;class g{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 u){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=c(g.DEFAULT_SITE_HANDLERS,e)}}g.DEFAULT_SITE_HANDLERS={siteEvents:v,initNativeAd:function(){}};const h=new g,m=h.modifyConfigProperties.bind(h),y=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},f={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},w=9826;class b{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=f.DESKTOP,isMobileApp:t}=h.get();if(t){return{"aa-sch-supply_type":`app_${e===f.MOBILE?"phone":f.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(t){return e(this,void 0,void 0,function*(){return Object.assign(Object.assign({},t),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(t.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=y("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return e(this,void 0,void 0,function*(){return yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get(),{getConsentAsync:n}=a(e);if(!(yield n()))return;const i=y("_pulse2data");return i?i.split(",")[9]:void 0})})}isTrackingForbidden(){return e(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=w}=h.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}=h.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get(),{getConsentAsync:n}=a(e);return{"aa-sch-cmp_advertising":(yield n())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=h.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}=h.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 E=new b;E.prepare.bind(E);function k(e=!1){var t,n;const i=null===(n=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===n?void 0:n.toLocaleLowerCase(),r=(()=>{const e=window.navigator.userAgent.toLowerCase(),t=[["win","windows"],["macintosh","macos"],["x11","linux"],["android","android"],["ipad","ios"],["iphone","ios"]].find(([t])=>e.includes(t));return t?t[1]:"unknown"})();return{OS:r,mobileOS:["ios","android"].includes(r)?r:"unknown",isHybridApp:i.includes("hermes"),appMode:e?"hybrid":"notinapp"}}class I extends b{constructor(){super(...arguments),this.getDeviceKeywords=()=>{const{deviceType:e=f.DESKTOP}=h.get();return{"se-generic-sitemode":this.getPageOptionsFormatDevice(e)}}}getScreenKeywords(){const e=function(){const e=window.innerWidth,t=window.innerHeight,n=document.documentElement.clientWidth,i=document.documentElement.clientHeight;return{width:e||n||0,height:t||i||0}}(),t={width:null!==(i=null===(n=window.screen)||void 0===n?void 0:n.width)&&void 0!==i?i:0,height:null!==(o=null===(r=window.screen)||void 0===r?void 0:r.height)&&void 0!==o?o:0};var n,i,r,o;return{"se-generic-viewportheight":e.height,"se-generic-viewportwidth":e.width,"se-generic-screenheight":t.height,"se-generic-screenwidth":t.width}}getExternalIdSrc(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return e?{"se-generic-externalid_src":Number(!!e)+Number(!!t)}:{"se-generic-externalid_src":0}})}getAppTypeKeywords(){const{isMobileApp:e}=h.get(),{appMode:t,mobileOS:n}=k(e);return{"se-generic-appmode":t,"se-generic-mobileos":n}}getPublisherGroup(){return{"se-generic-publishergroup":"schibsted"}}}const A=864e5,x=(()=>{const e=e=>{const n=window.localStorage.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch(e){return t("Error with parsing localStorage data"),null}},n=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:n,setWithTimestamp:(e,t,i=A)=>{const r={data:t,expirationTime:(new Date).getTime()+i};n(e,JSON.stringify(r))},getByTimestamp:(n,i=A)=>{const r=e(n);if(!r)return null;if(!i)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return t("Error with parsing localStorage data"),null}}}})(),T={get:e=>{try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return t(`sessionStorageClient.get: Error during getting data from sessionStorage: ${e}`),null}},set:(e,n)=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch(e){t(`sessionStorageClient.set: Error during saving data to sessionStorage: ${e}`)}},remove:e=>{try{sessionStorage.removeItem(e)}catch(e){t(`sessionStorageClient.remove: Error during remove data from sessionStorage: ${e}`)}}},S={NO:"no",SE:"se"},C="advertory:ppids-cache",P={[S.SE]:`SCH${S.SE.toUpperCase()}-EnvHash`,[S.NO]:`SCH${S.NO.toUpperCase()}-EnvHash`},O={[S.SE]:`SCH${S.SE.toUpperCase()}-UserHash`,[S.NO]:`SCH${S.NO.toUpperCase()}-UserHash`},L={[S.SE]:`sch${S.SE}-envhash-v3`,[S.NO]:`sch${S.NO}-envhash-v3`},$={[S.SE]:`sch${S.SE}-userhash-v3`,[S.NO]:`sch${S.NO}-userhash-v3`},j={[S.SE]:`'sch${S.SE}-iosid-v3'`,[S.NO]:`'sch${S.NO}-iosid-v3'`},N={[S.SE]:`sch${S.SE}-androidid-v3`,[S.NO]:`sch${S.NO}-androidid-v3`},_={[S.SE]:"sdrn:schibsted.com:user",[S.NO]:"sdrn:spid.no:user"},D=t=>e(void 0,void 0,void 0,function*(){const e=yield t.getEnvironmentId();if(!e)return null;return`sdrn:schibsted:environment:${e}`}),M=(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield t.getUserId();if(!e)return null;return`${_[n]}:${e}`}),q=()=>e(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 R{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 e(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 t("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return e(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 B="advertory-session",F=e=>{const{privacyBroker:{storageKeyPrefix:t=B}={}}=h.get();return t+"-"+e},z=()=>{const{privacyBroker:{storageKeyPrefix:e=B}={}}=h.get(),t=sessionStorage;for(const n in t)0===n.indexOf(e+"-")&&T.remove(n)},V={LOCAL:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",DEV:"https://user-permissions.privacy-dev.schibsted.io/privacy/v2",PRE:"https://user-permissions.privacy-pre.schibsted.io/privacy/v2",PRO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_NO:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_FI:"https://user-permissions.privacy.schibsted.com/privacy/v2",PRO_DK:"https://user-permissions.privacy.schibsted.com/privacy/v2"},H={get:(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield fetch(t,n);if(!e.ok)throw new Error(e.statusText);return yield e.json()}),post:(t,n,i)=>e(void 0,void 0,void 0,function*(){const e=JSON.stringify(i),r=yield fetch(t,{method:"POST",headers:n,body:e});if(!r.ok)throw new Error(r.statusText);return yield r.json()})},U=n=>e(void 0,[n],void 0,function*({endpoint:n,identityFacade:i,environment:r}){var o;z();const a=yield(t=>e(void 0,void 0,void 0,function*(){const e=new Headers;e.set("Content-Type","application/json");const n=yield t.getIdentityUser();return n&&e.set("Authorization",`SPIDSIG ${n.sig}`),e}))(i);try{const e=null!==(o=V[r])&&void 0!==o?o:V.PRO;return yield H.get(`${e}${n}`,{headers:a})}catch(e){return t("[PrivacyBroker] Failed to fetch permissions",e),null}}),W=()=>e(void 0,void 0,void 0,function*(){var n,i;const{privacyBroker:{enabled:r,clientId:o}={},tracker:{instance:a}={},country:s,tcf:{schibstedAdChoicesEnabled:d}={}}=h.get();if(d)return t("[Privacy Broker]: Schibsted Ad Choices enabled, skipping permissions fetching"),null;if(!r||!a||!o)return t("[Privacy Broker]: Data not present",{enabled:r,trackerInstance:a}),null;const l=yield q(),c=new R(l);if(!l||!c)return t("[Privacy Broker]: Data not present",{identity:l,identityFacade:c}),null;const u=yield c.isUserLoggedIn();c.onIdentityLogout(()=>{t("[Privacy Broker]: clearPermissions"),z()}),t("[Privacy Broker]: Creating endpoint for fetching permissions started");const v=null!==(n=yield M(a,s))&&void 0!==n?n:"",p=null!==(i=yield D(a))&&void 0!==i?i:"",g=u?v:p,m=yield((t,n,i)=>e(void 0,void 0,void 0,function*(){const e=`/schacc/${n}/user/${i}/permissions`,r=`/anonymous/${n}/user/${i}/permissions`;return(yield t.getIdentityUser())?e:r}))(c,o,g);t(`[Privacy Broker]: Endpoint created ${m}`);const y=(e=>!!T.get(F(e)))(g),f=F(g);if(y){t("[Privacy Broker]: SessionStorage cached",{key:f,permissions:sessionStorage.getItem(f)});return T.get(f)}t("[Privacy Broker]: Fetching permissions...");const w=yield(t=>e(void 0,[t],void 0,function*({endpoint:e,timeout:t,identityFacade:n,environment:i}){return yield Promise.race([U({endpoint:e,environment:i,identityFacade:n}),new Promise(e=>setTimeout(()=>e(null),t))])}))({endpoint:m,timeout:500,identityFacade:c,environment:l.env});return w?(t("[Privacy Broker]: Permissions fetched",w),E=g,(null==(b=w)?void 0:b.permissions)&&T.set(F(E),b.permissions),w):(t("[Privacy Broker]: Permissions not found",{permissions:w,isLoggedIn:u,identifiedId:g,country:s}),null);var b,E}),K="glimrTags",G=["glwe_","glwet_"],J={geofenceTags:[],geoTags:[],weatherTags:[]},Y=(n,i,...r)=>e(void 0,[n,i,...r],void 0,function*(e,n,i="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return t(`Schibsted Consent to Pay is not enabled, returning true for ${i}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return t(`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}=a(e);return(yield r())?(t(`Schibsted Ad Choices consent given according to TCF consent manager for ${i}`),!0):(t(`Schibsted Ad Choices consent not given according to TCF consent manager for ${i}`),!1)}),Q=()=>e(void 0,void 0,void 0,function*(){const{privacyBroker:n,tcf:i,isMobileApp:r}=h.get();if(null==i?void 0:i.schibstedAdChoicesEnabled){return yield Y(i,r,"glimr")}if(null==n?void 0:n.enabled){const n=(e=>{const n=null==e?void 0:e.find(e=>e.purpose.includes("targeted_advertising"));if(t("targeted_advertising permissions",n),!(null==n?void 0:n.data)||!Array.isArray(null==n?void 0:n.data))return!1;const i=null==n?void 0:n.data.find(e=>e.includes("geolocation"));return t("geolocation permission",i),!!i})(yield e(void 0,void 0,void 0,function*(){var e,n;const{country:i,tracker:{instance:r}={}}=h.get(),o=yield q();if(!r||!o)return t("[Privacy Broker] No tracker found."),null;const a=new R(o),s=yield a.isUserLoggedIn(),d=null!==(e=yield M(r,i))&&void 0!==e?e:"",l=null!==(n=yield D(r))&&void 0!==n?n:"",c=F(s?d:l);return T.get(c)||null}));return n}return!0}),X=()=>e(void 0,void 0,void 0,function*(){const{glimr:n}=h.get();if(!(yield Q())||!(null==n?void 0:n.enabled))return void t("No consent for glimr data fetching.");const i=yield(r=500,e(void 0,void 0,void 0,function*(){return yield Promise.race([e(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),r))])}));var r;if(i)try{i.setTagCacheTimeInSeconds(300),yield new Promise(e=>{i.getTags(n.clientId,(t,n)=>{x.setWithTimestamp(K,{tags:t,tagMappings:n}),e(!0)})})}catch(e){t(`Error during getting glimr data: ${e}`)}else t("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:i})}),Z=()=>{const{country:e}=h.get();return e===S.NO?"no-sno":"se-generic"},ee=()=>{const{country:e,publisher:t}=h.get();return`${e}-${t}`},te={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"},ne=e=>G.some(t=>e.startsWith(t)),ie=e=>e.startsWith("glgc_"),re=e=>!ne(e)&&!ie(e),oe=e=>{const t=ae();if(!t)return J;const n=((e=[])=>e.filter(ne))(t),i=((e=[])=>e.filter(ie))(t),r=((e=[],t)=>{const n=e.filter(re);if(t){const{publisher:e}=h.get(),t=te[e]||e;n.push(t)}return n})(t,e);return{geoTags:r,geofenceTags:i,weatherTags:n}},ae=()=>{const e=x.getByTimestamp(K);return e&&"string"!=typeof e?null==e?void 0:e.tags:null};class se{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 de=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(t){return e(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,n;return null!==this.ppid1&&null!==this.ppid2||t("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(n=this.ppid2)&&void 0!==n?n:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},le=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(t,n){return e(this,void 0,void 0,function*(){var e,i,r,o,a,s,d,l,c,u,v;const p=x.get(C),g=yield this.getNewPPIDs(t,n);if(this.shouldHash(p,g)){const n=null!==(e=t.hasherUrl)&&void 0!==e?e:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(g),c=yield this.hashPPIDs(l,n);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!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=g.idfv)||void 0===s?void 0:s.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,n;return null!==this.ppid1&&null!==this.ppid2||t("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(n=this.ppid2)&&void 0!==n?n:"",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}}:{});x.set(C,r)}hashPPIDs(n,i){return e(this,void 0,void 0,function*(){try{const e=new Headers({"Content-Type":"application/json"});return yield H.post(i,e,n)}catch(e){return t("Error with hashing PPIDs",e),null}})}getNewPPIDs(t,n){return e(this,arguments,void 0,function*({clientId:e,instance:t},n){const i=yield M(t,n),r=yield D(t),o=window.advertory_idfv,a=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}}:{}),a?{anId:{plain:a}}:{})})}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}}},ce=n=>e(void 0,void 0,void 0,function*(){const{tracker:e,tcf:i,country:r,isMobileApp:o}=n;if(!(yield Y(i,o,"setXandrPPIDs")))return;if(!e)return;(yield Promise.allSettled([de.processPPIDs(e,null==i?void 0:i.timeout),le.processPPIDs(e,r)])).forEach((e,n)=>{if("rejected"===e.status){t(`Cannot fetch PPIDs v${n+2}`,e.reason)}})}),ue=e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:a}=le.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]).add(o,j[e]).add(a,N[e]).buildEids()}]}},ve=e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r,idfv:o,anId:a}=le.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]).add(o,j[e]).add(a,N[e]).buildRyEids()}}]}}};const pe=new class extends I{prepare(n){return e(this,void 0,void 0,function*(){const i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":S.SE},this.getPublisherKeywords()),this.getSupplyTypeKeywords()),this.getAppTypeKeywords()),this.getDeviceKeywords()),this.getScreenKeywords()),yield this.getAdvertisingConsentKeywords()),this.getAnalyticsConsentKeywords()),yield this.getExternalIdSrc()),this.getHasContextKeywords(n.keywords)),yield e(void 0,void 0,void 0,function*(){const{glimr:e}=h.get(),{addPublisherToGeo:n}={},i=yield Q();if(!(null==e?void 0:e.enabled)||!i)return t("No consent for getting glimr tags."),{};const r=Z(),o=oe(n);return{[`${r}-geo`]:o.geoTags,[`${r}-weather`]:o.weatherTags,[`${r}-geofence`]:o.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=de.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),n.keywords);return Object.assign(Object.assign({},n),{keywords:i,user:Object.assign(Object.assign({},ue(S.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var ge=pe.prepare.bind(pe);const he={adRequested:()=>{},adAvailable:()=>{},adLoaded:e=>{(e=>{var t;const n=null===(t=document.getElementById(`${e.targetId}`))||void 0===t?void 0:t.parentElement;n&&e.width>=1260&&e.width<=1280&&n.classList.add("advertory-klart-l-format")})(e)},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},me={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"},ye={publisherClassName:me.KLART,fullWidthFormatClassName:"panorama",classesToRemoveOnRefresh:["advertory-klart-l-format"]};class fe{initialize(){this.DATA=Object.assign({},fe.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)}}fe.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const we=new fe,be=()=>(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),Ee=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),ke=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:i=!1}={}}=h.get(),r=[`${Z()}-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:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},Ie=(t,...n)=>e(void 0,[t,...n],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=()=>{s(),n()},a=()=>{s(),i(new Error(`Failed to load ${e}`))},s=()=>{r.removeEventListener("load",o),r.removeEventListener("error",a),clearTimeout(d)};r.addEventListener("load",o),r.addEventListener("error",a);const d=setTimeout(()=>{s(),i(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(r)}).catch(e=>{console.error(e)}))}),Ae=()=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:n,country:i,isMobileApp:r}=h.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=h.getHandlers(),{getConsentAsync:s}=a(n),d=yield s(),l=(()=>{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=be(),{prebid:{relevantCbTimeout:o}={}}=h.get(),a="relevantCb"===i&&o?o:n[i].timeout,s=setTimeout(()=>{!n[i].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${i}'`),e=!0,r.loadTags&&r.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),c=be(),u=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=be();return{user:e,keywords:t}})();l.failsafeOnTimeout("relevantCb");const{user:{externalUid:v=""}={},keywords:p}=u;(()=>{const e=Ee();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(l.getCancel()||!c.loadTags)return t("core loadTags() call was cancelled",{cancel:l.getCancel(),apnTagLoadTags:!c.loadTags,condition:"or"}),void l.cleanup();const n=Ee();l.events.relevantCb.done=!0,l.failsafeOnTimeout("auctionCb");const r=d?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};t("prebid consentManagement",r),n.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},ve(i)),ke(p,v))),t("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},ve(i)),ke(p,v))),n.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{l.getCancel()||(l.events.auctionCb.done=!0,c.loadTags(e)),l.cleanup()}},customNativeRender:e=>{xe(e,o)}}),t("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{l.getCancel()||(l.events.auctionCb.done=!0,c.loadTags(e))}},customNativeRender:e=>{xe(e,o)}})})}),xe=(e,t)=>{var n;const{divId:i,native:r,bid:o}=e,a=document.querySelectorAll(`[id^=${i}]`)[0],s=`RY-${a.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)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:r,targetId:s},h.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},Te="0123456789abcdefghijklmnopqrstuvwxyz",Se=()=>Promise.resolve(),Ce=()=>{},Pe=e=>{window.apntag.anq.push(e)},Oe=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),Le=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})}),$e="ABSOLUTE_FULLSCREEN",je="ANY_FULLSCREEN",Ne="VERTICAL_FULLWIDTH",_e="FULLWIDTH",De="TAKEOVER",Me="VELVET_TAKEOVER",qe="WALLPAPER",Re="COLLAPSE",Be={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}]},Fe={wallpaper:1600,"l-format":1600},ze=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&nt(e,je)},Ve=e=>{const{native:t}=e;return!!t},He=e=>nt(e,_e),Ue=e=>{const{targetId:t}=e;return t.includes("takeover")||nt(e,De)},We=e=>nt(e,De),Ke=e=>nt(e,qe),Ge=e=>nt(e,Re),Je=e=>e.targetId.includes("sponsorstripe"),Ye=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},Qe=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),Xe=e=>e.targetId.startsWith("midboard"),Ze=e=>e.width>=1260&&e.width<=1280,et=e=>e.width>=1600&&e.width<=1620,tt=e=>{var t,n;return"string"==typeof(null===(t=e.native)||void 0===t?void 0:t.desc2)&&(null===(n=e.native)||void 0===n?void 0:n.desc2.endsWith("_alcohol"))},nt=(e,t)=>{const n=Be[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,a=t.width===r,s=!t.height||t.height===o;return a&&s})},it=e=>e.includes("snoap.no"),rt=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)},ot=(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()},at=ot([],()=>{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,a=e/r,s=t/o;i.style.transform=`scale(${a},${s})`,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}),st=e=>{const t=ot([],()=>{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},dt=[],lt={},ct=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const i=vt(e);n?(ut(i,n),pt(e,i,t)):(ut(i,n),gt(e,i,t))})},ut=(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}`,"*")},vt=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},pt=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),dt.includes(t)||dt.push(t),n&&window.addEventListener("scroll",lt[t],{passive:!0})},gt=(e,t,n)=>{dt.includes(t)&&(n&&window.removeEventListener("scroll",lt[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},ht=(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=[],a=[];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&&a.push(t)}),()=>{o.length&&mt(e,o,r,0),a.length&&mt(e,a,r,40)}},mt=(e,t,n,i)=>{const r=e.offsetHeight,o=window.scrollY,a=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>o?(a-o)/t-i:(o+t-(a+r))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})};function yt(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}yt('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const ft={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 wt=null;const bt=(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=`(${at})()`,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(it(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=st(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>it(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)),it(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)),rt(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},Et=()=>{wt=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=()=>{wt||(wt=window.requestAnimationFrame(Et))},It=(e,t)=>{var n,i,r,o;const{country:a}=h.get(),{targetId:s}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:i="#fff",margin:r="16px 0",beforeContentValue:o=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${i} calc(50% - ${a}px),\n ${i} calc(50% + ${a}px),\n ${n} calc(50% + ${a}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 }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(i=null==t?void 0:t.overlayStyles)&&void 0!==i?i:{});const d=document.getElementById(s),l=null==d?void 0:d.parentElement;d&&l&&(((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,i=new IntersectionObserver(e=>ct(e,n),{}),r=vt(e);i.observe(e),n&&(lt[r]=ht(e,t))})(l,t),d.className="advertory-fullscreen-scroll",nt(e,$e)&&(d.style.position="absolute"),l.className="advertory-fullscreen-scroll-wrapper",l.dataset.showTagSubscribeId=s,d.setAttribute("data-ad-label",ft[a].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),kt(),window.addEventListener("resize",kt),null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",kt),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",kt))},At=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=rt(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=rt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,bt(t,e))},xt=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};let Tt="";const St=new Map,Ct="advertory-wallpaper-background",Pt=()=>{const e=document.querySelector(`.${Ct}`);e&&e.remove()},Ot=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,Lt=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")&&Pt())},$t=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"))},jt=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`)},Nt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:i}=(e=>{const t=we.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},_t=()=>{Pt();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{Lt(e.id),Nt(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=xt(e.id)}),Pe(()=>window.apntag.clearRequest())},Dt="noGroupedPlacements",Mt=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},qt=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}=h.get(),o=n[r].filter(Mt)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=o.reduce((e,t)=>{const n=(e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t})(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)),s=(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=a.querySelectorAll(s),l=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{const i=Rt(e,t,n),r=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=Te[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&&we.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}=h.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(Tt!==window.location.pathname&&(St.clear(),Tt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),i=null!==(t=St.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${ee()}-count`]=i,St.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))})(s)},Rt=(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},Bt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=h.get(),i=(null==t?void 0:t[n])||{},r=Object.values(i).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=xt(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[i,r]of Object.entries(t))n[i]=e.filter(e=>r.includes(xt(e.id)));return n})(e,i),s=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(xt(e.id))))(e,new Set([...s,...r]));return Object.assign(Object.assign(Object.assign({},a),o),{[Dt]:d})},Ft=(e,t,n)=>{const i=document.getElementById(`div_utif_${e}`);if(!i)return;const{apntag:r}=window,[o,a]=t;if(!i.dataset.lockedsize&&a&&o)i.style.width=`${o}px`,i.style.height=`${a}px`,n&&(r.resizeAd(i.id,[o,a]),i.dataset.lockedsize="true",i.dataset.lockedwidth=o.toString(),i.dataset.lockedheight=a.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])}},zt=["netboard","board"];class Vt{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")||""})(),a=JSON.stringify(null!==(i=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==i?i:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",r),o&&s.searchParams.append("urlData",o),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(n){return e(this,void 0,void 0,function*(){var e,i;const r=yield this.identityFacade.getIdentityUser(),o=null!==(i=yield null===(e=this.tracker)||void 0===e?void 0:e.getEnvironmentId())&&void 0!==i?i:"",a=(null==r?void 0:r.userId)?String(r.userId):"",s=this.buildUrl(n,{envId:o,spid:a});try{t("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},n=yield H.get(s,e);return t("Fetch operation completed successfully."),n}catch(e){t("Error during fetch operation:",e)}return null})}}class Ht{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:a}=t,s=i.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:r,utm_medium:s},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(t,n){return e(this,void 0,void 0,function*(){const{id:e,autoplay:i,mute:r,videoLoop:o,vendor:a}=n.videoConfiguration;t.classList.add("vgtv-video-container"),Object.assign(t.dataset,{vgtvVideoId:e,vgtvVendor:a,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 Ut=e=>{const n=e.parentElement;n?n.classList.remove("dr-edition-lock-height"):t("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Wt{constructor(e,t,n,i){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=i,this.drEditionAds=[]}fetchAndRenderAd(n,i){return e(this,void 0,void 0,function*(){var e,r;const{drEditionConfig:{containerSelector:o},renderAsBackfill:a=!1}=i,s=n.querySelector(o);if(!s)return void t(`Container with selector "${o}" not found.`);const d=yield this.drEditionService.fetchData(i);return(null==d?void 0:d.itemId)||a?!(null==d?void 0:d.itemId)&&a?(t("No Dr. Edition ads available to render. Collapsing whole placement."),Lt(n.id),void Ut(s)):((null==d?void 0:d.itemId)&&a&&(t("Dr. Edition ad available to render as a Xandr backfill."),$t(n.id)),void(d?(d.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(d.css,"style"),yield this.rendererManager.render(s,d,i),yield null===(e=this.videoManager)||void 0===e?void 0:e.handle(d,i),Ut(s),this.drEditionAds.push(d),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(d.itemId),this.observeAdView(n,d,i),null===(r=n.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)):Ut(s))):(t("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(s),this.showBackfill(n),void Ut(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:"";$t(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 Kt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(t,n,i){return e(this,void 0,void 0,function*(){if(!(null==n?void 0:n.itemId))return;const{getConsentAsync:e}=a(i.tcf,i.isMobileApp),r=yield e(),o=i.device===f.MOBILE?n.mobileHTML:n.desktopHTML;const s=r?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");t.innerHTML=s,t.querySelectorAll("a").forEach(e=>{var t,r,o;e.search=null!==(o=null===(r=(t=this.newsroomStrategy).getUrlSearchParams)||void 0===r?void 0:r.call(t,e,n,i))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,n,i)})})}}class Gt{constructor(e){this.strategy=e}handle(t,n){return e(this,void 0,void 0,function*(){const{videoConfiguration:{id:e,preview:i}={}}=t;(e||i)&&(yield this.importScript(n),yield this.createVideoElement(t,n))})}importScript(n){return e(this,void 0,void 0,function*(){const e=n.drEditionConfig.videoScriptUrl,i=document.querySelector(`script[src="${e}"]`);if(e&&!window.autoplayQueue&&!i)try{yield Ie(e)}catch(e){t("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(t,n){return e(this,void 0,void 0,function*(){const e=document.createElement("div"),{node:i}=t.videoConfiguration,r=[...document.querySelectorAll(`#${i}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(t,n))return;this.strategy.handleVideo(e,t),null==r||r.appendChild(e),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==r?void 0:r.parentNode;if(!o)return;const a=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,i,r;const{preview:{url:o,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("playsinline",""),!(!s||!a)&&(null===(r=(i=t.drEditionConfig).addPreviewVideo)||void 0===r||r.call(i,s),!0))}}class Jt{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(t,n,i){return e(this,void 0,void 0,function*(){var e,r,o,a,s,d,l,c;if(!this.pulse)return;const u=this.getEventInput(t,n,i,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackLegacyViewUIElement)?null===(o=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===o||o.call(r,u):(null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)?null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)||void 0===d||d.call(s,u):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,u)})}trackContentClick(t,n,i){return e(this,void 0,void 0,function*(){var e,r,o,a,s,d;if(!this.pulse)return;const l=this.getEventInput(t,n,i,"click");this.pulse.trackLegacyClickUIElement?null===(r=(e=this.pulse).trackLegacyClickUIElement)||void 0===r||r.call(e,l):this.pulse.trackClickUIElement?null===(a=(o=this.pulse).trackClickUIElement)||void 0===a||a.call(o,l):null===(d=(s=this.pulse).trackElementClick)||void 0===d||d.call(s,l)})}}class Yt extends Jt{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:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:i,placement:{columnName:a,primaryPosition:s},"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)}}}class Qt extends Jt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var i,r,o,a,s,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!==(a=null===(o=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulseObjectId)||void 0===o?void 0:o.call(r))&&void 0!==a?a: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===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,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,a,s;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!==(s=null!==(a=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!==a?a:p)&&void 0!==s?s:"";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 Xt={FRONT:"front"},Zt=t=>e(void 0,void 0,void 0,function*(){var e,n;return(null===(e=null===window||void 0===window?void 0:window.SVP)||void 0===e?void 0:e.Player)?new window.SVP.Player(t):((()=>{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(t):yield new Promise(e=>{window.addEventListener("onSvpPlayerReady",()=>e(new window.SVP.Player(t)))}))}),en={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 e(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Pr})})}})}};class tn{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:i,autoplay:r,mute:o,vendor:a}}){yield e(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"],d=this.createPlayerOverlay(t);var l,c;c=d,null==(l=s)||l.forEach(e=>{en[e](c)});const u={id:n,node:i,autoplay:r,mute:o,vendor:a,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},v=yield Zt(u);v.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(v,s)}),v.once("ready",()=>{const e=t;new MutationObserver(t=>{t.forEach(({type:t,attributeName:n})=>{"attributes"===t&&"class"===n&&(e.classList.contains("jw-state-playing")?d.classList.add("is-playing"):d.classList.remove("is-playing"),e.classList.contains("jw-flag-user-inactive")?d.classList.add("is-inactive"):d.classList.remove("is-inactive"))})}).observe(e,{attributes:!0,attributeFilter:["class"]})}),v.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield v.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===Xt.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 nn="https://www.aftonbladet.se/video-player-extras/latest/";class rn{handleVideo(t,n){return e(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:i,mute:r,vendor:o}}){const a={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:{[`${nn}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${nn}external-link.js`]:{name:"ExternalLink"}}};yield Zt(a),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 an{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:i,autoplay:r,mute:o,vendor:a}}){const s={id:n,node:i,autoplay:r,mute:o,vendor:a,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-${n}`]},requestSettings:{}}}},d=yield Zt(s);d.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield d.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===Xt.FRONT?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class sn{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const dn=(e,t,n)=>{var i;const{publisher:r,pageType:o,country:a}=e,s={[me.VG]:new Ht,[me.E24]:new tn,[me.AFTONBLADET]:new rn,[me.SVD]:new an}[r]||new sn,d=new(a===S.SE?Yt:Qt)(n,s,o),l=new Vt(t,null!==(i=null==n?void 0:n.pulseTracker)&&void 0!==i?i:n),c=new Kt(s,d),u=new Gt(s);return new Wt(l,c,u,d)},ln=(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=dn(n,i,r);e.forEach(e=>{var i,r,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(i=s.dataset.editionName)&&void 0!==i?i:"",l=null!==(r=s.dataset.pulseColumnname)&&void 0!==r?r:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";o.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(i,r,e,t,n),{rootMargin:"400% 0px"});r.forEach(e=>o.observe(e))},cn=[],un=(n,i)=>e(void 0,void 0,void 0,function*(){var e;const{pulse:r,tcf:o,deviceType:a,drEdition:s,publisher:d,pageType:l,country:c,isMobileApp:u}=n;if(!(yield Y(o,u,"handleDrEditionBackfill")))return;const v=((e,t)=>{var n;const{deviceType:i,placements:r,drEdition:{fallbackGlobalEditionName:o}={}}=e,a=r[i]||r.desktop,s=xt(t.targetId),d=a.find(e=>e.id===s),l=zt.some(e=>s.startsWith(e)),c=cn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(cn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(n,i);if(!v)return;if(!(null==r?void 0:r.instance))return void t("Pulse has not been passed as a prop, aborting");const p=yield q(),g=new R(p),h=dn({publisher:d,pageType:l,country:c},g,null==r?void 0:r.instance),m=document.getElementById(i.targetId);if(!m||!s)return;m.classList.value="";const y=document.createElement("div");y.className=s.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=y.outerHTML;const f={editionName:(null===(e=null==v?void 0:v.drEdition)||void 0===e?void 0:e.editionName)||"",drEditionConfig:s,device:a,tcf:o,isMobileApp:u,renderAsBackfill:!0};yield h.fetchAndRenderAd(m,f)}),vn="collapseAd",pn="hideAd",gn="resizeAd",hn="renderDrEditionFallback",mn="wallpaperImageUrl",yn="wallpaperColor",fn="velvet",wn=[gn,mn,yn,vn,pn,hn,fn];let bn;const En=e=>{if("object"==typeof e)return e;if(t=e,Ot.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:mn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:yn,wallpaperColor:t}}if(e.startsWith(hn)){const t=e.split(":")[1];return{name:hn,targetId:t}}if(e.startsWith(vn)||e.startsWith(pn)){const t=e.split(":")[1];return{name:vn,targetId:t}}if(e.includes("name")&&wn.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=En(t);if(!n)return;if(!n.name||!wn.some(e=>n.name===e))return;const{name:i,targetId:r,wallpaperImageUrl:o,wallpaperColor:a,cmd:s,size:d}=n;i===fn&&s&&(s.includes("noScroll")&&(bn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==bn||bn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),i!==vn&&i!==pn||!r||Lt(r),i===gn&&r&&s&&Ft(r,s),i===hn&&r&&(Lt(r),un(h.get(),{targetId:r})),"resizeMediationAd"===i&&r&&d&&Ft(r,d,!0),i===mn&&o&&(e=>{const t=document.querySelector(`.${Ct}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),i===yn&&a&&(e=>{const t=document.querySelector(`.${Ct}`);t&&(t.style.backgroundColor=e)})(a)},In=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),An=(n,i)=>{if(Ye(i))return t(`loading finn blink ad with full ads chain for ${i}`),void(()=>{const{publisher:t,country:n,finnBlink:i}=h.get(),{loadFinnBlinkAd:r,wallpaperHandlers:{adjustAdToHorseshoe:o}}=h.getHandlers(),a=window.apntag,s={publisher:t,country:n,finnBlink:i},d=e=>{$t(e),Pe(()=>a.showTag(e))};return{withXandrAd:d,withFinnBlinkAd:t=>e(void 0,void 0,void 0,function*(){yield r(t,s,null)}),withFullAdsChain:t=>e(void 0,void 0,void 0,function*(){yield r(t,s,d,()=>{we.getData("horseshoe").isAvailable&&o(t)})})}})().withFullAdsChain(i);Pe(()=>(t("core showTag",{id:i}),n.showTag(i)))},xn=(n,i)=>e(void 0,void 0,void 0,function*(){yield Oe,yield Le;const e=new IntersectionObserver((e,n)=>((e,n,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:r}=e,o=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(r),a=document.getElementById(o);t("core log from intersection observer handler",{targetId:o,element:a}),i(window.apntag,o),a&&(n.unobserve(a),n.disconnect())})})(e,n,An),In(i));e.observe(n)}),Tn=new Map,Sn=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],Cn=".brandstudio-premium-content-widget",Pn=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),On=({adWrapper:e,placementContainer:t})=>{const n=Pn({adWrapper:e,placementContainer:t});var i;null==e||e.style.setProperty("height",`${n}px`),Nt(i=t),i.innerHTML=""},Ln=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},$n=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=h.get(),i=Sn.includes(n)&&Boolean(t.closest(Cn));const r=i?t.closest(Cn):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!i&&!a||i&&!r)return;if(a)return Ln(e),void o.disconnect();const s=t.closest('[style*="height"]'),d=r;s&&d.contains(s)?Ln(s):d.hasAttribute("style")&&Ln(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},jn=(e,t,n,i,r,o)=>{var a;const s=performance.now(),d=null!==(a=Tn.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(i,r)&&n<0;s-d>=r&&l&&(Tn.set(t,s),((e,t,n)=>{const i=null==n?void 0:n.parentElement;i&&n&&On({adWrapper:i,placementContainer:n}),Pe(()=>{e.setKeywords([t],{[`${Z()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},Nn=(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,jn,n,i),In(t));r.observe(e)},_n=(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},Dn=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),Mn=(e,t=0)=>{const n=e.getBoundingClientRect(),i=window.innerHeight;return n.bottom>-t&&n.top<i+t},qn=(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;$n({adWrapper:r,placementContainer:i});const{delayTime:o=1e3}=t,a=(new Date).getTime();if(i&&"true"!==i.dataset.subscribedForRefresh){const e=(e=>{var t;const{deviceType:n,preloadMarginsConfig:i}=h.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,a,s,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!==(a=null==t?void 0:t.renderMargin)&&void 0!==a?a:150},low:{refreshMargin:null!==(s=null==n?void 0:n.refreshMargin)&&void 0!==s?s: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&&Nn(i,e,a,o)}},Rn=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=h.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Hn(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Bn=(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;Mn(r,o)&&i&&(jt(i.id),n.length&&r.classList.remove(...n),Hn([i],t))}},Fn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:i}=h.get();t&&(e.forEach(({id:e})=>{const t=zn(e);t&&(t.dataset.bfCacheRefresh="true")}),i?((e,t)=>{document.addEventListener("visibilitychange",()=>{Bn(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const i=()=>{window.scrollY>0&&(window.removeEventListener("scroll",i),Bn(e,!1,t))};n.persisted&&(Dn()?window.addEventListener("scroll",i,{passive:!0}):Bn(e,!1,t))})})(e,n))},zn=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Vn=e=>{const{id:t,allowedFormats:n}=e,i=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(zn(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},Hn=(e,t=!1)=>{const{requestSize:n=p}=h.get(),i=e.map(({id:e})=>e),r=_n(i,n);if(t)for(const t of e){const e=Vn(t);window.apntag.modifyTag(t.id,e)}for(const e of r)Pe(()=>window.apntag.refresh(e))};const Un="#fff",Wn="#0098da",Kn="splash",Gn="welcomePage",Jn="topscroller",Yn="velvet",Qn="takeover-displayed",Xn=()=>{const{takeover:{enabled:e=!1}={}}=h.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||e&&!Zn())},Zn=()=>{var e;const t=(null===(e=h.get().takeover)||void 0===e?void 0:e.cookieCapName)||Qn;return"true"===y(t)},ei=(e,t)=>[[1,1],[1920,1080]].some(([n,i])=>n===e&&i===t),ti=()=>{const{takeover:e}=h.get();return Boolean(null==e?void 0:e.topscroller)},ni=()=>e(void 0,void 0,void 0,function*(){const e=14400,t=document.location.hostname,{takeover:{cookieCapName:n=Qn,cookieCapTime:i=e}={},isMobileApp:r,tcf:o}=h.get(),a=yield Y(o,r,"ad-takeover-cookiecap");i&&a&&(window.document.cookie=`${n}=true; max-age=${i}; domain=${t}; path=/`)}),ii=e=>{var t;const n=!!(null===(t=h.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return Ue(e)&&n},ri=(e,t)=>{var n;if(t===Jn){const{topscroller:t}=e;return null!=t?t:{}}if(t===Kn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},oi=(e,t)=>{t!==Kn?(e=>{var t,n,i;const r=null===(n=null===(t=h.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(i=h.get().takeover)||void 0===i?void 0:i.topscroller;if(!r||o)return;const a=document.querySelector(r),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),l=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&l&&d))return;const c=null==a?void 0:a.offsetHeight,u=We(e)?"60svh":`calc(100svh - ${c}px)`,v=We(e)?"calc(40svh + 30px)":`calc(${c}px + 30px)`;s.style.setProperty("height",u,"important"),d.style.setProperty("height",u,"important"),l.style.setProperty("bottom",v,"important")})(e):(e=>{var t;if(!(null===(t=h.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)},ai=ot([],()=>{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})}),si=(e,t=!0)=>{(e===Gn||e===Jn)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},di=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},li=e=>{document.body.style.overflow=e?"initial":"hidden"},ci=e=>{const t=vi(e),n=ui(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),li(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},ui=e=>{const t=()=>ci(e);return window.addEventListener("advertory:closeTakeover",t),di(),t},vi=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&ci(e)};return di(),window.addEventListener("keydown",t),t},pi=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(vi(e),ui(e),di(),t.addEventListener("click",()=>{ci(e)}),li(!1))},gi=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),ui(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},hi=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>ci(e))})(e)},mi=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=h.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=ft.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},yi=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=ft.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},fi=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=ft.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},wi=e=>{e.classList.toggle("advertory-impact-wrapper",!0)},bi=()=>{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)},Ei=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${ai})()`,e+t.outerHTML})(e)),n},ki=e=>{const t=(e=>{const{requests:t}=window.apntag,n=rt(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=rt(e)?1:0;n&&(n.tags[e].adResponse.ads[i].rtb.banner.content=t)})(e,Ei(t))},Ii=t=>e(void 0,void 0,void 0,function*(){const{takeover:e}=h.get(),{targetId:n}=t,i=document.querySelector(`#${n}`),r=document.querySelector(".advertory-takeover-wrapper");if(!i||!r||!e)return;const o=(e=>{const{width:t,height:n}=e;return ei(t,n)?Kn:nt(e,Me)?Yn:ti()?Jn:Gn})(t),a=r.offsetHeight,s=window.scrollY>a;r.style.display="block",!s&&si(o,!1),((e,t)=>{({[Gn]:fi,[Kn]:mi,[Jn]:yi,[Yn]:wi})[t](e)})(r,o),bi(),((e,t)=>{({[Gn]:gi,[Jn]:gi,[Kn]:pi,[Yn]:hi})[t](e)})(r,o),((e,t,n)=>{if(!n)return;({[Gn]:()=>{const{buttonLabel:i}=ri(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:"")})},[Kn]:()=>{const{themeColors:i,logotype:r,buttonLabel:o,showArrowIcon:a}=ri(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&&a){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:Un,"important"),n.style.color=null!=t?t:Wn}}})},[Jn]:()=>{const{buttonLabel:i,showArrowIcon:r,showCloseButton:o=!0}=ri(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:""))})},[Yn]:()=>{}})[t]()})(r,o,e),yield ni(),!s&&si(o,!0),oi(t,o)});yt(".advertory-brandmetrics-survey{width:100%}");const Ai="advertory-brandmetrics-survey",xi=()=>e(void 0,void 0,void 0,function*(){const{norstat:{enabled:t}={},country:n,isMobileApp:i,tcf:r}=h.get(),o=yield Y(r,i,"norstat");if(!t||i||!o)return;const a=(e=>{const{ppid1:t,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r}=le.getPPIDs(),o=(new se).add(n,P[e]).add(t,O[e]).add(r,L[e]).add(i,$[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(n);((t,n,...i)=>{e(void 0,[t,n,...i],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/${n===S.NO?"schibsted":"schibstedse"}/map/${a}`,"norstat")}),Ti={nativeAd:e=>Ve(e)&&!Je(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:He,fullscreenScroll:ze,topscroller:e=>Ue(e)&&ti(),splash:e=>Ue(e)&&ei(e.width,e.height),welcomePage:Ue,wallpaper:Ke,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:Ze,hFormat:et,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!et(e)&&!Ze(e),topboard:e=>e.targetId.startsWith("topboard")&&!Ue(e),widescreen:e=>e.targetId.startsWith("widescreen"),insider:e=>e.targetId.startsWith("insider"),sponsorstripe:Je,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!Qe(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!Xe(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:Qe,midboard:Xe},Si=({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 a=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;a&&(t.dataset.invCode=a)})(r,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const a="DIV"===(null==o?void 0:o.tagName);e&&a&&((e,t)=>{var n,i;for(const[r,o]of Object.entries(Ti))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)},Ci=e=>{var t;return(null===(t=Object.entries(Ti).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Pi=new Map;Pi.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Pi.set("panorama",{scale:.79,transformOrigin:"center center"}),Pi.set("outstream",{scale:.79,transformOrigin:"center center"}),Pi.set("integration",{scale:.79,transformOrigin:"center center"}),Pi.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Oi=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=Ci(e),r=Pi.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 a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==o?void 0:o.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},Li=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}={}}=h.get();if(!t||!n||!i)return;const a=window.innerWidth,s=Math.round(a/1080*1920);t.style.width="100%",t.style.height=`${s}px`,t.classList.add(`advertory-${r}-${o}__vertical-full-width-ad`);const d=((e,t)=>{const n=e.width,i=(null!=t?t:window.screen.width)/n;return i<1?i:1})(e,t.offsetWidth);i.style.transform=`scale(${d})`,i.style.transformOrigin="left top"},$i=(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,ji=e=>`externalImpId:'${e}'`,Ni=e=>{var n;const{forwardExternalImpId:i=!1,tracker:r}=h.get(),o=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${ee()}-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:a,sizes:s,keywords:d,allowedFormats:l,invCode:c,ssa:u=!1,nativeCustomProperties:v,safeframeConfig:p,resizeAdParentDiv:g=!1,dynamicSizeWidthCheck:m=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Xn())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!==Jn),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})})(o),y=Object.assign({invCode:c,sizes:s,targetId:a,keywords:$i(d,u),allowedFormats:l,resizeAdParentDiv:g,dynamicSizeWidthCheck:m},p&&{safeframeConfig:p}),f=(e=>{var n,i,r,o,a,s,d;return e?(null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)?(null===(r=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===r?void 0:r.pageViewId)?(t("Tracker state pageViewId is:",null===(a=null===(o=null==e?void 0:e.instance)||void 0===o?void 0:o.state)||void 0===a?void 0:a.pageViewId),null===(d=null===(s=null==e?void 0:e.instance)||void 0===s?void 0:s.state)||void 0===d?void 0:d.pageViewId):(t("Tracker state does not contain field pageViewId or it is empty"),""):(t("Tracker state is empty"),""):(t("Tracker is not configured in initAdvertory function"),"")})(r);i&&f&&(t("External Impression ID assigned to defineTag:",ji(f)),y.externalImpId=ji(f));const w=(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}}))(v);return(null===(n=e.allowedFormats)||void 0===n?void 0:n.includes("native"))&&(y.native=w),y},_i=e=>{const{source:t}=e;return"csm"===t},Di="native-ad",Mi=e=>{if(!e)return e;const t=e[`${Z()}-targetid`],n=t?xt(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${Z()}-targetid`]:[n]})},qi=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${Z()}-geo`]&&{[`${Z()}-geo`]:["geo-test-value"]}),e[`${Z()}-geofence`]&&{[`${Z()}-geofence`]:["geofence-test-value"]}),e[`${Z()}-weather`]&&{[`${Z()}-weather`]:["weather-test-value"]}),Ri=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"})})()},Bi=(t,n)=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{t().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})}),Fi=()=>e(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)}}),zi={arrayMerge:(e,t)=>t},Vi=n=>e(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))})(n))return n;try{const i=yield(n=>e(void 0,void 0,void 0,function*(){const e=(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})(n);if(!e)return null;const i=new AbortController,r=setTimeout(()=>i.abort(),5e3);try{return yield H.get(e,{method:"GET",signal:i.signal})}catch(n){throw t("Failed to fetch S3 config",{error:n,url:e}),n}finally{clearTimeout(r)}}))(n);return i?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:i,refresh:r,placements:o,threshold:a,batchSize:s}=t,d=c.all([e.placements,o],zi),l=c(e.pageOptions,{keywords:i},zi),u=c(e.appearanceConfig,{defaultThreshold:a},zi),v=c(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:r},zi);return Object.assign(Object.assign({},e),{placements:d,requestSize:null!=s?s:e.requestSize,pageOptions:l,appearanceConfig:u,refreshConfig:v})})({siteConfig:n,configOverrides:i}):n}catch(e){return t("Error fetching S3 config, using site config",{error:e}),n}}),Hi=".advertory-right-column-track",Ui="--advertory-right-column-track-height",Wi=e=>e.getBoundingClientRect().top+window.scrollY,Ki=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},Gi=(e,t)=>{const n=(i=t,`${Math.max(0,Math.round(i))}px`);var i;document.body.style.setProperty(e,n)},Ji=(e,t)=>`${e}-${t}`,Yi=(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 a=Wi(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=Ki(e);Gi("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const i=Wi(e),r=Ji(Ui,t),o=i-n,a=Ji("--advertory-right-column-split-point-height",t),s=Ki(e);Gi(r,o),Gi(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Ji("--advertory-right-column-ad-height",t),i=Ki(e);Gi(n,i)})(r[t])});((e,t)=>{const n=Wi(e);Gi(Ui,n-t)})(o[Math.min(r.length,o.length-1)].point,a)};let Qi=!1;let Xi,Zi=[];const er=["takeover","wallpaper"],tr=e=>{const t=(e=>{const t=we.getData("alertoryConfigKeywords"),{queryConfig:n,placements:i,tcf:r,glimr:o,appearanceConfig:a,requestSize:s=p,publisher:d,country:l,pageType:c,deviceType:u,isMobileApp:v=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m,useAppTabletInvCode:y}=e;return{xandr:{member:g,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:s,isMobileApp:v,useAppTabletInvCode:y},o&&{glimr:o}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},nr=()=>e(void 0,void 0,void 0,function*(){const{pageOptions:t}=h.get(),{preparePageOptions:n}=h.getHandlers(),i=(()=>{const{sandboxAdIframeEnabled:e=!0}=h.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"]}})(),r=yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get();return(yield Y(e,t,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield n(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},t),{renderingManagement:Object.assign({},i)}),r));(e=>{const t=we.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=qi(e);we.setData("alertoryConfigKeywords",n)})(o.keywords),Pe(()=>Xi.setPageOpts(o))}),ir=n=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:i,isMobileApp:r}=h.get();rr(n);const o=yield Y(i,r,"prebid");(null==e?void 0:e.enabled)&&o?(t("core loadPlacements prebid enabled"),yield Ae()):(t("core load tags invoked without prebid enabled"),or(n))}),rr=e=>{const{prepareTag:n}=h.getHandlers(),i=[];(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=>{t("core defineTags",{placement:e});const r=Ni(e);if(!e.id.includes("takeover")||Xn()){const o=n(r),a=(e=>{const{allowedFormats:t,invCode:n,keywords:i,sizes:r}=e;return{adTypes:t,invCode:n,keywords:Mi(i),sizes:r}})(o);i.push(a),Pe(()=>(t("core defineTag - add to the queue",{placement:e,preparedTag:o}),Xi.defineTag(o)))}}),(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)})(i)},or=e=>{const n=e.map(({id:e})=>e);Pe(()=>(t("core loadTags",{placementsIdsToLoad:n}),Xi.loadTags([...n])))},ar=(n,i)=>e(void 0,void 0,void 0,function*(){const{appearanceConfig:e,deviceType:r}=h.get(),{threshold:o,refresh:a,priority:s="normal"}=n,d=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(i),l=null==e?void 0:e.defaultThreshold[r];d&&(t("core showAd - subscribe for show tag with thresholds",{placement:n,adObj:i,threshold:o,deviceDefaultThreshold:l}),yield xn(d,null!=o?o:l)),d&&a&&(t("core showAd - setup refreshing",{placement:n,adObj:i}),d.dataset.refresh=a.toString(),d.dataset.priority=s)}),sr=e=>e.some(({id:e})=>er.some(t=>e.includes(t))),dr=n=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return;const{requestSize:i=p}=h.get(),r=Bt(n);for(const e of Object.keys(r)){const n=r[e],o=_n(n,i);for(const e of o)sr(e)?(t("core loadAds without lazy loading",{placementsToLoad:e}),yield ir(e)):e.length&&(t("core loadAds with lazy loading",{placementsToLoad:e}),yield lr(e))}}),lr=n=>e(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:e=!1,rootMargin:i="200% 0px"}={}}={}}=h.get(),r=[];if(!e)return t("lazy load is not enabled",{placements:n}),void(yield ir(n));const o=new IntersectionObserver((e,i)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{t("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:n});const o=n.every(e=>r.includes(e.id)),a=n.map(e=>e.id);!o&&r.push(...a),!o&&ir(n),t("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:n,arePlacementsLoaded:o,placementIds:a}),i.disconnect()})},{rootMargin:i});n.forEach(e=>{const n=document.getElementById(e.id);n&&(t("lazy loading - observe element",{placementId:e.id,element:n}),o.observe(n))})}),cr=()=>e(void 0,void 0,void 0,function*(){const{siteEvents:n,initNativeAd:i,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:o}}=h.getHandlers(),{wallpaper:a,fullscreenScroll:s}=h.get(),d=[];Pe(()=>{Xi.onEvent("adRequested",()=>{n.adRequested()}),Xi.onEvent("adAvailable",o=>e(void 0,void 0,void 0,function*(){var e,d,l,c,u,v;t("core adAvailable start",{placementsAvailable:Zi,adObj:o,isFullscreenScrollAd:ze(o),isFinnBlink:Ye(o.targetId),isNativeAd:Ve(o),isMediation:_i(o),isTakeoverAd:Ue(o),isCollapseAd:Ge(o),isWallpaperAd:Ke(o)});const p=null===(l=null===(d=null===(e=null===window||void 0===window?void 0:window.apntag)||void 0===e?void 0:e.requests)||void 0===d?void 0:d.tags[o.targetId])||void 0===l?void 0:l.adResponse.ads;_i(o)&&p&&(null===(c=p[1])||void 0===c?void 0:c.rtb)&&(o.banner=null===(v=null===(u=p[1])||void 0===u?void 0:u.rtb)||void 0===v?void 0:v.banner),ze(o)&&At(o),ze(o)&&!Ye(o.targetId)&&It(o,s),!Ve(o)||_i(o)||Ye(o.targetId)||i(o,h.get()),Ue(o)&&!Ge(o)&&(ki(o.targetId),yield Ii(o)),Ke(o)&&(r(()=>Pe(()=>window.apntag.showTag(o.targetId)),a),we.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(o)&&we.setData("horseshoe",{isAvailable:!0}),Si({adObj:o}),(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)})(o),n.adAvailable(o);const g=Zi.find(({id:e})=>e===o.targetId);g&&(yield ar(g,o),Zi=Zi.filter(e=>e.id!==g.id)),t("core adAvailable stop",{placementsAvailable:Zi,adObj:o,isFullscreenScrollAd:ze(o),isFinnBlink:Ye(o.targetId),isNativeAd:Ve(o),isMediation:_i(o),isTakeoverAd:Ue(o),isCollapseAd:Ge(o),isWallpaperAd:Ke(o)})})),Xi.onEvent("adLoaded",e=>{const{refreshConfig:t,appearanceConfig:r}=h.get(),a=document.getElementById(e.targetId);Ye(e.targetId)&&(e=>{const{fullscreenScroll:t}=h.get(),{initNativeAd:n}=h.getHandlers();ze(e)&&It(e,t),Ve(e)&&n(e,h.get())})(e);d.includes(e.targetId)&&Ve(e)&&(i(e,h.get()),Si({adObj:e})),!d.includes(e.targetId)&&_i(e)&&d.push(e.targetId),Ge(e)&&Lt(e.targetId),Ue(e)&&((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"]})})(Xi,e.targetId),He(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:i}={}}=h.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`))})(e),(e=>nt(e,Ne))(e)&&Li(e),qn(e,t),(null==r?void 0:r.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(e.targetId);var s,l;we.getData("horseshoe").isAvailable&&o(e.targetId),n.adLoaded(e),s=e.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${s}`)&&(null===(l=window.gdpr)||void 0===l?void 0:l.setupButton)&&window.gdpr.setupButton(s),a&&a.classList.add("ad-loaded"),Oi(e),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:e.targetId,adFormat:Ci(e)}}))}),Xi.onEvent("adNoBid",t=>e(void 0,void 0,void 0,function*(){Lt(t.targetId),yield un(h.get(),t),ii(t)&&(yield ni()),n.adNoBid(t)})),Xi.onEvent("adError",(t,i)=>e(void 0,void 0,void 0,function*(){ii(i)&&(yield ni()),n.adError(t,i)})),Xi.onEvent("adCollapse",()=>{n.adCollapse()}),Xi.onEvent("adRequestFailure",e=>{Lt(e.targetId),n.adRequestFailure(e)}),Xi.onEvent("adBadRequest",e=>{Lt(e.targetId),n.adBadRequest(e)}),Xi.onEvent("adLoadedMediated",e=>n.adLoadedMediated(e)),Xi.onEvent("adNoBidMediated",e=>n.adNoBidMediated(e))})}),ur=(n,i)=>e(void 0,void 0,void 0,function*(){var r;h.set(n),h.setHandlers(i),we.initialize(),window.addEventListener("message",kn,!1),Xi=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=Xi,t("Apn tag is set up on window"),yield W(),t("Fetching permissions has been resolved"),yield Promise.allSettled([e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t}=h.get();(yield Y(e,t,"xandr-endpoint"))||Xi.setEndpoint("ib.adnxs-simple.com",!0)}),e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n}=h.get(),i=yield Y(t,n,"prebid");(null==e?void 0:e.enabled)&&i&&(yield Ie(null==e?void 0:e.url))}),ce(n),e(void 0,void 0,void 0,function*(){const{astUrl:e}=h.get();yield Ie(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),e(void 0,void 0,void 0,function*(){const{gptUrl:e}=h.get();yield Ie(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),e(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:i}=h.get(),{getConsentAsync:r}=a(n),o=yield r();if(e&&t&&o){if(yield Ie(t),document.querySelector(`.${Ai}`))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(Ai)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),X(),e(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=h.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Ie(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield xi(),t("Libraries have been loaded and trackers have been set"),yield(r=i.librariesToLoad,e(void 0,void 0,void 0,function*(){const e=r.map(e=>Ie(e));yield Promise.all(e)})),yield cr(),yield nr(),t("Page options have been set"),tr(n),t("Advertory is setup on window"),Zi=qt(),Rn(Zi),Fn(Zi),yield dr(Zi),t("Ads has been loaded",Zi),Ri(Zi),yield i.replaceAdsWithFinnBlink(n.finnBlink),yield(t=>e(void 0,void 0,void 0,function*(){var e;if(!t.drEdition)return;if(!(yield Y(t.tcf,t.isMobileApp,"handleDrEdition")))return;const n=yield q(),i=new R(n);ln({publisher:t.publisher,drEditionConfig:t.drEdition,device:t.deviceType,pageType:t.pageType,country:t.country},i,null===(e=t.pulse)||void 0===e?void 0:e.instance)}))(n),(e=>{if(!(null==e?void 0:e.enabled)||Qi)return;const{splitPointIDs:t,adSelector:n,trackSelector:i=Hi}=e,r=document.querySelector(i);if(!r)return;Qi=!0;const o=()=>{Yi(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)})(n.rightColumnSplit)}),vr=(n,i)=>e(void 0,void 0,void 0,function*(){yield((n,i)=>e(void 0,void 0,void 0,function*(){const{initConsentManager:e,getConsentAsync:r}=a(n.tcf,n.isMobileApp),o=yield Vi(n);yield Fi(),yield Bi(e),yield Bi(r),t("TCF resolved successfully"),yield ur(o,i),t("Run function resolved successfully")}))(n,i)}),pr=()=>{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},gr="native_override_desc2",hr=(e,t,n)=>{var i;const{image:r,icon:o,sponsoredBy:a,title:s,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!=s?s:"",logo:w(o),sponsoredBy:null!=a?a:"",title:null!=s?s:"",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)},mr=(e,t)=>{const n=(i=gr,window.location.href.includes(i));var i;const r=new URLSearchParams(window.location.search).get(gr),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},yr=(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(me).includes(i);n&&o&&((e,t,n,i)=>{const r=t.parentElement;if(!r)return;const o=e?`-${e}`:"",a=i?`__${i}`:"",s=`advertory${o}-${n}${a}`,d=`advertory${o}-${n}-wrapper${a}`;t.classList.remove(...t.classList),r.classList.remove(...r.classList),t.classList.add(s),r.classList.add(d),t.dataset.adType=n})(i,e,Di,r)})(r,n),i())},fr=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:[])kr(i)}),t.dataset.tracked="true")})},wr=e=>{const{native:{impressionTrackers:t}={}}=e;(null==t?void 0:t.some(e=>e.includes("googleads")))?null==t||t.forEach(Er):window.apntag.fireImpressionTrackers(e);const n=new CustomEvent("advertory:nativeImpression",{detail:{ad:e}});window.dispatchEvent(n)},br=(e,t)=>{var n;let i=!1;const r=document.querySelector(`#${e.targetId}`);if(!r||!e.native)return;const{deviceType:o,appearanceConfig:a,nativeTrackingConfig:{fireImpressionsBasedOnAppearanceThreshold:s=!1}={}}=t,d=s?{rootMargin:`${l=null!==(n=null==a?void 0:a.defaultThreshold[null!=o?o:f.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,wr(e),c.disconnect();break}},d);c.observe(r)},Er=e=>{const t=e.includes("googleads");"function"!=typeof window.navigator.sendBeacon||t?kr(e):window.navigator.sendBeacon(e)},kr=e=>{fetch(e,{method:"GET",mode:"no-cors"}).catch(t=>console.warn(`Tracker ${e} failed. Error: ${t||"Unknown"}`))},Ir=(e,t,n)=>{const i=((e,t,n)=>{var i;const{displayTemplates:r,videoTemplates:o}=n,a="default";if(!e.native)return null;const{native:s,targetId:d}=e,{desc2:l=a}=e.native,c=l.toLowerCase(),u=null!==(i=mr(e.targetId,l))&&void 0!==i?i:c,v=ft[t.language||S.NO],p=hr(s,v,d);return(s.video?o[u]:r[u]||r.default)(p,t)})(e,t,n);yr(e.targetId,i,t,()=>{const{nativeTrackingConfig:{nativeTrackingEnabled:n=!0}={}}=t;n&&((e,t)=>{fr(e),br(e,t)})(e,t)})};yt('@import"https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap";.advertory-klart-ad-native-content{position:relative;font-family:Roboto,sans-serif;font-style:normal;background-color:#e4f0ff;font-size:12px;margin-top:8px;width:100%;box-shadow:rgba(0,0,0,.05) 0 2px 2px 0}.advertory-klart-ad-native-content .ad-info{position:absolute;right:5px;top:2px;height:26px;width:26px;z-index:50;border-bottom-left-radius:13px;border-top-right-radius:13px}.advertory-klart-ad-native-content .ad-info svg path{fill:#fff}.advertory-klart-ad-native-content .ad-link{color:inherit;text-decoration:none}.advertory-klart-ad-native-content .ad-link .ad-header{position:absolute;z-index:9;width:100%;box-sizing:border-box;font-family:Roboto,sans-serif;background-color:rgba(42,114,221,.7);border:1px solid rgba(34,34,34,.1);border-bottom:none}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-header{position:relative}}.advertory-klart-ad-native-content .ad-link .ad-header .ad-annonse{display:inline-block;font-weight:bold;color:#fff;line-height:15px;background-color:#2a72dd;padding:6px 16px}.advertory-klart-ad-native-content .ad-link .ad-content{display:flex;flex-direction:column;background-color:#fff;padding:0}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content{display:flex;flex-direction:row;justify-content:space-between;padding:10px 16px 12px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content{display:flex;flex-direction:column;justify-content:space-between;order:2;margin:8px 16px;width:calc(100% - 32px)}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content{order:1;margin:0;width:inherit}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-subtitle{order:3;padding:10px 16px 0 0;font-size:14px;line-height:16px;color:#444}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-subtitle{order:2;padding:10px 16px 16px 0}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-sponsored{order:1;margin-bottom:4px;color:#2a72dd;font-family:Roboto,sans-serif;font-style:normal;font-weight:bold;line-height:13px;text-transform:uppercase}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-sponsored{order:3;margin-top:8px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-title{color:#222;font-size:22px;font-style:normal;font-weight:bold;line-height:25px;order:2}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-data-content .ad-title{font-size:24px;line-height:28px}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container{order:1}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container{order:2}}.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container .ad-image{position:relative;margin-top:0;width:100%;height:auto;aspect-ratio:1200/628}@media screen and (min-width: 768px){.advertory-klart-ad-native-content .ad-link .ad-content .ad-image-container .ad-image{width:268px;max-height:140px;margin:0 0 10px 0}}.advertory-klart-ad-native-content .ad-link .ad-gambling{display:flex;justify-content:space-between;border-top:1px solid #ccc;padding-top:8px;padding-bottom:8px;margin:0 16px 0 16px}.advertory-klart-ad-native-content .ad-link .ad-gambling .ad-gambling-text{line-height:14px;color:#6a6a6a}.advertory-klart-ad-native-content .ad-link .ad-gambling .ad-gambling-link{line-height:14px;color:#0078bd;text-decoration:underline !important}.advertory-klart-ad-native-content.article{border-left:4px solid #2a72dd}@media screen and (min-width: 768px){.advertory-klart-ad-native-content.article{border-left:unset}}.advertory-klart-ad-native-content.article .ad-content{display:flex;flex-direction:row-reverse;align-items:center}@media screen and (min-width: 768px){.advertory-klart-ad-native-content.article .ad-content{flex-direction:unset}}.advertory-klart-ad-native-content.article .ad-content .ad-data-content{display:flex;margin:0 10px 0 0}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-annonse{order:1;color:#fff;background-color:#0366b4;font-size:12px;padding:2px 4px;text-transform:uppercase;font-weight:bold;margin-bottom:unset;width:fit-content}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-title{order:2;line-height:23px;font-size:15px}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-subtitle{order:3;font-size:15px}.advertory-klart-ad-native-content.article .ad-content .ad-data-content .ad-sponsored{order:4;color:gray}.advertory-klart-ad-native-content.article .ad-content .ad-image-container{width:150px;margin:10px}');yt('@import"https://fonts.googleapis.com/css?family=Roboto:400&display=swap";.advertory-klart-ad-native-classic{border-top:4px solid #2a72dd;position:relative;font-family:Roboto,sans-serif;font-style:normal;background-color:#fff;color:#000;width:100%}.advertory-klart-ad-native-classic .ad-info{top:2px;right:0;position:absolute;height:26px;width:26px;z-index:1000;border-bottom-left-radius:13px;border-top-right-radius:13px}.advertory-klart-ad-native-classic .ad-link{color:inherit;text-decoration:none;display:block}.advertory-klart-ad-native-classic .ad-link .ad-content{border-left:1px solid rgba(34,34,34,.1);border-right:1px solid rgba(34,34,34,.1);border-bottom:1px solid rgba(34,34,34,.1);display:flex;flex-direction:column}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-header{display:flex;padding:8px 16px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-header .ad-annonse{font-size:14px;font-weight:bold;color:#2a72dd;content:"ANNONS";display:inline-block;text-align:left;vertical-align:middle}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content{padding:8px 16px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-subtitle{font-family:Roboto,sans-serif;font-size:15px}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-subtitle .ad-sponsored{color:#2a72dd;font-weight:bold;text-transform:uppercase}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-title{font-weight:bold;font-size:30px;letter-spacing:-1px;line-height:1.08;margin:0 0 4px}@media screen and (min-width: 768px){.advertory-klart-ad-native-classic .ad-link .ad-content .ad-data-content .ad-title{font-size:54px;letter-spacing:-1.8px;font-weight:bold}}.advertory-klart-ad-native-classic .ad-link .ad-content .ad-image-container .ad-image{position:relative;width:100%;height:100%;aspect-ratio:2.8;object-fit:cover;object-position:center}.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:24px;font-weight:700;border:5px solid #000;padding:10px 0;text-align:center;justify-content:center;background:#fff;font-family:Roboto,sans-serif;color:#000;display:flex;flex-direction:column;box-sizing:border-box}@media screen and (min-width: 440px){.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:30px}}@media screen and (min-width: 768px){.advertory-klart-ad-native-classic .ad-link .alcohol-warning{font-size:48px}}[data-theme=dark] .advertory-klart-ad-native-classic{background-color:#222;color:#fff}');const Ar={CONTENT_DISPLAY:({containerId:e,url:t,adContentFrom:n,adText:i,sponsoredBy:r,title:o,img:a,description:s,desc2:d})=>`<article class="advertory-klart-ad-native-content">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}" target="_blank">\n <div class="ad-header">\n <span class="ad-annonse">${i}</span>\n </div>\n <div class="ad-content">\n <div class="ad-data-content">\n <div class="ad-title">${o}</div>\n ${s&&`<div class="ad-subtitle">${s}</div>`}\n <div class="ad-sponsored">${n} ${r}</div> \n </div>\n <div class="ad-image-container">\n <img alt="${o}" class="ad-image" src="${a}" />\n </div>\n </div>\n ${"gambling"===d?'<div class="ad-gambling">\n <div class="ad-gambling-text">Åldersgräns för spel är 18 år.</div>\n <div class="ad-gambling-link">www.stodlinjen.se</div>\n </div>':""}\n </a>\n </article>`,CLASSIC:({containerId:e,url:t,adText:n,sponsoredBy:i,title:r,img:o,description:a,desc2:s},d)=>{const l=tt({native:{desc2:s}}),c=l?"advertory-klart-ad-native-classic-alcohol":"",u=l?'<div class="alcohol-warning">Alkohol&nbsp;kan skada&nbsp;din&nbsp;hälsa</div>':"",{deviceType:v}=d,p=(e=>e===f.DESKTOP)(v)?"":' target="_blank" rel="noopener"';return`<article class="advertory-klart-ad-native-classic ${c}">\n <div class="ad-info" id="${e}-button"></div>\n <a class="ad-link" href="${t}"${p}>\n <div class="ad-content">\n <div class="ad-header">\n <span class="ad-annonse">${n}</span>\n </div>\n <div class="ad-image-container">\n <img alt="${r}" class="ad-image" src="${o}" />\n </div>\n <div class="ad-data-content">\n <div class="ad-title">${r}</div>\n <div class="ad-subtitle">\n <span class="ad-sponsored">${i}</span> ${a}\n </div>\n </div>\n </div>\n ${u}\n </a>\n </article>`}},xr={displayTemplates:{brandstudio_native_ad:Ar.CLASSIC,brandstudio_native_ad_alcohol:Ar.CLASSIC,default:Ar.CONTENT_DISPLAY,gambling:Ar.CONTENT_DISPLAY},videoTemplates:{}},Tr=e=>{const t=e.querySelector(".advertory-klart-ad-native-classic-alcohol");if(!t)return;const n=t.querySelector(".ad-content"),i=t.querySelector(".alcohol-warning");if(!i||!n)return;const r=(e=>{const t=e.getBoundingClientRect().height;return Math.floor(.25*t)})(n);i.style.height=`${r}px`};yt(".advertory-klart-native-ad-wrapper__front{align-items:center;clear:both;display:flex;justify-content:center;overflow:hidden}.advertory-klart-native-ad-wrapper__front .advertory-klart-native-ad__front{position:relative;width:100%;min-height:120px;z-index:10}");const Sr=((e,t)=>n=>vr(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:(e,t)=>{const{targetId:n}=e,i=document.querySelector(`#${n}`);if(!i)return;const{pageType:r=Xt.FRONT,deviceType:o,nativeTrackingConfig:a,appearanceConfig:s}=null!=t?t:{},d={language:S.SE,publisher:me.KLART,deviceType:o,pageType:r,nativeTrackingConfig:a,appearanceConfig:s};Ir(e,d,xr),tt(e)&&Tr(i)},wallpaperHandlers:{initWallpaperAd:Ce,adjustAdToHorseshoe:Ce},loadFinnBlinkAd:Se,replaceAdsWithFinnBlink:Se,preparePageOptions:ge,prepareTag:e=>{const{keywords:t,targetId:n,invCode:i}=e,{useAppTabletInvCode:r=!0}=h.get(),o=((e,t)=>{const{isMobileApp:n}=h.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(i,r),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,i=`${Z()}-adformat`,r=t?t[i]:[];if(!r)return{};const o=(Array.isArray(r)?r:[r]).filter(e=>!(e in Fe)||window.innerWidth>=Fe[e]);return{[i]:n?o:r}})(e),s=(e=>{const t=`${Z()}-targetid`;return e?{[t]:[e]}:{}})(n),d=(e=>{var t;const[,n]=null!==(t=e.match(/-((w|a)(?:ph|de|tb))-/))&&void 0!==t?t:[];switch(n){case"wde":return{"aa-sch-supply_type":"web_desktop"};case"wtb":return{"aa-sch-supply_type":"web_tablet"};case"wph":return{"aa-sch-supply_type":"web_phone"};case"aph":return{"aa-sch-supply_type":"app_phone"};default:return}})(o),l=pr();return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),d),l)})},siteEvents:he,librariesToLoad:[]},ye),Cr=yt("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var Pr=Object.freeze({__proto__:null,default:Cr});exports.getVideoPPIDs=t=>e(void 0,void 0,void 0,function*(){const{ppid1:e,ppid2:n}=de.getPPIDs(),{ppid1:i,ppid2:r}=le.getPPIDs(),o=(new se).add(n,P[t]).add(e,O[t]).add(r,L[t]).add(i,$[t]);return yield new Promise(e=>{e(o.buildVideoEids())})}),exports.initAdvertoryPackage=Sr,exports.updateAdvertory=(t,n)=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return[];const{clearAds:i,reloadExistingAds:r,renderFinnBlinkPlacements:o,contextSelector:a}=null!=n?n:{};if(i)return _t(),[];r&&(_t(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{$t(e.id)})),m(null!=t?t:{}),yield nr();let s=qt(a);return o&&(s=s.filter(e=>Ye(e.id))),s.length>0&&(Zi=[...Zi,...s.map(e=>Object.assign({},e))],Rn(s),Fn(s),yield dr(s)),Zi});