[\\s\\S]*?","gi");(e=(t=e).replace(r,""))!==t;);return e.replace(/e.minDistanceForSwipe:"x"===e.validAxis&&(t=n>e.minDistanceForSwipe),{isHorizontal:r/g),o="var p = []; with(o) {\n",i=!1;r.forEach(function(e){i?"="==e[0]?o+=" p.push("+e.replace(/^=\s*|\s*$/g,"")+");\n":o+=" "+e+"\n":e&&(o+=" p.push('"+e.replace(/'/g,"\\'").split(/\r?\n/g).join("\\n');\n p.push('")+"');\n"),i=!i}),o+='} return p.join("");';try{n=new Function("o",o)}catch(e){r=new Error("Cannot parse template! (see `template` property)");throw r.template=o,r}}return t?n(t):n}function crc32(e){"use strict";for(var t=-1,n=0,r=window.crc32.crcTable||(window.crc32.crcTable=function(){for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?2197175160^n>>>1:n>>>1;e[t]=n}return e}()),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(r,e,t){t=t||noop;var n,o=!1,i=fetchShortenedUrl.inProgress,a=fetchShortenedUrl.cache;function c(t,n){i[r].forEach(function(e){e[t](n)}),delete i[r]}"http"==!r.slice(0,4)?t():a[r]?defer(function(){e(a[r])},0,"fetchShortenedUrl defer success callback"):(i[r]||(i[r]=[],o=!0),i[r].push({success:e,error:t}),o&&(t=(creative.runtimeParams.secure?creative.cachedApiUrl:creative.insecureCachedApiUrl)+"shortenedUrls/",o={url:r,fields:"shortUrlKey"},n={cbName:"shortener_"+btoa(to_utf8(r)).replace(/\//g,"$").replace(/\+/g,"_").replace(/=/g,"")},loadJSONP(t+"?"+buildQuery(o),n,function(e){e=creative.shareUrl+e.shortUrlKey;c("success",a[r]=e)},function(){requestCreateShortenedUrl(r,c)})))}function requestCreateShortenedUrl(t,n){var e=(creative.runtimeParams.secure?creative.apiUrl:creative.insecureApiUrl)+"shortenedUrls/",r=fetchShortenedUrl.cache,o=new XMLHttpRequest;o.open("POST",e),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){var e;4===o.readyState&&(201===o.status?(e=JSON.parse(o.responseText),e=creative.shareUrl+e.shortUrlKey,r[t]=e,n("success",e)):n("error"))},o.send(JSON.stringify({url:t}))}function isMediaPlaying(e){try{return 0=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(i){function o(e,n){this.os=new t(e.osName,e.osVersion),this.browser=new r(e.browserName,e.browserVersion,n),this.engine=new s(e.browserRenderingEngine,e.browserRenderingEngineVersion),this.deviceType=new a(e.deviceType,e.mobileDevice),this.vendor=e.vendor||"",this.model=e.model||"",this.userAgent=n}function t(e,n){this.name=e||"",this.version=n||"0"}function r(e,n,t){this.name=e||"",this.version=n||"0",this.userAgent=t}function s(e,n){this.name=e||"",this.version=n||"0"}function a(e,n){this.hardwareType=e||"",this.mobile=n||""}function u(e,n){var t,r,i;if(!e)return!0;if(0===n.length)i=r=null;else if(1===n.length)r=n[0],i=n[0];else{if(2!==n.length)throw"Invalid number of arguments";r=n[0],i=n[1]}function o(e){return parseInt(e.replace(/\D/g,""),10)}for(e=e.split(".").map(o),r=r?r.split(".").map(o):[],i=i?i.split(".").map(o):[],t=Math.max(r.length,i.length)-e.length;0<=t;t--)e.push(0);function s(e,n){for(var t=0;tn[t])return 1}return 0}return!(-1===s(e,r)||1===s(e,i))}t.prototype.android=function(){return"Android"===this.name&&u(this.version,arguments)},t.prototype.osx=function(){return"OSX"===this.name&&u(this.version,arguments)},t.prototype.ios=function(){return"IOS"===this.name&&u(this.version,arguments)},t.prototype.windows=function(){return"Windows"===this.name&&u(this.version,arguments)},t.prototype.windowsPhone=function(){return"WindowsPhone"===this.name&&u(this.version,arguments)},t.prototype.linux=function(){return"Linux"===this.name},r.prototype.safari=function(){return"Safari"===this.name&&u(this.version,arguments)},r.prototype.chrome=function(){return 0===this.name.indexOf("Chrom")&&u(this.version,arguments)},r.prototype.android=function(){return"Android Browser"===this.name&&u(this.version,arguments)},r.prototype.samsung=function(){return"Samsung Browser"===this.name&&u(this.version,arguments)},r.prototype.opera=function(){return 0===this.name.indexOf("Opera")&&u(this.version,arguments)},r.prototype.firefox=function(){return 0===this.name.indexOf("Firefox")&&u(this.version,arguments)},r.prototype.edge=function(){return"Edge"===this.name&&u(this.version,arguments)},r.prototype.miui=function(){return"MIUI Browser"===this.name&&u(this.version,arguments)},r.prototype.webView=function(){var e,n,t=null;return"iP"===(i.navigator.platform||"").substr(0,2)?(e=-1!==(e=this.userAgent).indexOf("Safari")&&-1!==e.indexOf("Version"),n=!/constructor/i.test(i.HTMLElement),e&&!i.navigator.standalone?t="iOS Safari or Safari Controller":(n||i.indexedDB)&&i.statusbar.visible?(i.webkit&&i.webkit.messageHandlers||n||i.indexedDB)&&(t="WKWebView"):t="UIWebView"):/^.*\/\d\.\d \(.*wv\).*/.test(this.userAgent)&&(t="AndroidWebView"),t},r.prototype.facebookApp=function(){var e=this.userAgent;return-1=this.win.innerWidth||t.clientY<=0||t.clientY>=this.win.innerHeight)&&this.cancelInteraction()},TouchEventSimulator.prototype.handleDragStart=function(t){return t.preventDefault(),!1},TouchEventSimulator.prototype.handlePointerDown=function(t){0==t.button&&(this.touch={identifier:0,target:t.target},this.updateTouchCoordinates(t),this.fireTouchEvent("touchstart",t))},TouchEventSimulator.prototype.handlePointerMove=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchmove",t))},TouchEventSimulator.prototype.handlePointerUp=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchend",t))},TouchEventSimulator.prototype.handlePointerCancel=function(t){this.touch&&0==t.button&&(this.updateTouchCoordinates(t),this.fireTouchEvent("touchcancel",t),this.touch=null)},TouchEventSimulator.prototype.fireTouchEvent=function(t,e){var o=this.doc.createEvent("HTMLEvents");o.initEvent(t,!0,!0),"touchend"==t||"touchcancel"==t?(o.touches=o.targetTouches=[],o.changedTouches=[this.touch]):o.touches=o.targetTouches=o.changedTouches=[this.touch],e.target.dispatchEvent(o)},TouchEventSimulator.prototype.cancelInteraction=function(){this.touch&&(this.fireTouchEvent("touchcancel",this.touch),this.touch=null)};;
function Logger(e){if(!(this instanceof Logger))return new Logger(e);e=e||"";var n=noop;(0<=Logger.enabledNames.indexOf(e)||0<=Logger.enabledNames.indexOf("all"))&&(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(){var e=new Date;function n(e,n){for(e+="";e.length=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(i/this._targetTime,this.options.exp)*e+this._startValue};;
function Tapper(T,C){var m="undefined"!=typeof creative&&creative.adapter||adapter;function w(t){for(var e=t,a=null;1!=e.nodeType;)e=e.parentNode;for(;e&&1==e.nodeType&&e.tagName;){var n=e.tagName.toLowerCase();if(hasClass(e,"touchable")||"a"===n&&e.href||"button"===n||"img"===n||"input"===n&&e.type&&"button"===e.type.toLowerCase()){a=e;break}e=e.parentNode}return a}function k(t,e){t=t.ownerDocument.createEvent("MouseEvents");t.initEvent("tap",!0,!0),e.dispatchEvent(t)}(C=C||m.useNativeClickForTapDetection)&&(attach(T,"click",function(t){t=w(t.target);t&&k(T,t)},!m.nativeClickEmittedOnSwipe),m.useNativeClickForTapDetection)||attach(T,"touchstart",function(t){var a,n,o,c,i,r,u,h,d,s,l,v,p,e,f,g=w(t.target);g&&(o=!1,window.top!==window&&(n=(a=function(){var t=m.getTopWindow();return[t.scrollX,t.scrollY,t.innerWidth,t.innerHeight]})(),o=!0),c=t.targetTouches[0].clientX-10,i=t.targetTouches[0].clientX+10,r=t.targetTouches[0].clientY-10,u=t.targetTouches[0].clientY+10,addClass(g,"touched"),l=s=d=h=!1,v=new Date,p=function(t){var e;h||d||(e=t.targetTouches[0].clientX,t=t.targetTouches[0].clientY,h=o&&n.toString()!=a().toString(),((d=!(c<=e&&e<=i&&r<=t&&t<=u))||h?removeClass:addClass)(g,"touched"))},e=function(t){var e;l||(l=!0,detach(T,"touchmove",p,!1),detach(T,"touchend",arguments.callee,!1),hasClass(g,"touched")&&(e=200=TrackingCenter.eventCountLimit},TrackingCenter.prototype._createTrackingEvent=function(e){return e=JSON.parse(JSON.stringify(e)),extend({sessionId:this._sessionId,accountId:this._accountId,stream:"adEvents",instantiation:this._instantiation,index:this._eventIndex++,clientTimestamp:new Date/1e3},e)},TrackingCenter.prototype._addEventPendingToQueues=function(e){e=this._resolvePixelsAndEventsForQueue([e]);this.isTrackingLimitReached()&&e.events.push(this._createTrackingEvent({name:"eventLimitReached"})),e.events.forEach(function(e){Logger("tracking").log("Queuing event "+JSON.stringify(e))}),e.pixels.forEach(function(e){Logger("tracking").log("Queuing pixel "+JSON.stringify(e))}),this._pendingEvents=this._pendingEvents.concat(e.events),this._pendingPixels=this._pendingPixels.concat(e.pixels)},TrackingCenter.prototype.track=function(e,t){this.trackNoLaterThan(e,0,t)},TrackingCenter.prototype.trackNoLaterThan=function(e,t,n){var i,s,r;this.isTrackingLimitReached()?console.warn("Tracking limit reached: "+TrackingCenter.eventCountLimit+" events."):(i=t,parseInt(i,10)!==i?t=1500:t<0&&(t=0),n=n||noop,"live"!==this._purpose?(i=this._createTrackingEvent(e),Logger("tracking").log("Ignoring non-live event "+JSON.stringify(i)),defer(n)):(s=null,this._addEventPendingToQueues(e),r=this.windowForPixels,this.once("trackingQueueEmptied",function(){s&&(r.clearTimeout(s),s=null),n()}.bind(this)),s=this._useBatching?r.setTimeout(this._flushPixels,t):r.setTimeout(this.flush,t)))},TrackingCenter.prototype._resolvePixelsAndEventsForQueue=function(e){var o=this;return function e(t,n,i){var s,r;return 0==t.length?{events:n,pixels:i}:(s=t[0],s=o._createTrackingEvent(s),r=o._trackers.urlsAndEventsFor(s),e(t.slice(1).concat(r.events||[]),n.concat(s),i.concat(r.urls||[])))}(e,[],[])},TrackingCenter.prototype._fireBeacon=function(e,t){this.windowForPixels.navigator.sendBeacon(e),t()},TrackingCenter.prototype._firePixel=function(e,t){function n(){i.onload=i.onerror=null,t()}var i=this.windowForPixels.document.createElement("img");i.onload=i.onerror=n;try{i.src=e}catch(e){n()}},TrackingCenter.prototype._decrementWaiting=function(){0e&&(t.apply(n,arguments),o.lastCall=Date.now())}},o.isFunction=function(t){return"function"==typeof t},o.constantly=function(t){return function(){return t}},o.hash=function(){for(var t=Array.prototype.slice.apply(arguments),e=0,n=0;n>1,marginVertical:r>>1}},o.removeUnits=function(t){return parseInt(t.replace(/[a-z]+/,""))},o.capitaliseFirstLetter=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},o.createHandlerName=function(t,e){return(e=e||"on")+o.capitaliseFirstLetter(t)},o.forEach=function(t,e,n){for(var i in t)e.call(n,t[i],i,t)},o.changeStyle=function(t,e,n){for(var i,r=0;rd.indexOf(i.canPlayType)?-1:1}).shift().id;o=[t]}var a=!deviceInfo.deviceType.desktop()&&i.isVideo360&&e&&!i.startMuted,c;return{clazz:deviceInfo.os.ios(null,"10")&&i.isVideo360?"CrossOriginHtml5VideoEngine":"Html5VideoEngine",presets:o,engineType:"html5",doAVSync:a,isTeaser:i.isTeaser,preload:i.preload,crossOrigin:true,options:{}}}(i,e),o)},VideoEngineProvider.createVideoSourceObjects=function(e,n){var d=e.doAVSync||e.isTeaser;return e.presets.map(function(e){i=n;var i=c(merge({from:i.from,to:i.to,muted:d?"1":null,transform:"VideoStream",celtraCacheBust:v(e)},i.customUrlParameters)),r=creative.videoTranscodingPresets[e].mediaType,o=t(r.mime);return createSourceObject(a(s("cachedApi"),"videoStream",n.blobHash,e,o,i),r)})},window.VideoEngineProvider=VideoEngineProvider,AudioEngineProvider.createAudioEngineSpec=function(e){return e.doAVSync?{clazz:"undefined"!=typeof AudioContext||"undefined"!=typeof webkitAudioContext?"WebAudioEngine":"Html5AudioEngine",preload:e.preload}:null},AudioEngineProvider.createAudioSourceObjects=function(n){return["aacAudio"].map(function(e){var i=n?(i=n,c(merge({from:i.from,to:i.to,transfom:"VideoStream",celtraCacheBust:v(e)},i.customUrlParameters))):{},r=creative.videoTranscodingPresets[e].mediaType,o=t(r.mime);return createSourceObject(a(s("cachedApi"),"videoStream",n.blobHash,e,o,i),r)})},window.AudioEngineProvider=AudioEngineProvider}();;
!function(){function i(){}var a,t,n={fsvp:{attachment:"body",positioning:"screen",type:"layer"}},l={},s=null,d=!1,c=null;function o(){videoEventsAdapter=null,d=!1,a=s=null}function f(){videoEventsAdapter&&(videoEventsAdapter.destroy(),videoEventsAdapter=null),s&&(s.destroy(),a.destroy(),o())}i.init=function(e){o(),l=merge({hideControls:!1,controlsHidden:!1,baseUrl:urls.staticUrl+"runner/FullscreenVideoPlayer/",muteUnmuteEnabled:!0},e||{}),adapter.createPlacements(n,function(){c=adapter.placements.fsvp})},i.play=function(e,t,n){adapter._stopAllMedia("toPlayVideo"),f();d=!1,a=new FullScreenHandler(c.getContainer(),!1,!1),0;try{var o=parseFloat(t.file.meta.duration)}catch(e){o=null}t.file.meta&&(l.muteUnmuteEnabled=l.muteUnmuteEnabled&&t.file.meta.hasAudio);function r(e){return new BasicVideoControls(e)}o={autoplay:!1,baseUrl:l.baseUrl,closeFSOnEnd:!0,fullscreenMode:"permanent",autohideTime:3,duration:o},t.file.meta&&(o.videoWidth=t.file.meta.width,o.videoHeight=t.file.meta.height),o=(s=new VideoPlayer(a.getElement(),function(){return{clazz:"Html5VideoEngine",engineType:"html5",videoUrl:t.file.getUrl(),doAVSync:!1,options:{}}},function(e,t){e=new BasicVideoControlsController(e,r,extend(l,t));return e.on("playButtonPressed",function(){s.play()}.bind(this)),e},function(){return!0},o)).createSpecs(!0,!1);s.initialize(o),i.attachListeners(n),videoEventsAdapter=new VideoEventsAdapter(s),e.registerSource(videoEventsAdapter),s.on("userInteraction",function(){e.trackUserInteraction()}),c.setPosition(0,0),c.show(),s.play(),s.redraw()},i.attachListeners=function(e){t=CeltraPlayerUtils.idempotented(function(){e(d)}),s.on("timeupdate",i.onTimeUpdate),s.on("close",i.close),s.on("ended",i.close),s.on("error",i.close),s.on("exitfullscreen",i.close),adapter.once("dismissed",i.close),adapter.once("collapsed",i.close),adapter.on("orientationchange",i.refresh),adapter.on("resize",i.refresh),adapter.once("mediaStopRequested",i.close)},i.removeListeners=function(){s.off("timeupdate",i.onTimeUpdate),s.off("close",i.close),s.off("ended",i.close),s.off("error",i.close),s.off("exitfullscreen",i.close),adapter.off("dismissed",i.close),adapter.off("collapsed",i.close),adapter.off("orientationchange",i.refresh),adapter.off("resize",i.refresh),adapter.off("mediaStopRequested",i.close)},i.onTimeUpdate=function(){.5=this._buffer.duration?clearInterval(this._emitTimeUpdateInterval):this._emitTimeUpdateInterval=setInterval(this.emit.bind(this,"timeupdate"),250)},_decodeAudioData:function(){s.decodeAudioData(this._encodedBuffer,function(e){this._buffer=e,this._loadStatus="loaded",this.emit("canplay"),this.emit("canplaythrough")}.bind(this))}}),Object.defineProperties(o,{paused:{get:function(){return this._paused}},ended:{get:function(){return!1}},ready:{get:function(){return"loaded"===this._loadStatus}},playedBefore:{get:function(){return i}},currentTime:{get:function(){return this._paused?this._pausedAt:s.currentTime-this._timeDiff},set:function(e){this._pausedAt=e,"loaded"!==this._loadStatus||this._paused||(this.pause(),this.playAudio(e))}}}),e.WebAudioEngine=function(e,t,i){return Object.create(o).init(e,t,!!i)}}(this);;
!function(){this.Html5AudioEngine=function(e,t){var n,i,o;return"undefined"==typeof Audio?null:((n=new Audio).isUnlocked=!1,t?(n.preload="auto",CeltraPlayerUtils.setMediaElementSource(document,n,e),n.start=noop):(n.preload="none",n.start=function(){CeltraPlayerUtils.setMediaElementSource(document,n,e),n.start=noop}),n.ready=!1,o=function(){.3',' ','
','
','
','
','
','
","
",' ",""],extend(o.prototype,{render:function(t,n){var e,i=n.isMasterVideo?[]:["play","replay"];return this._container||(e={},CeltraPlayerUtils.createDom(t,o.TEMPLATE,{desktop:deviceInfo.deviceType.desktop()?"video-controls-desktop":""},this._getWrapper(e)),this._container=e.wrapper,n.isMasterVideo&&this.hide("outOfPlaySet"),this._container.querySelector("[data-bind=progressBar]").style.backgroundColor=n.progressbarColour,this._container.querySelector("[data-bind=timeBar]").style.backgroundColor=n.progressbarColour,(t="undefined"!=typeof creative?creative:window.creative)&&(e="MRAIDAdapter"===t.adapter.constructor.name,"crop"===n.fitting&&e&&(this._container.querySelector("[data-bind=exitFullScreen]").style.top="50px")),i.forEach(function(t){var e,i;n[t]&&(e=n[t],i=this._getElements(t)[0],removeClass(i,"center-button"),addClass(i,"custom-button"),i.innerHTML='
')}.bind(this)),this._container.addEventListener("tap",this.onTapHandler)),this._container},show:function(){CeltraPlayerUtils.show.apply(null,this._getElements.apply(this,arguments))},hide:function(){CeltraPlayerUtils.hide.apply(null,this._getElements.apply(this,arguments))},showCursor:function(t){CeltraPlayerUtils.showCursor([t])},hideCursor:function(t){CeltraPlayerUtils.hideCursor([t])},setProgressBarWidth:function(t){t=Math.min(t,1),this._container&&this._container.querySelector("[data-bind=progressBar]")&&(this._container.querySelector("[data-bind=progressBar]").style.width=100*t+"%")},setTimeBarWidth:function(t){t=Math.min(t,1),this._container&&this._container.querySelector("[data-bind=timeBar]")&&(this._container.querySelector("[data-bind=timeBar]").style.width=100*t+"%")},hideAndShowWrapper:function(){this.hide("wrapper"),defer(function(){this.show("wrapper")}.bind(this))},disableMuteUnmuteControls:function(){this._getElements("mute")[0].innerHTML="",this._getElements("unMute")[0].innerHTML=""},pendingStateOn:function(t){addClass(this._getElements(t)[0],"video-controls-pending")},pendingStateOff:function(t){this._container&&removeClass(this._getElements(t)[0],"video-controls-pending")},addClass:function(t,e){t=this._getElements(t)[0];t&&addClass(t,e)},removeClass:function(t,e){t=this._getElements(t)[0];t&&removeClass(t,e)},orientationChange:function(t){t()},onTapHandler:function(t){t.stopPropagation();t=t.target.getAttribute("data-bind");t&&this._userInteractionHandler(t)},setDTMouseMoveHandler:function(e){e.addEventListener("mousemove",function(t){t.stopPropagation();t=t.target,t=t!==e?t.getAttribute("data-bind"):"vidWrapper";this.hasMouseMoved?this.hasMouseMoved=!1:"wrapper"!==t&&"vidWrapper"!==t||this._userInteractionHandler(t,!0)}.bind(this))},_getWrapper:function(i){return function(t){var e=t.getAttribute("data-bind");e&&(i[e]=t)}},_getElements:function(){if(this._container){for(var t,e=[],i=0;i',' ',' ',' ',""],t.prototype._init=function(){var e;CeltraPlayerUtils.createDom(this._doc,t.DOM,this._opts,CeltraPlayerUtils.xBindFactory(this)),CeltraPlayerUtils.insertStyleTag("celtra-video-player-style",VideoPlayerCss,this._doc),this._controlsController&&(this._controlsEl=this._controlsController.render(this._doc),this._controlsWrapperEl.appendChild(this._controlsEl)),this._containerEl.appendChild(this._wrapperEl),this._posterShow(),this._controlsController&&this._controlsController.adjustSizes(this._containerEl.clientHeight),this._opts.preload&&(e=this.createSpecs(!1,this._opts.startMuted),this.initialize(e)),this.dtCanFullscreen=this.isDesktop&&this._toggleDesktopFSStateHandlers("add")},t.prototype.setDimensions=function(e,t){this.width=e,this.height=t,this.redraw(),this.emit("rendered")},t.prototype.getVideoElement=function(){return this._videoEngine},t.prototype.getControlsElement=function(){return this._controlsEl},t.prototype.getWrapperElement=function(){return this._wrapperEl},t.prototype._posterHide=function(){this._posterShown&&(this._posterShown=!1,this._posterEl.style.display="none")},t.prototype._posterShow=function(){this._posterShown||(this._posterShown=!0,this._posterEl.style.display="")},extend(t.prototype,{onLoadStart:function(){this.emit("loadstart")},onLoadedMetaData:function(){this.redraw(),this.emit("canunmute")},onCanPlay:function(){this.emit("canplay")},onDurationChange:function(){this.emit("durationchange")},onBuffering:function(){this.changeState(CeltraPlayerUtils.BUFFERING),this.emit("buffering")},onEndBuffering:function(){this.emit("endbuffering")},onPlayerSourceLoading:function(e){(this._opts.autoplay||e)&&this.emit("playersourceloading")},onMuted:function(){this._muted=!0,this.emit("muted")},onUnMuted:function(){this._muted=!1,this.emit("unmuted")},onVolumeChange:function(e){this._muted=0==e,this.emit(this._muted?"muted":"unmuted"),this.emit("volumechange",e)},onProgress:function(){"object"==typeof this._videoEngine.buffered&&0=this._opts.playTo&&(this._hasToBeRepeated()?this._doRepeat():(this.pause(),this._doEnd()))},onPlay:function(){this.emit("play")},onPlaying:function(){this.emit("playing"),this.changeState(CeltraPlayerUtils.PLAYING),this.playSucceeded=!0,this.redraw()},onPause:function(){this.changeState(CeltraPlayerUtils.PAUSED),this.emit("pause")},onAutoplayRejected:function(){this.emit("autoplayrejected")},onAutoplayNotPossible:function(){this.emit("autoplaynotpossible")},onForceMuted:function(){this.emit("forcemuted")},onExitFullScreen:function(){this.exitFullScreen()},onEnded:function(){this._playingEmitted=!1,this._hasToBeRepeated()?this._doRepeat():this._doEnd()},getContainerDimensions:function(){var e;return this.isFullScreen?{width:(e=this.dtCanFullscreen?this._wrapperEl:this._wrapperEl.parentNode).clientWidth,height:e.clientHeight}:{width:this.width,height:this.height}},redraw:function(){var e="fit"!==this._opts.fitting,t=this._aspectRatio,i=this.getContainerDimensions(),n=CeltraPlayerUtils.fitComponent(100*t,100,i.width,i.height,e);switch(this.anchoringPoint){case"top":n.marginVertical=0;break;case"bottom":n.marginVertical=Math.ceil(i.height-n.height)}this._opts.videoElement||(this._wrapperEl.style.background=this._opts.barColor);function s(e){e.width=n.width+"px",e.height=n.height+"px",e.minHeight=n.height+"px",e.left=n.marginHorizontal+"px",e.top=n.marginVertical+"px"}var t=this._opts.videoPosition||"center";t.includes("top")?n.marginVertical=0:t.includes("bottom")&&(n.marginVertical=Math.ceil(i.height-n.height)),t.includes("left")?n.marginHorizontal=0:t.includes("right")&&(n.marginHorizontal=Math.ceil(i.width-n.width));e?(s(this._engineContainerEl.style),s(this._posterEl.style),(t=this._controlsWrapperEl.style).width=i.width+"px",t.height=i.height+"px",t.minHeight=i.height+"px",t.left=0,t.top=0):(s(this._engineContainerEl.style),s(this._posterEl.style),s(this._controlsWrapperEl.style))},onSeeking:function(){this.emit("seeking")},onSeeked:function(e){if(this._seeked){switch(this._seeked=!1,this._stateBeforeSeek){case CeltraPlayerUtils.PLAYING:this.play();break;case CeltraPlayerUtils.PAUSED:this.silentPause()}this._stateBeforeSeek=void 0}this.emit("seeked")},onError:function(){this.emit("error")},onCanUnMute:function(){this.emit("canunmute")},onCustomInfo:function(e){this.emit("custominfo",e)}}),extend(t.prototype,{getState:function(){return this._state},mute:function(){this._videoEngine&&"function"==typeof this._videoEngine.mute&&this._videoEngine.mute(),this.onMuted()},unMute:function(){this._videoEngine&&"function"==typeof this._videoEngine.unMute&&this._videoEngine.unMute(),this.onUnMuted()},silentPlay:function(){this._videoEngine.play()},createSpecs:function(e,t){e=this._videoEngineSpecProvider(e,t),e=merge(e,{options:this._opts}),this._opts.videoStream&&this._opts.videoStream.useRaw&&(e.videoUrl=(creative.secure?creative.cachedApiUrl:creative.insecureCachedApiUrl)+"blobs/"+this._opts.videoStream.blobHash),t=AudioEngineProvider.createAudioEngineSpec(e);return{videoEngineSpec:e,videoSources:e.videoUrl?[CeltraPlayerUtils.createSourceObject(e.videoUrl,null)]:VideoEngineProvider.createVideoSourceObjects(e,this._opts.videoStream),audioEngineSpec:t,audioSources:t?AudioEngineProvider.createAudioSourceObjects(this._opts.videoStream):null}},initialize:function(e){this._createEngines(e),CeltraPlayerUtils.isNode(this._engineEl)&&!this._engineEl.parentNode&&this._engineContainerEl.appendChild(this._engineEl),e.videoEngineSpec.options.videoElement&&(this._wrapperEl.style.background="transparent"),CeltraPlayerUtils.attachHandlers(this,this._videoEngine,n),void 0!==e.videoEngineSpec.startMuted&&(e.videoEngineSpec.startMuted?this.mute():this.unMute()),"fit"===e.videoEngineSpec.options.fitting&&this._engineContainerEl.classList.add("video-player-engine-fit"),this._initialized=!0},play:function(e){null==this._videoEngine?Logger("VideoPlayer").log("Video not initialized!"):(this.isState(CeltraPlayerUtils.UNSTARTED,CeltraPlayerUtils.ENDED)&&this.changeState(CeltraPlayerUtils.BUFFERING),this._firstPlay&&!e&&this.unMute(),this._firstPlay=!1,this._videoEngine.play(),this.emit("userplayed"))},_createEngines:function(e){var t;null===this._videoEngine&&(this._engineType=e.videoEngineSpec.engineType,this._videoPresets=e.videoEngineSpec.presets,"JsVideoEngine"==e.videoEngineSpec.clazz?this._videoEngine=new JsVideoEngine(e.videoSources[0].url,this._engineType,e.videoEngineSpec):"Html5VideoEngine"==e.videoEngineSpec.clazz&&(this._videoEngine=Html5VideoEngine(e.videoSources,e.videoEngineSpec)),null!==e.audioEngineSpec&&(t=null,"WebAudioEngine"==e.audioEngineSpec.clazz?(t=WebAudioEngine(e.audioSources[0].url,e.audioEngineSpec.preload),Object.create(AVSyncWebAudio).init(this,t,e.videoEngineSpec.startMuted)):"Html5AudioEngine"==e.audioEngineSpec.clazz&&(t=Html5AudioEngine(e.audioSources,e.audioEngineSpec.preload),Object.create(AVSyncAudio).init(this,t,e.videoEngineSpec.startMuted))),this._engineEl=this._videoEngine.render(this._doc,{playsInline:this.playsInline()}))},silentPause:function(){this._videoEngine.pause()},pause:function(){this._videoEngine&&this._videoEngine.pause(),this.emit("userpaused"),this._playingEmitted=!1},close:function(){this.playsInline()?this.exitFullScreen():this.emit("close")},replay:function(){this.emit("replayed"),this.setCurrentTime(0),this._playingEmitted=!1,this.play()},reset:function(){this._videoEngine.pause(),this._videoEngine.reset(),this._posterShow(),this._controlsController&&this._controlsController.reset(),this._timeUpdateCounter=0,this._playingEmitted=!1},enterFullScreen:function(){if(this._videoEngine){if(this._containerElzIndex=this._containerEl.style.zIndex,this.dtCanFullscreen){var e=this._wrapperEl;(e.requestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen).bind(e)()}else{this.isFullScreen=!0;var t=this._wrapperEl;for(this.isState(CeltraPlayerUtils.PAUSED);t&&!t.getAttribute("class").includes("celtra-base-creative-unit");)t=t.parentNode;t.insertBefore(this._wrapperEl,t.firstChild),this._wrapperEl.style.zIndex=CeltraPlayerUtils.ZINDEX_MAX,this.redraw(),this.silentPauseActive=!0,defer(function(){this.silentPauseActive=!1}.bind(this),500),this._initialized&&this._videoEngine.pause()}this._initialized&&this._videoEngine.play(),this.emit("enterfullscreen")}},exitFullScreen:function(){var e;this.dtCanFullscreen?((e=document).exitFullscreen||e.webkitExitFullscreen||e.mozCancelFullScreen||e.msExitFullscreen).bind(e)():(this.isFullScreen=!1,this.isState(CeltraPlayerUtils.PAUSED,CeltraPlayerUtils.ENDED),this._wrapperEl.style.zIndex="",this._containerEl.style.zIndex=this._containerElzIndex,this._containerEl.appendChild(this._wrapperEl),this.silentPauseActive=!0,defer(function(){this.silentPauseActive=!1}.bind(this),500),this.once("pause",CeltraPlayerUtils.validFor(function(){this.play(),this._muted||defer(this.unMute.bind(this),100)}.bind(this),500))),this.redraw(),this.emit("exitfullscreen")},hide:function(){this._wrapperEl&&(this._wrapperEl.style.display="none")},show:function(){this._wrapperEl&&(this._wrapperEl.style.display="")},destroy:function(){this._videoEngine&&(this._videoEngine.pause(),this._videoEngine.destroy(),this._controlsController&&this._controlsController.destroy());var e=function(){CeltraPlayerUtils&&this._wrapperEl&&CeltraPlayerUtils.removeElements(this._wrapperEl),this._toggleDesktopFSStateHandlers("remove"),this._wrapperEl=null}.bind(this);"undefined"!=typeof TouchEventSimulator?defer(e,100):e(),this.emit("destroy")},getDuration:function(){return this.duration},getCurrentTime:function(){return this._videoEngine?this._videoEngine.getCurrentTime():null},setCurrentTime:function(e){this._videoEngine&&this._videoEngine.setCurrentTime(e)},seekTo:function(e){this.emit("seekto",e),this._seeked||(this._stateBeforeSeek=this.getState(),this.getState()===CeltraPlayerUtils.PLAYING&&this.pause()),this._seeked=!0,this._videoEngine.seekToRatio(e)}}),t.prototype._hasToBeRepeated=function(){return this._repeatedthis._lastPlayingPosition&&(this._lastPlayingPosition=t),this._lastPlayingPosition-this._startPlayingPosition>=this.maxPlayingSegmentLength&&this.flush()},t.prototype.flush=function(t){var i,n;null!=this._startPlayingPosition&&(i=this._startPlayingPosition,n=this._lastPlayingPosition,(t||.4Math.min(1,.25*i)},videoFirstQuartile:function(n,t,i){i*=.25;return nMath.max(.75*i,i-2)}};window.QuartileEventsEmitter=function(n){n.QUARTILE_EVENTS=i;var r={},u=(Object.keys(i).forEach(function(n){r[n]=i[n]}),null),t=function(){var n,t=null===u||null!==u&&this.currentTime>u?this.currentTime:u,i=(n=this).serverReportedDuration||(-1!==o.indexOf(n.duration)?null:n.duration);if(null!==i&&null!==u&&t&&t-u<1)for(var e in 0=this._serverReportedDuration||(e=!this._serverReportedDuration||t.tothis._currentTime&&(this._currentTime=this._video.currentTime),this._currentTime},t.prototype.start=function(){this._running||(this._running=!0,this._viewDirectionsObserver&&this._viewDirectionsObserver.start(),s().mediaState.startVideo(),this._firstSegmentEmitted||(this._currentTime=this.getCurrentTime()+.01,this.trackVideoPlayedSegment({from:0,to:this.getCurrentTime()}),this._firstSegmentEmitted=!0),this._playedSegmentComputationUnit.init(this.getCurrentTime()),clearInterval(this._intervalId),this._intervalId=setInterval(this.tick,250))},t.prototype.stopAndReset=function(){this.stop(!0),this._playedSegmentComputationUnit&&(this._playedSegmentComputationUnit.reset(),this._currentTime=0,this._firstSegmentEmitted=!1,this._viewDirectionsObserver&&this._viewDirectionsObserver.reset())},t.prototype.flush=function(){this._playedSegmentComputationUnit&&this._playedSegmentComputationUnit.flush()},t.prototype.stop=function(t){(this._running||t)&&(this._running&&(s().mediaState.stopVideo(),this._running=!1,clearInterval(this._intervalId)),this._viewDirectionsObserver&&this._viewDirectionsObserver.stop(),this._playedSegmentComputationUnit.addEvent(this.getCurrentTime()),this._playedSegmentComputationUnit.flush(t))},t.prototype.trackDurationChange=function(){var t,e,i,s;this.checkDuration&&(t=this._video.duration,e=-1!==n.indexOf(t),i=-1!==r.indexOf(t),s=t!==this._lastObservedDuration,e||i||!s||(this._serverReportedDuration=t,this.emit("videoDurationUpdate",{duration:t}),this._lastObservedDuration=t))},t.prototype.tick=function(){this.trackDurationChange();var t=this.getCurrentTime(),e=Date.now()-(this._lastTickTime||Date.now());t==this._lastObservedPosition&&1e3',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)return this.querySelector("#viewport");throw new Error("Root node not attached to document yet!")},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,r){this.root=t.ownerDocument.createElement("div"),this.root.style.overflow="hidden",addClass(this.root,"notranslate"),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.");for(var t in this.frame.contentDocument.open(),this.windowVarsByRef)this.frame.contentWindow[t]=this.windowVarsByRef[t];var e="";for(t in this.windowVarsByCopy)e+="window."+t+" = "+JSON.stringify(this.windowVarsByCopy[t])+";\n";this.frame.contentDocument.write(IframePlacement.baseHTML);var n=this.frame.contentDocument.createElement("script");n.textContent=e+";\n"+this.unitScript,this.frame.contentDocument.body.appendChild(n),attach(this.frame,"load",function(){this.setupFrame(),r&&defer(r,void 0,void 0,useAsap())}.bind(this)),this.frame.contentDocument.close()}.bind(this),void 0,void 0,useAsap())},IframePlacement.prototype.destroy=function(){this.stopSyncingIframeSize(),IframePlacement.uber.destroy.apply(this,arguments)},IframePlacement.prototype.createElement=function(t){return this.frame.contentDocument.createElement(t)},IframePlacement.prototype.querySelector=function(t){return this.frame.contentDocument?this.frame.contentDocument.querySelector(t):null},IframePlacement.prototype.querySelectorAll=function(t){return this.frame.contentDocument?this.frame.contentDocument.querySelectorAll(t):[]},IframePlacement.prototype._getViewportElement=function(){return this.querySelector("#viewport")},IframePlacement.prototype.hidePlacementFromScreenReader=function(){this.frame.tabIndex=-1,this.frame.setAttribute("aria-hidden","true")},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(t){Placement.apply(this,arguments)}inherit(DivPlacement,Placement),DivPlacement.prototype.attachTo=function(t,e){this.root=t.ownerDocument.createElement("div"),this.root.style.overflow="hidden",addClass(this.root,"notranslate"),this.hide(),t.appendChild(this.root),this.touchEventSimulator=new TouchEventSimulator(this.root),this.touchEventSimulator.init(),e&&defer(e,0,"DivPlacement.attachTo defer callback",useAsap())},DivPlacement.prototype.destroy=function(){DivPlacement.uber.destroy.apply(this,arguments),this.touchEventSimulator.stop(),this.touchEventSimulator=null},DivPlacement.prototype.getContainer=function(){return this.root},DivPlacement.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)},DivPlacement.prototype.querySelector=function(t){return this.root.querySelector(t)},DivPlacement.prototype.querySelectorAll=function(t){return this.root.querySelectorAll(t)},DivPlacement.prototype._getViewportElement=function(){return this.root};;
function StickyPlacement(t,i,e,s,o){IframePlacement.apply(this,arguments),this.stickyOptions=o,this._handleDismissTouchEnd=this._handleDismissTouchEnd.bind(this),this.origin.horizontal="center",this.origin.vertical=this.stickyOptions.stickiness,this.usesFixedPositioning=!0,this._originalDocumentPadding=null}inherit(StickyPlacement,IframePlacement),StickyPlacement.create=function(t,i,e,s,o){i=new StickyPlacement(i,"",e,s,o);return i.root=t.parentNode,i.root.style.display="none",i.startSyncingIframeSize(),i.frame=t,i.setupFrame(),addClass(i.root,"notranslate"),i},StickyPlacement.prototype.setPosition=StickyPlacement.prototype.setZIndex=noop,StickyPlacement.prototype.show=function(){IframePlacement.prototype.show.apply(this,arguments),IframePlacement.prototype.setZIndex.call(this,-20),this.enableDocumentPadding(),this.update()},StickyPlacement.prototype.hide=function(){IframePlacement.prototype.hide.apply(this,arguments),this.disableDocumentPadding()},StickyPlacement.prototype.attachTo=function(){StickyPlacement.uber.attachTo.apply(this,arguments),addClass(this.root,"celtra-placement-sticky")},StickyPlacement.prototype.populate=function(t,i){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(){var viewport=this.getViewportGeometry();with(this.root.style.overflow="visible",this._dismissButton=this.root.ownerDocument.createElement("img"),this._dismissButton.src=this.stickyOptions.baseUrl+"runner/clazzes/CreativeUnit/close-up.svg",this._dismissButton.style)switch(position="absolute",left="auto",right="6px",width="32px",height="32px",zIndex=10,this.stickyOptions.stickiness){case"top":top="auto",bottom="-16px";break;case"bottom":top="-16px",bottom="auto"}deviceInfo.deviceType.mobileDevice()?attach(this._dismissButton,"touchend",this._handleDismissTouchEnd,!1):attach(this._dismissButton,"click",this._handleDismissTouchEnd,!1),this.root.appendChild(this._dismissButton)},StickyPlacement.prototype._handleDismissTouchEnd=function(t){t.preventDefault(),t.stopPropagation(),this.disableDocumentPadding(),(this.stickyOptions.dismissCallback||noop)()},StickyPlacement.prototype.enableDocumentPadding=function(){var t=this.getRootWindow(),i=t.document.documentElement;this._originalDocumentPadding||(this._originalDocumentPadding=t.getComputedStyle(i)["padding-"+this.stickyOptions.stickiness]),i.style["padding-"+this.stickyOptions.stickiness]=this.root.offsetHeight+"px"},StickyPlacement.prototype.disableDocumentPadding=function(){this.getRootWindow().document.documentElement.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,"Accessibility"in window&&(this._accessibility=new Accessibility),this.adapter.nesting&&this.adapter.nesting.hostileIframe&&this.needsAccessToHostPage()&&this.adapter.trackingCenter.track({name:"userError",userErrorId:"nonFriendlyIFrame"})}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&&e.raf.environment&&(e.raf.isNative||this._allowNonNativeRAFForViewableTime)&&(e.supportsContainerViewability||e.canMeasureViewportPlacementGeometry)},Format.prototype.transitionTo=function(e,t,i){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 r=i||t;e._outerPlacement=r,this.adapter.canMeasureViewportPlacementGeometry&&(r.inView||(r.inView=new PlacementInView(this.adapter,r)),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(t,i){this.adapter.on("orientationchange",function(){t.update(noop,this.adapter.adBehavior.crossScreenSticky)}.bind(this)),t.on("resized",function(){var e;!t._visible||(e=t.getPlacementGeometry()).width<2&&e.height<2||i.setAvailableSize(e.width,e.height)}.bind(this)),t.on("shown",function(){var e=t.getPlacementGeometry();i.setAvailableSize(e.width,e.height),i.enterRenderTree()}),t.on("hidden",function(){i.exitRenderTree()})},Format.prototype._trackViewportPlacementGeometry=function(e){var t=this.adapter.getTopWindow(),e=e.getGlobalGeometry(t),t=getViewportGeometry(t,"win"),e=CRect.adopt(e),t=(e.left+=t.left,e.top+=t.top,{name:"viewportPlacementGeometry",pageDimensions:this.adapter.getPageDimensions(),viewportPositionRect:t,firstPlacementPositionRect:e});this.adapter.trackingCenter.trackNoLaterThan(t)},Format.prototype.setupViewableTimeObserver=function(){var e,t;this._observesViewableTime="0"!==this.adapter.runtimeParams._trackViewableTime,this.observingViewableTime()&&(e=this.adapter,t=new AdViewableTimeTracker(e.trackingCenter,e.raf.environment,e.getTopWindow()),e.canMeasureViewportPlacementGeometry?this.adViewableTimeObserver=new AdViewableInViewObjectObserver(t):this.adViewableTimeObserver=new AdViewableUnitObserver(t),this.adViewableTimeObserver.registerAdapter(e))},Format.IGNORABLES=["INPUT","TEXTAREA","SELECT"],Format.isElementIgnorable=function(e){return-1=i.ratio)?(t=function(){this.removeListener(s),n(i)}.bind(this),"Core"==r?t():this._inTimer[r]||(this._inTimer[r]=this.win.setTimeout(t,i.time))):this._inTimer[r]&&(this.win.clearTimeout(this._inTimer[r]),this._inTimer[r]=null)}.bind(this);return this.addListener(s),s},UnitViewabilityObserver.prototype.waitForViewableCore=function(e){return this.waitForViewable("Core",e)},UnitViewabilityObserver.prototype.waitForViewableIAB=function(e){return this.waitForViewable("IAB",e)},UnitViewabilityObserver.prototype.waitForVideoViewableIAB=function(e){return this.waitForViewable("IABvideo",e)},UnitViewabilityObserver.prototype.waitForVideoViewableFB=function(e){return this.waitForViewable("FBvideo",e)},UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT=242500,UnitViewabilityObserver.selectCriterion=function(e,t){switch(e){case"IAB":return t&&t.width*t.height>UnitViewabilityObserver.LARGE_AD_PIXEL_COUNT?this.criteria.IABlargeAd:this.criteria.IABsmallAd;case"Core":case"IABvideo":case"FBvideo":return this.criteria[e];default:throw new Error("Unknown viewability criterion.")}},UnitViewabilityObserver.criteria={Core:{name:"Core",ratio:0,time:0},IABsmallAd:{name:"50/1",ratio:.5,time:1e3},IABlargeAd:{name:"30/1",ratio:.3,time:1e3},IABvideo:{name:"50/2",ratio:.5,time:2e3},FBvideo:{name:"50/3",ratio:.5,time:3e3}};;
function PlacementInView(t,e,i){this._init(),this.adapter=t,this.placement=e,this.node=e.getContainer(),this.inViewParent=i,this.outerRectInView=CRect.ZERO,this._lastScrollTime=0,this._isTouchDown=!1,this._autoSwitchObserverRunningState=this._autoSwitchObserverRunningState.bind(this),this.destroy=this.destroy.bind(this),this._onScroll=this._onScroll.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this.hacks={wrongBoundingRectWhileScrolling:deviceInfo.os.ios()&&this.placement.isSticky},this.inViewParent||(this._tick=this._tick.bind(this),this._timestepInterval=200,this._lastRunTime=0,this.adapter.on("containerViewableChange",this._autoSwitchObserverRunningState)),e.on("destroyed",this.destroy),this._autoSwitchObserverRunningState(),e.on("shown",this._autoSwitchObserverRunningState),e.on("hidden",this._autoSwitchObserverRunningState),this.hacks.wrongBoundingRectWhileScrolling&&(this.adapter.getTopWindow().addEventListener("scroll",this._onScroll,!0),this.adapter.getTopWindow().addEventListener("touchstart",this._onTouchStart,!0),this.adapter.getTopWindow().addEventListener("touchend",this._onTouchEnd,!0))}inherit(PlacementInView,InViewObject),PlacementInView.prototype._onScroll=function(){this._lastScrollTime=Date.now()},PlacementInView.prototype._onTouchStart=function(){this._isTouchDown=!0},PlacementInView.prototype._onTouchEnd=function(){this._isTouchDown=!1},PlacementInView.prototype._autoSwitchObserverRunningState=function(){var t=this.placement.visible&&this.adapter.containerIsViewable;t&&!this.active?this.start():!t&&this.active&&(this.stop(),this.rectInView=CRect.ZERO,this.outerRectInView=CRect.ZERO,this.areaInView=0,this.emit("rectInViewChanged",this.rectInView),this.emit("outerRectInViewChanged",this.outerRectInView),Logger("InViewObject").debug(this.placement.constructor.name+", rectInViewChanged: "+this.rectInView.toString()),this.emit("areaInViewRatioChanged",this.areaInView),Logger("InViewObject").debug(this.placement.constructor.name+", areaInViewRatioChanged: "+this.areaInView))},PlacementInView.prototype.getNode=function(){return this.placement.getContainer()},PlacementInView.prototype.getOuterRectInView=function(){return this.outerRectInView},PlacementInView.prototype.getParentRect=function(){return this.inViewParent?this.inViewParent.getOuterRectInView():this.adapter.getViewportRect()},PlacementInView.prototype.computeRectInView=function(){var t,e,i,n;this.hacks.wrongBoundingRectWhileScrolling&&(Date.now()-this._lastScrollTime<100||this._isTouchDown)||(t=this.getNode(),n=this.adapter.getPlacementRect(this.placement),t=t?CRect.adopt(t.getBoundingClientRect()):CRect.ZERO,i=this.getParentRect(),n=(i=(e=this.adapter.getPlacementRect(this.placement)).intersect(i)).zero()?CRect.ZERO:i.map(n,t),this._computeMaxPossibleDimensions(e,this.getParentMaxPossDims()),this.rectInView.equals(n)||(this.rectInView=n,this.emit("rectInViewChanged",n),Logger("InViewObject").debug(this.placement.constructor.name+", rectInViewChanged: "+this.rectInView.toString())),this.outerRectInView.equals(i)||(this.outerRectInView=i,this.emit("outerRectInViewChanged",i),Logger("InViewObject").debug(this.placement.constructor.name+", placementRectInViewChanged: "+this.outerRectInView.toString())))},PlacementInView.prototype.destroy=function(){this.hacks.wrongBoundingRectWhileScrolling&&(this.adapter.getTopWindow().removeEventListener("scroll",this._onScroll,!0),this.adapter.getTopWindow().removeEventListener("touchstart",this._onTouchStart,!0),this.adapter.getTopWindow().removeEventListener("touchend",this._onTouchEnd,!0)),this.stop(),this.adapter.off("containerViewableChange",this._autoSwitchObserverRunningState)},PlacementInView.prototype._start=function(){this.inViewParent?this.inViewParent.on("outerRectInViewChanged",this.computeRectInView):this.adapter.Ticker.frame(this._tick,"update")},PlacementInView.prototype._stop=function(){this.inViewParent?this.inViewParent.off("outerRectInViewChanged",this.computeRectInView):this.adapter.Ticker.removeFrame(this._tick,"update")},PlacementInView.prototype._tick=function(){var t=Date.now();t-this._lastRunTime>this._timestepInterval&&(this.computeRectInView(),this._lastRunTime=t)};;
function decorateBefore(t,e){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function decorateAfter(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function decorateCallbackBefore(r,n,o){return function(){for(var t=Array.prototype.slice.call(arguments).slice();t.length=t?e.toString():this.sticky?void 0:"100%":"100%"},CrossScreenFormat.prototype._getMinHeightForFlexiblePlacement=function(t,e){e=this.uvOverrideSize?this.uvOverrideSize.height:(e.variantSelector="widestThenShortest",e.usesUpdatedVariantSelection?e.getVariantForSize(t,this.adapter.getTopWindow().innerHeight).getComputedHeight(t):e.getMatchingBreakpoint(t).height);return e},CrossScreenFormat.getVariantForSize=function(t,e,i){return t.getVariantForSize?t.getVariantForSize(e,i):(t=t.variants,n=e,r=i,t.map(function(t){return{variant:t,rank:function(t,e,i){return e>=t.layouts[0].minSize.width&&i>=t.layouts[0].minSize.height?1:0}(t,n,r)*function(t,e,i){var n=a(t,e,i);return t.layouts[0].minSize.width*t.layouts[0].minSize.height*n*n/(e*i)}(t,n,r)/a(t,n,r)}}).sort(function(t,e){return e.rank-t.rank})[0].variant);function a(t,e,i){return e/i "+t+")");this.destroy()}this.state=t},CrossScreenBannerFormat.prototype._transitionFromNullToDefault=function(e){this._ensureBannerPlacement(function(t){t.creative.trackCreativeLoaded(this.observationAbilities),this.adapter.triggerLoadedEvent(t.root),this._triggerAppearAfterViewable(t,this.units.banner),this.start(),e()}.bind(this))},CrossScreenBannerFormat.prototype._ensureBannerPlacement=function(r){this.placements.banner?defer(function(){r(this.placements.banner)}.bind(this)):this.adapter.createPlacements({banner:{attachment:"inline",positioning:this.sticky?"static":"container",type:"unit"}},function(){var t=this.placements.banner,e=t.creative.units.banner,i=(this._accessibility&&(this._accessibility.setAccessibilityProperties(e),this._accessibility.createAndPopulateAccessibilityPlacement(this.adapter),t.hidePlacementFromScreenReader()),"1"!=this.adapter.runtimeParams.ignoreCssCustomClass&&"1"!=this.adapter.runtimeParams.campaignExplorer&&(t.applyCustomPubClasses(),this.adapter.usePubCSS=t.usePubClasses()),t.addClasses("celtra-banner"),this.adapter.runtimeParams.creativeVariantLockSize&&e.lockVariantSelectionToSize(this.adapter.runtimeParams.creativeVariantLockSize),this.adapter.canMeasureViewportPlacementGeometryRelativeToPage&&this._trackViewportPlacementGeometry(t),this.adapter.isInlineWebPlacement&&this.setupInlineWebPlacementContainer(t.root.parentNode,e),t.root.parentNode),i=(this._formatState.containerWidth=i.offsetWidth,i.getBoundingClientRect()),a=(this._formatState.placementMarginLeft=this._useFullWidth?-i.left:0,this.sticky&&!this.adapter.usePubCSS?(e.variantSelector="widestThenShortest",i=t.root.parentNode.offsetWidth,a=e.getVariantForSize(i,e.getLargestComputedHeight(i)),t.setSize("100%",a.getComputedHeight(i))):((this.adapter.isPreviewAdapter||this.adapter.isPreview)&&(e.variantSelector="fittingWidestThenTallest"),t.setSize(this._renderWidth,"100%")),t.setPosition(this._formatState.placementMarginLeft,0),t.show(),t.getPlacementGeometry());e.setAvailableSize(a.width,a.height),this.populateBanner(t,function(){this.adViewableTimeObserver&&this.adViewableTimeObserver.registerUnit(e),e.enterRenderTree(),r(t)}.bind(this))}.bind(this))},CrossScreenBannerFormat.prototype._triggerAppearAfterViewable=function(e,i){this.adapter.viewabilityMeasurable.viewable00?this.adapter.waitForViewableCore(e,i.node,function(t){e.creative.track({name:"viewable00",criterion:t}),this.adViewableTimeObserver&&this.adViewableTimeObserver.readyToShow(),i.appear()}.bind(this)):defer(function(){i.appear()},void 0,void 0,this.adapter.useAsap),this.adapter.viewabilityMeasurable.viewable501&&this.adapter.waitForViewableIAB(e,i.node,function(t){e.creative.track({name:"viewable501",criterion:t})})},CrossScreenBannerFormat.prototype.destroy=function(){this.stop(),CrossScreenBannerFormat.uber.destroy.apply(this)},CrossScreenBannerFormat.prototype.start=function(){this.adapter.Ticker.frame(this._update,"update"),this.adapter.Ticker.frame(this._render,"render")},CrossScreenBannerFormat.prototype.stop=function(){this.adapter.Ticker.removeFrame(this._update,"update"),this.adapter.Ticker.removeFrame(this._render,"render")},CrossScreenBannerFormat.prototype._update=function(){var t,e,i,a,r,n,s,o;this.units.banner&&((t=this.units.banner).updateRxState(this.placements.banner.root),this.adapter.usePubCSS?(e=this.placements.banner.root,this._formatState.placementWidth=e.offsetWidth,this._formatState.placementHeight=e.offsetHeight):(e=this.placements.banner.root.parentNode,this._formatState.containerWidth=e.offsetWidth,i=this._renderWidth,a=e.offsetHeight,r=this._formatState.placementMinHeight,n=t.usesUpdatedVariantSelection?this.placements.banner.getViewportGeometry().height:t.getLargestComputedHeight(i),this.sticky?(t.variantSelector="widestThenShortest",a=r=(s=t.getVariantForSize(i,n)).getComputedHeight(i)):this.adapter.isPreviewAdapter||this.adapter.isPreview?(t.variantSelector="fittingWidestThenTallest",o="string"==typeof(o=e.parentNode.style.height)&&o.length?parseInt(o):n,r=(s=t.getVariantForSize(i,o)).getComputedHeight(i)):this.adapter.isInlineWebPlacement&&(this._setHeightFromMatchingBreakpoint||0===e.offsetHeight)?(t.variantSelector="widestThenShortest",r=(s=t.getVariantForSize(i,n)).getComputedHeight(i),a=Math.max(r,a),this._setHeightFromMatchingBreakpoint||(this._setHeightFromMatchingBreakpoint=!0)):t.getVariantForSize(i,a).scaleUnit&&(t.variantSelector=null,n=e.offsetHeight,s=t.getVariantForSize(i,n),r=a=Math.min(s.getComputedHeight(i),n)),o=e.getBoundingClientRect(),this._formatState.placementMarginLeft=this._useFullWidth?-o.left:0,this._formatState.placementWidth=i,this._formatState.placementHeight=a,this._formatState.placementMinHeight=r))},CrossScreenBannerFormat.prototype._render=function(){var t;this._formatState.isDirty()&&(t=this.placements.banner,this.adapter.usePubCSS||(this.adapter.isInlineWebPlacement&&this._formatState.isDirty("placementMinHeight")&&(t.root.parentNode.style.minHeight=this._formatState.placementMinHeight+"px"),this.sticky&&t.enableDocumentPadding()),t.setSize(this._formatState.placementWidth,this._formatState.placementHeight),t.setPosition(this._formatState.placementMarginLeft,0),this.adapter.setIABFriendlyIframeSize(null,this._formatState.placementMinHeight,!0),this._formatState.markClean())};;
function SDKAdapter(e,t,i,n,r,o,a,s,d,p){function h(e){return this.experiments&&this.experiments.get&&this.experiments.get(e)}function c(e,t){return"1"===t||e&&"treatment"===e.chosenVariant&&"0"!==t}this.runtimeParams=e,this.trackingCenter=t,this.aggregatorTracking=i,this.experiments=n,this.useAsap=c(h("DeferWithAsap"),e._useAsap),this._renderBeforeDomReady=c(h("RenderBeforeDomReady"),e._renderImmediately),this.macros=a,this.perf=p,defer.perf=p,this.ampDetected=!1,this.ampNestingLevel="",this.safeFrameDetected=!1,this.scriptElement=script,this.scriptElement.parentNode.celtra||(this.scriptElement.parentNode.celtra={loaded:!1,viewabilityObservee:null}),this.domApi=this.scriptElement.parentNode.celtra,this.adapterWindow=window,this.tagWindow=this.scriptElement.ownerDocument.defaultView,this.nesting=getWindowNesting(this.tagWindow),this.tagElement=this.scriptElement.parentNode,this.hostElement=this.tagElement,this.storeOpenedOverrideUrls=o,this.urlOpenedOverrideUrls=r,this.urlOpenedUrlAppendage=s,this.clickThroughDestinationUrl=d,this.useNativeClickForTapDetection=1!=e.useTouchEvents,this.nativeClickEmittedOnSwipe=deviceInfo.deviceType.desktop()||deviceInfo.os.ios(),this.preventIABFriendlyIFrameBusting=!1,this.providesCloseButton=!1,this.enableCustomStateTransitions=!1,this.adBehavior={interstitial:!1,expandable:!1,expanded:!1,sticky:!1,crossScreenSticky:!1,attachInlinePlacementToViewport:!1,scrollable:!1,subpixelScrollable:!1},this.activeGeometryBaseline={placement:"banner",unit:"banner"},this.isRxAvailable=!1,this.viewabilityMeasurable={viewable00:!1,viewable501:!1},this.canMeasureViewportPlacementGeometry=!1,this.canMeasureViewportPlacementGeometryRelativeToPage=!1,this.canMeasureContainerAreaInViewRatio=!1,this.supportsContainerViewability=!1,this.supportsContainerInitialViewability=!1,this.useFSVP=!0,void 0!==this.runtimeParams.topLayerZIndex&&(t=parseInt(this.runtimeParams.topLayerZIndex,10),!isNaN(t)&&20e.height?"landscape":i():i()},SDKAdapter.prototype.collectAndTrackData=function(e,t){if("function"!=typeof e)throw new Error("The dataCollector param was not a function.");if(void 0===t)throw new Error("The eventName param was not defined.");var i=1e3;defer(function(){try{e(function(e){e.name=t,this.trackingCenter.trackNoLaterThan(e,i)}.bind(this))}catch(e){this.trackingCenter.trackNoLaterThan({name:t,error:e.message+"\n"+e.stack},i)}}.bind(this),void 0,void 0,this.useAsap)},SDKAdapter.prototype._createViewportElement=function(){var e=document.createElement("div");return e.id="viewport",e.style.cssText="position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible;",this.tagWindow.document.body.appendChild(e),e},SDKAdapter.prototype.getViewportGeometry=function(e){return getViewportGeometry(this.getTopWindow(),e)},SDKAdapter.prototype._getViewportElement=function(){return this.viewport},SDKAdapter.prototype.listenForExpandErrors=function(){},SDKAdapter.prototype.enableScroll=function(){},SDKAdapter.prototype.disableScroll=function(){},SDKAdapter.prototype._checkJsFeatures=function(){for(var t=[],i={supported:[],notSupported:[],blockedByCSP:[],unsupported:[]},n=0;nthis.getTopWindow().innerHeight&&!this.nesting.hostileIframe}}),BrowserAdapter.prototype.onReadyCallback=function(){this._setupMouseLeaveObserver(),defer(this.emits("displayed"),void 0,"BrowserAdapter emits displayed on ready",this.useAsap)},BrowserAdapter.prototype._setupMouseLeaveObserver=function(){var o;deviceInfo.deviceType.desktop()||("ontouchstart"in(o=this.getTopWindow())||navigator.msMaxTouchPoints||attach(o.document,"mouseout",function(e){e=e||o.event;var t=o.document.documentElement,i=Math.max(t.clientWidth,o.innerWidth||0),t=Math.max(t.clientHeight,o.innerHeight||0),r=e.clientX||e.pageX,n=e.clientY||e.pageY;e.toElement&&"HTML"!==e.toElement.tagName||!(r<1||i-1t?l():r.requestAnimationFrame(e)}),defer(l,t)},BrowserAdapter.prototype._createContainerViewabilityObserver=function(){var t=this,i=this.getTopWindow().document,r={isSupported:!1,propertyName:"",eventName:"",isVisible:function(){return!this.isSupported||!i[this.propertyName]},init:function(){["webkit","moz","ms",""].forEach(function(e){var t=e?e+"Hidden":"hidden";t in i&&(this.isSupported=!0,this.propertyName=t,this.eventName=e+"visibilitychange")},this)}},e=(r.init(),this.useAsap),n={isViewable:!1,start:function(){r.isVisible()&&defer(o,void 0,"BrowserAdapter observer start",e),r.isSupported&&i.addEventListener(r.eventName,o)},stop:function(){r.isSupported&&i.removeEventListener(r.eventName,o)}},o=function(){var e=this.isViewable;this.isViewable=r.isVisible(),e!=this.isViewable&&t.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){var i=-1!==["newGeometryWithSampling","newGeometryWithoutSampling"].indexOf(this.experiments.get("UseNewUnitViewabilityLogic")&&this.experiments.get("UseNewUnitViewabilityLogic").chosenVariant),r="IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype;return this._unitViewabilityObserver||(this._unitViewabilityObserver=new UnitViewabilityObserver(this,e,t,i&&r)),this._unitViewabilityObserver},BrowserAdapter.prototype.waitForViewableCore=function(e,t,i){return this._getUnitViewabilityObserver(e,t).waitForViewableCore(i)},BrowserAdapter.prototype.waitForViewableIAB=function(e,t,i){return this._getUnitViewabilityObserver(e,t).waitForViewableIAB(i)},BrowserAdapter.prototype.removeViewabilityListener=function(e,t,i){this._getUnitViewabilityObserver(e,t).removeListener(i)},BrowserAdapter.prototype._getActivePlacementOrUnitGeometry=function(){var e,t=this.placements[this.activeGeometryBaseline.placement];if(!t)return null;t.visible?e=t.getPlacementGeometry():(t.root.style.visibility="hidden",t.root.style.display="block",e=t.getPlacementGeometry(),t.root.style.display="none",t.root.style.visibility="");t=t.creative&&t.creative.unitSizes&&t.creative.unitSizes[this.activeGeometryBaseline.unit];return 0===e.height&&t&&(e.height=t.height),0===e.width&&t&&(e.width=t.width),e},BrowserAdapter.prototype._getWindowForPreviewMessaging=function(){return this.adBehavior.requiresTopWindowParentForPreviewMessaging?this.getTopWindow().parent:this.getTopWindow()},BrowserAdapter.prototype._disableScrollHandler=function(e){-1==["INPUT","TEXTAREA","SELECT"].indexOf(e.target.tagName)&&e.preventDefault()};;
function PreviewAdapter(e,t,i,n){PreviewAdapter.uberConstructor.apply(this,arguments),this.isPreviewAdapter=!0,this.checkVideoTranscodeStatus=!0,this.providesCloseButton=!1,this.enableCustomStateTransitions=!0,this.unitScript=unitScript,this.nesting={iframe:!1,friendlyIframe:!1,iabFriendlyIframe:!1,hostileIframe:!1,iframeDepth:0},this.isInlineWebPlacement=!0,"1"==this.runtimeParams.campaignExplorer&&(this.canMeasureViewportPlacementGeometry=!1),this._prepareSdk(),this.viewabilityMeasurable={viewable00:!0,viewable501:!0},this.runtimeParams.sticky||(this.canMeasureViewportPlacementGeometryRelativeToPage=!0),this.canMeasureViewportPlacementGeometry="1"==!this.runtimeParams.campaignExplorer,this.supportsContainerViewability=!0,this.supportsContainerInitialViewability=!0,this.useFixedPositioningForInterstitial=deviceInfo.os.ios()||deviceInfo.deviceType.desktop(),this.supportsSticky=!0,this._onProcessResources=this._onProcessResources.bind(this),this.on("documentReady",function(){"undefined"!=typeof FullscreenVideoPlayer&&FullscreenVideoPlayer.init({baseUrl:(e.secure?urls.staticUrl:urls.insecureStaticUrl)+"runner/FullscreenVideoPlayer/"}),document.documentElement.style.cssText="padding: 0; margin: 0; width: 100%; height: 100%;",document.body.style.cssText="padding: 0; margin: 0; height: 100%; width: 100%;",this.emit("ready")}.bind(this))}inherit(PreviewAdapter,BrowserAdapter),PreviewAdapter.prototype.setMinimumSize=function(e,t){this.hostElement.style.minWidth=e+"px",this.runtimeParams.sticky||(this.hostElement.style.minHeight=t+"px")},PreviewAdapter.prototype._prepareSdk=function(){var n=this.getTopWindow();this.sdk=extend({},EventEmitter),this.sdk.send=function(e,t,i){n.postMessage(extend({sender:this.unitName,name:e,warnings:i},t||{}),n.location.origin)}.bind(this),n.addEventListener("message",function(e){e=e.data;-1<["setValue","resizeVariants","goToObject","getComponentPosition","frameActiveComponents"].indexOf(e.name)&&("resizeVariants"===e.name&&this.setMinimumSize(e.variants[0].width,e.variants[0].height),this.emit(e.name,e)),this.sdk.emit(e.name,e)}.bind(this)),"1"==this.runtimeParams.campaignExplorer&&defer(function(){var e=new Event("creativePreviewInitializing");n.dispatchEvent(e)},0)},PreviewAdapter.prototype._startObservingEnvironment=function(){PreviewAdapter.uber._startObservingEnvironment.apply(this),this.getTopWindow().addEventListener("scroll",function(){this.emit("viewportChange")}.bind(this)),"function"==typeof ResourceObserver&&(this._resourceObserver=new ResourceObserver(this._onProcessResources),this._resourceObserver.addWindowToObserve(this.getTopWindow(),["preview.js"]),this._resourceObserver.start())},PreviewAdapter.prototype._createOrientationObserver=function(){var t=this,i=this.getTopWindow();return{_currentOrientation:null,start:function(){this._currentOrientation=this.getOrientation(),this._handler=function(){this.getOrientation()!=this._currentOrientation&&(this._currentOrientation=this.getOrientation(),t.emit("orientationchange",this.getOrientation()))}.bind(this),i.addEventListener("resize",this._handler,!1)},stop:function(){i.removeEventListener("resize",this._handler,!1)},getOrientation:function(){for(var e in t.placements)t.placements[e].sticky&&t.placements[e].sticky.updatePosition();return i.innerWidth>i.innerHeight?90:0}}},PreviewAdapter.prototype.notifycreativeRendered=function(){var e,t;this.commentsExtensionsEnabled&&(e=this.getTopWindow(),t=new Event("creativeAppeared"),e.dispatchEvent(t))},PreviewAdapter.prototype._createContainerViewabilityObserver=function(){var i,e;return"1"==this.runtimeParams.campaignExplorer?(e=(i=this).getTopWindow(),{isViewable:!1,start:function(){e.addEventListener("frameActivatedChange",function(e){this.refresh(e.detail)}.bind(this))},stop:function(){e.removeEventListener("frameActivatedChange",function(e){this.refresh(e.detail)}.bind(this))},refresh:function(e){var t=this.isViewable;this.isViewable=e,t!=this.isViewable&&i.emit("containerViewableChange",this.isViewable)}}):PreviewAdapter.uber._createContainerViewabilityObserver.apply(this,arguments)},PreviewAdapter.prototype.getTopWindow=function(){return this.tagWindow},PreviewAdapter.prototype.createPlacement=function(e,t){var i={trackingCenter:this.trackingCenter,aggregatorTracking:this.aggregatorTracking,experiments:this.experiments,adapter:this,runtimeParams:this.runtimeParams,celtraDeviceInfoRuntimeParams:this.runtimeParams.deviceInfo,nextFrame:this.nextFrame,cancelFrame:this.cancelFrame,Ticker:this.Ticker,macros:this.macros,perf:this.perf},n={urls:urls,urlOpenedOverrideUrls:this.urlOpenedOverrideUrls,storeOpenedOverrideUrls:this.storeOpenedOverrideUrls,urlOpenedUrlAppendage:this.urlOpenedUrlAppendage,clickThroughDestinationUrl:this.clickThroughDestinationUrl},r=null,s=function(e){e.creative.wrapRedirectPageUrl=function(e){return e};var t=e.creative.units;if(this._sendMetaToPreview(t.banner),this._sendUnitsToPreview(t),t[Object.keys(t)[0]].variants)for(var i in t)t[i].variants.forEach(function(e){e.on("enteredRenderTree",function(){this.sdk.send("unitVariantApplied",{unit:this._serializeUnit(e.parentUnit)})}.bind(this)),e.on("exitedRenderTree",function(){this.sdk.send("unitVariantRemoved",{unit:this._serializeUnit(e.parentUnit)})}.bind(this))}.bind(this))}.bind(this);switch(e.type){case"unit":(r=-1<["top","bottom"].indexOf(runtimeParams.sticky)&&"static"==e.positioning?(e.positioning="screen",e.attachment="body",new StickyPlacement(e.positioning,this.unitScript,i,n,{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)})):new IframePlacement(e.positioning,this.unitScript,i,n)).on("populated",function(){s(r)});break;case"layer":r=new DivPlacement(e.positioning);break;default:throw new Error("I can't do that, Dave.")}function o(){defer(function(){t&&t(r),"screen"==e.positioning&&(r.usesFixedPositioning=!0),this.commentsExtensionsEnabled&&this._setAnnotationContainerId(r),r instanceof IframePlacement&&this._reportingObserver&&this._reportingObserver.createChildObserverAndStartObserving(r.getContentWindow()),r instanceof IframePlacement&&this._resourceObserver&&this._resourceObserver.addWindowToObserve(r.getContentWindow())}.bind(this))}"node"==e.attachment?r.attachTo(e.parentNode,o.bind(this)):"placement"==e.attachment?r.attachTo(e.placement.root,o.bind(this)):r.attachTo("inline"==e.attachment?this.hostElement:this.getTopWindow().document.body,o.bind(this))},PreviewAdapter.prototype.expand=function(i,e){this._stopAllMedia(),this.animateExpansion=""!=e.animation&&this.enableCustomStateTransitions,this.waitForHook("beforeExpand",function(){var e,t;defer(function(){this.emit("stateChange","expanded")}.bind(this)),this.commentsExtensionsEnabled&&(e=this.getTopWindow(),t=new Event("beforeCreativeExpand"),e.dispatchEvent(t)),i&&i()}.bind(this))},PreviewAdapter.prototype.collapse=function(i){this._stopAllMedia(),this.waitForHook("beforeCollapse",function(){var e,t;defer(function(){this.emit("stateChange","default")}.bind(this)),this.commentsExtensionsEnabled&&(e=this.getTopWindow(),t=new Event("beforeCreativeCollapse"),e.dispatchEvent(t)),i&&i()}.bind(this))},PreviewAdapter.prototype.dismiss=function(e,t){var i={};t&&Object.keys(t).forEach(function(e){i[e]=t[e]}),e=e||noop,this._stopAllMedia(),this._enableClickShield(),this.waitForHook("beforeDismiss",function(){this._stopObservingEnvironment(),this.trackingCenter.flush(function(){this.hostElement.parentNode&&this.hostElement.parentNode.removeChild(this.hostElement)}.bind(this)),this.sdk.send("dismissed"),this.emit("stateChange","dismissed"),e()}.bind(this),i)},PreviewAdapter.prototype.resize=function(e,t){var i={};t&&Object.keys(t).forEach(function(e){i[e]=t[e]}),e=e||noop,this._enableClickShield(),this.waitForHook("beforeResize",e,i)},PreviewAdapter.prototype.playVideoInPlayer=function(e,t,i){FullscreenVideoPlayer.play(e,t,i)},PreviewAdapter.prototype._sendUnitsToPreview=function(e){if(e){var t,i={};for(t in e)i[t]=this._serializeUnit(e[t]);this.sdk.send("updateUnits",{units:i})}},PreviewAdapter.prototype._serializeUnit=function(e){function t(e){var t={};return t.originalIndex=e.originalIndex,t.minSize=e.minSize,t.revealCollapsedHeight=e.revealCollapsedHeight,t.revealIntroHeight=e.revealIntroHeight,t.layouts=e.layouts,t}var i={};return i.name=e.name,e.currentVariant&&(i.currentVariant=t(e.currentVariant),i.variants=e.variants.map(t)),i},PreviewAdapter.prototype._sendMetaToPreview=function(e){var t;e&&e.master&&(t=e.master.findByType("MasterVideo"),e=e.master.findByType("VideoAsset"),(t=t.length?t[0]:e.length?e[0]:null)&&t.video&&t.video.meta&&this.sdk.send("updateMeta",{meta:t.video.meta}))},PreviewAdapter.prototype._onReportReceived=function(e){switch(e){case"heavyAdCPUIntervention":case"heavyAdNetworkIntervention":this.sdk.send("heavyAdIntervention",{type:e,adBehavior:{placementGeometry:this._getActivePlacementOrUnitGeometry(),positioning:this.adBehavior.interstitial?"interstitial":this.runtimeParams.sticky||"inline"}}),this._resourceObserver&&this._resourceObserver.processResources(),this.dismiss();break;default:console.warn("Received unknown report!")}},PreviewAdapter.prototype._onProcessResources=function(e){0