console.log("THETA VIDEO"); let apotis4stis5inread = {} apotis4stis5inread.pel = document.createElement('script') apotis4stis5inread.pel.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js' apotis4stis5inread.pel.async = true window.parent.document.head.appendChild(apotis4stis5inread.pel) apotis4stis5inread.pel = document.createElement('script') apotis4stis5inread.pel.src = `https://static.thetamedia.gr/prebid.js?t=1721893585` apotis4stis5inread.pel.async = true window.parent.document.head.appendChild(apotis4stis5inread.pel) apotis4stis5inread._theta_head = window.parent.document.head || window.parent.document.getElementsByTagName('head')[0] apotis4stis5inread.scrolling = false apotis4stis5inread.carousel = JSON.parse('{"desktop":{},"mobile":{}}'.replaceAll('"', '"')) apotis4stis5inread.conf = JSON.parse('{"bidders":[{"bidder":"adform","params":{"mid":1947896}},{"bidder":"adform","params":{"mid":1501299}},{"bidder":"oftmedia","params":{"placementId":34352662}},{"bidder":"rubicon","params":{"accountId":26556,"siteId":544342,"zoneId":3382574,"video":{"size_id":203}}}]}'.replaceAll('"', '"')) apotis4stis5inread.sellerId = "5" apotis4stis5inread.selector = "p" apotis4stis5inread.selectorIndex = "1" apotis4stis5inread.selectorIndexMobile = "1" apotis4stis5inread.margin = "0" apotis4stis5inread.passbackuri = "https://thetamarketplace.com/passback/apotis4stis5inread" apotis4stis5inread.hituri = "https://thetamarketplace.com/hit/apotis4stis5inread/host/false" apotis4stis5inread.brandsafetyuri = "https://thetamarketplace.com/brandsafety/dealID" apotis4stis5inread.dmp = false apotis4stis5inread.containerHeight = 0 apotis4stis5inread.method = "StickyOne" apotis4stis5inread.thisscript = document.currentScript apotis4stis5inread.unset_carousel_width = "false" apotis4stis5inread.unset_carousel_width = apotis4stis5inread.unset_carousel_width == "true" apotis4stis5inread.PREBID_TIMEOUT = 1500; apotis4stis5inread.FAILSAFE_TIMEOUT = 3000; apotis4stis5inread.mobileCheck = function() { let check = false; ((a) => { if ( /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( a.substr(0, 4) ) ) check = true })(navigator.userAgent || navigator.vendor || window.opera) return check } apotis4stis5inread.sindex = apotis4stis5inread.selectorIndex if(apotis4stis5inread.mobileCheck()) { apotis4stis5inread.sindex = apotis4stis5inread.selectorIndexMobile } apotis4stis5inread.ins = window.parent.document.querySelectorAll(apotis4stis5inread.selector) apotis4stis5inread.ins = apotis4stis5inread.ins.length === 1 || apotis4stis5inread.selector.includes('#') ? apotis4stis5inread.ins[0] : apotis4stis5inread.ins[apotis4stis5inread.sindex] if(apotis4stis5inread.ins.tagName == 'P') { apotis4stis5inread.n = window.parent.document.createElement('div') apotis4stis5inread.n.setAttribute('id', 'apotis4stis5inread_inread') apotis4stis5inread.ins.parentNode.insertBefore(apotis4stis5inread.n, apotis4stis5inread.ins.nextSibling); apotis4stis5inread.ins = apotis4stis5inread.n apotis4stis5inread.ins.setAttribute('data-margin', true) } else { let t = document.createElement('div') t.setAttribute('id', `apotis4stis5inread_inread`) apotis4stis5inread.ins.append(t) apotis4stis5inread.ins = t; // apotis4stis5inread.ins.setAttribute('id', 'apotis4stis5inread_inread') } apotis4stis5inread.ins.setAttribute('style', 'text-align:center;') let bidders = apotis4stis5inread.conf.bidders if(apotis4stis5inread.mobileCheck()) { bidders.push(apotis4stis5inread.carousel.mobile) } else { bidders.push(apotis4stis5inread.carousel.desktop) } apotis4stis5inread.adUnits = [ { code: 'apotis4stis5inread_inread', mediaTypes: { banner: { sizes: [ [ 300, 250 ], [ 300, 600 ], [ 570, 427 ] ] }, video: { api: [1,2,3,4,5,6], context: 'outstream', linearity: 2, mimes: ['video/mp4'], playerSize: [[640, 480]], protocols: [1, 2, 3, 4, 5, 6, 7, 8], skip: 1, renderer: { url: 'https://s2.adform.net/banners/scripts/video/outstream/render.js', render: function (bid) { let ad = bid.ad || bid.vastXml; if (ad) { bid.renderer.push(() => { window.parent.Adform.renderOutstream(bid, ad) apotis4stis5inread.prepare(); if(apotis4stis5inread.method == 'StickyOne') { apotis4stis5inread.onesticky(); } else { apotis4stis5inread.finalizeInterval = setInterval(() => { apotis4stis5inread.finalize() }, 300) } }); } else { if (bid.vastUrl) { (async () => { ad = await fetch(resp).then(resp => resp.text()); if (typeof ad === 'string') { bid.renderer.push(() => { window.parent.Adform.renderOutstream(bid, ad) apotis4stis5inread.prepare(); if(apotis4stis5inread.method == 'StickyOne') { apotis4stis5inread.onesticky(); } else { apotis4stis5inread.finalizeInterval = setInterval(() => { apotis4stis5inread.finalize() }, 300) } }); } else { console.log('Invalid VAST'); } })(); } else { console.log('Invalid ad'); } } } } } }, bids: apotis4stis5inread.conf.bidders, }]; window.parent.pbjs = window.parent.pbjs || {}; window.parent.pbjs.que = window.parent.pbjs.que || []; apotis4stis5inread.onesticky = () => { if (apotis4stis5inread.ins !== null) { window.parent.addEventListener('scroll', () => { apotis4stis5inread.scrolling = true }) apotis4stis5inread.scrollInterval = setInterval(() => { apotis4stis5inread.finalize() if (apotis4stis5inread.scrolling) { apotis4stis5inread.scrolling = false apotis4stis5inread.oneScroll() } }, 300) } } apotis4stis5inread.oneScroll = function() { apotis4stis5inread.iframe = apotis4stis5inread.iframe || apotis4stis5inread.ins.getElementsByTagName('iframe')[0] if(typeof apotis4stis5inread.iframe !== "undefined") { let { rect, b, c, m, w, iw, ih, mw, mh } = apotis4stis5inread.preparePositioning() if (c != 0) { if(apotis4stis5inread.containerHeight === 0) { apotis4stis5inread.containerHeight = apotis4stis5inread.ins.clientHeight } let style = `position: fixed; left: 50%; top: 50%; width: 1px !important; height: 1px !important;` apotis4stis5inread.ins.setAttribute('style', style) apotis4stis5inread.iframe.setAttribute('style', style) if (apotis4stis5inread.stickyElement) apotis4stis5inread.stickyElement.el.setAttribute('style', style) if (apotis4stis5inread.keepclose === true) { apotis4stis5inread.close.style.display = 'block' } apotis4stis5inread.buffer.setAttribute('style', `height:${ apotis4stis5inread.containerHeight }px; margin:${ apotis4stis5inread.margin } `) } else { apotis4stis5inread.originalPosition(m) } } } apotis4stis5inread.isElementInViewport = function(rect) { if (rect.top + rect.height / 2 < 0) { return -1 } if (rect.top + rect.height / 2 > (window.parent.innerHeight || window.parent.document.documentElement.clientHeight)) { return 1 } return 0 } apotis4stis5inread.preparePositioning = function() { let rect = { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 } rect = apotis4stis5inread.sibling.getBoundingClientRect() let w = apotis4stis5inread.containerWidth * apotis4stis5inread.factor let b = { height: rect.height, width: rect.width, top: rect.top + apotis4stis5inread.ins.clientHeight / 2 + apotis4stis5inread.sibling.clientHeight, left: rect.left } let c = apotis4stis5inread.isElementInViewport(b) let m = apotis4stis5inread.mobileCheck() let iw = 270 //apotis4stis5inread.factor * apotis4stis5inread.containerWidth let ih = 202 //apotis4stis5inread.factor * apotis4stis5inread.containerHeight let mw = apotis4stis5inread.mobilefactor * apotis4stis5inread.containerWidth let mh = apotis4stis5inread.mobilefactor * apotis4stis5inread.containerHeight return { rect, b, c, m, w, iw, ih, mw, mh } } apotis4stis5inread.mobilePositioning = function(w, h) { if (apotis4stis5inread.keepclose === true) { apotis4stis5inread.close.style.display = 'block' } let style = `position: fixed; bottom:` + apotis4stis5inread.bottomOffset + `px; left: 50%; transform: translate(-50%, 0); width: ${w}px !important; height: ${h}px !important; z-index: 20;` if (apotis4stis5inread.mobilePosition !== undefined && apotis4stis5inread.mobilePosition === 'top') { style = `position: fixed; top: 50px; left: 50%; transform: translate(-50%, 0); width: ${w}px !important; height: ${h}px !important; z-index: 20;` } apotis4stis5inread.ins.setAttribute('style', style) apotis4stis5inread.iframe.setAttribute('style', style) apotis4stis5inread.ins.setAttribute( 'style', `position: fixed; top: 10%; left: 50%; transform: translate(-50%, -10%); width: ${w}px !important; height: ${h}px !important; z-index: 20;` ) apotis4stis5inread.iframe.setAttribute( 'style', `position: fixed; top: 10%; left: 50%; transform: translate(-50%, -10%); width: ${w}px !important; height: ${h}px !important; z-index: 20;` ) apotis4stis5inread.adsby.style.top = '55px' apotis4stis5inread.close.style.top = '55px' apotis4stis5inread.controlbar.style.bottom = '45px' } apotis4stis5inread.originalPosition = function(m) { if (apotis4stis5inread.keepclose === false) { apotis4stis5inread.close.style.display = 'none' } if (apotis4stis5inread.stickyElement) apotis4stis5inread.stickyElement.el.setAttribute( 'style', `clear: both; position:relative;` ) if (m) { apotis4stis5inread.ins.setAttribute('style', `position: relative; margin:${ apotis4stis5inread.margin }`) apotis4stis5inread.iframe.setAttribute('style', `position: relative;`) } else { apotis4stis5inread.ins.setAttribute( 'style', `clear: both; position: relative; margin: ${ apotis4stis5inread.margin };` ) apotis4stis5inread.iframe.setAttribute( 'style', `clear: both; position: relative;` ) } apotis4stis5inread.buffer.setAttribute('style', `height: 0;`) } apotis4stis5inread.prepare = function() { apotis4stis5inread.sibling = document.createElement('div') apotis4stis5inread.sibling.setAttribute('id', 'thetasib') apotis4stis5inread.ins.parentNode.insertBefore(apotis4stis5inread.sibling, apotis4stis5inread.ins) apotis4stis5inread.buffer = document.createElement('div') apotis4stis5inread.buffer.setAttribute('id', 'thetabuffer') apotis4stis5inread.ins.parentNode.insertBefore(apotis4stis5inread.buffer, apotis4stis5inread.ins) } apotis4stis5inread.finalize = () => { apotis4stis5inread.iframe = apotis4stis5inread.ins.querySelectorAll('iframe')[0] if(typeof apotis4stis5inread.iframe !== "undefined" && apotis4stis5inread.iframe.contentWindow !== null && apotis4stis5inread.iframe.contentWindow.document.getElementById('thetaadsby') === null && apotis4stis5inread.iframe.contentWindow.document.getElementById('banner') !== null) { apotis4stis5inread.adsby = document.createElement('div') apotis4stis5inread.adsby.setAttribute('id', 'thetaadsby') apotis4stis5inread.adsby.setAttribute( 'style', 'display: block; \ position: absolute; \ z-index: 20; \ cursor: pointer; \ top: 7px; \ left: 5px; \ color: #fff; \ font-size: 11px; \ text-decoration: none; \ border-radius: 5px' ) let img = document.createElement('img') img.src = 'https://assets.thetamedia.gr/inread/ads-by-theta@2x.png' if (apotis4stis5inread.mobileCheck()) { img.setAttribute('width', '60') } else { img.setAttribute('width', '125') } apotis4stis5inread.adsby.appendChild(img) apotis4stis5inread.iframe.contentWindow.document.getElementById('banner').appendChild(apotis4stis5inread.adsby) apotis4stis5inread.player = apotis4stis5inread.iframe.contentWindow.document.getElementById('vast-wrapper') apotis4stis5inread.player.style.backgroundColor = 'transparent' img = document.createElement('img') img.src = 'https://assets.thetamedia.gr/inread/close-theta@2x.png' img.setAttribute('width', '16') apotis4stis5inread.close = apotis4stis5inread.iframe.contentWindow.document.getElementById('vast-skip') if (apotis4stis5inread.keepclose === false) { apotis4stis5inread.close.style.display = 'none' } // select control bar and play button. let e = apotis4stis5inread.iframe.contentWindow.document.querySelector('.vjs-progress-control') e = apotis4stis5inread.iframe.contentWindow.document.querySelector('.vjs-play-control') apotis4stis5inread.clearIntervals = window.parent.setInterval(function() { if(apotis4stis5inread.ins.childElementCount < 3) { apotis4stis5inread.ins.remove() window.parent.clearInterval(apotis4stis5inread.clearIntervals); window.parent.clearInterval(apotis4stis5inread.scrollInterval); window.parent.clearInterval(apotis4stis5inread.finalizeInterval); } }, 500); } } apotis4stis5inread.passback = function() { thetapbins = apotis4stis5inread.thisscript.parentElement if(thetapbins.parentElement.tagName === 'HTML') { thetapbins = thetapbins.parentElement.querySelector('body') } var script_tag = document.createElement('script') script_tag.src = apotis4stis5inread.passbackuri script_tag.async = true script_tag.defer = true apotis4stis5inread.ins.appendChild(script_tag) } apotis4stis5inread.pbjsconfig = { enableTIDs: true, currency: { adServerCurrency: 'EUR' }, ortb2: { site: { ext: { data: { hostname: location.hostname } }, publisher: { domain: location.hostname } } }, schain: { validation: "strict", config: { ver: "1.0", complete: 1, nodes: [ { asi: "thetamarketplace.com", sid: apotis4stis5inread.sellerId, hp:1 } ] } }, userSync: { iframeEnabled: true, filterSettings: { iframe: { bidders: '*', filter: 'include', }, }, userIds: [], auctionDelay: 1000, syncDelay: 3000, syncEnabled: true } } apotis4stis5inread.initAdserver = function() { if (apotis4stis5inread.initAdserverSet) return; apotis4stis5inread.initAdserverSet = true; let adServerTargeting = window.parent.pbjs.getAdserverTargetingForAdUnitCode('apotis4stis5inread_inread'); if (adServerTargeting && adServerTargeting['hb_adid']) { const text = window.parent.document.body.innerText var formdata = new FormData(); formdata.append('t', text) var requestOptions = { method: 'POST', body: formdata, redirect: 'follow' }; fetch(apotis4stis5inread.brandsafetyuri.replace("dealID", adServerTargeting["hb_deal"]), requestOptions) .then((response) => { return response.json() }) .then((data) => { if(data.res === false) { if(apotis4stis5inread.ins.hasAttribute('data-margin') === true) { apotis4stis5inread.ins.style.margin = apotis4stis5inread.margin } if(adServerTargeting["hb_format"] === 'banner') { var iframe = document.createElement('iframe'); iframe.setAttribute('id', 'thetacarousel') iframe.setAttribute('frameBorder', '0') if(apotis4stis5inread.unset_carousel_width == true){ iframe.setAttribute('style', 'width:unset !important;') } apotis4stis5inread.ins.appendChild(iframe) var iframeDoc = iframe.contentWindow.document; window.parent.pbjs.renderAd(iframeDoc, adServerTargeting['hb_adid']); } else { window.parent.pbjs.renderAd(apotis4stis5inread.ins, adServerTargeting['hb_adid']); } } else { apotis4stis5inread.passback() } }) .catch((error) => console.error(error)); } else { apotis4stis5inread.passback() } } if(location.hostname === 'localhost' || location.hostname === '127.0.0.1') { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { apotis4stis5inread.passback() } else { window.parent.pbjs.que.push(function() { window.parent.pbjs.addAdUnits(apotis4stis5inread.adUnits); window.parent.pbjs.setConfig(apotis4stis5inread.pbjsconfig) window.parent.pbjs.requestBids({ timeout: apotis4stis5inread.PREBID_TIMEOUT, bidsBackHandler: apotis4stis5inread.initAdserver }); }); } } else { fetch(apotis4stis5inread.hituri.replace('/host', '/' + window.location.host), { method: 'GET', }) apotis4stis5inread.pbjsconfig.consentManagement = { gdpr: { cmpApi: 'iab', timeout: 1000, actionTimeout: 10000, defaultGdprScope: true } } window.parent.__tcfapi('addEventListener', 2, function (tcData, success) { if (success) { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { apotis4stis5inread.passback() return } if (tcData.eventStatus == 'useractioncomplete' || tcData.eventStatus == 'tcloaded') { if(tcData.purpose.consents[1] && tcData.purpose.consents[3] && tcData.purpose.consents[5] && tcData.purpose.consents[7] && tcData.purpose.consents[8] && tcData.purpose.consents[9] && tcData.purpose.consents[10]) { if (tcData.vendor.consents[131]) { apotis4stis5inread.pbjsconfig.userSync.userIds.push({ name: "id5Id", params: { partner: 1653, externalModuleUrl: 'https://cdn.id5-sync.com/api/1.0/id5PrebidModule.js', }, storage: { type: "html5", name: "id5id", expires: 90, refreshInSeconds: 8 * 3600 } }) } if (tcData.vendor.consents[95]) { apotis4stis5inread.pbjsconfig.userSync.userIds.push({ name: "lotamePanoramaId", params: { clientId: 17773 } }) } apotis4stis5inread.pbjsconfig.userSync.userIds.push({ name: "sharedId", storage: { name: "_sharedID", type: "html5", expires: 30 } }) apotis4stis5inread.pbjsconfig.userSync.userIds.push({ name: "criteo" }) } window.parent.pbjs.que.push(function() { window.parent.pbjs.addAdUnits(apotis4stis5inread.adUnits); window.parent.pbjs.setConfig(apotis4stis5inread.pbjsconfig) window.parent.pbjs.requestBids({ timeout: apotis4stis5inread.PREBID_TIMEOUT, bidsBackHandler: apotis4stis5inread.initAdserver }); }); setTimeout(function() { apotis4stis5inread.initAdserver(); }, apotis4stis5inread.FAILSAFE_TIMEOUT); if(apotis4stis5inread.dmp === true) { const stringToUuid = (str) => { str = str.replace('-', ''); return 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c, p) { return str[p % str.length]; }); } navigator.mediaDevices .enumerateDevices() .then((devices) => { const uuid = JSON.parse(decodeURIComponent(localStorage.id5id)).universal_uid const source = window.location.host const atype = 1 const text = window.parent.document.body.innerText var formdata = new FormData(); formdata.append('t', text) var requestOptions = { method: 'POST', body: formdata, redirect: 'follow' }; fetch('https://contextual.thetamarketplace.com/', requestOptions) .then(response => response.json()) .then(data => { const key = data.key let ns = document.createElement('noscript') let img = document.createElement('img') img.src = `//dmp.adform.net/dmp/profile/?pid=12269&sg=${key}&eid_${source}_${atype}=${uuid}` img.setAttribute('style', 'display:none !important') ns.appendChild(img) apotis4stis5inread._theta_head.appendChild(ns) }) }) .catch((err) => { console.log(`${err.name}: ${err.message}`); }); } } } }); }