[\\s\\S]*?","gi");do t=e,e=e.replace(r,"");while(e!==t);return e.replace(//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,c="http"==e.slice(0,4),u=new RegExp("^(https?://)?(www.)?("+fetchShortenedUrl.invalidDomains.map(function(e){return e.replace(/[^a-zA-Z]/g,"\\$&")}).join("|")+")(/|\\?)").test(e);if(!c||u)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 s=creative.runtimeParams.secure?creative.cachedApiUrl:creative.insecureCachedApiUrl,f=s+"/services/shortener",d={longUrl:e},l=btoa(to_utf8(e));l=l.replace(/\//g,"$").replace(/\+/g,"_").replace(/=/g,"");var p={cbName:"shortener_"+l};loadJSONP(f+"?"+buildQuery(d),p,function(t){a[e]=t.id,r("success",t.id)},function(){r("error")})}}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(e){if(!this.defer){try{for(;"undefined"!=typeof e.parent.location.href&&e.parent.document!==e.document;)e=e.parent}catch(t){}this.defer=function(t,n,r){var o,i=0|n;if(r){var a;"undefined"!=typeof defer.perf?a=defer.perf:"undefined"!=typeof creative?a=creative.perf:"undefined"!=typeof perf&&(a=perf),a&&(a._stopTrackingDefers||(o=a.start("defer",{deferId:r,delay:i})))}t&&e.setTimeout(function(){o&&o.end(),t()},i)}}}(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);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={},fetchShortenedUrl.invalidDomains=["db.tt","lnkd.in","t.co","youtu.be","goo.gl","adf.ly","bit.do","bit.ly","fur.ly","ht.ly","is.gd","ow.ly","tr.im","tiny.cc","tinyurl.com"];;
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),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){this.name=e||"",this.version=n||"0"}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 u(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("Chrome")&&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)},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||{},u(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(t){function e(){var e=t;try{for(;"undefined"!=typeof e.parent.location.href&&e.parent.document!==e.document;)e=e.parent}catch(n){}return e}function n(){return s.getComputedStyle(s.document.body,null)}function i(t,e,n){if(!t)throw new Error("No element specified!");if(a(e)){if(!(e in t.style)&&i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+e);if("undefined"==typeof n)return t.style[e];t.style[e]=n}else{if(-1==w.indexOf(e)&&o(e),"undefined"==typeof n)return t.style[y[e]];t.style[y[e]]=n}}function r(t,e){if(!t)throw new Error("No element specified!");var n=t.ownerDocument.defaultView.getComputedStyle(t,null);if(R&&v.indexOf(e)>-1&&(e="webkit"+f(e)),!n||"none"==n.display||!u())return null;if(!(e in n)&&i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+e);return a(e)?n[e]:(-1==w.indexOf(e)&&o(e),n[y[e]])}function o(t){S=S||n();var e=E+f(t);if(R&&v.indexOf(t)>-1)y[t]=e;else if(S&&t in S)y[t]=t;else if(S&&e in S)y[t]=e;else if(i.BREAK_ON_ERROR)throw new Error("Invalid CSS attribute "+t+' or iframe still display "none" in FF');w.push(t)}function a(t){return p.test(t)}function u(){if(t===s)return!0;var e=t.frameElement.ownerDocument.defaultView.getComputedStyle(t.frameElement,null);return e&&"none"!=e.display}function f(t){return t+="",t?t[0].toUpperCase()+t.slice(1):""}var l=t.navigator.userAgent,s=e(),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 t=l.match(/AppleWebKit\/(\d+)/);return t&&~~t[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,t.celtra=t.celtra||{},t.celtra.styler={css:i,computedCSS:r,isWebkit:m,isGecko:c,isIE:d},t.css=i,t.computedCSS=r}(window);;
function PerformanceTracker(e,t){this.trackingCenter=e,this.trackingEnabled=t.get("PerformanceTiming")||t.get("ConsolidateIframes")&&!window.disableIframeConsolidation||t.get("MonotypeOffloadFonts"),this._id=0}PerformanceTracker.prototype.start=function(e,t){var r=this,i={name:e,type:"interval",id:this._id++,startTime:Date.now(),args:t||[]};return i.end=function(){this.endTime=Date.now();var e=this.endTime-this.startTime;Logger("perf").log(this.name+"(#"+this.id+") "+e),r.collect(this)}.bind(i),i},PerformanceTracker.prototype.collect=function(e){if(this.trackingEnabled){var t={name:"perfTiming",section:e.name,type:e.type,perfId:e.id,startTime:e.startTime,endTime:e.endTime,args:e.args};this.trackingCenter.trackNoLaterThan(t,1e3)}},PerformanceTracker.prototype.mark=function(e){var t=this.start(e);t.type="mark",t.endTime=t.startTime,this.collect(t)},PerformanceTracker.prototype.marks=function(e){return function(){this.mark(e)}.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;;
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,n,t,i,r){this._sessionId=e,this._accountId=n,this._trackingUrl=i,this._trackers=r,this._purpose=t,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)}extend(TrackingCenter.prototype,EventEmitter),TrackingCenter.eventCountLimit=1e3,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,instantiation:this._instantiation,index:this._eventIndex++,clientTimestamp:new Date/1e3},e)},TrackingCenter.prototype._addEventPendingToQueues=function(e){var n=this._resolvePixelsAndEventsForQueue([e]);this.isTrackingLimitReached()&&n.events.push(this._createTrackingEvent({name:"eventLimitReached"})),n.events.forEach(function(e){Logger("tracking").log("Queuing event "+JSON.stringify(e))}),n.pixels.forEach(function(e){Logger("tracking").log("Queuing pixel "+JSON.stringify(e))}),this._pendingEvents=this._pendingEvents.concat(n.events),this._pendingPixels=this._pendingPixels.concat(n.pixels)},TrackingCenter.prototype.track=function(e,n){this.trackNoLaterThan(e,0,n)},TrackingCenter.prototype.trackNoLaterThan=function(e,n,t){function i(e){return parseInt(e,10)===e}if(this.isTrackingLimitReached())return void console.warn("Tracking limit reached: "+TrackingCenter.eventCountLimit+" events.");if(i(n)?0>n&&(n=0):n=1500,t=t||noop,"live"!==this._purpose){var r=this._createTrackingEvent(e);return Logger("tracking").log("Ignoring non-live event "+JSON.stringify(r)),void defer(t)}var s=null;this._addEventPendingToQueues(e);var c=this.windowForPixels;this.once("trackingQueueEmptied",function(){s&&(c.clearTimeout(s),s=null),t()}.bind(this)),s=c.setTimeout(this.flush,n)},TrackingCenter.prototype._resolvePixelsAndEventsForQueue=function(e){function n(e,i,r){if(0==e.length)return{events:i,pixels:r};var s=e[0],c=t._createTrackingEvent(s),o=t._trackers.urlsAndEventsFor(c);return n(e.slice(1).concat(o.events||[]),i.concat(c),r.concat(o.urls||[]))}var t=this;return n(e,[],[])},TrackingCenter.prototype._firePixel=function(e,n){function t(){i.onload=i.onerror=null,n()}var i=this.windowForPixels.document.createElement("img");i.onload=i.onerror=t;try{i.src=e}catch(r){t()}},TrackingCenter.prototype._decrementWaiting=function(){this._waitingTrackingRequests>0&&(--this._waitingTrackingRequests||this.emit("trackingQueueEmptied"))},TrackingCenter.prototype.flush=function(e){var n=this;e=e||noop;var t=n._pendingEvents;n._pendingEvents=[],n._eventsInProgress=n._eventsInProgress.concat(t),t.length&&(n._waitingTrackingRequests++,n._firePixel(n._getTrackerPixelUrl(t),function(){n._eventsInProgress=n._eventsInProgress.filter(function(e){return-1===t.indexOf(e)}),n._decrementWaiting()})),n._pendingPixels.forEach(function(e){n._waitingTrackingRequests++,n._firePixel(e,n._decrementWaiting)}),n._pendingPixels=[],0===n._waitingTrackingRequests?this.windowForPixels.setTimeout(e,0):this.once("trackingQueueEmptied",e)},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._getTrackerRedirectUrl=function(e,n,t,i){i=i||{};var r={events:e,pixels:n,dest:t};return i.jsRedirectFunc&&(r.redirectFunc=i.jsRedirectFunc),this._getTrackerUrl(r)},TrackingCenter.prototype.wrapRedirectPageUrl=function(e,n){var t=this._getTrackerRedirectUrl(this._pendingEvents.concat(this._eventsInProgress),this._pendingPixels,e,n);return this._pendingEvents=[],this._pendingPixels=[],t};;
function Experiments(t,n){this._instances={};for(var e in t)this._instances[e]=new Experiment(e,t[e],n)}function Experiment(t,n,e){this.key=t,this.chosenVariant=n,this._trackingCenter=e,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,n){var e=[t].concat(n||[]).map(encodeURIComponent).join("/");return this._instances[e]||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 Logger("TouchEventSimulator").warn("Touch event simulator already initialised!"):(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?(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 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.pageX<0||t.pageX>this.win.innerWidth||t.pageY<0||t.pageY>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 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}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,n,s=this._parseLength(t),h=this._parseLength(e),r=this.getViewportGeometry(),l=extend({},this._minWidth),a=extend({},this._minHeight);i||(this.width={value:s.value,unit:s.unit},this.height={value:h.value,unit:h.unit}),this._visible&&("screen"==this.positioning?(o=r.width,n=r.height):"page"==this.positioning?(o=this.root.ownerDocument.documentElement.offsetWidth,n=this.root.ownerDocument.documentElement.offsetHeight):(o=this.root.parentNode.offsetWidth,n=this.root.parentNode.offsetHeight),"%"==s.unit&&(s.value=Math.round(s.value*o/100),s.unit="px"),"%"==h.unit&&(h.value=Math.round(h.value*n/100),h.unit="px"),"%"==l.unit&&(l.value=Math.round(l.value*o/100),l.unit="px"),"%"==a.unit&&(a.value=Math.round(a.value*n/100),a.unit="px"),this.root.style.width=Math.max(s.value,l.value)+s.unit,this.root.style.height=Math.max(h.value,a.value)+h.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.setPosition=function(t,e,i,o){var n=this._parseLength(t),s=this._parseLength(e),h=this.getViewportGeometry(),r=this.getBaseOffset();if(i||(this.left.value=n.value,this.left.unit=n.unit,this.top.value=s.value,this.top.unit=s.unit),this._visible){switch(this.positioning){case"screen":if(this._canUseFixedPositioning)this.root.style.position="fixed","left"==this.origin.horizontal?(this.root.style.left=n.value+n.unit,this.root.style.right="auto",this.root.style.marginLeft=""):"center"==this.origin.horizontal?(this.root.style.left=n.value+n.unit,this.root.style.right="auto",this.root.style.marginLeft=o?"":(h.width-this.root.offsetWidth)/2+"px"):(this.root.style.right=n.value+n.unit,this.root.style.left="auto",this.root.style.marginLeft=""),"top"==this.origin.vertical?(this.root.style.top=s.value+s.unit,this.root.style.bottom="auto",this.root.style.marginTop=""):"center"==this.origin.vertical?(this.root.style.top=s.value+s.unit,this.root.style.bottom="auto",this.root.style.marginTop=(h.height-this.root.offsetHeight)/2+"px"):(this.root.style.bottom=s.value+s.unit,this.root.style.top="auto",this.root.style.marginTop="");else{var l="",a="";if("%"==n.unit&&(n.value*=h.width/100,n.unit="px"),"%"==s.unit&&(s.value*=h.height/100,s.unit="px"),"left"==this.origin.horizontal)n.value+=h.left;else if("center"==this.origin.horizontal)n.value+=h.left,l=(h.width-this.root.offsetWidth)/2+"px";else{var u="%"==this.width.unit?this.width.value/100*h.width:this.width.value;n.value=h.left+h.width-u-n.value}if("top"==this.origin.vertical)s.value+=h.top;else if("center"==this.origin.vertical)s.value+=h.top,a=(h.height-this.root.offsetHeight)/2+"px";else{var p="%"==this.height.unit?this.height.value/100*h.height:this.height.value;s.value=h.top+h.height-p-s.value}this.root.style.position="absolute",this.root.style.left=n.value-r.left+"px",this.root.style.top=s.value-r.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=n.value+n.unit,this.root.style.right="auto",this.root.style.marginLeft=""):"center"==this.origin.horizontal?(this.root.style.left=n.value+n.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=n.value+n.unit,this.root.style.marginLeft=""),"top"==this.origin.vertical?(this.root.style.top=s.value+s.unit,this.root.style.bottom="auto",this.root.style.marginTop=""):"center"==this.origin.vertical?(this.root.style.top=s.value+s.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=s.value+s.unit,this.root.style.marginTop="");break;case"page":var c={width:this.root.ownerDocument.documentElement.clientWidth,height:this.root.ownerDocument.documentElement.clientHeight};"%"==n.unit&&(n.value=Math.round(n.value*c.width/100),n.unit="px"),"%"==s.unit&&(s.value=Math.round(s.value*c.height/100),s.unit="px"),this.root.style.position="absolute","left"==this.origin.horizontal?(this.root.style.left=n.value-r.left+"px",this.root.style.top=s.value-r.top+"px"):"center"==this.origin.horizontal?(this.root.style.left=(c.width-this.root.offsetWidth)/2-r.left+n.value+"px",this.root.style.top=(c.height-this.root.offsetHeight)/2-r.top+s.value+"px"):(this.root.style.left=c.width-this.root.offsetWidth-r.left-n.value+"px",this.root.style.top=c.height-this.root.offsetHeight-r.top-s.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)},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: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",n=t.verticalPosition||"center";return"center"==o?i.left+=(e.width-t.size.width)/2:"right"==o&&(i.left+=e.width-t.size.width),"center"==n?i.top+=(e.height-t.size.height)/2:"bottom"==n&&(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)},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)}.bind(this)),this.frame.contentDocument.close()}.bind(this))},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")},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.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/Sticky/sticky-dismiss-button.png",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){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}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 n=i?i:t;e._outerPlacement=n,this.adapter.canMeasureViewportPlacementGeometry&&(n.inView||(n.inView=new PlacementInView(this.adapter,n)),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)}}),e.on("shown",function(){var i=e.getPlacementGeometry();t.setAvailableSize(i.width,i.height),t.enterRenderTree()}),e.on("hidden",function(){t.exitRenderTree()})},Format.prototype._getBackwardCompatibleOrientation=function(e){function t(){var t=e.size;return t.widtht.height?"landscape":"noOrientation"}var i=void 0;return i=this.adapter.runtimeParams.lockOrientation||this.adapter.autoLock()?this.adapter.determineLockOrientation():"prompt"===e.wrongOrientationHandling&&e?t():"noOrientation"},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(),n=e.getGlobalGeometry(i),r=t(i),a=CRect.adopt(n);a.left+=r.left,a.top+=r.top;var o={name:"viewportPlacementGeometry",pageDimensions:this.adapter.getPageDimensions(),viewportPositionRect:r,firstPlacementPositionRect:a};this.adapter.trackingCenter.trackNoLaterThan(o)},Format.prototype.setupViewableTimeObserver=function(){if(this._observesViewableTime=!0,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.createRxStateObject=function(){return new StateObject({left:null,top:null,right:null,bottom:null,width:null,height:null,vw:null,vh:null,x:null,y:null,pageYOffset:null})},Format.prototype.updateRxStateObject=function(e,t){var i=t.getBoundingClientRect(),n=t.ownerDocument.defaultView;e.left=~~i.left,e.top=~~i.top,e.right=~~i.right,e.bottom=~~i.bottom,e.width=~~i.width,e.height=~~i.height,e.vw=n.innerWidth,e.vh=n.innerHeight,e.pageYOffset=n.pageYOffset,e.x=~~(i.left+i.width/2-n.innerWidth/2),e.y=~~(i.top+i.height/2-n.innerHeight/2)},Format.IGNORABLES=["INPUT","TEXTAREA","SELECT"],Format.isElementIgnorable=function(e){return Format.IGNORABLES.indexOf(e.tagName)>-1};;
function UnitViewabilityObserver(i,t,e){this.adapter=i,this.win=i.getTopWindow(),this.placement=t,this.element=e,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)}UnitViewabilityObserver.samplingCount=100,UnitViewabilityObserver.minimumOpacity=.95,UnitViewabilityObserver.prototype._getUnitVisibleGeometry=function(){var i=this.adapter.getPlacementRect(this.placement),t=this.adapter.getViewportRect(),e=CRect.adopt(this.placement.getContainer().getBoundingClientRect()),r=CRect.adopt(this.element.getBoundingClientRect()),n=r.intersect(e);return{globalUnitRect:r.map(e,i),intersect:n?n.map(e,i).intersect(t):null}},UnitViewabilityObserver.prototype._getUnitInteractionSamples=function(i){var t=0,e=0;if(!this.adapter.isSingleOccupant){for(var r=this.placement.root,n=r.ownerDocument,a=n.defaultView,s=this.placement.getContainer(),o=null,l=1,c=1;(r=r.parentNode)&&r!==n.body;)o=a.getComputedStyle(r),l*=o.opacity,c*=("visible"==o.visibility?1:0)*("none"!=o.display?1:0);l*c>UnitViewabilityObserver.minimumOpacity&&CPoint.sample(i,UnitViewabilityObserver.samplingCount,function(i,r){var a=n.elementFromPoint(Math.round(i),Math.round(r));if(t++,this.placement.frame&&a===this.placement.frame)e++;else{for(;a&&a!==s&&a!==n;)a=a.parentNode;a===s&&e++}}.bind(this))}return{samples:t,positives:e}},UnitViewabilityObserver.prototype.computeUnitInteractableRatio=function(i){if(!this.element.parentNode||!this.placement.root.parentNode)return 0;if(!this.adapter.containerIsViewable||!this.element.ownerDocument.defaultView)return 0;var t=this._getUnitVisibleGeometry(),e=t.intersect,r=e&&t.globalUnitRect.area>0?e.area/t.globalUnitRect.area:0,n=!this._samplingRect.equals(e),a=i-this._lastSamplingTimestamp,s=null;return this._samplingRect.copyFrom(e),r>0&&(n||a>=this._minSamplingTimeDelta)&&(s=this._getUnitInteractionSamples(t.intersect),this._lastSamplingTimestamp=i),s&&s.samples>0?this._ratio=r*s.positives/s.samples:(s&&0===s.samples||0===r)&&(this._ratio=0),this._ratio},UnitViewabilityObserver.prototype.addListener=function(i){this._listeners.push(i),this._start()},UnitViewabilityObserver.prototype.removeListener=function(i){this._listeners=this._listeners.filter(function(t){return t!==i}),0===this._listeners.length&&this.stop()},UnitViewabilityObserver.prototype._calc=function(i){if(this._active){var t=this._getUnitVisibleGeometry().globalUnitRect;this._currentViewability=this.computeUnitInteractableRatio(i),this._listeners.forEach(function(i){this._currentViewability!==i.previousViewability&&(i.previousViewability=this._currentViewability,i(this._currentViewability,t))},this)}},UnitViewabilityObserver.prototype._start=function(){this._active||(this._active=!0,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 i in this._inTimer)this.win.clearTimeout(this._inTimer[i]);this._inTimer={}}},UnitViewabilityObserver.prototype.waitForViewable=function(i,t){var e=function(r,n){var a=UnitViewabilityObserver.selectCriterion(i,n),s=0==a.ratio?r>0:r>=a.ratio;if(s){var o=function(){this.removeListener(e),t(a)}.bind(this);"Core"==i?o():this._inTimer[i]||(this._inTimer[i]=this.win.setTimeout(o,a.time))}else this._inTimer[i]&&(this.win.clearTimeout(this._inTimer[i]),this._inTimer[i]=null)}.bind(this);return this.addListener(e),e},UnitViewabilityObserver.prototype.waitForViewableCore=function(i){return this.waitForViewable("Core",i)},UnitViewabilityObserver.prototype.waitForViewableIAB=function(i){return this.waitForViewable("IAB",i)},UnitViewabilityObserver.prototype.waitForVideoViewableIAB=function(i){return this.waitForViewable("IABvideo",i)},UnitViewabilityObserver.prototype.waitForVideoViewableFB=function(i){return this.waitForViewable("FBvideo",i)},UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT=242500,UnitViewabilityObserver.selectCriterion=function(i,t){switch(i){case"IAB":var e=t&&t.width*t.height>UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT;return e?this.criteria.IABlargeAd:this.criteria.IABsmallAd;case"Core":case"IABvideo":case"FBvideo":return this.criteria[i];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._autoSwitchObserverRunningState=this._autoSwitchObserverRunningState.bind(this),this.destroy=this.destroy.bind(this),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)}inherit(PlacementInView,InViewObject),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(){var t=this.getNode(),e=this.adapter.getPlacementRect(this.placement),i=t?CRect.adopt(t.getBoundingClientRect()):CRect.ZERO,n=this.getParentRect(),a=CRect.adopt(this.placement.root.getBoundingClientRect()),s=a.intersect(n),r=s.zero()?CRect.ZERO:s.map(e,i);this._computeMaxPossibleDimensions(a,this.getParentMaxPossDims()),this.rectInView.equals(r)||(this.rectInView=r,this.emit("rectInViewChanged",r),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.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){attach(t,"touchstart",function(e){for(var a,o=e.target;1!=o.nodeType;)o=o.parentNode;for(;o&&1==o.nodeType&&o.tagName;){var n=o.tagName.toLowerCase();if(hasClass(o,"touchable")||"a"===n&&o.href||"button"===n||"img"===n||"input"===n&&o.type&&"button"===o.type.toLowerCase()){a=o;break}o=o.parentNode}if(a){var c=!1;if(celtra.iframe()){var r=function(){var t=("undefined"!=typeof creative&&creative.adapter||adapter).getTopWindow();return[t.scrollX,t.scrollY,t.innerWidth,t.innerHeight]},u=r();c=!0}var i=20,h=e.targetTouches[0].clientX-i,s=e.targetTouches[0].clientX+i,d=e.targetTouches[0].clientY-i,l=e.targetTouches[0].clientY+i;addClass(a,"touched");var f=!1,v=!1,p=!1,g=!1,m=new Date,T=function(t){if(!f&&!v){var e=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY;f=c&&u.toString()!=r().toString(),v=!(e>=h&&s>=e&&o>=d&&l>=o),v||f?removeClass(a,"touched"):addClass(a,"touched")}},C=function(){if(!g&&(g=!0,detach(t,"touchmove",T,!1),detach(t,"touchend",arguments.callee,!1),hasClass(a,"touched"))){if(removeClass(a,"touched"),v||f||p||new Date-m>400&&!desktop())return;var e=t.ownerDocument.createEvent("MouseEvents");e.initEvent("tap",!0,!0),a.dispatchEvent(e)}},w=function(){detach(t,"touchend",w,!0),nextFrame(function(){p=!0,C()})};attach(t,"touchcancel",function(t){removeClass(a,"touched"),C(t)},!1),attach(t,"touchmove",T,!1),attach(t,"touchend",C,!1),attach(t,"touchend",w,!0)}},!0)};
function BannerFormat(e){Format.apply(this,arguments),e.adBehavior.interstitial=!1,e.adBehavior.expandable=!1,this.bannerRx=this.createRxStateObject(),this.adapter.isRxAvailable&&this.adapter.registerRxStateObject("banner",this.bannerRx),this._tick=this._tick.bind(this),this.setup()}inherit(BannerFormat,Format),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.isRxAvailable&&(this.updateRxStateObject(this.bannerRx,t.root),this.adapter.Ticker.frame(this._tick,"update")),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")),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;i.swipeable=!0,i.firstAppearWithoutUserInteraction=!0,this._attachInViewToOrderedPlacements(i,e),this.connectPlacementEventsToUnitBehavior(e,i);var a=i.getNode(function(){var n="top"==this.adapter.runtimeParams.sticky||"bottom"==this.adapter.runtimeParams.sticky;e.setMinimumSize(i.size.width,i.size.height),e.populate(a,t),n?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.updateRxStateObject(this.bannerRx,this.placements.banner.root)):void this.destroy()};;
function SDKAdapter(e,t,i,n,r,o,a,s,d,h){if(this.runtimeParams=e,this.trackingCenter=t,this.aggregatorTracking=i,this.experiments=n,this.macros=a,this.perf=h,defer.perf=h,this.ampDetected=!1,this.ampNestingLevel="",this.safeFrameDetected=!1,this.scriptElement=script,this.domApi=this.scriptElement.parentNode.celtra={loaded:!1,viewabilityObservee:null},this.adapterWindow=this.scriptElement.ownerDocument.defaultView,this.storeOpenedOverrideUrls=o,this.urlOpenedOverrideUrls=r,this.urlOpenedUrlAppendage=s,this.clickThroughDestinationUrl=d,this.providesCloseButton=!1,this.enableCustomStateTransitions=!1,this.adBehavior={interstitial:!1,expandable:!1,expanded:!1,sticky:!1,crossScreenSticky:!1,attachInlinePlacementToViewport:!1},this.isRxAvailable=!1,this._rxStates={},this._rxListeners={},this._rxRunning=!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 p=parseInt(this.runtimeParams.topLayerZIndex,10);!isNaN(p)&&p>20&&(Placement.ZINDEX_MAX=Math.min(Placement.ZINDEX_MAX,p))}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._updateRxStateObjects=this._updateRxStateObjects.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.mpeg1VideoHas1pxBlackBorderOnRight=!1,this.hostWindow=window,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 c=function(e){e&&(this.trackingCenter.track({name:"containerBecameViewable"}),this.off("containerViewableChange",c))}.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",c))}.bind(this),0,"SDKAdapter defer _startObservingEnvironment"),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")}.bind(this),0,"SDKAdapter defer _initSdk"),this.on("documentReady",function(){android("4.0")&&this.getTopWindow().setInterval(function(){for(var e in this.placements)this.placements[e]._flash()}.bind(this),250)}.bind(this))}extend(SDKAdapter.prototype,EventEmitter),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.hostWindow,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));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"))}.bind(this)),this.once("sdkReady",function(){this.collectAndTrackData(function(e){var t=this.getHostElement().parentNode,i={width:this.getTopWindow().innerWidth,height:this.getTopWindow().innerHeight},n={width:this.hostWindow.innerWidth,height:this.hostWindow.innerHeight},r={scope:"global",userAgent:this.getTopWindow().navigator.userAgent,orientation:this.orientation,topmostReachableWindow:i,hostWindow:n,nesting:getWindowNesting(this.hostWindow),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};runtimeParams.universalTagSignals&&(r.universalTagSignals=runtimeParams.universalTagSignals),e(r)}.bind(this),"environmentInfo")}.bind(this));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()):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))},stop:function(){}}},SDKAdapter.prototype.triggerLoadedEvent=function(e){this.domApi.loaded=!0,this.domApi.viewabilityObservee=e,this._dispatchCeltraLoadedEvent(this.getHostElement())},SDKAdapter.prototype.triggerClosedEvent=function(){this._dispatchCeltraClosedEvent(this.getHostElement())},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);var t=function(i){i&&(this.off(t),defer(e))}.bind(this);this.on("containerViewableChange",t)},SDKAdapter.prototype._createDocumentAttachmentObserver=function(){var e=this,t=e.getHostElement(),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.getHostElement=function(){return this.scriptElement.parentNode},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"):t.addEventListener("DOMContentLoaded",e,!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")))}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(){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))},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.hostWindow.document.body.appendChild(e),e},SDKAdapter.prototype._getViewportElement=function(){return this.viewport};;
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(),defer(this.emits("displayed"))}.bind(this))}inherit(BrowserAdapter,SDKAdapter),Object.defineProperty(BrowserAdapter.prototype,"assumeScrollSupported",{get:function(){var e=this.getTopWindow().document.body.scrollHeight>this.getTopWindow().innerHeight;return e&&!getWindowNesting(this.hostWindow).hostileIframe}}),BrowserAdapter.prototype._setupMouseLeaveObserver=function(){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,l=1>s,h=s>r-1;t.toElement&&"HTML"!==t.toElement.tagName||!(a||p||l||h)||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-p>n?i():r.requestAnimationFrame(t))}function i(){a&&a.parentNode&&(a.removeEventListener("click",e,!0),a.parentNode.removeChild(a),a=null)}var n=500,r=this.getTopWindow(),o=r.document,s=r.document.documentElement,a=o.createElement("div"),p=new Date;a.style.position="absolute",a.style.left=a.style.top=0,a.style.width=Math.max(s.clientWidth,r.innerWidth||0)+"px",a.style.height=Math.max(s.clientHeight,r.innerHeight||0)+"px",a.style.background="none",a.style.zIndex=Placement.ZINDEX_MAX,a.style.webkitTapHighlightColor="rgba(0,0,0,0)",a.addEventListener("click",e,!0),o.body.appendChild(a),r.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={isViewable:!1,start:function(){i.isVisible()&&defer(r),i.isSupported&&t.addEventListener(i.eventName,r)},stop:function(){i.isSupported&&t.removeEventListener(i.eventName,r)}},r=function(){var t=this.isViewable;this.isViewable=i.isVisible(),t!=this.isViewable&&e.emit("containerViewableChange",this.isViewable)}.bind(n);return n},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){return this._unitViewabilityObserver||(this._unitViewabilityObserver=new UnitViewabilityObserver(this,e,t)),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)};;
function MobileWebAdapter(e,t,i,n){MobileWebAdapter.uberConstructor.apply(this,arguments),this.hostWindow=window.parent;var s=n.get("ConsolidateIframes");if(this._consolidateIframes=s&&"treatment"===s.chosenVariant&&!window.disableIframeConsolidation,this.nesting=getWindowNesting(this._consolidateIframes?window.originatingWindow:this.hostWindow),this.isInlineWebPlacement=!(this.isSingleOccupant||this.nesting.hostileIframe||this.nesting.friendlyIframe&&!this.nesting.iabFriendlyIframe),this.mpeg1VideoHas1pxBlackBorderOnRight=ios()&&tablet(),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.hasBuggyDateInputControls=android()&&!/Chrome/i.test(navigator.userAgent)&&/HTC.One.[^S]|GT-I930[05]|S[PGC][HV]-(E210[KLS]|T999|I747|N064|N035|J021|R530|I535|S960L|S968C|L710)/.test(navigator.userAgent),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.iframe&&!this.nesting.iabFriendlyIframe&&t.track({name:"userError",userErrorId:"nonFriendlyIFrame"}),this._consolidateIframes)this.win=this.hostWindow,this.hostElement=window.frameElement.parentNode;else if(this.nesting.iabFriendlyIframe){var r=this.hostWindow;try{for(;r!==r.parent&&getWindowNesting(r.parent).iabFriendlyIframe;)r=r.parent}catch(a){}this._iabWin=r,this.win=this._iabWin.parent,this.hostElement=this.win.document.createElement("div"),this.hostElement.className="celtra-ad-v3",this.readIABIFrameHeight=function(){function e(e){return"%"===e.slice(-1)?"%":"px"}var t=this.hostWindow.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.hostWindow,this.hostElement=this.scriptElement.parentNode;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));var o=this.win.document.querySelector("meta[name=viewport]");"Phone"==requiredDeviceType&&(o&&(o.content.match(/minimum-scale=1(\.0)?/)&&o.content.match(/maximum-scale=1(\.0)?/)||o.content.match(/initial-scale=1(\.0)?/)&&o.content.match(/user-scalable=no/))||t.track({name:"userError",userErrorId:"nonMobileOptimized"})),this._parentPageHighlightStyle=null,this._downsizePlacements=this._downsizePlacements.bind(this),this._updatePlacements=this._updatePlacements.bind(this),this._topListenerAttached=!1,this._hasBeenViewable=!1,this.useFSVP=this.getVideoCapabilities().supportsHtml5Video&&!(this.nesting.hostileIframe&&!ios()&&!this.adBehavior.interstitial),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/",hostWindow:this.win}),this.runtimeParams._mraidCheck&&defer(function(){this.trackingCenter.track("undefined"!=typeof this.hostWindow.mraid?{name:"userError",userErrorId:"checkNoMraidOnWebFailed"}:{name:"checkNoMraidOnWebSuccess"})}.bind(this),1e3),this.emit("ready")}.bind(this)),this.trackViewableAreaRatio=this.trackViewableAreaRatio.bind(this),this._viewableAreaRatio=0)}inherit(MobileWebAdapter,BrowserAdapter),MobileWebAdapter.prototype.hideIABFriendlyIframe=function(){this._consolidateIframes||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)})}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)};this._consolidateIframes&&window.initialIframe&&"banner"===e.name?(r=StickyPlacement.create(window.initialIframe,e.positioning,n,s,a),i()):r=new StickyPlacement(e.positioning,this.unitScript,n,s,a)}else this._consolidateIframes&&window.initialIframe&&"banner"===e.name?(r=IframePlacement.create(window.initialIframe,e.positioning,n,s),i()):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(!this._consolidateIframes||!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.hostWindow.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))},MobileWebAdapter.prototype.getTopWindow=function(){return this.nesting||(this.nesting=getWindowNesting(this.hostWindow)),this.nesting.hostileIframe?this.hostWindow:SDKAdapter.prototype.getTopWindow.apply(this)},MobileWebAdapter.prototype.expand=function(e,t){return this.nesting.hostileIframe?(window.top.location.href=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(){!desktop()&&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(),this.Ticker.stop();var i={};t&&Object.keys(t).forEach(function(e){i[e]=t[e]}),this.waitForHook("beforeDismiss",function(){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.maximizeViewport=function(e){return desktop()?e():(this.win.scrollBy(0,android()?100:1),void this.win.setTimeout(function(){this._updatePlacements(e)}.bind(this),android()?100:0))},MobileWebAdapter.prototype.playVideoInPlayer=function(e,t){this.useFSVP?FullscreenVideoPlayer.play(e,t):(window.top.location.href=e.url,t(!0))},MobileWebAdapter.prototype.callPhone=function(e){if(/Chrome/.test(navigator.userAgent)||ios("9",null)){var t=document.createElement("a");t.href="tel:"+encodeURIComponent(e),t.addEventListener("click",function(){t.parentNode.removeChild(t)}),this.getTopWindow().document.body.appendChild(t),t.click()}else MobileWebAdapter.uber.callPhone.apply(this,arguments)},MobileWebAdapter.prototype.openBrowser=function(e,t){t?fakeClickAhrefBlank(e,noop,this.getTopWindow()):this.nesting.hostileIframe?window.top.location.href=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.getVideoCapabilities=function(){var e=!(/Safari\/\d+/.test(navigator.userAgent)&&ios())&&ios()&&!window.indexedDB;return{supportsHtml5Video:!0,allowsInlineMediaPlayback:android("4",null)||tablet()||desktop()||e,mediaPlaybackRequiresUserAction:!desktop()}},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)};;
function ViewportObserver(t){this.win=t,this.handler=null,this.keyboardShown=!1,this.resizeDelay=200,this.heightCutoff=120,this.dimensions={portrait:{left:0,top:0,width:null,height:0},landscape:{left:0,top:0,width:null,height:0}},this.triggerTimer=this.triggerTimer.bind(this),this.commitDimensions=this.commitDimensions.bind(this),this._resizeTimer=null}extend(ViewportObserver.prototype,EventEmitter),Object.defineProperty(ViewportObserver.prototype,"isPortrait",{get:function(){return"undefined"!=typeof this.win.orientation?0==this.win.orientation||180==this.win.orientation:this.win.innerWidth=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/6b98ee20/","apiUrl":"https://hub.celtra.com/api/","cachedApiUrl":"https://cache-ssl.celtra.com/api/","staticUrl":"https://cache-ssl.celtra.com/api/static/ve03a4e2d4f/","insecureCreativeUrl":"http://ads.celtra.com/compiled/6b98ee20/","insecureApiUrl":"http://hub.celtra.com/api/","insecureCachedApiUrl":"http://cache.celtra.com/api/","insecureStaticUrl":"http://cache.celtra.com/api/static/ve03a4e2d4f/","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"};
urls.resourceUrl = runtimeParams.secure ? urls.staticUrl : urls.insecureStaticUrl;
var trackingCenter = new TrackingCenter(
runtimeParams.sessionId,
runtimeParams.accountId,
runtimeParams.purpose,
runtimeParams.secure ? urls.trackingUrl : urls.insecureTrackingUrl,
trackers
);
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":970,"height":55},"designTimeSize":{"width":970,"height":55},"unitAlignment":{"horizontal":"center","vertical":"center"}}]}});
perfFormatNew.end();