[\\s\\S]*?","gi");do t=e,e=e.replace(r,"");while(e!==t);return e.replace(/=1424&&1535>=e||e>=1536&&1791>=e||e>=1792&&1871>=e||e>=1872&&1919>=e||e>=2144&&2159>=e||e>=2208&&2303>=e||e>=64288&&64335>=e||e>=64336&&65023>=e||e>=65136&&65279>=e||8207===e||8235===e||8238===e)?!0:!1}function isLTRChar(e){return e=String(e).charCodeAt(0),e&&(e>=65&&90>=e||e>=97&&122>=e||e>=192&&214>=e||e>=216&&246>=e||e>=248&&696>=e||e>=768&&1424>=e||e>=2048&&8191>=e||e>=11264&&64284>=e||e>=65022&&65135>=e||e>=65277&&65535>=e||8206===e||8234===e||8237===e)?!0:!1}function guessWritingDirection(e){for(var t=25,n=Math.min(t,e.length),r=0;n>r;r++){var o=e.charAt(r);if(isLTRChar(o))return"ltr";if(isRTLChar(o))return"rtl"}return null}function randInt(){return(Math.random()+"").slice(2)}function _isListenerOptionSupported(e){var t=_isListenerOptionSupported.opts;if("undefined"==typeof t[e]){t[e]=!1;try{window.addEventListener("listener-test",null,Object.defineProperty({},e,{get:function(){t[e]=!0}}))}catch(n){}}return t[e]}function _buildNativeListenerOptions(e){if("object"!=typeof e)return!!e;if(!_isListenerOptionSupported("capture"))return!!e.capture;var t={capture:!!e.capture};return _isListenerOptionSupported("passive")&&(t.passive=!!e.passive),t}function _analyzeTouch(e){var t,n=Math.abs(e.firstTouch.x-e.lastTouch.x),r=Math.abs(e.firstTouch.y-e.lastTouch.y);return"y"===e.validAxis?t=r>e.minDistanceForSwipe:"x"===e.validAxis&&(t=n>e.minDistanceForSwipe),{isHorizontal:n>r,isConsideredSwipe:t}}function attach(e,t,n,r){var o=getEventNames()[t.toLowerCase()]||t;e.addEventListener(o,n,_buildNativeListenerOptions(r))}function detach(e,t,n,r){var o=getEventNames()[t.toLowerCase()]||t;e.removeEventListener(o,n,_buildNativeListenerOptions(r))}function once(e,t,n,r){attach(e,t,function o(){detach(e,t,o,r),n.apply(this,arguments)},r)}function trigger(e,t,n,r){var o=document.createEvent("HTMLEvents");o.initEvent(t,n,r);var i="on"+ucfirst(t);return"function"==typeof e[i]&&e[i](),e.dispatchEvent(o)}function fakeclick(e,t){t=t||window;var n=t.document.createElement("a");n.cssText="visibility: hidden",n.addEventListener("click",function(t){e(),t.preventDefault(),t.stopPropagation(),n.parentNode.removeChild(n)},!0),t.document.body.appendChild(n);var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),n.dispatchEvent(r)}function fakeClickAhrefBlank(e,t,n){t=t||noop,n=n||window;var r=n.document.createElement("a");r.style.cssText="visibility: hidden",r.setAttribute("href",e),r.setAttribute("target","_blank"),r.addEventListener("click",function(e){e.stopPropagation(),t(),r.parentNode.removeChild(r)},!0),n.document.body.appendChild(r);var o=n.document.createEvent("MouseEvents");o.initEvent("click",!0,!0),r.dispatchEvent(o)}function noop(){}function nullai(e,t){t&&t()}function retTrue(){return!0}function retFalse(){return!1}function offset(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+(o.pageYOffset||r.scrollTop)-(r.clientTop||0),left:t.left+(o.pageXOffset||r.scrollLeft)-(r.clientLeft||0)}}function addCssRule(e,t,n){var r=document.createElement("style");r.textContent=e+" {"+t+"}",n?n.document.getElementsByTagName("head")[0].appendChild(r):document.getElementsByTagName("head")[0].appendChild(r)}function redrawAndroidIframe(){var e=document.createElement("style");document.body.appendChild(e),document.body.removeChild(e)}function parseQuery(e){var t={};return e=e.replace(/\&$/,"").replace(/\+/g,"%20"),e.split("&").forEach(function(e){var n=e.split("=").map(decodeURIComponent);t[n[0]]=n[1]}),t}function buildQuery(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function postBlob(e,t){var n=new XMLHttpRequest;n.open("POST",creative.apiUrl+"blobs?base64=1"),n.setRequestHeader("Content-Type","application/octet-stream"),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText,n.status)},n.send(e)}function tmpl(e,t){function n(e){return" p.push('"+e.replace(/'/g,"\\'").split(/\r?\n/g).join("\\n');\n p.push('")+"');\n"}if(!e)return"";var r;if(-1==e.indexOf("<%"))r=function(){return e};else{var o=e.split(/<%\s*|\s*%>/g),i="var p = []; with(o) {\n",a=!1;o.forEach(function(e){a?i+="="==e[0]?" p.push("+e.replace(/^=\s*|\s*$/g,"")+");\n":" "+e+"\n":e&&(i+=n(e)),a=!a}),i+='} return p.join("");';try{r=new Function("o",i)}catch(c){var u=new Error("Cannot parse template! (see `template` property)");throw u.template=i,u}}return t?r(t):r}function flash(){var e=document.createElement("div");e.style.background="white",e.style.opacity=.005,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.width="100%",e.style.height="100%",e.style.zIndex=2147483647,document.body.appendChild(e),setTimeout(function(){e.parentNode.removeChild(e)},0)}function crc32(e){"use strict";var t=-1,n=0,r=[0,-227835133,-516198153,324072436,-946170081,904991772,648144872,-724933397,-1965467441,2024987596,1809983544,-1719030981,1296289744,-1087877933,-1401372889,1578318884,274646895,-499825556,-244992104,51262619,-675000208,632279923,922689671,-996891772,-1702387808,1760304291,2075979607,-1982370732,1562183871,-1351185476,-1138329528,1313733451,549293790,-757723683,-1048117719,871202090,-416867903,357341890,102525238,-193467851,-1436232175,1477399826,1264559846,-1187764763,1845379342,-1617575411,-1933233671,2125378298,820201905,-1031222606,-774358714,598981189,-143008082,85089709,373468761,-467063462,-1170599554,1213305469,1526817161,-1452612982,2107672161,-1882520222,-1667500394,1861252501,1098587580,-1290756417,-1606390453,1378610760,-2032039261,1955203488,1742404180,-1783531177,-878557837,969524848,714683780,-655182201,205050476,-28094097,-318528869,526918040,1361435347,-1555146288,-1340167644,1114974503,-1765847604,1691668175,2005155131,-2047885768,-604208612,697762079,986182379,-928222744,476452099,-301099520,-44210700,255256311,1640403810,-1817374623,-2130844779,1922457750,-1503918979,1412925310,1197962378,-1257441399,-350237779,427051182,170179418,-129025959,746937522,-554770511,-843174843,1070968646,1905808397,-2081171698,-1868356358,1657317369,-1241332974,1147748369,1463399397,-1521340186,-79622974,153784257,444234805,-401473738,1021025245,-827320098,-572462294,797665321,-2097792136,1889384571,1674398607,-1851340660,1164749927,-1224265884,-1537745776,1446797203,137323447,-96149324,-384560320,461344835,-810158936,1037989803,781091935,-588970148,-1834419177,1623424788,1939049696,-2114449437,1429367560,-1487280117,-1274471425,1180866812,410100952,-367384613,-112536529,186734380,-538233913,763408580,1053836080,-860110797,-1572096602,1344288421,1131464017,-1323612590,1708204729,-1749376582,-2065018290,1988219213,680717673,-621187478,-911630946,1002577565,-284657034,493091189,238226049,-61306494,-1307217207,1082061258,1395524158,-1589280451,1972364758,-2015074603,-1800104671,1725896226,952904198,-894981883,-638100751,731699698,-11092711,222117402,510512622,-335130899,-1014159676,837199303,582374963,-790768336,68661723,-159632680,-450051796,390545967,1230274059,-1153434360,-1469116676,1510247935,-1899042540,2091215383,1878366691,-1650582816,-741088853,565732008,854102364,-1065151905,340358836,-433916489,-177076669,119113024,1493875044,-1419691417,-1204696685,1247431312,-1634718085,1828433272,2141937292,-1916740209,-483350502,291187481,34330861,-262120466,615137029,-691946490,-980332558,939183345,1776939221,-1685949482,-1999470558,2058945313,-1368168502,1545135305,1330124605,-1121741762,-210866315,17165430,307568514,-532767615,888469610,-962626711,-707819363,665062302,2042050490,-1948470087,-1735637171,1793573966,-1104306011,1279665062,1595330642,-1384295599];for(n=0;n>>8^r[255&(t^e.charCodeAt(n))];return(-1^t)>>>0}function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}function isDefAndNotNull(e){return null!=e}function updateQueryStringParameter(e,t,n){t=encodeURIComponent(t),n=encodeURIComponent(n);var r=new RegExp("([?|&])"+t+"=.*?(&|$)","i");return separator=-1!==e.indexOf("?")?"&":"?",e.match(r)?e.replace(r,"$1"+t+"="+n+"$2"):e+separator+t+"="+n}function fetchShortenedUrl(e,t,n){function r(t,n){i[e].forEach(function(e){e[t](n)}),delete i[e]}n=n||noop;var o=!1,i=fetchShortenedUrl.inProgress,a=fetchShortenedUrl.cache;if("http"==!e.slice(0,4))return void n();if(a[e])return void defer(function(){t(a[e])},0,"fetchShortenedUrl defer success callback");if(i[e]||(i[e]=[],o=!0),i[e].push({success:t,error:n}),o){var c=(creative.runtimeParams.secure?creative.cachedApiUrl:creative.insecureCachedApiUrl)+"shortenedUrls/",u={url:e,fields:"shortUrlKey"},s=btoa(to_utf8(e));s=s.replace(/\//g,"$").replace(/\+/g,"_").replace(/=/g,"");var d={cbName:"shortener_"+s};loadJSONP(c+"?"+buildQuery(u),d,function(t){var n=creative.shareUrl+t.shortUrlKey;a[e]=n,r("success",n)},function(){requestCreateShortenedUrl(e,r)})}}function requestCreateShortenedUrl(e,t){var n=(creative.runtimeParams.secure?creative.apiUrl:creative.insecureApiUrl)+"shortenedUrls/",r=fetchShortenedUrl.cache,o=new XMLHttpRequest;o.open("POST",n),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(4===o.readyState)if(201===o.status){var n=JSON.parse(o.responseText),i=creative.shareUrl+n.shortUrlKey;r[e]=i,t("success",i)}else t("error")},o.send(JSON.stringify({url:e}))}function isMediaPlaying(e){try{return e.currentTime>0&&!e.paused&&!e.ended}catch(t){return!1}}function merge(){var e,t,n={};for(t=0;tt?0:1}function pulse(e,t,n){return step(e,n)-step(t,n)}function smoothstep(e,t,n){var r=clamp(0,1,(n-e)/(t-e));return r*r*r*((6*r-15)*r+10)}function bump(e,t,n){var r=clamp(0,1,(n-e)/(t-e));return(Math.cos(Math.PI*r)+1)/2}function getWindowNesting(e){var t={iframe:e!==e.top,friendlyIframe:!1,iabFriendlyIframe:!1,hostileIframe:!1,iframeDepth:0};if(t.iframe){var n=e;try{for(t.friendlyIframe=!!e.top.location.href,t.iabFriendlyIframe=t.friendlyIframe&&"undefined"!=typeof e.inDapIF&&e.inDapIF;"undefined"!=typeof n.parent.location.href&&n.parent.document!==n.document;)n=n.parent,t.iframeDepth++;"undefined"==typeof e.top.document&&(t.hostileIframe=!0)}catch(r){t.hostileIframe=!0}}return t}function isFetchSupported(){return!!(window.fetch&&window.URL&&URL.createObjectURL)}function isBeaconSupported(){return!(!window.navigator||!window.navigator.sendBeacon)}function isNativeImplementation(e){return"function"==typeof e&&e.toString().indexOf("[native code]")>-1}!function(e){if(!this.defer){try{for(;"undefined"!=typeof e.parent.location.href&&e.parent.document!==e.document;)e=e.parent}catch(t){}var n=function(){function t(){return 9007199254740991===s?0:++s}var n,r,o,i,a=e,c="function"==typeof a.setImmediate;if(a.MutationObserver)return function(e){n=document.createElement("div"),new MutationObserver(function(){e(),n=null}).observe(n,{attributes:!0}),n.setAttribute("i","1")};if(!c&&a.postMessage&&!a.importScripts&&a.addEventListener){var u="com.setImmediate"+Math.random(),s=0;i={};var d=function(e){if(e.source===a&&0===e.data.indexOf(u)){var t=e.data.split(":")[1];i[t](),delete i[t]}};return a.addEventListener("message",d,!1),function(e){var n=t();i[n]=e,a.postMessage(u+":"+n,"*")}}return!c&&a.document&&"onreadystatechange"in document.createElement("script")?function(e){r=document.createElement("script"),r.onreadystatechange=function(){r.onreadystatechange=null,r.parentNode.removeChild(r),r=null,e()},document.body.appendChild(r)}:(o=c&&setImmediate||setTimeout,function(e){o(e)})}();this.defer=function(t,r,o,i){var a,c=0|r;if(o){var u;"undefined"!=typeof defer.perf?u=defer.perf:"undefined"!=typeof creative?u=creative.perf:"undefined"!=typeof perf&&(u=perf),u&&(u._stopTrackingDefers||(a=u.start("defer",{deferId:o,delay:c})))}if(t){var s=function(){a&&a.end(),t()};i?n(s):e.setTimeout(s,c)}}}}(window),Function.prototype.bind||Object.defineProperty(Function.prototype,"bind",{value:function(e){var t=this;return function(){return t.apply(e,arguments)}}}),function(e){e.getEventNames=function(){var t={};return"WebKitAnimationEvent"in e&&(t.animationstart="webkitAnimationStart",t.animationiteration="webkitAnimationIteration",t.animationend="webkitAnimationEnd"),"WebKitTransitionEvent"in e&&(t.transitionend="webkitTransitionEnd"),t}}(window),_isListenerOptionSupported.opts={};var getTimestamp=function(){return void 0===window.performance||void 0===window.performance.now?Date.now:window.performance.now.bind(window.performance)}();Date.now||(Date.now=function(){return+new Date}),Array.prototype.waitForEach||Object.defineProperty(Array.prototype,"waitForEach",{value:function(e,t,n){var r=this.length;r?this.forEach(function(o,i,a){var c=!1;e.call(n,o,function(){if(c)throw"Called `done` multiple times for element "+i;c=!0,--r||t()},i,a)},n):t()}}),function(e){e.loadJS=function(t,n,r,o){var i=e.loadJS.externals,a={success:n||noop,error:r||noop};if(!/^[A-Za-z0-9]*:\/\/|^\/\//.test(t)){var c=creative.hostedFiles.filter(function(e){return e.filepath===t})[0];if("undefined"==typeof c)return console.warn('Hosted file "'+t+'" was not found.'),void a.error();if(c.loaded!==!1)return console.warn('Hosted file "'+t+'" is already loaded.'),void setTimeout(a.success,0);c.loaded=!0,t=creative.cachedApiUrl+"hostedFiles/"+creative.id+"/"+creative.version+"/"+t}if(t in i&&!o)i[t].loaded?setTimeout(a.success,0):i[t].cbs.push(a);else{i[t]={cbs:[a]};var u=document.createElement("script");u.type="text/javascript",u.onload=function(){i[t].loaded=!0,i[t].cbs.forEach(function(e){e.success()}),i[t].cbs=[]},u.onerror=function(){i[t].cbs.forEach(function(e){e.error()}),i[t].cbs=[],delete i[t]},u.src=t,e.loadJS.appendToRoot(u)}},e.loadJS.externals={},e.loadJS.appendToRoot=function(e){return document.querySelector("head").appendChild(e)},e.loadJSONP=function(t,n,r,o){"function"==typeof n&&(o=r,r=n,n={});var i=n.cbName||"__jsonp"+randInt();t+=(-1==t.indexOf("?")?"?":"&")+(n.paramName||"jsonp")+"="+i,e[i]=function(t){r(t),delete e[i]},loadJS(t,noop,o,!0)}}(window),"undefined"==typeof Function.prototype.name&&!function(){var e=/^function\s+(\w+?)\s*?\(/;Object.defineProperty(Function.prototype,"name",{get:function(){var t=this.constructor.prototype.toString.call(this);return e.test(t)?t.match(e)[1]:""}})}(),fetchShortenedUrl.cache={},fetchShortenedUrl.inProgress={};;
function CTickerQueue(){this._queue=[],this._i=this.length}Object.defineProperty(CTickerQueue.prototype,"length",{get:function(){return this._queue.length}}),CTickerQueue.filterNulls=function(e){return null!==e},CTickerQueue.prototype._removeNulls=function(){this._queue=this._queue.filter(CTickerQueue.filterNulls)},CTickerQueue.prototype.process=function(e){if(this.length){for(this._i=0;this._i-1})}}),CTicker.prototype.stop=function(){try{this._queues.update.empty(),this._queues.render.empty()}finally{this.raf.cancelFrame(this._tick)}},CTicker.prototype._tick=function(e){try{this._queues.update.process(e),this._queues.nextUpdate.process(e),this._queues.render.process(e),this._queues.nextRender.process(e),this._queues.next.process(e),this._queues.next.empty(),this._queues.nextRender.empty(),this._queues.nextUpdate.empty()}finally{this.raf.nextFrame(this._tick)}},CTicker.prototype.frame=function(e,t){t=t||"render",this._queues[t].add(e)},CTicker.prototype.removeFrame=function(e,t){t=t||"render",this._queues[t].remove(e)};;
function RequestAnimationFrameWrapper(e){this._lastTime=0,this._win=e,this._createRAFWrapper=this._createRAFWrapper.bind(this),this._createCAFWrapper=this._createCAFWrapper.bind(this);var t=this._extractFromWindow(this._win),r=this._createPolyfill();this.environment=this._wrapRafAndCaf(t),this.polyfill=this._wrapRafAndCaf(r),this.isNative=!!t&&this._isNative(t.nextFrame)}Object.defineProperty(RequestAnimationFrameWrapper.prototype,"isRequestAnimationFrameBroken",{get:function(){var e=getWindowNesting(this._win);return deviceInfo.browser.firefox()&&e.hostileIframe?!0:!1}}),RequestAnimationFrameWrapper.prototype._extractFromWindow=function(e){var t=e.requestAnimationFrame||null,r=e.cancelAnimationFrame||null;return["ms","moz","webkit","o"].forEach(function(n){t=t||e[n+"RequestAnimationFrame"]||null,r=r||e[n+"CancelAnimationFrame"]||e[n+"CancelRequestAnimationFrame"]||null}),{nextFrame:t,cancelFrame:r}},RequestAnimationFrameWrapper.prototype._createPolyfill=function(){var e=this,t=function(t){var r=getTimestamp(),n=Math.max(0,16-(r-e._lastTime)),i=e._win.setTimeout(function(){t(r+n)},n);return e._lastTime=r+n,i},r=function(t){e._win.clearTimeout(t)};return{nextFrame:t,cancelFrame:r}},RequestAnimationFrameWrapper.prototype._isNative=function(e){return!!(e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1)},RequestAnimationFrameWrapper.prototype._wrapRafAndCaf=function(e){return e&&e.nextFrame&&e.cancelFrame?{nextFrame:this._createRAFWrapper(e.nextFrame),cancelFrame:this._createCAFWrapper(e.cancelFrame)}:null},RequestAnimationFrameWrapper.prototype._createRAFWrapper=function(e){return function(t){return e.call(this._win,t)}.bind(this)},RequestAnimationFrameWrapper.prototype._createCAFWrapper=function(e){return function(t){e.call(this._win,t)}.bind(this)};;
function CPoint(t,i){this.x=1*t||0,this.y=1*i||0}function CRect(t,i,e,o){this.left=1*t||0,this.top=1*i||0,this.width=1*e||0,this.height=1*o||0}CPoint.offset=function(t){var i=offset(t);return new CPoint(i.left,i.top)},CPoint.convertPointFromNodeToPage=function(t,i){if(!t||"undefined"!=typeof t.x)return null;var e=CPoint.offset(t);return new CPoint((i?i.x:0)+(e?e.x:0),(i?i.y:0)+(e?e.y:0))},CPoint.convertPointFromPageToNode=function(t,i){if(!t||"undefined"!=typeof t.x)return null;var e=CPoint.offset(t);return new CPoint((i?i.x:0)-(e?e.x:0),(i?i.y:0)-(e?e.y:0))},CPoint.sample=function(t,i,e){for(var o=Math.floor(Math.sqrt(t.width*i/t.height)),n=Math.floor(Math.sqrt(t.height*i/t.width)),h=t.width/o,r=t.height/n,s=0;n>s;s++)for(var f=0;o>f;f++)e((f+.5)*h+t.left,(s+.5)*r+t.top)},CPoint.epsilon=function(t,i,e){return Math.abs(t-i)h||0>r?CRect.ZERO:new CRect(i,e,h,r)},CRect.prototype.copyFrom=function(t){this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height},CRect.prototype.relativeTo=function(t){return new CRect(this.left-t.left,this.top-t.top,this.width,this.height)},CRect.prototype.contains=function(t){return t instanceof CPoint?t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom:t instanceof CRect?t.left>=this.left&&t.right<=this.right&&t.top>=this.top&&t.bottom<=this.bottom:void 0},CRect.prototype.map=function(t,i){var e=i.width/t.width,o=i.height/t.height;return new CRect((this.left-t.left)*e+i.left,(this.top-t.top)*o+i.top,this.width*e,this.height*o)},CRect.prototype.equals=function(t){return t&&this.left==t.left&&this.top==t.top&&this.right==t.right&&this.bottom==t.bottom},CRect.prototype.toString=function(){return"CRect: "+JSON.stringify(this)};;
window.CeltraDeviceInfo={},function(e){function n(e,n){this.os=new t(e.osName,e.osVersion),this.browser=new r(e.browserName,e.browserVersion,n),this.engine=new i(e.browserRenderingEngine,e.browserRenderingEngineVersion),this.deviceType=new o(e.deviceType,e.mobileDevice),this.vendor=e.vendor||"",this.model=e.model||"",this.userAgent=n}function t(e,n){this.name=e||"",this.version=n||"0"}function r(e,n,t){this.name=e||"",this.version=n||"0",this.userAgent=t}function i(e,n){this.name=e||"",this.version=n||"0"}function o(e,n){this.hardwareType=e||"",this.mobile=n||""}function s(e,n){function t(e){return parseInt(e.replace(/\D/g,""),10)}function r(e,n){var t;for(t=0;tn[t])return 1}return 0}var i,o,s;if(!e)return!0;if(0===n.length)o=null,s=null;else if(1===n.length)o=n[0],s=n[0];else{if(2!==n.length)throw"Invalid number of arguments";o=n[0],s=n[1]}for(e=e.split(".").map(t),o=o?o.split(".").map(t):[],s=s?s.split(".").map(t):[],i=Math.max(o.length,s.length)-e.length;i>=0;i--)e.push(0);return!(-1===r(e,o)||1===r(e,s))}function a(e,n){if(-1===e.indexOf("Playstation")){var t=e.match(/\bSilk\/([0-9._-]+)\b/);t&&(n.browserName="Amazon Silk",n.browserVersion=t[1])}n.browserName&&n.browserVersion&&(0===n.browserName.indexOf("Chrome")&&s(n.browserVersion,["28",null])||0===n.browserName.indexOf("Opera")&&s(n.browserVersion,["15",null]))&&(n.browserRenderingEngine="Blink"),n.browserRenderingEngineVersion||(n.browserRenderingEngineVersion=function(){var n;return(n=e.match(/Trident\/([0-9.]+)/))?n[1]:(n=e.match(/Presto\/([0-9.]+)/))?n[1]:(n=e.match(/AppleWebKit\/*([0-9.]+)/i))?n[1]:(n=e.match(/Gecko\/*([0-9.]+)/),n?n[1]:"")}())}t.prototype.android=function(){return"Android"===this.name&&s(this.version,arguments)},t.prototype.osx=function(){return"OSX"===this.name&&s(this.version,arguments)},t.prototype.ios=function(){return"IOS"===this.name&&s(this.version,arguments)},t.prototype.windows=function(){return"Windows"===this.name&&s(this.version,arguments)},t.prototype.windowsPhone=function(){return"WindowsPhone"===this.name&&s(this.version,arguments)},t.prototype.linux=function(){return"Linux"===this.name},r.prototype.safari=function(){return"Safari"===this.name&&s(this.version,arguments)},r.prototype.chrome=function(){return 0===this.name.indexOf("Chrom")&&s(this.version,arguments)},r.prototype.ie=function(){return 0===this.name.indexOf("Internet Explorer")&&s(this.version,arguments)},r.prototype.android=function(){return"Android Browser"===this.name&&s(this.version,arguments)},r.prototype.samsung=function(){return"Samsung Browser"===this.name&&s(this.version,arguments)},r.prototype.opera=function(){return 0===this.name.indexOf("Opera")&&s(this.version,arguments)},r.prototype.silk=function(){return"Amazon Silk"===this.name&&s(this.version,arguments)},r.prototype.firefox=function(){return"Firefox"===this.name&&s(this.version,arguments)},r.prototype.edge=function(){return"Edge"===this.name&&s(this.version,arguments)},r.prototype.webView=function(){var n=null,t="iP"===(e.navigator.platform||"").substr(0,2);if(t){var r=this.userAgent,i=-1!==r.indexOf("Safari")&&-1!==r.indexOf("Version"),o=!/constructor/i.test(e.HTMLElement);i&&!e.navigator.standalone?n="iOS Safari or Safari Controller":(o||e.indexedDB)&&e.statusbar.visible?(e.webkit&&e.webkit.messageHandlers||o||e.indexedDB)&&(n="WKWebView"):n="UIWebView"}else/^.*\/\d\.\d \(.*wv\).*/.test(this.userAgent)&&(n="AndroidWebView");return n},r.prototype.facebookApp=function(){var e=this.userAgent;return e.indexOf("FBAN")>-1||e.indexOf("FBAV")>-1},i.prototype.webkit=function(){return"WebKit"===this.name&&s(this.version,arguments)},i.prototype.gecko=function(){return"Gecko"===this.name&&s(this.version,arguments)},i.prototype.trident=function(){return"Trident"===this.name&&s(this.version,arguments)},i.prototype.presto=function(){return"Presto"===this.name&&s(this.version,arguments)},i.prototype.blink=function(){return"Blink"===this.name&&s(this.version,arguments)},o.prototype.phone=function(){return"Phone"===this.hardwareType},o.prototype.tablet=function(){return"Tablet"===this.hardwareType},o.prototype.desktop=function(){return"Desktop"===this.hardwareType},o.prototype.mobileDevice=function(){return this.mobile===!0},e.CeltraDeviceInfo.create=function(t,r){return t=t||e.navigator.userAgent||"",r=r||{},a(t,r),new n(r,t)}}(window);;
window.deviceInfo=CeltraDeviceInfo.create(window.navigator.userAgent,window.celtraDeviceInfoRuntimeParams);;
!function(e){function n(){var e=p().match(/iP(ad|hone|od).*OS ([0-9_]+)/);return!!e&&s(e[2].replace(/_/g,"."),arguments)}function t(){var e=p().match(/Android ([0-9.]+)/),n=p().match(/Windows Phone/);return!n&&!!e&&s(e[1],arguments)}function r(){var e=p().match(/Windows Phone ([0-9.]+)/);return!!e&&s(e[1],arguments)}function i(){var e=p().match(/AppleWebKit\/*([0-9.]+)/i);return!!e&&s(e[1],arguments)}function a(){var e=p().match(/Gecko\/*([0-9.]+)/i);return!!e&&s(e[1],arguments)}function o(){var e=p().match(/MSIE ([0-9]{1,}[.0-9]{0,})|Trident.* rv:([0-9]{1,}[.0-9]{0,})/i);return!!e&&s(e[1]||e[2],arguments)}function u(){var e=p().match(/Silk\/([0-9.]+)/);return!!e&&s(e[1],arguments)}function f(){var e=p().toLowerCase();return/kftt|kfot|kfjwi|kfjwa|kfso|kfth|kfapwi|kfthwi|kfsowi|kfthwa|kfapwa|kfap|sd4930ur/.test(e)?s("2",arguments):!1}function d(){return"undefined"!=typeof offsetWidthOverride?offsetWidthOverride:(document.body.offsetWidth,Math.min(innerWidth,innerHeight))}function c(){return/iPad/.test(p())||d()>550}function m(){return!(t()||n()||r())}function s(e,n){function t(e){return parseInt(e.replace(/\D/g,""),10)}function r(e,n){for(var t=0;tn[t])return 1}return 0}var i,a,o;if(!e)return!0;if(0===n.length)a=null,o=null;else if(1===n.length)a=n[0],o=n[0];else{if(2!==n.length)throw"Invalid number of arguments";a=n[0],o=n[1]}e=e.split(".").map(t),a=a?a.split(".").map(t):[],o=o?o.split(".").map(t):[];for(var i=v.max(a.length,o.length)-e.length;i>=0;i--)e.push(0);return!(-1===r(e,a)||1===r(e,o))}function h(){return v.top!==e}function l(){if(!(n()||window.chrome&&"Google Inc."===window.navigator.vendor))return!1;var e;return e=p().match(n()?/CriOS\/([0-9]+.)/:/Chrome\/([0-9]+.)/),!!e&&s(e[1],arguments)}function g(){var e="(-webkit-min-device-pixel-ratio: 1.5),(min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),(min-resolution: 1.5dppx)";return window.devicePixelRatio>1||window.matchMedia&&window.matchMedia(e).matches}e.celtra=e.celtra||{};var w={};w.ios=n,w.android=t,w.webkit=i,w.windowsPhone=r,w.gecko=a,w.windows=o,w.kindleSilk=u,w.kindle=f,w.iframe=h,w.desktop=m,w.tablet=c,w.chromeBased=l,w.isHighDensityDisplay=g,extend(e.celtra,w),delete w.webkit,extend(e,w);var v={max:e.Math.max,min:e.Math.min,userAgent:e.navigator.userAgent,top:e.top},p=function(){return"undefined"!=typeof e.userAgentOverride?e.userAgentOverride:v.userAgent}}(window);;
!function(e){function t(){var t=e;try{for(;"undefined"!=typeof t.parent.location.href&&t.parent.document!==t.document;)t=t.parent}catch(n){}return t}function n(){return s.getComputedStyle(s.document.body,null)}function i(e,t,n){if(!e)throw new Error("No element specified!");if(a(t)){if(!(t in e.style)&&i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+t);if("undefined"==typeof n)return e.style[t];e.style[t]=n}else{if(-1==w.indexOf(t)&&o(t),"undefined"==typeof n)return e.style[y[t]];e.style[y[t]]=n}}function r(e,t){if(!e)throw new Error("No element specified!");var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if(R&&v.indexOf(t)>-1&&(t="webkit"+u(t)),!n||"none"==n.display||!f())return null;if(!(t in n)&&i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+t);return a(t)?n[t]:(-1==w.indexOf(t)&&o(t),n[y[t]])}function o(e){S=S||n();var t=E+u(e);if(R&&v.indexOf(e)>-1)y[e]=t;else if(S&&e in S)y[e]=e;else if(S&&t in S)y[e]=t;else if(!S&&deviceInfo.browser.firefox)y[e]=e;else if(i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+e+' or iframe still display "none" in FF');w.push(e)}function a(e){return p.test(e)}function f(){if(e===s)return!0;var t=e.frameElement.ownerDocument.defaultView.getComputedStyle(e.frameElement,null);return t&&"none"!=t.display}function u(e){return e+="",e?e[0].toUpperCase()+e.slice(1):""}var l=e.navigator.userAgent,s=t(),c=/rv:.*Gecko\//.test(l),d=/MSIE|Trident\//.test(l),m=/WebKit/.test(l),p=/^-?([mM]oz|[wW]eb[kK]it|[mM]s)-?/,y={},w=[],E=function(){return m?"webkit":d?"ms":c?"Moz":""}(),R=function(){var e=l.match(/AppleWebKit\/(\d+)/);return e&&~~e[1]<540}(),v=["transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","perspective","perspective-origin"],S=n();i.BREAK_ON_ERROR=!1,e.celtra=e.celtra||{},e.celtra.styler={css:i,computedCSS:r,isWebkit:m,isGecko:c,isIE:d},e.css=i,e.computedCSS=r}(window);;
function PerformanceTracker(t,e){this.trackingCenter=t,this.trackingEnabled=e.get("PerformanceTiming")||e.get("MonotypeOffloadFonts"),this._id=0}PerformanceTracker.prototype.start=function(t,e){var r=this,i={name:t,type:"interval",id:this._id++,startTime:Date.now(),args:e||[]};return i.end=function(){this.endTime=Date.now();var t=this.endTime-this.startTime;Logger("perf").log(this.name+"(#"+this.id+") "+t),r.collect(this)}.bind(i),i},PerformanceTracker.prototype.collect=function(t){if(this.trackingEnabled){var e={name:"perfTiming",section:t.name,type:t.type,perfId:t.id,startTime:t.startTime,endTime:t.endTime,args:t.args};this.trackingCenter.trackNoLaterThan(e,1e3)}},PerformanceTracker.prototype.mark=function(t){var e=this.start(t);e.type="mark",e.endTime=e.startTime,this.collect(e)},PerformanceTracker.prototype.marks=function(t){return function(){this.mark(t)}.bind(this)};;
var EventEmitter={emit:function(t){var e=this._listeners;if(e&&e[t]){var n=[].slice.call(arguments,1);e[t].forEach(function(t){t.apply(window,n)})}},emits:function(){var t=arguments;return function(){this.emit.apply(this,t)}.bind(this)},addListener:function(t,e){var n=this._listeners;n||(n=this._listeners={}),n[t]||(n[t]=[]),n[t].push(e)},removeListener:function(t,e){var n=this._listeners;n&&n[t]&&(n[t]=n[t].filter(function(t){return t!==e}))},once:function(t,e){var n=this;n.on(t,function i(){n.off(t,i),e.apply(this,arguments)})},onAll:function(t,e){t.split(" ").waitForEach(function(t,e){this.once(t,e)},e,this)}};EventEmitter.on=EventEmitter.addListener,EventEmitter.off=EventEmitter.removeListener,EventEmitter.addEventListener=EventEmitter.addListener,EventEmitter.removeEventListener=EventEmitter.removeListener,"undefined"!=typeof module&&null!==module&&(module.exports=EventEmitter);;
function TaskScheduler(){this.hub=extend({},EventEmitter)}TaskScheduler.prototype.when=function(){var t,e=this;return t=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),{run:function(n){t.waitForEach(function(t,n){e.hub.once(t,n)},n)}}},TaskScheduler.prototype.notify=function(t){this.paused||this.hub.emit(t)},TaskScheduler.prototype.notifies=function(t){return function(){this.notify(t)}.bind(this)},TaskScheduler.prototype.pause=function(){this._paused=!0};;
function TrackingCenter(e,t,n,i,s,r){this._sessionId=e,this._accountId=t,this._trackingUrl=i,this._trackers=s,this._purpose=n,this._flushCycle=null,this._flushCycleLength=1e4,this._useBatching=r,this._usePixel=!0,this.windowForPixels=window,this._instantiation=randInt(),this._eventIndex=0,this._pendingEvents=[],this._eventsInProgress=[],this._pendingPixels=[],this._waitingTrackingRequests=0,this._decrementWaiting=this._decrementWaiting.bind(this),this.flush=this.flush.bind(this),this.batchFlush=this.batchFlush.bind(this),this._flushPixels=this._flushPixels.bind(this)}extend(TrackingCenter.prototype,EventEmitter),TrackingCenter.eventCountLimit=1e3,TrackingCenter.prototype.setExperimentStatus=function(e){if(e&&e.get){var t=e.get("BatchTrackingRequests");this._useBatching=t?"control"!==t.chosenVariant.slice(0,7):this._useBatching;var n=t&&"Beacon"===t.chosenVariant.slice(-6),i=e.get("TrackWithBeaconAPI")||n;this._useBeacon=i&&this.windowForPixels.navigator&&this.windowForPixels.navigator.sendBeacon,this._usePixel=!(n&&this._useBeacon)}},TrackingCenter.prototype.batchFlush=function(){this._useBatching?this.flush():noop()},TrackingCenter.prototype.startBatchFlushCycle=function(e){this._useBatching&&(this.windowForPixels.setTimeout(this.flush,e),this._flushCycle=this.windowForPixels.setTimeout(this.flush,this._flushCycleLength))},TrackingCenter.prototype.isTrackingLimitReached=function(){return this._eventIndex>=TrackingCenter.eventCountLimit},TrackingCenter.prototype._createTrackingEvent=function(e){return e=JSON.parse(JSON.stringify(e)),extend({sessionId:this._sessionId,accountId:this._accountId,stream:"adEvents",instantiation:this._instantiation,index:this._eventIndex++,clientTimestamp:new Date/1e3},e)},TrackingCenter.prototype._addEventPendingToQueues=function(e){var t=this._resolvePixelsAndEventsForQueue([e]);this.isTrackingLimitReached()&&t.events.push(this._createTrackingEvent({name:"eventLimitReached"})),t.events.forEach(function(e){Logger("tracking").log("Queuing event "+JSON.stringify(e))}),t.pixels.forEach(function(e){Logger("tracking").log("Queuing pixel "+JSON.stringify(e))}),this._pendingEvents=this._pendingEvents.concat(t.events),this._pendingPixels=this._pendingPixels.concat(t.pixels)},TrackingCenter.prototype.track=function(e,t){this.trackNoLaterThan(e,0,t)},TrackingCenter.prototype.trackNoLaterThan=function(e,t,n){function i(e){return parseInt(e,10)===e}if(this.isTrackingLimitReached())return void console.warn("Tracking limit reached: "+TrackingCenter.eventCountLimit+" events.");if(i(t)?0>t&&(t=0):t=1500,n=n||noop,"live"!==this._purpose){var s=this._createTrackingEvent(e);return Logger("tracking").log("Ignoring non-live event "+JSON.stringify(s)),void defer(n)}var r=null;this._addEventPendingToQueues(e);var o=this.windowForPixels;this.once("trackingQueueEmptied",function(){r&&(o.clearTimeout(r),r=null),n()}.bind(this)),r=this._useBatching?o.setTimeout(this._flushPixels,t):o.setTimeout(this.flush,t)},TrackingCenter.prototype._resolvePixelsAndEventsForQueue=function(e){function t(e,i,s){if(0==e.length)return{events:i,pixels:s};var r=e[0],o=n._createTrackingEvent(r),c=n._trackers.urlsAndEventsFor(o);return t(e.slice(1).concat(c.events||[]),i.concat(o),s.concat(c.urls||[]))}var n=this;return t(e,[],[])},TrackingCenter.prototype._fireBeacon=function(e,t){this.windowForPixels.navigator.sendBeacon(e),t()},TrackingCenter.prototype._firePixel=function(e,t){function n(){i.onload=i.onerror=null,t()}var i=this.windowForPixels.document.createElement("img");i.onload=i.onerror=n;try{i.src=e}catch(s){n()}},TrackingCenter.prototype._decrementWaiting=function(){this._waitingTrackingRequests>0&&(--this._waitingTrackingRequests||this.emit("trackingQueueEmptied"))},TrackingCenter.prototype.flush=function(e,t){var n=this,i=e||noop;t="undefined"==typeof t?this._usePixel:t;var s=n._pendingEvents;if(n._pendingEvents=[],n._eventsInProgress=n._eventsInProgress.concat(s),s.length){n._waitingTrackingRequests++,this._useBatching&&(this.windowForPixels.clearTimeout(this._flushCycle),i=function(){n._flushCycle=n.windowForPixels.setTimeout(n.flush,n._flushCycleLength),(e||noop)()});var r=function(){n._eventsInProgress=n._eventsInProgress.filter(function(e){return-1===s.indexOf(e)}),n._decrementWaiting()};this._useBeacon&&n._fireBeacon(n._getTrackerBeaconUrl(s),r),t&&n._firePixel(n._getTrackerPixelUrl(s),r)}n._flushPixels(),0===n._waitingTrackingRequests?this.windowForPixels.setTimeout(i,0):this.once("trackingQueueEmptied",i)},TrackingCenter.prototype._flushPixels=function(){var e=this;e._pendingPixels.forEach(function(t){e._waitingTrackingRequests++,e._firePixel(t,e._decrementWaiting)}),e._pendingPixels=[]},TrackingCenter.prototype._getTrackerUrl=function(e){return base64json=this.windowForPixels.btoa(to_utf8(JSON.stringify(e))),this._trackingUrl+"json/"+base64json+"?crc32c="+crc32(base64json)},TrackingCenter.prototype._getTrackerPixelUrl=function(e){return this._getTrackerUrl({events:e})},TrackingCenter.prototype._getTrackerBeaconUrl=function(e){return this._getTrackerUrl({events:e.map(function(e){var t=JSON.parse(JSON.stringify(e));return t.beacon=!0,t})})},TrackingCenter.prototype._getTrackerRedirectUrl=function(e,t,n,i){i=i||{};var s={events:e,pixels:t,dest:n};return i.jsRedirectFunc&&(s.redirectFunc=i.jsRedirectFunc),this._getTrackerUrl(s)},TrackingCenter.prototype.wrapRedirectPageUrl=function(e,t){var n=this._getTrackerRedirectUrl(this._pendingEvents.concat(this._eventsInProgress),this._pendingPixels,e,t);return this._useBeacon?this.flush(void 0,!1):(this._pendingEvents=[],this._pendingPixels=[]),n};;
function Experiments(t,e){this._instances={};for(var n in t)this._instances[n]=new Experiment(n,t[n],e);e.setExperimentStatus(this)}function Experiment(t,e,n){this.key=t,this.chosenVariant=e,this._trackingCenter=n,this._variantExposedTracked=!1,this._variantSucceededTracked=!1,this.trackExposure=function(){this._track("variantExposed")}.bind(this),this.trackSuccess=function(){this._track("variantSucceeded")}.bind(this)}Experiments.prototype.get=function(t,e){var n=[t].concat(e||[]).map(encodeURIComponent).join("/");return this._instances[n]||null},Experiment.prototype._track=function(t){this["_"+t+"Tracked"]||(this["_"+t+"Tracked"]=!0,this._trackingCenter.track({name:t,experimentKey:this.key,variant:this.chosenVariant}))};;
function TouchEventSimulator(t){this.el=t,this.doc=t.ownerDocument?t.ownerDocument:t,this.win=this.doc.defaultView,this.touch=null,this._initialised=!1,this._firstEventFired=!1,this.handleFirstEvent=this.handleFirstEvent.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handlePointerCancel=this.handlePointerCancel.bind(this),this.captureBubbleEvents=this.captureBubbleEvents.bind(this)}TouchEventSimulator.mode=null,TouchEventSimulator.prototype.start=function(){return this._initialised?void("function"==typeof Logger&&Logger("TouchEventSimulator").warn("Touch event simulator already initialised!")):("function"==typeof Logger&&Logger("TouchEventSimulator").log("Enabling touch event simulation"),this.doc.defaultView.msPointerEnabled?this.startPointers():this.startMouse(),this.el.addEventListener("touchstart",this.captureBubbleEvents,!1),this.el.addEventListener("touchmove",this.captureBubbleEvents,!1),this.el.addEventListener("touchend",this.captureBubbleEvents,!1),this.el.addEventListener("touchcancel",this.captureBubbleEvents,!1),void this.el.addEventListener("tap",this.captureBubbleEvents,!1))},TouchEventSimulator.prototype.stop=function(){return this._initialised?("function"==typeof Logger&&Logger("TouchEventSimulator").log("Disabling touch event simulation"),this.win&&this.win.msPointerEnabled?this.stopPointers():this.stopMouse(),this.el.removeEventListener("touchstart",this.captureBubbleEvents,!1),this.el.removeEventListener("touchmove",this.captureBubbleEvents,!1),this.el.removeEventListener("touchend",this.captureBubbleEvents,!1),this.el.removeEventListener("touchcancel",this.captureBubbleEvents,!1),void this.el.removeEventListener("tap",this.captureBubbleEvents,!1)):void("function"==typeof Logger&&Logger("TouchEventSimulator").warn("Touch event simulator not running!"))},TouchEventSimulator.prototype.captureBubbleEvents=function(t){t.stopPropagation(),t.preventDefault()},TouchEventSimulator.prototype.startMouse=function(){this.el.addEventListener("mousedown",this.handleMouseDown,!0),this.el.addEventListener("mousemove",this.handleMouseMove,!0),this.el.addEventListener("mouseup",this.handleMouseUp,!0),this.el.addEventListener("mouseout",this.handleMouseOut,!0),this.el.addEventListener("dragstart",this.handleDragStart,!0),this._initialised=!0},TouchEventSimulator.prototype.stopMouse=function(){this.el.removeEventListener("mousedown",this.handleMouseDown,!0),this.el.removeEventListener("mousemove",this.handleMouseMove,!0),this.el.removeEventListener("mouseup",this.handleMouseUp,!0),this.el.removeEventListener("mouseout",this.handleMouseOut,!0),this.el.removeEventListener("dragstart",this.handleDragStart,!0),this._initialised=!1},TouchEventSimulator.prototype.startPointers=function(){this.el.addEventListener("MSPointerDown",this.handlePointerDown,!0),this.el.addEventListener("MSPointerMove",this.handlePointerMove,!0),this.el.addEventListener("MSPointerUp",this.handlePointerUp,!0),this.el.addEventListener("MSPointerCancel",this.handlePointerCancel,!0),this._initialised=!0},TouchEventSimulator.prototype.stopPointers=function(){this.el.removeEventListener("MSPointerDown",this.handlePointerDown,!0),this.el.removeEventListener("MSPointerMove",this.handlePointerMove,!0),this.el.removeEventListener("MSPointerUp",this.handlePointerUp,!0),this.el.removeEventListener("MSPointerCancel",this.handlePointerCancel,!0),this._initialised=!1},TouchEventSimulator.prototype.init=function(){this.doc.defaultView.navigator.msPointerEnabled?this.start():(this.el.addEventListener("touchstart",this.handleFirstEvent,!0),this.el.addEventListener("mousedown",this.handleFirstEvent,!0))},TouchEventSimulator.prototype.updateTouchCoordinates=function(t){this.touch.screenX=t.screenX,this.touch.screenY=t.screenY,this.touch.pageX=t.pageX,this.touch.pageY=t.pageY,this.touch.clientX=t.clientX,this.touch.clientY=t.clientY},TouchEventSimulator.prototype.ignorables=["select","input","textarea"],TouchEventSimulator.prototype.isFormElement=function(t){return this.ignorables.indexOf(t.nodeName.toLowerCase())>-1},TouchEventSimulator.prototype.isIgnorable=function(t){for(var e=t;e&&e instanceof HTMLElement;e=e.parentNode)if(hasClass(e,"ignore-toucheventsimulator"))return!0;return!1},TouchEventSimulator.prototype.handleFirstEvent=function(t){this._firstEventFired||(this._firstEventFired=!0,this.el.removeEventListener("touchstart",this.handleFirstEvent,!0),this.el.removeEventListener("mousedown",this.handleFirstEvent,!0),"touch"!=TouchEventSimulator.mode&&"mousedown"==t.type?(TouchEventSimulator.mode="mouse",this.start(),this.handleMouseDown(t)):TouchEventSimulator.mode="touch")},TouchEventSimulator.prototype.handleMouseDown=function(t){0!=t.button||this.isIgnorable(t.target)||(this.touch={identifier:0,target:t.target},this.updateTouchCoordinates(t),t.stopPropagation(),this.isFormElement(t.target)||t.preventDefault(),this.fireTouchEvent("touchstart",t))},TouchEventSimulator.prototype.handleMouseMove=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),t.stopPropagation(),t.preventDefault(),this.fireTouchEvent("touchmove",t))},TouchEventSimulator.prototype.handleMouseUp=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),t.stopPropagation(),t.preventDefault(),this.fireTouchEvent("touchend",t),this.touch=null)},TouchEventSimulator.prototype.handleMouseOut=function(t){this.touch&&0==t.button&&(t.clientX<=0||t.clientX>=this.win.innerWidth||t.clientY<=0||t.clientY>=this.win.innerHeight)&&this.cancelInteraction()},TouchEventSimulator.prototype.handleDragStart=function(t){return t.preventDefault(),!1},TouchEventSimulator.prototype.handlePointerDown=function(t){0==t.button&&(this.touch={identifier:0,target:t.target},this.updateTouchCoordinates(t),this.fireTouchEvent("touchstart",t))},TouchEventSimulator.prototype.handlePointerMove=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchmove",t))},TouchEventSimulator.prototype.handlePointerUp=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchend",t))},TouchEventSimulator.prototype.handlePointerCancel=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchcancel",t),this.touch=null)},TouchEventSimulator.prototype.fireTouchEvent=function(t,e){var n=this.doc.createEvent("HTMLEvents");n.initEvent(t,!0,!0),"touchend"==t||"touchcancel"==t?(n.touches=n.targetTouches=[],n.changedTouches=[this.touch]):n.touches=n.targetTouches=n.changedTouches=[this.touch],e.target.dispatchEvent(n)},TouchEventSimulator.prototype.cancelInteraction=function(){this.touch&&(this.fireTouchEvent("touchcancel",this.touch),this.touch=null)};;
function AggregatorTracking(t){this._trackingCenter=t}AggregatorTracking.prototype.trackAggregator=function(t,r,g){"object"==typeof r&&(g=r,r=void 0),g=g||{},r=void 0!==r?r:1,this._trackingCenter.track({name:"aggregator",metric:t,value:r,customDimensions:g})},AggregatorTracking.prototype.trackAggregatorTime=function(t,r,g){this.trackAggregator(t,Math.round(r),g)},AggregatorTracking.prototype.trackAggregatorUsingTimer=function(t,r){var g=new Date;return function(){this.trackAggregatorTime(t,new Date-g,r)}.bind(this)},AggregatorTracking.prototype.trackAggregatorMagicTriplet=function(t,r,g){this.trackAggregator(t+"Attempts",r);var e=new Date;return function(){var a=new Date-e;(!g||g>a)&&(this.trackAggregator(t+"Successes",r),this.trackAggregatorTime(t+"Time",a,r))}.bind(this)};;
function Logger(e){if(!(this instanceof Logger))return new Logger(e);e=e||"";var n=noop;(Logger.enabledNames.indexOf(e)>=0||Logger.enabledNames.indexOf("all")>=0)&&(n=function(){var e=[].slice.apply(arguments);e.unshift(Logger._ts()+" ["+Logger.sessionId+(this.name?" "+this.name:"")+"]"),console.log.apply(console,e)}),this.name=e,this.log=n,this.warn=n,this.debug=n,this.error=n}Logger._ts=function(){function e(e,n){for(e+="";e.length0?i.area/this._maxPossibleDimensions.area:0,o=!1;s!==this.areaInViewRatio&&(this.areaInViewRatio=s,o=!0),n&&(this.emit("rectInViewChanged",i),Logger("InViewObject").debug(this.view.toString()+", rectInViewChanged: "+this.rectInView.toString())),o&&(this.emit("areaInViewRatioChanged",s),Logger("InViewObject").debug(this.view.toString()+", areaInViewRatioChanged: "+s))},InViewObject.prototype.getBoundingClientRect=function(){var t=this.getNode();return t?CRect.adopt(t.getBoundingClientRect()):CRect.ZERO},InViewObject.prototype.getMaxPossibleDimensions=function(){return this._maxPossibleDimensions},InViewObject.prototype._computeMaxPossibleDimensions=function(t,e){this._maxPossibleDimensions.width=Math.min(e.width,t.width),this._maxPossibleDimensions.height=Math.min(e.height,t.height),this._maxPossibleDimensions.area=this._maxPossibleDimensions.width*this._maxPossibleDimensions.height},InViewObject.prototype.getRectInView=function(){return this.rectInView},InViewObject.prototype.getAreaInViewRatio=function(){return this.areaInViewRatio},InViewObject.prototype.start=function(){this.active||(this._start(),this.active=!0,this.computeRectInView())},InViewObject.prototype._start=function(){this.inViewParent.on("rectInViewChanged",this.computeRectInView),this.inViewParent.on("areaInViewRatioChanged",this.computeRectInView)},InViewObject.prototype.stop=function(){this.active&&(this.computeRectInView(),this._stop(),this.active=!1)},InViewObject.prototype._stop=function(){this.inViewParent.off("rectInViewChanged",this.computeRectInView),this.inViewParent.off("areaInViewRatioChanged",this.computeRectInView)};;
function AdViewableTimeObserver(e){this._tracker=e,this._readyToShow=!1,this._adapter}function AdViewableInViewObjectObserver(){AdViewableInViewObjectObserver.uberConstructor.apply(this,arguments),this._inViewObjects=[],this._viewableInViewObjects=[]}function AdViewableUnitObserver(){AdViewableUnitObserver.uberConstructor.apply(this,arguments),this._units=[],this._viewableUnits=[],this._containerIsViewable=!1}AdViewableTimeObserver.prototype.readyToShow=function(){throw new Error("AdViewableInViewObjectObserver.readyToShow not implemented!")},AdViewableTimeObserver.prototype.registerUnit=function(){throw new Error("AdViewableInViewObjectObserver.registerUnit not implemented!")},AdViewableTimeObserver.prototype.registerAdapter=function(){throw new Error("AdViewableTimeObserver.registerAdapter not implemented!")},AdViewableTimeObserver.prototype.stop=function(){this._tracker.stop()},inherit(AdViewableInViewObjectObserver,AdViewableTimeObserver),AdViewableInViewObjectObserver.prototype.registerAdapter=function(e){this._adapter=e;var t=this._tracker;e.mediaState.on("videoStarted",function(){this._tryStartTracker()}.bind(this)),e.mediaState.on("videoStopped",function(){0===this._viewableInViewObjects.length&&t.stop()}.bind(this))},AdViewableInViewObjectObserver.prototype.readyToShow=function(){this._readyToShow=!0,this._tryStartTracker()},AdViewableInViewObjectObserver.prototype.registerUnit=function(e){var t=e.inView,i=this._inViewObjects,r=this._viewableInViewObjects,a=this._tracker;if(-1===i.indexOf(t)){i.push(t);var n=-1!==r.indexOf(t);!n&&t.getAreaInViewRatio()>0&&r.push(t),this._tryStartTracker(),t.on("areaInViewRatioChanged",function(e){var i=r.indexOf(t),n=-1!==i;!n&&e>0?(r.push(t),this._tryStartTracker()):0===e&&n&&(r.splice(i,1),0===r.length&&a.stop())}.bind(this))}},AdViewableInViewObjectObserver.prototype._tryStartTracker=function(){var e=this._adapter,t=e&&e.mediaState.playingVideo;return this._readyToShow&&(this._viewableInViewObjects.length>0||t)?(this._tracker.start(),!0):!1},inherit(AdViewableUnitObserver,AdViewableTimeObserver),AdViewableUnitObserver.prototype.registerAdapter=function(e){this._adapter=e,this._containerIsViewable=e.containerIsViewable;var t=this._tracker;e.on("containerViewableChange",function(e){this._containerIsViewable=e,e?this._tryStartTracker():t.stop()}.bind(this)),e.mediaState.on("videoStarted",function(){this._tryStartTracker()}.bind(this)),e.mediaState.on("videoStopped",function(){this._adapter.containerIsViewable&&0!==this._viewableUnits.length||t.stop()}.bind(this))},AdViewableUnitObserver.prototype.readyToShow=function(){this._readyToShow=!0,this._tryStartTracker()},AdViewableUnitObserver.prototype.registerUnit=function(e){if(!this._adapter)throw new Error("adapter was not registered yet!");var t=this._units,i=this._viewableUnits,r=this._tracker;-1===t.indexOf(e)&&(t.push(e),-1===i.indexOf(e)&&e._visible&&(i.push(e),this._tryStartTracker()),e.on("appeared",function(){-1===i.indexOf(e)&&(i.push(e),this._tryStartTracker())}.bind(this)),e.on("disappeared",function(){var t=i.indexOf(e);-1!==t&&(i.splice(t,1),0===i.length&&r.stop())}.bind(this)))},AdViewableUnitObserver.prototype._tryStartTracker=function(){var e=this._adapter;return e&&(e.containerIsViewable||e.mediaState.playingVideo)&&this._readyToShow&&this._viewableUnits.length>0?(this._tracker.start(),!0):!1};;
function AdViewableTimeTracker(i,e,t,n){this._trackingCenter=i,this._raf=e,this._win=t,this._intervals=n||{3e3:1e3,1e4:2e3,63e3:3e3},this._isRunning=!1,this._viewableMilliseconds=0,this._fromTime=0,this._pendingPingTimeoutId,this._pendingPingRafId,this._maxRafLatency=500}AdViewableTimeTracker.eventName="viewableTime",AdViewableTimeTracker.TrackingData=function(i,e){return i>e&&(e=i),{name:AdViewableTimeTracker.eventName,from:i/1e3,to:e/1e3}},AdViewableTimeTracker.prototype.start=function(){this._isRunning||(this._isRunning=!0,this._fromTime=Date.now(),0===this._viewableMilliseconds?this._initPing():this._setNextPing())},AdViewableTimeTracker.prototype.stop=function(){if(this._clearPendingPing(),this._isRunning&&-1!==this._getPingInterval()){var i=Date.now(),e=i-this._fromTime;this._viewableMilliseconds+=e;var t=new AdViewableTimeTracker.TrackingData(this._fromTime,i);this._track(t)}this._isRunning=!1},AdViewableTimeTracker.prototype._initPing=function(){var i=this._fromTime,e=this._getPingInterval(),t=new AdViewableTimeTracker.TrackingData(this._fromTime,i);this._pendingPingRafId=this._raf.nextFrame(function(){this._track(t),this._setFromTimeForNextPing(i,e),this._setNextPing()}.bind(this))},AdViewableTimeTracker.prototype._setNextPing=function(){function i(){if(this._isRunning){var i=Date.now();this._viewableMilliseconds+=e,this._normalizeFromTime(i,e),this._pendingPingRafId=this._raf.nextFrame(function(){var t=new AdViewableTimeTracker.TrackingData(this._fromTime,i);this._track(t),this._setFromTimeForNextPing(i,e),this._setNextPing()}.bind(this))}}this._clearPendingPing();var e=this._getPingInterval();this._isRunning&&-1!==e&&(this._pendingPingTimeoutId=this._win.setTimeout(i.bind(this),e))},AdViewableTimeTracker.prototype._normalizeFromTime=function(i,e){var t=i-this._fromTime,n=e+this._maxRafLatency;t>n&&(this._fromTime=i)},AdViewableTimeTracker.prototype._setFromTimeForNextPing=function(i,e){var t=Date.now(),n=t-i,r=n>e;this._fromTime=r?t:i},AdViewableTimeTracker.prototype._getPingInterval=function(){var i=this._viewableMilliseconds,e=this._intervals,t=Object.keys(this._intervals),n=1*t[t.length-1],r=-1;return t.some(function(t){return 1*t>i?(r=e[t],i+r>n&&(r=-1),!0):!1}),r},AdViewableTimeTracker.prototype._clearPendingPing=function(){this._raf.cancelFrame(this._pendingPingRafId),this._win.clearTimeout(this._pendingPingTimeoutId)},AdViewableTimeTracker.prototype._track=function(i){this._trackingCenter.track(i)};;
!function(t){function i(){this.playingVideo=!1}var e=i.prototype;extend(e,EventEmitter),e.stopVideo=function(){this.playingVideo=!1,this.emit("videoStopped")},e.startVideo=function(){this.playingVideo=!0,this.emit("videoStarted")},t.MediaState=i}(window);;
!function(e){"use strict";var r={};r.toString=function(){return"[Clazz CustomAudiences]"};var t=function(e,r,t,n){function i(r,t){var i=new XMLHttpRequest;i.open(e,u+s+"/"+encodeURIComponent(r)+"/"+encodeURIComponent(t)+"?"+creative.authTokenUrlParam),i.send(n)}if(-1===["PUT","DELETE"].indexOf(e))throw new Error("Unsupported request method: "+e);if("undefined"==typeof creative.runtimeParams.customAudiences[r])throw new Error('Custom audience "'+r+'" is not used by the creative.');creative.runtimeParams.customAudiences[r]={userExists:t,userData:n};var u=creative.secure?creative.customAudiencesUrl:creative.insecureCustomAudiencesUrl,s="/audiences/"+r,o=creative.userIdentifiers;for(var a in o)for(var c in o[a])i(a,o[a][c])};r.addUser=function(e,r){creative.runtimeParams.userOptOut||t("PUT",e,!0,r)},r.removeUser=function(e){creative.runtimeParams.userOptOut||t("DELETE",e,!1)},e.CustomAudiences=r}(window);;
!function(e){"use strict";function t(e){return{findByLocalId:e}}var n={ambience:"Ambience",animatey:"Animatey",abtest:"Best",basket:"Basket",button:"Button",canvas:"Canvas",celebration:"Celebration",checkbox:"CheckBox",feedbasedchoice:"ChoiceFeed",countdown:"Countdown",draggy:"Draggy",dropdown:"Dropdown",dynamiccontent:"DynamicContent",facebookshare:"FacebookShareButton",fallback:"Fallback",frame:"Frame",flippy:"Flippy",grid:"Grid",group:"Group",gyro:"Gyro",hotspot:"Hotspot",input:"Input",lighttable:"LightTable",map:"Map",transitions:"Transitions",mastervideo:"MasterVideo",nearby:"Nearby",painty:"Painty",pannable:"Pannable",particles:"Particle",picture:"Picture",puzzle:"Puzzle",shapey:"Shapey",smoke:"Smoke",stack:"Stack",stopwatch:"Stopwatch",locatorclassic:"StoreLocator2",locator:"StoreLocator3",swipeygallery:"Swipey",swipeygroup:"SwipeyGroup",takephoto:"TakePhotoButton",texty:"Texty",twitterfeed:"TwitterFeed",twittershare:"TwitterShareButton",inlinevideo:"Video","360view":"View360","360video":"Video360","360°video":"Video360",weather:"Weather",whatsappshare:"WhatsAppShareButton",wipeable:"Wipeable",youtube:"Youtube",scene:"Scene",brandtracksurvey:"BrandTrackSurvey",brandtrackquestion:"BrandTrackQuestion",customcode:"CustomCode",videoasset:"VideoAsset"},o=function(e){return e=e.toLowerCase().replace(/\W+/g,""),e in n?n[e]:""},i=function(e,t){function n(r){t&&i.length>0||r.forEach(function(t){e(t)&&i.push(t),t.getActiveContainers().forEach(function(e){n(e.objects),o(e.scenes)})})}function o(n){!n||t&&i.length>0||n.forEach(function(t){e(t)&&i.push(t)})}var i=[];return"Screen"==this.constructor.name?(n(this.objects),o(this.scenes)):"function"==typeof this.getActiveContainers&&this.getActiveContainers().forEach(function(e){n(e.objects),o(e.scenes)}),i},r=function(e){var t=i.call(this,e,!0);return t.length>0?t[0]:null},a=function(e){return function(t){return"undefined"==typeof e||t.name==e}},c={findAll:function(e){return i.call(this,a(e))},findByType:function(e){var t=[];return"undefined"==typeof e?t:i.call(this,function(t){return t.constructor.name==o(e)})},findByLocalId:function(e){return r.call(this,function(t){return t.localId==e})},find:function(e){return r.call(this,a(e))}};e.DiscoverableTrait=c;var u=function(e){var t=null;for(var n in this.units)if(t=this.units[n].findByLocalId(e,!0))break;return t},s=function(e){if("undefined"==typeof e)return null;var t=null;return this.variants.some(function(n){return t=n.findByLocalId(e),n.localId==e&&(t=n),!!t}),t},l=function(e){if("undefined"==typeof e)return null;var t=null;return[this.master].concat(this.screens).some(function(n){return t=n.findByLocalId(e),n.localId==e&&(t=n),!!t}),t};e.DiscoverableUnitsTrait=t(u),e.DiscoverableVariantsTrait=t(s),e.DiscoverableScreensTrait=t(l)}(window);;
!function(n){"use strict";function e(n){return{goToObject:n}}var t=function(n,e){if(e=e||noop,null!==n){var t=null;"undefined"!=typeof n.parentUnit&&(t=n.parentUnit),"CreativeUnit"===n.constructor.name&&(t=n),t?this._goToUnit(t.localId,function(t){t.goToObject(n,e)}):defer(e.bind(this,null))}},r=function(n,e){e=e||noop;var t=null,r=null;"undefined"!=typeof n.parentScreen&&(r=n.parentScreen),"Screen"===n.constructor.name&&(r=n),r&&null!==r.parentUnitVariant&&(t=r.parentUnitVariant),"CreativeUnitVariant"===n.constructor.name&&(t=n),t?this.goToVariant(t.localId,function(t){t.goToObject(n,e)}):defer(e.bind(this,null))},i=function(n,e){e=e||noop;var t=null;"undefined"!=typeof n.parentScreen&&(t=n.parentScreen),"Screen"===n.constructor.name&&(t=n),t&&t!==this.currentScreen?this.goToScreen(t,void 0,function(){e(t)}):defer(e.bind(this,null))};n.TraversableUnitsTrait=e(t),n.TraversableVariantsTrait=e(r),n.TraversableScreensTrait=e(i)}(window);;
var SingleUnitFormatShareableStateNavigation={_applyShareableState:function(a){if(a&&a.unit){var e=this.placements.banner?this.placements.banner.creative.units.banner:this.placements.modal.creative.units.modal;e.applyShareableState(a.unit)}}};;
function StateObject(t){Object.defineProperties(this,{values:{enumerable:!1,configurable:!1,writable:!0,value:{}},_isDirty:{enumerable:!1,configurable:!1,writable:!0,value:!1}}),Object.keys(t).forEach(function(e){this.registerValue(e,t[e])},this)}extend(StateObject.prototype,EventEmitter),StateObject.prototype.registerValue=function(t,e){this.values[t]={dirty:!1,value:e},Object.defineProperty(this,t,{get:function(){return this.values[t].value},set:function(e){var i=this.values[t],r=i.value;e!=r&&(i.dirty=!0,i.value=e,this._isDirty=!0,this.emit("change:"+t,e,r))},enumerable:!0})},StateObject.prototype.markClean=function(t){var e=!1;Object.keys(this.values).forEach(function(i){t&&i!==t||(this[i].dirty=!1),e=e||this[i].dirty},this.values),this._isDirty=e},StateObject.prototype.getDirtyValues=function(){for(var t={},e=Object.keys(this.values),i=0;i1&&(t=Array.prototype.slice.apply(arguments));for(var e=0;e=this._targetTime?(this.pause(),this.value=this._targetValue,defer(this._callback||noop),this._startValue=null,this._startTime=null,this._targetValue=null,this._targetTime=null,this._callback=null):this.value=Math.pow(t/this._targetTime,this.options.exp)*i+this._startValue};;
function ViewportManager(t){this.container=t.container,this.width=this.originalWidth=t.width||0,this.height=this.originalHeight=t.height||0,this.iframe=this.container.ownerDocument.defaultView.frameElement,this.init()}extend(ViewportManager.prototype,EventEmitter),ViewportManager.prototype.init=function(){this.container.style.overflow="hidden",this.container.style.position="absolute",this.container.style.left=this.container.style.top=0,this.iframe.style.display="block",this.update()},ViewportManager.prototype.update=function(){this.container.style.width=this.width+"px",this.container.style.height=this.height+"px",this.iframe.style.width=this.width+"px",this.iframe.style.height=this.height+"px",this.iframe.width=this.width,this.iframe.height=this.height},ViewportManager.prototype.setSize=function(t,i){this.width=t,this.height=i,this.update()};;
function Placement(t){this.root=null,this.width={value:100,unit:"%"},this.height={value:100,unit:"%"},this.left={value:0,unit:"px"},this.top={value:0,unit:"px"},this._positioning=t||"container",this.origin={horizontal:"left",vertical:"top"},this._usesFixedPositioning=!1,this._minWidth={value:0,unit:"px"},this._minHeight={value:0,unit:"px"},this.touchEventSimulator=null,this.overflow=!1,this._visible=!1,this.isSticky=!1,this.bypassSizing=!1,this.bypassPositioning=!1}extend(Placement.prototype,EventEmitter),Placement.ZINDEX_MAX=2147483647,Placement.prototype.getRootWindow=function(){return this.root.ownerDocument.defaultView},Placement.prototype.attachTo=function(){throw new Error("Placement.attachTo not implemented")},Placement.prototype.getContainer=function(){throw new Error("Placement.getContainer not implemented")},Placement.prototype.getContentWindow=function(){return this.getContainer().ownerDocument.defaultView},Object.defineProperty(Placement.prototype,"creative",{get:function(){return this.getContainer().ownerDocument.defaultView.creative}}),Object.defineProperty(Placement.prototype,"positioning",{get:function(){return this._positioning},set:function(t){this._positioning=t,this.update()}}),Object.defineProperty(Placement.prototype,"visible",{get:function(){return this._visible}}),Object.defineProperty(Placement.prototype,"_canUseFixedPositioning",{get:function(){return this.usesFixedPositioning&&this.supportsFixedPositioning},enumerable:!1}),Placement.prototype.setMinimumSize=function(t,e){var i=this._parseLength(t),o=this._parseLength(e);this._minWidth.value=i.value,this._minWidth.unit=i.unit,this._minHeight.value=o.value,this._minHeight.unit=o.unit,this._visible&&this.update()},Placement.prototype.setSize=function(t,e,i){var o,s,n=this._parseLength(t),r=this._parseLength(e),h=this.getViewportGeometry(),l=extend({},this._minWidth),a=extend({},this._minHeight);i||(this.width={value:n.value,unit:n.unit},this.height={value:r.value,unit:r.unit}),this._visible&&("screen"==this.positioning?(o=h.width,s=h.height):"page"==this.positioning?(o=this.root.ownerDocument.documentElement.offsetWidth,s=this.root.ownerDocument.documentElement.offsetHeight):(o=this.root.parentNode.offsetWidth,s=this.root.parentNode.offsetHeight),"%"==n.unit&&(n.value=Math.round(n.value*o/100),n.unit="px"),"%"==r.unit&&(r.value=Math.round(r.value*s/100),r.unit="px"),"%"==l.unit&&(l.value=Math.round(l.value*o/100),l.unit="px"),"%"==a.unit&&(a.value=Math.round(a.value*s/100),a.unit="px"),this.bypassSizing||(this.root.style.width=Math.max(n.value,l.value)+n.unit,this.root.style.height=Math.max(r.value,a.value)+r.unit),this.emit("resized"))},Placement.prototype.getBaseOffset=function(){var t=this.root.ownerDocument.createElement("div"),e=this.root.parentNode;t.style.left=0,t.style.top=0,t.style.position="absolute",t.style.setProperty("display","block","important"),e.appendChild(t);var i=offset(t);return e.removeChild(t),i},Placement.prototype.applyCustomPubClasses=function(){var t=this._getPubClasses();this._usePubClasses=t.length>0,this._usePubClasses&&(this._disableSelfStyling(),this.addClasses.apply(this,t.concat(["celtra-placement"])))},Placement.prototype.usePubClasses=function(){return this._usePubClasses},Placement.prototype._disableSelfStyling=function(){this.bypassPositioning=!("StickyPlacement"===this.constructor.name||this.isSticky),this.bypassSizing=!0,this._clearCSS(),this.bypassPositioning&&(this.root.style.position="relative")},Placement.prototype._getPubClasses=function(){var t=this.creative&&this.creative.customAttributes,e=[];return t&&t.hasOwnProperty("cssCustomClass")&&"string"==typeof t.cssCustomClass&&(e=t.cssCustomClass.split(",")),e},Placement.prototype._clearCSS=function(){this.root.style=""},Placement.prototype.addClasses=function(t){t=Array.prototype.slice.apply(arguments).filter(function(t){return!!t}),t.forEach(function(t){try{this.root.classList.add(t)}catch(e){console.warn('Class "'+t+'" not added: '+e.message)}}.bind(this))},Placement.prototype.setPosition=function(t,e,i,o){var s=this._parseLength(t),n=this._parseLength(e),r=this.getViewportGeometry(),h=this.getBaseOffset();if(i||(this.left.value=s.value,this.left.unit=s.unit,this.top.value=n.value,this.top.unit=n.unit),this._visible&&!this.bypassPositioning){switch(this.positioning){case"screen":if(this._canUseFixedPositioning)this.root.style.position="fixed","left"==this.origin.horizontal?(this.root.style.left=s.value+s.unit,this.root.style.right="auto",this.root.style.marginLeft=""):"center"==this.origin.horizontal?(this.root.style.left=s.value+s.unit,this.root.style.right="auto",this.root.style.marginLeft=o?"":(r.width-this.root.offsetWidth)/2+"px"):(this.root.style.right=s.value+s.unit,this.root.style.left="auto",this.root.style.marginLeft=""),"top"==this.origin.vertical?(this.root.style.top=n.value+n.unit,this.root.style.bottom="auto",this.root.style.marginTop=""):"center"==this.origin.vertical?(this.root.style.top=n.value+n.unit,this.root.style.bottom="auto",this.root.style.marginTop=(r.height-this.root.offsetHeight)/2+"px"):(this.root.style.bottom=n.value+n.unit,this.root.style.top="auto",this.root.style.marginTop="");else{var l="",a="";if("%"==s.unit&&(s.value*=r.width/100,s.unit="px"),"%"==n.unit&&(n.value*=r.height/100,n.unit="px"),"left"==this.origin.horizontal)s.value+=r.left;else if("center"==this.origin.horizontal)s.value+=r.left,l=(r.width-this.root.offsetWidth)/2+"px";else{var u="%"==this.width.unit?this.width.value/100*r.width:this.width.value;s.value=r.left+r.width-u-s.value}if("top"==this.origin.vertical)n.value+=r.top;else if("center"==this.origin.vertical)n.value+=r.top,a=(r.height-this.root.offsetHeight)/2+"px";else{var p="%"==this.height.unit?this.height.value/100*r.height:this.height.value;n.value=r.top+r.height-p-n.value}this.root.style.position="absolute",this.root.style.left=s.value-h.left+"px",this.root.style.top=n.value-h.top+"px",this.root.style.marginLeft=l,this.root.style.marginTop=a,this.root.style.right=this.root.style.bottom="auto"}break;case"container":this.root.style.position="absolute","left"==this.origin.horizontal?(this.root.style.left=s.value+s.unit,this.root.style.right="auto",this.root.style.marginLeft=""):"center"==this.origin.horizontal?(this.root.style.left=s.value+s.unit,this.root.style.right="auto",this.root.style.marginLeft="px"==this.height.unit?-Math.round(this.width.value/2)+"px":-(this.root.offsetWidth/2)+"px"):(this.root.style.left="auto",this.root.style.right=s.value+s.unit,this.root.style.marginLeft=""),"top"==this.origin.vertical?(this.root.style.top=n.value+n.unit,this.root.style.bottom="auto",this.root.style.marginTop=""):"center"==this.origin.vertical?(this.root.style.top=n.value+n.unit,this.root.style.bottom="auto",this.root.style.marginTop="px"==this.height.unit?-Math.round(this.height.value/2)+"px":-(this.root.offsetHeight/2)+"px"):(this.root.style.top="auto",this.root.style.bottom=n.value+n.unit,this.root.style.marginTop="");break;case"page":var c={width:this.root.ownerDocument.documentElement.clientWidth,height:this.root.ownerDocument.documentElement.clientHeight};"%"==s.unit&&(s.value=Math.round(s.value*c.width/100),s.unit="px"),"%"==n.unit&&(n.value=Math.round(n.value*c.height/100),n.unit="px"),this.root.style.position="absolute","left"==this.origin.horizontal?(this.root.style.left=s.value-h.left+"px",this.root.style.top=n.value-h.top+"px"):"center"==this.origin.horizontal?(this.root.style.left=(c.width-this.root.offsetWidth)/2-h.left+s.value+"px",this.root.style.top=(c.height-this.root.offsetHeight)/2-h.top+n.value+"px"):(this.root.style.left=c.width-this.root.offsetWidth-h.left-s.value+"px",this.root.style.top=c.height-this.root.offsetHeight-h.top-n.value+"px"),this.root.style.right=this.root.style.bottom="auto";break;case"static":this.root.style.position="static",this.root.style.left=this.root.style.top=0,this.root.style.right=this.root.style.bottom="auto",this.root.style.marginLeft=this.root.style.marginTop=""}this.emit("repositioned")}},Placement.prototype.update=function(t){this.setSize(this.width.value+this.width.unit,this.height.value+this.height.unit,!0),this.setPosition(this.left.value+this.left.unit,this.top.value+this.top.unit,!0),defer(t||noop,void 0,void 0,useAsap())},Placement.prototype.supportsFixedPositioning=!0,Object.defineProperty(Placement.prototype,"usesFixedPositioning",{get:function(){return this._usesFixedPositioning},set:function(t){this._usesFixedPositioning=!!t,this.update()},enumerable:!0}),Placement.prototype.hacks={useAlternativeWindowDimensions:"BackCompat"==document.compatMode?!1:desktop(),useSplitScreenWindowDimensions:ios("9",null)},Placement.prototype.hide=function(){this.root.style.display="none",this._visible=!1,this.emit("hidden")},Placement.prototype.show=function(){this.root.style.display="block",this._visible=!0,this.update(),this.emit("shown")},Placement.prototype.destroy=function(){this.emit("destroyed"),this.root&&this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null},Placement.prototype.setZIndex=function(t){0>t&&(t=Placement.ZINDEX_MAX+t),"max"==t&&(t=Placement.ZINDEX_MAX),this.root.style.zIndex=t},Placement.prototype.createElement=function(){throw new Error("Not implemented")},Placement.prototype.querySelector=function(){throw new Error("Not implemented")},Placement.prototype.getViewportGeometry=function(){var t=this.getRootWindow(),e=t.document.documentElement;return{width:this.hacks.useAlternativeWindowDimensions||this.hacks.useSplitScreenWindowDimensions?e.clientWidth:t.innerWidth,height:this.hacks.useAlternativeWindowDimensions?e.clientHeight:t.innerHeight,left:t.scrollX||e&&e.scrollLeft||0,top:t.scrollY||e&&e.scrollTop||0}},Placement.prototype.getPlacementGeometry=function(){if("screen"==this.positioning&&this._canUseFixedPositioning)return{width:this.root.offsetWidth,height:this.root.offsetHeight,left:this.root.offsetLeft,top:this.root.offsetTop};var t=offset(this.root),e=this.getViewportGeometry();return{width:this.root.offsetWidth,height:this.root.offsetHeight,left:t.left-e.left,top:t.top-e.top}},Placement.prototype.getGlobalGeometry=function(t){for(var e=this.getRootWindow(),i=this.root.getBoundingClientRect(),o=CRect.adopt(i);e!==t&&e!==e.parent;)i=CRect.adopt(e.frameElement.getBoundingClientRect()),o.left+=i.left,o.top+=i.top,o=o.intersect(i),e=e.parent;return o},Placement.prototype._parseLength=function(t){if(!isNaN(t))return{value:t,unit:"px"};var e=t.match(/^(-?[\d.]+)(px|%)$/);if(!e)throw new Error('Cannot parse length "'+t+'"');return{value:parseFloat(e[1],10),unit:e[2]}},Placement.prototype.getUnitGeometry=function(t){var e=this.getPlacementGeometry(),i={left:e.left,top:e.top,width:t.size.width,height:t.size.height},o=t.horizontalPosition||"center",s=t.verticalPosition||"center";return"center"==o?i.left+=(e.width-t.size.width)/2:"right"==o&&(i.left+=e.width-t.size.width),"center"==s?i.top+=(e.height-t.size.height)/2:"bottom"==s&&(i.top+=e.height-t.size.height),i.left=Math.round(i.left),i.top=Math.round(i.top),i},Placement.prototype.getRelativeUnitGeometry=function(t){var e=offset(t.node);return e.width=t.node.offsetWidth,e.height=t.node.offsetHeight,e},Placement.prototype.populate=function(t,e){this.getContainer().appendChild(t),this.emit("populated"),e&&defer(e,void 0,void 0,useAsap())},Placement.prototype._getViewportElement=function(){throw new Error("Not implemented")},Placement.prototype.setBackground=function(t){null==t&&(t="none"),this.root.style.background=t},Placement.prototype.setOverflow=function(){var t=function(t){t.preventDefault()};return function(e){var i=this._getViewportElement();e?(i.style.overflowY="auto",ios()&&(i.style.webkitOverflowScrolling="touch",detach(i,"touchmove",t,!1))):(i.style.overflowY="hidden",ios()&&(i.style.webkitOverflowScrolling="auto",attach(i,"touchmove",t,!1)))}}(),Placement.prototype._flash=function(){var t=this.getContainer().ownerDocument,e=this.createElement("div");e.style.cssText="position:absolute;top:0;left:0;width:100%;height:100%;opacity:0.01;background:black;",t.body.appendChild(e),defer(function(){e.parentNode.removeChild(e)})};;
function IframePlacement(t,e,n,r){Placement.apply(this,arguments),this.frame=null,this.vm=null,this.unitScript=e,this.windowVarsByRef=n,this.windowVarsByCopy=r,this._syncInterval=null,this._syncIframeSize=this._syncIframeSize.bind(this)}inherit(IframePlacement,Placement),IframePlacement.create=function(t,e,n,r){var i=new IframePlacement(e,"",n,r);return i.root=t.parentNode,i.root.style.display="none",i.startSyncingIframeSize(),i.frame=t,i.setupFrame(),i},IframePlacement.baseHTML='',IframePlacement.prototype.setSize=function(){IframePlacement.uber.setSize.apply(this,arguments),this._syncIframeSize()},IframePlacement.prototype.show=function(){IframePlacement.uber.show.apply(this,arguments),this._syncIframeSize()},IframePlacement.prototype._syncIframeSize=function(){this._visible&&this.vm&&(this.root.offsetWidth!=this.vm.width||this.root.offsetHeight!=this.vm.height)&&this.vm.setSize(0|this.root.offsetWidth,0|this.root.offsetHeight)},IframePlacement.prototype.startSyncingIframeSize=function(){this._syncInterval=this._setInterval(this._syncIframeSize,100)},IframePlacement.prototype.stopSyncingIframeSize=function(){this._syncInterval&&this._clearInterval(this._syncInterval),this._syncInterval=null},IframePlacement.prototype.getContainer=function(){if(!this.root)throw new Error("Root node not attached to document yet!");return this.querySelector("#viewport")},IframePlacement.prototype._setInterval=function(t,e){return this.windowVarsByRef.adapter.getTopWindow().setInterval(t,e)},IframePlacement.prototype._clearInterval=function(t,e){return this.windowVarsByRef.adapter.getTopWindow().clearInterval(t,e)},IframePlacement.prototype.attachTo=function(t,e){this.root=t.ownerDocument.createElement("div"),this.root.style.overflow="hidden",this.hide(),t.appendChild(this.root),this.startSyncingIframeSize(),this.frame=t.ownerDocument.createElement("iframe"),this.frame.style.border="0px",this.frame.setAttribute("frameborder","0"),this.frame.setAttribute("scrolling","no"),this.frame.setAttribute("allowFullScreen",""),this.root.appendChild(this.frame),defer(function(){if(!this.frame.contentWindow)throw new Error("Can't access contentWindow of an iframe, skip placement initialization.");this.frame.contentDocument.open();for(var t in this.windowVarsByRef)this.frame.contentWindow[t]=this.windowVarsByRef[t];var n="";for(var t in this.windowVarsByCopy)n+="window."+t+" = "+JSON.stringify(this.windowVarsByCopy[t])+";\n";this.frame.contentDocument.write(IframePlacement.baseHTML);var r=this.frame.contentDocument.createElement("script");r.textContent=n+";\n"+this.unitScript,this.frame.contentDocument.body.appendChild(r),attach(this.frame,"load",function(){this.setupFrame(),e&&defer(e,void 0,void 0,useAsap())}.bind(this)),this.frame.contentDocument.close()}.bind(this),void 0,void 0,useAsap())},IframePlacement.prototype.destroy=function(){this.stopSyncingIframeSize(),IframePlacement.uber.destroy.apply(this,arguments)},IframePlacement.prototype.createElement=function(t){return this.frame.contentDocument.createElement(t)},IframePlacement.prototype.querySelector=function(t){return this.frame.contentDocument?this.frame.contentDocument.querySelector(t):null},IframePlacement.prototype.querySelectorAll=function(t){return this.frame.contentDocument?this.frame.contentDocument.querySelectorAll(t):[]},IframePlacement.prototype._getViewportElement=function(){return this.querySelector("#viewport")},IframePlacement.prototype.setupFrame=function(){var t=this.frame.contentDocument.createElement("script");t.textContent="window.touchEventSimulator = new TouchEventSimulator(document);window.touchEventSimulator.init();function __parseJSON(s){return JSON.parse(s);}",this.frame.contentDocument.querySelector("head").appendChild(t),this.touchEventSimulator=this.frame.contentWindow.touchEventSimulator,this.vm=new ViewportManager({container:this._getViewportElement()})};;
function DivPlacement(){Placement.apply(this,arguments)}inherit(DivPlacement,Placement),DivPlacement.prototype.attachTo=function(t,e){this.root=t.ownerDocument.createElement("div"),this.root.style.overflow="hidden",this.hide(),t.appendChild(this.root),this.touchEventSimulator=new TouchEventSimulator(this.root),this.touchEventSimulator.init(),e&&defer(e,0,"DivPlacement.attachTo defer callback",useAsap())},DivPlacement.prototype.destroy=function(){DivPlacement.uber.destroy.apply(this,arguments),this.touchEventSimulator.stop(),this.touchEventSimulator=null},DivPlacement.prototype.getContainer=function(){return this.root},DivPlacement.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)},DivPlacement.prototype.querySelector=function(t){return this.root.querySelector(t)},DivPlacement.prototype.querySelectorAll=function(t){return this.root.querySelectorAll(t)},DivPlacement.prototype._getViewportElement=function(){return this.root};;
function StickyPlacement(t,i,e,s,o){IframePlacement.apply(this,arguments),this.stickyOptions=o,this._handleDismissTouchEnd=this._handleDismissTouchEnd.bind(this),this.origin.horizontal="center",this.origin.vertical=this.stickyOptions.stickiness,this.usesFixedPositioning=!0,this._originalDocumentPadding=null}inherit(StickyPlacement,IframePlacement),StickyPlacement.create=function(t,i,e,s,o){var n=new StickyPlacement(i,"",e,s,o);return n.root=t.parentNode,n.root.style.display="none",n.startSyncingIframeSize(),n.frame=t,n.setupFrame(),n},StickyPlacement.prototype.setPosition=StickyPlacement.prototype.setZIndex=noop,StickyPlacement.prototype.show=function(){IframePlacement.prototype.show.apply(this,arguments),IframePlacement.prototype.setZIndex.call(this,-20),this.enableDocumentPadding(),this.update()},StickyPlacement.prototype.hide=function(){IframePlacement.prototype.hide.apply(this,arguments),this.disableDocumentPadding()},StickyPlacement.prototype.attachTo=function(){StickyPlacement.uber.attachTo.apply(this,arguments),addClass(this.root,"celtra-placement-sticky")},StickyPlacement.prototype.populate=function(){this.stickyOptions.showDismissButton&&this.once("populated",this.createDismissButton.bind(this)),IframePlacement.prototype.populate.apply(this,arguments)},StickyPlacement.prototype.update=function(t,i){this.root&&this.root.parentNode&&(IframePlacement.prototype.setSize.call(this,this.width.value+this.width.unit,this.height.value+this.height.unit,!0),IframePlacement.prototype.setPosition.call(this,0,0,!0,i),defer(t))},StickyPlacement.prototype.createDismissButton=function(){this.getViewportGeometry();with(this.root.style.overflow="visible",this._dismissButton=this.root.ownerDocument.createElement("img"),this._dismissButton.src=this.stickyOptions.baseUrl+"runner/clazzes/CreativeUnit/close-up.svg",this._dismissButton.style)switch(position="absolute",left="auto",right="6px",width="32px",height="32px",zIndex=10,this.stickyOptions.stickiness){case"top":top="auto",bottom="-16px";break;case"bottom":top="-16px",bottom="auto"}deviceInfo.deviceType.mobileDevice()?attach(this._dismissButton,"touchend",this._handleDismissTouchEnd,!1):attach(this._dismissButton,"click",this._handleDismissTouchEnd,!1),this.root.appendChild(this._dismissButton)},StickyPlacement.prototype._handleDismissTouchEnd=function(t){t.preventDefault(),t.stopPropagation(),this.disableDocumentPadding(),(this.stickyOptions.dismissCallback||noop)()},StickyPlacement.prototype.enableDocumentPadding=function(){var t=this.getRootWindow(),i=t.document.documentElement;this._originalDocumentPadding||(this._originalDocumentPadding=t.getComputedStyle(i)["padding-"+this.stickyOptions.stickiness]),i.style["padding-"+this.stickyOptions.stickiness]=this.root.offsetHeight+"px"},StickyPlacement.prototype.disableDocumentPadding=function(){var t=this.getRootWindow(),i=t.document.documentElement;i.style["padding-"+this.stickyOptions.stickiness]=this._originalDocumentPadding,this._originalDocumentPadding=null},StickyPlacement.prototype.hideStickyCloseButton=function(){this._dismissButton.style.display="none"},StickyPlacement.prototype.showStickyCloseButton=function(){this._dismissButton.style.display="block"};;
function Format(e,t){if(this.adapter=e,this.state=null,this.units=t,this.observesViewability=!0,this.observingViewability=function(e){return this.observesViewability&&this.adapter.viewabilityMeasurable["viewable"+e]}.bind(this),this._observesViewableTime=!1,this.observingViewableTime=this.observingViewableTime.bind(this),this.observationAbilities={observingViewability:this.observingViewability,observingViewableTime:this.observingViewableTime},this._allowNonNativeRAFForViewableTime="1"==this.adapter.runtimeParams._allowNonNativeRAFForViewableTime,this.adapter.nesting&&this.adapter.nesting.hostileIframe&&this.needsAccessToHostPage()&&trackingCenter.track({name:"userError",userErrorId:"nonFriendlyIFrame"}),this.adapter.usedByStandalonePreview&&this.adapter.on("applyShareableState",this._applyShareableState.bind(this)),this.adapter.runtimeParams.massProductionPreview){extend(Format.prototype,TraversableUnitsTrait),this.adapter.on("resizeVariants",function(e){var t=this.placements.banner.creative.units.banner;t&&t.variants&&this.goToObject(e.goToObjectLocalId,function(){e.variants.forEach(function(e){var i=t.variants.filter(function(t){return t.localId===e.localId});if(1===i.length||i[0].parentUnit.currentVariant.localId===e.localId){var a=i[0];a.setLayoutSize(e.width,e.height),a.parentUnit.preventUVUpdate=!0,a.updateSizeAndPosition(),this.placements.banner.setSize(e.width,e.height)}}.bind(this))}.bind(this))}.bind(this));var i=function(){var e=function(e){return"undefined"!=typeof e};return Object.keys(this.placements).map(function(e){return this.placements[e].creative}.bind(this)).filter(e)}.bind(this);this.adapter.on("setValue",function(e){i().forEach(function(t){if(t.setValue(e.objectLocalId,e.property,e.value),"undefined"!=typeof e.goToObjectLocalId){var i=t.findByLocalId(e.goToObjectLocalId);this.goToObject(i)}}.bind(this))}.bind(this)),this.adapter.on("goToObject",function(e){i().forEach(function(t){var i=t.findByLocalId(e.objectLocalId);this.goToObject(i)}.bind(this))}.bind(this))}}extend(Format.prototype,EventEmitter),Object.defineProperty(Format.prototype,"placements",{get:function(){return this.adapter.placements},enumerable:!0}),Format.prototype.observingViewableTime=function(){var e=this.adapter;return this._observesViewableTime&&!!this.observingViewability("00")&&e.raf.environment&&(e.raf.isNative||this._allowNonNativeRAFForViewableTime)&&(e.supportsContainerViewability||e.canMeasureViewportPlacementGeometry)},Format.prototype.transitionTo=function(){throw new Error("transitionTo not implemented")},Format.prototype.destroy=function(){for(var e in this.placements)this.adapter.destroyPlacement(e),delete this.placements[e];this.adapter._stopObservingEnvironment(),this.adViewableTimeObserver&&this.adViewableTimeObserver.stop()},Format.prototype.hacks={},Format.prototype._attachInViewToOrderedPlacements=function(e,t,i){var a=i?i:t;e._outerPlacement=a,this.adapter.canMeasureViewportPlacementGeometry&&(a.inView||(a.inView=new PlacementInView(this.adapter,a)),i&&!t.inView&&(t.inView=new PlacementInView(this.adapter,t,i.inView)),e.inView||(e.inView=new InViewObject(e,t.inView)))},Format.prototype.connectPlacementEventsToUnitBehavior=function(e,t){this.adapter.on("orientationchange",function(){e.update(noop,this.adapter.adBehavior.crossScreenSticky)}.bind(this)),e.on("resized",function(){if(e._visible){var i=e.getPlacementGeometry();i.width<2&&i.height<2||t.setAvailableSize(i.width,i.height)}}),this.adapter.runtimeParams.massProductionPreview&&t.on("loaded",function(){this.adapter.sendUnitLoaded()}),e.on("shown",function(){var i=e.getPlacementGeometry();t.setAvailableSize(i.width,i.height),t.enterRenderTree()}),e.on("hidden",function(){t.exitRenderTree()}),this.adapter.usedByStandalonePreview&&(t.on("shareableStateChanged",this.sendShareableStateToPreview.bind(this,t)),e.on("shown",this.sendShareableStateToPreview.bind(this,t)))},Format.prototype._trackViewportPlacementGeometry=function(e){function t(e){var t=e.document.documentElement;return{width:e.innerWidth,height:e.innerHeight,left:e.scrollX||t&&t.scrollLeft||0,top:e.scrollY||t&&t.scrollTop||0}}var i=this.adapter.getTopWindow(),a=e.getGlobalGeometry(i),n=t(i),r=CRect.adopt(a);r.left+=n.left,r.top+=n.top;var o={name:"viewportPlacementGeometry",pageDimensions:this.adapter.getPageDimensions(),viewportPositionRect:n,firstPlacementPositionRect:r};this.adapter.trackingCenter.trackNoLaterThan(o)},Format.prototype.setupViewableTimeObserver=function(){if(this._observesViewableTime="0"!==this.adapter.runtimeParams._trackViewableTime,this.observingViewableTime()){var e=this.adapter,t=new AdViewableTimeTracker(e.trackingCenter,e.raf.environment,e.getTopWindow());this.adViewableTimeObserver=e.canMeasureViewportPlacementGeometry?new AdViewableInViewObjectObserver(t):new AdViewableUnitObserver(t),this.adViewableTimeObserver.registerAdapter(e)}},Format.prototype.sendShareableStateToPreview=function(e){this.adapter.sendShareableStateToPreview(this._getShareableState(e))},Format.prototype._getShareableState=function(e){return{unit:e.getShareableState()}},Format.prototype._applyShareableState=function(){},Format.IGNORABLES=["INPUT","TEXTAREA","SELECT"],Format.isElementIgnorable=function(e){return Format.IGNORABLES.indexOf(e.tagName)>-1},Format.prototype.needsAccessToHostPage=function(){return!1},Format.prototype._goToUnit=function(e,t){var i=null;for(var a in this.units)if(this.units[a].localId==e&&(i=this.units[a]),i)break;t(i)};;
function UnitViewabilityObserver(e,t,i,r){this.adapter=e,this.win=e.getTopWindow(),this.placement=t,this.element=i,this._listeners=[],this._active=!1,this._currentViewability=null,this._inTimer={},this._ratio=0,this._samplingRect=new CRect,this._lastSamplingTimestamp=0,this._minSamplingTimeDelta=200,this._calc=this._calc.bind(this),this._useIntersectionObserver=!!r,this._asyncComputed={ratio:0,boundingClientRect:{bottom:0,height:0,left:0,right:0,top:0,width:0}}}UnitViewabilityObserver.samplingCount=100,UnitViewabilityObserver.minimumOpacity=.95,UnitViewabilityObserver.prototype._getUnitVisibleGeometry=function(){return this._useIntersectionObserver?this._getIntersectionObserverGeometry():this._getOldObserverGeometry()},UnitViewabilityObserver.prototype._getOldObserverGeometry=function(){var e=this.adapter.getPlacementRect(this.placement),t=this.adapter.getViewportRect(),i=CRect.adopt(this.placement.getContainer().getBoundingClientRect()),r=CRect.adopt(this.element.getBoundingClientRect()),n=r.intersect(i),s=r.map(i,e),a=n?n.map(i,e).intersect(t):null;return{globalUnitRect:s,intersect:a,ratio:a&&s.area>0?a.area/s.area:0}},UnitViewabilityObserver.prototype._getIntersectionObserverGeometry=function(){var e=0;if(this._asyncComputed.ratio>0)var t=this.adapter.getPlacementRect(this.placement),i=CRect.adopt(this.placement.getContainer().getBoundingClientRect()),r=this._asyncComputed.rect,n=new CRect(r.x,r.y,r.width,r.height),e=n.map(i,t);return{globalUnitRect:this._asyncComputed.boundingClientRect,intersect:e,ratio:this._asyncComputed.ratio}},UnitViewabilityObserver.prototype._handleIntersect=function(e){e.forEach(function(e){this._asyncComputed={ratio:e.intersectionRatio,rect:e.intersectionRect,boundingClientRect:e.boundingClientRect}}.bind(this))},UnitViewabilityObserver.prototype._intersectionObserverSetUp=function(){function e(e){for(var t=[],i=0;e>=i;i++){var r=i/e;t.push(r)}return t}var t=this.element,i=50,r={threshold:e(i)};this._useIntersectionObserver=new IntersectionObserver(this._handleIntersect.bind(this),r),this._useIntersectionObserver.observe(t)},UnitViewabilityObserver.prototype.computeUnitInteractableRatio=function(){if(!this.element.parentNode||!this.placement.root.parentNode)return 0;if(!this.adapter.containerIsViewable||!this.element.ownerDocument.defaultView)return 0;var e=this._getUnitVisibleGeometry(),t=(e.intersect,e.ratio);return this._ratio=t,this._ratio},UnitViewabilityObserver.prototype.addListener=function(e){this._listeners.push(e),this._start()},UnitViewabilityObserver.prototype.removeListener=function(e){this._listeners=this._listeners.filter(function(t){return t!==e}),0===this._listeners.length&&this.stop()},UnitViewabilityObserver.prototype._calc=function(e){if(this._active){var t=this._getUnitVisibleGeometry().globalUnitRect;this._currentViewability=this.computeUnitInteractableRatio(e),this._listeners.forEach(function(e){this._currentViewability!==e.previousViewability&&(e.previousViewability=this._currentViewability,e(this._currentViewability,t))},this)}},UnitViewabilityObserver.prototype._start=function(){this._active||(this._active=!0,this._useIntersectionObserver&&this._intersectionObserverSetUp(),this.adapter.on("containerViewableChange",this._calc),Ticker.frame(this._calc,"update"))},UnitViewabilityObserver.prototype.stop=function(){if(this._active){this._active=!1,this.adapter.off("containerViewableChange",this._calc),Ticker.removeFrame(this._calc,"update");for(var e in this._inTimer)this.win.clearTimeout(this._inTimer[e]);this._inTimer={},this._useIntersectionObserver&&this._useIntersectionObserver.unobserve(this.element)}},UnitViewabilityObserver.prototype.waitForViewable=function(e,t){var i=function(r,n){var s=UnitViewabilityObserver.selectCriterion(e,n),a=0==s.ratio?r>0:r>=s.ratio;if(a){var o=function(){this.removeListener(i),t(s)}.bind(this);"Core"==e?o():this._inTimer[e]||(this._inTimer[e]=this.win.setTimeout(o,s.time))}else this._inTimer[e]&&(this.win.clearTimeout(this._inTimer[e]),this._inTimer[e]=null)}.bind(this);return this.addListener(i),i},UnitViewabilityObserver.prototype.waitForViewableCore=function(e){return this.waitForViewable("Core",e)},UnitViewabilityObserver.prototype.waitForViewableIAB=function(e){return this.waitForViewable("IAB",e)},UnitViewabilityObserver.prototype.waitForVideoViewableIAB=function(e){return this.waitForViewable("IABvideo",e)},UnitViewabilityObserver.prototype.waitForVideoViewableFB=function(e){return this.waitForViewable("FBvideo",e)},UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT=242500,UnitViewabilityObserver.selectCriterion=function(e,t){switch(e){case"IAB":var i=t&&t.width*t.height>UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT;return i?this.criteria.IABlargeAd:this.criteria.IABsmallAd;case"Core":case"IABvideo":case"FBvideo":return this.criteria[e];default:throw new Error("Unknown viewability criterion.")}},UnitViewabilityObserver.criteria={Core:{name:"Core",ratio:0,time:0},IABsmallAd:{name:"50/1",ratio:.5,time:1e3},IABlargeAd:{name:"30/1",ratio:.3,time:1e3},IABvideo:{name:"50/2",ratio:.5,time:2e3},FBvideo:{name:"50/3",ratio:.5,time:3e3}};;
function PlacementInView(t,e,i){this._init(),this.adapter=t,this.placement=e,this.node=e.getContainer(),this.inViewParent=i,this.outerRectInView=CRect.ZERO,this._lastScrollTime=0,this._isTouchDown=!1,this._autoSwitchObserverRunningState=this._autoSwitchObserverRunningState.bind(this),this.destroy=this.destroy.bind(this),this._onScroll=this._onScroll.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this.hacks={wrongBoundingRectWhileScrolling:deviceInfo.os.ios()&&this.placement.isSticky},this.inViewParent||(this._tick=this._tick.bind(this),this._timestepInterval=200,this._lastRunTime=0,this.adapter.on("containerViewableChange",this._autoSwitchObserverRunningState)),e.on("destroyed",this.destroy),this._autoSwitchObserverRunningState(),e.on("shown",this._autoSwitchObserverRunningState),e.on("hidden",this._autoSwitchObserverRunningState),this.hacks.wrongBoundingRectWhileScrolling&&(this.adapter.getTopWindow().addEventListener("scroll",this._onScroll,!0),this.adapter.getTopWindow().addEventListener("touchstart",this._onTouchStart,!0),this.adapter.getTopWindow().addEventListener("touchend",this._onTouchEnd,!0))}inherit(PlacementInView,InViewObject),PlacementInView.prototype._onScroll=function(){this._lastScrollTime=Date.now()},PlacementInView.prototype._onTouchStart=function(){this._isTouchDown=!0},PlacementInView.prototype._onTouchEnd=function(){this._isTouchDown=!1},PlacementInView.prototype._autoSwitchObserverRunningState=function(){var t=this.placement.visible&&this.adapter.containerIsViewable;t&&!this.active?this.start():!t&&this.active&&(this.stop(),this.rectInView=CRect.ZERO,this.outerRectInView=CRect.ZERO,this.areaInView=0,this.emit("rectInViewChanged",this.rectInView),this.emit("outerRectInViewChanged",this.outerRectInView),Logger("InViewObject").debug(this.placement.constructor.name+", rectInViewChanged: "+this.rectInView.toString()),this.emit("areaInViewRatioChanged",this.areaInView),Logger("InViewObject").debug(this.placement.constructor.name+", areaInViewRatioChanged: "+this.areaInView))},PlacementInView.prototype.getNode=function(){return this.placement.getContainer()},PlacementInView.prototype.getOuterRectInView=function(){return this.outerRectInView},PlacementInView.prototype.getParentRect=function(){return this.inViewParent?this.inViewParent.getOuterRectInView():this.adapter.getViewportRect()},PlacementInView.prototype.computeRectInView=function(){if(!this.hacks.wrongBoundingRectWhileScrolling||!(Date.now()-this._lastScrollTime<100||this._isTouchDown)){var t=this.getNode(),e=this.adapter.getPlacementRect(this.placement),i=t?CRect.adopt(t.getBoundingClientRect()):CRect.ZERO,n=this.getParentRect(),o=this.adapter.getPlacementRect(this.placement),s=o.intersect(n),h=s.zero()?CRect.ZERO:s.map(e,i);this._computeMaxPossibleDimensions(o,this.getParentMaxPossDims()),this.rectInView.equals(h)||(this.rectInView=h,this.emit("rectInViewChanged",h),Logger("InViewObject").debug(this.placement.constructor.name+", rectInViewChanged: "+this.rectInView.toString())),this.outerRectInView.equals(s)||(this.outerRectInView=s,this.emit("outerRectInViewChanged",s),Logger("InViewObject").debug(this.placement.constructor.name+", placementRectInViewChanged: "+this.outerRectInView.toString()))}},PlacementInView.prototype.destroy=function(){this.hacks.wrongBoundingRectWhileScrolling&&(this.adapter.getTopWindow().removeEventListener("scroll",this._onScroll,!0),this.adapter.getTopWindow().removeEventListener("touchstart",this._onTouchStart,!0),this.adapter.getTopWindow().removeEventListener("touchend",this._onTouchEnd,!0)),this.stop(),this.adapter.off("containerViewableChange",this._autoSwitchObserverRunningState)},PlacementInView.prototype._start=function(){this.inViewParent?this.inViewParent.on("outerRectInViewChanged",this.computeRectInView):this.adapter.Ticker.frame(this._tick,"update")},PlacementInView.prototype._stop=function(){this.inViewParent?this.inViewParent.off("outerRectInViewChanged",this.computeRectInView):this.adapter.Ticker.removeFrame(this._tick,"update")},PlacementInView.prototype._tick=function(){var t=Date.now();t-this._lastRunTime>this._timestepInterval&&(this.computeRectInView(),this._lastRunTime=t)};;
function Tapper(t,e){function a(t){for(var e=t,a=null;1!=e.nodeType;)e=e.parentNode;for(;e&&1==e.nodeType&&e.tagName;){var n=e.tagName.toLowerCase();if(hasClass(e,"touchable")||"a"===n&&e.href||"button"===n||"img"===n||"input"===n&&e.type&&"button"===e.type.toLowerCase()){a=e;break}e=e.parentNode}return a}function n(t,e){var a=t.ownerDocument.createEvent("MouseEvents");a.initEvent("tap",!0,!0),e.dispatchEvent(a)}var c="undefined"!=typeof creative&&creative.adapter||adapter;e=e||c.useNativeClickForTapDetection,e&&(attach(t,"click",function(e){var c=a(e.target);c&&n(t,c)},!c.nativeClickEmittedOnSwipe),c.useNativeClickForTapDetection)||attach(t,"touchstart",function(o){var r=a(o.target);if(r){var i=!1;if(celtra.iframe()){var u=function(){var t=c.getTopWindow();return[t.scrollX,t.scrollY,t.innerWidth,t.innerHeight]},h=u();i=!0}var s=10,d=o.targetTouches[0].clientX-s,v=o.targetTouches[0].clientX+s,l=o.targetTouches[0].clientY-s,f=o.targetTouches[0].clientY+s;addClass(r,"touched");var p=!1,g=!1,m=!1,T=!1,C=new Date,w=function(t){if(!p&&!g){var e=t.targetTouches[0].clientX,a=t.targetTouches[0].clientY;p=i&&h.toString()!=u().toString(),g=!(e>=d&&v>=e&&a>=l&&f>=a),g||p?removeClass(r,"touched"):addClass(r,"touched")}},k=function(){if(!T&&(T=!0,detach(t,"touchmove",w,!1),detach(t,"touchend",arguments.callee,!1),hasClass(r,"touched"))){var a=200,c=new Date-C>a&&!deviceInfo.deviceType.desktop();if(removeClass(r,"touched"),g||p||m||c)return;e||n(t,r)}},y=function(){detach(t,"touchend",y,!0),nextFrame(function(){m=!0,k()})};attach(t,"touchcancel",function(t){removeClass(r,"touched"),k(t)},!1),attach(t,"touchmove",w,!1),attach(t,"touchend",k,!1),attach(t,"touchend",y,!0)}},!0)};
function BannerFormat(e){Format.apply(this,arguments),e.adBehavior.interstitial=!1,e.adBehavior.expandable=!1,this._tick=this._tick.bind(this),this.setup()}inherit(BannerFormat,Format),extend(BannerFormat.prototype,SingleUnitFormatShareableStateNavigation),BannerFormat.prototype.setup=function(){this.setupViewableTimeObserver();var e=new TaskScheduler;e.when("ready").run(function(){this.adapter.createPlacements({banner:{attachment:"inline",positioning:"static",type:"unit"}},function(){var t=this.placements.banner;this.populateBanner(t,function(){this.adViewableTimeObserver&&this.adViewableTimeObserver.registerUnit(t.creative.units.banner),e.notify("unitPopulated")}.bind(this))}.bind(this))}.bind(this)),e.when("unitPopulated").run(function(){var t=this.placements.banner,i=this.units.banner=t.creative.units.banner,a=!1;t.creative.trackCreativeLoaded(this.observationAbilities),this.adapter.triggerLoadedEvent(this.units.banner.node),this.adapter.setMinimumSize(this.units.banner.size.width,this.units.banner.size.height),t.show(),this.adapter.Ticker.frame(this._tick,"update"),i.updateRxState(t.root),this.adapter.canMeasureViewportPlacementGeometryRelativeToPage&&this._trackViewportPlacementGeometry(t),this.adapter.viewabilityMeasurable.viewable00?(a="1"==this.adapter.runtimeParams.immediateAppear,this.adapter.waitForViewableCore(t,i.node,function(i){t.creative.track({name:"viewable00",criterion:i}),this.adViewableTimeObserver&&this.adViewableTimeObserver.readyToShow(),a||e.notify("placementViewable")}.bind(this))):a=!0,a&&defer(e.notifies("placementViewable"),void 0,void 0,this.adapter.useAsap),this.adapter.viewabilityMeasurable.viewable501&&this.adapter.waitForViewableIAB(t,i.node,function(e){t.creative.track({name:"viewable501",criterion:e})})}.bind(this)),e.when("placementViewable").run(function(){e.pause(),this.adapter.on("stateChange",function(e){this.transitionTo(e)}.bind(this)),this.transitionTo("default")}.bind(this)),this.adapter.on("ready",e.notifies("ready"))},BannerFormat.prototype.populateBanner=function(e,t){var i=e.creative.units.banner,a="top"==this.adapter.runtimeParams.sticky||"bottom"==this.adapter.runtimeParams.sticky;i.swipeable=!0,i.firstAppearWithoutUserInteraction=!0,this.adapter.isRxAvailable&&i.createRxState(),a&&(e.isSticky=!0),this._attachInViewToOrderedPlacements(i,e),this.connectPlacementEventsToUnitBehavior(e,i);var n=i.getNode(function(){e.setMinimumSize(i.size.width,i.size.height),e.populate(n,t),a?e.setSize(i.size.width,i.size.height):e.setSize("100%","100%"),e.setPosition(0,0)}.bind(this))},BannerFormat.prototype.transitionTo=function(e,t,i){i||(i=noop);if("default"==e&&null===this.state)this.placements.banner.show(),this.units.banner.appear(),defer(i);else{if("dismissed"!=e||"default"!=this.state&&null!=this.state)throw new Error("Invalid state transition request! ("+this.state+" => "+e+")");this.destroy()}this.state=e},BannerFormat.prototype.destroy=function(){this.adapter.Ticker.removeFrame(this._tick,"update"),BannerFormat.uber.destroy.apply(this)},BannerFormat.prototype._tick=function(){return this.placements.banner.root.ownerDocument.defaultView?void(this.placements.banner._visible&&this.units.banner.updateRxState(this.placements.banner.root)):void this.destroy()};;
function SDKAdapter(e,t,i,n,r,o,a,s,d,p){function h(e){return this.experiments&&this.experiments.get&&this.experiments.get(e)}function c(e,t){return"1"===t||e&&"treatment"===e.chosenVariant&&"0"!==t}if(this.runtimeParams=e,this.trackingCenter=t,this.aggregatorTracking=i,this.experiments=n,this.useAsap=c(h("DeferWithAsap"),e._useAsap),this._renderBeforeDomReady=c(h("RenderBeforeDomReady"),e._renderImmediately),this.macros=a,this.perf=p,defer.perf=p,this.ampDetected=!1,this.ampNestingLevel="",this.safeFrameDetected=!1,this.scriptElement=script,this.domApi=this.scriptElement.parentNode.celtra={loaded:!1,viewabilityObservee:null},this.adapterWindow=window,this.tagWindow=this.scriptElement.ownerDocument.defaultView,this.nesting=getWindowNesting(this.tagWindow),this.tagElement=this.scriptElement.parentNode,this.hostElement=this.tagElement,this.storeOpenedOverrideUrls=o,this.urlOpenedOverrideUrls=r,this.urlOpenedUrlAppendage=s,this.clickThroughDestinationUrl=d,this.useNativeClickForTapDetection=!0,this.nativeClickEmittedOnSwipe=deviceInfo.deviceType.desktop()||deviceInfo.os.ios(),this.providesCloseButton=!1,this.enableCustomStateTransitions=!1,this.adBehavior={interstitial:!1,expandable:!1,expanded:!1,sticky:!1,crossScreenSticky:!1,attachInlinePlacementToViewport:!1,scrollable:!1},this.isRxAvailable=!1,this.viewabilityMeasurable={viewable00:!1,viewable501:!1},this.canMeasureViewportPlacementGeometry=!1,this.canMeasureViewportPlacementGeometryRelativeToPage=!1,this.canMeasureContainerAreaInViewRatio=!1,this.supportsContainerViewability=!1,this.supportsContainerInitialViewability=!1,this.useFSVP=!0,"undefined"!=typeof this.runtimeParams.topLayerZIndex){var l=parseInt(this.runtimeParams.topLayerZIndex,10);!isNaN(l)&&l>20&&(Placement.ZINDEX_MAX=Math.min(Placement.ZINDEX_MAX,l))}this.hacks={useResizeOnScroll:ios("9")},this._hooks={},this.placements={},this._handleResize=this._handleResize.bind(this),this._handleOrientationChange=this._handleOrientationChange.bind(this),this._handleViewportChange=this._handleViewportChange.bind(this),this._handleDetachedFromDocument=this._handleDetachedFromDocument.bind(this),this._updatePlacements=this._updatePlacements.bind(this),this.listenForExpandErrors=this.listenForExpandErrors.bind(this),this._keyboardShown=!1,this._initialInnerDims=null,this._onKeyboardShown=this._onKeyboardShown.bind(this),this._onKeyboardHidden=this._onKeyboardHidden.bind(this),this._resizeTimer=null,this._listening=!1,this._touchEventSimulator=null,this.hostContainerSize={width:"100%",height:"100%"},this.mediaState=new MediaState,this.nativeRAFIsSupported=["r","webkitR","mozR","msR"].some(function(e){return e+"equestAnimationFrame"in window}),this.visibilityApiIsSupported=["webkit","moz","ms",""].some(function(e){return(e?e+"Hidden":"hidden")in window.document});var u=function(e){e&&(this.trackingCenter.track({name:"containerBecameViewable"}),this.off("containerViewableChange",u))}.bind(this);defer(function(){var e=this.perf.start("Adapter.startObservingEnvironment");this._startObservingEnvironment(),e.end(),this.supportsContainerInitialViewability&&(this.containerIsViewable?this.trackingCenter.track({name:"containerBecameViewable"}):this.on("containerViewableChange",u))}.bind(this),0,"SDKAdapter defer _startObservingEnvironment",this.useAsap),this.on("containerViewableChange",this.trackingCenter.batchFlush),this.getTopWindow().document.addEventListener("unload",this.trackingCenter.batchFlush),this.getTopWindow().document.addEventListener("beforeunload",this.trackingCenter.batchFlush),this.getTopWindow().document.addEventListener("pagehide",this.trackingCenter.batchFlush),this.trackingCenter.startBatchFlushCycle(1e3),this.on("resize",this._updatePlacements),this._displayed=!1,this.on("displayed",function(){this._displayed=!0}.bind(this)),this.sdkReady=!1,this.canOpenUrlInSameWindow=!1,this._initRequestAnimationFrame(),this.once("domReady",this.perf.marks("Adapter.domReady")),this.once("documentReady",this.perf.marks("Adapter.documentReady")),this.once("sdkReady",this.perf.marks("Adapter.sdkReady")),this.once("ready",this.perf.marks("Adapter.ready")),defer(function(){var e=this.perf.start("Adapter.initSdk");this._initSdk(deferred(function(){e.end(),this.sdkReady=!0,this.emit("sdkReady")}.bind(this),0,"SDKAdapter defer sdkReady",this.useAsap))}.bind(this),0,"SDKAdapter defer _initSdk",this.useAsap),this.on("documentReady",function(){android("4.0")&&this.getTopWindow().setInterval(function(){for(var e in this.placements)this.placements[e]._flash()}.bind(this),250),this.runtimeParams._mraidCheck&&defer(function(){this.collectAndTrackData(function(e){var t={isMraid:"undefined"!=typeof this.tagWindow.mraid};e(t)}.bind(this),"mraidCheckEnvironmentInfo")}.bind(this),1e3)}.bind(this)),this.useFixedPositioningForInterstitial=!1}extend(SDKAdapter.prototype,EventEmitter),SDKAdapter.prototype.protoLoading={},Object.defineProperties(SDKAdapter.prototype.protoLoading,{dataURIsSupported:{get:function(){return!!runtimeParams.protoLoading&&"supported"===runtimeParams.protoLoading.dataLoadStatus},enumerable:!0},blobURIsSupported:{get:function(){return!!runtimeParams.protoLoading&&"supported"===runtimeParams.protoLoading.blobLoadStatus},enumerable:!0}}),Object.defineProperty(SDKAdapter.prototype,"__CELTRA",{get:function(){return this.getTopWindow().__CELTRA||(this.getTopWindow().__CELTRA={formats:[]}),this.getTopWindow().__CELTRA},enumerable:!0}),Object.defineProperty(SDKAdapter.prototype,"assumeScrollSupported",{get:function(){return!1}}),SDKAdapter.prototype._initRequestAnimationFrame=function(){var e=this.getTopWindow();this.raf=new RequestAnimationFrameWrapper(e),this.Ticker=new CTicker(this.raf,e),this.nextFrame=this.Ticker.raf.nextFrame,this.cancelFrame=this.Ticker.raf.cancelFrame,window.nextFrame=this.Ticker.raf.nextFrame,window.cancelFrame=this.Ticker.raf.cancelFrame,window.Ticker=this.Ticker},SDKAdapter.prototype._startObservingEnvironment=function(){function e(e){return"$sf"in e&&e.$sf.ext}function t(e){return e.context&&"undefined"!=typeof e.context.pageViewId}if(!this._listening){try{for(var i=this.tagWindow,n=0;i;){if(t(i)){this.ampDetected=!0,this.ampNestingLevel=n;break}if(e(i)){this.safeFrameDetected=!0;break}if(i==i.parent)break;i=i.parent,n++}}catch(r){}this.resizeListener=this._createViewportListener(),this.resizeListener.start(this._handleResize,this._handleViewportChange);var o=this._createOrientationObserver(function(e){this.orientationObserver=e,this.orientationObserver.start(),Object.defineProperty(this,"orientation",{get:function(){return this.orientationObserver.getOrientation()}.bind(this),configurable:!0})}.bind(this));if(o&&(this.orientationObserver=o,this.orientationObserver.start(),Object.defineProperty(this,"orientation",{get:function(){return this.orientationObserver.getOrientation()}.bind(this),configurable:!0})),this.containerViewabilityObserver=this._createContainerViewabilityObserver(),this.containerViewabilityObserver.start(),Object.defineProperty(this,"containerIsViewable",{get:function(){return this.containerViewabilityObserver.isViewable}.bind(this),configurable:!0}),this.documentAttachmentObserver=this._createDocumentAttachmentObserver(),this.documentAttachmentObserver.start(this._handleDetachedFromDocument),this.on("domReady",function(){this._initDocument(deferred(this.emits("documentReady"),0,"SDKAdapter._startObservingEnvironment deferred documentReady",this.useAsap))}.bind(this)),this.once("sdkReady",function(){this.collectAndTrackData(function(e){var t=this.tagElement.parentNode,i={width:this.getTopWindow().innerWidth,height:this.getTopWindow().innerHeight},n={width:this.tagWindow.innerWidth,height:this.tagWindow.innerHeight},r={scope:"global",userAgent:this.getTopWindow().navigator.userAgent,orientation:this.orientation,topmostReachableWindow:i,hostWindow:n,nesting:this.nesting,pageVisibilityApi:this.visibilityApiIsSupported,requestAnimationFrame:this.nativeRAFIsSupported,topWindowNativeRAFSupported:this.raf.isNative,allowNonNativeRAFForViewableTimeUsed:"1"==runtimeParams._allowNonNativeRAFForViewableTime,clientTimeZoneOffsetInMinutes:(new Date).getTimezoneOffset(),supportsContainerViewability:this.supportsContainerViewability,supportsContainerInitialViewability:this.supportsContainerInitialViewability,tagParentWidth:t?t.clientWidth:"",tagParentHeight:t?t.clientHeight:"",ampDetected:this.ampDetected,ampNestingLevel:this.ampNestingLevel,safeFrameDetected:this.safeFrameDetected,fetchSupported:isFetchSupported(),asapEnabled:this.useAsap,nativePromisesSupported:isNativeImplementation(window.Promise),beaconSupported:isBeaconSupported(),IntersectionObserverSupported:"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype,isMutationObserverSupported:isNativeImplementation(window.MutationObserver),webView:deviceInfo.browser.webView()};if(runtimeParams.universalTagSignals&&(r.universalTagSignals=runtimeParams.universalTagSignals),runtimeParams.protoLoading&&(r.protoLoading=runtimeParams.protoLoading),(!this.nesting.iframe||this.nesting.friendlyIframe)&&(r.topWindowLocation=this.getTopWindow().location.href,"undefined"!=typeof r.topWindowLocation)){r.topWindowLocationLength=r.topWindowLocation.length;var o=200;r.topWindowLocationLength>o&&(r.topWindowLocation=r.topWindowLocation.slice(0,o)+"...")}e(r)}.bind(this),"environmentInfo")}.bind(this)),this._renderBeforeDomReady)this.emit("domReady");else{var a=!1;this._waitForDomReady(function(){a||(this.emit("domReady"),a=!0)}.bind(this))}this._listening=!0}},SDKAdapter.prototype._initSdk=function(e){e()},SDKAdapter.prototype._initDocument=function(e){e()},SDKAdapter.prototype._onKeyboardShown=function(){this._keyboardShown=!0},SDKAdapter.prototype._onKeyboardHidden=function(){this._keyboardShown=!1,defer(this._updatePlacements)},SDKAdapter.prototype._createViewportListener=function(){var e=this,t={_resizeCallback:null,_viewportChangeCallback:null,start:function(t,i){var n=e.getTopWindow();this._resizeCallback=t,this._viewportChangeCallback=i,n.addEventListener("resize",this._resizeHandler,!1),n.addEventListener("scroll",this._scrollHandler,!1),ios()&&(n.addEventListener("focus",this._focusHandler,!0),n.addEventListener("blur",this._blurHandler,!0))},stop:function(){var t=e.getTopWindow();t.removeEventListener("resize",this._resizeHandler,!1),t.removeEventListener("scroll",this._scrollHandler,!1),ios()&&(t.removeEventListener("focus",this._focusHandler,!0),t.removeEventListener("blur",this._blurHandler,!0))}};return t._resizeHandler=function(){e.hacks.useResizeOnScroll&&(t.numTimesScrollTriggeredAfterResize=0),"undefined"!=typeof window?(this._resizeCallback(),this._viewportChangeCallback(),"undefined"!=typeof window.admarvelSDKVersion&&defer(this._resizeCallback.bind(this),200)):e.dismiss()}.bind(t),t._scrollHandler=function(){"undefined"!=typeof window?(e.hacks.useResizeOnScroll&&void 0!==t.numTimesScrollTriggeredAfterResize&&(t.numTimesScrollTriggeredAfterResize++,t.numTimesScrollTriggeredAfterResize<=2&&this._resizeCallback()),this._viewportChangeCallback()):e.dismiss()}.bind(t),t._focusHandler=function(t){["INPUT","TEXTAREA"].indexOf(t.target.nodeName)>-1&&(e._keyboardShown=!0)},t._blurHandler=function(){e._keyboardShown=!1;var i=ios("9",null)?100:0;defer(function(){e._keyboardShown||(t._resizeCallback(),t._viewportChangeCallback())},i)},t},SDKAdapter.prototype._createOrientationObserver=function(){var e=this,t=this.getTopWindow(),i={_orientationChangeEventQueued:!1,start:function(){t.addEventListener("orientationchange",this._handler,!1)},stop:function(){t.removeEventListener("orientationchange",this._handler,!1)},getOrientation:function(){return e._normalizeOrientation(t.orientation)||0},_handler:function(){"undefined"!=typeof window?(e.emit("_rawOrientationChange"),i._orientationChangeEventQueued=!0,e.once("resize",i._trigger),setTimeout(i._trigger,1e3)):e.dismiss()},_trigger:function(){i._orientationChangeEventQueued&&(i._orientationChangeEventQueued=!1,defer(e.emits("orientationchange")))}};return i},SDKAdapter.prototype._createContainerViewabilityObserver=function(){var e=this;return{isViewable:!1,start:function(){defer(function(){this.isViewable=!0,e.emit("containerViewableChange",this.isViewable)}.bind(this),void 0,void 0,this.useAsap)},stop:function(){}}},SDKAdapter.prototype.triggerLoadedEvent=function(e){this.domApi.loaded=!0,this.domApi.viewabilityObservee=e,this._dispatchCeltraLoadedEvent(this.tagElement)},SDKAdapter.prototype.triggerClosedEvent=function(){this._dispatchCeltraClosedEvent(this.tagElement)},SDKAdapter.prototype._dispatchCeltraLoadedEvent=function(e){var t=e.ownerDocument.createEvent("HTMLEvents");t.initEvent("celtraLoaded",!0,!1),e.dispatchEvent(t)},SDKAdapter.prototype._dispatchCeltraClosedEvent=function(e){var t=e.ownerDocument.createEvent("HTMLEvents");t.initEvent("celtraClosed",!0,!1),e.dispatchEvent(t)},SDKAdapter.prototype.waitForDisplayed=function(e){return this._displayed?defer(e):void this.once("displayed",e)},SDKAdapter.prototype.waitForContainerViewable=function(e){if(this.containerIsViewable)return defer(e,void 0,void 0,this.useAsap);var t=function(i){i&&(this.off(t),defer(e,void 0,void 0,this.useAsap))}.bind(this);this.on("containerViewableChange",t)},SDKAdapter.prototype._createDocumentAttachmentObserver=function(){var e=this,t=e.tagElement,i=e.getTopWindow(),n=new i.Function("f","return function() { f(); };"),r={_detachmentHandler:null,_interval:60,_timer:null,start:function(t){this._detachmentHandler=t,this._timer=i.setTimeout(this.wrappedTimerTick,this._interval),e.Ticker.frame(this.rafTick,"update")},stop:function(){i.clearTimeout(this._timer),this._timer=null,e.Ticker.removeFrame(this.rafTick,"update")},timerTick:function(){this.isDetached()?this._detachmentHandler():this._timer=i.setTimeout(this.wrappedTimerTick,this._interval)},rafTick:function(){this.isDetached()&&this._detachmentHandler()},isDetached:function(){if(t.parentNode&&t.ownerDocument.defaultView&&window&&window.document){for(var e=t;(e=e.parentNode)&&e&&e!==e.ownerDocument.documentElement;);return e?!1:(this._timer=null,!0)}return!0}};return r.timerTick=r.timerTick.bind(r),r.rafTick=r.rafTick.bind(r),r.wrappedTimerTick=n(r.timerTick),r},SDKAdapter.prototype._normalizeOrientation=function(e){var t=this.getTopWindow().navigator.userAgent,i=["Nexus 10","GT-N8","SM-P60","GT-P5","SCH-19","GT-P7","SM-T9","SM-T8"];return i.some(function(e){return-1!=t.indexOf(e)})&&(e+=90,270==e&&(e=-90)),e},SDKAdapter.prototype._waitForDomReady=function(e){var t=this.getTopWindow().document;"interactive"===t.readyState||"loaded"===t.readyState||"complete"===t.readyState?defer(e,0,"SDKAdapter._waitForDomReady defer cb",this.useAsap):t.addEventListener("DOMContentLoaded",e,!1)},SDKAdapter.prototype.waitForWindowLoad=function(e){var t=this.getTopWindow(),i=30,n=!1,r=function(){n||(n=!0,e())};"complete"===t.document.readyState?defer(e,0,"SDKAdapter.waitForWindowLoad readyState === complete cb",this.useAsap):(t.setTimeout(r,1e3*i),t.addEventListener("load",r,!1))},SDKAdapter.prototype._stopObservingEnvironment=function(){this._listening&&(this.resizeListener.stop(this._handleResize),this.orientationObserver.stop(),this.documentAttachmentObserver.stop(),this._listening=!1)},SDKAdapter.prototype.setMinimumSize=function(){},SDKAdapter.prototype._handleResize=function(){var e=!1;this.emit("beforeResize",function(t){e=t}),e?defer(function(){this.emit("resize")}.bind(this),700):this.emit("resize")},SDKAdapter.prototype._handleViewportChange=function(){this.emit("viewportChange")},SDKAdapter.prototype._handleOrientationChange=function(e){this.emit("orientationchange",e)},SDKAdapter.prototype._handleDetachedFromDocument=function(){this.dismiss()},SDKAdapter.prototype._updatePlacements=function(e){function t(){--i||(e&&e(),defer(n.emits("placementsUpdated"),void 0,void 0,this.useAsap))}if(e=e||noop,this._keyboardShown)return e();var i=0,n=this;for(var r in this.placements)i++,"undefined"!=typeof window&&this.placements[r].update(t,this.adBehavior.crossScreenSticky)},SDKAdapter.prototype._stopAllMedia=function(e){this._stopMediaTagsInPlacements(),this.emit("mediaStopRequested",e)},SDKAdapter.prototype._stopMediaTagsInPlacements=function(){for(var e in this.placements)for(var t=this.placements[e].querySelectorAll("audio,video"),i=0;it.height?"landscape":e():e()},SDKAdapter.prototype.collectAndTrackData=function(e,t){function i(){try{e(function(e){e.name=t,this.trackingCenter.trackNoLaterThan(e,n)}.bind(this))}catch(i){this.trackingCenter.trackNoLaterThan({name:t,error:i.message+"\n"+i.stack},n)}}if("function"!=typeof e)throw new Error("The dataCollector param was not a function.");if("undefined"==typeof t)throw new Error("The eventName param was not defined.");var n=1e3;defer(i.bind(this),void 0,void 0,this.useAsap)},SDKAdapter.prototype._createViewportElement=function(){var e=document.createElement("div");return e.id="viewport",e.style.cssText="position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible;",this.tagWindow.document.body.appendChild(e),e},SDKAdapter.prototype._getViewportElement=function(){return this.viewport},SDKAdapter.prototype.listenForExpandErrors=function(){},SDKAdapter.prototype.enableScroll=function(){},SDKAdapter.prototype.disableScroll=function(){};;
function BrowserAdapter(){BrowserAdapter.uberConstructor.apply(this,arguments),this.isSingleOccupant=!1,this.hasDeadZones=ios("7"),this.isRxAvailable=!0,this.canOpenUrlInSameWindow=!0,this.on("ready",function(){this._setupMouseLeaveObserver(),this._createCommunicationChannelWithPreview(),defer(this.emits("displayed"),void 0,"BrowserAdapter emits displayed on ready",this.useAsap)}.bind(this)),this.usedByStandalonePreview=1==this.runtimeParams.standalonePreview}inherit(BrowserAdapter,SDKAdapter),Object.defineProperty(BrowserAdapter.prototype,"assumeScrollSupported",{get:function(){var e=this.getTopWindow().document.body.scrollHeight>this.getTopWindow().innerHeight;return e&&!this.nesting.hostileIframe}}),BrowserAdapter.prototype._setupMouseLeaveObserver=function(){if(!deviceInfo.deviceType.desktop()){var e=this.getTopWindow();"ontouchstart"in e||navigator.msMaxTouchPoints||attach(e.document,"mouseout",function(t){t=t?t:e.event;var i=e.document.documentElement,n=Math.max(i.clientWidth,e.innerWidth||0),r=Math.max(i.clientHeight,e.innerHeight||0),o=t.clientX||t.pageX,s=t.clientY||t.pageY,a=1>o,p=o>n-1,d=1>s,l=s>r-1;t.toElement&&"HTML"!==t.toElement.tagName||!(a||p||d||l)||Object.keys(this.placements).forEach(function(e){this.placements[e].touchEventSimulator&&this.placements[e].touchEventSimulator.cancelInteraction()},this)}.bind(this),!1)}},BrowserAdapter.prototype._enableClickShield=function(){function e(e){e.preventDefault(),e.stopPropagation(),i()}function t(){a&&(new Date-d>n?i():o.requestAnimationFrame(t))}function i(){a&&a.parentNode&&(a.removeEventListener("click",e,!0),a.parentNode.removeChild(a),a=null)}var n=500,r=Math.round(1e4*Math.random()),o=this.getTopWindow(),s=o.document,a=(o.document.documentElement,s.createElement("div")),p=s.createElement("script"),d=new Date;a.id="celtra-click-shield-"+r,a.style.position="absolute",a.style.left=a.style.top=0,a.style.width="100%",a.style.height="100%",a.style.background="none",a.style.zIndex=Placement.ZINDEX_MAX,a.style.webkitTapHighlightColor="rgba(0,0,0,0)",a.addEventListener("click",e,!0),s.body.appendChild(a),p.type="text/javascript";var l="window.setTimeout(function() { var shield = document.getElementById('"+a.id+"'); if (shield) { shield.parentNode.removeChild(shield); }}, "+n+");";try{p.appendChild(s.createTextNode(l))}catch(c){p.text=l}a.appendChild(p),o.requestAnimationFrame(t),defer(i,n)},BrowserAdapter.prototype._createContainerViewabilityObserver=function(){var e=this,t=this.getTopWindow().document,i={isSupported:!1,propertyName:"",eventName:"",isVisible:function(){return this.isSupported?!t[this.propertyName]:!0},init:function(){["webkit","moz","ms",""].forEach(function(e){var i=e?e+"Hidden":"hidden";i in t&&(this.isSupported=!0,this.propertyName=i,this.eventName=e+"visibilitychange")},this)}};i.init();var n=this.useAsap,r={isViewable:!1,start:function(){i.isVisible()&&defer(o,void 0,"BrowserAdapter observer start",n),i.isSupported&&t.addEventListener(i.eventName,o)},stop:function(){i.isSupported&&t.removeEventListener(i.eventName,o)}},o=function(){var t=this.isViewable;this.isViewable=i.isVisible(),t!=this.isViewable&&e.emit("containerViewableChange",this.isViewable)}.bind(r);return r},BrowserAdapter.prototype._downsizePlacements=function(){for(var e in this.placements)"screen"!==this.placements[e].positioning||this.placements[e].preventDownsizeHack||this.placements[e].setSize(1,1,!0)},BrowserAdapter.prototype._getUnitViewabilityObserver=function(e,t){var i=-1!==["newGeometryWithSampling","newGeometryWithoutSampling"].indexOf(this.experiments.get("UseNewUnitViewabilityLogic")&&this.experiments.get("UseNewUnitViewabilityLogic").chosenVariant),n="IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype,r=i&&n;return this._unitViewabilityObserver||(this._unitViewabilityObserver=new UnitViewabilityObserver(this,e,t,r)),this._unitViewabilityObserver},BrowserAdapter.prototype.waitForViewableCore=function(e,t,i){return this._getUnitViewabilityObserver(e,t).waitForViewableCore(i)},BrowserAdapter.prototype.waitForViewableIAB=function(e,t,i){return this._getUnitViewabilityObserver(e,t).waitForViewableIAB(i)},BrowserAdapter.prototype.removeViewabilityListener=function(e,t,i){this._getUnitViewabilityObserver(e,t).removeListener(i)},BrowserAdapter.prototype._disableScrollHandler=function(e){-1==["INPUT","TEXTAREA","SELECT"].indexOf(e.target.tagName)&&e.preventDefault()};;
function MobileWebAdapter(e,t,i){if(MobileWebAdapter.uberConstructor.apply(this,arguments),this.isInlineWebPlacement=!(this.isSingleOccupant||this.nesting.hostileIframe||this.nesting.friendlyIframe&&!this.nesting.iabFriendlyIframe),this.muteSoundIfVideoStartedOnTouchStartEvent=android(),this.unitScript=unitScript,this.requiredDeviceType=requiredDeviceType,this.trackingCenter=t,this.aggregatorTracking=i,this.__CELTRA.stickyPresent&&this.runtimeParams.sticky)return t.track({name:"userError",userErrorId:"multipleStickyAds"}),defer(this.dismiss.bind(this));if(this.runtimeParams.sticky&&(this.__CELTRA.stickyPresent=!0),this.hacks.needsConstantFlashing=kindleSilk("1")||/\bHTC.One.S\b/.test(navigator.userAgent),this.hacks.requiresHidingInputsAndLinks=android()&&(/HTC/g.test(navigator.userAgent)||"hiding"==this.runtimeParams.focusableHighlightFix),this.hacks.fixFocusablesHighlighting=android("4.0"),this.hacks.requiresWrappingPlacementWithComments=windows("10"),this.providesCloseButton=!1,this.enableCustomStateTransitions=!(/Windowshop/.test(navigator.userAgent)&&kindle()),(!this.nesting.iframe||this.nesting.iabFriendlyIframe)&&(this.viewabilityMeasurable={viewable00:!0,viewable501:this.visibilityApiIsSupported},this.canMeasureViewportPlacementGeometry=!0,this.supportsContainerViewability=!0,this.supportsContainerInitialViewability=!0),this.nesting.iframe&&!this.nesting.iabFriendlyIframe||this.runtimeParams.sticky||(this.canMeasureViewportPlacementGeometryRelativeToPage=!0),this.nesting.iabFriendlyIframe){var n=this.tagWindow;try{for(;n!==n.parent&&getWindowNesting(n.parent).iabFriendlyIframe;)n=n.parent}catch(s){}this._iabWin=n,this.win=this._iabWin.parent,this.hostElement=this.win.document.createElement("div"),this.readIABIFrameHeight=function(){function e(e){return"%"===e.slice(-1)?"%":"px"}var t=this.tagWindow.frameElement,i=t.style.height||t.getAttribute("height")||"0",n=parseInt(i,10),s=e(i);return{value:n,unit:s,toString:function(){return n+s}}},this._iabWin.frameElement.parentNode.insertBefore(this.hostElement,this._iabWin.frameElement.nextSibling)}else this.win=this.tagWindow;addClass(this.hostElement,"celtra-ad-inline-host"),this.hacks.requiresWrappingPlacementWithComments&&(this.hostElement.parentNode.insertBefore(this.win.document.createComment("ie10hack"),this.hostElement),this.hostElement.parentNode.insertBefore(this.win.document.createComment("ie10hack"),this.hostElement.nextSibling)),this._parentPageHighlightStyle=null,this._downsizePlacements=this._downsizePlacements.bind(this),this._updatePlacements=this._updatePlacements.bind(this),this._topListenerAttached=!1,this._hasBeenViewable=!1,this.useFSVP=!(this.nesting.hostileIframe&&!deviceInfo.os.ios()&&!this.adBehavior.interstitial),this.restoreScrollOnCollapse=!deviceInfo.deviceType.desktop(),this.hostElement.activeAdapter||(this.hostElement.activeAdapter=this,this.on("documentReady",function(){this.hacks.needsConstantFlashing&&this.getTopWindow().setInterval(function(){for(var e in this.placements)this.placements[e]._flash()}.bind(this),200),this.adBehavior.adWillHideIframe||this.hideIABFriendlyIframe(),this.useFSVP&&"undefined"!=typeof FullscreenVideoPlayer&&FullscreenVideoPlayer.init({baseUrl:(this.runtimeParams.secure?urls.staticUrl:urls.insecureStaticUrl)+"runner/FullscreenVideoPlayer/"}),this.emit("ready")}.bind(this)),this.trackViewableAreaRatio=this.trackViewableAreaRatio.bind(this),this._viewableAreaRatio=0,this.useFixedPositioningForInterstitial=deviceInfo.os.ios())}inherit(MobileWebAdapter,BrowserAdapter),MobileWebAdapter.prototype.hideIABFriendlyIframe=function(){this.adBehavior.interstitial||this.nesting.iabFriendlyIframe&&(this._iabWin.frameElement.style.display="none")},MobileWebAdapter.prototype.setMinimumSize=function(e,t){this.hostElement.style.minWidth=e+"px",this.runtimeParams.sticky||(this.hostElement.style.minHeight=t+"px")},MobileWebAdapter.prototype._createViewportListener=function(){var e;return android()||kindleSilk()?(e=new ViewportObserver(this.getTopWindow()),e.on("keyboardShown",this._onKeyboardShown),e.on("keyboardHidden",this._onKeyboardHidden),this.on("_rawOrientationChange",this._downsizePlacements)):(e=MobileWebAdapter.uber._createViewportListener.apply(this),ios("8",null)&&(e._resizeHandler=deferred(e._resizeHandler),e._scrollHandler=deferred(e._scrollHandler))),e},MobileWebAdapter.prototype.createPlacement=function(e,t){function i(){defer(function(){t&&t(r)},void 0,void 0,h)}var n={trackingCenter:this.trackingCenter,aggregatorTracking:this.aggregatorTracking,experiments:this.experiments,adapter:this,console:console,runtimeParams:this.runtimeParams,celtraDeviceInfoRuntimeParams:this.runtimeParams.deviceInfo,nextFrame:this.nextFrame,cancelFrame:this.cancelFrame,Ticker:this.Ticker,macros:this.macros,perf:this.perf},s={urls:urls,urlOpenedOverrideUrls:this.urlOpenedOverrideUrls,storeOpenedOverrideUrls:this.storeOpenedOverrideUrls,urlOpenedUrlAppendage:this.urlOpenedUrlAppendage,clickThroughDestinationUrl:this.clickThroughDestinationUrl},r=null;switch(this._initialInnerDims={height:adapter.getTopWindow().innerHeight,width:adapter.getTopWindow().innerWidth},e.type){case"unit":if(["top","bottom"].indexOf(runtimeParams.sticky)>-1&&"static"==e.positioning){e.positioning="screen",e.attachment="body";var a={stickiness:runtimeParams.sticky,showDismissButton:"1"==runtimeParams.showDismissButton||"1"==runtimeParams.showStickyCloseButton,baseUrl:runtimeParams.secure?urls.staticUrl:urls.insecureStaticUrl,dismissCallback:function(){this.placements.banner.creative.units.banner.trackCreativeDismissed(),this.dismiss()}.bind(this)};r=new StickyPlacement(e.positioning,this.unitScript,n,s,a)}else r=new IframePlacement(e.positioning,this.unitScript,n,s);break;case"layer":r=new DivPlacement(e.positioning);break;default:throw new Error("I can't do that, Dave.")}if(!r.root||!r.root.parentNode){var o;"node"==e.attachment?o=e.parentNode:"placement"==e.attachment?o=e.placement.root:"inline"==e.attachment?this.isInlineWebPlacement||!this.adBehavior.attachInlinePlacementToViewport?o=this.hostElement:(this.viewport||(this.viewport=this._createViewportElement()),o=this.viewport):o=this.adBehavior.interstitial&&this.nesting.friendlyIframe&&!this.nesting.iabFriendlyIframe&&"1"==this.runtimeParams._nobust?this.tagWindow.document.body:this.getTopWindow().document.body,r.attachTo(o,i)}(ios()||kindleSilk())&&r.once("populated",function(){(r instanceof IframePlacement||!(r instanceof IframePlacement)&&!this._topListenerAttached)&&(r.getContainer().ownerDocument.addEventListener("focus",this._onKeyboardShown,!0),r.getContainer().ownerDocument.addEventListener("blur",this._onKeyboardHidden,!0),this._topListenerAttached=!0)}.bind(this));var h=this.useAsap},MobileWebAdapter.prototype.getTopWindow=function(){return this.nesting.hostileIframe?this.tagWindow:SDKAdapter.prototype.getTopWindow.apply(this)},MobileWebAdapter.prototype.expand=function(e,t){return this.nesting.hostileIframe?(this.openBrowserSameWindowInHostileIFrame(this.placements.banner.creative.wrapRedirectPageUrl(this.getModalUrl())),void(e&&e())):(this.animateExpansion=""!=t.animation&&this.enableCustomStateTransitions,this._stopAllMedia(),this._preExpandScroll={x:this.win.scrollX,y:this.win.scrollY},void this.waitForHook("beforeExpand",function(){this._enableClickShield(),defer(function(){this.emit("stateChange","expanded")}.bind(this)),e&&e()}.bind(this)))},MobileWebAdapter.prototype.collapse=function(e){this._stopAllMedia(),this.waitForHook("beforeCollapse",function(){this.restoreScrollOnCollapse&&this._preExpandScroll&&this.win.scrollTo(this._preExpandScroll.x,this._preExpandScroll.y),this._enableClickShield(),defer(function(){this.emit("stateChange","default")}.bind(this)),e&&e()}.bind(this))},MobileWebAdapter.prototype.dismiss=function(e,t){this._stopAllMedia();var i={};t&&Object.keys(t).forEach(function(e){i[e]=t[e]}),this.waitForHook("beforeDismiss",function(){this.Ticker.stop(),this._stopObservingEnvironment(),this.emit("stateChange","dismissed"),this.trackingCenter.flush(),this.hostElement&&this.hostElement.parentNode&&(this._enableClickShield(),this.hostElement.parentNode.removeChild(this.hostElement)),this.__CELTRA.stickyPresent&&(this.runtimeParams.sticky||this.adBehavior.sticky)&&(this.__CELTRA.stickyPresent=!1),(e||noop)()}.bind(this),i)},MobileWebAdapter.prototype.resize=function(e,t){var i={};t&&Object.keys(t).forEach(function(e){i[e]=t[e]}),this._enableClickShield(),this.waitForHook("beforeResize",e,i)},MobileWebAdapter.prototype.playVideoInPlayer=function(e,t){this.useFSVP?FullscreenVideoPlayer.play(e,t):(this.openBrowserSameWindowInHostileIFrame(e.url),t(!0))},MobileWebAdapter.prototype.callPhone=function(e){if(/Chrome/.test(navigator.userAgent)||deviceInfo.os.ios("9",null)){var t=document.createElement("a");t.href="tel:"+encodeURIComponent(e),t.addEventListener("click",function(){t.parentNode.removeChild(t)}),deviceInfo.browser.safari()&&this.nesting.hostileIframe&&(t.target="_top"),this.getTopWindow().document.body.appendChild(t),t.click()}else MobileWebAdapter.uber.callPhone.apply(this,arguments)},MobileWebAdapter.prototype._openInSameWindow=function(e){this.nesting.hostileIframe?this.openBrowserSameWindowInHostileIFrame(e):this.getTopWindow().location.href=e},MobileWebAdapter.prototype.getApp=function(e){this.openBrowser(e)},MobileWebAdapter.prototype.canSaveImage=function(){return desktop()||android()?!0:!1},MobileWebAdapter.prototype.saveImage=function(e,t,i){this.openBrowser(e+"?transform=download&name="+t),i()},MobileWebAdapter.prototype.startObscuringContent=function(){this.hacks.fixFocusablesHighlighting&&(this._parentPageHighlightStyle&&this.stopObscuringContent(),this._parentPageHighlightStyle=this.getTopWindow().document.createElement("style"),this._parentPageHighlightStyle.textContent="a, input, textarea, select { -webkit-tap-highlight-color: rgba(255, 0, 0, 0) !important; }input, textarea, select { visibility: hidden !important; }",this.getTopWindow().document.querySelector("head").appendChild(this._parentPageHighlightStyle))},MobileWebAdapter.prototype.stopObscuringContent=function(){this.hacks.fixFocusablesHighlighting&&(this._parentPageHighlightStyle&&this._parentPageHighlightStyle.parentNode&&this._parentPageHighlightStyle.parentNode.removeChild(this._parentPageHighlightStyle),this._parentPageHighlightStyle=null)},MobileWebAdapter.prototype._stopObservingEnvironment=function(){this._unitViewabilityObserver&&this._unitViewabilityObserver.stop(),MobileWebAdapter.uber._stopObservingEnvironment.apply(this,arguments)},MobileWebAdapter.prototype.waitForViewableIAB=function(e,t,i){this._getUnitViewabilityObserver(e,t).waitForViewableIAB(i),this.experiments.get("TrackViewableAreaChange")&&this._setupViewableAreaChangeObserver()},MobileWebAdapter.prototype.trackViewableAreaRatio=function(){var e={name:"viewableAreaRatio",ratio:this._viewableAreaRatio};this.trackingCenter.track(e)},MobileWebAdapter.prototype._setupViewableAreaChangeObserver=function(){var e=!1,t=this.getTopWindow(),i=!0,n=0,s=0,r=1e3,a=0,o=30,h=function(){s=n;var e={name:"largestViewableAreaRatio",ratio:n};this.trackingCenter.track(e)}.bind(this),l=function(l){this._viewableAreaRatio=l,l>n&&(n=l),i?(i=!1,this.trackViewableAreaRatio(),h()):!e&&o>a&&(e=!0,a++,t.setTimeout(function(){e=!1,n>s&&h(),this.trackViewableAreaRatio()}.bind(this),r))}.bind(this);this._unitViewabilityObserver.addListener(l)},MobileWebAdapter.prototype._removeDisableScrollEventListeners=function(e){if(e){if(this.useNativeClickForTapDetection)var t=["touchmove","wheel"];else var t=["touchstart","touchmove","touchend","wheel"];for(var i=0;i=this.heightCutoff)),this._keyboardShown}.bind(this);null!==i.width||e()?i.width==t.width&&(i.height-this.heightCutoff>t.height?(this.keyboardShown=!0,this.emit("keyboardShown")):(this.keyboardShown=!1,this.emit("keyboardHidden")),this._resizeCallback(),this._viewportUpdateCallback(),this.updateDimensions()):(this._resizeCallback(),this._viewportUpdateCallback())},ViewportObserver.prototype.updateDimensions=function(){var t=this.dimensions[this.orientation],i=this.getViewportGeometry();t.left=i.left,t.top=i.top,t.width=null===t.width?i.width:t.width,t.height=Math.max(i.height,t.height)},ViewportObserver.prototype.getViewportGeometry=function(){var t=this.win.document.documentElement;return{width:this.win.innerWidth,height:this.win.innerHeight,left:this.win.scrollX||t&&t.scrollLeft||0,top:this.win.scrollY||t&&t.scrollTop||0}};;
Logger.initFromRuntimeParams(runtimeParams);
var urls = {"creativeUrl":"https://ads.celtra.com/compiled/8c826bca/","apiUrl":"https://hub.celtra.com/api/","cachedApiUrl":"https://cache-ssl.celtra.com/api/","staticUrl":"https://cache-ssl.celtra.com/api/static/vc2969d471c/","insecureCreativeUrl":"http://ads.celtra.com/compiled/8c826bca/","insecureApiUrl":"http://hub.celtra.com/api/","insecureCachedApiUrl":"http://cache.celtra.com/api/","insecureStaticUrl":"http://cache.celtra.com/api/static/vc2969d471c/","trackingUrl":"https://track.celtra.com/","insecureTrackingUrl":"http://track.celtra.com/","geoUrl":"https://geo.celtra.com/","insecureGeoUrl":"http://geo.celtra.com/","customAudiencesUrl":"https://audiences.celtra.com","insecureCustomAudiencesUrl":"http://audiences.celtra.com","shareUrl":"https://hub-user.celtra.com/share/","insecureShareUrl":"http://hub-user.celtra.com/share/"};
urls.resourceUrl = runtimeParams.secure ? urls.staticUrl : urls.insecureStaticUrl;
var shouldBatchTrackers = !!'';
var trackingCenter = new TrackingCenter(
runtimeParams.sessionId,
runtimeParams.accountId,
runtimeParams.purpose,
runtimeParams.secure ? urls.trackingUrl : urls.insecureTrackingUrl,
trackers,
runtimeParams._batchTrackers === '1' || shouldBatchTrackers
);
if (runtimeParams.fallbackSdkUsed === '1') {
trackingCenter.track({
name : 'fallbackSdkUsed',
sdk : 'MobileWeb'
});
}
var aggregatorTracking = new AggregatorTracking(trackingCenter);
var experiments = new Experiments(runtimeParams.variantChoices, trackingCenter);
var trackingLoadingTimesExperiment = experiments.get('TrackingLoadingTimes');
var perf = new PerformanceTracker(trackingCenter, experiments);
if (runtimeParams.clientTimestamp) {
// Do it manually instead of using var p = perf.start() + p.end() pattern because we want to log
// times from before PerformanceTracker is available
perf.collect({
name: 'redirectDownload',
type: 'interval',
id: null,
startTime: parseFloat(runtimeParams.clientTimestamp) * 1000,
endTime: runtimeParams.redirectJsClientTimestamp * 1000,
args: []
});
}
perf.collect({
name: 'payloadDownload',
type: 'interval',
id: null,
startTime: runtimeParams.redirectJsClientTimestamp * 1000,
endTime: runtimeParams.payloadJsClientTimestamp * 1000,
args: []
});
var unitName = 'banner';
var requiredDeviceType = 'Desktop';
perf.collect({
name: 'payLoadDownloadedToAdapter.new',
type: 'interval',
id: null,
startTime: runtimeParams.payloadJsClientTimestamp * 1000,
endTime: Date.now(),
args: []
});
var perfAdapterNew = perf.start('Adapter.new');
var adapter = new MobileWebAdapter(runtimeParams, trackingCenter, aggregatorTracking, experiments, urlOpenedOverrideUrls, storeOpenedOverrideUrls, macros, urlOpenedUrlAppendage, clickThroughDestinationUrl, perf);
perfAdapterNew.end();
trackingCenter.windowForPixels = adapter.getTopWindow();
var perfFormatNew = perf.start('Format.new');
var format = new BannerFormat(adapter, {"banner":{"size":null,"layouts":[{"orientation":"independent","minSize":{"width":0,"height":0},"unitSize":{"width":300,"height":250},"designTimeSize":{"width":300,"height":250},"unitAlignment":{"horizontal":"center","vertical":"center"}}]}});
perfFormatNew.end();