import{c as t,G as e,S as o,H as n,I as a}from"./_auto-entry_aftenposten-CGc0ZPFr.js";export{E as calculateScaleFactor,K as getAspectRatio,J as scaleAdIpadAirPortrait}from"./_auto-entry_aftenposten-CGc0ZPFr.js";import"react/jsx-runtime";const i=i=>{var d,l,s,r,c,u;const{adScaleConfig:f,pageContext:{deviceType:v}}=t.get();if(!(null==f?void 0:f.enabled))return;if(e(i,o.ANY_FULLSCREEN))return;const p=null!==(d=f.adsToBeScaled[v])&&void 0!==d?d:[],m=n(i.targetId.split("-")[0]);if(!p.includes(m))return;const g=null!==(s=null===(l=f.offset)||void 0===l?void 0:l[m])&&void 0!==s?s:0,w=document.getElementById(i.targetId),E=null!==(r=null==w?void 0:w.offsetWidth)&&void 0!==r?r:window.screen.width,I=null!==(u=null===(c=null==w?void 0:w.parentElement)||void 0===c?void 0:c.offsetWidth)&&void 0!==u?u:window.screen.width;a(i,(E<I?E:I)-g)};export{a as scaleAd,i as scaleAds};
