PageSourceSearch

https://plus.rtl.de/6752-474fac59bb133be1.bundle.js

js rtl.de collected 2026-09-24 08:29:37 UTC 329,307 bytes, 2 lines download raw bytes

1(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[6752],{36793(e,t,i){"use strict";i.d(t,{b:()=>E});var n=i(2631),a=i.n(n),r=i(74089);const s=class{constructor(e,{storage:t}){this.config=e,this.storage=t}saveLastBreak(){const{type:e}=this.config,t=this.getBreakTimestamps();t[e]=Date.now(),this.storage.setItem("lastBreakTimestamp",JSON.stringify(t))}retrieveLastBreakTimestamp(e){return this.getBreakTimestamps()[e]}getBreakTimestamps(){try{return JSON.parse(this.storage.getItem("lastBreakTimestamp"))||{}}catch(e){r.A.error("Capping","saveLastBreak",e)}return{}}canBreak(e=0){const{type:t,duration:i}=this.config,n=this.retrieveLastBreakTimestamp(t),a=Date.now()+1e3*e;return!(n&&n<a&&a/1e3<n/1e3+i)||(r.A.debug("Capping","canBreak","Minimum time between breaks not elapsed"),!1)}};var o=i(53175),l=i.n(o);const d=635,_=["https://static.6cloud.fr/m6group_web/player/bw.jpg"];const h=()=>{const e=a().get(navigator,"connection.downlink");if(e){const t=Math.max(1e3*e,d);return r.A.debug("Bandwidth","calculateBandwidth",`Browser returned a calculated bandwidth of ${t}Kbps`),Promise.resolve(t)}return Promise.all(_.map(e=>function(e){const t=Date.now();return(e=>l().get(`${e}?t=${Date.now()}`).set({"Cache-Control":"no-cache,no-store,must-revalidate,max-age=-1,private",Expires:"-1"}).responseType("blob").timeout(1e3))(e).then(e=>{const i=(Date.now()-t)/1e3;return Math.max(Math.floor(8*e.body.size/1e3/i),d)}).catch(()=>null)}(e))).then(e=>{const t=(e=>{const t=e.filter(e=>!!e);return t.length?t.reduce((e,t)=>e+t,0)/t.length:d})(e);return r.A.debug("Bandwidth","calculateBandwidth",`Calculated a ${t}Kbps bandwidth`),t}).catch(()=>d)};var c=i(77710);const u={capping:{type:"default",duration:0},desiredBitrate:0,hostTargetingSeparator:"?",minOverlayWidth:1360,targetingKeysSeparator:"&"};class E{constructor(e,t,i,{storage:n}={}){if(this.setAutoPlay=e=>{this.shouldAutoPlay=e},this.onTimeUpdate=({target:e}={})=>{e.playbackRate>1&&(e.playbackRate=1)},!n.setItem||!n.getItem)throw new Error("Storage must implement setItem and getItem methods.");this.storage=n,this.released=!1,this.config=a().merge({},u,e),this.eventsHandlers={...t},this.contentHandlers={...i},this.handleInteraction=this.handleInteraction.bind(this),this.eventsHandlers.__onBreakEnded=this.eventsHandlers.onBreakEnded,this.eventsHandlers.onBreakEnded=(...e)=>{this.jingles.breakDisplayed=!1,this.jingles.sponsorDisplayed=!1,this.eventsHandlers.__onBreakEnded(...e)},this.cuePoints=[]}canBreak(e=0){return!!this.capping.canBreak(e)||(this.eventsHandlers.onBreakCapping(),!1)}triggerSlotOnSeek(){}setContainerRef(e){this.containerRef=e}setLBannerContainerRef(e){this.lBannerContainerRef=e}setPauseAdContainerRef(e){this.pauseAdContainerRef=e}setVideoRef(e){this.videoRef=e,this.videoEl=e,this.videoRef&&a().get(this.config,"options.optiExpo.enabled",!1)&&this.videoRef.addEventListener("timeupdate",this.onTimeUpdate)}setVpaidRef(e){this.vpaidRef=e}setCompanionRef(e){this.companionRef=e}setEventSender(e){this.sendEvent=e}__onAdClick(e,t,i=!0){const n=e.trim();return!!/^https?:\/\//.test(n)&&(window.open(n,"_blank"),"function"==typeof t&&t(),i&&this.pause(),this.eventsHandlers.onClicked(n),!0)}handleInteraction(){}updateCuePoints(e){if(this.cuePoints=e,this.eventsHandlers?.onAdBreakListUpdate){const t=this.engine?.getSlots().filter(e=>e.type===c.X.nT.LBANNER).map(e=>e.cuePoint)??[],i=e=>!t.includes(e);this.eventsHandlers.onAdBreakListUpdate(e.filter(i))}}
1async init(){this.eventsHandlers.onProviderLoading(),this.jingles={breakDisplayed:!1,sponsorDisplayed:!1},this.capping=new s(this.config.capping,{storage:this.storage}),this.updateCuePoints((this.config.breaks||[]).map(({cuePoint:e})=>e)),this.released=!1,this.config.desiredBitrate||(this.config.desiredBitrate=await h()),this.desiredBitrate=this.config.desiredBitrate}getEstimatedDesiredBitrate(){return this.config.desiredBitrate}reload(e=this.config){this.config=a().merge({},u,e)}release(){this.released=!0,this.videoRef&&this.videoRef.removeEventListener("timeupdate",this.onTimeUpdate)}contentHasEnded(){}contentHasPaused(){}contentHasStarted(){}contentHasProgressed(){}requestAds(){}setVolume(e){this.config.volume=e}isEnded(){}isPaused(){}pause(){}play(){}stop(){}skipAd(){}skipBreak(){}resize(){}addProvider(){}}},63739(e,t,i){"use strict";i.d(t,["v",0,e=>{e.removeAttribute("width"),e.removeAttribute("height"),e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style["object-fit"]="cover",e.style.left="50%",e.style.top="50%",e.style.transform="translate(-50%, -50%)"}])},74089(e,t,i){"use strict";var n=i(31523);const a=(e="info",t="Unknown target",i="Unknown method",...a)=>{n.FL.get("isDebug")&&(console[e]&&"function"==typeof console[e]?console[e]:console.log).bind(console)(`[adEngine][${(new Date).toLocaleTimeString()}][${t}][${i}] -`,...a)},r={info:(...e)=>a("info",...e),error:(...e)=>a("error",...e),debug:(...e)=>a("debug",...e),warn:(...e)=>a("warn",...e)};i.d(t,["A",0,r])},96414(){var $jscomp=$jscomp||{},h;$jscomp.scope={},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,i){e!=Array.prototype&&e!=Object.prototype&&(e[t]=i.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof globalThis&&null!=globalThis?globalThis:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.SYMBOL_PREFIX="jscomp_symbol_",$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){},$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)},$jscomp.Symbol=(h=0,function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+h++}),$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}}),$jscomp.initSymbolIterator=function(){}},$jscomp.arrayIterator=function(e){var t=0;return $jscomp.iteratorPrototype(function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}})},$jscomp.iteratorPrototype=function(e){return $jscomp.initSymbolIterator(),(e={next:e})[$jscomp.global.Symbol.iterator]=function(){return this},e},$jscomp.iteratorFromArray=function(e,t){$jscomp.initSymbolIterator(),e instanceof String&&(e+="");var i=0,n={next:function(){if(i<e.length){var a=i++;return{value:t(a,e[a]),done:!1}}return n.next=function(){return{done:!0,value:void 0}},n.next()}};return n[Symbol.iterator]=function(){return n},n},$jscomp.polyfill=function(e,t,i,n){if(t){for(i=$jscomp.global,e=e.split("."),n=0;n<e.length-1;n++){var a=e[n];a in i||(i[a]={}),i=i[a]}(t=t(n=i[e=e[e.length-1]]))!=n&&null!=t&&$jscomp.defineProperty(i,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.keys",function(e){return e||function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6","es3"),$jscomp.polyfill("Object.is",function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},"es6","es3"),$jscomp.polyfill("Array.prototype.includes",function(e){return e||function(e,t){var i=this;i instanceof String&&(i=String(i));var n=i.length;for(t=t||0;t<n;t++)if(i[t]==e||Object.is(i[t],e))return!0;return!1}},"es7","es3"),$jscomp.checkStringArgs=function(e,t,i){if(null==e)throw new TypeError("The 'this' value for String.prototype."+i+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+i+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.includes",function(e){return e||function(e,t){return-1!==$jscomp.checkStringArgs(this,e,"includes").indexOf(e,t||0)}},"es6","es3"),$jscomp.owns=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},$jscomp.polyfill("Object.assign",function(e){return e||function(e,t){for(var i=1;i<arguments.length;i++){var n=arguments[i];if(n)for(var a in n)$jscomp.owns(n,a)&&(e[a]=n[a])}return e}},"es6","es3"),function(){var h="SDK_"+"6.46.0-d76fcbd1-202112070207".replace(/[^\w]/g,"_"),t="undefined"!=typeof window?window:"undefined"!=typeof GLOBAL?GLOBAL:this;t.tv=t.tv||{},t.tv.freewheel=t.tv.freewheel||{},t.tv.freewheel[h]=function(h){var a={version:"js-6.46.0-d76fcbd1-202112070207"};return"undefined"!=typeof window&&(window._fw_admanager=window._fw_admanager||{},window._fw_admanager.version=a.version),a.LOG_LEVEL_QUIET=0,a.LOG_LEVEL_INFO=1,a.LOG_LEVEL_DEBUG=2,a.setLogLevel=function(e){if(a.warn=a.log=a.debug=function(){},"undefined"!=typeof console){try{window.localStorage&&window.localStorage.getItem("fwLogLevel")&&-1<window.localStorage.getItem("fwLogLevel")&&(e=window.localStorage.getItem("fwLogLevel"))}catch(e){console.warn(">FW Common.setLogLevel"+e.description)}e>a.LOG_LEVEL_QUIET&&(a.log=function(){console.log(">FW "+(new Date).toISOString().substr(14,9)+" "+Array.prototype.slice.call(arguments).join(" "))},a.warn=function(){console.warn(">FW "+(new Date).toISOString().substr(14,9)+" "+Array.prototype.slice.call(arguments).join(" "))},e>a.LOG_LEVEL_INFO&&(a.debug=function(){console.log(">FW "+(new Date).toISOString().substr(14,9)+" "+Array.prototype.slice.call(arguments).join(" "))}))}},a.setLogLevel(a.LOG_LEVEL_INFO),a.log("FreeWheel Integration Runtime",a.version),a.proxyUrl=null,a.creativesProxyUrl=null,a.proxyAuthenticationParameter=null,a.setProxy=function(e){a.debug("setProxy: "+e),a.Util.isValidProxyUrl(e)&&(a.proxyUrl="/"!==e.charAt(e.length-1)?e+"/":e)},a.setCreativesProxy=function(e){a.debug("setCreativesProxy: "+e),a.Util.isValidProxyUrl(e)&&(a.creativesProxyUrl="/"!==e.charAt(e.length-1)?e+"/":e)},a.setProxyAuthenticationParameter=function(e,t){a.proxyAuthenticationParameter=2<=arguments.length&&e?{key:e,value:t||""}:null},a.checkUserAgent=function(e){a.PLATFORM_IS_WINDOWSPHONE=-1<e.search("windows phone"),a.PLATFORM_IS_IPAD=-1<e.search("ipad"),a.PLATFORM_IS_IPHONE_IPOD=-1<e.search("iphone")||-1<e.search("ipod"),a.PLATFORM_IS_CHROMECAST=-1<e.search("crkey");var t=function(t){return(t=e.match(t))&&0<t.length?1*(t=t[0].match(/\d+/g))[0]+.1*(1<t.length?t[1]:0):0};a.PLATFORM_IE_MOBILE_VERSION=t(/iemobile\/\d+\.\d+/),a.PLATFORM_IOS_VERSION=t(/os \d+_\d+/),a.PLATFORM_ANDROID_VERSION=function(){if(-1<e.indexOf("transformer"))return 3.2;var i=t(/android \d+\.\d+/);return 0!==i?i:t(/android \d+/)}(),a.PLATFORM_IS_SAFARI=0<a.PLATFORM_IOS_VERSION&&-1<e.search("applewebkit")||0===a.PLATFORM_ANDROID_VERSION&&0>e.search("chrome")&&-1<e.search("safari"),a.PLATFORM_IS_CHROME=0>e.search("edge")&&-1<e.search("chrome"),a.PLATFORM_IS_FIREFOX=-1<e.search("firefox"),a.PLATFORM_IS_MOBILE=0<a.PLATFORM_IOS_VERSION||0<a.PLATFORM_ANDROID_VERSION,a.PLATFORM_BROWSER_VERSION=function(e){var t,i,n="";return-1!==(t=e.indexOf("opr/"))?n=e.substring(t+4):-1!==(t=e.indexOf("opera"))?(n=e.substring(t+6),-1!==(t=e.indexOf("version"))&&(n=e.substring(t+8))):-1!==(t=e.indexOf("rv:"))?n=e.substring(t+3):-1!==(t=e.indexOf("msie"))||-1!==(t=e.indexOf("edge"))?n=e.substring(t+5):-1!==(t=e.indexOf("chrome"))?n=e.substring(t+7):-1!==(t=e.indexOf("safari"))?(n=e.substring(t+7),-1!==(t=e.indexOf("version"))&&(n=e.substring(t+8))):-1!==(t=e.indexOf("firefox"))?n=e.substring(t+8):e.lastIndexOf(" ")+1<(t=e.lastIndexOf("/"))&&(n=e.substring(t+1)),-1!==(i=n.indexOf(";"))&&(n=n.substring(0,i)),-1!==(i=n.indexOf(" "))&&(n=n.substring(0,i)),(e=parseInt(""+n,10))?e:0}(e),a.PLATFORM_ID=a.PLATFORM_IS_MOBILE?0<a.PLATFORM_ANDROID_VERSION?"Android"+a.PLATFORM_ANDROID_VERSION:a.PLATFORM_IS_IPAD?"iPad"+a.PLATFORM_IOS_VERSION:a.PLATFORM_IS_IPHONE_IPOD?"iPhone"+a.PLATFORM_IOS_VERSION:"UnknownMobile":"Desktop",a.log("Device:",a.PLATFORM_ID,"PLATFORM_IS_SAFARI:",a.PLATFORM_IS_SAFARI,"PLATFORM_IS_CHROME:",a.PLATFORM_IS_CHROME)},a.checkUserAgent(navigator.userAgent.toLowerCase()),a.PLATFORM_EVENT_CLICK=a.PLATFORM_IS_MOBILE?"touchend":"click",a.MOBILE_EVENT_DRAG="touchmove",a.PLATFORM_SEND_REQUEST_BY_FORM=!1,a.PLATFORM_SEND_REQUEST_BY_JS=!1,a.PLATFORM_HIDE_AND_SHOW_CONTENT_VIDEO_BY_MOVE_POSITION=3.1<=a.PLATFORM_ANDROID_VERSION,a.PLATFORM_HIDE_AND_SHOW_CONTENT_VIDEO_BY_SET_DISPLAY=!0,a.PLATFORM_SUPPORT_PLAY_MIDROLL_BY_CURRENT_VIDEO_ELEMENT=a.PLATFORM_IS_IPAD||a.PLATFORM_IS_IPHONE_IPOD,a.PLATFORM_AUTO_SEEK_AFTER_MIDROLL=a.PLATFORM_IS_IPAD,a.PLATFORM_NOT_SUPPORT_OVERLAY_AD=a.PLATFORM_IS_IPHONE_IPOD||0<a.PLATFORM_ANDROID_VERSION&&3.1>a.PLATFORM_ANDROID_VERSION||a.PLATFORM_IS_WINDOWSPHONE,a.PLATFORM_FILL_VIDEO_POOL_FOR_MIDROLL=4.2<=a.PLATFORM_IOS_VERSION,a.PLATFORM_NOT_SUPPORT_MIDROLL_AD=2.2<=a.PLATFORM_ANDROID_VERSION&&3>=a.PLATFORM_ANDROID_VERSION||9<=a.PLATFORM_IE_MOBILE_VERSION,a.PLATFORM_NOT_SUPPORT_VIDEO_AD=0<a.PLATFORM_ANDROID_VERSION&&2.1>=a.PLATFORM_ANDROID_VERSION,a.PLATFORM_DETECT_FULL_SCREEN_FOR_MIDROLL=a.PLATFORM_IS_IPAD&&4.2<=a.PLATFORM_IOS_VERSION,a.PLATFORM_NOT_SUPPORT_CLICK_FOR_VIDEO=a.PLATFORM_IS_IPHONE_IPOD&&10>a.PLATFORM_IOS_VERSION||a.PLATFORM_IS_WINDOWSPHONE||a.PLATFORM_IS_CHROMECAST,a.PLATFORM_NOT_FIRE_CLICK_WHEN_AD_VIDEO_PAUSED=3.1<=a.PLATFORM_ANDROID_VERSION||10<=a.PLATFORM_IOS_VERSION,a.PLATFORM_WAIT_WHEN_AD_VIDEO_TIMEOUT=0<a.PLATFORM_ANDROID_VERSION&&3>=a.PLATFORM_ANDROID_VERSION,a.PLATFORM_VIDEO_DOESNOT_SUPPORT_TIMEUPDATE=9<=a.PLATFORM_IE_MOBILE_VERSION,a.PLATFORM_PLAY_DUMMY_VIDEO_FOR_PREROLL=0<a.PLATFORM_IOS_VERSION&&4.2>a.PLATFORM_IOS_VERSION&&4<=a.PLATFORM_IOS_VERSION,a.PLATFORM_NOT_WAIT_FOR_ERROR_WHEN_PLAY_DUMMY_VIDEO_FOR_PREROLL=!1,a.PLATFORM_SUPPORT_VIDEO_START_DETECT_TIMEOUT=0===a.PLATFORM_IOS_VERSION||4<=a.PLATFORM_IOS_VERSION&&4.2>a.PLATFORM_IOS_VERSION,a.PLATFORM_NOT_SUPPORT_OVERLAY_CLICK_WHEN_CONTROLS_IS_TRUE=a.PLATFORM_IS_IPAD,a.PLATFORM_BLOCKS_AUTOPLAY=a.PLATFORM_IS_MOBILE||a.PLATFORM_IS_SAFARI||a.PLATFORM_IS_CHROME&&(0<a.PLATFORM_ANDROID_VERSION||64<=a.PLATFORM_BROWSER_VERSION)||a.PLATFORM_IS_FIREFOX&&66<=a.PLATFORM_BROWSER_VERSION,a.PLATFORM_NOT_SUPPORT_DASH=0<a.PLATFORM_IOS_VERSION,a.PLATFORM_HLSJS_MIN_VERSION="0.11.0",a.PLATFORM_DASHJS_SUPPORTED_VERSION="3.0.3",a.CONTEXT_REQUEST_TIMEOUT=5,a.RENDERER_STATE_INIT=1,a.RENDERER_STATE_STARTING=2,a.RENDERER_STATE_STARTED=3,a.RENDERER_STATE_COMPLETING=4,a.RENDERER_STATE_COMPLETED=5,a.RENDERER_STATE_FAILED=6,a.TRANSLATOR_STATE_INIT=a.RENDERER_STATE_INIT,a.TRANSLATOR_STATE_STARTING=a.RENDERER_STATE_STARTING,a.TRANSLATOR_STATE_STARTED=a.RENDERER_STATE_STARTED,a.TRANSLATOR_STATE_COMPLETING=a.RENDERER_STATE_COMPLETING,a.TRANSLATOR_STATE_COMPLETED=a.RENDERER_STATE_COMPLETED,a.TRANSLATOR_STATE_FAILED=a.RENDERER_STATE_FAILED,a.EVENT_AD="adEvent",a.EVENT_AD_BUFFERING_START="adBufferingStart",a.EVENT_AD_BUFFERING_END="adBufferingEnd",a.EVENT_SLOT_IMPRESSION="slotImpression",a.EVENT_SLOT_END="slotEnd",a.EVENT_AD_INITIATED="adInitiated",a.EVENT_AD_PREINIT="preInit",a.EVENT_AD_IMPRESSION="defaultImpression",a.EVENT_AD_IMPRESSION_END="adEnd",a.EVENT_AD_QUARTILE="quartile",a.EVENT_AD_FIRST_QUARTILE="firstQuartile",a.EVENT_AD_MIDPOINT="midPoint",a.EVENT_AD_THIRD_QUARTILE="thirdQuartile",a.EVENT_AD_SKIPPED="adSkipped",a.EVENT_AD_PROGRESS="progress",a.EVENT_AD_COMPLETE="complete",a.EVENT_AD_CLICK="defaultClick",a.EVENT_AD_MUTE="_mute",a.EVENT_AD_UNMUTE="_un-mute",a.EVENT_AD_COLLAPSE="_collapse",a.EVENT_AD_EXPAND="_expand",a.EVENT_AD_PAUSE="_pause",a.EVENT_AD_RESUME="_resume",a.EVENT_AD_REWIND="_rewind",a.EVENT_AD_ACCEPT_INVITATION="_accept-invitation",a.EVENT_AD_CLOSE="_close",a.EVENT_AD_MINIMIZE="_minimize",a.EVENT_ERROR="_e_unknown",a.EVENT_RESELLER_NO_AD="resellerNoAd",a.EVENT_AD_MEASUREMENT="concreteEvent",a.EVENT_EXTENSION_LOADED="extensionLoaded",a.EVENT_AD_VOLUME_CHANGE="adVolumeChange",a.EVENT_AD_AUTO_PLAY_BLOCKED="videoAutoPlayBlocked",a.EVENT_AD_PROGRESS="progress",a.EVENT_AD_SKIPPABLE_STATE_CHANGED="skippableStateChanged",a.INFO_KEY_CUSTOM_ID="customId",a.INFO_KEY_MODULE_TYPE="moduleType",a.INFO_KEY_AD_SKIPPABLE_STATE="skippableState",a.MODULE_TYPE_EXTENSION="extension",a.MODULE_TYPE_RENDERER="renderer",a.MODULE_TYPE_TRANSLATOR="translator",a.INFO_KEY_START_TIME_POSITION="startTimePosition",a.INFO_KEY_ERROR_CODE="errorCode",a.INFO_KEY_ERROR_INFO="errorInfo",a.INFO_KEY_ERROR_MODULE="errorModule",a.INFO_KEY_VAST_ERROR_CODE="vastErrorCode",a.ERROR_IO="_e_io",a.ERROR_TIMEOUT="_e_timeout",a.ERROR_NULL_ASSET="_e_null-asset",a.ERROR_ADINSTANCE_UNAVAILABLE="_e_adinst-unavail",a.ERROR_UNKNOWN="_e_unknown",a.ERROR_MISSING_PARAMETER="_e_missing-param",a.ERROR_NO_AD_AVAILABLE="_e_no-ad",a.ERROR_PARSE="_e_parse",a.ERROR_INVALID_VALUE="_e_invalid-value",a.ERROR_INVALID_SLOT="_e_invalid-slot",a.ERROR_NO_RENDERER="_e_no-renderer",a.ERROR_DEVICE_LIMIT="_e_device-limit",a.ERROR_3P_COMPONENT="_e_3p-comp",a.ERROR_UNSUPPORTED_3P_FEATURE="_e_unsupp-3p-feature",a.ERROR_SECURITY="_e_security",a.ERROR_UNMATCHED_SLOT_SIZE="_e_slot-size-unmatch",a.ERROR_DASHJS="_e_dashjs",a.ERROR_HLSJS="_e_hlsjs",a.ERROR_CUSTOM_PLAYER="_e_custom_player",a.INFO_KEY_URL="url",a.INFO_KEY_SHOW_BROWSER="showBrowser",a.INFO_KEY_CUSTOM_EVENT_NAME="customEventName",a.INFO_KEY_NEED_EMPTY_CT="needEmptyCT",a.INFO_KEY_CONCRETE_EVENT_ID="concreteEventId",a.EVENT_TYPE_CLICK_TRACKING="CLICKTRACKING",a.EVENT_TYPE_IMPRESSION="IMPRESSION",a.EVENT_TYPE_CLICK="CLICK",a.EVENT_TYPE_STANDARD="STANDARD",a.EVENT_TYPE_GENERIC="GENER
1IC",a.EVENT_TYPE_ERROR="ERROR",a.EVENT_VIDEO_VIEW="videoView",a.SHORT_EVENT_TYPE_IMPRESSION="i",a.SHORT_EVENT_TYPE_CLICK="c",a.SHORT_EVENT_TYPE_STANDARD="s",a.SHORT_EVENT_TYPE_ERROR="e",a.INIT_VALUE_ZERO="0",a.INIT_VALUE_ONE="1",a.INIT_VALUE_TWO="2",a.INFO_KEY_PARAMETERS="parameters",a.URL_PARAMETER_KEY_ET="et",a.URL_PARAMETER_KEY_CN="cn",a.URL_PARAMETER_KEY_INIT="init",a.URL_PARAMETER_KEY_CT="ct",a.URL_PARAMETER_KEY_METR="metr",a.URL_PARAMETER_KEY_CR="cr",a.URL_PARAMETER_KEY_KEY_VALUE="kv",a.URL_PARAMETER_KEY_ERROR_INFO="additional",a.URL_PARAMETER_KEY_ERROR_MODULE="renderer",a.URL_PARAMETER_KEY_CREATIVE_RENDITION_ID="reid",a.URL_PARAMETER_KEY_CONCRETE_EVENT_ID="creid",a.URL_PARAMETER_START_TIME_POSITION="stpos",a.URL_PARAMETER_KEY_AUTO_PLAY_BLOCKED="f",a.URL_PARAMETER_KEY_AUTO_PLAY_BLOCKED_VALUE="16777216",a.CAPABILITY_SLOT_TEMPLATE="sltp",a.CAPABILITY_DISPLAY_REFRESH="rfnt",a.CAPABILITY_MULTIPLE_CREATIVE_RENDITIONS="emcr",a.CAPABILITY_RECORD_VIDEO_VIEW="exvt",a.CAPABILITY_CHECK_COMPANION="cmpn",a.CAPABILITY_CHECK_TARGETING="targ",a.CAPABILITY_RESET_EXCLUSIVITY="rste",a.CAPABILITY_FALLBACK_UNKNOWN_ASSET="unka",a.CAPABILITY_FALLBACK_UNKNOWN_SITE_SECTION="unks",a.CAPABILITY_FALLBACK_ADS="fbad",a.CAPABILITY_SLOT_CALLBACK="slcb",a.CAPABILITY_NULL_CREATIVE="nucr",a.CAPABILITY_AUTO_EVENT_TRACKING="aeti",a.CAPABILITY_RENDERER_MANIFEST="rema",a.CAPABILITY_REQUIRE_VIDEO_CALLBACK="vicb",a.CAPABILITY_SKIP_AD_SELECTION="skas",a.SLOT_TYPE_TEMPORAL="temporal",a.SLOT_TYPE_VIDEOPLAYER_NONTEMPORAL="videoPlayerNonTemporal",a.SLOT_TYPE_SITESECTION_NONTEMPORAL="siteSectionNonTemporal",a.TIME_POSITION_CLASS_PREROLL="PREROLL",a.TIME_POSITION_CLASS_MIDROLL="MIDROLL",a.TIME_POSITION_CLASS_POSTROLL="POSTROLL",a.TIME_POSITION_CLASS_OVERLAY="OVERLAY",a.TIME_POSITION_CLASS_DISPLAY="DISPLAY",a.TIME_POSITION_CLASS_PAUSE_MIDROLL="PAUSE_MIDROLL",a.EVENT_REQUEST_INITIATED="onRequestInitiated",a.EVENT_REQUEST_COMPLETE="onRequestComplete",a.EVENT_SLOT_STARTED="onSlotStarted",a.EVENT_SLOT_ENDED="onSlotEnded",a.EVENT_CONTENT_VIDEO_PAUSED="contentVideoPaused",a.EVENT_CONTENT_VIDEO_RESUMED="contentVideoResumed",a.EVENT_CONTENT_VIDEO_PAUSE_REQUEST="contentVideoPauseRequest",a.EVENT_CONTENT_VIDEO_RESUME_REQUEST="contentVideoResumeRequest",a.EVENT_USER_ACTION_NOTIFIED="userActionNotified",a.EVENT_USER_ACTION_PAUSE_BUTTON_CLICKED="pauseButtonClicked",a.EVENT_USER_ACTION_RESUME_BUTTON_CLICKED="resumeButtonClicked",a.CAPABILITY_STATUS_OFF=0,a.CAPABILITY_STATUS_ON=1,a.PARAMETER_LEVEL_PROFILE=0,a.PARAMETER_LEVEL_GLOBAL=1,a.PARAMETER_LEVEL_OVERRIDE=5,a.PARAMETER_ENABLE_COUNTING_REPLAY_CALLBACK="enableCountingReplayCallback",a.PARAMETER_ENABLE_FORM_TRANSPORT="sdk.enableFormTransport",a.PARAMETER_ENABLE_JS_TRANSPORT="sdk.enableJSTransport",a.PARAMETER_DESIRED_BITRATE="desiredBitrate",a.PARAMETER_PAGE_SLOT_CONTENT_TYPE="sdk.pageSlotContentType",a.PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENT="extension.ad.control.clickElement",a.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED="extension.contentVideo.enabled",a.PARAMETER_EXTENSION_CONTENT_VIDEO_RESPOND_PAUSE_RESUME="extension.contentVideo.respondPauseResume",a.PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACK="extension.contentVideo.autoSeekBack",a.PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SOURCE_RESTORE="extension.contentVideo.autoSourceRestore",a.PARAMETER_EXTENSION_PAUSE_AD_ENABLE="extension.pausead.enable",a.PARAMETER_EXTENSION_OMSDK_ENABLED="extension.omsdk.enabled",a.PARAMETER_EXTENSION_VIDEO_STATE_ENABLED="extension.videoState.enabled",a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT="renderer.video.startDetectTimeout",a.PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT="renderer.video.progressDetectTimeout",a.PARAMETER_RENDERER_VIDEO_ANDROID_DELAY="renderer.video.android.delay",a.PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSE="renderer.video.displayControlsWhenPause",a.PARAMETER_RENDERER_VIDEO_CLICK_DETECTION="renderer.video.clickDetection",a.PARAMETER_RENDERER_VIDEO_PLAY_AFTER_STALLED="renderer.video.playAfterStalled",a.PARAMETER_EXTENSION_SURVEY_ENABLED="extension.survey.enabled",a.PARAMETER_AUTO_PAUSE_AD_ONVISIBILITYCHANGE="autoPauseAdOnVisibilityChange",a.PARAMETER_DISABLE_CORS_ENFORCEMENT="disableCORSEnforcement",a.PARAMETER_ENABLE_ACCESS_CONTROL_ALLOW_CREDENTIALS="enableAccessControlAllowCredentials",a.PARAMETER_RENDERER_DISPLAY_COAD_SCR
1IPT_NAME="renderer.html.coadScriptName",a.PARAMETER_RENDERER_HTML_SHOULD_BACKGROUND_TRANSPARENT="renderer.html.isBackgroundTransparent",a.PARAMETER_RENDERER_HTML_SHOULD_END_AFTER_DURATION="renderer.html.shouldEndAfterDuration",a.PARAMETER_RENDERER_HTML_AD_LOAD_TIMEOUT="renderer.html.adLoadTimeout",a.PARAMETER_RENDERER_HTML_PLACEMENT_TYPE="renderer.html.placementType",a.PARAMETER_RENDERER_HTML_BOOTSTRAP="renderer.html.bootstrap",a.PARAMETER_RENDERER_HTML_PRIMARY_ANCHOR="renderer.html.primaryAnchor",a.PARAMETER_RENDERER_HTML_MARGIN_WIDTH="renderer.html.marginWidth",a.PARAMETER_RENDERER_HTML_MARGIN_HEIGHT="renderer.html.marginHeight",a.PARAMETER_VPAID_CREATIVE_TIMEOUT_DELAY="renderer.vpaid.creativeTimeoutDelay",a.PARAMETER_VAST_TIMEOUT_IN_MILLISECONDS="translator.vast.timeoutInMilliseconds",a.PARAMETER_VAST_MAX_WRAPPER_COUNT="translator.vast.maxWrapperCount",a.VAST_DEFAULT_MAX_WRAPPER_COUNT=5,a.PARAMETER_RENDERER_HTML_PLACEMENT_TYPE_INTERSTITIAL="interstitial",a.PARAMETER_RENDERER_HTML_BASEUNIT_INTERSTITIAL="app-interstitial",a.PARAMETER_CONSENT_RETRIEVAL_TIMEOUT="consent_retrieval_timeout",a.PARAMETER_USE_GDPR_TCFAPI="useGDPR_TCFAPI",a.PARAMETER_USE_CCPA_USPAPI="useCCPA_USPAPI",a.GDPR_TCFAPI_VERSION=2,a.ID_TYPE_FW=1,a.ID_TYPE_CUSTOM=2,a.ID_TYPE_GROUP=3,a.VIDEO_STATE_PLAYING=1,a.VIDEO_STATE_PAUSED=2,a.VIDEO_STATE_STOPPED=3,a.VIDEO_STATE_COMPLETED=4,a.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED=1,a.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED=2,a.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE=3,a.VIDEO_ASSET_AUTO_PLAY_TYPE_CLICK_TO_PLAY=4,a.VIDEO_ASSET_DURATION_TYPE_EXACT="exact",a.VIDEO_ASSET_DURATION_TYPE_VARIABLE="variable",a.ADUNIT_PREROLL="preroll",a.ADUNIT_MIDROLL="midroll",a.ADUNIT_POSTROLL="postroll",a.ADUNIT_OVERLAY="overlay",a.ADUNIT_STREAM_PREROLL="stream_preroll",a.ADUNIT_STREAM_POSTROLL="stream_postroll",a.ADUNIT_PAUSE_MIDROLL="pause_midroll",a.SLOT_LOCATION_PLAYER="player",a.SLOT_LOCATION_EXTERNAL="external",a.SLOT_OPTION_INITIAL_AD_STAND_ALONE=0,a.SLOT_OPTION_INITIAL_AD_KEEP_ORIGINAL=1,a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_ONLY=2,a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_STAND_ALONE=3,a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_THEN_STAND_ALONE=4,a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE=5,a.SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE=6,a.SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE_IF_TEMPORAL=7,a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE_IF_TEMPORAL=8,a.REQUEST_MODE_ON_DEMAND="on-demand",a.REQUEST_MODE_LIVE="live",a.MINIMUM_VAST_VERSION_SUPPORTED=2,a.MAXIMUM_VAST_VERSION_SUPPORTED=4,a.ERROR_VAST_XML_PARSING="100",a.ERROR_VAST_SCHEMA_VALIDATION="101",a.ERROR_VAST_VERSION_NOT_SUPPORTED="102",a.ERROR_VAST_TRACKING_ERROR="200",a.ERROR_VAST_LINEARITY_NOT_MATCH="201",a.ERROR_VAST_NO_AD="303",a.ERROR_VAST_WRAPPER_LIMIT_REACH="302",a.ERROR_VAST_URI_TIMEOUT="301",a.ERROR_VAST_GENERAL_LINEAR_ERROR="400",a.ERROR_VAST_NON_LINEAR_GENERAL_ERROR="500",a.ERROR_VAST_COMPANION_GENERAL_ERROR="600",a.ERROR_VAST_GENERAL_VPAID_ERROR="901",a.AD_VIDEO_PAUSED_BY_RENDERER=1,a.AD_VIDEO_PAUSED_BY_TAB_SWITCH=2,a.AD_VIDEO_UNPAUSED=3,a.AD_VIDEO_HLS_PAUSED_BY_RENDERER_AFTER_TAB_SWITCH=4,a.OMSDK_PARTNER_NAME="Freewheeltv",a.OMSDK_SERVICE_SCRIPT_URL="https://mssl.fwmrm.net/libs/omsdk/1.3.17/omweb-v1.js",a.OMSDK_SESSION_SCRIPT_URL="https://mssl.fwmrm.net/libs/omsdk/1.3.17/omid-session-client-v1.js",a.OMSDK_ACCESS_MODE="full",a.OMSDK_CREATIVE_TYPE_VIDEO="video",a.OMSDK_IMPRESSION_TYPE_BEGIN_TO_RENDER="beginToRender",a.AD_VERIFICATION_EVENT_NOT_EXECUTED="verificationNotExecuted",a.VERIFICATION_RESOURCE_REJECTED="1",a.VERIFICATION_NOT_SUPPORTED="2",a.VERIFICATION_RESOURCE_LOAD_ERROR="3",a.IAB_API_FRAMEWORKS_VPAID_2=2,a.IAB_API_FRAMEWORKS_MRAID_1=3,a.IAB_API_FRAMEWORKS_OMID_1=7,a.Util={setContext:function(e){a.Util._context=e},getParameterAccessControlAllowCredentials:function(){if(!a.Util._context)return!1;var e=a.Util._context.getParameter(a.PARAMETER_ENABLE_ACCESS_CONTROL_ALLOW_CREDENTIALS);return!0===a.Util.str2bool(e)},canPlayVideoType:function(e){if("video/3gp"===e&&(e="video/3gpp"),"video/3gpp"===e&&!a.PLATFORM_IS_SAFARI||a.PLATFORM_IS_SAFARI&&("video/ogg"===e||"video/webm"===e))return!1;if(1<a.PLATFORM_ANDROID_VERSION&&"video/m4v"===e)return!0;var t=document.createElement("video");return!!(t.canPlayType&&("undefined"!=typeof Hls&&Hls.isSupported()&&this.isMimeTypeHls(e)||t.canPlayType(e)||t.canPlayType(e.replace("/","/x-"))))},isMimeTypeHls:function(e){return"application/x-mpegurl"===(e=e.toLowerCase())||"application/vnd.apple.mpegurl"===e},str2bool:function(e){return!!e&&("true"===(e=a.Util.trim(e).toLowerCase())||"yes"===e||"on"===e||"1"===e)},trim:function(e){return"string"!=typeof e?e.toString():e.replace(/^\s+|\s+$/g,"")},isBlank:function(e){return!e||""===a.Util.trim(e)},encodeToHex:function(e){for(var t="",i=0;i<e.length;i++){for(var n=e.charCodeAt(i).toString(16).toUpperCase();4>n.length;)n="0"+n;t+="\\u"+n.toUpperCase()}return t},forEachOnArray:function(e,t,i){var n;if(null==e)throw new TypeError(" array is null or not defined");var a=(e=Object(e)).length>>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(i&&(n=i),i=0;i<a;){if(i in e){var r=e[i];t.call(n,r,i,e)}i++}}
1,mixin:function(e,t){for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e},copy:function(e){return a.Util.mixin({},e)},bind:function(e,t){var i=t,n=Array.prototype.slice.call(arguments);return n.shift(),i=n.shift(),function(){return i.apply(e,n.concat(Array.prototype.slice.call(arguments)))}},getObject:function(e,t,i){if(!e)return null;e=e.split("."),t=t||window;for(var n,a=0;t&&(n=e[a]);a++)t=n in t?t[n]:i?t[n]={}:void 0;return t},transformToProxy:function(e,t){return null==e||null==t||(t=t.replace("$","$$"),e=e.replace(/https?:\/\//,t),a.proxyAuthenticationParameter&&(e=a.Util.setParameterInURL(e,a.proxyAuthenticationParameter.key,a.proxyAuthenticationParameter.value))),e},transformUrlToProxy:function(e){return this.transformToProxy(e,a.proxyUrl)},transformCreativeUrlToProxy:function(e){return this.transformToProxy(e,a.creativesProxyUrl)},pingURLWithImage:function(e){new Image(1,1).src=a.Util.transformUrlToProxy(e)},pingURLWithForm:function(e,t,i){i=i?"_fw_request":"_fw_cb",null==t&&(t=Math.random());var n=document.createElement("iframe");n.name=i+"_iframe_"+t,n.id=i+"_iframe_"+t,n.style.position="absolute",n.style.left="-10000px",n.style.width="1px",n.style.visibility="hidden";var r=document.createElement("form");r.action=a.Util.transformUrlToProxy(e),r.id=i+"_form_"+t,r.target=n.id,r.method="post",r.style.position="absolute",r.style.left="-10000px",r.style.width="1px",r.style.visibility="hidden",document.body&&(document.body.appendChild(n),document.body.appendChild(r),r.submit(),document.body.removeChild(r))},pingURLWithScript:function(e){var t=document.getElementsByTagName("head")[0],i=document.createElement("script");i.src=a.Util.transformUrlToProxy(e),i.onload=i.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||t.removeChild(i)},t.appendChild(i)},pingURLWithXMLHTTPRequest:function(e){var t=new XMLHttpRequest,i=a.Util.transformUrlToProxy(e);t.onload=function(){200===t.status?a.debug("Sent pingback: "+i+". Status: "+t.status):a.warn("Pingback not sent: "+i+". Status: "+t.status)},t.onerror=function(e){a.warn("An error ocurred while trying to send pingback:"+i+". Error: "+e)},t.ontimeout=function(){a.warn("Timeout ocurred while trying to send pingback:"+i)},t.timeout=1e3*a.CONTEXT_REQUEST_TIMEOUT,t.open("GET",i,!0),t.withCredentials=a.Util.getParameterAccessControlAllowCredentials(),t.send()},extractAdResponseJSONFromXMLHttpRequest:function(e,t){String.prototype.rsplit=function(e,t){var i=this.split(e);return t?[i.slice(0,-t).join(e)].concat(i.slice(-t)):i};try{var i=t.split(".requestComplete(");return i&&0!=i.length?-1>=i[0].indexOf("tv.freewheel.SDK._instanceQueue['Context_"+e+"']")?(a.warn("An error occured while trying to parse the ad response. The callback function is not set correctly."),null):JSON.parse(i[1].rsplit(");",1)[0]):(a.warn("An error occured while trying to parse the ad response."),null)}catch(e){return a.warn("An error occured while trying to parse the ad response: "+e),null}},sendAdRequestWithXMLHTTPRequest:function(e){var t=new XMLHttpRequest,i=a.Util.transformUrlToProxy(e);t.onload=function(){if(200===t.status){a.debug("Sent request: "+i+". Status: "+t.status);var e=a.Util.extractAdResponseJSONFromXMLHttpRequest(a.Util._context._instanceId,t.responseText);a.Util._context.requestComplete(e)}else a.warn("Request not sent: "+i+". Status: "+t.status)},t.onerror=function(e){a.warn("An error ocurred while trying to send pingback:"+i+". Error: "+JSON.stringify(e)),a.Util._context.requestComplete(null)},t.ontimeout=function(){a.warn("Timeout ocurred while trying to send the ad request:"+i)},t.timeout=1e3*a.CONTEXT_REQUEST_TIMEOUT,t.open("GET",i,!0),t.withCredentials=a.Util.getParameterAccessControlAllowCredentials(),t.send()},pingURL:function(e){a.debug("send callback: "+e),e&&(a.PLATFORM_SEND_REQUEST_BY_FORM?a.Util.pingURLWithForm(e,null,!1):a.PLATFORM_SEND_REQUEST_BY_JS?a.Util.pingURLWithXMLHTTPRequest(e):a.Util.pingURLWithImage(e))},pingURLs:function(e){for(var t=0;t<e.length;t++)a.Util.pingURL(e[t])},setParameterInURL:function(e,t,i){if(!e||!t||null==i)return null;var n=!1;if(e=e.split("?"),i=encodeURIComponent(i),e[1]){for(var a=e[1].split("&"),r=0;r<a.length;++r){var s=a[r].split("=");if(s[0]===t){a[r]=s[0]+"="+i,n=!0;break}}s=a.join("&"),n||(s=t+"="+i+"&"+s)}
1else s=t+"="+i;return e[0]+"?"+s},getParameterInURL:function(e,t){if(!e||!t)return null;if((e=e.split("?"))[1]){e=e[1].split("&");for(var i=0;i<e.length;++i){var n=e[i].split("=");if(n[0]===t&&!a.Util.isBlank(n[1]))return decodeURIComponent(n[1])}}return null},isParameterInURL:function(e,t){if(!e||!t)return!1;if((e=e.split("?"))[1]){e=e[1].split("&");for(var i=0;i<e.length;++i)if(e[i].split("=")[0]===t)return!0}return!1},flashVersion:function(){var e="0,0,0,0";if(null!=navigator.plugins&&0<navigator.plugins.length){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"])try{var t=navigator.plugins["Shockwave Flash"+(navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"")].description.split(" "),i=t[2].split("."),n=i[0],r=i[1],s=t[3];""===s&&(s=t[4]),"d"===s[0]?s=s.substring(1):"r"===s[0]&&0<(s=s.substring(1)).indexOf("d")&&(s=s.substring(0,s.indexOf("d"))),e=n+","+r+","+s+",0"}catch(e){a.warn("Flash detection failed on navigator method")}}else try{var o=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7").GetVariable("$version").split(" ")[1].split(",");3===o.length?e=o.join(",")+",0":4===o.length&&(e=o.join(","))}catch(e){a.warn("Flash detection failed on ActiveX method")}return e},xmlToJson:function(e){var t={};if(!e)return null;if(1===e.nodeType){if(0<e.attributes.length){t["@attributes"]={};for(var i=0;i<e.attributes.length;i++){var n=e.attributes.item(i);t["@attributes"][n.nodeName]=n.nodeValue}}}else(3===e.nodeType||4===e.nodeType)&&(t=e.nodeValue);if(e.hasChildNodes()){for(i=0;i<e.childNodes.length;i++){var r=(n=e.childNodes.item(i)).nodeName;if(void 0===t[r])t[r]=a.Util.xmlToJson(n);else{if(void 0===t[r].length||"string"==typeof t[r]){var s=t[r];t[r]=[],t[r].push(s)}t[r].push(a.Util.xmlToJson(n))}}void 0!==t["#cdata-section"]?(t.value=t["#cdata-section"],t.value.constructor===Array&&(t.value=t.value.join(""))):t["#text"]&&(t.value=t["#text"])}return t},lazyJavaScriptLoad:function(e,t){var i=document.getElementsByTagName("head")[0]||document.documentElement,n=document.createElement("script");n.type="text/javascript",n.src=e,t&&(n.attachEvent&&!window.opera?n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(i.removeChild(n),n.onreadystatechange=null,t())}:n.addEventListener("load",function(){i.removeChild(n),t()},!1)),i.insertBefore(n,i.firstChild)},getViewport:function(){var e=0,t=0;return void 0!==window.innerWidth?(e=window.innerWidth,t=window.innerHeight):void 0!==document.documentElement&&void 0!==document.documentElement.clientWidth&&0!==document.documentElement.clientWidth?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0]&&(e=document.getElementsByTagName("body")[0].clientWidth,t=document.getElementsByTagName("body")[0].clientHeight),{width:e,height:t,offsetX:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,offsetY:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop}},getAbsoluteUrl:function(e,t){if(e=a.Util.trim(e),-1!==(t=a.Util.trim(t)).indexOf("://"))return t;var i=e.substring(0,e.indexOf("://"));if(0===t.indexOf("//"))return i+":"+t;i=e.indexOf("/",e.indexOf("://")+5);var n=e;return-1!==i&&(n=e.substring(0,i)),0===t.indexOf("/")?n+t:(i=e.lastIndexOf("#"),n=e,-1!==i&&(n=e.substring(0,i)),0===t.indexOf("#")?n+t:(n=e.indexOf("?"),i=e,-1!==n&&(i=e.substring(0,n)),0===t.indexOf("?")?i+t:(n=-1===n?e.lastIndexOf("/"):i.lastIndexOf("/"),(i=-1!==n?e.substring(0,n+1):i+"/")+t)))},secondsToHms:function(e){e=isNaN(Number(e))?0:Number(e);var t=Math.floor(e%3600/60),i=Math.round(e%3600%60);return("0"+Math.floor(e/3600)).slice(-2)+":"+("0"+t).slice(-2)+":"+("0"+i).slice(-2)},getFixedDigitRandomNumber:function(e){return e=isNaN(Number(e))?0:Number(e),Math.floor(9*Math.random()*Math.pow(10,e-1)+Math.pow(10,e-1))},getDateStringInISOFormat:function(e){return e instanceof Date&&!isNaN(e.valueOf())?e.toISOString():null},getTopMostWindow:function(){for(var e=window;e!=top;){if(!e.parent.location.href.length)throw"Cannot access top most window";e=e.parent}return e},getFrameAncestor:function(e){for(var t,i=window;!t;){try{i.frames[e]&&(t=i)}catch(t){a.warn("Error while trying to access window with "+e)}if(i===window.top)break;i=i.parent}return t},isValidProxyUrl:function(e){return e&&"string"==typeof e},compareVersion:function(e,t){if(e===t)return 0;e=e.split("."),t=t.split(".");for(var i=Math.min(e.length,t.length),n=0;n<i;n++){if(parseInt(e[n])>parseInt(t[n]))return 1;if(parseInt(e[n])<parseInt(t[n]))return-1}return e.length>t.length?1:e.length<t.length?-1:0},validateJSON:function(e,t,i){var n=Object.keys(t).filter(function(i){var n=t[i];if(n.isOptional&&!e.hasOwnProperty(i))return!1;if(n.validationFunction)return!n.validationFunction(e[i]);for(var a=0;a<n.allowedTypes.length;a++)if(typeof e[i]===n.allowedTypes[a])return!1;return!0}
1).map(function(t){return t in e?t+" is invalid.":t+" is missing."});if(0<n.length)return n=this.arrayToString(n),Error("The "+i+" failed validation:"+n)},arrayToString:function(e){return e.reduce(function(e,t){return e+" "+t},"")},validateCustomPlayer:function(e){return e?(e=this.validateJSON(e,{open:{allowedTypes:["function"]},getDuration:{allowedTypes:["function"]},getPlayheadTime:{allowedTypes:["function"]},playPause:{allowedTypes:["function"]}},"customPlayer"))?Error(e.message.replace("invalid","not a function")):void 0:Error("customPlayer is null")},getBooleanParameter:function(e,t){return null==(e=this._context.getParameter(e))&&(e=t),this.str2bool(e)},offsetStringToSecond:function(e,t){if("string"!=typeof e||this.isBlank(e))return-1;var i=/(\d+)%/.exec(e);return i?0<t?t*i[1]/100|0:-1:(t=/(\d+):(\d+):(\d+)(.(\d+))?/.exec(e))?3600*t[1]+60*t[2]+1*t[3]:(a.warn('offset is malformatted with value "',e,' ", the expected format is either HH:MM:SS(:mmm) or percentage%.'),-1)}},a.MediaState=function(){},a.MediaState.prototype={},a.MediaState.prototype.constructor=a.MediaState,a.Util.mixin(a.MediaState.prototype,{play:function(e){a.debug(this._name+" play("+e+")")},pause:function(e){a.debug(this._name+" pause("+e+")")},complete:function(e){a.debug(this._name+" complete("+e+")")}}),a.MediaInitState=function(){this._name="MediaInitState"},a.MediaInitState.prototype=new a.MediaState,a.MediaInitState.prototype.constructor=a.MediaInitState,a.Util.mixin(a.MediaInitState.prototype,{play:function(e){a.debug(this._name+" play("+e+")"),e.setMediaState(a.MediaPlayingState.instance),"function"==typeof e.onStartPlaying&&e.onStartPlaying()}}),a.MediaInitState.instance=new a.MediaInitState,a.MediaPlayingState=function(){this._name="MediaPlayingState"},a.MediaPlayingState.prototype=new a.MediaState,a.MediaPlayingState.prototype.constructor=a.MediaPlayingState,a.Util.mixin(a.MediaPlayingState.prototype,{pause:function(e){a.debug(this._name+" pause("+e+")"),e.setMediaState(a.MediaPausedState.instance),"function"==typeof e.onPausePlaying&&e.onPausePlaying()},complete:function(e){a.debug(this._name+" complete("+e+")"),e.setMediaState(a.MediaEndState.instance),"function"==typeof e.onCompletePlaying&&e.onCompletePlaying()}}),a.MediaPlayingState.instance=new a.MediaPlayingState,a.MediaPausedState=function(){this._name="MediaPausedState"},a.MediaPausedState.prototype=new a.MediaState,a.MediaPausedState.prototype.constructor=a.MediaPausedState,a.Util.mixin(a.MediaPausedState.prototype,{play:function(e){a.debug(this._name+" play("+e+")"),e.setMediaState(a.MediaPlayingState.instance),"function"==typeof e.onResumePlaying&&e.onResumePlaying()},complete:function(e){a.debug(this._name+" complete("+e+")"),e.setMediaState(a.MediaEndState.instance),"function"==typeof e.onCompletePlaying&&e.onCompletePlaying()}}),a.MediaPausedState.instance=new a.MediaPausedState,a.MediaReplayingState=function(){this._name="MediaReplayingState"},a.MediaReplayingState.prototype=new a.MediaState,a.MediaReplayingState.prototype.constructor=a.MediaReplayingState,a.Util.mixin(a.MediaReplayingState.prototype,{pause:function(e){a.debug(this._name+" pause("+e+")"),e.setMediaState(a.MediaReplayPausedState.instance),"function"==typeof e.onPausePlaying&&e.onPausePlaying()},complete:function(e){a.debug(this._name+" complete("+e+")"),e.setMediaState(a.MediaEndState.instance),"function"==typeof e.onCompleteReplaying&&e.onCompleteReplaying()}}),a.MediaReplayingState.instance=new a.MediaReplayingState,a.MediaReplayPausedState=function(){this._name="MediaReplayPausedState"},a.MediaReplayPausedState.prototype=new a.MediaState,a.MediaReplayPausedState.prototype.constructor=a.MediaReplayPausedState,a.Util.mixin(a.MediaReplayPausedState.prototype,{play:function(e){a.debug(this._name+" play("+e+")"),e.setMediaState(a.MediaReplayingState.instance),"function"==typeof e.onResumePlaying&&e.onResumePlaying()},complete:function(e){a.debug(this._name+" complete("+e+")"),e.setMediaState(a.MediaEndState.instance),"function"==typeof e.onCompleteReplaying&&e.onCompleteReplaying()}}),a.MediaReplayPausedState.instance=new a.MediaReplayPausedState,a.MediaEndState=function(){this._name="MediaEndState"},a.MediaEndState.prototype=new a.MediaState,a.MediaEndState.prototype.constructor=a.MediaEndState,a.Util.mixin(a.MediaEndState.prototype,{play:function(e){a.debug(this._name+" play("+e+")"),e.setMediaState(a.MediaReplayingState.instance),"function"==typeof e.onStartReplaying&&e.onStartReplaying()}}),a.MediaEndState.instance=new a.MediaEndState,a.RendererState=function(){}
1,a.RendererState.prototype={},a.RendererState.prototype.constructor=a.RendererState,a.Util.mixin(a.RendererState.prototype,{start:function(e){a.debug(this._name+" start() rendererController = "+e)},notifyStarted:function(e){a.debug(this._name+" notifyStarted() rendererController = "+e)},stop:function(e){a.debug(this._name+" stop() rendererController = "+e)},complete:function(e){a.debug(this._name+" complete() rendererController = "+e)},notifyCompleted:function(e){a.debug(this._name+" notifyCompleted() rendererController = "+e)},fail:function(e){a.debug(this._name+" fail() rendererController = "+e),e.setRendererState(a.RendererFailedState.instance),e.getAdInstance().complete()}}),a.RendererInitState=function(){this._name="RendererInitState"},a.RendererInitState.prototype=new a.RendererState,a.RendererInitState.prototype.constructor=a.RendererInitState,a.RendererInitState.instance=new a.RendererInitState,a.Util.mixin(a.RendererInitState.prototype,{start:function(e){a.debug(this._name+" start()"),e.setRendererState(a.RendererStartingState.instance),e.getRenderer().start(e)},stop:function(e){a.debug(this._name+" stop()"),e.setRendererState(a.RendererCompletingState.instance),e.getRendererState().notifyCompleted(e)}}),a.RendererStartingState=function(){this._name="RendererStartingState"},a.RendererStartingState.prototype=new a.RendererState,a.RendererStartingState.prototype.constructor=a.RendererStartingState,a.RendererStartingState.instance=new a.RendererStartingState,a.Util.mixin(a.RendererStartingState.prototype,{notifyStarted:function(e){a.debug(this._name+" notifyStarted()"),e.setRendererState(a.RendererStartedState.instance),e.getAdInstance().play()},stop:function(e){a.debug(this._name+" stop()"),"function"==typeof e.getRenderer().stop&&(e.setRendererState(a.RendererCompletingState.instance),e.getRenderer().stop())}}),a.RendererStartedState=function(){this._name="RendererStartedState"},a.RendererStartedState.prototype=new a.RendererState,a.RendererStartedState.prototype.constructor=a.RendererStartedState,a.RendererStartedState.instance=new a.RendererStartedState,a.Util.mixin(a.RendererStartedState.prototype,{complete:function(e){a.debug(this._name+" complete()"),e.setRendererState(a.RendererCompletingState.instance)},stop:function(e){a.debug(this._name+" stop()"),"function"==typeof e.getRenderer().stop&&(e.setRendererState(a.RendererCompletingState.instance),!1===e.getRenderer().stop()&&e.getAdInstance().fakeComplete())}}),a.RendererCompletingState=function(){this._name="RendererCompletingState"},a.RendererCompletingState.prototype=new a.RendererState,a.RendererCompletingState.prototype.constructor=a.RendererCompletingState,a.RendererCompletingState.instance=new a.RendererCompletingState,a.Util.mixin(a.RendererCompletingState.prototype,{notifyCompleted:function(e){a.debug(this._name+" notifyCompleted()"),e.setRendererState(a.RendererCompletedState.instance),e.getAdInstance().complete()}}),a.RendererCompletedState=function(){this._name="RendererCompletedState"},a.RendererCompletedState.prototype=new a.RendererState,a.RendererCompletedState.prototype.constructor=a.RendererCompletedState,a.RendererCompletedState.instance=new a.RendererCompletedState,a.RendererFailedState=function(){this._name="RendererFailedState"},a.RendererFailedState.prototype=new a.RendererState,a.RendererFailedState.prototype.constructor=a.RendererFailedState,a.RendererFailedState.instance=new a.RendererFailedState,a.HTMLRenderer=function(){this._rendererController=null,this._onVisibilityChange=this._onVisibilityChange.bind(this)},a.HTMLRenderer.prototype={start:function(e){this._rendererController=e,this._rendererController.getAdInstance().getSlot().getBase()?document.visibilityState&&"visible"!==document.visibilityState?(a.debug("Document was not visible when ad started."),document.addEventListener("visibilitychange",this._onVisibilityChange,!1)):(a.debug("Document was visible when ad started."),this._setupParameters()&&(this._render(),this._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED))):this._onRendererFailed(a.ERROR_INVALID_SLOT,"slot base is empty")},_onVisibilityChange:function(){"visible"===document.visibilityState&&(a.debug("Document is now visible, and ad already tried to start when the document was not visible."),this._setupParameters()&&(this._render(),this._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED)),document.removeEventListener("visibilitychange",this._onVisibilityChange,!1))},pause:function(){this.log("pause"),this.shouldEndAfterDuration&&this.timer&&this.timer.pause()},resume:function(){this.log("resume"),this.shouldEndAfterDuration&&this.timer&&this.timer.start()},stop:function(){return this.log("stop isMRAIDAd:"+this.isMRAIDAd+" tpc:"+this._tpc+" interstitial:"+this.shouldKeepInterstitial),this._stop()},_stop:function(){if(this.log("_stop isMRAIDAd:"+this.isMRAIDAd+" tpc:"+this._tpc+" interstitial:"+this.shouldKeepInterstitial),!this.isMRAIDAd&&this._tpc===a.TIME_POSITION_CLASS_DISPLAY&&!this.shouldKeepInterstitial)return!1;this._cleanup(),this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED)},resize:function(){var e=this._rendererController.getAdInstance(),t=e.getSlot().getBase();e.getSlot().getTimePositionClass()===a.TIME_POSITION_CLASS_OVERLAY?!this.isMRAIDAd||this.isMRAIDAd&&this.mraid.state===this.mraid.STATEDEFAULT?(e="_fw_ad_container_html_"+e.getSlot().getCustomId()+"_",(e=document.getElementById(e)).style.width=t.style.width||"100%",e.style.height=t.style.height||"100%",this._layoutOverlayAd(this.defaultAdElement)):this.log("Cannot resize an MRAID ad that is not in the default state"):this.log("Cannot resize a non-overlay ad")},_cleanup:function(){if(this.log("_cleanup"),document.removeEventListener("visibilitychange",this._onVisibilityChange,!1),this.timer&&(this.timer.stop(),this.timer=null),this.adLoadTimeoutTimer&&(this.adLoadTimeoutTimer.stop(),this.adLoadTimeoutTimer=null),window.removeEventListener?(document.removeEventListener("touchmove",this.touchMoveDisabler,!1),window.removeEventListener("message",this.messageHandlerFunc,!1),window.removeEventListener("resize",this.viewportChangeFunc,!1),window.removeEventListener("scroll",this.viewportChangeFunc,!1)):window.detachEvent&&(window.detachEvent("onmessage",this.messageHandlerFunc),window.detachEvent("onresize",this.viewportChangeFunc),window.detachEvent("onscroll",this.viewportChangeFunc)),this.isMRAIDAd&&(this.mraid.inExpandedState()&&(this.log("stopping with expanded state, invoke close()"),this._mraidClose()),this.mraid.inDefaultState()))return this.log("stopping with default state, invoke close()"),void this._mraidClose();if(this.expandedAdElement){var e=this.expandedAdElement.parentNode;this.expandedAdElement._fw_closeButton&&e.removeChild(this.expandedAdElement._fw_closeButton),e.removeChild(this.expandedAdElement),this.expandedAdElement===this.defaultAdElement&&(this.defaultAdElementContainer===this.defaultAdElement&&(this.defaultAdElementContainer=null),this.defaultAdElement=null),this.expandedAdElement=null}if(this.expandedLightbox&&((e=this.expandedLightbox.parentNode).removeChild(this.expandedLightbox),this.expandedLightbox=null),this.defaultAdElement){e=this.defaultAdElement.parentNode;var t=this.defaultAdElement;t.style.display="none",e!==this._rendererController.getAdInstance().getSlot().getBase()&&window.setTimeout(function(){for(var i=e&&e.childNodes||[],n=0;n<i.length;n++){var a=i[n];a===t&&e.removeChild(a)}},200),this.defaultAdElementContainer===this.defaultAdElement&&(this.defaultAdElementContainer=null),this.defaultAdElement=null}this.defaultAdElementContainer&&((e=this.defaultAdElementContainer.parentNode).removeChild(this.defaultAdElementContainer),this.defaultAdElementContainer=null),(this.shouldPauseContentWhenStart||this.isInterstitialNow&&!this.isMRAIDAd)&&this._rendererController.requestContentStateChange(!1)},_setupParameters:function(){var e=this._rendererController.getAdInstance(),t=e.getSlot().getTimePositionClass();this._tpc=t;var i,n=e.getActiveCreativeRendition();if(e=n.getBaseUnit(),n=n.getCreativeApi(),a.PLATFORM_NOT_SUPPORT_OVERLAY_AD&&t===a.TIME_POSITION_CLASS_OVERLAY)return this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"Overlay not supported on this device."),!1;if(a.PLATFORM_NOT_SUPPORT_MIDROLL_AD&&(t===a.TIME_POSITION_CLASS_MIDROLL||t===a.TIME_POSITION_CLASS_PAUSE_MIDROLL))return this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"Midroll, pause_midroll not supported on this device."),!1;if(a.PLATFORM_IS_IPHONE_IPOD)switch(t){case a.TIME_POSITION_CLASS_MIDROLL:case a.TIME_POSITION_CLASS_PAUSE_MIDROLL:case a.TIME_POSITION_CLASS_OVERLAY:return this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"Midroll, pause_midroll and overlay ads are not supported on iPod, iPhone."),!1;case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_POSTROLL:this._rendererController.setCapability(a.EVENT_AD_CLICK,a.CAPABILITY_STATUS_OFF)}if(this.adLoadTimeout=5,(i=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_AD_LOAD_TIMEOUT))&&(this.adLoadTimeout=0<Number(i)?Number(i):this.adLoadTimeout),this.shouldKeepInterstitial=!1,(i=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_PLACEMENT_TYPE))?this.shouldKeepInterstitial=i===a.PARAMETER_RENDERER_HTML_PLACEMENT_TYPE_INTERSTITIAL:"string"==typeof e&&(this.shouldKeepInterstitial=e.toLowerCase()===a.PARAMETER_RENDERER_HTML_BASEUNIT_INTERSTITIAL),this.isInterstitialNow=this.shouldKeepInterstitial,this.shouldPauseContentWhenStart=!1,this.shouldPauseContentWhenExpandOrClick=!this.shouldKeepInterstitial&&(t===a.TIME_POSITION_CLASS_DISPLAY||t===a.TIME_POSITION_CLASS_OVERLAY),this.shouldBackgroun
1dTransparent=!1,void 0!==(i=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_SHOULD_BACKGROUND_TRANSPARENT))&&null!=i&&(this.shouldBackgroundTransparent=a.Util.str2bool(i)),this.shouldEndAfterDuration=t!==a.TIME_POSITION_CLASS_DISPLAY||this.shouldKeepInterstitial,void 0!==(i=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_SHOULD_END_AFTER_DURATION))&&null!=i&&(this.shouldEndAfterDuration=a.Util.str2bool(i)),this.coadScriptName=this._rendererController.getParameter(a.PARAMETER_RENDERER_DISPLAY_COAD_SCRIPT_NAME),this.coadScriptName||(this.coadScriptName=this._rendererController.getParameter("coad_script_name")),this.primaryAnchor=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_PRIMARY_ANCHOR)||"bc",this.marginWidth=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_MARGIN_WIDTH)||0,this.marginHeight=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_MARGIN_HEIGHT)||0,this.bootstrap=this._rendererController.getParameter(a.PARAMETER_RENDERER_HTML_BOOTSTRAP),e=a.Util.getViewport(),this.defaultExpandWidth=e.width,this.defaultExpandHeight=e.height,this.isMRAIDAd="MRAID-1.0"===n,this.mraid=new function(e){this.STATELOADING="loading",this.STATEDEFAULT="default",this.STATEEXPANDED="expanded",this.STATEHIDDEN="hidden",this._renderer=e,this._state=this.STATELOADING,this._useCustomClose=!1,this.viewable=this.expandIsModal=!0,this._baseUrlExpanded=this._baseUrlDefault="",e=Object.defineProperty||function(e,t,i){i.get&&e.__defineGetter__(t,i.get),i.set&&e.__defineSetter__(t,i.set)},e(this,"baseUrl",{get:function(){return this.inExpandedState()&&this._baseUrlExpanded||this._baseUrlDefault},set:function(e){this.inExpandedState()?this._baseUrlExpanded=e:(this._baseUrlDefault=e,this._baseUrlExpanded="")}}),e(this,"useCustomClose",{get:function(){return this._useCustomClose},set:function(e){this._useCustomClose===!e&&(this._useCustomClose=!!e,this.pushData())}}),e(this,"placementType",{get:function(){return this._renderer.shouldKeepInterstitial?"interstitial":"inline"}}),e(this,"expandWidth",{get:function(){return this._renderer.requestedExpandWidth&&this._renderer.requestedExpandWidth<this._renderer.defaultExpandWidth?this._renderer.requestedExpandWidth:this._renderer.defaultExpandWidth}}),e(this,"expandHeight",{get:function(){return this._renderer.requestedExpandHeight&&this._renderer.requestedExpandHeight<this._renderer.defaultExpandHeight?this._renderer.requestedExpandHeight:this._renderer.defaultExpandHeight}}),e(this,"state",{get:function(){return this._state},set:function(e){this.log("mraid.state change "+this.state+" => "+e),this.state!==e&&(this._renderer.shouldPauseContentWhenExpandOrClick&&(e===this.STATEEXPANDED?this._renderer._rendererController.requestContentStateChange(!0):this.inExpandedState()&&this._renderer._rendererController.requestContentStateChange(!1)),e===this.STATEEXPANDED?(this._renderer.expandedAdElement?this._renderer._rendererController.processEvent({name:a.EVENT_AD_ACCEPT_INVITATION}):(this._renderer.expandedAdElement=this._renderer.defaultAdElement,this._renderer._rendererController.processEvent({name:a.EVENT_AD_EXPAND})),this._renderer.presentInterstitial(),this._renderer.shouldEndAfterDuration&&this._renderer.timer.pause()):e===this.STATEDEFAULT&&(this._renderer.shouldKeepInterstitial?(this._renderer.expandedAdElement=this._renderer.defaultAdElement,this._renderer.presentInterstitial()):(this.inExpandedState()&&(this._renderer.expandedAdElement!==this._renderer.defaultAdElement?this._renderer._rendererController.processEvent({name:a.EVENT_AD_CLOSE}):this._renderer._rendererController.processEvent({name:a.EVENT_AD_COLLAPSE})),this._renderer.expandedAdElement=null,this._renderer.presentInline()),this._renderer.shouldEndAfterDuration&&this._renderer.timer&&this._renderer.timer.start()),this._state=e,this.pushData(),e===this.STATEHIDDEN&&this._renderer.stop())}}),this.inLoadingState=function(){return this.state===this.STATELOADING},this.inDefaultState=function(){return this.state===this.STATEDEFAULT},this.inExpandedState=function(){return this.state===this.STATEEXPANDED},this.inHiddenState=function(){return this.state===this.STATEHIDDEN},this.pushData=function(){var e='mraid._Update("'+this.state+'", '+this.viewable+', "'+this.placementType+'", '+this.expandWidth+", "+this.expandHeight+", "+this.useCustomClose+", "+this.expandIsModal+")";this.log("mraid.pushData: going to invoke on iframe with "+e),this._renderer.defaultAdElement?(this._renderer.defaultAdElement.contentWindow.postMessage("fwsdk-bounce:"+e,"*"),this._renderer.expandedAdElement&&this._renderer.expandedAdElement!==this._renderer.defaultAdElement&&this._renderer.expandedAdElement.contentWindow.postMessage("fwsdk-bounce:"+e,"*")):this.warn("_mraidPushData: no iframe suitable to send "+e)},this.log=function(e){this._renderer.log(e)},this.warn=function(e){this._renderer.warn(e)}}(this),this.onLoadFunc=a.Util.bind(this,function(){this.adLoadTimeoutTimer&&(this.adLoadTimeoutTimer.stop(),this.adLoadTimeoutTimer=null),this.timer&&this.shouldEndAfterDuration&&this.timer.start()}),this.touchMoveDisabler=function(e){e.preventDefault()},this.log("setting parameters, adLoadTimeout: "+this.adLoadTimeout+", isMRAIDAd: "+this.isMRAIDAd+", shouldKeepInterstitial: "+this.shouldKeepInterstitial+", shouldEndAfterDuration: "+this.shouldEndAfterDuration+", shouldPauseContentWhenStart: "+this.shouldPauseContentWhenStart+", shouldPauseContentWhenExpandOrClick: "+this.shouldPauseContentWhenExpandOrClick+", shouldBackgroun
1dTransparent: "+this.shouldBackgroundTransparent+", defaultExpandWidth: "+this.defaultExpandWidth+", defaultExpandHeight: "+this.defaultExpandHeight+", coadScriptName: "+this.coadScriptName+", primaryAnchor: "+this.primaryAnchor+", marginWidth: "+this.marginWidth+", marginHeight: "+this.marginHeight+", bootstrap: "+this.bootstrap),this.shouldKeepInterstitial){if(t===a.TIME_POSITION_CLASS_OVERLAY)return this._onRendererFailed(a.ERROR_INVALID_SLOT,"Interstitial ad is not supported in overlay slot."),!1}else!this.isMRAIDAd||a.PLATFORM_IS_IPHONE_IPOD&&t!==a.TIME_POSITION_CLASS_DISPLAY||(this._rendererController.setCapability(a.EVENT_AD_ACCEPT_INVITATION,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_CLOSE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_COLLAPSE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_EXPAND,a.CAPABILITY_STATUS_ON));return!0},_render:function(){this.log("_render");var b=this._rendererController.getAdInstance(),c=b.getSlot(),d=c.getTimePositionClass(),e=c.getBase(),f=b.getActiveCreativeRendition(),g=f.getDuration(),k=f.getPrimaryCreativeRenditionAsset();b=k.getProxiedUrl();var m=k.getContent();if(d===a.TIME_POSITION_CLASS_DISPLAY&&(e.innerHTML=""),this.timer=new a.Timer(g,a.Util.bind(this,this._stop)),this.coadScriptName&&"function"==typeof window[this.coadScriptName])this.defaultAdElement=window[this.coadScriptName](m,b,f.getHeight(),f.getWidth(),k.getMimeType(),c.getCustomId()),this.timer&&this.shouldEndAfterDuration&&this.timer.start();else{if(g=document.createElement("span"),g.id="_fw_ad_container_html_"+c.getCustomId()+"_",g.style.position="relative"===e.style.position?"absolute":"relative",g.style.display="inline-block",g.style.margin="0px",g.style.padding="0px",g.style.width=e.style.width||"100%",g.style.height=e.style.height||"100%",g.style.top=g.style.left="0px",e.appendChild(g),this.defaultAdElementContainer=g,!b&&!m)return this._onRendererFailed(a.ERROR_NULL_ASSET,"Empty URL and empty content"),void this._stop();if("text/html_lit_nowrapper"===f.getContentType()||"text/html_lit_js_wc_nw"===f.getContentType()){if(this.isMRAIDAd||this.isInterstitialNow)return this._onRendererFailed(a.ERROR_INVALID_VALUE,""),void this._stop();if(!m)return this._onRendererFailed(a.ERROR_NULL_ASSET,"Empty content"),void this._stop();this.defaultAdElement=g,this.defaultAdElement.innerHTML=m,c=this.defaultAdElement.getElementsByTagName("script");var r=document.getElementsByTagName("head")[0];for(e=0;e<c.length;++e)if(c[e].src){var h=document.createElement("script");h.src=c[e].src,c[e].charset&&(h.charset=c[e].charset),c[e].innerHTML&&(h.innerHTML=c[e].innerHTML),h.onload=h.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||r.removeChild(h)},r.appendChild(h)}else h=c[e].innerHTML,eval(h);return this.presentInline(),void this.onLoadFunc()}f=document.createElement("iframe"),f.id="_fw_ad_container_iframe_"+c.getCustomId()+"_"+Math.random(),f.attachEvent?f.attachEvent("onload",this.onLoadFunc):f.onload=this.onLoadFunc,this.defaultAdElement=f,this.defaultAdElementContainer.appendChild(f),this._fillAdNode(f,b,m),this.isMRAIDAd&&(this.adLoadTimeoutTimer=new a.Timer(this.adLoadTimeout,a.Util.bind(this,function(){this._onRendererFailed(a.ERROR_TIMEOUT,"Loading MRAID Ad timed out"),d!==a.TIME_POSITION_CLASS_DISPLAY&&this.isMRAIDAd&&!this.mraid.inLoadingState()?this._mraidClose():this._stop()})),this.adLoadTimeoutTimer.start())}this.defaultAdElement||(c=e.getElementsByTagName("iframe"))&&0<c.length&&(this.defaultAdElement=c[c.length-1]),this.defaultAdElement?(this.defaultAdElement.frameBorder="0",this.shouldBackgroundTransparent&&(this.defaultAdElement.allowTransparency="true",this.defaultAdElement.style["background-color"]="rgba(255,255,255,0)"),this.isInterstitialNow?(this.expandedAdElement=this.defaultAdElement,this.presentInterstitial()):this.presentInline(),this.messageHandlerFunc=a.Util.bind(this,this._onWindowMessageReceived),this.viewportChangeFunc=a.Util.bind(this,function(){this.viewportChangeFuncTimer&&window.clearTimeout(this.viewportChangeFuncTimer),this.viewportChangeFuncTimer=window.setTimeout(a.Util.bind(this,this._onViewportResizeScroll),200)}),window.addEventListener?(window.addEventListener("message",this.messageHandlerFunc,!1),window.addEventListener("resize",this.viewportChangeFunc,!1),window.addEventListener("scroll",this.viewportChangeFunc,!1)):window.attachEvent&&(window.attachEvent("onmessage",this.messageHandlerFunc),window.attachEvent("onresize",this.viewportChangeFunc),window.attachEvent("onscroll",this.viewportChangeFunc))):this.isMRAIDAd&&(this._onRendererFailed(a.ERROR_UNKNOWN,"Failed to find iframe in slotBase for MRAID ad"),this._stop())},_layoutOverlayAd:function(e){this.log("_layoutOverlayAd");var t=this._rendererController.getAdInstance(),i=t.getSlot(),n=i.getVideoDisplaySize().width;i=i.getVideoDisplaySize().height;var a=t.getActiveCreativeRendition();switch(t=a.getWidth()||240,a=a.getHeight()||50,e.style.width=Math.min(t,n)+"px",e.style.height=Math.min(a,i)+"px",e.style.left=e.style.top=e.style.right=e.style.bottom="",this.primaryAnchor){case"tl":case"lt":e.style.top=this.marginHeight+"px",e.style.left=this.marginWidth+"px";break;case"tr":case"rt":e.style.top=this.marginHeight+"px",e.style.right=this.marginWidth+"px";break;case"bl":case"lb":e.style.bottom=this.marginHeight+"px",e.style.left=this.marginWidth+"px";break;case"br":case"rb":e.style.bottom=this.marginHeight+"px",e.style.right=this.marginWidth+"px";break;case"tc":case"ct":e.style.top=this.marginHeight+"px",e.style.left=.5*Math.max(0,n-t)+"px";break;case"lm":case"ml":e.style.left=this.marginWidth+"px",e.style.top=.5*Math.max(0,i-a)+"px";break;case"rm":case"mr":e.style.right=this.marginWidth+"px",e.style.top=.5*Math.max(0,i-a)+"px";break;case"mc":case"cm":case"c":case"m":e.style.left=.5*Math.max(0,n-t)+"px",e.style.top=.5*Math.max(0,i-a)+"px";break;default:e.style.bottom=this.marginHeight+"px",e.style.left=.5*Math.max(0,n-t)+"px"}},_fillAdNode:function(e,t,i){if(this.log("_fillAdNode, url:"+t+", content:"+(i?"<omited>":"<empty>")),t)e.src=t;else{if(!i)return this._onRendererFailed(a.ERROR_NULL_ASSET,"Empty URL and content"),!1;(e=e.contentWindow?e.contentWindow.document:e.contentDocument.document?e.contentDocument.document:e.contentDocument).open(),e.write(i),e.close()}return!0},presentInline:function(){this.log("presentInline"),this.isInterstitialNow=!1;var e=this.defaultAdElement;if(e){var t=this._rendererController.getAdInstance(),i=t.getSlot(),n=i.getTimePositionClass(),r=i.getWidth(),s=i.getHeight(),o=i.getVideoDisplaySize().width;i=i.getVideoDisplaySize().height;var l=t.getActiveCreativeRendition();
1switch(t=l.getWidth(),l=l.getHeight(),e.scrolling="no",e.style.overflow="hidden",n){case a.TIME_POSITION_CLASS_DISPLAY:e.style.position="",e.style.background=this.shouldBackgroundTransparent?"transparent":"",e.style.left="0px",e.style.top="0px",e.style.width=(t||r)+"px",e.style.height=(l||s)+"px";break;case a.TIME_POSITION_CLASS_OVERLAY:e.style.position="absolute",e.style.background=this.shouldBackgroundTransparent?"transparent":"white",this._layoutOverlayAd(e);break;default:e.style.position="absolute",e.style.background=this.shouldBackgroundTransparent?"transparent":"white",e.style.left="0px",e.style.top="0px",e.style.width=o+"px",e.style.height=i+"px"}}},presentInterstitial:function(){if(this.log("presentInterstitial, defaultExpandWidth: "+this.defaultExpandWidth+", defaultExpandHeight: "+this.defaultExpandHeight+", this.mraid.expandWidth: "+this.mraid.expandWidth+", this.mraid.expandHeight: "+this.mraid.expandHeight+", (Math.max(0, this.defaultExpandWidth - this.mraid.expandWidth) / 2) = "+Math.max(0,this.defaultExpandWidth-this.mraid.expandWidth)/2+", (Math.max(0, this.defaultExpandHeight - this.mraid.expandHeight) / 2) = "+Math.max(0,this.defaultExpandHeight-this.mraid.expandHeight)/2),this.expandedAdElement){this.isInterstitialNow=!0,document.addEventListener&&(document.removeEventListener("touchmove",this.touchMoveDisabler,!1),document.addEventListener("touchmove",this.touchMoveDisabler,!1));var e=this.expandedAdElement.parentNode;if(this.expandedLightbox||(this.expandedLightbox=document.createElement("div"),this.expandedLightbox.style.background="black",this.expandedLightbox.style.opacity=.8,this.expandedLightbox.style.position="fixed",this.expandedLightbox.style.top="0px",this.expandedLightbox.style.left="0px",this.expandedLightbox.style.zIndex=this.expandedLightbox.style["z-index"]=9999,e.appendChild(this.expandedLightbox)),this.expandedLightbox.style.width=this.defaultExpandWidth+"px",this.expandedLightbox.style.height=this.defaultExpandHeight+"px",this.expandedAdElement.frameBorder="0",this.expandedAdElement.scrolling="no",this.expandedAdElement.style.position="fixed",this.expandedAdElement.style.overflow="hidden",this.expandedAdElement.style.top=this.expandedAdElement.top=Math.max(0,this.defaultExpandHeight-this.mraid.expandHeight)/2+"px",this.expandedAdElement.style.left=this.expandedAdElement.left=Math.max(0,this.defaultExpandWidth-this.mraid.expandWidth)/2+"px",this.expandedAdElement.style.width=this.expandedAdElement.width=this.mraid.expandWidth+"px",this.expandedAdElement.style.height=this.expandedAdElement.height=this.mraid.expandHeight+"px",this.expandedAdElement.style.zIndex=this.expandedAdElement.style["z-index"]=1e4,this.log("presentInterstitial, expanded ad element size: (top, left, width, height) = ("+this.expandedAdElement.top+", "+this.expandedAdElement.left+", "+this.expandedAdElement.width+", "+this.expandedAdElement.height+")"),this.isMRAIDAd){var t=this.expandedAdElement._fw_closeButton;t||((t=document.createElement("div")).addEventListener?t.addEventListener("click",a.Util.bind(this,function(){this._mraidClose()})):t.attachEvent&&t.attachEvent("onclick",a.Util.bind(this,function(){this._mraidClose()})),t.style.position="fixed",t.style.margin="0px",t.style.padding="0px",t.style.width="25px",t.style.height="25px",t.style.zIndex=t.style["z-index"]=10001,e.appendChild(t),this.expandedAdElement._fw_closeButton=t),t.style.top=this.expandedAdElement.style.top,t.style.left=Math.max(0,this.defaultExpandWidth-this.mraid.expandWidth)/2+this.mraid.expandWidth-25+"px",t.innerHTML=this.mraid.useCustomClose?0<a.PLATFORM_ANDROID_VERSION?"   ":"":0<a.PLATFORM_ANDROID_VERSION&&3>=a.PLATFORM_ANDROID_VERSION?'<img style="width:25px; height:25px; border:0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4xJREFUeNrMmjFv2kAUxw/IUAZUw4AqJjIxMAQJ9sIHgDYLUqfSBTowJBudAmOnNCNeAitLyVgxxNlBgk+QTKgb6UQHhr7nniNj8PmM3zk86XQZOPt+ee/e+9+dI4zQms1mGTpsb6EVXH42h/YHmqHrukH17kjAiWvQfYT2gfeH2BjaHfYA9hwqCABkobvik9eI/qkIMYB2A0BPSkG4By44hErrQfvhx0MRn/F/Cy3Lwj
1H0yhfZdRSThOhyCI2FZ/iuRrFYjMxmMyMwCEDc8nB6LSsDTBZg7g4GAYj7ANmI0gpeMDEPTxwDhBRMzAXiGrqv7PgMYTSA+eWZtQACvfCTHbedQzYbu4LwOvHolp3q9TorlUpsuVyyfr/P1us16ezi8TirVqtmP5lMzPcIiuepvc5EHT+4doPIZDImhPV3q9UyX0hl+MxOp2O+I5/Ps1qt5pWat4py1CE7Gm4jnf99Sph9z5Lw9gWf845HhLJjtVqx0WhEDuMGgaElYVdbWYuTDbxGYcwiELreskQiwXK5HFssFmyz2ZBA4PoTrA9nFhtCFnu2PCJdL6bTKYlnCCCYfe4WyGc/I4PCEEK8zD3Cw+rxkPjGDIMp2Rl+otRMDGHZaZRvTQ8yv55RBGEKSwQ5C/IEWRiFEGhnMVj1naCbJa9slk6nVUKg/T2h2iyhZywZ4/RCMplUCWFW+hPBsQ0ZjFMhEEOY9SRKLUv3rRnFEHtFI4nhRPelX1xH2FQYOYjf9EsJ8qQSQqVqth8dkYGI6oQK1awExKvYUQlNL5CFSghq1exiCwQxVEOEAGPEYFPyG2QKniS+CWNTRL05w7DSdf2blX7HYe7siD0ztteRm7B3doQww5c9Ow+vspcKRvHXbrfJBCBBmOH13XdnZe95jcKzJmoVK/KMhPV2JAq/UDG8TgJVCEA3GAlvGG5a61JGpmM4UKtYJ4zEs7fmuu8Qu8vU3xEK12EqlXJV0FZIgTe6QhAOcx/kUEKxYUhVZGX8Oft/sX9sNudz2zHXW13wCm6B71m4F6AiwyuECnhj7mtjxQdUKPcrQdStCELoEZtnNO6ZwiuGU8Xr4wE/HwzgJVDY19T49cOlzA9jsk/EC0iQMQ/cM+9C8MIngOjLDjj0o5oGrzVZBWsBa8TA78Cgnznh3QQe6we9j0cpPnTe1IYG4kgIZR5273mvCdIohg6G6TzI5O32T4ABAPsBS28k7apdAAAAAElFTkSuQmCC">':'<img style="width:25px; height:25px; border:0" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwIiB5PSIwIiB3aWR0aD0iNDAwcHgiIGhlaWdodD0iNDAwcHgiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA0MDAgNDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48Y2lyY2xlIGZpbGw9IiM2NjY2NjYiIGN4PSIyMDAuMTM5IiBjeT0iMTk5Ljg2IiByPSIxOTcuODYiLz48cGF0aCBmaWxsPSIjRjBGMEYwIiBzdHJva2U9IiNGMEYwRjAiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTExNC44NjUsMzAzLjY0NGMtNi4yMjYsNi4yMjctMTUuMzYzLDcuMTg2LTIwLjQwNywyLjE0NGwtMC41MjItMC41MjJjLTUuMDQzLTUuMDQzLTQuMDgzLTE0LjE4LDIuMTQ0LTIwLjQwN0wyODQuODYsOTYuMDc4YzYuMjI2LTYuMjI3LDE1LjM2Mi03LjE4NiwyMC40MDUtMi4xNDRsMC41MjIsMC41MjFjNS4wNDMsNS4wNDIsNC4wODMsMTQuMTc5LTIuMTQ0LDIwLjQwOEwxMTQuODY1LDMwMy42NDR6Ii8+PHBhdGggZmlsbD0iI0YwRjBGMCIgc3Ryb2tlPSIjRjBGMEYwIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIGQ9Ik0zMDcuODE5LDI4OC42NjZjNS4xNTMsNS4xNTgsNS4wNDgsMTMuNjI0LTAuMjQxLDE4LjkxMWwwLDBjLTUuMjg4LDUuMjg5LTEzLjc1Miw1LjM5My0xOC45MDksMC4yNEw5MS45MDYsMTExLjA1NWMtNS4xNTYtNS4xNTYtNS4wNDgtMTMuNjIzLDAuMjQtMTguOTFsMCwwYzUuMjktNS4yODksMTMuNzU1LTUuMzk2LDE4LjkxMS0wLjI0MUwzMDcuODE5LDI4OC42NjZ6Ii8+PC9zdmc+">'}this.isMRAIDAd||this._rendererController.requestContentStateChange(!0)}},_onWindowMessageReceived:function(e){if(this.defaultAdElement&&(e.source===this.defaultAdElement.contentWindow||this.expandedAdElement&&e.source===this.expandedAdElement.contentWindow)){this.log("_onWindowMessageReceived, event.data:"+e.data+", event.origin:"+e.origin);var t=e.data.toString().split(":");if(t&&2<=t.length&&"fwsdk-invoke"===t[0]){var i=t[1];if((t=t.slice(2))&&0<t.length){for(var n=0;n<t.length;n++)t[n]=decodeURIComponent(t[n]);1===t.length&&(t=t[0])}else t=null;"iframe_ready"===i?(this.onLoadFunc&&e.source===this.defaultAdElement.contentWindow&&this.defaultAdElement!==this.expandedAdElement&&this.onLoadFunc(),t&&(t=a.Util.trim(t))&&this.isMRAIDAd&&(this.mraid.baseUrl=t),this.bootstrap&&e.source.postMessage("fwsdk-bounce:"+this.bootstrap,e.origin),e.source.postMessage('fwsdk-bounce:mraid._messagingModel = "postMessage"',e.origin),this.isMRAIDAd&&(e.source===this.defaultAdElement.contentWindow&&this.shouldPauseContentWhenStart&&this._rendererController.requestContentStateChange(!0),this.mraid.inLoadingState()?this.mraid.state=this.mraid.STATEDEFAULT:this.expandedAdElement&&e.source===this.expandedAdElement.contentWindow&&this.mraid.pushData())):this.isMRAIDAd?this._mraidMethods(i,t):"close"===i&&this._stop()}}},_mraidMethods:function(e,t){if(e&&this.isMRAIDAd)switch(this.log("_mraidMethods("+e+", "+t+")"),e){case"open":"string"==typeof t?this._mraidOpen(t):2<=t.length&&this._mraidOpen(t[0],a.Util.str2bool(t[1]));break;case"close":this._mraidClose();break;case"expand":this._mraidExpand(t);break;case"useCustomClose":t&&0<t.length?this.mraid.useCustomClose=a.Util.str2bool(t):this.warn("Invalid parameter to useCustomClose");break;case"setExpandProperties":if(!t)break;this.requestedExpandWidth=Number(t[0]),this.requestedExpandHeight=Number(t[1]),this.requestedExpandWidth&&this.requestedExpandHeight&&(this.requestedExpandWidth!==this.defaultExpandWidth||this.requestedExpandHeight!==this.defaultExpandHeight)||(this.requestedExpandHeight=this.requestedExpandWidth=0),this.mraid.useCustomClose=a.Util.str2bool(t[2]),this.requestedExpandWidth===this.mraid.expandWidth&&this.requestedExpandHeight===this.mraid.expandHeight||this.mraid.pushData();break;case"log":this.log("MRAID log:"+t);break;default:this.warn("Unknown MRAID function call: "+e+" with param:"+t)}},_mraidOpen:function(e,t){this.log("_mraidOpen("+e+"), baseUrl: "+this.mraid.baseUrl+", absolute Url: "+(e=a.Util.getAbsoluteUrl(this.mraid.baseUrl,e))),e&&"string"==typeof e&&0<e.length?((t||void 0===t)&&window.open(e),this._rendererController.processEvent({name:a.EVENT_AD_CLICK,info:{showBrowser:!1}})):this.warn("_mraidOpen: url required for open")}
1,_mraidClose:function(){if(this.log("_mraidClose, current state: "+this.mraid.state),this.mraid.inExpandedState()){window.removeEventListener&&document.removeEventListener("touchmove",this.touchMoveDisabler,!1);var e=this.expandedAdElement,t=this.expandedAdElement._fw_closeButton;this.expandedAdElement._fw_closeButton=null;var i=this.expandedAdElement.parentNode;this.mraid.state=this.mraid.STATEDEFAULT,this.expandedLightbox&&(i.removeChild(this.expandedLightbox),this.expandedLightbox=null),e!==this.defaultAdElement&&(e.style.display="hidden",window.setTimeout(function(){i.removeChild(e)},50)),i.removeChild(t)}else this.mraid.inDefaultState()?this.mraid.state=this.mraid.STATEHIDDEN:this.warn("_mraidClose: close() is only valid when in expanded/default state")},_mraidExpand:function(e){if(this.log("_mraidExpand, current state: "+this.mraid.state),this.mraid.inDefaultState())if(this.shouldKeepInterstitial)this.warn("_mraidExpand: expand() is only valid for inline ad");else{if(e){var t=document.createElement("iframe"),i=a.Util.getAbsoluteUrl(this.mraid.baseUrl,e);this.shouldBackgroundTransparent&&(t.allowTransparency="true",t.style["background-color"]="rgba(255,255,255,0)"),(this.defaultAdElementContainer||this.defaultAdElement.parentNode).appendChild(t),this.expandedAdElement=t,this.log("_mraidExpand("+e+"), baseUrl:"+this.mraid.baseUrl+", absolute Url"+i),this._fillAdNode(t,i,null)}this.mraid.state=this.mraid.STATEEXPANDED,this.isInterstitialNow=!0,this._onViewportResizeScroll()}else this.warn("_mraidExpand: expand() is only valid when in default state")},_onViewportResizeScroll:function(){var e=a.Util.getViewport();this.defaultExpandWidth=e.width,this.defaultExpandHeight=e.height,this.isInterstitialNow&&this.presentInterstitial()},log:function(e){var t=this._rendererController.getAdInstance().getSlot();a.log("HTMLRenderer["+t+"]\t"+e)},warn:function(e){var t=this._rendererController.getAdInstance().getSlot();a.warn("HTMLRenderer["+t+"]\t"+e)},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){return this.timer?this.timer.getPlayheadTime():-1},getDuration:function(){return this.timer?this.timer.getDuration():-1},_onRendererFailed:function(e,t,i){var n={};n[a.INFO_KEY_ERROR_MODULE]="HTMLRenderer",n[a.INFO_KEY_ERROR_CODE]=e,this._rendererController.getAdInstance().getSlot().getTimePositionClass()===a.TIME_POSITION_CLASS_OVERLAY?i||(i=a.ERROR_VAST_NON_LINEAR_GENERAL_ERROR):this._rendererController.getAdInstance().getSlot().getTimePositionClass()!==a.TIME_POSITION_CLASS_DISPLAY||i||(i=a.ERROR_VAST_COMPANION_GENERAL_ERROR),i&&(n[a.INFO_KEY_VAST_ERROR_CODE]=i),t&&(n[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.RENDERER_STATE_FAILED,n)}},a.HTMLRenderer.prototype.constructor=a.HTMLRenderer,a.PauseAdExtension=function(){this._context=null,this.linearSlotToPauseSlotsMap={},this.currentPlayingPauseSlotCustomId=this.toBePlayedPauseSlotCustomId=null,this.needDispatchContentResumeEvent=!1},a.PauseAdExtension.prototype={init:function(e){a.debug("PauseAdExtension.init(context)"),this._context=e,this._onRequestComplete=a.Util.bind(this,function(e){if(a.debug("PauseAdExtension._onRequestComplete"),a.Util.getBooleanParameter(a.PARAMETER_EXTENSION_PAUSE_AD_ENABLE,!0))if(e.success){for(var t=(e=this._context.getTemporalSlots()).filter(function(e){return e.isPauseSlot(
1)}),i=0;i<e.length;i++){var n=e[i];if(n.getTimePositionClass()===a.TIME_POSITION_CLASS_PREROLL||n.getTimePositionClass()===a.TIME_POSITION_CLASS_MIDROLL){for(var r=[],s=0;s<t.length;s++){var o=t[s];o.getTimePosition()===n.getTimePosition()&&r.push(o.getCustomId())}0<r.length&&(this.linearSlotToPauseSlotsMap[n.getCustomId()]=r)}}for(i=0;i<t.length;i++)if(0===(n=t[i]).getTimePosition()){this.toBePlayedPauseSlotCustomId=n.getCustomId();break}a.debug("PauseAdExtension: toBePlayedPauseSlotCustomId:"+this.toBePlayedPauseSlotCustomId),this._context.addEventListener(a.EVENT_SLOT_STARTED,this._onSlotStarted),this._context.addEventListener(a.EVENT_SLOT_ENDED,this._onSlotEnded),this._context.addEventListener(a.EVENT_AD,this._onAdEvent)}else a.debug("PauseAdExtension: request complete failed");else a.debug("PauseAdExtension: return since PauseAdExtension is disabled")}),this._onSlotStarted=a.Util.bind(this,function(e){a.debug("PauseAdExtension._onSlotStarted"),e=e.slot;var t=this.linearSlotToPauseSlotsMap[e.getCustomId()];t?(a.debug("PauseAdExtension: setting pause slot to follow after preroll or midroll"),this.toBePlayedPauseSlotCustomId=t[Math.floor(Math.random()*Math.floor(Math.pow(2,32)+1))%t.length]):e.getTimePositionClass()===a.TIME_POSITION_CLASS_PAUSE_MIDROLL&&(this.currentPlayingPauseSlotCustomId=e.getCustomId())}),this._onSlotEnded=a.Util.bind(this,function(e){a.debug("PauseAdExtension._onSlotEnded"),this.needDispatchContentResumeEvent&&this.currentPlayingPauseSlotCustomId===e.slot.getCustomId()&&(this.needDispatchContentResumeEvent=!1,this.currentPlayingPauseSlotCustomId=null,a.debug("PauseAdExtension: _requestContentVideoToResumeBySlot",e.slot.getCustomId()),this._context._requestContentVideoToResumeBySlot(e.slot))}),this._onUserActionNotified=a.Util.bind(this,function(e){a.debug("PauseAdExtension._onUserActionNotified"),(e=e.action)===a.EVENT_USER_ACTION_PAUSE_BUTTON_CLICKED?(a.debug("PauseAdExtension: pauseButtonClicked"),(e=this._context.getSlotByCustomId(this.toBePlayedPauseSlotCustomId))&&(a.debug("PauseAdExtension: slot.play: "+this.toBePlayedPauseSlotCustomId),e.play())):e===a.EVENT_USER_ACTION_RESUME_BUTTON_CLICKED?(a.debug("PauseAdExtension: resumeButtonClicked"),this.currentPlayingPauseSlotCustomId?(e=this._context.getSlotByCustomId(this.currentPlayingPauseSlotCustomId))&&(a.debug("PauseAdExtension: slot.stop: "+this.currentPlayingPauseSlotCustomId),e.stop(),this.needDispatchContentResumeEvent=!1,this.currentPlayingPauseSlotCustomId=null):a.debug("PauseAdExtension: Current playing pause slot id was empty. No slot to stop.")):a.debug("PauseAdExtension: No valid user action was provided.")}),this._onAdEvent=a.Util.bind(this,function(e){e.subType&&e.subType===a.EVENT_AD_IMPRESSION?(a.debug("PauseAdExtension._onAdEvent impression fired"),this.currentPlayingPauseSlotCustomId===e.slot.getCustomId()&&(this.needDispatchContentResumeEvent=!0)):e.subType&&e.subType===tv.freewheel.SDK.EVENT_ERROR&&(a.debug("PauseAdExtension._onAdEvent error fired"),this.currentPlayingPauseSlotCustomId===e.slot.getCustomId()&&(this.needDispatchContentResumeEvent=!1))}),this._context.addEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete),this._context.addEventListener(a.EVENT_USER_ACTION_NOTIFIED,this._onUserActionNotified)},dispose:function(){a.debug("PauseAdExtension.dispose()"),this._context&&(this._context.removeEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete),this._context.removeEventListener(a.EVENT_USER_ACTION_NOTIFIED,this._onUserActionNotified),this._context.removeEventListener(a.EVENT_AD,this._onAdEvent),this._context.removeEventListener(a.EVENT_SLOT_STARTED,this._onSlotStarted),this._context.removeEventListener(a.EVENT_SLOT_ENDED,this._onSlotEnded),this._context=null)}},a.PauseAdExtension.prototype.constructor=a.PauseAdExtension,a.CustomPlayerRenderer=function(){this._adListener=this._customPlayer=this._rendererController=null,this._quartileSent=0,this._isPaused=this._isStarted=!1,this._timeoutTracker=null,this._lastPlayheadTime=0,this._timeUpdatePollingIntervalInMs=250},a.CustomPlayerRenderer.prototype={pause:function(){this._isPaused=!0,this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),this._customPlayer&&this._customPlayer.playPause(!0)},resume:function(){this._isPaused=!1,this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_RESUME}),this._customPlayer&&this._customPlayer.playPause(!1)},start:function(e){if(this._rendererController=e,this._customPlayer=this._rendererController.getCustomPlayer()){var t=(e=this._rendererController.getAdInstance()).getSlot();a.log("CustomPlayerRenderer.start",t.getTimePositionClass(),e);var i=t.getVideoDisplaySize().width,n=t.getVideoDisplaySize().height;t=e.getRenderableCreativeRenditions(),(n=(i=new a.RenditionSelector(this._rendererController.getParameter(a.PARAMETER_DESIRED_BITRATE)||1e3,this._rendererController.getParameter("arWeight")||1,this._rendererController.getParameter("pxWeight")||1,.2).getCustomPlayerBestFitRendition(t,i,n))?i.getPrimaryCreativeRenditionAsset():null)&&t.length?(t=n.getProxiedUrl())?(e.setActiveCreativeRendition(i),a.log("CustomPlayerRenderer.start selected rendition is:",t),this._rendererController.setCapability(a.EVENT_AD_QUARTILE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_MUTE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_PAUSE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_CLICK,a.CAPABILITY_STATUS_OFF),this._adListener=new a.AdListener(this),e=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT)||5e3,this._progressTimeoutInMs=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT)||8e3,this._onTimeout=a.Util.bind(this,function(e){this._adListener.onError(e)}),this._timeoutTracker=setTimeout(this._onTimeout,e,e+" ms custom player timeout before playing"),this._quartileTimerId=setInterval(a.Util.bind(this,this._pollForAdVideoTimeUpdate),this._timeUpdatePollingIntervalInMs),a.log("CustomPlayerRenderer will play video ad: "+t),this._customPlayer.open(i,this._adListener)):this._onRendererFailed(a.ERROR_NULL_ASSET):this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"no compatible asset")}else this._onRendererFailed(a.ERROR_UNKNOWN,"custom player was null")},_pollForAdVideoTimeUpdate:function(){var e=this._customPlayer.getPlayheadTime(),t=this._customPlayer.getDuration();"number"==typeof e&&"number"==typeof t&&(0>=e||0>=t?a.debug("CustomPlayerRenderer._pollForAdVideoTimeUpdate currentTime or duration is less than or 0"):(this._isStarted||(this._isStarted=!0,this._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED)),this._rendererController&&(this._rendererController.checkProgress(e),this._rendererController.checkForSkippableStateChange()),e>this._lastPlayheadTime&&(this._clearTimeoutTracker(),this._lastPlayheadTime=e,this._isPaused||(this._timeoutTracker=setTimeout(this._onTimeout,this._progressTimeoutInMs,this._progressTimeoutInMs+" ms custom player timeout when playing"))),e>=.25*t&&1>this._quartileSent&&(this._quartileSent=1,this._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE})),e>=.5*t&&2>this._quartileSent&&(this._quartileSent=2,this._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT})),e>=.75*t&&3>this._quartileSent&&(this._quartileSent=3,this._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE})),e>=t-.5&&4>this._quartileSent&&(this._rendererController.checkProgress(t),this._quartileSent=4,this._rendererController.processEvent({name:a.EVENT_AD_COMPLETE}))))},_onEnded:function(e){if(a.debug("CustomPlayerRenderer._onEnded"),this._pollForAdVideoTimeUpdate(),this._clearTimeoutTracker(),this._clearQuartileTimer(),this._customPlayer=null,this._adListener=this._adListener._
1customPlayerRenderer=null,e){var t=a.ERROR_CUSTOM_PLAYER;e.includes("timeout")&&(t=a.ERROR_TIMEOUT),this._onRendererFailed(t,e)}else this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED);this._rendererController=null},stop:function(){a.debug("CustomPlayerRenderer.stop"),this._customPlayer&&this._customPlayer.playPause(!0),this._onEnded()},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){return this._customPlayer?this._customPlayer.getPlayheadTime():-1},getDuration:function(){return this._customPlayer?this._customPlayer.getDuration():-1},setVolume:function(e){a.warn("setVolume is not supported at this time")},_clearTimeoutTracker:function(){this._timeoutTracker&&(clearTimeout(this._timeoutTracker),this._timeoutTracker=null)},_clearQuartileTimer:function(){this._quartileTimerId&&(clearInterval(this._quartileTimerId),this._quartileTimerId=null)},_onRendererFailed:function(e,t){var i={};i[a.INFO_KEY_ERROR_MODULE]="CustomPlayerRenderer",i[a.INFO_KEY_ERROR_CODE]=e,t&&(i[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.RENDERER_STATE_FAILED,i)}},a.CustomPlayerRenderer.prototype.constructor=a.CustomPlayerRenderer,a.AdListener=function(e){this._customPlayerRenderer=e},a.AdListener.prototype={onEnded:function(){a.debug("AdListener.onEnded"),this._customPlayerRenderer._onEnded()},onError:function(e){a.warn("AdListener.onError:",e),this._customPlayerRenderer._onEnded(e)}},a.AdListener.prototype.constructor=a.AdListener,a.Timer=function(e,t){this._lastTickDate=new Date,this._duration=e||-1,this._playheadTime=-1,this._callback=t,this._state=-1},a.Timer.prototype={},a.Timer.prototype.constructor=a.Timer,a.Util.mixin(a.Timer.prototype,{tick:function(){var e=new Date,t=Math.round((e.getTime()-this._lastTickDate.getTime())/1e3);return this._lastTickDate=e,t},start:function(){if(0!==this._state){2!==this._state&&-1!==this._playheadTime||(this._playheadTime=0),this._state=0,this._timeStamp=new Date,this._timeouter&&(window.clearTimeout(this._timeouter),this._timeouter=null);var e=this,t=1e3*(this._duration-this._playheadTime);0>t||(this._timeouter=window.setTimeout(function(){e.stop(),e._playheadTime=e._duration,e._callback&&e._callback()},t))}},pause:function(){0===this._state&&(this._state=1,this._timeouter&&(window.clearTimeout(this._timeouter),this._timeouter=null),this._playheadTime=(new Date-this._timeStamp)/1e3+this._playheadTime)},stop:function(){this._state=2,this._timeouter&&(window.clearTimeout(this._timeouter),this._timeouter=null),this._playheadTime=(new Date-this._timeStamp)/1e3+this._playheadTime},getPlayheadTime:function(){return 0===this._state?(new Date-this._timeStamp)/1e3+this._playheadTime:this._playheadTime},getCTValue:function(){return(new Date-this._timeStamp)/1e3},getDuration:function(){return this._duration}}),a.RendererController=function(e,t){var i=null,n=null,r={},s=a.RendererInitState.instance,o={},l=[],d=0,_=!1,c=!1,u=[];return{getAdInstance:function(){return t},getContext:function(){return e},getRendererState:function(){return s},processEvent:function(e){var i=e.name;if(i===a.RENDERER_STATE_STARTED||i===a.RENDERER_STATE_COMPLETING||i===a.RENDERER_STATE_COMPLETED||i===a.RENDERER_STATE_FAILED)this.handleStateTransition(i,e.info);else{var n=this._inferEventType(i);if(n&&(n===a.EVENT_TYPE_CLICK&&e.info&&e.info[a.INFO_KEY_CUSTOM_EVENT_NAME]&&(i=e.info[a.INFO_KEY_CUSTOM_EVENT_NAME]),i!==a.EVENT_AD_MEASUREMENT||e.info[a.INFO_KEY_CONCRETE_EVENT_ID])){var r=i===a.EVENT_AD_INITIATED||i===a.EVENT_AD_PREINIT||i===a.EVENT_AD_BUFFERING_START||i===a.EVENT_AD_BUFFERING_END||i===a.EVENT_AD_VOLUME_CHANGE||i===a.EVENT_AD_SKIPPABLE_STATE_CHANGED||e.info&&e.info.hasOwnProperty("apiOnly")&&e.info.apiOnly;t.processEvent(i,n,e.info,r)}}},checkProgress:function(e){for(;0<u.length&&u[0]<e;)t.processProgressEvent(u.shift())},checkForSkippableStateChange:function(){!c&&t&&t.getAdSkippableState()&&(c=!0,this.processEvent({name:a.EVENT_AD_SKIPPABLE_STATE_CHANGED}))},handleStateTransition:function(e,i){switch(e){case a.RENDERER_STATE_STARTED:u=Object.keys(t._progressEventCallbackUrlsDict||[]).sort(function(e,t){return e-t}),i&&i[a.INFO_KEY_START_TIME_POSITION]&&t.setStartTimePosition(i[a.INFO_KEY_START_TIME_POSITION]),s.notifyStarted(this);break;case a.RENDERER_STATE_COMPLETING:s.complete(this);break;case a.RENDERER_STATE_COMPLETED:s.complete(this),s.notifyCompleted(this);break;case a.RENDERER_STATE_FAILED:if(t.getSlot()._clearScheduledAdInstance(),i||(i={}),a.warn("FAIL",", FW ErrorModule:",i[a.INFO_KEY_ERROR_MODULE],", FW ErrorCode:",i[a.INFO_KEY_ERROR_CODE],", FW ErrorInfo:",i[a.INFO_KEY_ERROR_INFO],", VAST ErrorCode:",i[a.INFO_KEY_VAST_ERROR_CODE]),(e=t.processEvent(a.EVENT_ERROR,a.EVENT_TYPE_ERROR,i))||a.debug("No EVENT_ERROR callback found"),i)switch(i[a.INFO_KEY_ERROR_CODE]){case a.ERROR_NO_AD_AVAILABLE:case a.ERROR_PARSE:(e=t.processEvent(a.EVENT_RESELLER_NO_AD,a.EVENT_TYPE_IMPRESSION))||a.debug("No EVENT_RESELLER_NO_AD callback found.")}s.fail(this);break;default:a.debug("Unknown event received",e)}},setCapability:function(e,i){t.setMetr(e,i)},getVersion:function(){return e._adManager.getVersion()},getParameter:function(i){if(!i)return null;if(e._overrideLevelParameterDictionary.hasOwnProperty(i))return e._overrideLevelParameterDictionary[i];if(t.getActiveCreativeRendition()&&void 0!==t.getActiveCreativeRendition().getParameter(i))return t.getActiveCreativeRendition().getParameter(i);var n=t._creative;return n&&void 0!==n.getParameter(i)?n.getParameter(i):void 0!==t.getSlot().getParameter(i)?t.getSlot().getParameter(i):e._adResponse._profileParameters.hasOwnProperty(i)?e._adResponse._profileParameters[i]:e._globalLevelParameterDictionary.hasOwnProperty(i)?e._globalLevelParameterDictionary[i]:r&&r.hasOwnProperty(i)?r[i]:null},getCompanionSlots:function(){for(var e=[],i=t._companionAdInstances,n=0;n<i.length;n++)i[n].isPlaceholder()&&e.push(i[n].getSlot());return e},createNullDrivingAdInstance:function(){var e=t.getSlot().scheduleAdInstance();return e.addCreativeRendition().setContentType("null/null"),e},scheduleAdInstances:function(e){var i,n=[],a=null;if(0===(e=e||[]).length)return n;for(i=0;i<e.length;i++)e[i].getCustomId()===t.getSlot().getCustomId()&&(a=t.getSlot().scheduleAdInstance());if(!a)if(this.isTranslator())a=this.createNullDrivingAdInstance();else{if(!this.isRenderer())return n;a=t}for(var r=0;r<e.length;r++){if(e[r].getCustomId()===t.getSlot().getCustomId())a!==t&&n.push(a);else for(var s=0,d=a._companionAdInstances;s<d.length;
1s++)if(i=d[s],e[r]===i.getSlot()){if(this.isTranslator())n.push(i);else if(this.isRenderer()&&i.isPlaceholder()){var _=i.cloneForTranslation();a===t&&(o[_]=i),d[s]=_,n.push(_),l.push(_)}break}n.length<=r&&n.push(null)}return n},commitAdInstance:function(){if(this.isRenderer()&&t.isStarted()){for(var e=0;e<l.length;e++){var i=l[e];i&&i.getSlot().playCompanionAds(i)}l=[]}else a.warn("Skipping RendererController.commitAdInstance when called with driving ad not started or completed.")},isRenderer:function(){return i&&a.MODULE_TYPE_RENDERER===i.info()[a.INFO_KEY_MODULE_TYPE]},isTranslator:function(){return i&&a.MODULE_TYPE_TRANSLATOR===i.info()[a.INFO_KEY_MODULE_TYPE]},playable:function(){return s===a.RendererInitState.instance},reset:function(){s=a.RendererInitState.instance},play:function(){for(var e=t.getRenderableCreativeRenditions()||[],i=null,n=0;n<e.length;n++){var a=e[n];if(i=this._matchRendererClassName(a)){t.setActiveCreativeRendition(a);break}}0===d&&this._actualPlay(i)},_actualPlay:function(e){(n=a.Util.getObject(e)||a.Util.getObject(h+"."+e))&&(i=new n),i?(_||this.isTranslator()||(_=!0,this.processEvent({name:a.EVENT_AD_PREINIT}),a.debug("Fired preInit for: "+e)),s.start(this)):this.handleStateTransition(a.RENDERER_STATE_FAILED,{errorCode:a.ERROR_NO_RENDERER,errorInfo:"Renderer class <"+e+"> not found"})},dispatchEvent:function(t,i){e.dispatchEvent(t,i)},requestContentStateChange:function(i){i?e._requestContentVideoToPauseBySlot(t.getSlot()):e._requestContentVideoToResumeBySlot(t.getSlot())},getRenderer:function(){return i},setRenderer:function(e){i=e},setRendererState:function(e){s=e},getContentVideoElement:function(){return e.getContentVideoElement()},getCustomPlayer:function(){return e.getCustomPlayer()},_restorePlaceholdersForHybrid:function(){if(o&&this.isRenderer()){for(var e=[],i=0;i<t._companionAdInstances.length;i++){var n=t._companionAdInstances[i],a=o[n];a?e.push(a):e.push(n)}t._companionAdInstances=e}0<l.length&&this.isRenderer()&&(l=[])},rendererMatch:function(e){return!n||n===a.Util.getObject(this._matchRendererClassName(e))},_matchRendererClassName:function(i){function n(e,t,i){if(a.debug("matching "+e+" within "+t),!t)return!0;if((t=t.split(","))[t.length-1]||t.pop(),i){for(e=e.toLowerCase(),i=0;i<t.length;i++)if(e===t[i].toLowerCase())return!0;return a.debug("not match"),!1}return(t=0<=t.indexOf(e))||a.debug("not match"),t}var s=i.getPrimaryCreativeRenditionAsset().getContentType(),o=i.getContentType(),l=i.getWrapperType(),_=i.getCreativeApi(),c=i.getBaseUnit(),u=t.getSoAdUnit(),E=t.getSlot(),p=E.getType();if(E=E.getTimePositionClass(),a.debug("match renderer for creativeRendition:"+i.getId()),a.debug("slot type:"+p),a.Util.isBlank(o)&&a.Util.isBlank(l))return a.warn("renderer not match due to both contentType and wrapperType are empty"),null;var A=e._rendererManifest["*"];if(A||(A=e._rendererManifest[l]),A||(A=e._rendererManifest[o]),!A){p=e._overriddenAdRenderers.concat(e._adResponse._adRenderers);for(var T=0;T<p.length;T++){var R=p[T],g=!R.contentType;if(g||(l?g=n(l,R.contentType,!0):(s&&(g=n(s,R.contentType,!0)),g||(g=n(o,R.contentType,!0)))),g)if((g=!R.creativeApi)||(g=n(_,R.creativeApi)),g){if(R.baseUnit&&!n(c,R.baseUnit))a.debug("can't match renderer "+R.url+" due to baseUnit not match for creativeRendition:"+i.getId());else if(R.soAdUnit&&!n(u,R.soAdUnit))a.debug("can't match renderer "+R.url+" due to soAdUnit not match for creativeRendition:"+i.getId());else if(R.slotType&&!n(E.toUpperCase(),R.slotType.toUpperCase()))a.debug("can't match renderer "+R.url+" due to slotType not match for creativeRendition:"+i.getId());else if("class://DashRenderer"===R.url&&void 0===window.tv.freewheel.Dashjs)a.debug("can't match renderer "+R.url+" due to missing tv.freewheel.Dash.js for creativeRendition:"+i.getId());else if(a.debug("renderer "+R.url+" matched for creativeRendition:"+i.getId()),R.url){-1!==(i=(A=R.url).indexOf("?"))&&(A=A.substring(0,i)),-1!==(i=A.lastIndexOf("/"))&&(A=A.substring(i+1)),-1!==(i=A.lastIndexOf(".js"))&&(A=A.substring(0,i));var m={};if(R.parameter)for(i=[].concat(R.parameter),s=0;s<i.length;s++)if(i[s].hasOwnProperty("name"))m[i[s].name]=i[s].value;else for(var I in i[s])i[s].hasOwnProperty(I)&&(m[I]=i[s][I]);if(a.Util.getObject(h+"."+A)&&(A=h+"."+A),a.Util.getObject(A))r=m,d=0;else{if(0<d)break;var S=this;I=1*this.getContext().getParameter("moduleLoadTimeout")||6e4,d=window.setTimeout(function(){d=-1,S.handleStateTransition(a.RENDERER_STATE_FAILED,{errorCode:a.ERROR_NO_RENDERER,errorInfo:"Load renderer timeout, URL:"+R.url})},I),a.Util.lazyJavaScriptLoad(R.url,function(){a.log("async load renderer successful, URL:"+R.url),-1===d?a.debug("renderer loaded after timeout. WILL NOT PLAY."):(window.clearTimeout(d),d=0,r=m,S._actualPlay(A))})}break}}else a.debug("can't match renderer "+R.url+" due to creative api not match for creativeRendition:"+i.getId());else a.debug("can't match renderer "+R.url+" due to contentType not match for creativeRendition:"+i.getId())}}return A||(a.Util.isBlank(l)&&"null/null"===o?h+".NullRenderer":null)},_inferEventType:function(e){return e===a.EVENT_ERROR?a.EVENT_TYPE_ERROR:e===a.EVENT_AD_CLICK?a.EVENT_TYPE_CLICK:e===a.EVENT_AD_IMPRESSION||e===a.EVENT_AD_FIRST_QUARTILE||e===a.EVENT_AD_MIDPOINT||e===a.EVENT_AD_THIRD_QUARTILE||e===a.EVENT_AD_COMPLETE||e===a.EVENT_RESELLER_NO_AD?a.EVENT_TYPE_IMPRESSION:e===a.EVENT_AD_PAUSE||e===a.EVENT_AD_RESUME||e===a.EVENT_AD_REWIND||e===a.EVENT_AD_MUTE||e===a.EVENT_AD_UNMUTE||e===a.EVENT_AD_COLLAPSE||e===a.EVENT_AD_EXPAND||e===a.EVENT_AD_MINIMIZE||e===a.EVENT_AD_CLOSE||e===a.EVENT_AD_ACCEPT_INVITATION||e===a.EVENT_AD_SKIPPED?a.EVENT_TYPE_STANDARD:e===a.EVENT_AD_MEASUREMENT||e===a.EVENT_AD_VOLUME_CHANGE||e===a.EVENT_AD_BUFFERING_START||e===a.EVENT_AD_BUFFERING_END||e===a.EVENT_AD_INITIATED||e===a.EVENT_AD_PREINIT||e===a.EVENT_AD_AUTO_PLAY_BLOCKED||e===a.EVENT_AD_SKIPPABLE_STATE_CHANGED?a.EVENT_TYPE_GENERIC:null},pause:function(){a.log("RendererController.pause"),i&&"function"==typeof i.pause?i.pause():a.log("Renderer.pause() is not implemented.")},resume:function(){a.log("RendererController.resume"),i&&"function"==typeof i.resume?i.resume():a.log("Renderer.resume() is not implemented.")},stop:function(){a.log("RendererController.stop"),0<d&&(d=-1),s.stop(this)}}},a.VideoStateExtension=function(){},a.VideoStateExtension.prototype={_enabled:function(){if(null==this._context)return!1;var e=this._context.getParameter(a.PARAMETER_EXTENSION_VIDEO_STATE_ENABLED);return null==e&&(e="false"),!0===a.Util.str2bool(e)},init:function(e){this._context=e,this._enabled()?this._context.setVideoState(a.VIDEO_STATE_PLAYING):a.log("VideoStateExtension is disabled.")},dispose:function(){this._context=null}},a.VideoStateExtension.prototype.constructor=a.VideoStateExtension,a.AdResponse=function(e){this._context=e},a.AdResponse.prototype={},a.AdResponse.prototype.constructor=a.AdResponse,a.Util.mixin(a.AdResponse.prototype,{parse:function(e,t){var i;this._data=e,this._temporalSlots=[],this._videoPlayerNonTemporalSlots=[],this._siteSectionNonTemporalSlots=[],this._profileParameters={},this._ads=[],this._siteSectionCustomId=a.Util.getObject("siteSection.customId",e)||"",this._adRenderers=[];var n=a.Util.getObject("parameters",e)||[];for(i=0;i<n.length;++i){var r=n[i];this._profileParameters[r.name]=r.value}for(this._adRenderers=a.Util.getObject("rendererManifest.adRenderers.adRenderer",e)||[],i=0;i<this._adRenderers.length;i++)void 0!==this._adRenderers[i].adUnit&&(this._adRenderers[i].baseUnit=this._adRenderers[i].adUnit,delete this._adRenderers[i].adUnit);for(n=a.Util.getObject("ads.ads",e)||[],i=0;i<n.length;++i)(r=new a.Ad(this._context)).parse(n[i]),this._ads.push(r);for(n=a.Util.getObject("siteSection.videoPlayer.videoAsset.adSlots",e)||[],i=0;i<n.length;++i)(r=new a.Slot(this._context)).setType(a.SLOT_TYPE_TEMPORAL),r.setBase(t),r.parse(n[i]),this._temporalSlots.push(r);for(n=a.Util.getObject("siteSection.videoPlayer.adSlots",e)||[],i=0;i<n.length;++i)(r=new a.Slot(this._context)).setType(a.SLOT_TYPE_VIDEOPLAYER_NONTEMPORAL),r.setTimePositionClass(a.TIME_POSITION_CLASS_DISPLAY),r.parse(n[i]),this._initSlotData(r),this._videoPlayerNonTemporalSlots.push(r);for(n=a.Util.getObject("siteSection.adSlots",e)||[],i=0;i<n.length;++i)(r=new a.Slot(this._context)).setType(a.SLOT_TYPE_SITESECTION_NONTEMPORAL),r.setTimePositionClass(a.TIME_POSITION_CLASS_DISPLAY),r.parse(n[i]),this._initSlotData(r),this._siteSectionNonTemporalSlots.push(r);e=a.Util.getObject("siteSection.videoPlayer.videoAsset",e)||{},this._context._videoAsset.parse(e)},getCreative:function(e,t){return(e=this.getAd(e))?e.getCreative(t):null},getAd:function(e){for(var t=0;t<this._ads.length;t++){var i=this._ads[t];if(i.getId()===e)return i}return null},getTemporalSlots:function(){return this._temporalSlots},getSiteSectionNonTemporalSlots:function(){return this._siteSectionNonTemporalSlots},getVideoPlayerNonTemporalSlots:function(){return this._videoPlayerNonTemporalSlots},getSiteSectionCustomId:function(){return this._siteSectionCustomId},getSlotByCustomId:function(e){for(var t=0;t<this._temporalSlots.length;++t)if(this._temporalSlots[t].getCustomId()===e)return this._temporalSlots[t];for(t=0;t<this._videoPlayerNonTemporalSlots.length;++t)if(this._videoPlayerNonTemporalSlots[t].getCustomId()===e)return this._videoPlayerNonTemporalSlots[t];for(t=0;t<this._siteSectionNonTemporalSlots.length;++t)if(this._siteSectionNonTemporalSlots[t].getCustomId()===e)return this._siteSectionNonTemporalSlots[t];return a.warn("getSlotByCustomId(): not found",e),null},_initSlotData:function(e){for(var t=!1,i=0;i<this._context._adRequest._slotScanner._knownSlots.length;i++){var n=this._context._adRequest._slotScanner._knownSlots[i];if(e.getCustomId()===n.id&&n.element){e.setWidth(n.width),e.setHeight(n.height),e.setBase(n.element),e.setAcceptCompanion(n.acceptCompanion),e.setInitialAdOption(n.initialAdOption),t=!0;break}}return t||a.warn("Failed to init slot "+e.getCustomId()),t}}),a.Slot=function(e){var t,i,n,r,s,o,l,d,_,h="",c=null,u=null,E=null,p=null,A=[],T=[],R={},g=null,m=a.MediaInitState.instance,I=0,S=null,f=0,v=0,C=[],P=null,O=0,N=!1,D=!1,y=!0,L=[],M=!1;return{getAutoPlayBlocked:function(){return M},setAutoPlayBlocked:function(e){M=e},getSlotProfile:function(){return u},setSlotProfile:function(e){u=e},setMediaState:function(e){m=e},setParameter:function(e,t){null==t?delete R[e]:R[e]=t},getParameter:function(e){if(e&&R.hasOwnProperty(e))return R[e]},getAdCount:function(){return A.length},setCustomId:function(e){h=e},getCustomId:function(){return h},setAdUnit:function(e){o=e},getAdUnit:function(){return o},setType:function(e){c=e},getType:function(){return c},setTimePosition:function(e){i=e},getTimePosition:function(){return i},getEndTimePosition:function(){return n}
1,setTimePositionClass:function(e){S=e&&e.toUpperCase()},getTimePositionClass:function(){return S},setWidth:function(e){r=e},getWidth:function(){return S!==a.TIME_POSITION_CLASS_DISPLAY?r||e.getVideoDisplaySize().width:r},setHeight:function(e){s=1*e},getHeight:function(){return S!==a.TIME_POSITION_CLASS_DISPLAY?s||e.getVideoDisplaySize().height:s},setBase:function(e){t=e},getBase:function(){return t},setCuepointSequence:function(e){l=1*e?1*e:0},getCuepointSequence:function(){return l},getVideoDisplaySize:function(){return e.getVideoDisplaySize()},setMaxDuration:function(e){f=1*e?1*e:0},getMaxDuration:function(){return f},setMinDuration:function(e){v=1*e?1*e:0},getMinDuration:function(){return v},setAcceptContentType:function(e){if(e&&e.trim()){e=e.split(",");for(var t=0;t<e.length;t++)C.push(e[t].trim())}},setSignalId:function(e){e&&e.trim()&&(P=e)},getSignalId:function(){return P},setMaxAds:function(e){O=1*e?1*e:0},getMaxAds:function(){return O},getAcceptContentType:function(){return C.join(",")},parse:function(t){if(t){h=t.customId,i=1*t.timePosition,S=t.timePositionClass&&t.timePositionClass.toUpperCase()||S;var r=1*t.endTimePosition||-1;n=r>=i?r:-1,o=t.adUnit,null==(P=t.signalId)&&(P=t.outSignalId);for(var s=0,l=t.eventCallbacks||[];s<l.length;s++){r=l[s];var d=a.EventCallback.newEventCallback(e,r.name,r.type);d&&(d._slot=this,d.parse(r),T.push(d))}for(s=0,l=t.selectedAds||[];s<l.length;s++)r=l[s],t=[],d=new a.AdInstance(e),t.push(d),d._slot=this,d._slotCustomId=h,d._parentAdInstancesGroup=t,d.parse(r),A.push(t)}},getCurrentAdInstance:function(){return E},isPauseSlot:function(){return S===a.TIME_POSITION_CLASS_PAUSE_MIDROLL},play:function(t){if(M)a.log("Resuming previously blocked video ad now."),M=!1,e.getContentVideoElement()&&e.getContentVideoElement().play();else{for(var i=this.getAdInstances(),n=0;n<i.length;n++)i[n]._isSkipped=!1;S!==a.TIME_POSITION_CLASS_DISPLAY||y?(a.log("Slot.play",S),N=!1,S===a.TIME_POSITION_CLASS_DISPLAY&&1<A.length&&A.splice(0,A.length-1),this._play(t)):(a.log("Slot is invisible. Push the play operation to the queue."),L.push({operation:this.play,argument:t}))}},stop:function(){a.log("Slot.stop",S),S===a.TIME_POSITION_CLASS_DISPLAY&&(L=[]),m===a.MediaInitState.instance||m===a.MediaEndState.instance?a.log("Slot.stop, not start or already end, ignore"):(N=!0,E?E.stop():a.warn("Slot.stop, no _currentAdInstance, ignore"))},pause:function(){a.log("Slot.pause"),S!==a.TIME_POSITION_CLASS_DISPLAY?E&&E.pause():a.log("Not a temporal slot. Ignore.")},resume:function(){a.log("Slot.resume"),S!==a.TIME_POSITION_CLASS_DISPLAY?E&&E.resume():a.log("Not a temporal slot. Ignore.")},skipCurrentAd:function(){a.log("Slot.skipCurrentAd ",E),E?E.skip():a.log("Slot.skipCurrentAd, no _currentAdInstance, ignore")},setVisible:function(e){if(S!==a.TIME_POSITION_CLASS_DISPLAY)a.log("Slot.setVisible is only for display ads.");else if(a.log("Slot.setVisible",e),y!==e&&(y=e))for(;0<L.length;)(e=L.pop()).operation&&e.operation.call(this,e.argument)},_play:function(e){g=g||e,m.play(this)},onStartPlaying:function(){this._onStartPlaying()},onStartReplaying:function(){this._onStartPlaying()},onCompletePlaying:function(){this._onCompletePlaying()},onCompleteReplaying:function(){this._onCompletePlaying()},playNextAdInstance:function(){a.log("Slot.playNextAdInstance ",S),this._playNextAdInstance()||m.complete(this)},scheduleAdInstance:function(){return p=E.cloneForTranslation()},_clearScheduledAdInstance:function(){p=null},_onStartPlaying:function(){S===a.TIME_POSITION_CLASS_MIDROLL&&0<A.length&&e._requestContentVideoToPauseBySlot(this);var t=a.EventCallback.getEventCallback(T,a.EVENT_SLOT_IMPRESSION,a.EVENT_TYPE_IMPRESSION);t&&t.process(),this.dispatchSlotEvent(a.EVENT_SLOT_STARTED),this.playNextAdInstance()},dispatchSlotEvent:function(t){D||e.dispatchEvent(t,{slot:this})},_onCompletePlaying:function(){g&&g(),g=null,L=[];var t=a.EventCallback.getEventCallback(T,a.EVENT_SLOT_END,a.EVENT_TYPE_IMPRESSION);t&&t.process(),E=null,this.dispatchSlotEvent(a.EVENT_SLOT_ENDED),S===a.TIME_POSITION_CLASS_MIDROLL&&0<A.length&&e._requestContentVideoToResumeBySlot(this)},_playNextAdInstance:function(){return!(N||m!==a.MediaPlayingState.instance&&m!==a.MediaReplayingState.instance||(this._commitScheduledAdInstance(),!(E=this._nextPlayableAdInstance())||(E.reset(),E._isInitiatedSent||(E.getRendererController().processEvent({name:a.EVENT_AD_INITIATED}),E._isInitiatedSent=!0),E.getRendererController().play(),0)))},_commitScheduledAdInstance:function(){if(p){var e=E._parentAdInstancesGroup.indexOf(E);0<=e&&(p._parentAdInstancesGroup=E._parentAdInstancesGroup,E._parentAdInstancesGroup.splice(e,1,p),p=null)}},_nextPlayableAdInstance:function(){if(E){var e=E._parentAdInstancesGroup,t=e.indexOf(E),i=A.indexOf(e);0<=i&&0<=t&&(E._isImpressionSent||E._isSkipped||t===e.length-1)&&i++}else i=0;if(0>i||i>=A.length)return null;var n;if(m===a.MediaPlayingState.instance){for(e=A[i],n=0;n<e.length;n++)if((t=e[n]).getRendererController().playable())return t}else if(m===a.MediaReplayingState.instance)for(;i<A.length;i++){for(e=A[i],n=0;n<e.length;n++)if((t=e[n])._isImpressionSent)return t;for(n=0;n<e.length;n++)if((t=e[n]).getRendererController().getRendererState()!==a.RendererFailedState.instance&&!t._translated)return t}return null},toString:function(){return"[Slot "+h+"]"},getAdInstances:function(){for(var e=[],t=0;t<A.length;++t)for(var i=A[t],n=0;n<i.length;++n){var a=i[n];if(a.isPlayable()){e.push(a);break}}return e},getPlayheadTime:function(){for(var e=0,t=this.getAdInstances(),i=0;i<t.length;++i){if(t[i]===E){-1<(t=E.getPlayheadTime())&&(e+=t);break}var n=t[i].getDuration();-1<n&&(e+=n)}return I&&e>I&&(e=I),e},getTotalDuration:function(){if(c!==a.SLOT_TYPE_TEMPORAL)return-1;for(var e=0,t=this.getAdInstances(),i=0;i<t.length;++i){var n=t[i].getDuration();-1<n&&(e+=n)}return I=e},playCompanionAds:function(e){a.log("Slot.playCompanionAds");var t=[];e._parentAdInstancesGroup=t,t.push(e),A.push(t),D=!0,E&&this.stop(),this.play()},getState:function(){return m},setAcceptCompanion:function(e){d=e},getAcceptCompanion:function(){return d},setInitialAdOption:function(e){_=e},getInitialAdOption:function(){return _}}},a.SurveyExtension=function(){this._surveyPingedIds=[]},a.SurveyExtension.prototype={init:function(e){this._context=e,a.log("SurveyExtension.init("+Array.prototype.slice.call(arguments).join(",")+")"),this._onAdStarted=a.Util.bind(this,function(e){if(this._parameters=this._getParameters(),this._parameters.enabled){a.log("SurveyExtension.onAdStarted()");var t=e.adInstance;if(-1<this._surveyPingedIds.indexOf(t.getAdId()))a.log("won't pingback survey since it has been pinged back");else{var i=t._creative.getParameter("_fw_survey_url");
1if(i)try{a.log("append"+i+" to head");var n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("src",i),n.appendChild(r),this._surveyPingedIds.push(t.getAdId())}catch(t){a.warn("Append survey to head",e.type,t)}}}}),this._context.addEventListener(a.EVENT_AD_IMPRESSION,this._onAdStarted)},dispose:function(){a.log("SurveyExtension.dispose()"),this._context.removeEventListener(a.EVENT_AD_IMPRESSION,this._onAdStarted),this._parameters=this._onAdStarted=null},_getParameters:function(){var e={};return e.enabled="false"!==this._context.getParameter(a.PARAMETER_EXTENSION_SURVEY_ENABLED),a.log(e),e}},a.SurveyExtension.prototype.constructor=a.SurveyExtension,a.ExtensionManager=function(e){this._extensions={},this._context=e,this._surveyExtension=new a.SurveyExtension,this._surveyExtension.init(e),this._videoStateExtension=new a.VideoStateExtension,this._videoStateExtension.init(e),this._displayRefreshExtension=new a.DisplayRefreshExtension,this._displayRefreshExtension.init(e),this._contentVideoExtension=new a.ContentVideoExtension,this._contentVideoExtension.init(e),this._pauseAdExtension=new a.PauseAdExtension,this._pauseAdExtension.init(e),this._omsdkExtension=new a.OMSDKExtension,this._omsdkExtension.init(e)},a.ExtensionManager.prototype={_scriptLoaded:function(e){if(null==this._extensions[e])this._loadFail(e,"Extension supposed to be loaded but not found");else{var t=a.Util.getObject(e);"function"!=typeof t?this._loadFail(e,"Script loaded but extension class not found"):"function"==typeof(t=new t).init&&"function"==typeof t.dispose?(a.log("Extension loaded: "+e),t.init(this._context),this._context.dispatchEvent(a.EVENT_EXTENSION_LOADED,{success:!0,moduleName:e})):this._loadFail(e,"Extension loaded but is not supported")}},_getExtensionNameFromUrl:function(e){for(var t,i,n=/(?!.*\.{2})(?:[\\/\?=#])([a-z][\w\.]+)(?:\.js(#|\?|$))/gi;null!=(t=n.exec(e));)i=t;return i?i[1]:null},_loadFail:function(e,t){a.log("Extension failed to load. "+e+" : "+t),this._context.dispatchEvent(a.EVENT_EXTENSION_LOADED,{success:!1,errorVal:t,moduleName:e})},load:function(e){if(e){var t=this._getExtensionNameFromUrl(e);if(null==t)this._loadFail(t,"Extension name not exists in the Url. Url: "+e);else if(this._extensions[t]===e)a.log("Extension is already loaded"),this._loadFail(t,"Extension is already loaded");else{var i=1*this._context.getParameter("moduleLoadTimeout")||6e4,n=!1,r=this,s=window.setTimeout(function(){n=!0,r._loadFail(t,"Timeout occured while loading extension. Url: "+e)},i);a.Util.lazyJavaScriptLoad(e,function(){a.log("async load extension successful, URL:"+e),window.clearTimeout(s),n?a.debug("Extension loaded after timeout, do nothing."):(r._extensions[t]=e,r._scriptLoaded(t))})}}else this._loadFail(t,"Url cannot be empty")},dispose:function(){this._extensions=null,this._surveyExtension.dispose(),this._surveyExtension=null,this._displayRefreshExtension.dispose(),this._displayRefreshExtension=null,this._pauseAdExtension.dispose(),this._pauseAdExtension=null,this._omsdkExtension.dispose(),this._omsdkExtension=null,this._videoStateExtension.dispose(),this._videoStateExtension=null,this._contentVideoExtension.dispose(),this._context=this._contentVideoExtension=null}},a.ExtensionManager.prototype.constructor=a.ExtensionManager,a.EventCallback=function(e){this._url=this._name=this._type=null,this._showBrowser=!1,this._trackingUrls=[],this._adInstance=this._slot=null,this._context=e},a.EventCallback.prototype={},a.EventCallback.prototype.constructor=a.EventCallback,a.EventCallback.getEventCallback=function(e,t,i){for(var n,r=0;r<e.length;r++)if((n=e[r])._name===t&&n._type===i)return n;for(r=0;r<e.length;r++)if((n=e[r])._type===a.EVENT_TYPE_GENERIC)return(t=a.EventCallback.newEventCallback(n._context,t,i))&&(t._url=n._url,t._slot=n._slot,t._adInstance=n._adInstance,e.push(t)),t;return null},a.EventCallback.newEventCallback=function(e,t,i){if(i===a.EVENT_TYPE_GENERIC)e=new a.EventCallback(e);else if(i===a.EVENT_TYPE_ERROR)e=new a.ErrorEventCallback(e);else if(i===a.EVENT_TYPE_CLICK)e=new a.AdClickEventCallback(e);else if(i===a.EVENT_TYPE_STANDARD)e=new a.AdStandardEventCallback(e);else if(t===a.EVENT_SLOT_IMPRESSION||t===a.EVENT_SLOT_END)e=new a.SlotImpressionEventCallback(e);else if(t===a.EVENT_AD_IMPRESSION||t===a.EVENT_AD_IMPRESSION_END)e=new a.AdImpressionEventCallback(e);else if(t===a.EVENT_VIDEO_VIEW)e=new a.VideoViewEventCallback(e);else if(t===a.EVENT_RESELLER_NO_AD)e=new a.ResellerNoAdEventCallback(e);else if(t===a.EVENT_AD_FIRST_QUARTILE||t===a.EVENT_AD_MIDPOINT||t===a.EVENT_AD_THIRD_QUARTILE||t===a.EVENT_AD_COMPLETE)e=new a.AdQuartileEventCallback(e);else{if(t!==a.EVENT_AD_PROGRESS)return null;e=new a.AdProgressEventCallback(e)}return e._name=t,e._type=i,e},a.EventCallback.getShortType=function(e){var t="";switch(e){case a.EVENT_TYPE_IMPRESSION:t=a.SHORT_EVENT_TYPE_IMPRESSION;break;case a.EVENT_TYPE_CLICK:t=a.SHORT_EVENT_TYPE_CLICK;break;case a.EVENT_TYPE_STANDARD:t=a.SHORT_EVENT_TYPE_STANDARD;break;case a.EVENT_TYPE_ERROR:t=a.SHORT_EVENT_TYPE_ERROR}return t},a.Util.mixin(a.EventCallback.prototype,{parse:function(e){if(e){this._usage=e.use,this._type=e.type,this._name=e.name,this._url=e.url,this._showBrowser=e.showBrowser,this._trackingUrls=[];var t=0;for(e=e.trackingUrls||[];t<e.length;t++)this._trackingUrls.push(e[t].value)}},copy:function(){var e=new this.constructor(this._context);return e._type=this._type,e._name=this._name,e._url=this._url,e._showBrowser=this._showBrowser,e._trackingUrls=this._trackingUrls.slice(),e._slot=this._slot,e._adInstance=this._adInstance,e},getUrl:function(e){var t=this._replaceMacrosInUrl(this._url,e);return this._name===a.EVENT_AD_MEASUREMENT?(t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_ET,a.SHORT_EVENT_TYPE_IMPRESSION),t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CONCRETE_EVENT_ID,e[a.INFO_KEY_CONCRETE_EVENT_ID])):t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_ET,a.EventCallback.getShortType(this._type)),t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CN,this._name),this._adInstance&&0<this._adInstance._creativeRenditionId&&(t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CREATIVE_RENDITION_ID,this._adInstance._creativeRenditionId)),t},getTrackingUrls:function(e){var t=this._trackingUrls;if(this._adInstance){var i=this._type;i===a.EVENT_TYPE_CLICK&&(i=a.EVENT_TYPE_CLICK_TRACKING),t=t.concat(this._adInstance.getExternalEventCallbackUrls(this._name,i))}i=[];for(var n=0;n<t.length;n++){var r=a.Util.trim(this._replaceMacrosInUrl(t[n],e));a.Util.isBlank(r)||i.push(r)}return i},process:function(e){e=e||{},this._processTrackingUrls(e),a.Util.pingURL(this.getUrl(e))},_processTrackingUrls:function(e){this._shouldSkipSendingTrackingAndExternalUrls()||a.Util.pingURLs(this.getTrackingUrls(e))},_shouldSkipSendingTrackingAndExternalUrls:function(){return!1},_needEmptyCT:function(e){var t=!1;return e&&!0===e[a.INFO_KEY_NEED_EMPTY_CT]&&(t=!0),t},_getAdPlayheadTime:function(){var e=-1;return this._adInstance&&(e=this._adInstance.getPlayheadTime()),e},_getCreativeAssetLocation:function(){var e=null;return this._adInstance&&this._adInstance.getActiveCreativeRendition()&&this._adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset()&&(e=this._adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getProxiedUrl()),e},_getParameter:function(e){return this._adInstance?this._adInstance._rendererController.getParameter(e):this._slot?this._slot.getParameter(e):this._context.getParameter(e)},_replaceVASTMacro:function(e,t,i){return a.log("replace VAST Macro: url=",e+", macro="+t+", value="+i),e&&t&&(i=encodeURIComponent(i||""),e=(e=e.replace("["+t+"]",i)).replace("%5B"+t+"%5D",
1i)),e},_replaceMacrosInUrl:function(e,t){if(a.Util.isBlank(e))return e;t&&t[a.INFO_KEY_VAST_ERROR_CODE]&&(e=this._replaceVASTMacro(e,"ERRORCODE",t[a.INFO_KEY_VAST_ERROR_CODE])),this._getCreativeAssetLocation()&&(e=this._replaceVASTMacro(e,"ASSETURI",this._getCreativeAssetLocation()));var i=this._context._getContentPlayheadTime();if(this._adInstance){if(t=null!=i&&0<=Number(i)?a.Util.secondsToHms(i):"",e=this._replaceVASTMacro(e,"CONTENTPLAYHEAD",t),e=this._replaceVASTMacro(e,"CACHEBUSTING",a.Util.getFixedDigitRandomNumber(8)),e=this._replaceVASTMacro(e,"TIMESTAMP",a.Util.getDateStringInISOFormat(new Date)),e=this._replaceVASTMacro(e,"OMIDPARTNER",a.OMSDK_PARTNER_NAME+"/"+this._context._adManager.getVersion()),t=[],this._context._overriddenAdRenderers&&null!=this._context._overriddenAdRenderers){var n=[];this._context._adResponse&&this._context._adResponse._adRenderers&&(n=this._context._overriddenAdRenderers.concat(this._context._adResponse._adRenderers));for(var r=0;r<n.length;r++){var s=n[r].creativeApi;s.includes("VPAID")?t.push(a.IAB_API_FRAMEWORKS_VPAID_2):s.includes("MRAID")&&t.push(a.IAB_API_FRAMEWORKS_MRAID_1)}}this._context.getParameter(a.PARAMETER_EXTENSION_OMSDK_ENABLED)&&t.push(a.IAB_API_FRAMEWORKS_OMID_1),t=t.sort().filter(function(e,t,i){return!t||e!=i[t-1]}),e=this._replaceVASTMacro(e,"APIFRAMEWORKS",t.toString())}e=e.replace(/#(ce?)\{([^\}]+)\}/g,a.Util.bind(this,function(e,t,n){switch(a.log("matchedSubString"+e),e="ce"===t,t=null,n){case"ad.playheadTime":t=0<=(n=this._getAdPlayheadTime())?Math.round(n)+"":"";break;case"content.playheadTime":t=0<=i?Math.round(i)+"":"";break;case"creative.assetLocation":t=this._getCreativeAssetLocation();break;default:0===n.indexOf("parameter.")&&(t=this._getParameter(n.substr(10)))}return a.Util.isBlank(t)&&(t=""),e?encodeURIComponent(t):t})),t="";try{t=a.Util.getParameterInURL(e,a.URL_PARAMETER_KEY_CR)}catch(t){return a.warn(t),e}return a.Util.isBlank(t)||(e=a.Util.setParameterInURL(e,a.URL_PARAMETER_KEY_CR,this._replaceMacrosInUrl(t))),e}}),a.AdClickEventCallback=function(e){a.EventCallback.call(this,e)},a.AdClickEventCallback.prototype=new a.EventCallback,a.AdClickEventCallback.prototype.constructor=a.AdClickEventCallback,a.Util.mixin(a.AdClickEventCallback.prototype,{getUrl:function(e){var t=a.EventCallback.prototype.getUrl.call(this,e);return e[a.INFO_KEY_URL]&&(a.Util.isParameterInURL(t,a.URL_PARAMETER_KEY_CR)||(t=t+"&"+a.URL_PARAMETER_KEY_CR+"="),t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CR,e[a.INFO_KEY_URL])),t},process:function(e){e=e||{};var t=this.getUrl(e),i=!0===this._showBrowser;i=e.hasOwnProperty(a.INFO_KEY_SHOW_BROWSER)?!0===e[a.INFO_KEY_SHOW_BROWSER]:i,e[a.INFO_KEY_URL]&&(i=!0),i&&!a.Util.isBlank(t)?(window.open(t),this._processTrackingUrls(e)):a.EventCallback.prototype.process.call(this,e)}}),a.AdImpressionEventCallback=function(e){a.EventCallback.call(this,e)},a.AdImpressionEventCallback.prototype=new a.EventCallback,a.AdImpressionEventCallback.prototype.constructor=a.AdImpressionEventCallback,a.Util.mixin(a.AdImpressionEventCallback.prototype,{_shouldSkipSendingTrackingAndExternalUrls:function(){return this._getInitValue()!==a.INIT_VALUE_ONE},_getInitValue:function(){return this._adInstance.getSlot().isPauseSlot(
1)||!this._processed?a.INIT_VALUE_ONE:a.INIT_VALUE_TWO},_getStartTimePosition:function(){return this._adInstance.getStartTimePosition()},_getAutoPlayBlocked:function(){return this._adInstance.getSlot().getAutoPlayBlocked()},getUrl:function(e){var t=a.EventCallback.prototype.getUrl.call(this,e);return t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_METR,this._adInstance._metr),this._name!==a.EVENT_AD_IMPRESSION?t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CT,this._needEmptyCT(e)?"":this._adInstance._timer.tick()):(-1<this._getStartTimePosition()&&(t=a.Util.setParameterInURL(t,a.URL_PARAMETER_START_TIME_POSITION,this._getStartTimePosition())),this._getAutoPlayBlocked()&&(t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_AUTO_PLAY_BLOCKED,a.URL_PARAMETER_KEY_AUTO_PLAY_BLOCKED_VALUE))),a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_INIT,this._getInitValue())},process:function(e){a.MODULE_TYPE_TRANSLATOR!==this._adInstance.getRendererController().getRenderer().info()[a.INFO_KEY_MODULE_TYPE]&&(a.EventCallback.prototype.process.call(this,e),this._processed=!0)}}),a.AdQuartileEventCallback=function(e){a.EventCallback.call(this,e)},a.AdQuartileEventCallback.prototype=new a.EventCallback,a.AdQuartileEventCallback.prototype.constructor=a.AdQuartileEventCallback,a.Util.mixin(a.AdQuartileEventCallback.prototype,{_getInitValue:function(){return this._adInstance.getSlot().isPauseSlot(
1)||!this._processed?a.INIT_VALUE_ONE:a.INIT_VALUE_TWO},getUrl:function(e){var t=a.EventCallback.prototype.getUrl.call(this,e);return t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_METR,this._adInstance._metr),t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CT,this._needEmptyCT(e)?"":this._adInstance._timer.tick()),null!=this._adInstance._context.getParameter(a.PARAMETER_ENABLE_COUNTING_REPLAY_CALLBACK)&&"true"==this._adInstance._context.getParameter(a.PARAMETER_ENABLE_COUNTING_REPLAY_CALLBACK)&&(t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_INIT,this._getInitValue())),t},process:function(e){var t=null!=this._adInstance._context.getParameter(a.PARAMETER_ENABLE_COUNTING_REPLAY_CALLBACK)&&"true"==this._adInstance._context.getParameter(a.PARAMETER_ENABLE_COUNTING_REPLAY_CALLBACK);this._processed&&!t||(a.EventCallback.prototype.process.call(this,e),this._processed=!0)}}),a.AdStandardEventCallback=function(e){a.EventCallback.call(this,e)},a.AdStandardEventCallback.prototype=new a.EventCallback,a.AdStandardEventCallback.prototype.constructor=a.AdStandardEventCallback,a.AdProgressEventCallback=function(e){a.EventCallback.call(this,e)},a.AdProgressEventCallback.prototype=new a.EventCallback,a.AdProgressEventCallback.prototype.constructor=a.AdProgressEventCallback,a.Util.mixin(a.AdProgressEventCallback.prototype,{getTrackingUrls:function(){for(var e=[],t=0;t<this._trackingUrls.length;t++)a.Util.isBlank(this._trackingUrls[t])||e.push(this._trackingUrls[t]);return e},process:function(e){this._shouldSkipSendingTrackingAndExternalUrls()||a.Util.pingURLs(this.getTrackingUrls())}}),a.ErrorEventCallback=function(e){a.EventCallback.call(this,e)},a.ErrorEventCallback.prototype=new a.EventCallback,a.ErrorEventCallback.prototype.constructor=a.ErrorEventCallback,a.Util.mixin(a.ErrorEventCallback.prototype,{getUrl:function(e){var t=a.EventCallback.prototype.getUrl.call(this,e),i=e[a.INFO_KEY_ERROR_CODE];i||(i=a.ERROR_UNKNOWN);var n=e[a.INFO_KEY_ERROR_INFO];return n||(n=""),(e=e[a.INFO_KEY_ERROR_MODULE])||(e=""),t=a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_CN,i),a.Util.setParameterInURL(t,a.URL_PARAMETER_KEY_KEY_VALUE,encodeURIComponent(a.URL_PARAMETER_KEY_ERROR_MODULE)+"="+encodeURIComponent(e)+"&"+encodeURIComponent(a.URL_PARAMETER_KEY_ERROR_INFO)+"="+a.PLATFORM_ID+"/"+encodeURIComponent(n))}}),a.ResellerNoAdEventCallback=function(e){a.EventCallback.call(this,e)},a.ResellerNoAdEventCallback.prototype=new a.EventCallback,a.ResellerNoAdEventCallback.prototype.constructor=a.ResellerNoAdEventCallback,a.Util.mixin(a.ResellerNoAdEventCallback.prototype,{}),a.SlotImpressionEventCallback=function(e){a.EventCallback.call(this,e)},a.SlotImpressionEventCallback.prototype=new a.EventCallback,a.SlotImpressionEventCallback.prototype.constructor=a.SlotImpressionEventCallback,a.Util.mixin(a.SlotImpressionEventCallback.prototype,{_shouldSkipSendingTrackingAndExternalUrls:function(){return this._getInitValue()!==a.INIT_VALUE_ONE}
1,_getInitValue:function(){return this._slot.isPauseSlot()||!this._processed?a.INIT_VALUE_ONE:a.INIT_VALUE_TWO},getUrl:function(e){return e=a.EventCallback.prototype.getUrl.call(this,e),a.Util.setParameterInURL(e,a.URL_PARAMETER_KEY_INIT,this._getInitValue())},process:function(e){a.EventCallback.prototype.process.call(this,e),this._processed=!0}}),a.VideoViewEventCallback=function(e){a.EventCallback.call(this,e)},a.VideoViewEventCallback.prototype=new a.EventCallback,a.VideoViewEventCallback.prototype.constructor=a.VideoViewEventCallback,a.Util.mixin(a.VideoViewEventCallback.prototype,{_getInitValue:function(){return this._processed?a.INIT_VALUE_ZERO:a.INIT_VALUE_ONE},_getCTValue:function(){return this._context._videoAsset?this._context._videoAsset.getPlayheadTime():0},getUrl:function(e){return e=a.EventCallback.prototype.getUrl.call(this,e),e=a.Util.setParameterInURL(e,a.URL_PARAMETER_KEY_INIT,this._getInitValue()),a.Util.setParameterInURL(e,a.URL_PARAMETER_KEY_CT,this._getCTValue())},_shouldSkipSendingTrackingAndExternalUrls:function(){return this._processed},process:function(e){a.EventCallback.prototype.process.call(this,e),this._processed=!0}}),a.VideoRenderer=function(){this._adVideo=null,this._duration=this._playheadTime=-1,this._dragging=this._stopInvoked=this._isEnded=!1,this._volume=1,this._rendererController=null,this._isBuffering=!1,this._autoPauseAdOnVisibilityChange=!0,this._hls=null,this._adVideoPauseState=""},a.VideoRenderer.prototype={pause:function(){this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),this._adVideo&&!this._adVideo.paused&&this._adVideo.pause(),this._adVideoPauseState=this._hls&&this._adVideoPauseState===a.AD_VIDEO_PAUSED_BY_TAB_SWITCH?a.AD_VIDEO_HLS_PAUSED_BY_RENDERER_AFTER_TAB_SWITCH:a.AD_VIDEO_PAUSED_BY_RENDERER},resume:function(){this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_RESUME}),this._adVideo&&this._adVideo.paused&&this._adVideo.play(),this._adVideoPauseState=a.AD_VIDEO_UNPAUSED},start:function(e){this._rendererController=e;var t=(e=this._rendererController.getAdInstance()).getSlot(),i=this,n=!1,r=!1;if(this._autoPauseAdOnVisibilityChange=this._rendererController.getParameter(a.PARAMETER_AUTO_PAUSE_AD_ONVISIBILITYCHANGE),a.PLATFORM_NOT_SUPPORT_VIDEO_AD)this._onRendererFailed(a.ERROR_DEVICE_LIMIT,t.getTimePositionClass());else if(a.PLATFORM_NOT_SUPPORT_MIDROLL_AD&&t.getTimePositionClass()===a.TIME_POSITION_CLASS_MIDROLL)this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"midroll");else{a.log("VideoRenderer.start",t.getTimePositionClass(),e);var s=this._rendererController.getContentVideoElement();a.debug("VideoRenderer","use content video element"),s.controls=!1,this._adVideo=s;var o=null,l=null,d=null,_=null,h=t.getVideoDisplaySize().width,c=t.getVideoDisplaySize().height,u=e.getRenderableCreativeRenditions(),E=(h=new a.RenditionSelector(this._rendererController.getParameter(a.PARAMETER_DESIRED_BITRATE)||1e3,this._rendererController.getParameter("arWeight")||1,this._rendererController.getParameter("pxWeight")||1,.2).getBestFitRendition(u,h,c))?h.getPrimaryCreativeRenditionAsset():null;if(E&&u.length)if(u=E.getProxiedUrl()){e.setActiveCreativeRendition(h),a.log("VideoRenderer.start selected rendition is:",u),e=E.getMimeType();var p=a.Util.isMimeTypeHls(e);this._rendererController.setCapability(a.EVENT_AD_QUARTILE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_MUTE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_PAUSE,a.CAPABILITY_STATUS_ON);var A=!a.PLATFORM_NOT_SUPPORT_CLICK_FOR_VIDEO;A||this._rendererController.setCapability(a.EVENT_AD_CLICK,a.CAPABILITY_STATUS_OFF);var T=a.PLATFORM_EVENT_CLICK,R=a.MOBILE_EVENT_DRAG;this._volume=this._rendererController.getContext().getAdVolume(),this._adVideo.volume=this._volume,this._adVideo.muted=0===this._volume;var g=function(e){a.debug("VideoRenderer.checkTimeUpdate timeout"),b(e)},m=function(){l&&(clearTimeout(l),l=null)},I=a.Util.bind(this,function(e){a.debug("onAdVideoBufferEmpty(): Ad video event "+e.type),null!=(e=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_PLAY_AFTER_STALLED))&&!1!==a.Util.str2bool(e)&&(a.debug("play the ad immediately after the stalled event"),s&&s._fw_videoAdPlaying&&s.play())}),S=function(e){i._isBuffering||(i._isBuffering=!0,i._rendererController.processEvent({name:a.EVENT_AD_BUFFERING_START}),a.debug("onAdVideoBufferingStarted(): Ad video event "+e.type))},f=function(e){i._isBuffering&&(i._isBuffering=!1,i._rendererController.processEvent({name:a.EVENT_AD_BUFFERING_END}),a.debug("onAdVideoBufferingEnded(): Ad video event "+e.type))};e=this._rendererController.getParameter(a.PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENT);var v=null;e&&(v=document.getElementById(e)),v||(v=s);var C,P=a.Util.bind(this,function(e){if(s.paused&&a.PLATFORM_NOT_FIRE_CLICK_WHEN_AD_VIDEO_PAUSED)s.play();else{var t=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_CLICK_DETECTION);null==t&&(t="true"),!1!==a.Util.str2bool(t)&&(r?(a.debug("Ad video event "+e.type),this._dragging?this._dragging=!1:this._rendererController.processEvent({name:a.EVENT_AD_CLICK})):a.debug("Ad not started, ignore click."))}}),O=a.Util.bind(this,function(e){a.debug("Ad video event "+e.type),this._dragging=!0}),N=function(e){if(a.debug("Ad video event "+e.type+" ended: "+s.ended+" playing:"+s._fw_videoAdPlaying),s.ended&&.2>Math.abs(s.duration-s.currentTime)||!s._fw_videoAdPlaying)C=setTimeout(function(){a.warn("Force ad video end bc ad paused with ended = true"),e.type="ended",M(e)},200);else{var t=i._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSE);null==t&&(t="true"),!1===a.Util.str2bool(t)?a.debug("Pause controls disabled"):s.controls=!0,m()}},D=function(e){a.debug("Ad video event "+e.type),s.controls=!1},y=0,L=function(e){a.debug("Ad video event "+e.type),0>=s.currentTime?a.debug("VideoRenderer.onAdVideoTimeUpdate currentTime is less than or 0"):(m(),s.paused||(e=i._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT)||8e3,l=setTimeout(g,e,e+"ms timeout when playing")),r||(r=!0,i._playheadTime=s.currentTime,0>i._playheadTime&&(i._playheadTime=0),o&&(clearTimeout(o),o=null),i._quartileTimerId=setInterval(function(){var e=s.currentTime,t=s.duration;0<e&&(i._playheadTime=e),0<t&&(i._duration=t),"number"!=typeof e||"number"!=typeof t||d||(i._rendererController&&(i._rendererController.checkProgress(e),i._rendererController.checkForSkippableStateChange()),e>=.25*t&&1>y&&(i._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE}),y=1),e>=.5*t&&2>y&&(i._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT}),y=2),e>=.75*t&&3>y&&(clearInterval(i._quartileTimerId),i._quartileTimerId=null,i._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE}),y=3))},1e3),i._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED)))};this.dispose=a.Util.bind(this,function(){M()});var M=function(e){var t=d;e&&e.type&&(a.debug("Ad video event "+e.type),"error"===e.type&&(a.warn(e.target.src),a.warn(e.target.currentSrc),f(e))),m(),o&&(clearTimeout(o),o=null),A&&(v.removeEventListener(T,P,!1),v.removeEventListener(R,O,!1)),C&&(clearTimeout(C),C=null),V&&i._autoPauseAdOnVisibilityChange&&(document.removeEventListener("visibilitychange",V,!1),V=null),s.removeEventListener("ended",M,!1),s.removeEventListener("error",M,!0),s.removeEventListener("pause",N,!1),s.removeEventListener("playing",D,!1),s.removeEventListener("timeupdate",L,!1),s.removeEventListener("stalled",I,!1),s.removeEventListener("waiting",S,!1),s.removeEventListener("canplay",f,!1),s.paused||(a.debug("try pausing video before complete"),s.pause()),e&&"error"===e.type&&(t="video error",(e=s.error||e.target.error)&&(t="error:"+e+",code:"+e.code)),t||(i._isEnded=!0),a.log("VideoRenderer.complete"),n?i._rendererController.checkProgress(s.duration):(n=!0,delete s._fw_videoAdPlaying,i._adVideo=null,i._quartileTimerId&&(clearInterval(i._quartileTimerId),i._quartileTimerId=null),t?i._onRendererFailed(_,t):(i._stopInvoked||(s.currentTime>=.25*s.duration&&1>y&&(i._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE}),y=1),s.currentTime>=.5*s.duration&&2>y&&(i._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT}),y=2),s.currentTime>=.75*s.duration&&3>y&&(i._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE}),y=3),s.currentTime>=s.duration-.5&&4>y&&(i._rendererController.checkProgress(s.duration),i._rendererController.processEvent({name:a.EVENT_AD_COMPLETE}),y=4)),i._stopInvoked=!1,i._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED))),i._rendererController=null,i._hls&&i._hls.destroy()},b=function(e){d=e,_=a.ERROR_TIMEOUT,a.warn(d),a.PLATFORM_WAIT_WHEN_AD_VIDEO_TIMEOUT||M()},V=function(e){a.log("onVisibilityChange:"+(document.hidden?"invisible":"visible")),document.hidden?i._adVideoPauseState!==a.AD_VIDEO_PAUSED_BY_RENDERER&&(s&&!s.paused&&s.pause(),i._adVideoPauseState=a.AD_VIDEO_PAUSED_BY_TAB_SWITCH,i._rendererController&&i._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),o&&(clearTimeout(o),o=null)):i._adVideoPauseState===a.AD_VIDEO_PAUSED_BY_TAB_SWITCH?(i.resume(),r||!s._fw_fromVideoPool&&!a.PLATFORM_SUPPORT_VIDEO_START_DETECT_TIMEOUT||(e=i._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT)||5e3,o=setTimeout(b,e,e+"ms timeout before playing"))):i._adVideoPauseState===a.AD_VIDEO_HLS_PAUSED_BY_RENDERER_AFTER_TAB_SWITCH&&i._rendererController&&i._rendererController.processEvent({name:a.EVENT_AD_RESUME})};s._fw_videoAdPlaying=!0;var w=!1,U=function(){if(!w){if(w=!0,A&&(v.addEventListener(T,P,!1),v.addEventListener(R,O,!1)),s.addEventListener("ended",M,!1),s.addEventListener("error",M,!0),s.addEventListener("pause",N,!1),s.addEventListener("playing",D,!1),s.addEventListener("timeupdate",L,!1),s.addEventListener("stalled",I,!1),s.addEventListener("waiting",S,!1),s.addEventListener("canplay",f,!1),p)if("undefined"!=typeof Hls){if(Hls.isSupported()){var e=Hls.version;e=e.replace("-beta",""),0<=a.Util.compareVersion(e,a.PLATFORM_HLSJS_MIN_VERSION)?(a.log("VideoRenderer loading hls rendition using hls.js ver
1sion",e),i._hls=new window.Hls,i._hls.on(Hls.Events.ERROR,function(e,t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.NETWORK_ERROR:a.debug("VideoRenderer has encountered fatal hls network error and attempting to recover"),i._hls.startLoad();break;case Hls.ErrorTypes.MEDIA_ERROR:a.debug("VideoRenderer has encountered fatal hls media error and attempting to recover"),i._hls.recoverMediaError();break;default:i._hls.destroy(),a.debug("VideoRenderer has encountered unrecoverable fatal hls error. Details: "+t.details),i._onRendererFailed(a.ERROR_HLSJS,t.details)}else a.debug("VideoRenderer has encountered non-fatal hls network error. Automatic recovery attempt by hls.js.")}),i._hls.attachMedia(s),i._hls.on(Hls.Events.MEDIA_ATTACHED,function(){i._hls.loadSource(E.getProxiedUrl()),i._hls.on(Hls.Events.MANIFEST_PARSED,function(e,t){a.debug("VideoRenderer hls manifest successfully parsed, found "+t.levels.length+" quality level")})})):0>a.Util.compareVersion(e,a.PLATFORM_HLSJS_MIN_VERSION)?a.warn("Found hls.js version is too old and incompatible. Please upgrade to v0.11.0 or higher. Current version:",e):a.warn("Unable to find successful hls support.")}}else s.src=E.getProxiedUrl(),a.debug("VideoRenderer loading hls rendition on Safari "+s.src),s.load();else s.src=E.getProxiedUrl(),a.debug("VideoRenderer loading video ad "+s.src),s.load();(s._fw_fromVideoPool||a.PLATFORM_SUPPORT_VIDEO_START_DETECT_TIMEOUT)&&(e=i._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT)||5e3,o=setTimeout(b,e,e+"ms timeout before playing")),a.PLATFORM_VIDEO_DOESNOT_SUPPORT_TIMEUPDATE&&i._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED),e=100,0<a.PLATFORM_ANDROID_VERSION&&(e=i._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_ANDROID_DELAY)||100),setTimeout(function(){var e=s.play();e&&a.PLATFORM_BLOCKS_AUTOPLAY&&e.catch(function(e){(e&&"AbortError"===e.name||"NotAllowedError"===e.name)&&(a.warn("Blocked by browser, need player to display a start button. Details: %o",e),o&&(clearTimeout(o),o=null),t.setAutoPlayBlocked(!0),i._rendererController.processEvent({name:a.EVENT_AD_AUTO_PLAY_BLOCKED,info:{apiOnly:!0}}))}),document.hidden&&s&&i._autoPauseAdOnVisibilityChange&&(a.log("VideoRenderer pause ad when tab is invisible."),s&&!s.paused&&(s.pause(),i._adVideoPauseState=a.AD_VIDEO_PAUSED_BY_TAB_SWITCH,i._rendererController&&i._rendererController.processEvent({name:a.EVENT_AD_PAUSE})),o&&(clearTimeout(o),o=null))},e),i._autoPauseAdOnVisibilityChange&&document.addEventListener("visibilitychange",V,!1)}};a.VideoRenderer._fw_playedDummyVideo||t.getTimePositionClass()!==a.TIME_POSITION_CLASS_PREROLL||!a.PLATFORM_PLAY_DUMMY_VIDEO_FOR_PREROLL||/\.webm$/.test(E.getProxiedUrl())?U():(a.VideoRenderer._fw_playedDummyVideo=!0,a.debug("play dummy video for iOS 3.2-4.1"),s.src="http://127.0.0.1:1/404.mp4",s.load(),s.play(),s._fw_videoAdPlaying=!0,s.addEventListener("error",function(){event.target.removeEventListener("error",s,!0),U()},!0),setTimeout(U,a.PLATFORM_NOT_WAIT_FOR_ERROR_WHEN_PLAY_DUMMY_VIDEO_FOR_PREROLL?500:5e3))}else this._onRendererFailed(a.ERROR_NULL_ASSET);else this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"no compatible asset")}},stop:function(){a.debug("VideoRenderer stop"),this._stopInvoked=!0,this._adVideo&&(this._adVideo._fw_videoAdPlaying=!1,this._adVideo.pause(),this.dispose()),this._rendererController=null},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){if(this._isEnded&&0<this._duration)return this._duration;if(this._adVideo){var e=this._adVideo.currentTime;if(0<e)return e}return this._playheadTime},getDuration:function(){return this._duration},setVolume:function(e){a.debug("VideoRenderer setVolume("+e+")"),this._adVideo?(this._adVideo.volume=e,this._adVideo.muted=0===e,this._volume!==e&&this._rendererController.processEvent({name:a.EVENT_AD_VOLUME_CHANGE}),0===this._volume&&0!==e?this._rendererController.processEvent({name:a.EVENT_AD_UNMUTE}):0!==this._volume&&0===e&&this._rendererController.processEvent({name:a.EVENT_AD_MUTE}),this._volume=e):a.debug("VideoRenderer ad video is null, ignore.")},_onRendererFailed:function(e,t,i){var n={};n[a.INFO_KEY_ERROR_MODULE]="VideoRenderer",n[a.INFO_KEY_ERROR_CODE]=e,i||
1(i=a.ERROR_VAST_GENERAL_LINEAR_ERROR),n[a.INFO_KEY_VAST_ERROR_CODE]=i,t&&(n[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.RENDERER_STATE_FAILED,n)}},a.VideoRenderer.prototype.constructor=a.VideoRenderer,a.AdRequest=function(e){this._context=e,this._capabilities=new a.Capabilities,this._keyValues=[],this._playerProfile="",this._compatibleDimensions=null,this._temporalSlots=[],this._siteSectionId=this._siteSectionCustomId="",this._siteSectionNetworkId=0,this._siteSectionFallbackId="",this._siteSectionViewRandom=0,this._requestMode=this._visitorIpV4Address=this._visitorCustomId="",this._subsessionToken=this._requestDuration=0,this._candidateAdIds=[],this._slotScanner=new a.PageSlotScanner(e),this._urlParams={},this._urlKeyValues=[],this._customInfo=""},a.AdRequest.prototype={setCapability:function(e,t){this._capabilities.setCapability(e,t)},addKeyValue:function(e,t){"string"!=typeof e||"string"!=typeof t||0===e.length?a.warn("AdRequest.addKeyValue:","key and value required"):(e=encodeURIComponent(e)+"="+encodeURIComponent(t),0>this._keyValues.indexOf(e)&&this._keyValues.push(e))},removeKey:function(e){if("string"!=typeof e||0===e.length)a.warn("AdRequest.removeKey:","key required");else{e=encodeURIComponent(e);for(var t=this._keyValues,i=t.length-1;0<=i;--i)t[i].split("=")[0]===e&&this._keyValues.splice(i,1)}},setProfile:function(e){"string"!=typeof e?a.warn("AdRequest.setProfile:","player profile required"):this._playerProfile=e},setVideoDisplayCompatibleSizes:function(e){if(e&&e.length){for(var t=[],i={},n=0;n<e.length;++n)if(a.debug("dimension is:",e[n].width,"X",e[n].height),0<e[n].width&&0<e[n].height){var r=e[n].width+","+e[n].height;null==i[r]&&(i[r]="",t.push(r))}0<t.length&&(this._compatibleDimensions=t.join("|"))}else a.warn("AdRequest.setVideoDisplayCompatibleSizes:","compatible dimensions required")},setSiteSection:function(e,t,i,n,r){if(e){switch(n){case a.ID_TYPE_FW:this._siteSectionId=e;break;case a.ID_TYPE_GROUP:this._siteSectionId="g"+e;break;default:this._siteSectionCustomId=e}0<1*t&&(this._siteSectionNetworkId=1*t),0<1*i&&(this._siteSectionViewRandom=1*i),"number"==typeof r&&0<r?this._siteSectionFallbackId=""+r:"string"==typeof r&&(this._siteSectionFallbackId=r.trim())}else a.warn("AdRequest.setSiteSection: id required")},setVisitor:function(e,t){"string"!=typeof e?a.warn("AdRequest.setVisitor:","customId required"):(this._visitorCustomId=e,"string"==typeof t&&""!==t&&(this._visitorIpV4Address=t))},setRequestMode:function(e){e!==a.REQUEST_MODE_ON_DEMAND&&e!==a.REQUEST_MODE_LIVE?a.warn("AdRequest.setRequestMode:","unknown mode: "+e):(this._requestMode=e,this._requestMode===a.REQUEST_MODE_LIVE&&0===this._subsessionToken&&this.setSubsessionToken(1e4*Math.random()+1))},setRequestDuration:function(e){"number"!=typeof e?a.warn("AdRequest.setRequestDuration:","request duration required"):(0>e&&(a.warn("AdRequest.setRequestDuration:","requestDuration is negative, reset it to 0"),e=0),this._requestDuration=e)},addCandidateAd:function(e){"number"!=typeof e?a.warn("AdRequest.addCandidateAd:","candidate ad ID required"):0>e?a.warn("AdRequest.addCandidateAd","invalid ad ID, ignore"):this._candidateAdIds.push(e)},addTemporalSlot:function(e,t,i,n,r,s,o,l,d,_){if(a.Util.isBlank(e)||a.Util.isBlank(t)||0>i)a.warn("AdRequest.addTemporalSlot:","invalid parameters");else{for(var h=0;h<this._temporalSlots.length;h++)if(this._temporalSlots[h].getCustomId()===e)return void a.warn("AdRequest.addTemporalSlot:","slot with custom Id: "+e+" is already added, ignoring the duplicate addition");(h=new a.Slot(this._context)).setCustomId(e),h.setAdUnit(t),h.setTimePosition(i),h.setSlotProfile(n),h.setCuepointSequence(1*r),h.setMaxDuration(s),h.setMinDuration(o),h.setAcceptContentType(l),h.setSignalId(d),h.setMaxAds(_),this._temporalSlots.push(h)}},setSubsessionToken:function(e){this._subsessionToken=e},scanPageSlots:function(){this._slotScanner.scanPageSlots()},generateTypeBRequestUrl:function(){var e=this._context._adManager._serverURL.split("?"),t=e[0],i=[/fwmrm\.net$/,/fwmrm\.net\/$/,/fwmrm\.net\/ad$/,/fwmrm\.net\/ad\/$/,/fwmrm\.net\/ad\/g$/,/fwmrm\.net\/ad\/g\/$/,/fwmrm\.net\/ad\/g\/1$/];if(0===t.indexOf("http://")||0===t.indexOf("https://"))for(var n=0;n<i.length;++n)if(t.match(i[n])){t=t.slice(0,t.indexOf("fwmrm.net")+9)+"/ad/g/1";break}return this.parseQueryStr(e.slice(1).join("?")),e=this.generateGlobalParametersQueryStr()+";"+this.generateKeyValuesStr()+";",this._capabilities.getCapability(a.CAPABILITY_SKIP_AD_SELECTION)&&1===this._capabilities.getCapability(a.CAPABILITY_SKIP_AD_SELECTION)||(e+=this.generateSlotsTypeBStr()),a.Util.isBlank(this._customInfo)||(e+=";"+this._customInfo),t+"?"+e},generateVideoViewRequestUrlWithDummyContextInstanceId:function(e){this._context.setCapability(a.CAPABILITY_REQUIRE_VIDEO_CALLBACK,a.CAPABILITY_STATUS_ON),this._context.setCapability(a.CAPABILITY_SKIP_AD_SELECTION,a.CAPABILITY_STATUS_ON);var t=this.generateTypeBRequestUrl();return t=a.Util.setParameterInURL(t,"cbfn","tv.freewheel.SDK._instanceQueue['Context_"+e+"']._videoAsset.requestComplete"),a.debug("generateVideoViewRequestUrlWithDummyContextInstanceId():"+t),this._context.setCapability(a.CAPABILITY_REQUIRE_VIDEO_CALLBACK,a.CAPABILITY_STATUS_UNSET),this._context.setCapability(a.CAPABILITY_SKIP_AD_SELECTION,a.CAPABILITY_STATUS_UNSET),t},parseQueryStr:function(e){var t=e;if(a.debug("AdRequest.parseQueryStr("+Array.prototype.slice.call(arguments).join(",")+")"),this._urlParam
1s={},this._urlKeyValues=[],this._customInfo="",t){var i;if(";"===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),(t=t.split(";"))[0]){var n=t[0].split("&");for(i=0;i<n.length;++i){var r=n[i].split("=");2===r.length&&(this._urlParams[r[0]]=r[1])}}if(t[1])for(n=t[1].split("&"),i=0;i<n.length;++i)this._urlKeyValues.push(n[i]);t[2]&&(this._customInfo=t.slice(2).join(";"))}},generateGlobalParametersQueryStr:function(){a.debug("AdRequest.generateGlobalParametersQueryStr");var e=this._context.getParameter("wrapperVersion");e=[["prof",this._playerProfile,"string"],["nw",this._context._adManager._networkId,"number"],["caid",this._context._videoAsset._customId,"string"],["asid",this._context._videoAsset._id,"string"],["vdur",this._context._videoAsset._duration,"number"],["asnw",this._context._videoAsset._networkId,"number"],["asml",this._context._videoAsset._location,"string"],["vprn",this._context._videoAsset._viewRandom,"number"],["afid",this._context._videoAsset._fallbackId,"string"],["vdty",this._context._videoAsset._durationType,"string"],["vtpo",this._context._videoAsset._currentTpos,"number"],["csid",this._siteSectionCustomId,"string"],["ssid",this._siteSectionId,"string"],["ssnw",this._siteSectionNetworkId,"number"],["pvrn",this._siteSectionViewRandom,"number"],["sfid",this._siteSectionFallbackId,"string"],["vcid",this._visitorCustomId,"string"],["mode",this._requestMode,"string"],["vrdu",this._requestDuration,"number"],["ssto",this._subsessionToken,"number"],["cd",this._compatibleDimensions||this.detectScreenDimension(),"string"],["vclr",a.version+(e?","+e:""),"string"],["resp",a.PLATFORM_SEND_REQUEST_BY_FORM?"json2":"json","string"],["orig",window.location.protocol+"//"+window.location.host,"string"],["cbfn","tv.freewheel.SDK._instanceQueue['Context_"+this._context._instanceId+"'].requestComplete","string"],["vip",this._visitorIpV4Address,"string"],["cana",this._candidateAdIds.join(","),"string"]];for(var t=0;t<e.length;t++){var i=e[t];switch(i[2]){case"string":a.Util.isBlank(i[1])||(this._urlParams[i[0]]=encodeURIComponent(i[1]));break;case"number":0<i[1]&&(this._urlParams[i[0]]=i[1])}}for(var n in e="",this._urlParams)this._urlParams.hasOwnProperty(n)&&(e+=n+"="+this._urlParams[n]+"&");switch(e=e.substring(0,e.length-1),0<this._slotScanner._candidateAds.length&&(null==this._capabilities._capabilities[a.CAPABILITY_CHECK_COMPANION]&&this._capabilities.setCapability(a.CAPABILITY_CHECK_COMPANION,a.CAPABILITY_STATUS_ON),null==this._capabilities._capabilities[a.CAPABILITY_CHECK_TARGETING]&&this._capabilities.setCapability(a.CAPABILITY_CHECK_TARGETING,a.CAPABILITY_STATUS_OFF)),this._context._videoAsset._eventCallback||this._context._videoAsset._requestedVideoViewUrl||!this._context._videoAsset._id&&!this._context._videoAsset._customId||this._context.setCapability(a.CAPABILITY_REQUIRE_VIDEO_CALLBACK,a.CAPABILITY_STATUS_ON),this._capabilities._capabilities[a.CAPABILITY_DISPLAY_REFRESH]&&this._context.setCapability(a.CAPABILITY_REQUIRE_VIDEO_CALLBACK,a.CAPABILITY_STATUS_OFF),e=this._capabilities.parseCapabilities(e),this._context.setCapability(a.CAPABILITY_REQUIRE_VIDEO_CALLBACK,a.CAPABILITY_STATUS_UNSET),this._context._videoAsset._autoPlayType){case a.VIDEO_ASSET_AUTO_PLAY_TYPE_CLICK_TO_PLAY:n="+cltp";break;case a.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED:n="+play+uapl";break;case a.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE:n="-play";break;default:n="+play-uapl"}return e.replace(/flag=/,"flag="+encodeURIComponent(n))},generateKeyValuesStr:function(){a.debug("AdRequest.generateKeyValuesStr");var e=a.Util.flashVersion();e=this._keyValues.concat(["_fw_h_x_flash_version="+encodeURIComponent(e),"_fw_dpr="+(void 0===window.devicePixelRatio?"1":window.devicePixelRatio.toFixed(2).toString())]);for(var t=0;t<this._urlKeyValues.length;t++){var i=this._urlKeyValues[t];0>e.indexOf(i)&&e.push(i)}return(t=this._context._adManager._location)&&e.push("ltlg="+encodeURIComponent(Math.round(1e4*t.coords.latitude)/1e4+","+Math.round(1e4*t.coords.longitude)/1e4)),e.join("&")},generateSlotsTypeBStr:function(){a.debug("AdRequest.generateSlotsTypeBStr");for(var e="",t=[],i=0;i<this._temporalSlots.length;i++){var n=this._temporalSlots[i];n=[["slid",n.getCustomId(),"string"],["slau",n.getAdUnit(),"string"],["ptgt","a","string"],["tpos",n.getTimePosition(),"number"],["cpsq",n.getCuepointSequence(),"number"],["envp",
1n.getSlotProfile(),"string"],["maxd",n.getMaxDuration(),"number"],["mind",n.getMinDuration(),"number"],["prct",n.getAcceptContentType(),"string"],["sgid",n.getSignalId(),"string"],["maxa",n.getMaxAds(),"number"]];for(var r=[],s=0;s<n.length;s++){var o=n[s];switch(o[2]){case"string":a.Util.isBlank(o[1])||r.push(o[0]+"="+encodeURIComponent(o[1]));break;case"number":-1<["cpsq","maxd","mind","maxa"].indexOf(o[0])?0<o[1]&&r.push(o[0]+"="+o[1]):0<=o[1]&&r.push(o[0]+"="+o[1])}}t.push(r.join("&"))}return 0<t.length&&(e=t.join(";")+";"),e+this._slotScanner.slotsToTypeBStr()},detectScreenDimension:function(){return a.debug("AdRequest.detectScreenDimension:",screen.width+","+screen.height),screen.width+","+screen.height},useTCFAPI:function(){if(a.debug("AdRequest.useTCFAPI"),this._context.getParameter(a.PARAMETER_USE_GDPR_TCFAPI)){var e=this._context._adManager._fwGDPR||"",t=this._context._adManager._fwGDPRConsent||"";this.removeKey("_fw_gdpr"),this.removeKey("_fw_gdpr_consent"),this.addKeyValue("_fw_gdpr",e.toString()),this.addKeyValue("_fw_gdpr_consent",t)}},useUSPAPI:function(){if(a.debug("AdRequest.useUSPAPI"),this._context.getParameter(a.PARAMETER_USE_CCPA_USPAPI)){var e=this._context._adManager._fwUSPString||"";""!=e&&(this.removeKey("_fw_us_privacy"),this.addKeyValue("_fw_us_privacy",e))}}},a.AdInstance=function(e){this._context=e,this._creativeRenditionId=this._creativeId=this._soAdUnit=this._adId=this._slot=null,this._universalAdIdRegistry=this._universalAdId=this._action=this._marketUnifiedAdId=this._openExchangeId=this._dealId=this._replicaId="",this._primaryCreativeRendition=this._creative=null,this._creativeRenditions=[],this._noLoad=!1,this._companionAdInstances=[],this._eventCallbacks=[],this._externalEventCallbackUrlsDictionary={},this._rendererController=new a.RendererController(e,this),this._timer=new a.Timer,this._metr=0,this._state=a.MediaInitState.instance,this._isStartSuccessfully=this._translated=this._isImpressionSent=this._isInitiatedSent=!1,this._lastDurationFromRenderer=-1,this._slotCustomId=this._parentAdInstancesGroup=null,this._isSkipped=!1,this._wrapperCount=0,this._startTimePosition=-1,this._adVerifications=[],this._skipOffset=-1,this._progressEventCallbackUrlsDict={}},a.AdInstance.prototype={},a.AdInstance.prototype.constructor=a.AdInstance,a.METR_MASK_QUARTILE=0,a.METR_MASK_MIDPOINT=1,a.METR_MASK_COMPLETE=2,a.METR_MASK_VOLUME=3,a.METR_MASK_SIZE=4,a.METR_MASK_CONTROL=5,a.METR_MASK_REWIND=6,a.METR_MASK_ACCEPT_INVITATION=7,a.METR_MASK_CLOSE=8,a.METR_MASK_MINIMIZE=9,a.METR_MASK_CLICK=10,a.AdInstance._metrDictionary={},a.AdInstance._metrDictionary[a.EVENT_AD_FIRST_QUARTILE]=a.AdInstance._metrDictionary[a.EVENT_AD_THIRD_QUARTILE]=a.AdInstance._metrDictionary[a.EVENT_AD_QUARTILE]=1<<a.METR_MASK_QUARTILE|1<<a.METR_MASK_MIDPOINT|1<<a.METR_MASK_COMPLETE,a.AdInstance._metrDictionary[a.EVENT_AD_MIDPOINT]=1<<a.METR_MASK_MIDPOINT|1<<a.METR_MASK_COMPLETE,a.AdInstance._metrDictionary[a.EVENT_AD_COMPLETE]=1<<a.METR_MASK_COMPLETE,a.AdInstance._metrDictionary[a.EVENT_AD_MUTE]=1<<a.METR_MASK_VOLUME,a.AdInstance._metrDictionary[a.EVENT_AD_UNMUTE]=1<<a.METR_MASK_VOLUME,a.AdInstance._metrDictionary[a.EVENT_AD_COLLAPSE]=1<<a.METR_MASK_SIZE,a.AdInstance._metrDictionary[a.EVENT_AD_EXPAND]=1<<a.METR_MASK_SIZE,a.AdInstance._metrDictionary[a.EVENT_AD_PAUSE]=1<<a.METR_MASK_CONTROL,a.AdInstance._metrDictionary[a.EVENT_AD_RESUME]=1<<a.METR_MASK_CONTROL,a.AdInstance._metrDictionary[a.EVENT_AD_REWIND]=1<<a.METR_MASK_REWIND,a.AdInstance._metrDictionary[a.EVENT_AD_ACCEPT_INVITATION]=1<<a.METR_MASK_ACCEPT_INVITATION,a.AdInstance._metrDictionary[a.EVENT_AD_CLOSE]=1<<a.METR_MASK_CLOSE,a.AdInstance._metrDictionary[a.EVENT_AD_MINIMIZE]=1<<a.METR_MASK_MINIMIZE,a.AdInstance._metrDictionary[a.EVENT_AD_CLICK]=1<<a.METR_MASK_CLICK,a.Util.mixin(a.AdInstance.prototype,{getAdId:function(){return this._adId},getUniversalAdId:function(){if(""!=this._universalAdId)return{idRegistry:this._universalAdIdRegistry,idValue:this._universalAdId};var e=this.getActiveCreativeRendition();return e?e.getUniversalAdId():null},getSoAdUnit:function(){return this._soAdUnit},getParameter:function(e){var t=[];return this._context.getParameter(e)&&t.push(this._context.getParameter(e)),this._primaryCreativeRendition.getParameter(e)&&t.push(this._primaryCreativeRendition.getParameter(e)),this._creative.getParameter(e)&&t.push(this._creative.getParameter(e)),this._slot.getParameter(e)&&t.push(this._slot.getParameter(e)),t},addProgressEventCallbackUrls:function(e,t){this._progressEventCallbackUrlsDict.hasOwnProperty(e)?(t=this._progressEventCallbackUrlsDict[e].concat(t),this._progressEventCallbackUrlsDict[e]=t):this._progressEventCallbackUrlsDict[e]=t||[]},getAdSkippableState:function(){return"VPAID"===this.getActiveCreativeRendition().getCreativeApi()?this._rendererController.getRenderer().getAdSkippableState():-1!==this.getSkipOffset()&&this.getPlayheadTime()>=this.getSkipOffset()},getEventCallbackUrls:function(e,t){var i=[],n=t===a.EVENT_TYPE_CLICK,r=t===a.EVENT_TYPE_CLICK_TRACKING;return(e=a.EventCallback.getEventCallback(this._eventCallbacks,e,r?a.EVENT_TYPE_CLICK:t))?((t={})[a.INFO_KEY_NEED_EMPTY_CT]=!0,n?e._showBrowser&&i.push(e.getUrl(t)):r&&e._showBrowser||i.push(e.getUrl(t)),n||(i=i.concat(e.getTrackingUrls())),i):i},addEventCallbackUrls:function(e,t,i){i&&this._isValidEventNameAndType(e,t)&&(this._externalEventCallbackUrlsDictionary[t+"-"+e]=this.getExternalEventCallbackUrls(e,t).concat(i))},setClickThroughUrl:function(e,t){t&&this._isValidEventNameAndType(e,a.EVENT_TYPE_CLICK)&&(e=this.getEventCallback(e,a.EVENT_TYPE_CLICK))&&(a.Util.isParameterInURL(e._url,a.URL_PARAMETER_KEY_CR)||(e._url=e._url+"&"+a.URL_PARAMETER_KEY_CR+"="),e._url=a.Util.setParameterInURL(e._url,a.URL_PARAMETER_KEY_CR,t),e._showBrowser=!0)},addAdVerifications:function(e){for(var t=0;t<e.length;t++)this._adVerifications.push(e[t])},addCreativeRendition:function(){var e=new a.CreativeRendition;return e.parse({creativeRenditionId:this._creativeRenditionId,adReplicaId:this._replicaId,preference:0}),e.setBaseUnit(this._creative.getBaseUnit()),e.setDuration(this._creative.getDuration()),this._creativeRenditions.push(e),this.isPlaceholder()&&(this._noLoad=!1),e},getRendererController:function(){return this._rendererController},getSlot:function(){return this._slot||(this._slot=this._context._adResponse.getSlotByCustomId(this._slotCustomId)),this._slot},getCompanionSlots:function(){for(var e=[],t=0;t<this._companionAdInstances.length;t++)e.push(this._companionAdInstances[t]._slot);return e},getActiveCreativeRendition:function(){return this._primaryCreativeRendition},setActiveCreativeRendition:function(e){e?(-1===this._creativeRenditions.indexOf(e)&&this._creativeRenditions.push(e),this._primaryCreativeRendition=e,this._creativeRenditionId=e.getId()):a.warn("AdInstance.setActiveCreativeRendition","rendition is null")},getAllCreativeRenditions:function(){var e=this._creativeRenditions.slice();e.sort(function(e,t){return t.getPreference()-e.getPreference()});var t=e.indexOf(this._primaryCreativeRendition);return-1<t&&(e.splice(t,1),e.unshift(this._primaryCreativeRendition)),e},getRenderableCreativeRenditions:function(){var e=this._creativeRenditions.slice().sort(function(e,t){return t.getPreference()-e.getPreference()}).filter(function(e){return this._rendererController.rendererMatch(e)},this),t=e.indexOf(this._primaryCreativeRendition);return-1<t&&(e.splice(t,1),e.unshift(this._primaryCreativeRendition)),e},getPlayheadTime:function(){var e=-1;if(this._rendererController.getRenderer()&&"function"==typeof this._rendererController.getRenderer().getPlayheadTime)try{e=this._rendererController.getRenderer().getPlayheadTime()}catch(e){a.warn("AdInstance.getPlayheadTime",e.description)}return e},getDuration:function(){var e=-1;return this._rendererController.getRenderer()&&"function"==typeof this._rendererController.getRenderer().getDuration&&(this._lastDurationFromRenderer=e=this._rendererController.getRenderer().getDuration()),-1===e&&(e=-1<this._lastDurationFromRenderer?this._lastDurationFromRenderer:this.getActiveCreativeRendition().getDuration()),e},parse:function(e){if(e){var t,i;this._adId=e.adId||null,this._creativeId=e.creativeId||null,this._creativeRenditionId=e.creativeRenditionId||null,this._replicaId=e.hasOwnProperty("replicaId")?e.replicaId:"",this._dealId=e.hasOwnProperty("dealId")?e.dealId:"",this._openExchangeId=e.hasOwnProperty("openExchangeId")?e.openExchangeId:"",this._marketUnifiedAdId=e.hasOwnProperty("marketUnifiedAdId")?e.marketUnifiedAdId:"",this._action=e.hasOwnProperty("action")?e.action:"",this._universalAdId=e.hasOwnProperty("universalAdId")?e.universalAdId:"",this._universalAdIdRegistry=e.hasOwnProperty("universalAdIdRegistry")?e.universalAdIdRegistry:"",this._noLoad=this._context._adResponse.getAd(this._adId).getNoLoad(),this._soAdUnit=this._context._adResponse.getAd(this._adId).getSoAdUnit(),this._creative=this._context._adResponse.getCreative(this._adId,this._creativeId),this._creativeRenditions=this._creative.getEligibleCreativeRenditionsForAdInstance(this);var n=0;for(t=e.eventCallbacks||[];n<t.length;n++){var r=t[n];(i=a.EventCallback.newEventCallback(this._context,r.name,r.type))&&(i._adInstance=this,i.parse(r),this._eventCallbacks.push(i))}for(n=0,t=e.companionAds||[];n<t.length;++n)(r=t[n])&&r.adSlotCustomId&&((i=new a.AdInstance(this._context))._slotCustomId=r.adSlotCustomId,i.parse(r),this._companionAdInstances.push(i));for(n=0,t=e.fallbackAds||[];n<t.length;++n)r=t[n],i=new a.AdInstance(this._context),this._parentAdInstancesGroup.push(i),i._slot=this._slot,i._parentAdInstancesGroup=this._parentAdInstancesGroup,i.parse(r);0<this._creativeRenditions.length&&(this._primaryCreativeRendition=this._creativeRenditions[0])}},play:function(){if(a.log("AdInstance.play "+this._slotCustomId),this._timer.tick(),this.processEvent(a.EVENT_AD_IMPRESSION,a.EVENT_TYPE_IMPRESSION),this._isStartSuccessfully||(a.MODULE_TYPE_RENDERER===this._rendererController.getRenderer().info()[a.INFO_KEY_MODULE_TYPE]&&this._context.dispatchEvent(a.EVENT_AD_IMPRESSION,{adInstance:this,slotCustomId:this._slotCustomId}),this._isStartSuccessfully=!0),this._state.play(this),this._rendererController.getRenderer().info()[a.INFO_KEY_MODULE_TYPE]===a.MODULE_TYPE_RENDERER)for(var e=0;e<this._companionAdInstances.length;e++)this._companionAdInstances[e].isPlaceholder()||this._companionAdInstances[e].getSlot().playCompanionAds(this._companionAdInstances[e])},pause:function(){a.log("AdInstance.pause "+this._slotCustomId),this._isStartSuccessfully?this._rendererController&&this._rendererController.pause():a.log("Ad hasn't started yet. Ignore.")},resume:function(){a.log("AdInstance.resume"+this._slotCustomId),this._isStartSuccessfully?this._rendererController&&this._rendererController.resume():a.log("Ad hasn't started yet. Ignore.")},skip:function(){a.log("AdInstance.skip"),"VPAID"!==this.getActiveCreativeRendition().getCreativeApi()?(this._processSkipEvent(),this.stop()):this._rendererController.getRenderer().attemptSkip()},_processSkipEvent:function(){this._isSkipped=!0,this.processEvent(a.EVENT_AD_SKIPPED,a.EVENT_TYPE_STANDARD)},stop:function(){a.log("AdInstance.stop"),this._rendererController.stop()},fakeComplete:function(){this._slot.getTimePositionClass()===a.TIME_POSITION_CLASS_DISPLAY&&(this._isStartSuccessfully=!1,this._slot.playNextAdInstance())},complete:function(){this._isStartSuccessfully&&(this.processEvent(a.EVENT_AD_IMPRESSION_END,a.EVENT_TYPE_IMPRESSION),a.MODULE_TYPE_RENDERER===this._rendererController.getRenderer().info()[a.INFO_KEY_MODULE_TYPE]&&this._context.dispatchEvent(a.EVENT_AD_IMPRESSION_END,{adInstance:this})),this._state.complete(this),this._rendererController._restorePlaceholdersForHybrid(),this._rendererController.setRenderer(null),this._isStartSuccessfully=!1,this._slot.playNextAdInstance()},isStarted:function(){return this._isStartSuccessfully},onStartPlaying:function(){a.MODULE_TYPE_RENDERER===this._rendererController.getRenderer().info()[a.INFO_KEY_MODULE_TYPE]?this._isImpressionSent=!0:this._translated=!0},onCompletePlaying:function(){},onStartReplaying:function(){},onCompleteReplaying:function(){},getEventCallback:function(e,t){return a.EventCallback.getEventCallback(this._eventCallbacks,e,t)},processEvent:function(e,t,i,n){var r=!0;return t=this.getEventCallback(e,t),e===a.EVENT_AD_IMPRESSION&&this._isStartSuccessfully&&(t=this.getEventCallback(a.EVENT_ERROR,a.EVENT_TYPE_ERROR),i={errorInfo:"Trying to send defaultImpression multiple times"},r=!1),t?n||t.process(i):r=!1,e===a.EVENT_AD_CLICK&&this._context.dispatchEvent(a.EVENT_AD_CLICK,{adInstance:this}),(e!==a.EVENT_AD_IMPRESSION&&e!==a.EVENT_AD_IMPRESSION_END||a.MODULE_TYPE_RENDERER===this._rendererController.getRenderer().info()[a.INFO_KEY_MODULE_TYPE])&&(n={subType:e,adInstance:this,slot:this._slot},e===a.EVENT_AD_SKIPPABLE_STATE_CHANGED&&(n[a.INFO_KEY_AD_SKIPPABLE_STATE]=this.getAdSkippableState()),e===a.EVENT_ERROR&&(n[a.INFO_KEY_ERROR_CODE]=i[a.INFO_KEY_ERROR_CODE],n[a.INFO_KEY_ERROR_INFO]=i[a.INFO_KEY_ERROR_INFO],n[a.INFO_KEY_ERROR_MODULE]=i[a.INFO_KEY_ERROR_MODULE]),e===a.EVENT_AD_MEASUREMENT&&(n[a.INFO_KEY_CONCRETE_EVENT_ID]=i[a.INFO_KEY_CONCRETE_EVENT_ID]),this._context.dispatchEvent(a.EVENT_AD,n)),r},processProgressEvent:function(e){var t=a.EventCallback.newEventCallback(this._rendererController.getContext(),a.EVENT_AD_PROGRESS);t._trackingUrls=this._progressEventCallbackUrlsDict[e],this._context.dispatchEvent(a.EVENT_AD,{subType:a.EVENT_AD_PROGRESS,adInstance:this,slot:this._slot,offset:e}),t.process()},setVolume:function(e){a.debug("AdInstance.setVolume("+e+")"),this.isStarted()&&"function"==typeof this._rendererController.getRenderer().setVolume&&this._rendererController.getRenderer().setVolume(e)},setMetr:function(e,t){var i=a.AdInstance._metrDictionary[e],n=t;i&&(e===a.EVENT_AD_CLICK&&(n=!t),this._metr=n===a.CAPABILITY_STATUS_ON||!0===n?this._metr|i:this._metr&~i)},getExternalEventCallbackUrls:function(e,t){return(this._externalEventCallbackUrlsDictionary[t+"-"+e]||[]).slice()},reset:function(){this._rendererController.reset();for(var e=0;e<this._companionAdInstances.length;e++){var t=this._companionAdInstances[e];t._state!==a.MediaPlayingState.instance&&t._state!==a.MediaReplayingState.instance||t.stop(),t._rendererController.reset()}},cloneForTranslation:function(){var e=new a.AdInstance(this._context);e._adId=this._adId,e._creativeId=this._creativeId,e._creative=this._creative.cloneForTranslation(),e._creativeRenditionId=this._creativeRenditionId,e._isInitiatedSent=this._isInitiatedSent,e._noLoad=this._noLoad,e._slot=this.getSlot(),e._soAdUnit=this.getSoAdUnit(),e._replicaId=this._replicaId,e._dealId=this._dealId,e._openExchangeId=this._openExchangeId,e._marketUnifiedAdId=this._marketUnifiedAdId,e._action=this._action,e._universalAdId=this._universalAdId,e._universalAdIdRegistry=this._universalAdIdRegistry,e._wrapperCount=this._wrapperCount,e._adVerifications=this._adVerifications,e._skipOffset=this._skipOffset;for(var t=0;t<this._eventCallbacks.length;t++){var i=this._eventCallbacks[t].copy();i._adInstance=e,e._eventCallbacks.push(i)}for(e._externalEventCallbackUrlsDictionary=a.Util.copy(this._externalEventCallbackUrlsDictionary),e._progressEventCallbackUrlsDict=a.Util.copy(this._progressEventCallbackUrlsDict),t=0;t<this._companionAdInstances.length;t++)this._companionAdInstances[t].isPlaceholder()?e._companionAdInstances.push(this._companionAdInstances[t].cloneForTranslation()):e._companionAdInstances.push(this._companionAdInstances[t]);return e},isPlaceholder:function(){return this._noLoad},setMediaState:function(e){this._state=e},_isValidEventNameAndType:function(e,t){return!a.Util.isBlank(e)&&!a.Util.isBlank(t)&&(t===a.EVENT_TYPE_CLICK||t===a.EVENT_TYPE_CLICK_TRACKING||t===a.EVENT_TYPE_IMPRESSION&&(e===a.EVENT_AD_IMPRESSION||e===a.EVENT_AD_FIRST_QUARTILE||e===a.EVENT_AD_MIDPOINT||e===a.EVENT_AD_THIRD_QUARTILE||e===a.EVENT_AD_COMPLETE)||t===a.EVENT_TYPE_STANDARD&&(e===a.EVENT_AD_PAUSE||e===a.EVENT_AD_RESUME||e===a.EVENT_AD_REWIND||e===a.EVENT_AD_MUTE||e===a.EVENT_AD_UNMUTE||e===a.EVENT_AD_COLLAPSE||e===a.EVENT_AD_EXPAND||e===a.EVENT_AD_MINIMIZE||e===a.EVENT_AD_CLOSE||e===a.EVENT_AD_ACCEPT_INVITATION||e===a.EVENT_AD_SKIPPED||e===a.EVENT_AD_PROGRESS)||t===a.EVENT_TYPE_ERROR&&e===a.EVENT_ERROR)},isPlayable:function(){var e=!(this._rendererController.getRend
1ererState()===a.RendererFailedState.instance&&!this._isImpressionSent);return e?((e=e&&!this._translated)||a.debug("AdInstance.isPlayable returning false translated:",this._translated),e):(a.debug("AdInstance.isPlayable returning false isImpressionSent:",this._isImpressionSent),e)},toString:function(){return"[AdInstance "+this._adId+"]"},getCompanionAdInstances:function(){for(var e=[],t=0;t<this._companionAdInstances.length;++t)this._companionAdInstances[t].isPlaceholder()||e.push(this._companionAdInstances[t]);return e},isRequiredToShow:function(){return this._context._adResponse.getAd(this._adId).isRequiredToShow()},incrementWrapperCount:function(){this._wrapperCount++},getWrapperCount:function(){return this._wrapperCount},getDealId:function(){return this._dealId},getOpenExchangeId:function(){return this._openExchangeId},getMarketUnifiedAdId:function(){return this._marketUnifiedAdId},getAction:function(){return this._action},setStartTimePosition:function(e){!isNaN(e)&&-1<e&&e<this.getDuration()?this._startTimePosition=Math.round(e):a.warn("AdInstance.setStartTimePosition","invalid start time position")},getStartTimePosition:function(){return this._startTimePosition},getSkipOffset:function(){return this._skipOffset},_setSkipOffset:function(e){this.getDuration(),this._skipOffset=a.Util.offsetStringToSecond(e,this.getDuration())}}),a.EventDispatcher=function(){this._listeners={}},a.EventDispatcher.prototype={addEventListener:function(e,t){void 0===this._listeners[e]&&(this._listeners[e]=[]),this._listeners[e].push(t)},dispatchEvent:function(e){if("string"==typeof e&&(e={type:e}),e.target||(e.target=this),e.type&&this._listeners[e.type]instanceof Array)for(var t=this._listeners[e.type],i=0,n=t.length;i<n;i++)try{t[i]&&t[i].call(this,e)}catch(t){a.warn("EventDispatcher.dispatchEvent",e.type,t)}},removeEventListener:function(e,t){if(this._listeners[e]instanceof Array){var i=this._listeners[e];if(null==t)this._listeners[e]=[];else{e=0;for(var n=i.length;e<n;e++)if(i[e]===t){i.splice(e,1);break}}}}},a.EventDispatcher.prototype.constructor=a.EventDispatcher,a.DashRenderer=function(){this._fwDashPlayer=null,this._duration=this._playheadTime=-1,this._dragging=this._stopInvoked=this._isEnded=!1,this._volume=1,this._rendererController=null,this._isBuffering=!1,this._autoPauseAdOnVisibilityChange=!0,this._dashjs=window.tv.freewheel.Dashjs,this._adVideoPauseState=""},a.DashRenderer.prototype={pause:function(){this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),this._fwDashPlayer&&!this._fwDashPlayer.isPaused()&&this._fwDashPlayer.pause(),this._adVideoPauseState=a.AD_VIDEO_PAUSED_BY_RENDERER},resume:function(){this._rendererController&&this._rendererController.processEvent({name:a.EVENT_AD_RESUME}),this._fwDashPlayer&&this._fwDashPlayer.isPaused()&&this._fwDashPlayer.play(),this._adVideoPauseState=a.AD_VIDEO_UNPAUSED},start:function(e){this._rendererController=e;var t=this._rendererController.getAdInstance(),i=t.getSlot(),n=this,r=!1,s=!1;if(this._autoPauseAdOnVisibilityChange=this._rendererController.getParameter(a.PARAMETER_AUTO_PAUSE_AD_ONVISIBILITYCHANGE),a.PLATFORM_NOT_SUPPORT_VIDEO_AD)this._onRendererFailed(a.ERROR_DEVICE_LIMIT,i.getTimePositionClass());else if(a.PLATFORM_NOT_SUPPORT_MIDROLL_AD&&i.getTimePositionClass()===a.TIME_POSITION_CLASS_MIDROLL)this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"midroll");else if(a.PLATFORM_NOT_SUPPORT_DASH)this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"MPEG-DASH playback not supported on this platform");else{a.log("DashRenderer.start",i.getTimePositionClass(),t);var o=this._rendererController.getContentVideoElement(),l=i.getVideoDisplaySize().width,d=i.getVideoDisplaySize().height,_=t.getRenderableCreativeRenditions();if(e=(e=this._rendererController.getParameter(a.PARAMETER_DESIRED_BITRATE))&&0<Number(e)?Number(e):null,(l=(d=new a.RenditionSelector(e||1e3,this._rendererController.getParameter("arWeight")||1,this._rendererController.getParameter("pxWeight")||1,.2).getBestDashRendition(_,l,d))?d.getPrimaryCreativeRenditionAsset():null)&&_.length)if(l.getProxiedUrl()){t.setActiveCreativeRendition(d),a.log("DashRenderer.start selected rendition is:",l.getUrl()),this._rendererController.setCapability(a.EVENT_AD_QUARTILE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_MUTE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_PAUSE,a.CAPABILITY_STATUS_ON);var h=!a.PLATFORM_NOT_SUPPORT_CLICK_FOR_VIDEO;h||this._rendererController.setCapability(a.EVENT_AD_CLICK,a.CAPABILITY_STATUS_OFF);var c=a.PLATFORM_EVENT_CLICK,u=a.MOBILE_EVENT_DRAG;a.debug("DashRenderer","use content video element"),o.controls=!1;var E=this._dashjs.MediaPlayer().create();if(E.initialize(),t=E.getVersion(),a.debug("dash.js -v "+E.getVersion()+" loaded"),0!==a.Util.compareVersion(t,a.PLATFORM_DASHJS_SUPPORTED_VERSION))this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"Unsupported tv.freewheel.Dash.js ver
1sion");else{E.setAutoPlay(!1),E.attachView(o),e&&E.updateSettings({streaming:{abr:{initialBitrate:{video:e}}}}),E.attachSource(l.getUrl()),E.preload(),this._fwDashPlayer=E;var p=null,A=null,T=null;this._volume=this._rendererController.getContext().getAdVolume(),E.setVolume(this._volume),E.setMute(0===this._volume);var R=function(e){a.debug("DashRenderer.checkTimeUpdate timeout"),M(e)},g=function(){A&&(clearTimeout(A),A=null)},m=a.Util.bind(this,function(e){a.debug("onAdVideoPlaybackStalled(): Ad video event "+e.type),null!=(e=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_PLAY_AFTER_STALLED))&&!1!==a.Util.str2bool(e)&&(a.debug("play the ad immediately after the stalled event"),E&&E._fw_videoAdPlaying&&E.play())}),I=function(e){n._isBuffering||(n._isBuffering=!0,n._rendererController.processEvent({name:a.EVENT_AD_BUFFERING_START}),a.debug("onAdVideoBufferingStarted(): Ad video event "+e.type))},S=function(e){n._isBuffering&&(n._isBuffering=!1,n._rendererController.processEvent({name:a.EVENT_AD_BUFFERING_END}),a.debug("onAdVideoBufferingEnded(): Ad video event "+e.type))};e=this._rendererController.getParameter(a.PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENT);var f=null;e&&(f=document.getElementById(e)),f||(f=o);var v,C=a.Util.bind(this,function(e){if(E.isPaused()&&a.PLATFORM_NOT_FIRE_CLICK_WHEN_AD_VIDEO_PAUSED)E.play();else{var t=this._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_CLICK_DETECTION);null==t&&(t="true"),!1!==a.Util.str2bool(t)&&(s?(a.debug("Ad video event "+e.type),this._dragging?this._dragging=!1:this._rendererController.processEvent({name:a.EVENT_AD_CLICK})):a.debug("Ad not started, ignore click."))}}),P=a.Util.bind(this,function(e){a.debug("Ad video event "+e.type),this._dragging=!0}),O=function(e){a.debug("Ad video event "+e.type+" ended: "+o.ended+" playing: "+E._fw_videoAdPlaying),null==(e=n._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSE))&&(e="true"),!1===a.Util.str2bool(e)?a.debug("Pause controls disabled"):o.controls=!0,g()},N=function(e){a.debug("Ad video event "+e.type),o.controls=!1,n._videoPausedByRenderer=!1},D=0,y=function(e){a.debug("Ad video event "+e.type),0>=E.time()?a.debug("DashRenderer.onAdVideoTimeUpdate currentTime is less than or 0"):(g(),E.isPaused()||(e=n._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT)||8e3,A=setTimeout(R,e,e+"ms timeout when playing")),s||(s=!0,n._playheadTime=E.time(),0>n._playheadTime&&(n._playheadTime=0),p&&(clearTimeout(p),p=null),n._quartileTimerId=setInterval(function(){var e=E.time(),t=E.duration();0<e&&(n._playheadTime=e),0<t&&(n._duration=t),"number"!=typeof e||"number"!=typeof t||T||(n._rendererController&&(n._rendererController.checkProgress(e),n._rendererController.checkForSkippableStateChange()),e>=.25*t&&1>D&&(n._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE}),D=1),e>=.5*t&&2>D&&(n._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT}),D=2),e>=.75*t&&3>D&&(clearInterval(n._quartileTimerId),n._quartileTimerId=null,n._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE}),D=3))},1e3),n._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED)))};this.dispose=a.Util.bind(this,function(){L()});var L=function(e){n.playAdAfterStartDelay&&(clearTimeout(n.playAdAfterStartDelay),n.playAdAfterStartDelay=null);var t=T;e&&e.type&&(a.debug("DashRenderer onAdVideoEnded. Ad video event: "+e.type),"error"===e.type&&e.target&&(a.warn(e.target.src),a.warn(e.target.currentSrc),S(e))),g(),p&&(clearTimeout(p),p=null),h&&(f.removeEventListener(c,C,!1),f.removeEventListener(u,P,!1)),v&&(clearTimeout(v),v=null),b&&n._autoPauseAdOnVisibilityChange&&(document.removeEventListener("visibilitychange",b,!1),b=null);var i=n._dashjs.MediaPlayer.events;if(E.off(i.PLAYBACK_ENDED,L,n),E.off(i.PLAYBACK_ERROR,L,n),E.off(i.ERROR,L,n),E.off(i.PLAYBACK_PAUSED,O,n),E.off(i.PLAYBACK_PLAYING,N,n),E.off(i.PLAYBACK_TIME_UPDATED,y,n),E.off(i.PLAYBACK_STALLED,m,n),E.off(i.BUFFER_EMPTY,I,n),E.off(i.BUFFER_LOADED,S,n),E.off(i.PLAYBACK_NOT_ALLOWED,V,n),E.isPaused()||(a.debug("try pausing video before complete"),E.pause()),e&&"error"===e.type&&e.target?(t="video error",(e=o.error||e.target.error)&&(t="error:"+e+",code:"+e.code)):e&&"error"===e.type&&e.error?t="dashjs error, dashjs-error-message: "+e.error.message+", dashjs-error-code: "+e.error.code:e&&"playbackError"===e.type&&e.error&&(t="dashjs playbackError"),t||(n._isEnded=!0),a.log("DashRenderer.complete"),r)n._rendererController.checkProgress(E.duration());else{r=!0,delete E._fw_videoAdPlaying,e=E.time(),i=E.duration(),n._fwDashPlayer=null;try{E.reset()}catch(e){a.warn("Error resetting fw dashjs player: ",e)}E=null,n._quartileTimerId&&(clearInterval(n._quartileTimerId),n._quartileTimerId=null),t?(e=null,t.includes("timeout")?e=a.ERROR_TIMEOUT:t.includes("dashjs")&&(e=a.ERROR_DASHJS),n._onRendererFailed(e,t)):(n._stopInvoked||(e>=.25*i&&1>D&&(n._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE}),D=1),e>=.5*i&&2>D&&(n._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT}),D=2),e>=.75*i&&3>D&&(n._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE}),D=3),e>=i-.5&&4>D&&(n._rendererController.checkProgress(i),n._rendererController.processEvent({name:a.EVENT_AD_COMPLETE}),D=4)),n._stopInvoked=!1,n._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED))}n._rendererController=null},M=function(e){T=e,a.warn(T),a.PLATFORM_WAIT_WHEN_AD_VIDEO_TIMEOUT||L()},b=function(e){a.log("onVisibilityChange:"+(document.hidden?"invisible":"visible")),document.hidden?n._adVideoPauseState!==a.AD_VIDEO_PAUSED_BY_RENDERER&&(E&&!E.isPaused()&&E.pause(),n._adVideoPauseState=a.AD_VIDEO_PAUSED_BY_TAB_SWITCH,n._rendererController&&n._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),p&&(clearTimeout(p),p=null)):n._adVideoPauseState===a.AD_VIDEO_PAUSED_BY_TAB_SWITCH&&(n.resume(),s||!E._fw_fromVideoPool&&!a.PLATFORM_SUPPORT_VIDEO_START_DETECT_TIMEOUT||(e=n._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT)||5e3,p=setTimeout(
1M,e,e+"ms timeout before playing")))},V=function(){a.warn("Blocked by browser, need player to display a start button"),n._fwDashPlayer.off(n._dashjs.MediaPlayer.events.PLAYBACK_NOT_ALLOWED,V,n),p&&(clearTimeout(p),p=null),i.setAutoPlayBlocked(!0),n._rendererController.processEvent({name:a.EVENT_AD_AUTO_PLAY_BLOCKED,info:{apiOnly:!0}})};E._fw_videoAdPlaying=!0;var w=!1;!function(){if(!w){w=!0,h&&(f.addEventListener(c,C,!1),f.addEventListener(u,P,!1));var e=n._dashjs.MediaPlayer.events;E.on(e.PLAYBACK_ENDED,L,n),E.on(e.PLAYBACK_ERROR,L,n),E.on(e.ERROR,L,n),E.on(e.PLAYBACK_PAUSED,O,n),E.on(e.PLAYBACK_PLAYING,N,n),E.on(e.PLAYBACK_TIME_UPDATED,y,n),E.on(e.PLAYBACK_STALLED,m,n),E.on(e.BUFFER_EMPTY,I,n),E.on(e.BUFFER_LOADED,S,n),E.on(e.PLAYBACK_NOT_ALLOWED,V,n),a.log("DashRenderer, play video ad "+E.getSource()),(E._fw_fromVideoPool||a.PLATFORM_SUPPORT_VIDEO_START_DETECT_TIMEOUT)&&(e=n._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT)||5e3,p=setTimeout(M,e,e+"ms timeout before playing")),a.PLATFORM_VIDEO_DOESNOT_SUPPORT_TIMEUPDATE&&n._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED),e=100,0<a.PLATFORM_ANDROID_VERSION&&(e=n._rendererController.getParameter(a.PARAMETER_RENDERER_VIDEO_ANDROID_DELAY)||100),n.playAdAfterStartDelay=setTimeout(function(){n.playAdAfterStartDelay=null,document.hidden&&n._autoPauseAdOnVisibilityChange?(a.log("DashRenderer pause ad when tab is invisible."),n._adVideoPauseState=a.AD_VIDEO_PAUSED_BY_TAB_SWITCH,E&&E.pause(),n._rendererController&&n._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),p&&(clearTimeout(p),p=null)):E.play()},e),n._autoPauseAdOnVisibilityChange&&document.addEventListener("visibilitychange",b,!1)}}()}}else this._onRendererFailed(a.ERROR_NULL_ASSET);else this._onRendererFailed(a.ERROR_DEVICE_LIMIT,"no compatible asset")}},stop:function(){a.debug("DashRenderer stop"),this._stopInvoked=!0,this._fwDashPlayer&&(this._fwDashPlayer._fw_videoAdPlaying=!1,this._fwDashPlayer.pause(),this.dispose()),this._rendererController=null},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){if(this._isEnded&&0<this._duration)return this._duration;if(this._fwDashPlayer){var e=this._fwDashPlayer.time();if(0<e)return e}return this._playheadTime},getDuration:function(){return this._duration},setVolume:function(e){a.debug("DashRenderer setVolume("+e+")"),this._fwDashPlayer?(this._fwDashPlayer.setVolume(e),this._fwDashPlayer.setMute(0===e),this._volume!==e&&this._rendererController.processEvent({name:a.EVENT_AD_VOLUME_CHANGE}),0===this._volume&&0!==e?this._rendererController.processEvent({name:a.EVENT_AD_UNMUTE}):0!==this._volume&&0===e&&this._rendererController.processEvent({name:a.EVENT_AD_MUTE}),this._volume=e):a.debug("DashRenderer ad video is null, ignore.")},_onRendererFailed:function(e,t,i){var n={};n[a.INFO_KEY_ERROR_MODULE]="DashRenderer",n[a.INFO_KEY_ERROR_CODE]=e,i||(i=a.ERROR_VAST_GENERAL_LINEAR_ERROR),n[a.INFO_KEY_VAST_ERROR_CODE]=i,t&&(n[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.RENDERER_STATE_FAILED,n)}},a.DashRenderer.prototype.constructor=a.DashRenderer,a.HTMLAdGenerator={log:function(e){a.log("HTMLAdGenerator\t"+e)},getExtension:function(e){return e&&(e=e.match(/^[^?]+\/[^?.]*(\.\w+)+/))?e[e.length-1].slice(1):""},generateAd:function(e,t,i,n,r,s,o){a.HTMLAdGenerator.log("generatorAd("+[].slice.call(arguments,0).join(",")+")");var l=s,d=!1;switch(null==l&&(d=!0,l=a.HTMLAdGenerator.getExtension(e).toLowerCase()),l){case"jpeg":case"jpg":case"gif":case"png":case"image/jpeg":case"image/jpg":case"image/gif":case"image/png":case"image/bmp":l=a.HTMLAdGenerator.generateImageHTML(e,t);break;case"swf":case"application/x-shockwave-flash":l=a.HTMLAdGenerator.generateFlashHTML(e,t,i,n,r);break;case"script":case"js":case"text/javascript":case"text/js_ref":case"application/x-javascript":l=a.HTMLAdGenerator.generateScriptHTML(e,i,n,r);break;case"iframe":case"html":case"htm":case"text/html":case"text/html_doc_ref":case"text/html_lit_nowrapper":case"text/html_doc_lit_mobile":l=a.HTMLAdGenerator.generateIFrameHTML(e,t,i,n,r);break;default:l=d?a.HTMLAdGenerator.generateIFrameHTML(e,t,i,n,r):a.HTMLAdGenerator.generateAd(e,t,i,n,r,null,o)}return"text/html_doc_lit_mobile"===o?a.HTMLAdGenerator.htmlLitToHTMLDocLitMobile(l):l},generateImageHTML:function(e,t){return a.HTMLAdGenerator.log("generateImageHTML"),t?'<a rel="noopener noreferrer" href="'+t+'" target="_blank"><img src="'+e+'" border="0" /></a>':'<img src="'+e+'" border="0" />'},generateFlashHTML:function(e,t,i,n,r){a.HTMLAdGenerator.log("generateFlashHTML");var s=e;return t&&0<t.length&&(s+=-1===e.indexOf("?")?"?":"&",s+="clickTag="+encodeURIComponent(t)),e='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"c
1odebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"WIDTH="'+n+'" HEIGHT="'+r+'" id="'+i+'_external_ad"><PARAM NAME=movie VALUE="'+s+'"/><PARAM NAME=quality VALUE=high/><PARAM NAME=bgcolor VALUE=#FFFFFF/><PARAM NAME="allowScriptAccess" VALUE="always"/><PARAM NAME="loop" VALUE="true"/>',(e+='<EMBED src="'+s+'" ')+'quality=high bgcolor=#FFFFFF WIDTH="'+n+'" HEIGHT="'+r+'"NAME="'+i+'_external_video" ALIGN="" TYPE="application/x-shockwave-flash"PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>'},generateIFrameHTML:function(e,t,i,n,r){return a.HTMLAdGenerator.log("generateIFrameHTML"),'<iframe height="'+r+'" width="'+n+'" frameborder="0" scrolling="no" allowtransparency="true" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0" src="'+e+'"></iframe>'},docLitToHTMLLit:function(e,t,i,n){return a.HTMLAdGenerator.log("docLitToHTMLLit"),'<iframe id="_fw_frame_'+t+'" width="'+i+'" height="'+n+'" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe><script language="javascript" type="text/javascript" id="_fw_container_js_'+t+"\">if(!fw_targets) {var fw_targets = [];}var _fw_wr;var fw_scope = document;var fw_content = '"+a.Util.encodeToHex(e)+"';var trgtFrm = fw_scope.getElementById(\"_fw_frame_"+t+'");trgtFrm = (trgtFrm.contentWindow) ? trgtFrm.contentWindow : (trgtFrm.contentDocument.document) ? trgtFrm.contentDocument.document : trgtFrm.contentDocument;fw_targets["'+t+'"] = trgtFrm;if(navigator.userAgent.match(/\\bMSIE\\b/) || navigator.userAgent.match(/\\bOpera\\b/)){trgtFrm.document.open();trgtFrm.document.write(fw_content);setTimeout(function(){fw_close(fw_targets["'+t+'"])}, 7500);} else if (navigator.userAgent.match(/\\bFirefox\\b/)) {if(true && fw_content.length < 2000){var ec = escape(fw_content);var fw_iframe_url = "http://m2.feiwei.tv/g/lib/template/echo.html?s="+ec;fw_scope.getElementById("_fw_frame_'+t+'").src = fw_iframe_url;} else {trgtFrm.document.open();trgtFrm.document.write(fw_content);trgtFrm.document.close();}} else {trgtFrm.document.open();trgtFrm.document.write(fw_content);trgtFrm.document.close();}function fw_close(theFrame){theFrame.document.close();}<\/script>'},htmlLitToDocLit:function(e){return a.HTMLAdGenerator.log("htmlLitToDocLit"),'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Advertisement</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'+e+"</body></html>"},wrapUnsafeHTML:function(e,t,i,n){return a.HTMLAdGenerator.htmlLitToHTMLDocLitMobile(a.HTMLAdGenerator.docLitToHTMLLit(a.HTMLAdGenerator.htmlLitToDocLit(e),t,i,n))},wrapJSCode:function(e,t,i,n){return a.HTMLAdGenerator.wrapUnsafeHTML('<script language="javascript" type="text/javascript">'+e+"<\/script>",t,i,n)},generateScriptHTML:function(e,t,i,n){return a.HTMLAdGenerator.log("generateScriptHTML"),a.HTMLAdGenerator.wrapUnsafeHTML('<script language="javascript" type="text/javascript" src="'+e+'"><\/script>',t,i,n)},htmlLitToHTMLDocLitMobile:function(e){return a.HTMLAdGenerator.log("htmlLitToHTMLDocLitMobile"),'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta name = "viewport" content = "initial-scale = 1.0, target-densitydpi = device-dpi" /><title>Advertisement</title><script type="text/javascript">window._fw_page_url = "";<\/script></head><body style="margin:0px;background-color:transparent;">'+e+"</body></html>"}},a.AdVerification=function(e){if(this.vendorKey="",this.javaScriptResources=this._parseJavaScriptResources(e),this.executableResources=this._parseExecutableResources(e),this.verificationParameters="",this.trackingEvents={},e["@attributes"]&&e["@attributes"].vendor&&(this.vendorKey=e["@attributes"].vendor),e.VerificationParameters&&e.VerificationParameters.value&&(this.verificationParameters=e.VerificationParameters.value),e.TrackingEvents&&e.TrackingEvents.Tracking)if((e=e.TrackingEvents.Tracking).length)for(var t=0;t<e.length;t++)this._pushTrackingEvents(e[t]);else this._pushTrackingEvents(e)},a.AdVerification.prototype={dispatchAdVerificationNotExecutedWithReason:function(e){for(var t=this.trackingEvents[a.AD_VERIFICATION_EVENT_NOT_EXECUTED],i=0;i<t.length;i++){var n=t[i].replace("[REASON]",e);a.Util.pingURL(n)}},_pushTrackingEvents:function(e){var t=e["@attributes"].event;this.trackingEvents[t]?this.trackingEvents[t].push(e.value):this.trackingEvents[t]=[e.value]},_parseJavaScriptResources:function(e){return this._parseResources(e.JavaScriptResource,this._parseJavaScriptResourceNode.bind(this))},_parseExecutableResources:function(e){return this._parseResources(e.ExecutableResource,this._parseExecutableResourceNode.bind(this))},_parseResources:function(e,t){var i=[];if(e)if(e.length)for(var n=0;n<e.length;n++){var a=t(e[n]);i.push(a)}else a=t(e),i.push(a);return i},_parseJavaScriptResourceNode:function(e){return{url:this._parseUrl(e),apiFramework:this._parseApiFramework(e),browserOptional:this._parseBrowserOptional(e)}},_parseExecutableResourceNode:function(e){return{url:this._parseUrl(e),apiFramework:this._parseApiFramework(e),type:this._parseType(e)}},_parseUrl:function(e){try{return new URL(e.value),e.value}catch(t){return a.debug('AdVerification._parseUrl Error parsing "'+e.value+'". Error message:',t.message),""}},_parseApiFramework:function(e){return this._parseFromAttributes(e,"apiFramework")},_parseBrowserOptional:function(e){return this._parseFromAttributes(e,"browserOptional")},_parseType:function(e){return this._parseFromAttributes(e,"type")},_parseFromAttributes:function(e,t){return(e=e["@attributes"])&&null!=e[t]?e[t]:""}},a.RenditionSelector=function(e,t,i,n){this._targetByterate=e,this._arWeight=t,this._pxWeight=i,this._conversionFactor=n},a.RenditionSelector.prototype={getBestFitRendition:function(e,t,i){return e.reverse(),(e=e.filter(function(e){return e&&e.getPrimaryCreativeRenditionAsset()&&(e.getPrimaryCreativeRenditionAsset().getProxiedUrl()||e.getPrimaryCreativeRenditionAsset().getContent())&&a.Util.canPlayVideoType(e.getPrimaryCreativeRenditionAsset().getMimeType())}).sort(function(e,t){return e.getBitrate()-t.getBitrate()})).length?this._getBitRateFilteredRenditions(e,t,i,this):null},getCustomPlayerBestFitRendition:function(e,t,i){return e.reverse(),(e=e.filter(function(e){return e&&e.getPrimaryCreativeRenditionAsset()&&(e.getPrimaryCreativeRenditionAsset().getProxiedUrl()||e.getPrimaryCreativeRenditionAsset().getContent())}).sort(function(e,t){return e.getBitrate()-t.getBitrate()})).length?this._getBitRateFilteredRenditions(e,t,i,this):null},_getBitRateFilteredRenditions:function(e,t,i,n){var a=Number.MAX_VALUE,r=e.filter(function(e){return e=e.getBitrate(),a=e<a?e:a,e<=n._targetByterate});return r.length||(r=e.filter(function(e){return e.getBitrate()<=a})),r.sort(function(e,a){return n.compareVisualMetrics(e,a,t,i)}).pop()},getBestDashRendition:function(e,t,i){var n=this;return e.reverse(),e.sort(function(e,a){return n.compareVisualMetrics(e,a,t,i)})[e.length-1]},compareVisualMetrics:function(e,t,i,n){var a=this.calculateVisualRatios(e.getWidth(),e.getHeight(),i,n);return n=this.calculateVisualRatios(t.getWidth(),t.getHeight(),i,n),!a&&n?-1:a&&!n?1:a&&n&&(i=this._conversionFactor*this._arWeight*Math.log(n.arRatio),n=this._pxWeight*Math.log(n.pixelation),a=this.findDistance(this._conversionFactor*this._arWeight*Math.log(a.arRatio),this._pxWeight*Math.log(a.pixelation),0,0),(i=this.findDistance(i,n,0,0))!==a)?i-a:e.getPreference()-t.getPreference()},calculateVisualRatios:function(e,t,i,n){if(0<e&&0<t&&0<i&&0<n){var a=e/t,r=i/n;return a>r?n=i/a:i=n*a,{arRatio:a/r,pixelation:e*t/(i*n)}}return null},findDistance:function(e,t,i,n){return isNaN(e)||isNaN(i)||isNaN(t)||isNaN(n)?NaN:Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}},a.RenditionSelector.prototype.constructor=a.RenditionSelector,a.PageSlotScanner=function(e){this.OPTION_INIT=1,this.OPTION_FCAI=2,this.OPTION_NIIC=4,this.OPTION_NOSA=8,this.OPTION_NSIT=16,this._knownSlots=[],this._slots={},this._candidateAds=[],this._slotOptionFound=!1,this._context=e},a.PageSlotScanner.prototype={isSlotDuplicate:function(e){for(var t=0;t<this._knownSlots.length;++t)if(this._knownSlots[t].id===e)return!0;return!1},findPageSlotByScope:function(e){var t=e.document;if(t){var i=/(^|\s)_fwph(\s|$)/,n=t.getElementsByTagName("span");for(e._fw_admanager||(e._fw_admanager={}),e._fw_admanager.pageScanState=!0,e=0;e<n.length;++e){var r,s=n[e];if(i.test(s.className)&&(s=s.getAttribute("id"),(r=t.getElementById("_fw_input_"+s))&&!this.isSlotDuplicate(s)&&(r=r.getAttribute("value")))){";"!==r.charAt(r.length-1)&&(r+=";");var o=(r=r.split(";"))[r.length-2],l=!1;-1!==o.search("lo=i")&&(l=!0);var d=!1;-1!==o.search("prct=")&&(d=!0),0>o.search("flag=")&&(o+="&flag="),0>o.search("ptgt=")&&(o="ptgt=s&"+o),r=[];var _,h,c=o.split("&");o=!0;for(var u=a.SLOT_OPTION_INITIAL_AD_STAND_ALONE,E=0;E<c.length;++E){var p=c[E].split("=");if(2===p.length){if(p[1]=decodeURIComponent(p[1]),"ssct"===p[0]){if
1(d)continue;d=!0,p[0]="prct"}"flag"===p[0]?(-1===p[1].search(/[-\+]cmpn/)&&(p[1]+="+cmpn"),"+"!==p[1].charAt(0)&&"-"!==p[1].charAt(0)&&(p[1]="+"+p[1]),l&&-1===p[1].search("-init")&&(p[1]+="-init"),-1!==p[1].search("-nrpl")&&(p[1]=p[1].replace("-nrpl","+cmpn")),-1!==p[1].search("-cmpn")&&(o=!1),u=this._getInitialOption(p[1]),this._slotOptionFound||(u=l?a.SLOT_OPTION_INITIAL_AD_KEEP_ORIGINAL:a.SLOT_OPTION_INITIAL_AD_STAND_ALONE)):"w"===p[0]?_=Number(p[1]):"h"===p[0]?h=Number(p[1]):"cana"===p[0]&&this._addCandidateAds(p[1]),p=encodeURIComponent(p[0])+"="+encodeURIComponent(p[1]),r.push(p)}}d||""==this._context.getParameter(a.PARAMETER_PAGE_SLOT_CONTENT_TYPE)||(l=this._context.getParameter(a.PARAMETER_PAGE_SLOT_CONTENT_TYPE)||"text/html_doc_lit_mobile,text/html_doc_ref",r.push("prct="+encodeURIComponent(l))),(l=t.getElementById("_fw_container_"+s))?(this._slots[s]=r.join("&")+";",this._knownSlots.push({id:s,width:_,height:h,element:l,acceptCompanion:o,initialAdOption:u})):a.warn("Failed to find container for slot "+s)}}}},scanPageSlots:function(){for(var e=0;e<window.frames.length;++e)try{a.debug("scanPageSlots in frame",e),this.findPageSlotByScope(window.frames[e])}catch(e){a.debug("PageSlotScanner: scanPageSlots exception "+e)}try{window.parent&&window.parent!==window&&(a.debug("scanPageSlots in parent frame"),this.findPageSlotByScope(window.parent))}catch(e){a.debug("PageSlotScanner: scanPageSlots exception "+e)}try{a.debug("scanPageSlots in current window"),this.findPageSlotByScope(window)}catch(e){a.debug("PageSlotScanner: scanPageSlots exception "+e)}},slotsToTypeBStr:function(){var e,t="";for(e in this._slots)if(this._slots.hasOwnProperty(e)){var i=this._slots[e];-1===i.search("slid=")&&(i="slid="+encodeURIComponent(e)+"&"+i),";"!==(t+=i).charAt(t.length-1)&&(t+=";")}return t&&(t=t.substring(0,t.length-1)),t},_addCandidateAds:function(e){e=e.split(",");for(var t=0;t<e.length;t++){var i=parseInt(e[t],10);0<i&&this._candidateAds.push(i)}},_parseFlags:function(e){var t=[],i=[],n="",a=!0;e+="+";for(var r=0;r<e.length;++r){var s=e.charAt(r);switch(s){case"+":case"-":""!==n&&((a?t:i).push(n),n=""),a="+"===s;break;default:n+=s}}return[t,i]},_getInitialOption:function(e){var t=!0,i=!1,n=0;e=this._parseFlags(e);for(var r=a.SLOT_OPTION_INITIAL_AD_STAND_ALONE,s=0;s<e.length;++s)for(var o=0;o<e[s].length;++o)switch(e[s][o].toString().toLowerCase()){case"cmpn":t=0===s;break;case"nrpl":t=0!==s;break;case"init":n=0===s?n&~this.OPTION_INIT:n|this.OPTION_INIT,i=!0;break;case"fcai":n=0===s?n|this.OPTION_FCAI:n&~this.OPTION_FCAI,i=!0;break;case"niic":n=0===s?n|this.OPTION_NIIC:n&~this.OPTION_NIIC,i=!0;break;case"nosa":n=0===s?n|this.OPTION_NOSA:n&~this.OPTION_NOSA,i=!0;break;case"nsit":n=0===s?n|this.OPTION_NSIT:n&~this.OPTION_NSIT,i=!0}switch(a.debug("PageSlotScanner: _getInitialOption: acceptCompanion = "+t),n){case 0:i&&(r=a.SLOT_OPTION_INITIAL_AD_STAND_ALONE);break;case 1:r=a.SLOT_OPTION_INITIAL_AD_KEEP_ORIGINAL;break;case 3:r=a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_ONLY;break;case 2:r=a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_STAND_ALONE;break;case 6:r=a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_THEN_STAND_ALONE;break;case 8:r=a.SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE;break;case 10:r=a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE;break;case 16:r=a.SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE_IF_TEMPORAL;break;case 18:r=a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE_IF_TEMPORAL;break;default:r=a.SLOT_OPTION_INITIAL_AD_STAND_ALONE}return this._slotOptionFound=i,r}},a.PageSlotScanner.prototype.constructor=a.PageSlotScanner,a.DisplayRefreshExtension=function(){this.REFRESH_TYPE_NONE="refresh_none",this.REFRESH_TYPE_AD="refresh_ad",this.REFRESH_TYPE_TIME="refresh_time",this.REPLACE_TYPE_NONE="replace_none",this.REPLACE_TYPE_BLANK="replace_blank",this.REPLACE_TYPE_AD="replace_ad",this._subContext=null,this._displaySlots=[],this._companionSlots=[],this._keyValues=[],this._globalParameters=[],this._overrideParameters=[],this._refreshType=this.REFRESH_TYPE_NONE,this._replaceType=this.REPLACE_TYPE_NONE,this._refreshInterval=0,this._refreshTimer=null,this._firstTemporalAd=!0,this._REQUEST_TIME_OUT=5},a.DisplayRefreshExtension.prototype={init:function(e){this._context=e,a.debug("DisplayRefreshExtension.init(context)"),this._onRendererEvent=a.Util.bind(this,function(e){a.debug("DisplayRefreshExtension._onRendererEvent()"),e.subType===a.EVENT_AD_IMPRESSION&&this._onAdStarted(e)}),this._onSlotEnded=a.Util.bind(this,function(e){var t=e.slot.getTimePositionClass();if(e=e.slot,a.debug("DisplayRefreshExtension._onSlotEnded()",e,t),null!=e&&t!==a.TIME_POSITION_CLASS_DISPLAY&&0!==e.getAdInstances().length)if(this._refreshType===this.REFRESH_TYPE_AD)this._resetSubContext(),this._refreshSlots(this._displaySlots);else if(this._refreshType===this.REFRESH_TYPE_TIME){this._resetSubContext(),this._refreshSlots(this._displaySlots);var i=this;this._refreshTimer=setInterval(function(){a.debug("DisplayRefreshExtension._onTimeout()"),i._resetSubContext(),i._refreshSlots(i._displaySlots)},1e3*this._refreshInterval)}}),this._onRequestComplete=a.Util.bind(this,function(e){if(a.debug("DisplayRefreshExtension._onRequestComplete()"),e.success){switch(this._context.getParameter("refreshType")){case"ad":this._refreshType=this.REFRESH_TYPE_AD;break;case"time":this._refreshInterval=this._context.getParameter("refreshInterval"),this._refreshType=0<this._refreshInterval?this.REFRESH_TYPE_TIME:this.REFRESH_TYPE_NONE;break;default:this._refreshType=this.REFRESH_TYPE_NONE}switch(this._context.getParameter("replaceMissingCompanion")){case"blank":this._replaceType=this.REPLACE_TYPE_BLANK;break;case"ad":this._replaceType=this.REPLACE_TYPE_AD;break;default:this._replaceType=this.REPLACE_TYPE_NONE}if(this._refreshType!==this.REFRESH_TYPE_NONE||this._replaceType!==this.REPLACE_TYPE_NONE){if(this._displaySlots=this._context.getSlotsByTimePositionClass(a.TIME_POSITION_CLASS_DISPLAY),this._companionSlots=this._displaySlots.filter(function(e){return e.getAcceptCompanion()}),this._keyValues=this._context._adRequest._keyValues,this._globalParameters=this._context._globalLevelParameterDictionary,this._overrideParameters=this._context._overrideLevelParameterDictionary,this._firstTemporalAd=!0,this._context.addEventListener(a.EVENT_AD,this._onRendererEvent),this._context.addEventListener(a.EVENT_SLOT_ENDED,this._onSlotEnded),this._refreshType===this.REFRESH_TYPE_TIME){var t=this;this._refreshTimer=setInterval(function(){a.debug("DisplayRefreshExtension._onTimeout()"),t._resetSubContext(),t._refreshSlots(t._displaySlots)},1e3*this._refreshInterval)}}else this._refreshTimer&&clearInterval(this._refreshTimer)}else a.debug("DisplayRefreshExtension: request complete failed")}),this._context.addEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete)},_resetSubContext:function(){a.debug("DisplayRefreshExtension._resetSubContext()"),this._subContext=this._context._adManager.cloneContext(this._context),this._subContext._extensionManager._displayRefreshExtension.dispose(),this._subContext._extensionManager._videoStateExtension.dispose(),this._subContext.setCapability(a.CAPABILITY_SLOT_TEMPLATE,a.CAPABILITY_STATUS_OFF),this._subContext.setCapability(a.CAPABILITY_DISPLAY_REFRESH,a.CAPABILITY_STATUS_ON),this._playRefreshedSlots=a.Util.bind(this,function(e){if(a.debug("DisplayRefreshExtension._playRefreshedSlots()"),e.success){e=this._subContext.getSlotsByTimePositionClass(a.TIME_POSITION_CLASS_DISPLAY);for(var t=0;t<e.length;t++)e[t].play()}else a.debug("DisplayRefreshExtension._playRefreshedSlots(): subContext refresh request error:",e)}),this._subContext.addEventListener(a.EVENT_REQUEST_COMPLETE,this._playRefreshedSlots);for(var e=this._subContext._adRequest._keyValues,t=0;t<this._keyValues.length;t++)0>e.indexOf(this._keyValues[t])&&e.push(this._keyValues[t]);for(var i in this._globalParameters)this._globalParameters.hasOwnProperty(i)&&this._subContext.setParameter(i,this._globalParameters[i],a.PARAMETER_LEVEL_GLOBAL);for(i in this._overrideParameters)this._overrideParameters.hasOwnProperty(i)&&this._subContext.setParameter(i,this._overrideParameters[i],a.PARAMETER_LEVEL_OVERRIDE)},_onAdStarted:function(e){a.debug("DisplayRefreshExtension._onAdStarted()");var t=e.adInstance.getSlot();if(a.debug("DisplayRefreshExtension._onAdStarted(): slot: ",t," | timePositionClass:",t.getTimePositionClass()),null!=t&&t.getTimePositionClass()!==a.TIME_POSITION_CLASS_DISPLAY&&(this._resetSubContext(),this._refreshTimer&&clearInterval(this._refreshTimer),this._replaceType!==this.REPLACE_TYPE_NONE)){e=e.adInstance,t=t.getAdInstances();for(var i=0;i<t.length;i++)e.getAdId()===t[i].getAdId()&&this._checkMissingCompanionForAd(e)}},_checkMissingCompanionForAd:function(e){a.debug("DisplayRefreshExtension._checkMissingCompanionForAd()",e);var t,i=this._companionSlots.slice();for(e=e.getCompanionAdInstances(),t=0;t<e.length;t++){var n=i.indexOf(e[t].getSlot());-1<n&&i.splice(n,1)}if(this._firstTemporalAd&&(this._firstTemporalAd=!1,i=i.filter(function(e){if(e.getInitialAdOption()!==a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_ONLY&&e.getInitialAdOption()!==a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_STAND_ALONE&&e.getInitialAdOption()!==a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_THEN_STAND_ALONE&&e.getInitialAdOption()!==a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE&&e.getInitialAdOption()!==a.SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE_IF_TEMPORAL)return a.debug("DisplayRefreshExtension._checkMissingCompanionForAd(): firstCompanionAsInitial false in slot ",e.getCustomId()),!0;for(var t=e.getAdInstances(),i=0;i<t.length;i++)if(!t[i].isPlaceholder())return a.debug("DisplayRefreshExtension._checkMissingCompanionForAd(): first companion found in slot ",e.getCustomId()),!1;return a.debug("DisplayRefreshExtension._checkMissingCompanionForAd(): firstCompanionAsInitial true, no ad in slot ",e.getCustomId()),!0})),this._replaceType===this.REPLACE_TYPE_BLANK)for(t=0;t<i.length;t++)i[t].stop(),this._subContext._replacePageSlot(i[t].getCustomId(),"");else this._replaceType===this.REPLACE_TYPE_AD&&this._refreshSlots(i)},_refreshSlots:function(e){if(a.debug("DisplayRefreshExtension._refreshSlots()",e),null!=e&&0!==e.length){for(var t=0;t<e.length;t++)e[t].stop(),this._subContext._refreshSlots.push(e[t].getCustomId());this._subContext._isRefreshRequest=!0,this._subContext.submitRequest(this._REQUEST_TIME_OUT)}},dispose:function(){a.debug("DisplayRefreshExtension.dispose()"),this._context&&(this._context.removeEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete),this._context.removeEventListener(a.EVENT_SLOT_ENDED,this._onSlotEnded),this._context.removeEventListener(a.EVENT_AD,this._onRendererEvent),this._context=null),this._subContext&&(this._subContext.removeEventListener(a.EVENT_REQUEST_COMPLETE,this._playRefreshedSlots),this._subContext=null),this._displaySlots=[],this._companionSlots=[],this._keyValues=[],this._globalParameters=[],this._overrideParameters=[],this._refreshType=this.REFRESH_TYPE_NONE,this._replaceType=this.REPLACE_TYPE_NONE,this._refreshInterval=0,this._refreshTimer&&clearInterval(this._refreshTimer),this._refreshTimer=null,this._firstTemporalAd=!0}},a.DisplayRefreshExtension.prototype.constructor=a.DisplayRefreshExtension,a.Ad=function(){this._id=null,this._creatives=[],this._noLoad=!1,this._soAdUnit=null,this._isRequiredToShow=!1},a.Ad.prototype={isRequiredToShow:function(){return this._isRequiredToShow},parse:function(e){if(e){this._id=e.adId||null,this._noLoad=e.noLoad,this._soAdUnit=e.adUnit,e.hasOwnProperty("required")&&(this._isRequiredToShow=e.required);var t=0;for(e=e.creatives||[];t<e.length;t++){var i=e[t],n=new a.Creative;n.parse(i),this._creatives.push(n)}}},getSoAdUnit:function(){return this._soAdUnit},getId:function(){return this._id},getNoLoad:function(){return this._noLoad},getCreative:function(e){for(var t=0;t<this._creatives.length;t++)if(this._creatives[t].getId()===e)return this._creatives[t];return null},addCreativeRendition:function(){var e=new a.Creative;return this._creatives.push(e),e}},a.Ad.prototype.constructor=a.Ad,a.Creative=function(){this._duration=this._baseUnit=this._id=null,this._parameters={},this._creativeRenditions=[]},a.Creative.prototype={getId:function(){return this._id},getBaseUnit:function(){return this._baseUnit},getDuration:function(){return this._duration},getParameter:function(e){return this._parameters[e]},setParameter:function(e,t){null==t?delete this._parameters[e]:this._parameters[e]=t},parse:function(e){if(e){if(this._id=e.creativeId||null,this._baseUnit=e.baseUnit||null,this._duration=1*e.duration,e.parameters)if(e.parameters.constructor===Array)for(var t=0,i=e.parameters||[];t<i.length;t++){var n=i[t];this._parameters[n.name]=n.value}else"object"==typeof e.parameters&&(this._parameters=a.Util.copy(e.parameters));for(t=0,i=e.creativeRenditions||[];t<i.length;t++){for(var r in n=i[t],(e=new a.CreativeRendition).parse(n),e.setDuration(this._duration),e.setBaseUnit(this._baseUnit),this._parameters)this._parameters.hasOwnProperty(r)&&e.setParameter(r,this._parameters[r]);this._creativeRenditions.push(e)}}},getAllCreativeRenditions:function(){return this._creativeRenditions},addCreativeRendition:function(e){this._creativeRenditions.push(e)},getEligibleCreativeRenditionsForAdInstance:function(e){var t,i=[],n=[];for(t=0;t<this._creativeRenditions.length;t++){var a=this._creativeRenditions[t];a.getId()===e._creativeRenditionId&&a.getReplicaId()===e._replicaId&&i.push(a),""===a.getReplicaId()&&n.push(a)}return 0===i.length?n:i},cloneForTranslation:function(){var e=new a.Creative;return e.parse({creativeId:this._id,baseUnit:this._baseUnit,duration:this._duration,parameters:a.Util.copy(this._parameters)}),e}},a.Creative.prototype.constructor=a.Creative,a.CreativeRendition=function(){this._id=null,this._creativeApi="None",this._baseUnit=null,this._replicaId="",this._bitrate=this._height=this._width=this._preference=this._wrapperUrl=this._wrapperType=this._contentType=null,this._parameters={},this._primaryCreativeRenditionAsset=null,this._otherCreativeRenditionAssets=[],this._universalAdId=this._duration=null},a.CreativeRendition.prototype={getId:function(){return this._id},getCreativeApi:function(){return this._creativeApi},setCreativeApi:function(e){this._creativeApi=e||"None"},getReplicaId:function(){return this._replicaId},getContentType:function(){return this._contentType?this._contentType:this._primaryCreativeRenditionAsset&&this._primaryCreativeRenditionAsset.getContentType()?this._primaryCreativeRenditionAsset.getContentType():null},setContentType:function(e){this._contentType=e},getWrapperType:function(){return this._wrapperType},setWrapperType:function(e){this._wrapperType=e},getWrapperUrl:function(){return this._wrapperUrl},setWrapperUrl:function(e){this._wrapperUrl=e},getBaseUnit:function(){return this._baseUnit},setBaseUnit:function(e){this._baseUnit=e},getPreference:function(){return this._preference},setPreference:function(e){this._preference=e},getWidth:function(){return this._width}
1,setWidth:function(e){this._width=e},getHeight:function(){return this._height},setHeight:function(e){this._height=e},getDuration:function(){return this._duration},setDuration:function(e){this._duration=e},getParameter:function(e){return this._parameters[e]},setParameter:function(e,t){null==t?delete this._parameters[e]:this._parameters[e]=t},getUniversalAdId:function(){return this._universalAdId},setUniversalAdId:function(e){this._universalAdId=e},getPrimaryCreativeRenditionAsset:function(){return this._primaryCreativeRenditionAsset},getOtherCreativeRenditionAssets:function(){return this._otherCreativeRenditionAssets.slice()},addCreativeRenditionAsset:function(e,t){var i=new a.CreativeRenditionAsset;return i.setName(e),t?this._primaryCreativeRenditionAsset=i:this._otherCreativeRenditionAssets.push(i),i},getBitrate:function(){var e=this._duration,t=this._primaryCreativeRenditionAsset._bytes;return t&&e&&!isNaN(t)&&!isNaN(e)&&0<t&&0<e?8*t/1e3/e:0<this._bitrate?this._bitrate:-1},parse:function(e){if(e){this._id=e.creativeRenditionId||null,this._creativeApi=e.creativeApi||"None",this._replicaId=e.hasOwnProperty("adReplicaId")?e.adReplicaId:"",this._contentType=e.contentType||null,this._wrapperType=e.wrapperType||null,this._wrapperUrl=e.wrapperUrl||null,this._preference=1*e.preference,this._width=1*e.width,this._height=1*e.height,this._bitrate=e.hasOwnProperty("bitrate")?1*e.bitrate:null;for(var t,i=0,n=e.parameters||[];i<n.length;i++)t=n[i],this._parameters[t.name]=t.value;for(this._primaryCreativeRenditionAsset=new a.CreativeRenditionAsset,this._primaryCreativeRenditionAsset.parse(e.asset),i=0,n=e.otherAssets||[];i<n.length;i++)t=n[i],(e=new a.CreativeRenditionAsset).parse(t),this._otherCreativeRenditionAssets.push(e)}}},a.CreativeRendition.prototype.constructor=a.CreativeRendition,a.CreativeRenditionAsset=function(){this._bytes=this._mimeType=this._contentType=this._content=this._proxiedUrl=this._url=this._name=this._id=null},a.CreativeRenditionAsset.prototype={getName:function(){return this._name},setName:function(e){this._name=e},getUrl:function(){return this._url},getProxiedUrl:function(){return this._proxiedUrl},setUrl:function(e){this._url=e,this._proxiedUrl=a.Util.transformCreativeUrlToProxy(this._url)},getContent:function(){return this._content},setContent:function(e){this._content=e},getContentType:function(){return this._contentType},setContentType:function(e){this._contentType=e},getMimeType:function(){return this._mimeType},setMimeType:function(e){this._mimeType=e},getBytes:function(){return this._bytes},setBytes:function(e){this._bytes=e},parse:function(e){e&&(this._id=e.id||null,this._name=e.name||null,this._url=e.url||null,this._proxiedUrl=a.Util.transformCreativeUrlToProxy(this._url),this._content=e.content||null,this._contentType=e.contentType||null,this._mimeType=e.mimeType||null,this._bytes=1*e.bytes)}},a.CreativeRenditionAsset.prototype.constructor=a.CreativeRenditionAsset,a.AdManager=function(e){var t=this,i=this;if(this._context=this.newContext(),this._context.addEventListener(a.EVENT_REQUEST_COMPLETE,function(e){i.onRequestComplete(e)}),this._networkId=this._serverURL="",this._location=null,e){var n=a.Util.validateJSON(e,{adNetworkID:{allowedTypes:["number","string"]},adProfileID:{allowedTypes:["string"]},adServerUrl:{allowedTypes:["string"]},adSiteSectionID:{allowedTypes:["string"]},adAssetNetworkID:{allowedTypes:["number","string"],isOptional:!0},adOptOut:{allowedTypes:["number","boolean"],isOptional:!0},appBundleID:{allowedTypes:["string"],isOptional:!0},appName:{allowedTypes:["string"],isOptional:!0},appVersion:{allowedTypes:["string"],isOptional:!0},authenticationEntity:{allowedTypes:["string"],isOptional:!0},coppa:{allowedTypes:["string"],isOptional:!0},deviceAdAttributes:{allowedTypes:["string"],isOptional:!0},distributorAppID:{allowedTypes:["string"],isOptional:!0},ifa:{allowedTypes:["string"],isOptional:!0},ifaValue:{allowedTypes:["string"],isOptional:!0},privacyData:{allowedTypes:["string"],isOptional:!0}},"adConfig");if(n)throw e="Unable to initialize AdManager instance. "+n.message,a.warn(e),Error(e);this._adConfig=Object.assign({},e),"boolean"==typeof e.adOptOut&&(this._adConfig.adOptOut=Number(e.adOptOut)),"string"==typeof e.adNetworkID&&(this._adConfig.adNetworkID=Number(e.adNetworkID)),"string"==typeof e.adAssetNetworkID&&(this._adConfig.adAssetNetworkID=Number(e.adAssetNetworkID)),this.setNetwork(e.adNetworkID),this.setServer(e.adServerUrl)}this._fwGDPRConsent=this._fwGDPR=null,this._fwTCFAPIExecuted=!1,this._fwUSPString=null,this._isListeningForTCData=this._fwUSPAPIExecuted=!1,this._tcfapiImpl=null,this._tcfapiCallback=function(e,i){i?t._onTCFSuccess(e):(t._fwTCFAPIExecuted=!0,t._isListeningForTCData=!1,a.warn("TCFAPI add listener failed."))},this._fetchGDPRData(),this._fetchCCPAData()},a.AdManager.prototype={getVersion:function(){if(a.version){var e=a.version.match(/^js-(\d)\.(\d)\.(\d).(\d)/)||a.version.match(/^js-(\d)\.(\d)\.(\d)/)||a.version.match(/^js-(\d)\.(\d)/);if(null!=e&&0<e.length){for(var t=0,i=0;i<e.length-1;i++)t+=e[e.length-i-1]<<(i<<3);return t}if(0===a.version.indexOf("js-master"))return 4294967295}return 0},setNetwork:function(e){if(a.debug("AdManager.setNetwork("+Array.prototype.slice.call(arguments).join(",")+")"),0<1*e){for(var t in this._networkId=1*e,a._instanceQueue)if(a._instanceQueue.hasOwnProperty(t)){var i=a._instanceQueue[t];i&&i._videoAsset&&i._videoAsset._videoPlayPending&&i._videoAsset.play()}}else a.warn("AdManager.setNetwork","valid networkId required")},setServer:function(e){if(a.debug("AdManager.setServer("+Array.prototype.slice.call(arguments).join(",")+")"),e&&"string"==typeof e){for(var t in this._serverURL=e,a._instanceQueue)if(a._instanceQueue.hasOwnProperty(t)){var i=a._instanceQueue[t];i&&i._videoAsset&&i._videoAsset._videoPlayPending&&i._videoAsset.play()}}else a.warn("AdManager.setServer","server url required")},setLocation:function(e){a.debug("AdManager.setLocation("+Array.prototype.slice.call(arguments).join(",")+")"),this._location=e},newContext:function(e,t){a.debug("AdManager.newContext("+Array.prototype.slice.call(arguments).join(",")+")");
1var i=this._validateVideoConfig(e,t);if(0<i.length)throw i="Unable to initialize Context instance."+i,a.warn(i),Error(i);return new a.Context(this,e,t)},_validateVideoConfig:function(e,t){var i=[];return e&&!this._adConfig?i.push("A videoConfig object should only be used to initialize Context when AdManager was initialized with an adConfig object."):!e&&this._adConfig?i.push("A videoConfig object is required to initialize Context when AdManager was initialized with an adConfig object."):e&&((e=a.Util.validateJSON(e,{mode:{validationFunction:function(e){return e&&("live"===e.toLowerCase()||"on-demand"===e.toLowerCase())}},duration:{allowedTypes:["number"]},customID:{allowedTypes:["string"]},language:{allowedTypes:["string"],isOptional:!0},genre:{allowedTypes:["string"],isOptional:!0},brand:{allowedTypes:["string"],isOptional:!0},rating:{allowedTypes:["string"],isOptional:!0},provider:{allowedTypes:["string"],isOptional:!0},title:{allowedTypes:["string"],isOptional:!0},series:{allowedTypes:["string"],isOptional:!0},autoPlay:{allowedTypes:["boolean"],isOptional:!0},idType:{isOptional:!0,validationFunction:function(e){return e===a.ID_TYPE_CUSTOM||e===a.ID_TYPE_FW||e===a.ID_TYPE_GROUP}},durationType:{isOptional:!0,validationFunction:function(e){return e&&(e.toLowerCase()===a.VIDEO_ASSET_DURATION_TYPE_EXACT||e.toLowerCase()===a.VIDEO_ASSET_DURATION_TYPE_VARIABLE)}},fallbackId:{allowedTypes:["number","string"],isOptional:!0},location:{allowedTypes:["string"],isOptional:!0}},"videoConfig"))&&i.push(e.message),t?"string"!=typeof t&&"object"!=typeof t?i.push("The player argument is the incorrect type. It should either be a string or an object."):"object"==typeof t&&(e=a.Util.validateCustomPlayer(t))&&i.push(e.message):i.push("No player argument was passed. The player argument is required when using a videoConfig object.")),a.Util.arrayToString(i)},newContextWithContext:function(e){a.debug("AdManager.newContextWithContext("+Array.prototype.slice.call(arguments).join(",")+")");var t=this.cloneContext(e);t._temporalSlotBase=e._temporalSlotBase,e.getContentVideoElement()&&(t.setContentVideoElement(e.getContentVideoElement()),delete t._temporalSlotBase["_fw_contentVideo_"+e._instanceId]),t._videoDisplaySize=e._videoDisplaySize,t._overriddenAdRenderers=e._overriddenAdRenderers,t._currentContentPlayheadTime=e._currentContentPlayheadTime,t.startSubsession(e._adRequest._subsessionToken),t.setRequestMode(e._adRequest._requestMode),t._adRequest._compatibleDimensions=e._adRequest._compatibleDimensions,t._adRequest._keyValues=e._adRequest._keyValues,t._videoAsset._state=e._videoAsset._state,t._videoAsset._callbackTimer=e._videoAsset._callbackTimer,t._videoAsset._videoPlayPending=e._videoPlayPending,t._videoAsset._requestedVideoViewUrl=e._videoAsset._requestedVideoViewUrl,t._videoAsset._delay=e._videoAsset._delay,t._videoAsset._durationType=e._videoAsset._durationType,e._customPlayer&&(t._customPlayer=e._customPlayer);var i,n=e._extensionManager.extensions;for(i in n)n.hasOwnProperty(i)&&t.loadExtension(n[i]);return this._context=t},_setupConsentPostMessage:function(e){a.debug("AdManager.setupConsentPostMessage");var t=e+"Locator",i=e+"Call",n=e+"Return",r=a.Util.getFrameAncestor(t),s={};window[e]=function(e,n,a){if(r){var o=Math.random()+"",l={};l[i]={command:e,parameter:n,callId:o},e=l,s[o]=a,r.postMessage(e,"*")}else a({msg:t+" not found"},!1)},window.addEventListener("message",function(e){try{var t="string"==typeof e.data?JSON.parse(e.data):e.data;if(t[n]){var i=t[n];"function"==typeof s[i.callId]&&(s[i.callId](i.returnValue,i.success),delete s[i.callId])}}catch(e){a.warn("Consent postMessage listener error:",e)}},!1)},_retrieveGDPRWithPostMessage:function(){a.debug("AdManager.retrieveGDPRWithPostMessage"),this._setupConsentPostMessage("__tcfapi"),this._tcfapiImpl=window.__tcfapi,this._getGdprConsentData()},_fetchGDPRData:function(){a.debug("AdManager.fetchGDPRData");try{this._tcfapiImpl=a.Util.getTopMostWindow().__tcfapi,this._getGdprConsentData()}catch(e){a.warn("__tcfapi function on top window is inaccessible due to the following error: "+e),this._retrieveGDPRWithPostMessage()}},_addEventListenerForTCData:function(){a.debug("AdManager._addEventListenerForTCData"),this._isListeningForTCData=!0;try{this._tcfapiImpl("addEventListener",a.GDPR_TCFAPI_VERSION,this._tcfapiCallback.bind(this))}catch(e){this._fwTCFAPIExecuted=!0,a.warn("AdManager._addEventListenerForTCData failed with err: ",e,e.description)}},_removeEventListenerForTCData:function(){a.debug("AdManager._removeEventListenerForTCData"),this._isListeningForTCData=!1;try{this._tcfapiImpl("removeEventListener",a.GDPR_TCFAPI_VERSION,function(e){e?a.log("removeEventListener succeeded"):a.warn("TCFAPI remove listener failed.")},this._tcfapiCallback.bind(this))}catch(e){a.warn("AdManager._removeEventListenerForTCData failed with err: ",e,e.description)}},_getTCStringFromTCData:function(e){var t=e.gdprApplies;null!==t?null==t?this._fwGDPR="":"boolean"==typeof t?this._fwGDPR=t?1:0:(this._fwGDPR=t.toString(),a.warn("VendorConsentData's gdprApplies value is malformed.")):a.warn("VendorConsentData's gdprApplies value is missing."),null!=(e=e.tcString)?"string"==typeof e?this._fwGDPRConsent=e:(this._fwGDPRConsent=e.toString(),a.warn("VendorConsentData's consentData value is malformed.")):a.warn("VendorConsentData's consentData value is missing.")},_onTCFSuccess:function(e){a.debug("AdManager._onTCFSuccess with event status ",e.eventStatus),this._getTCStringFromTCData(e),"tcloaded"==e.eventStatus||"useractioncomplete"==e.eventStatus?(this._fwTCFAPIExecuted=!0,this._isListeningForTCData&&this._removeEventListenerForTCData()):"cmpuishown"==e.eventStatus?this._isListeningForTCData||this._addEventListenerForTCData():(this._fwGDPRConsent=this._fwGDPR="",this._fwTCFAPIExecuted=!0,a.warn("VendorConsentData's event status is missing or not valid."))},_getGdprConsentData:function(){if(a.debug("AdManager.getGdprConsentData"),"function"==typeof this._tcfapiImpl)try{this._tcfapiImpl("getTCData",a.GDPR_TCFAPI_VERSION,this._tcfapiCallback.bind(this))}catch(e){this._fwTCFAPIExecuted=!0,a.warn("AdManager.getGdprConsentData failed with err: ",e,e.description)}else this._fwTCFAPIExecuted=!0,a.warn("TCFAPI function cannot be found. _fw_gdpr: "+this._fwGDPR+", _fw_gdpr_consent: "+this._fwGDPRConsent)},_retrieveCCPAWithPostMessage:function(){a.debug("AdManager.retrieveCCPAWithPostMessage"),this._setupConsentPostMessage("__uspapi"),this._getUSPData(window.__uspapi)},_fetchCCPAData:function(){a.debug("AdManager.fetchCCPAData");try{var e=a.Util.getTopMostWindow().__uspapi;this._getUSPData(e)}catch(e){a.warn("__uspapi function on top window is inaccessible due to the following error: "+e),this._retrieveCCPAWithPostMessage()}},_getUSPData:function(e){if(a.debug("AdManager.getUSPData"),"function"==typeof e)try{var t=this;e("getUSPData",1,function(e,i){i?null!=(e=e.uspString)?"string"==typeof e?t._fwUSPString=e:(t._fwUSPString=e.toString(),a.warn("USPData's uspString value is malformed.")):a.warn("USPData's uspString value is missing."):a.warn("Cannot retrieve CCPA params from USPAPI."),t._fwUSPAPIExecuted=!0},this)}catch(e){this._fwUSPAPIExecuted=!0,a.warn("AdManager.getUSPData "+e.description)}else this._fwUSPAPIExecuted=!0,a.warn("USPAPI function cannot be found. _fw_us_privacy: "+this._fwUSPString)},dispose:function(){a.debug("AdManager.dispose()"),this._context.dispose()},cloneContext:function(e){var t,i=new a.Context(this),n=e._adRequest._capabilities._capabilities;for(t in n)n.hasOwnProperty(t)&&i.setCapability(t,n[t]);return i.setProfile(e._adRequest._playerProfile),i.setSiteSection(e._ss_id,e._ss_networkId,e._ss_pageViewRandom,e._ss_idType,e._ss_fallbackId),i.setVideoAsset(e._va_id,e._va_duration,e._va_networkId,e._va_location,e._va_autoPlayType,e._va_viewRandom,e._va_
1idType,e._va_fallbackId,e._va_durationType),i.setVisitor(e._adRequest._visitorCustomId,e._adRequest._visitorIpV4Address),i}},a.AdManager.prototype.constructor=a.AdManager,a._instanceCounter=0,a._instanceQueue={},a.Context=function(e,t,i){if(this._adManager=e,this._eventDispatcher=new a.EventDispatcher,this._adRequest=new a.AdRequest(this),this._adResponse=null,this._videoAsset=new a.VideoAsset(this),this._customPlayer=this._temporalSlotBase=null,this._videoDisplaySize={},this._globalLevelParameterDictionary={},this._overrideLevelParameterDictionary={},this._globalLevelParameterDictionary[a.PARAMETER_AUTO_PAUSE_AD_ONVISIBILITYCHANGE]=!0,this._globalLevelParameterDictionary[a.PARAMETER_DISABLE_CORS_ENFORCEMENT]=!0,this._globalLevelParameterDictionary[a.PARAMETER_USE_GDPR_TCFAPI]=!0,this._globalLevelParameterDictionary[a.PARAMETER_USE_CCPA_USPAPI]=!0,this._globalLevelParameterDictionary[a.PARAMETER_CONSENT_RETRIEVAL_TIMEOUT]=500,this._globalLevelParameterDictionary[a.PARAMETER_ENABLE_ACCESS_CONTROL_ALLOW_CREDENTIALS]=!1,a.Util.setContext(this),this._rendererManifest={},this._overriddenAdRenderers=[],this._extensionManager=new a.ExtensionManager(this),this._totalSetDisplaySizeCount=this._autoSetDisplaySizeCount=this._requestState=0,this._instanceId=a._instanceCounter,a._instanceQueue["Context_"+a._instanceCounter]=this,a._instanceCounter++,this._contentVideoAttached=!1,this._currentContentPlayheadTime=0,this._ss_id="",this._ss_networkId=this._ss_pageViewRandom=0,this._ss_idType=a.ID_TYPE_CUSTOM,this._va_location=this._va_networkId=this._va_duration=this._va_id=this._ss_fallbackId="",this._va_autoPlayType=a.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED,this._va_fallbackId="",this._va_viewRandom=0,this._va_idType=a.ID_TYPE_CUSTOM,this._va_durationType=a.VIDEO_ASSET_DURATION_TYPE_EXACT,this._isRefreshRequest=!1,this._refreshSlots=[],this._adVolume=1,this._onVolumeChange=this.__onVolumeChange.bind(this),t){e=e._adConfig,this.setProfile(e.adProfileID);var n=e.adNetworkID;e.adAssetNetworkID&&(n=e.adAssetNetworkID);var r=null;!1===t.autoPlay?r=a.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE:!0===t.autoPlay&&(r=a.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED);var s=this._va_idType;null!=t.idType&&(s=t.idType);var o=this._va_durationType;null!=t.durationType&&(o=t.durationType.toLowerCase());var l=a.Util.getFixedDigitRandomNumber(8);if(this.setVideoAsset(t.customID,t.duration,n,t.location,r,l,s,t.fallbackId,o),n=a.Util.getFixedDigitRandomNumber(8),this.setSiteSection(e.adSiteSectionID,e.adNetworkID,n),this.setRequestMode(t.mode.toLowerCase()),"object"==typeof i?this._registerCustomPlayer(i):this.registerVideoDisplayBase(i),this.addKeyValue("_fw_content_id",t.customID),null!=t.language&&this.addKeyValue("_fw_content_language",t.language),null!=t.genre&&this.addKeyValue("_fw_content_genre",t.genre),null!=t.brand&&this.addKeyValue("_fw_content_programmer_brand",t.brand),null!=t.rating&&this.addKeyValue("_fw_content_rating",t.rating),null!=t.provider&&this.addKeyValue("_fw_content_provider",t.provider),null!=t.title&&this.addKeyValue("_fw_content_title",t.title),null!=t.series&&this.addKeyValue("_fw_content_series",t.series),null!=e.appBundleID&&this.addKeyValue("_fw_app_bundle",e.appBundleID),null!=e.appName&&this.addKeyValue("_fw_app_name",e.appName),null!=e.appVersion&&this.addKeyValue("_fw_app_version",e.appVersion),null!=e.authenticationEntity&&this.addKeyValue("_fw_ae",e.authenticationEntity),null!=e.coppa&&this.addKeyValue("_fw_coppa",e.coppa),null!=e.deviceAdAttributes&&this.addKeyValue("_fw_ad_attributes",e.deviceAdAttributes),null!=e.distributorAppID&&this.addKeyValue("_fw_app_platform",e.distributorAppID),null!=e.ifa&&this.addKeyValue("_fw_ifa",e.ifa),null!=e.ifaValue&&this.addKeyValue("_fw_ifa_value",e.ifaValue),null!=e.adOptOut&&this.addKeyValue("_fw_opt_out",e.adOptOut.toString()),null!=e.privacyData)try{var d=atob(e.privacyData);a.debug("Context.constructor: Decoded adConfig.privacyData value:",d),this.addKeyValue("_fw_opt_out_data",d)}catch(e){a.warn("Context.constructor: An error occurred while decoding adConfig.privacyData:",e)}}},a.Context.prototype={getAdVolume:function(){return this._customPlayer?(a.warn("Context.getAdVolume: volume control is not supported when using custom player"),-1):this._adVolume},setAdVolume:function(e){if(this._customPlayer)a.warn("Context.setAdVolume: volume control is not supported when using custom player");else if(a.debug("Context.setAdVolume",e),this.getContentVideoElement())if("number"!=typeof e||0>e||1<e)a.debug("Invalid volume: "+e);else if((a.PLATFORM_IS_IPHONE_IPOD||a.PLATFORM_IS_IPAD)&&0<e&&1>e)a.debug("iOS doesn't allow volume values other than 0 and 1, ignore.");
1else if(e===this._adVolume)a.debug("Volume did not change, ignore.");else{this._adVolume=e,e=this.getTemporalSlots();for(var t=0;t<e.length;++t){var i=e[t];if(i.getType()===a.SLOT_TYPE_TEMPORAL&&i.getState()!==a.MediaInitState.instance&&i.getState()!==a.MediaEndState.instance&&(i=i.getCurrentAdInstance())){i.setVolume(this._adVolume);break}}}else a.debug("No video element set, ignore.")},__onVolumeChange:function(e){a.debug("Context._onVolumeChange(): event = "+e.type),a.debug("Context._onVolumeChange(): video element is muted: "+this.getContentVideoElement().muted),0!==this._adVolume||this.getContentVideoElement().muted?this.setAdVolume(this.getContentVideoElement().muted?0:this.getContentVideoElement().volume):this.setAdVolume(this.getContentVideoElement().volume)},addRenderer:function(e,t,i,n,a,r,s){this._overriddenAdRenderers.push({url:e,baseUnit:t,contentType:i,creativeApi:r,slotType:n,soAdUnit:a,parameter:s})},setCapability:function(e,t){a.debug("Context.setCapability",e,t),this._adRequest.setCapability(e,t)},addKeyValue:function(e,t){a.debug("Context.addKeyValue",e,t),this._adRequest.addKeyValue(e,t)},setParameter:function(e,t,i){if(a.debug("Context.setParameter",e,t,i),i===a.PARAMETER_LEVEL_GLOBAL)i=this._globalLevelParameterDictionary;else{if(i!==a.PARAMETER_LEVEL_OVERRIDE)return;i=this._overrideLevelParameterDictionary}null==t?delete i[e]:i[e]=t},getParameter:function(e){return e?this._overrideLevelParameterDictionary.hasOwnProperty(e)?this._overrideLevelParameterDictionary[e]:this._adResponse&&this._adResponse._profileParameters.hasOwnProperty(e)?this._adResponse._profileParameters[e]:this._globalLevelParameterDictionary.hasOwnProperty(e)?this._globalLevelParameterDictionary[e]:null:null},setVideoState:function(e){a.debug("Context.setVideoState",e),this._videoAsset&&this._videoAsset.setVideoState(e)},registerVideoDisplayBase:function(e){if(a.debug("Context.registerVideoDisplayBase",e),e&&"string"==typeof e){if(this._temporalSlotBase&&this._temporalSlotBase.id===e){a.debug("Context.registerVideoDisplayBase","register the same display base, will only change size");var t=this._temporalSlotBase.getElementsByTagName("video")}else{if(this._temporalSlotBase&&this.getContentVideoElement().removeEventListener("volumechange",this._onVolumeChange),this._temporalSlotBase=document.getElementById(e),!this._temporalSlotBase)return void a.warn("Context.registerVideoDisplayBase","could not get element",e);if(0===(t=this._temporalSlotBase.getElementsByTagName("video")).length)return a.warn("Context.registerVideoDisplayBase","could not get video element from",e),void(this._temporalSlotBase=null);this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]=t[0],this.getContentVideoElement().addEventListener("volumechange",this._onVolumeChange),this._adVolume=t[0].muted?0:t[0].volume}this._setVideoDisplaySizeByContentVideo(t[0])}else a.warn("Context.registerVideoDisplayBase","id required")},setContentVideoElement:function(e){if(a.debug("Context.setContentVideoElement()"),e&&e.parentNode){var t=this._temporalSlotBase;this._temporalSlotBase=e.parentNode,this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]===e?a.debug("Context.setContentVideoElement","set the same video in same div, will only change size"):(t&&t["_fw_contentVideo_"+this._instanceId]&&t["_fw_contentVideo_"+this._instanceId].removeEventListener("volumechange",this._onVolumeChange),this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]=e,this.getContentVideoElement().addEventListener("volumechange",this._onVolumeChange),this._adVolume=this.getContentVideoElement().muted?0:this.getContentVideoElement().volume),this._setVideoDisplaySizeByContentVideo(e)}else a.warn("Context.setContentVideoElement","contentVideo and contentVideo.parentNode is required")},registerCustomPlayer:function(e){a.debug("Context.registerCustomPlayer");var t=a.Util.validateCustomPlayer(e);t?a.warn("Context.registerCustomPlayer: "+t.message):this._registerCustomPlayer(e)},_registerCustomPlayer:function(e){this._customPlayer=e,this._videoDisplaySize={left:0,top:0,width:0,height:0,position:0}},getContentVideoElement:function(){return this._temporalSlotBase?this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]:(a.warn("Context.getContentVideoElement: SlotBase is null"),null)},getCustomPlayer:function(){return this._customPlayer?this._customPlayer:(a.warn("Context.getCustomPlayer: customPlayer was null"),null)},setVideoDisplaySize:function(e,t,i,n,r){a.debug("Context.setVideoDisplaySize("+Array.prototype.slice.call(arguments).join(",")+")"),this._totalSetDisplaySizeCount++,this._videoDisplaySize={left:e,top:t,width:i,height:n,position:r};for(var s=this.getTemporalSlots(),o=0;o<s.length;++o){var l=s[o];if(l.setWidth(i),l.setHeight(n),l.getState()===a.MediaPlayingState.instance||l.getState()===a.MediaReplayingState.instance){(s=l.getCurrentAdInstance())&&((s=s.getRendererController().getRenderer())&&s.resize?s.resize():a.debug("renderer do not support resize"));break}}},getVideoDisplaySize:function(){function e(e){return e=parseInt(e,10),isNaN(e)&&(e=0),e}return this._videoDisplaySize.left=e(this._videoDisplaySize.left),this._videoDisplaySize.top=e(this._videoDisplaySize.top),this._videoDisplaySize.
1width=e(this._videoDisplaySize.width),this._videoDisplaySize.height=e(this._videoDisplaySize.height),this._videoDisplaySize},setVideoDisplayCompatibleSizes:function(e){a.debug("Context.setVideoDisplayCompatibleSizes",e),this._adRequest.setVideoDisplayCompatibleSizes(e)},resize:function(e,t){if(a.debug("Context.resize("+Array.prototype.slice.call(arguments).join(",")+")"),!this._temporalSlotBase)return a.warn("SlotBase is null"),null;this.setVideoDisplaySize(this._videoDisplaySize.left,this._videoDisplaySize.top,e,t,this._videoDisplaySize.position)},setProfile:function(e){a.debug("Context.setProfile",e),this._adRequest.setProfile(e)},setVideoAsset:function(e,t,i,n,r,s,o,l,d){a.debug("Context.setVideoAsset("+Array.prototype.slice.call(arguments).join(",")+")"),this._videoAsset.setVideoAsset(e,t,i,n,r,s,o,l,d),this._va_id=e,this._va_duration=t,this._va_networkId=i,this._va_location=n,this._va_autoPlayType=r,this._va_viewRandom=s,this._va_idType=o,this._va_fallbackId=l,this._va_durationType=d},setVideoAssetCurrentTimePosition:function(e){a.debug("Context.setVideoAssetCurrentTimePosition("+e+")"),this._videoAsset.setVideoAssetCurrentTimePosition(e)},setSiteSection:function(e,t,i,n,r){a.debug("Context.setSiteSection("+Array.prototype.slice.call(arguments).join(",")+")"),this._adRequest.setSiteSection(e,t,i,n,r),this._ss_id=e,this._ss_networkId=t,this._ss_pageViewRandom=i,this._ss_idType=n,this._ss_fallbackId=r},setVisitor:function(e,t){a.debug("Context.setVisitor("+Array.prototype.slice.call(arguments).join(",")+")"),this._adRequest.setVisitor(e,t)},startSubsession:function(e){a.debug("Context.startSubsession("+e+")"),this._adRequest.setSubsessionToken(e)},setRequestMode:function(e){a.debug("Context.setRequestMode("+e+")"),this._adRequest.setRequestMode(e)},setRequestDuration:function(e){a.debug("Context.setRequestDuration("+e+")"),this._adRequest.setRequestDuration(e)},addCandidateAd:function(e){a.debug("Context.addCandidateAd("+e+")"),this._adRequest.addCandidateAd(e)},addTemporalSlot:function(e,t,i,n,r,s,o,l,d,_){a.debug("Context.addTemporalSlot("+Array.prototype.slice.call(arguments).join(",")+")"),this._adRequest.addTemporalSlot(e,t,i,n,r,s,o,l,d,_)},getTemporalSlots:function(){return this._adResponse?this._adResponse._temporalSlots.slice():[]},getSlotByCustomId:function(e){return this._adResponse?this._adResponse.getSlotByCustomId(e):null},getSlotsByTimePositionClass:function(e){var t,i=[];if(this._adResponse){for(t=0;t<this._adResponse._temporalSlots.length;t++)this._adResponse._temporalSlots[t].getTimePositionClass()===e&&i.push(this._adResponse._temporalSlots[t]);for(t=0;t<this._adResponse._siteSectionNonTemporalSlots.length;t++)this._adResponse._siteSectionNonTemporalSlots[t].getTimePositionClass()===e&&i.push(this._adResponse._siteSectionNonTemporalSlots[t]);for(t=0;t<this._adResponse._videoPlayerNonTemporalSlots.length;t++)this._adResponse._videoPlayerNonTemporalSlots[t].getTimePositionClass()===e&&i.push(this._adResponse._videoPlayerNonTemporalSlots[t])}return i},_isConsentRequired:function(){var e=this.getParameter(a.PARAMETER_USE_GDPR_TCFAPI)&&!this._adManager._fwTCFAPIExecuted,t=this.getParameter(a.PARAMETER_USE_CCPA_USPAPI)&&!this._adManager._fwUSPAPIExecuted;return e||t},submitRequest:function(e){a.debug("Context.submitRequest",e);var t=0;if(!this._isConsentRequired()||this._isRefreshRequest)this._submitValidatedRequest(e);else var i=this.getParameter(a.PARAMETER_CONSENT_RETRIEVAL_TIMEOUT),n=setInterval(function(){t+=100,(!this._isConsentRequired()||t>=i)&&(clearInterval(n),this._submitValidatedRequest(e))}.bind(this),100)},_submitValidatedRequest:function(e){if(this.dispatchEvent(a.EVENT_REQUEST_INITIATED,{}),this._adManager._isListeningForTCData&&this._adManager._removeEventListenerForTCData(),this._requestState)a.warn("Context.submitRequest: request already submitted");else if(a.Util.isBlank(this._adManager._serverURL))a.warn("Context.submitRequest: serverURL is not set");else{if(this._requestState=1,this._adRequest.useTCFAPI(),this._adRequest.useUSPAPI(),this._adRequest.scanPageSlots(),this._isRefreshRequest){var t,i,n={},r=[];for(t=0;t<this._refreshSlots.length;t++){var s=this._refreshSlots[t];if(void 0!==this._adRequest._slotScanner._slots[s]){n[s]=this._adRequest._slotScanner._slots[s];var o=n[s].split("&");for(i=0;i<o.length;i++)-1!==o[i].search("flag")&&(o[i]="flag=-cmpn");n[s]=o.join("&")}for(i=0;i<this._adRequest._slotScanner._knownSlots.length;i++)this._adRequest._slotScanner._knownSlots[i].id===s&&((o=this._adRequest._slotScanner._knownSlots[i]).acceptCompanion=!1,o.initialAdOption=a.SLOT_OPTION_INITIAL_AD_STAND_ALONE,r.push(o))}this._adRequest._slotScanner._slots=n,this._adRequest._slotScanner._knownSlots=r}this.getParameter(a.PARAMETER_ENABLE_FORM_TRANSPORT)?(a.debug("Context.submitRequest: enabling Safari transport mechanism globally"),a.PLATFORM_SEND_REQUEST_BY_FORM=!0,a.PLATFORM_SEND_REQUEST_BY_JS=!1,this.setParameter(a.PARAMETER_ENABLE_JS_TRANSPORT,!1,a.PARAMETER_LEVEL_GLOBAL)):this.getParameter(a.PARAMETER_ENABLE_JS_TRANSPORT)?(a.debug("Context.submitRequest: enabling JS transport mechanism globally"),a.PLATFORM_SEND_REQUEST_BY_JS=!0,a.PLATFORM_SEND_REQUEST_BY_FORM&&a.warn("PARAMETER_ENABLE_FORM_TRANSPORT was enabled while attempting to use PARAMETER_ENABLE_JS_TRANSPORT. This will prevent PARAMETER_ENABLE_JS_TRANSPORT from working properly. Please disable PARAMETER_ENABLE_FORM_TRANSPORT before attempting to use PARAMETER_ENABLE_JS_TRANSPORT."),this.setParameter(a.PARAMETER_ENABLE_FORM_TRANSPORT,!1,a.PARAMETER_LEVEL_GLOBAL)):a.PLATFORM_SEND_REQUEST_BY_JS=!1,".js"!==(n=this._adManager._serverURL).substring(n.length-3,n.length)&&(n=this._adRequest.generateTypeBRequestUrl()),r=function(){1===this._requestState&&(a.warn("Context.submitRequest: request timeout"),this.requestComplete(null))}.bind(this),e&&"number"==typeof e&&0<e&&(a.CONTEXT_REQUEST_TIMEOUT=e),setTimeout(r,1e3*a.CONTEXT_REQUEST_TIMEOUT),a.log("Context.submitRequest: sending request to",n,"timeout",a.CONTEXT_REQUEST_TIMEOUT),a.PLATFORM_SEND_REQUEST_BY_FORM?(a.debug("Context.submitRequest:","use json2"),a.Util.pingURLWithForm(n,this._instanceId,!0),this._onMessagePosted=function(e){"object"==typeof e.data&&e.data.hasOwnProperty("cbfn")&&-1<e.data.cbfn.indexOf("['Context_"+this._instanceId+"']")&&this.requestComplete(e.data.response)}.bind(this),window.addEventListener("message",this._onMessagePosted,!1)):a.PLATFORM_SEND_REQUEST_BY_JS?a.Util.sendAdRequestWithXMLHTTPRequest
1(n):a.Util.pingURLWithScript(n)}},requestComplete:function(e){if(1!==this._requestState)a.warn("ad request complete after timeout"),this.dispatchEvent(a.EVENT_REQUEST_COMPLETE,{success:!1});else{if(this._requestState=2,a.debug("Context.requestComplete"),a.PLATFORM_SEND_REQUEST_BY_FORM){window.removeEventListener("message",this._onMessagePosted,!1);var t=document.getElementById("_fw_request_iframe_"+this._instanceId);document.body.removeChild(t)}if(null!=e){if(a._instanceQueue["Context_"+this._instanceId]=null,this._adResponse=new a.AdResponse(this),this._adResponse.parse(e,this._temporalSlotBase),a.log("Ad request succeeded"),this._adResponse._profileParameters.autoloadExtensions){t=this._adResponse._profileParameters.autoloadExtensions.split(",");for(var i=0;i<t.length;i++){var n=t[i].trim();a.log("Loading extension: "+n),this.loadExtension(n)}}for(this.dispatchEvent(a.EVENT_REQUEST_COMPLETE,{success:!0,response:e}),t=this._adResponse.getSiteSectionNonTemporalSlots(),e=0;e<t.length;++e)a.log("Auto play site section nonTemporal slots"),t[e].play();for(t=this._adResponse.getVideoPlayerNonTemporalSlots(),e=0;e<t.length;++e)a.log("Auto play video player nonTemporal slots"),t[e].play()}else a.warn("Ad request failed"),this.dispatchEvent(a.EVENT_REQUEST_COMPLETE,{success:!1})}},addEventListener:function(e,t){a.debug("Context.addEventListener",e),this._eventDispatcher.addEventListener(e,t)},removeEventListener:function(e,t){a.debug("Context.removeEventListener",e),this._eventDispatcher.removeEventListener(e,t)},dispatchEvent:function(e,t){if(a.log("Context.dispatchEvent type: "+e+", payload: "+t),e===a.EVENT_SLOT_STARTED){var i=t.slot.getTimePositionClass();i!==a.TIME_POSITION_CLASS_PREROLL&&i!==a.TIME_POSITION_CLASS_MIDROLL&&i!==a.TIME_POSITION_CLASS_POSTROLL&&i!==a.TIME_POSITION_CLASS_PAUSE_MIDROLL||(this._contentVideoAttached=!0,this._markCurrentContentPlayheadTime())}else e===a.EVENT_SLOT_ENDED&&((i=t.slot.getTimePositionClass())===a.TIME_POSITION_CLASS_PREROLL||i===a.TIME_POSITION_CLASS_MIDROLL||i===a.TIME_POSITION_CLASS_POSTROLL||i===a.TIME_POSITION_CLASS_PAUSE_MIDROLL)&&(this._contentVideoAttached=!1);(t=t||{}).type=e,t.target=this,this._eventDispatcher.dispatchEvent(t)},dispose:function(){if(a.debug("Context.dispose"),this.setVideoState(a.VIDEO_STATE_STOPPED),this._videoAsset=null,this._adResponse){if(this._temporalSlotBase||this._customPlayer)for(var e=0,t=this._adResponse._temporalSlots||[];e<t.length;++e){var i=t[e];if(i.getCurrentAdInstance()&&i.stop(),i._onContentVideoTimeUpdate&&this._temporalSlotBase){var n=this._temporalSlotBase["_fw_contentVideo_"+this._instanceId];n&&n.removeEventListener("timeupdate",i._onContentVideoTimeUpdate,!1),i._onContentVideoTimeUpdate=null}}this._customPlayer&&(this._customPlayer=null),this._temporalSlotBase&&(this.getContentVideoElement().removeEventListener("volumechange",this._onVolumeChange),this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]=null),this._isRefreshRequest=!1,this._refreshSlots=[],this._extensionManager.dispose(),this._extensionManager=null}},loadExtension:function(e){this._extensionManager.load(e,this)},_markCurrentContentPlayheadTime:function(){if(this._customPlayer)this._currentContentPlayheadTime=this._customPlayer.getPlayheadTime()||0;else if(this._temporalSlotBase){var e=this._temporalSlotBase["_fw_contentVideo_"+this._instanceId].currentTime;0<e&&(this._currentContentPlayheadTime=e)}},_getContentPlayheadTime:function(){var e=-1;return this._customPlayer?e=this._currentContentPlayheadTime:!this._contentVideoAttached&&this._temporalSlotBase&&this._temporalSlotBase["_fw_contentVideo_"+this._instanceId]&&(e=this._temporalSlotBase["_fw_contentVideo_"+this._instanceId].currentTime),0<e?e:this._currentContentPlayheadTime},_requestContentVideoToPauseBySlot:function(e){this._videoAsset.requestPauseBySlot(e)},_requestContentVideoToResumeBySlot:function(e){this._videoAsset.requestResumeBySlot(e)},_setVideoDisplaySizeByContentVideo:function(e){if(this._autoSetDisplaySizeCount===this._totalSetDisplaySizeCount){var t=e.style.left,i=e.style.top,n=e.offsetWidth?e.offsetWidth:e.style.pixelWidth,a=e.offsetHeight?e.offsetHeight:e.style.pixelHeight;e=e.style.position,this._autoSetDisplaySizeCount++,this.setVideoDisplaySize(t,i,n,a,e)}},_replacePageSlot:function(b,c){var d;a.debug("fw replace %s",b);try{var e=document.getElementById(b)?document:parent.document.getElementById(b)?parent.document:null,f=document.getElementById(b)?"window":parent.document.getElementById(b)?"parent":null}catch(t){f=e=null}if(!e)for(var g=0;g<window.frames.length;g++)try{window.frames[g].document.getElementById(b)&&(e=window.frames[g].document,f="window.frames["+g+"]")}catch(e){a.debug(e)}if(f&&(d=f+".document"),a.debug("fw replacing slot %s in frame %s",b,d),!e)throw"Slot element not found: "+b;g=e.getElementById("_fw_container_"+b),g.innerHTML=c,c=g.getElementsByTagName("script");var k=e.getElementsByTagName("head")[0];for(g=0;g<c.length;++g)if(a.PLATFORM_IS_FIREFOX||c[g].src){var h=e.createElement("script");c[g].charset&&(h.charset=c[g].charset),c[g].src&&(h.src=c[g].src),c[g].innerHTML&&(h.innerHTML=c[g].innerHTML),h.onload=h.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||k.removeChild(h)},a.debug("fw append script for %s",b),k.appendChild(h)}else h=c[g].innerHTML,h=h.replace(/var fw_scope = document;/,"var fw_scope="+d+";"),h=h.replace(/var fw_scope_window = window;/,"var fw_scope_window="+f+";"),a.debug("fw eval in %s for %s, %s",d,b,h),eval(h);a.debug("fw finish replace %s",b)}}
1,a.Context.prototype.constructor=a.Context,a.Capabilities=function(){this._capabilities={},this.init()},a.Capabilities.prototype={init:function(){for(var e=[a.CAPABILITY_SLOT_TEMPLATE,a.CAPABILITY_MULTIPLE_CREATIVE_RENDITIONS,a.CAPABILITY_FALLBACK_UNKNOWN_ASSET,a.CAPABILITY_FALLBACK_UNKNOWN_SITE_SECTION,a.CAPABILITY_FALLBACK_ADS,a.CAPABILITY_SLOT_CALLBACK,a.CAPABILITY_NULL_CREATIVE,a.CAPABILITY_AUTO_EVENT_TRACKING,a.CAPABILITY_RENDERER_MANIFEST],t=0;t<e.length;t++)this._capabilities[e[t]]=a.CAPABILITY_STATUS_ON},setCapability:function(e,t){this._capabilities[e]=t},getCapability:function(e){return this._capabilities[e]},parseCapabilities:function(e){var t,i="";for(t in this._capabilities)if(this._capabilities.hasOwnProperty(t)){switch(this._capabilities[t]){case a.CAPABILITY_STATUS_ON:i+="+"+t;break;case a.CAPABILITY_STATUS_OFF:i+="-"+t}e=e.replace(new RegExp("(%2B|-|\\+)"+t,"g"),"")}return i=encodeURIComponent(i),-1<e.indexOf("flag=")?e.replace(/flag=/,"flag="+i):e+"&flag="+i}},a.OMSDKExtension=function(){this._adSession=this._mediaEvents=this._adEvents=this._ad=this._videoElement=this._sessionClient=this._context=null,this._cachedEvents=[],this._serviceScript=null,this._serviceScriptLoaded=!1,this._sessionScript=null,this._pendingSessionStartRequest=this._sessionScriptLoaded=!1,this._onAdInitiated=this._onAdInitiated.bind(this),this._adEventListener=this._adEventListener.bind(this),this._videoDidLoad=this._videoDidLoad.bind(this),this._onRequestComplete=this._onRequestComplete.bind(this)},a.OMSDKExtension.prototype={init:function(e){a.debug("OMSDKExtension.init(context)"),this._context=e,this._context.addEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete)},_onRequestComplete:function(e){a.Util.getBooleanParameter(a.PARAMETER_EXTENSION_OMSDK_ENABLED,!1)?e.success?this._initWithScripts():a.debug("OMSDKExtension: request complete failed."):a.debug("OMSDKExtension: return since OMSDKExtension is disabled")},_initWithScripts:function(){a.debug("OMSDKExtension._initWithScripts"),this._addServiceScript(),this._addSessionScript(),this._context.addEventListener(a.EVENT_AD,this._onAdInitiated)},_addServiceScript:function(){this._serviceScript=this._addScript(a.OMSDK_SERVICE_SCRIPT_URL,"_fw_omsdk_service_script_",function(){a.debug("OMSDKExtension: on service script load"),this._serviceScriptLoaded=!0,this._checkIfAdSessionShouldStart()})},_addSessionScript:function(){this._sessionScript=this._addScript(a.OMSDK_SESSION_SCRIPT_URL,"_fw_omsdk_session_script_",function(){a.debug("OMSDKExtension: on session script load"),window.OmidSessionClient&&window.OmidSessionClient.default?(a.debug("OMSDKExtension: setting session client."),this._sessionClient=window.OmidSessionClient.default,this._sessionScriptLoaded=!0,this._checkIfAdSessionShouldStart()):(a.debug("OMSDKExtension: Error: Cannot use OMSDK because session client was null."),this.dispose())})},_addScript:function(e,t,i){a.debug("OMSDKExtension._addScript");var n=document.createElement("script");return n.type="text/javascript",n.src=e,n.id=t+this._context._instanceId,n.onload=i.bind(this),n.onerror=function(){a.debug("OMSDKExtension: Error loading script: ",e),this.dispose()}.bind(this),document.body.appendChild(n)},_checkIfAdSessionShouldStart:function(){a.debug("OMSDKExtension: _checkIfAdSessionShouldStart"),this._serviceScriptLoaded&&this._sessionScriptLoaded&&this._pendingSessionStartRequest&&this._prepareAdSession()},_onAdInitiated:function(e){if(e.subType===a.EVENT_AD_PREINIT&&e.adInstance){a.debug("OMSDKExtension_onAdInitiated");var t=(e=e.adInstance).getActiveCreativeRendition();t=e._rendererController._matchRendererClassName(t),this._isRendererSupported(t)?this._isTimePositionClassSupported(e)?(this._videoElement=this._context.getContentVideoElement(),null==this._videoElement?a.debug("OMSDKExtension: Error: Cannot use OMSDK because no video element was found"):null==e._adVerifications||0==e._adVerifications.length?a.debug("OMSDKExtension: No AdVerifications found."):(this._videoElement.addEventListener("loadeddata",this._videoDidLoad),this._context.addEventListener(a.EVENT_AD,this._adEventListener),this._ad=e,this._prepareAdSession())):a.debug("OMSDKExtension: The selected ad's slot time position class is not supported by OMSDK Web Video: "+timePositionClass):a.debug("OMSDKExtension: The selected renderer does not support OMSDK Web Video: "+t)}},_isRendererSupported:function(e){switch(a.debug("OMSDKExtension._isRendererSupported:",e),e){case h+".VideoRenderer":case h+".DashRenderer":return!0;default:return!1}},_isTimePositionClassSupported:function(e){switch(e=e.getSlot().getTimePositionClass(),a.debug("OMSDKExtension._isTimePositionClassSupported: "+e),e){case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_MIDROLL:case a.TIME_POSITION_CLASS_POSTROLL:return!0;default:return!1}},_prepareAdSession:function(){if(a.debug("OMSDKExtension._prepareAdSession"),this._serviceScriptLoaded&&this._sessionScriptLoaded){var e=this._getVerificationResourcesFromAdVerifications();0<e.length?(e=this._createOMSDKContext(e),this._createAdSession(e)):(a.debug("OMSDKExtension: No VerificationScriptResources were created."),this._cleanupAfterAdSession())}else a.debug("OMSDKExtension scripts are not loaded, cannot start ad session at this time."),this._pendingSessionStartRequest=!0},_getVerificationResourcesFromAdVerifications:function(){var e=this._ad._adVerifications;a.debug("OMSDKExtension._getVerificationResourcesFromAdVerifications",JSON.stringify(e));for(var t=[],i=0;i<e.length;i++){for(var n=0,r=e[i],s=r.javaScriptResources.concat(r.executableResources),o=0;o<s.length;o++)try{var l=s[o],d=new this._sessionClient.VerificationScriptResource(l.url,r.vendorKey,r.verificationParameters,a.OMSDK_ACCESS_MODE);t.push(d),n++}catch(e){a.debug("OMSDKExtension: An error occured while trying to create a verification script resource: "+e+(l.url,l.url))}0===n&&(a.debug("OMSDKExtension: Failed to create a verification script resource"),r.dispatchAdVerificationNotExecutedWithReason(a.VERIFICATION_RESOURCE_LOAD_ERROR))}return t},_createOMSDKContext:function(e){a.debug("OMSDKExtension._createOMSDKContext");var t=this._context._adManager.getVersion()+"";t=new this._sessionClient.Partner(a.OMSDK_PARTNER_NAME,t);var i=this._getContentURL();return(e=new this._sessionClient.Context(t,e,i)).setVideoElement(this._videoElement),e},_getContentURL:function(){var e=null;try{e=a.Util.getTopMostWindow().location.href}catch(t){e=document.referrer,a.debug("OMSDKExtension could not retrieve url from top most window. Using document referrer. Error: "+t)}return e},_createAdSession:function(e){a.debug("OMSDKExtension._createAdSession");try{var t=new this._sessionClient.AdSession(e);t.isSupported()?this._startAdSession(t):(a.debug("OMSDKExtension: Error: Cannot use OMSDK because adSession 
1was not supported."),this._cleanupAfterAdSession())}catch(e){a.debug("OMSDKExtension: Error: "+e),this._cleanupAfterAdSession()}},_startAdSession:function(e){for(e.setCreativeType(a.OMSDK_CREATIVE_TYPE_VIDEO),e.setImpressionType(a.OMSDK_IMPRESSION_TYPE_BEGIN_TO_RENDER),this._mediaEvents=new this._sessionClient.MediaEvents(e),this._adEvents=new this._sessionClient.AdEvents(e),this._adSession=e,this._adSession.start(),a.debug("OMSDKExtension: adSession.start() called");0<this._cachedEvents.length;)a.debug("Firing cached event:",this._cachedEvents[0].subType),this._onAdEvent(this._cachedEvents.shift())},_videoDidLoad:function(){a.debug("OMSDKExtension._videoDidLoad"),this._videoElement.removeEventListener("loadeddata",this._videoDidLoad),this._adEventListener({subType:"loaded"})},_adEventListener:function(e){a.debug("OMSDKExtension._adEventListener",e.subType),this._adSession?this._onAdEvent(e):this._cachedEvents.push(e)},_onAdEvent:function(e){if(a.debug("OMSDKExtension._onAdEvent:",e.subType),e&&e.subType)switch(e.subType){case"loaded":this._onVideoLoaded();break;case a.EVENT_AD_IMPRESSION:try{this._adEvents.impressionOccurred(),this._mediaEvents.start(this._ad.getDuration(),this._videoElement.volume)}catch(e){a.debug("OMSDKExtension: Error: "+e)}break;case a.EVENT_AD_FIRST_QUARTILE:this._mediaEvents.firstQuartile();break;case a.EVENT_AD_MIDPOINT:this._mediaEvents.midpoint();break;case a.EVENT_AD_THIRD_QUARTILE:this._mediaEvents.thirdQuartile();break;case a.EVENT_AD_COMPLETE:this._mediaEvents.complete();break;case a.EVENT_AD_IMPRESSION_END:this._endAdSession();break;case a.EVENT_AD_PAUSE:this._mediaEvents.pause();break;case a.EVENT_AD_RESUME:this._mediaEvents.resume();break;case a.EVENT_AD_BUFFERING_START:this._mediaEvents.bufferStart();break;case a.EVENT_AD_BUFFERING_END:this._mediaEvents.bufferFinish();break;case a.EVENT_AD_VOLUME_CHANGE:this._mediaEvents.volumeChange(this._videoElement.volume);break;case a.EVENT_AD_CLICK:this._mediaEvents.adUserInteraction("click");break;case a.EVENT_AD_SKIPPED:this._mediaEvents.skipped();break;case a.EVENT_ERROR:this._adSession.error("media",e.errorInfo||"An error occured during ad playback."),this._endAdSession()}},_onVideoLoaded:function(){a.debug("OMSDKExtension._onVideoLoaded");var e=this._ad.getSlot().getTimePositionClass().toLowerCase();e=new this._sessionClient.VastProperties(!1,0,this._context._va_autoPlayType!=a.VIDEO_ASSET_AUTO_PLAY_TYPE_CLICK_TO_PLAY&&this._context._va_autoPlayType!=a.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,e),this._adEvents.loaded(e)},_endAdSession:function(){a.debug("OMSDKExtension._endAdSession()"),this._adSession.finish(),this._cleanupAfterAdSession()},_cleanupAfterAdSession:function(){a.debug("OMSDKExtension._cleanupAfterAdSession()"),this._cachedEvents=[],this._adSession=this._ad=this._adEvents=this._mediaEvents=null,this._videoElement&&this._videoElement.removeEventListener("loadeddata",this._videoDidLoad),this._context&&this._context.removeEventListener(a.EVENT_AD,this._adEventListener)},dispose:function(){a.debug("OMSDKExtension.dispose()"),this._cleanupAfterAdSession(),this._context&&(this._context.removeEventListener(a.EVENT_REQUEST_COMPLETE,this._onRequestComplete),this._context.removeEventListener(a.EVENT_AD,this._onAdInitiated)),this._context=this._videoElement=this._sessionClient=null,this._serviceScript&&(this._serviceScript.onload=null,this._serviceScript.onerror=null),this._sessionScript&&(this._sessionScript.onload=null,this._sessionScript.onerror=null),setTimeout(function(){this._serviceScriptLoaded&&(document.body.removeChild(this._serviceScript),this._serviceScriptLoaded=!1),this._sessionScriptLoaded&&(document.body.removeChild(this._sessionScript),this._sessionScriptLoaded=!1),this._sessionScript=this._serviceScript=null}.bind(this),3e3)}},a.OMSDKExtension.prototype.constructor=a.OMSDKExtension,a.VideoAsset=function(e){this._defaultTimeouts=[5,10,15,30,60,120,180,300],this._context=e,this._internalState=a.MediaInitState.instance,this._eventCallback=this._state="",this._callbackTimer=null,this._requestedVideoViewUrl=this._videoPlayPending=!1,this._dummyInstanceId="",this._delay=0,this._location=this._networkId=this._duration=this._customId=this._id="",this._autoPlayType=null,this._fallbackId="",this._viewRandom=0,this._durationType=null,this._currentTpos=0},a.VideoAsset.prototype={setVideoAsset:function(e,t,i,n,r,s,o,l,d){if(e){switch(o){case a.ID_TYPE_FW:o=this._id!==e,this._id=e;break;case a.ID_TYPE_GROUP:o=this._id!=="g"+e,this._id="g"+e;break;default:o=this._customId!==e,this._customId=e}o&&(this._eventCallback=""),"number"==typeof t&&(this._duration=Math.round(10*t)/10),0<1*i&&(this._networkId=1*i),"string"==typeof n&&(this._location=n),"number"==typeof r&&(this._autoPlayType=r),0<1*s&&(this._viewRandom=1*s),"number"==typeof l&&0<l?this._fallbackId=""+l:"string"==typeof l&&(this._fallbackId=l.trim()),d!==a.VIDEO_ASSET_DURATION_TYPE_EXACT&&d!==a.VIDEO_ASSET_DURATION_TYPE_VARIABLE||(this._durationType=d),this._videoPlayPending&&this.play()}else a.warn("AdRequest.setVideoAsset","id is required.")},setVideoAssetCurrentTimePosition:function(e){!e||0>e?a.warn("AdRequest.setVideoAssetCurrentTimePosition","valid timePosition is required"):this._currentTpos=e},setVideoState:function(e){e===a.VIDEO_STATE_PLAYING?(this._state===a.VIDEO_STATE_PAUSED&&this._context.dispatchEvent(a.EVENT_CONTENT_VIDEO_RESUMED),this.play()):e===a.VIDEO_STATE_PAUSED||e===a.VIDEO_STATE_STOPPED?(this.pause(),e===a.VIDEO_STATE_PAUSED&&this._state===a.VIDEO_STATE_PLAYING&&this._context.dispatchEvent(a.EVENT_CONTENT_VIDEO_PAUSED)):e===a.VIDEO_STATE_COMPLETED&&this.complete(),this._state=e},callback:function(e){this._eventCallback?this._eventCallback.process():e=!0,e||((e=this._defaultTimeouts.shift())||(e=300),this._callbackTimer=new a.Timer(e,a.Util.bind(this,this.callback)),this._callbackTimer.start())},getPlayheadTime:function(){var e=this._delay;return this._delay=0,e+=this._callbackTimer?this._callbackTimer.getCTValue():0,Math.floor(e)},play:function(){this._context._adManager._serverURL&&this._context._adManager._networkId&&(this._id||this._customId)?this._eventCallback?(this._videoPlayPending=!1,this._internalState.play(this)):this._requestedVideoViewUrl||(this._requestedVideoViewUrl=!0,this.requestForVideoViewCallback(),this._callbackTimer||(this._callbackTimer=new a.Timer,this._callbackTimer.tick())):(a.warn("Server URL or Network ID or Video Asset id/customId is not set, delay video asset state change until these are provided."),this._videoPlayPending=!0,this._callbackTimer||(this._callbackTimer=new a.Timer,this._callbackTimer.tick()))},pause:function(){this._internalState.pause(this)},complete:function(){this._internalState.complete(this)},onStartPlaying:function(){this.callback()},onStartReplaying:function(){this.callback()},onPausePlaying:function(){this.callback(!0),this._callbackTimer.pause()},onResumePlaying:function(){this._callbackTimer.start()},onCompletePlaying:function(){this.callback(!0),this._callbackTimer.stop(),this._callbackTimer=null,this._eventCallback="",this._requestedVideoViewUrl=!1},onCompleteReplaying:function(){this.onCompletePlaying()},setMediaState:function(e){this._internalState=e},requestPauseBySlot:function(e){a.debug("requestPauseBySlot"),this._internalState===a.MediaPlayingState.instance||this._internalState===a.MediaReplayingState.instance?this._context.dispatchEvent(a.EVENT_CONTENT_VIDEO_PAUSE_REQUEST,{slot:e}):a.debug("Not sending content pause request because content video state is",JSON.stringify(this._internalState))},requestResumeBySlot:function(e){a.debug("requestResumeBySlot"),this._internalState===a.MediaPausedState.instance||this._internalState===a.MediaReplayPausedState.instance?this._context.dispatchEvent(a.EVENT_CONTENT_VIDEO_RESUME_REQUEST,{slot:e}):a.debug("Not sending content resume request because content video state is ",JSON.stringify(this._internalState))},requestForVideoViewCallback:function(){var e=new a.Context(this._context._adManager);e._videoAsset=this,this._dummyInstanceId=e._instanceId,e=this._context._adRequest.generateVideoViewRequestUrlWithDummyContextInstanceId(e._instanceId);var t=this;a.PLATFORM_SEND_REQUEST_BY_FORM?(a.debug("Context.submitRequest:","use json2"),a.Util.pingURLWithForm(e,this._dummyInstanceId,!0),t._onMessagePosted=function(e){"object"==typeof e.data&&e.data.hasOwnProperty("cbfn")&&-1<e.data.cbfn.indexOf("['Context_"+this._dummyInstanceId+"']")&&t.requestComplete(e.data.response)},window.addEventListener("message",t._onMessagePosted,!1)):a.PLATFORM_SEND_REQUEST_BY_JS?a.Util.pingURLWithXMLHTTPRequest
1(e):a.Util.pingURLWithScript(e)},requestComplete:function(e){if(this._delay=this._callbackTimer.tick(),this._callbackTimer=null,a.PLATFORM_SEND_REQUEST_BY_FORM){window.removeEventListener("message",this._onMessagePosted,!1);var t=document.getElementById("_fw_request_iframe_"+this._dummyInstanceId);document.body.removeChild(t)}null!=e?(a._instanceQueue["Context_"+this._dummyInstanceId]=null,this.parse(a.Util.getObject("siteSection.videoPlayer.videoAsset",e)||{}),this.play()):a.warn("Failed to get video view callback url.")},parse:function(e){if(e){this._customId=e.customId,this._networkId=parseInt(e.networkId);for(var t=0,i=e.eventCallbacks||[];t<i.length;t++){e=i[t];var n=a.EventCallback.newEventCallback(this._context,e.name,e.type);if(n&&e.name===a.EVENT_VIDEO_VIEW){n.parse(e),this._eventCallback=n,a.debug("Parsed video view url: "+this._eventCallback._url);break}}}}},a.NullRenderer=function(){this._rendererController=null},a.NullRenderer.prototype={start:function(e){this._rendererController=e,this._rendererController.setCapability(a.EVENT_AD_CLICK,a.CAPABILITY_STATUS_OFF),this._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED),this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED)},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){return-1},getDuration:function(){return-1}},a.NullRenderer.prototype.constructor=a.NullRenderer,a.VPAIDWrapper=function(){this._creative=null,this._timeoutInMs=0,this._eventHandlers={},this._timeoutTimer=null,this._timeoutOperation="",this.timeoutReached=!1,this._visibilityChangeListener=null,this._creativePausedByTabSwitch=!1,this._autoPauseAdOnVisibilityChange=!0,this._loadIntervalTimer=null,this._isCORSEnforcementDisabled=!0},a.VPAIDWrapper.prototype={_isCreativeFunctionInvokable:function(e){return!!this._creative&&(e=this._creative[e])&&"function"==typeof e},checkVPAIDInterface:function(e){for(var t={passed:!0,missingInterfaces:""},i=e.length-1;0<=i;i--)this._isCreativeFunctionInvokable(e[i])||(t.passed=!1,t.missingInterfaces+=e[i]+" ");return t},loadCreativeAsset:function(e){a.log("loadCreativeAsset("+e+")");var t=document.getElementById("vpaidFrame"),i=document.createElement("iframe");if(i.id="vpaidFrame",null==t?document.body.appendChild(i):document.body.replaceChild(i,t),i.width=0,i.height=0,i.style.display="none",i.contentWindow.document.open(),this._isCORSEnforcementDisabled){a.log("CORS Enforcement Disabled"),setTimeout(function(){i.contentWindow.document.write('
1<script type="text/javascript" src="'+e+'"> <\/script>'),i.contentWindow.document.close()},0),this._timeoutOperation="loadCreativeAsset",this._waitForTimeout();var n=this;this._loadIntervalTimer=setInterval(function(){var e=document.getElementById("vpaidFrame").contentWindow.getVPAIDAd;e&&"function"==typeof e&&(clearInterval(n._loadIntervalTimer),void 0===(e=e())?a.debug("getVPAIDAd() returns undefined value"):null==e?a.debug("getVPAIDAd() returns null"):(n._creative=e,n._eventHandlers.CreativeAssetLoaded()))},200)}else{i.contentWindow.document.close(),this._timeoutOperation="loadCreativeAsset",n=this;var r=new XMLHttpRequest;r.open("GET",e),r.timeout=n._timeoutInMs,r.onreadystatechange=function(){if(4==r.readyState)if(200===r.status)try{i.contentWindow.eval(r.responseText);var t=i.contentWindow.getVPAIDAd;if(!t||"function"!=typeof t)throw"getVPAIDAd() funtion does not exist";var s=t();if(void 0===s)throw"getVPAIDAd() returns undefined value";if(null==s)throw"getVPAIDAd() returns null";n._creative=s,n._eventHandlers.CreativeAssetLoaded()}catch(e){a.warn(e),n._eventHandlers.loaderror(a.ERROR_3P_COMPONENT,"Creative is not VPAID: "+e)}else 400<=r.status&&n._eventHandlers.loaderror(a.ERROR_IO,"creativeUrl="+e+"; status code="+r.status+"; status text="+r.statusText)},r.ontimeout=function(){n._eventHandlers.timeout.call()},r.onerror=function(){0===r.status?(a.warn("CORS error"),n._eventHandlers.loaderror(a.ERROR_SECURITY,"creativeUrl="+e+";cors error")):(a.warn("exception:"+r.statusText),n._eventHandlers.loaderror(a.ERROR_IO,"creativeUrl="+e+";exception="+r.statusText))},r.send()}},setCallbacksForCreative:function(e,t){for(var i in e)e.hasOwnProperty(i)&&this._creative.subscribe(e[i],i,t)},removeCallbacksForCreative:function(e){for(var t in e)e.hasOwnProperty(t)&&this._creative.unsubscribe(e[t],t)},handshakeVersion:function(e){return a.log("VPAID Creative: handshakeVersion("+e+")"),this._creative.handshakeVersion(e)},initAd:function(e,t,i,n,r,s){a.log("VPAID Creative: initAd()"),this._timeoutOperation="initAd",this._waitForTimeout(),this._creative.initAd(e,t,i,n,r,s)},startAd:function(){a.log("VPAID Creative: startAd()"),this._timeoutOperation="startAd",this._waitForTimeout(),this._creative.startAd(),document.hidden&&this._autoPauseAdOnVisibilityChange&&(a.log("VPAIDRenderer pause ad when tab is invisible"),this._creative.pauseAd(),this._creativePausedByTabSwitch=!0)},stopAd:function(){a.log("VPAID Creative: stopAd()"),"loadCreativeAsset"===this._timeoutOperation?(clearInterval(this._loadIntervalTimer),this._timeoutOperation="loadCreativeAsset and stopAd"):"startAd"===this._timeoutOperation?(clearTimeout(this._timeoutTimer),this._timeoutOperation="startAd and stopAd"):this._timeoutOperation+="stopAd",this._creative&&(this._waitForTimeout(),this._creative.stopAd())},isCreativeSkippable:function(){return this._isCreativeFunctionInvokable("skipAd")&&this._isCreativeFunctionInvokable("getAdSkippableState")},getAdSkippableState:function(){return this._isCreativeFunctionInvokable("getAdSkippableState")&&this._creative.getAdSkippableState()},skipAd:function(){a.log("VPAID Creative: skipAd()"),this._creative.skipAd()},canPauseAd:function(){return this._isCreativeFunctionInvokable("pauseAd")},canResumeAd:function(){return this._isCreativeFunctionInvokable("resumeAd")},canResizeAd:function(){return this._isCreativeFunctionInvokable("resizeAd")},pauseAd:function(){this.canPauseAd()&&(a.log("VPAID Creative: pauseAd()"),this._creative.pauseAd())},resumeAd:function(){this.canResumeAd()&&(a.log("VPAID Creative: resumeAd()"),this._creative.resumeAd())},resizeAd:function(e,t,i){this.canResizeAd()?(a.log("VPAID Creative: resizeAd()"),this._creative.resizeAd(e,t,i)):a.log("The creative is not able to resize")},getAdVolume:function(){return this._isCreativeFunctionInvokable("getAdVolume")?this._creative.getAdVolume():-1},setAdVolume:function(e){this._isCreativeFunctionInvokable("setAdVolume")&&this._creative.setAdVolume(e)},getAdExpanded:function(){return!!this._isCreativeFunctionInvokable("getAdExpanded")&&this._creative.getAdExpanded()},getAdRemainingTime:function(){return this._isCreativeFunctionInvokable("getAdRemainingTime")?this._creative.getAdRemainingTime():-1},getAdDuration:function(){return this._isCreativeFunctionInvokable("getAdDuration")?this._creative.getAdDuration():-1},getAdLinear:function(){return this._creative.getAdLinear()},getAdCompanions:function(){return this._isCreativeFunctionInvokable("getAdCompanions")?this._creative.getAdCompanions():""},setTimeoutValueInMs:function(e){this._timeoutInMs=e},cancelTimeoutEvent:function(){a.log("cancelTimeoutEvent");var e="startAd and stopAd"!==this._timeoutOperation;if(clearTimeout(this._timeoutTimer),!e){this._timeoutOperation="startAd";var t=this;setTimeout(function(){t._eventHandlers&&t._eventHandlers.timeout&&t._eventHandlers.timeout.call()},500)}},addEventListener:function(e,t){this._eventHandlers[e]=t},removeEventListener:function(e){this._eventHandlers[e]=null},_waitForTimeout:function(){if(a.log("Wait for "+this._timeoutOperation+" for "+this._timeoutInMs+"ms"),this._eventHandlers.timeout){var e=this;this._timeoutTimer=setTimeout(function(){e.timeoutReached||(e.timeoutReached=!0),"startAd"===e._timeoutOperation?e.stopAd():("loadCreativeAsset"===e._timeoutOperation&&clearInterval(e._loadIntervalTimer),e._eventHandlers&&e._eventHandlers.timeout&&e._eventHandlers.timeout.call())},this._timeoutInMs)}},getTimeoutOperation:function(){return this._timeoutOperation}},a.VPAIDWrapper.prototype.constructor=a.VPAIDWrapper,a.VPAIDRenderer=function(){this._rendererController=null,this._isCORSEnforcementDisabled=!0,this.vpaidCreative=null,this.vpaidVolume=this.vpaidDuration=-1,this.creativeEventCallbacks={},this.isMuted=!1,this.adPlaybackState="",this.creativeTimeoutDelayInMs=1e4,this.vpaidDesiredBitrate=268,this.vpaidViewmode="normal",this.playheadTime=0,this.videoBase=
1document.createElement("div"),this.videoParent=null,this.SUPPORTED_CREATIVE_VPAID_VERSION_MIN=this.PLAYER_VPAID_VERSION=2},a.VPAIDRenderer.prototype={},a.VPAIDRenderer.prototype.constructor=a.VPAIDRenderer,a.VPAIDRenderer.VastCompanion=function(e,t,i,n){this._width=e,this._height=t,this._apiFramework=i,this._xmlNode=n},a.VPAIDRenderer.VastCompanion.prototype={getWidth:function(){return this._width},getHeight:function(){return this._height},_isValidResource:function(e,t){return"StaticResource"===e&&t["@attributes"].creativeType||"IFrameResource"===e&&t.value||"HTMLResource"===e&&t.value},hasValidRendtions:function(){for(var e in this._xmlNode)if(this._xmlNode.hasOwnProperty(e)&&("StaticResource"===e||"IFrameResource"===e||"HTMLResource"===e))for(var t=[].concat(this._xmlNode[e]),i=t.length-1;0<=i;i--)if(this._isValidResource(e,t[i]))return!0;return!1},translateToAdInstance:function(e){var t;if(this._xmlNode.CompanionClickThrough&&e.setClickThroughUrl(a.EVENT_AD_CLICK,this._xmlNode.CompanionClickThrough.value),this._xmlNode.TrackingEvents){var i=this._xmlNode.TrackingEvents;if(i.Tracking){var n=[];for(t=(i=[].concat(i.Tracking)).length-1;0<=t;t--)"creativeView"===i[t]["@attributes"].event&&n.push(i[t].value);0<n.length&&e.addEventCallbackUrls(a.EVENT_AD_IMPRESSION,a.EVENT_TYPE_IMPRESSION,n)}}for(var r in this._xmlNode)if(this._xmlNode.hasOwnProperty(r)&&("StaticResource"===r||"IFrameResource"===r||"HTMLResource"===r))for(t=(i=[].concat(this._xmlNode[r])).length-1;0<=t;t--)if(this._isValidResource(r,i[t])){n=i[t];var s=e.addCreativeRendition();s.setWidth(this._width),s.setHeight(this._height),s.setCreativeApi("None");var o=s.addCreativeRenditionAsset("VPAIDAsset"+t,!0);o.setContentType("text/html_doc_lit_mobile"),o.setMimeType("text/html");var l,d=e.getEventCallbackUrls(a.EVENT_AD_CLICK,a.EVENT_TYPE_CLICK)[0],_=r;"HTMLResource"===_?o.setContent(a.HTMLAdGenerator.wrapUnsafeHTML(n.value,e.getSlot().getCustomId(),this._width,this._height)):("IFrameResource"===_?l="iframe":"StaticResource"===_&&(l=this._xmlNode.creativeType),o.setContent(a.HTMLAdGenerator.generateAd(n.value,d,e.getSlot().getCustomId(),this._width,this._height,l,o.getContentType()))),a.debug("rendtion width: "+s.getWidth()+" height:"+s.getHeight()+" asset content:"+o.getContent())}}},a.VPAIDRenderer.VastCompanion.prototype.constructor=a.VPAIDRenderer.VastCompanion,a.VPAIDRenderer.VastAdSelect=function(){},a.VPAIDRenderer.VastAdSelect.prototype={_getDeadSpaceRatio:function(e,t){var i=e.getWidth();e=e.getHeight();var n=t.getWidth();t=t.getHeight();var r=1;return i<=n&&e<=t&&(r=1-i*e/(n*t)),a.debug("computing dead space ratio ("+r+") for slot "+n+"x"+t+" and ad "+i+"x"+e),r},matchAdsWithSlots:function(e,t){var i;for(a.log("VPAIDRenderer: Matching ads with slots"),i=0;i<t.length;++i)t[i].matched=!1;var n=[],r=[];for(i=0;i<e.length;i++)for(var s=0;s<t.length;s++)r.push({ratio:this._getDeadSpaceRatio(e[i],t[s]),adIndex:i,slotIndex:s});for(r.sort(function(e,t){return e.ratio-t.ratio}),i=0;i<r.length&&1!==r[i].ratio;i++){var o=e[(s=r[i]).adIndex],l=t[s.slotIndex];o.matched||l.matched||(a.log("Winning ratio:"+s.ratio+" Winning ad:"+o.getWidth()+"x"+o.getHeight()+" for slot:"+l.getWidth()+"x"+l.getHeight()),n.push({ad:o,slot:l}),o.matched=!0,l.matched=!0)}return n}},a.VPAIDRenderer.VastAdSelect.prototype.constructor=a.VPAIDRenderer.VastAdSelect,a.Util.mixin(a.VPAIDRenderer.prototype,{_initParams:function(){var e=this._rendererController.getParameter(a.PARAMETER_VPAID_CREATIVE_TIMEOUT_DELAY);this._isCORSEnforcementDisabled=this._rendererController.getParameter(a.PARAMETER_DISABLE_CORS_ENFORCEMENT),e&&0<Number(e)&&(this.creativeTimeoutDelayInMs=Number(e)),a.log("initParams(), creative timeout delay in miliseconds:"+this.creativeTimeoutDelayInMs),e=parseFloat(this._rendererController.getParameter(a.PARAMETER_DESIRED_BITRATE)),this.vpaidDesiredBitrate=0<e?e:this.vpaidDesiredBitrate,a.log("initParams(), desired bitrate: "+this.vpaidDesiredBitrate)},_failWithError:function(e,t,i){var n={};n[a.INFO_KEY_ERROR_MODULE]="VPAIDRenderer",n[a.INFO_KEY_ERROR_CODE]=e,i||(i=a.ERROR_VAST_GENERAL_VPAID_ERROR),n[a.INFO_KEY_VAST_ERROR_CODE]=i,t&&(n[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.RENDERER_STATE_FAILED,n),this.dispose()},onCreativeLoadError:function(e,t){a.log("VPAIDRenderer: onCreativeLoadError()"),this.vpaidCreative.cancelTimeoutEvent(),this._failWithError(e,t)},onCreativeTimeout:function(){a.log("VPAIDRenderer: onCreativeTimeout()");var e=this.vpaidCreative.getTimeoutOperation();this._failWithError(a.ERROR_TIMEOUT,"loadCreativeAsset"!==e?"Creative function "+e+" timeout":"load creative asset timeout")},setVolume:function(e){a.log("VPAIDRenderer: setVolume("+e+")"),this.vpaidCreative&&this.vpaidCreative.setAdVolume(e)},onAdVolumeChange:function(){a.log("VPAIDRenderer: onAdVolumeChange()");var e=this.vpaidCreative.getAdVolume();0>e||1<e?a.log("Invalid ad volume value"):(this.isMuted&&2<100*e?(this.isMuted=!1,this._rendererController.processEvent({name:a.EVENT_AD_UNMUTE}
1)):!this.isMuted&&2>100*e&&(this.isMuted=!0,this._rendererController.processEvent({name:a.EVENT_AD_MUTE})),this._rendererController.processEvent({name:a.EVENT_AD_VOLUME_CHANGE}))},onAdExpandedChange:function(){a.log("VPAIDRenderer: onAdExpandedChange()"),this.vpaidCreative.getAdExpanded()?this._rendererController.processEvent({name:a.EVENT_AD_EXPAND}):this._rendererController.processEvent({name:a.EVENT_AD_COLLAPSE})},onAdDurationChange:function(){a.log("VPAIDRenderer: onAdDurationChange(): duration changed to "+this.vpaidCreative.getAdDuration())},onAdClickThru:function(e,t,i){a.log("VPAIDRenderer: onAdClickThru() with url:"+e+" id:"+t+" playerHandles:"+i),(t={name:a.EVENT_AD_CLICK,info:{}}).info[a.INFO_KEY_SHOW_BROWSER]=!0===i,!0===i?e?(a.log("onAdClickThru(): open window with overrided url"),t.info[a.INFO_KEY_URL]=e):a.log("onAdClickThru(): open window with url booked in MRM UI or VAST clickthru url"):a.log("onAdClickThru(): send click tracking"),this._rendererController.processEvent(t)},onCreativeAssetLoaded:function(){a.log("VPAIDRenderer: onCreativeAssetLoaded()"),this.vpaidCreative.cancelTimeoutEvent();var e=this,t=function(){var t=e.vpaidCreative.handshakeVersion(e.PLAYER_VPAID_VERSION.toFixed(1));return t?!(parseFloat(t)<e.SUPPORTED_CREATIVE_VPAID_VERSION_MIN&&(e._failWithError(a.ERROR_INVALID_VALUE,"Only support creatives with VPAID version >= "+e.SUPPORTED_CREATIVE_VPAID_VERSION_MIN.toFixed(1)),1)):(e._failWithError(a.ERROR_3P_COMPONENT,"Cannot get VPAID version from the creative"),!1)};if(function(){var t=e.vpaidCreative.checkVPAIDInterface("handshakeVersion initAd startAd stopAd subscribe unsubscribe getAdLinear".split(" "));return t.passed||e._failWithError(a.ERROR_3P_COMPONENT,"Missing interfaces in the VPAID creative: "+t.missingInterfaces),t.passed}()&&t()){e.creativeEventCallbacks={AdStarted:e.onAdStarted,AdStopped:e.onAdStopped,AdSkipped:e.onAdSkipped,AdLoaded:e.onAdLoaded,AdLinearChange:e.onAdLinearChange,AdSizeChange:e.onAdSizeChange,AdExpandedChange:e.onAdExpandedChange,AdDurationChange:e.onAdDurationChange,AdVolumeChange:e.onAdVolumeChange,AdImpression:e.onAdImpression,AdClickThru:e.onAdClickThru,AdSkippableStateChange:e.onAdSkippableStateChange,AdVideoFirstQuartile:e.onAdVideoFirstQuartile,AdVideoMidpoint:e.onAdVideoMidpoint,AdVideoThirdQuartile:e.onAdVideoThirdQuartile,AdVideoComplete:e.onAdVideoComplete,AdUserAcceptInvitation:e.onAdUserAcceptInvitation,AdUserMinimize:e.onAdUserMinimize,AdUserClose:e.onAdUserClose,AdPaused:e.onAdPaused,AdPlaying:e.onAdResumed,AdError:e.onAdError,AdLog:e.onAdLog},e.vpaidCreative.setCallbacksForCreative(e.creativeEventCallbacks,e),this._rendererController.setCapability(a.EVENT_AD_QUARTILE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_MUTE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_EXPAND,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_PAUSE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_CLOSE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_MINIMIZE,a.CAPABILITY_STATUS_ON),this._rendererController.setCapability(a.EVENT_AD_ACCEPT_INVITATION,a.CAPABILITY_STATUS_ON),(t=this.rendition?this.rendition.getParameter("creativeData"):null)||(t=this.rendition?this.rendition.getParameter("VPAID_creativeData"):null),t&&(t=a.Util.trim(t)),t={AdParameters:t};var i=this._rendererController.getAdInstance().getSlot();this.videoBase.style.width="0px",this.videoBase.style.height="0px",this.videoBase.style.zIndex="100000",this.videoBase.style.position="absolute",this.videoBase.style.left=this._rendererController.getContentVideoElement().style.left,this.videoBase.style.top=this._rendererController.getContentVideoElement().style.top,this.videoBase.className="fw_vpaid_slot",this.videoParent=i.getBase();var n=this._rendererController.getContentVideoElement();if("nodeType"in n&&0<n.nodeType)try{this.videoParent.insertBefore(this.videoBase,this._rendererController.getContentVideoElement())}catch(e){this.videoParent.insertBefore(this.videoBase,this.videoParent.firstChild)}else this.videoParent.insertBefore(this.videoBase,this.videoParent.firstChild);n={slot:this.videoBase,videoSlot:this._rendererController.getContentVideoElement(),videoSlotCanAutoPlay:!0};var r=i.getWidth();i=i.getHeight(),r&&i||!this.rendition||(r=this.rendition.getWidth(),i=this.rendition.getHeight()),this.vpaidCreative.initAd(r,i,this.vpaidViewmode,this.vpaidDesiredBitrate,t,n)}},onAdLoaded:function(){a.log("VPAIDRenderer: onAdLoaded()"),this.vpaidCreative.cancelTimeoutEvent(),a.log("Ad duration:"+this.getDuration());var e=this,t=function(t,i){var n=i;if(a.debug(n.length+" companion slots to fill."),0!==n.length&&0!==t.length){var r=(new a.VPAIDRenderer.VastAdSelect).matchAdsWithSlots(t,n);if(0!==r.length){for(t=[],n=[],i=r.length-1;0<=i;i--)t.push(r[i].ad),n.push(r[i].slot);for(i=(n=e._rendererController.scheduleAdInstances(n)).length-1;0<=i;i--)t[i].translateToAdInstance(n[i])}}},i=function(e){if(!e)return a.log("The adCompanions property is empty."),null;if(a.log("parsing adCompanions: "+e),window.DOMParser)var t=(new DOMParser).parseFromString(e,"text/xml");
1else(t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e);if(!(e=a.Util.xmlToJson(t))||!e.CompanionAds||!e.CompanionAds.Companion)return a.log("No companion ads found in parsed xml"),[];t=[];for(var i=(e=[].concat(e.CompanionAds.Companion)).length-1;0<=i;i--){var n=e[i];if(n["@attributes"]){var r=n["@attributes"].width,s=n["@attributes"].height;if(!r||!s||0>r||0>s)a.log("Missing width/height for companion.");else{var o=n["@attributes"].apiFramework||"";a.debug("Companion "+r+"x"+s+" api:"+o),(n=new a.VPAIDRenderer.VastCompanion(r,s,o,n)).hasValidRendtions()&&t.push(n)}}}return t}(e.vpaidCreative.getAdCompanions());i&&0<i.length?t(i,this._rendererController.getCompanionSlots()):a.log("VPAIDAdRenderer: No companions from VPAID creative."),t=this._rendererController.getAdInstance()._context.getAdVolume(),!this.isMuted&&2>100*t&&(this.isMuted=!0),this.setVolume(t),this.vpaidCreative.startAd()},onVisibilityChange:function(){a.log("onVisibilityChange:"+(document.hidden?"invisible":"visible")),a.log("Current playback state:"+this.adPlaybackState),document.hidden&&"playing"===this.adPlaybackState?(a.log("Pause the VPAID creative"),this.vpaidCreative.pauseAd(),this.vpaidCreative._creativePausedByTabSwitch=!0):!document.hidden&&"paused"===this.adPlaybackState&&this.vpaidCreative._creativePausedByTabSwitch&&(a.log("Resume the VPAID creative"),this.vpaidCreative.resumeAd(),this.vpaidCreative._creativePausedByTabSwitch=!1)},onAdStarted:function(){a.log("VPAIDRenderer: onAdStarted()"),this.vpaidCreative.timeoutReached?a.log("VPAID ad has already failed due to timeout. The AdStarted event will not be handled."):(this.vpaidCreative.cancelTimeoutEvent(),this.vpaidCreative._autoPauseAdOnVisibilityChange&&(this._visibilityChangeListener=this.onVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._visibilityChangeListener,!1)))},onAdStopped:function(){a.log("VPAIDRenderer: onAdStopped()"),this.vpaidCreative?(this.vpaidCreative.cancelTimeoutEvent(),this.timePositionClass===a.TIME_POSITION_CLASS_OVERLAY&&this.vpaidCreative.getAdLinear()&&this._rendererController.requestContentStateChange(!1),this.vpaidCreative&&!this.vpaidCreative.timeoutReached&&(this.adPlaybackState?(this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED),this.dispose()):(a.warn("Expecting AdStarted and AdImpression events but got AdStopped event instead. Fail."),this._failWithError(a.ERROR_3P_COMPONENT,"Expecting AdStarted and AdImpression events from the VPAID creative but got AdStopped event instead")))):a.log("The VPAID creative has been disposed. Return.")},onAdImpression:function(){if(a.log("VPAIDRenderer: onAdImpression()"),this.vpaidCreative.timeoutReached)a.log("VPAID ad has already failed due to timeout. The AdImpression event will not be handled.");else{var e=this.vpaidCreative.getAdVolume();this.isMuted=0<e&&2>=100*e,this.adPlaybackState="playing",this._rendererController.handleStateTransition(a.RENDERER_STATE_STARTED)}},onAdLinearChange:function(){a.log("VPAIDRenderer: onAdLinearChange()");var e=this.vpaidCreative.getAdLinear();e?a.log("onAdLinearChange(): non-linear click to linear -> request content video to pause"):a.log("onAdLinearChange(): linear back to non-linear -> request content video to resume"),this._rendererController.requestContentStateChange(e)},onAdSizeChange:function(){a.log("VPAIDRenderer: onAdSizeChange()")},onAdPaused:function(){a.log("VPAIDRenderer: onAdPaused()"),"playing"===this.adPlaybackState&&this._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),this.adPlaybackState="paused"},onAdResumed:function(){a.log("VPAIDRenderer: onAdResumed()"),"paused"===this.adPlaybackState&&this._rendererController.processEvent({name:a.EVENT_AD_RESUME}),this.adPlaybackState="playing"},attemptSkip:function(){a.log("VPAIDRenderer: attemptSkip()"),this.vpaidCreative.isCreativeSkippable()?this.vpaidCreative.getAdSkippableState()?this.vpaidCreative.skipAd():(a.log("VPAIDRenderer: creative adSkippableState is false, adding SkippableStateChange listener"),this._isAttemptSkipCalled=!0):(a.log("VPAIDRenderer: creative does not have skip functionality, calling rendererController.stop()"),this._rendererController.getAdInstance()._processSkipEvent(),this._rendererController.stop(),this.adPlaybackState||this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED))},onAdSkippableStateChange:function(){a.log("VPAIDRenderer: onAdSkippableStateChange()"),this.vpaidCreative.getAdSkippableState()&&this._isAttemptSkipCalled?(this._isAttemptSkipCalled=!1,this.vpaidCreative.skipAd()):a.log("VPAIDRenderer: creative adSkippableState is false, unable to skip"),this._rendererController.processEvent({name:a.EVENT_AD_SKIPPABLE_STATE_CHANGED})},onAdSkipped:function(){a.log("VPAIDRenderer: onAdSkipped()"),this._rendererController.getAdInstance()._processSkipEvent(),this.dispose(),this._rendererController.handleStateTransition(a.RENDERER_STATE_COMPLETED)},onAdVideoFirstQuartile:function(){a.log("VPAIDRenderer: onAdVideoFirstQuartile()"),this._rendererController.processEvent({name:a.EVENT_AD_FIRST_QUARTILE})},onAdVideoMidpoint:function(){a.log("VPAIDRenderer: onAdVideoMidpoint()"),this._rendererController.processEvent({name:a.EVENT_AD_MIDPOINT})},onAdVideoThirdQuartile:function(){a.log("VPAIDRenderer: onAdVideoThirdQuartile()"),this._rendererController.processEvent({name:a.EVENT_AD_THIRD_QUARTILE})},onAdVideoComplete:function(){a.log("VPAIDRenderer: onAdVideoComplete"),this._rendererController.processEvent({name:a.EVENT_AD_COMPLETE})},onAdUserAcceptInvitation:function(){a.log("VPAIDRenderer: onAdUserAcceptInvitation()"),this._rendererController.processEvent({name:a.EVENT_AD_ACCEPT_INVITATION})},onAdUserClose:function(){a.log("VPAIDRenderer: onAdUserClose()"),this._rendererController.processEvent({name:a.EVENT_AD_CLOSE})},onAdUserMinimize:function(){a.log("VPAIDRenderer: onAdUserMinimize()"),this._rendererController.processEvent({name:a.EVENT_AD_MINIMIZE})},onAdLog:function(e){a.log("VPAIDRenderer: onAdLog: "+e)},onAdError:function(e){a.log("VPAIDRenderer: onAdError(): "+e),this._failWithError(a.ERROR_3P_COMPONENT,"AdError event:"+e)},start:function(e){if(a.log("VPAIDRenderer start()"),this._rendererController=e,this._isAttemptSkipCalled=!1,this.timePositionClass=this._rendererController.getAdInstance().getSlot().getTimePositionClass(),this.rendition=this._rendererController.getAdInstance().getActiveCreativeRendition(),this._initParams(),e=(e=this.rendition?this.rendition.getPrimaryCreativeRenditionAsset():null)?e.getProxiedUrl():null){this.vpaidCreative=new a.VPAIDWrapper,this.vpaidCreative._autoPauseAdOnVisibilityChange=this._rendererController.getParameter(a.PARAMETER_AUTO_PAUSE_AD_ONVISIBILITYCHANGE),this.vpaidCreative._isCORSEnforcementDisabled=this._isCORSEnforcementDisabled,this.vpaidCreative.setTimeoutValueInMs(this.creativeTimeoutDelayInMs),this.vpaidCreative.addEventListener("loaderror",this.onCreativeLoadError.bind(this)),this.vpaidCreative.addEventListener("timeout",this.onCreativeTimeout.bind(this)),this.vpaidCreative.addEventListener("CreativeAssetLoaded",this.onCreativeAssetLoaded.bind(this));try{this.vpaidCreative.loadCreativeAsset(e)}catch(e){a.warn(e),this._isCORSEnforcementDisabled?(this._failWithError(a.ERROR_UNKNOWN,"Error when loading creative"+e),this.cancelTimeoutEvent()):that._eventHandlers.loaderror(a.ERROR_UNKNOWN,"Error when loading creative: "+e)}}else this._failWithError(a.ERROR_NULL_ASSET,"Creative asset url cannot be null")},stop:function(){a.log("VPAIDRenderer stop()"),this.vpaidCreative.stopAd(),this.vpaidCreative&&"loadCreativeAsset and stopAd"==this.vpaidCreative.getTimeoutOperation()&&this.dispose()},info:function(){return{moduleType:a.MODULE_TYPE_RENDERER}},getPlayheadTime:function(){var e=this.vpaidCreative.getAdDuration(),t=this.vpaidCreative.getAdRemainingTime();return 0<=e&&0<=t&&(this.playheadTime=e-t),0>this.playheadTime&&(this.playheadTime=-1),this.playheadTime},getDuration:function(){var e=this.vpaidCreative.getAdDuration();return 0<=e?e:-1},pause:function(){a.log("VPAIDRenderer pause()"),this._rendererController.processEvent({name:a.EVENT_AD_PAUSE}),this.vpaidCreative.canPauseAd()?"playing"===this.adPlaybackState&&(this.adPlaybackState="pausing",this.vpaidCreative.pauseAd()):a.log("The creative is not able to pause")},resume:function(){a.log("VPAIDRenderer resume()"),this._rendererController.processEvent({name:a.EVENT_AD_RESUME}),this.vpaidCreative.canResumeAd()?"paused"===this.adPlaybackState&&(this.adPlaybackState="resuming",this.vpaidCreative.resumeAd()):a.log("The creative is not able to resume")},dispose:function(){a.log("VPAIDRenderer dispose()"),this.vpaidCreative&&(this.videoParent&&(this.videoParent.removeChild(this.videoBase),this.videoParent=null),this._visibilityChangeListener&&this.vpaidCreative._autoPauseAdOnVisibilityChange&&(a.log("remove visibilitychange listener"),document.removeEventListener("visibilitychange",this._visibilityChangeListener,!1)),this.vpaidCreative.removeCallbacksForCreative(this.creativeEventCallbacks),this.vpaidCreative.removeEventListener("CreativeAssetLoaded"),this.vpaidCreative.removeEventListener("timeout"),this.vpaidCreative.removeEventListener("loaderror"),this.vpaidCreative=null)},resize:function(){a.log("VPAIDAdRenderer resize()");var e=this._rendererController.getAdInstance().getSlot(),t=e.getWidth();e=e.getHeight(),a.log("VPAIDRenderer new size width:"+t+" height:"+e),this.vpaidCreative.resizeAd(t,e,this.vpaidViewmode)},getAdSkippableState:function(){return this.vpaidCreative.getAdSkippableState()}}),a.VastTranslator=function(){this._rendererController=this._request=null},a.VastTranslator.prototype={start:function(e){function t(e){a.log("VastTranslator\t"+e)}function i(e){a.warn("VastTranslator\t"+e)}function n(e,t){!function(e,t){if(e)if(e.length&&"string"!=typeof e)for(var i=0;i<e.length;i++)t(e[i].value);else e.value&&t(e.value)}(t,function(t){t&&e.push(t)})}function r(e){if(!e)return!1;for(var t=0;t<f.length;t++)if(a.Util.trim(f[t]).toLowerCase()===a.Util.trim(e).toLowerCase())return!0;return!1}function s(e){return e?("string"!=typeof e&&(e=e.toString()),-1<(e=a.Util.trim(e)).indexOf("://")?e:null):null}function o(e,t){if(e&&e.length)for(var i=0;i<e.length;i++)o(e[i],t);else if(e.AdVerifications&&e.AdVerifications.Verification)if((e=e.AdVerifications.Verification).length)for(i=0;i<e.length;i++){var n=new a.AdVerification(e[i]);t.adVerifications.push(n)}else n=new a.AdVerification(e),t.adVerifications.push(n)}
1function l(e){this.code=this.url=null,this.height=this.width=NaN,this.resourceType=this.creativeType=null,this.bitrate=NaN,this.creativeApi=null,this.ad=e,this.clickThrough=null,this.clickTrackings=[],this.customClicks=[],this.creativeData=null}function d(){this.creativeView=[],this.start=[],this.firstQuartile=[],this.midpoint=[],this.thirdQuartile=[],this.complete=[],this.mute=[],this.unmute=[],this.pause=[],this.rewind=[],this.resume=[],this.replay=[],this.fullscreen=[],this.expand=[],this.collapse=[],this.acceptInvitation=[],this.stop=[],this.skip=[],this.progress={}}function _(e){this._impressions=[],this.clickThrough=null,this.clickTrackings=[],this.customClicks=[],this.creativeData=null,this.sequence=-1,this.universalAdId=null,this.vastRenditions=[],this.duration=NaN,this.adp=e,this.isDrivingAd=!1}function h(e){_.call(this,e)}function c(e){_.call(this,e)}function u(e){_.call(this,e)}function E(){}function p(e,i,n,a){if(e&&a&&0<a.length){t("augmentCallbacks("+i+", "+n+", "+a+")");for(var r=e.getEventCallbackUrls(i,n),s=0;s<r.length;s++)-1<a.indexOf(r[s])&&(t("augmentCallbacks() url = "+r[s]),a.unshift(r[s]));e.addEventCallbackUrls(i,n,a)}else t("augmentCallbacks("+i+", "+n+", "+a+"), empty callbacks")}function A(e,i){t("initErrorTrackings()"),e&&i&&p(e,a.EVENT_ERROR,a.EVENT_TYPE_ERROR,i.errorTrackings)}function T(e,i){if(t("initTrackingEvents()"),i&&e){p(e,a.EVENT_AD_IMPRESSION,a.EVENT_TYPE_IMPRESSION,i.creativeView),p(e,a.EVENT_AD_IMPRESSION,a.EVENT_TYPE_IMPRESSION,i.start),p(e,a.EVENT_AD_FIRST_QUARTILE,a.EVENT_TYPE_IMPRESSION,i.firstQuartile),p(e,a.EVENT_AD_MIDPOINT,a.EVENT_TYPE_IMPRESSION,i.midpoint),p(e,a.EVENT_AD_THIRD_QUARTILE,a.EVENT_TYPE_IMPRESSION,i.thirdQuartile),p(e,a.EVENT_AD_COMPLETE,a.EVENT_TYPE_IMPRESSION,i.complete),p(e,a.EVENT_AD_MUTE,a.EVENT_TYPE_STANDARD,i.mute),p(e,a.EVENT_AD_UNMUTE,a.EVENT_TYPE_STANDARD,i.unmute),p(e,a.EVENT_AD_PAUSE,a.EVENT_TYPE_STANDARD,i.pause),p(e,a.EVENT_AD_RESUME,a.EVENT_TYPE_STANDARD,i.resume),p(e,a.EVENT_AD_REWIND,a.EVENT_TYPE_STANDARD,i.rewind),p(e,a.EVENT_AD_EXPAND,a.EVENT_TYPE_STANDARD,i.fullscreen),p(e,a.EVENT_AD_COLLAPSE,a.EVENT_TYPE_STANDARD,i.collapse),p(e,a.EVENT_AD_EXPAND,a.EVENT_TYPE_STANDARD,i.expand),p(e,a.EVENT_AD_CLOSE,a.EVENT_TYPE_STANDARD,i.stop),p(e,a.EVENT_AD_ACCEPT_INVITATION,a.EVENT_TYPE_STANDARD,i.acceptInvitation),p(e,a.EVENT_AD_SKIPPED,a.EVENT_TYPE_STANDARD,i.skip);for(var n=Object.keys(i.progress),r=0;r<n.length;r++){var s=n[r];e.addProgressEventCallbackUrls(s,i.progress[s])}}}function R(e,i,n,r,s){if(t("initClickAndImpressionEvents"),e){if(i&&e.setClickThroughUrl(a.EVENT_AD_CLICK,i),n&&0<n.length&&p(e,a.EVENT_AD_CLICK,a.EVENT_TYPE_CLICK_TRACKING,n),r&&0<r.length)for(i=0;i<r.length;i++)r[i].url&&p(e,r[i].id,a.EVENT_TYPE_CLICK_TRACKING,[r[i].url]);s&&p(e,a.EVENT_AD_IMPRESSION,a.EVENT_TYPE_IMPRESSION,s)}}function g(e,n){if(t("initTemporalAdInstance"),e||i("initTemporalAdInstance: Invalid adInstance"),n.selectedDrivingAd){n.surveyUrl&&e._creative.setParameter("_fw_survey_url",n.surveyUrl);var a=n.selectedDrivingAd,s=n.selectedDrivingRenditions;t("vastRenditions:"+s);for(var o=4===N,l=0;l<s.length;l++){var d=e.addCreativeRendition(),_=d.addCreativeRenditionAsset("VAST_CRA",!0),h=s[l];e:{var c=h.creativeType;switch(c){case"video/mp4":c="video/mp4-h264";break e;case"video/3gp":c="video/3gpp"}}if(t("initTemporalAdInstance() set rendition/asset [vastRd.creativeApi,vastAd.duration,vastRd.width,vastRd.height,vastRd.url,assetContentType,vastRd.creativeType] =  "+[h.creativeApi,a.duration,h.width,h.height,h.url,c,h.creativeType]),d.setCreativeApi(h.creativeApi),isNaN(a.duration)||d.setDuration(a.duration),h.width&&!isNaN(h.width)&&d.setWidth(h.width),h.height&&!isNaN(h.height)&&d.setHeight(h.height),a.universalAdId&&d.setUniversalAdId(a.universalAdId),h.url&&_.setUrl(h.url),h.code&&_.setContent(h.code),_.setMimeType(h.creativeType),"static"===h.resourceType&&"text/html"===h.creativeType?_.setContentType("text/html_doc_ref"):"application/x-javascript"===h.creativeType||"application/javascript"===h.creativeType?_.setContentType("text/js_ref"):"iframe"===h.resourceType||"text/html"===h.creativeType||"text/html_doc_ref"===h.creativeType?_.setContentType("text/html_doc_ref"):"text/html_doc_lit_mobile"===h.creativeType?_.setContentType("text/html_doc_lit_mobile"):o||r(c)?(_.setContentType("text/html_doc_lit_mobile"),_.setUrl(null),_.setContent(m(e,O.getCustomId(),a,h,"text/html_doc_lit_mobile"))):_.setContentType(c),a.creativeData&&0!==a.creativeData.length&&(t("initTemporalAdInstance(), set asset parameter creativeData:"+a.creativeData),d.setParameter("creativeData",a.creativeData)),o||r(c)||(h=h.bitrate,!isNaN(h)&&0<h&&_.setBytes(1e3*h*a.duration/8)),c=y,_=L,h=!1,d.getContentType()&&c){var u=d.getContentType().toLowerCase(),E=c.toLowerCase();u===E?h=!0:(0===u.indexOf("video/mp4")&&0===E.indexOf("video/mp4")||"application/javascript"===E&&"text/js_ref"===u)&&(d.setContentType(c),h=!0)}c=!1,d.getCreativeApi()&&_&&((u=d.getCreativeApi().toLowerCase())===(E=_.toLowerCase())?c=!0:0===u.indexOf("mraid")&&0===E.indexOf("mraid")&&(c=!0,d.setCreativeApi(_))),h&&c?d.setPreference(10):c?d.setPreference(6):h?d.setPreference(5):d.setPreference(0),t("adjustMatchedRendition "+d.getId()+", contentType "+d.getContentType()+", creativeAPI "+d.getCreativeApi()+", preference "+d.getPreference())}T(e,a.trackingEvents),A(e,n),R(e,o?s[0].clickThrough:a.clickThrough,a.clickTrackings,a.customClicks,a.impressions),e.addAdVerifications(n.adVerifications)}else(d=e.addCreativeRendition()).setContentType("null/null"),(_=d.addCreativeRenditionAsset("VAST_CRA",!0)).setContentType("null/null")}function m(e,i,n,r,s){return t("getCoadHTML, ad id = "+e.getAdId()),r.url&&0<r.url.length?((n=r.clickThrough)&&0<n.length&&e.setClickThroughUrl(a.EVENT_AD_CLICK,n),e=e.getEventCallbackUrls(a.EVENT_AD_CLICK,a.EVENT_TYPE_CLICK)[0],a.HTMLAdGenerator.generateAd(r.url,e,i,r.width,r.height,r.creativeType,s)):r.code&&0<r.code.length?"script"===r.resourceType||"text/javascript"===r.resourceType||"text/js_ref"===r.resourceType||"application/x-javascript"===r.resourceType?a.HTMLAdGenerator.wrapJSCode(r.code,i,r.width,r.height):a.HTMLAdGenerator.wrapUnsafeHTML(r.code,i,r.width,r.height):null}function I(e,i,n,r){t("initPageAdInstance ad:"+i.getAdId());var s=n.vastRenditions[0];if(s.url||s.code){var o=i.addCreativeRendition(),l=o.addCreativeRenditionAsset("VAST_CRA",!0);o.setCreativeApi(s.creativeApi),o.setWidth(s.width),o.setHeight(s.height),"static"===s.resourceType&&"text/html"===s.creativeType||"iframe"===s.resourceType?(l.setContentType("text/html_doc_ref"),l.setUrl(s.url)):"HTML"===s.resourceType?(l.setContentType("text/html_doc_lit_mobile"),l.setContent(a.HTMLAdGenerator.wrapUnsafeHTML(s.code,e.getCustomId(),s.width,s.height))):(l.setContentType("text/html_doc_lit_mobile"),l.setContent(m(i,e.getCustomId(),n,s,"text/html_doc_lit_mobile"))),l.setMimeType("text/html")}else t("initPageAdInstance will add a tracking only companion ad");T(i,n.trackingEvents),A(i,r),R(i,s.clickThrough,s.clickTrackings,s.customClicks,n.impressions)}function S(e){if(200===e.status)if(e.responseXML){var i=(new E).parseAdData(e.responseXML);if(i){if(t("scheduleVastAds"),i&&0!==i.length)if(e=i[0].selectedPackage,i=i[0].redirectPackage,e||i){if(!e&&i){t("scheduleVastAds(), no ads scheduled, redirect to downstream Secondary Ad Server"),t("scheduleRedirect");var n=[];(e=[]).push(O),n.push({});for(var r=D,s=i.selectedCompanionAds,o=0;o<r.length;o++){var l=r[o];s&&s[l.getCustomId()]&&(e.push(l),n.push(s[l.getCustomId()]))}for((r=P._rendererController.scheduleAdInstances(e))&&0<r.length&&((o=(s=r[0]).addCreativeRendition()).setWrapperUrl(a.Util.transformUrlToProxy(i.tagUrl)),o.setWrapperType(M),o.setContentType(y),o.setCreativeApi(L),T(s,i.getTrackingEventsOfWrapper()),A(s,i),R(s,i.getClickThroughOfWrapper(),i.getClickTrackingsOfWrapper(),i.getCustomClicksOfWrapper(),i.getImpressionOfWrapper()),s.addAdVerifications(i.adVerifications)),t("scheduleRedirect, schedule companion for redirect ad "+i),o=1;o<r.length;o++)(s=r[o])&&(l=n[o])instanceof u&&I(e[o],s,l,i)}else if(e){for(t("scheduleVastAds(), ads returned from vast response, going to schedule them"),e.selectedDrivingAd?(t("scheduleVastAds(), ads returned from vast response, going to schedule them with driving ad"),e.selectedDrivingAd.isDrivingAd=!0):t("scheduleVastAds(), ads returned from vast response, going to schedule them without driving ad"),t("scheduleAdPackage()"),n=[],(i=[]).push(O),e.selectedDrivingAd&&n.push(e.selectedDrivingAd),r=D,s=e.selectedCompanionAds,o=0;o<r.length;o++)l=r[o],s&&s[l.getCustomId()]&&(i.push(l),n.push(s[l.getCustomId()]));if(0<(s=P._rendererController.scheduleAdInstances(i)).length){for(t("scheduleAdPackage, scheduled "+s.length+" ads"+e.selectedDrivingAd?"":0),e.selectedDrivingAd||t("Driving ad is not selected, will create a dummy null ad."),e.selectedDrivingAd||(i.shift(),g(s.shift(),e)),o=0;o<s.length;o++)if(l=s[o]){var d=n[o];d instanceof u?I(i[o],l,d,e):g(l,e)}
1!e.selectedDrivingAd&&0<r.length&&0<e.companionAds.length&&0===n.length&&(t("found empty companion slots and companion ads in package, but none of them matches slot size"),P.onTranslatorFailed(a.ERROR_UNMATCHED_SLOT_SIZE))}else t("scheduleAdPackage, no ad scheduled.")}}else t("scheduleVastAds(), no ads from vast response!!!"),v?4!==N?P.onTranslatorFailed(a.ERROR_NO_AD_AVAILABLE,"Expecting linear ad but returned non-linear ad",a.ERROR_VAST_LINEARITY_NOT_MATCH):P.onTranslatorFailed(a.ERROR_NO_AD_AVAILABLE,"Expecting non-linear ad but returned linear ad",a.ERROR_VAST_LINEARITY_NOT_MATCH):P.onTranslatorFailed(a.ERROR_NO_AD_AVAILABLE,"wrapperUrl="+V);else t("no ads for scheduleVastAds");P._request=null,P._rendererController.handleStateTransition(a.TRANSLATOR_STATE_STARTED),P._rendererController.handleStateTransition(a.TRANSLATOR_STATE_COMPLETED)}}else P.onTranslatorFailed(a.ERROR_PARSE,"wrapperUrl="+V,a.ERROR_VAST_XML_PARSING);else 400<=e.status&&P.onTranslatorFailed(a.ERROR_IO,"wrapperUrl="+V)}this._rendererController=e;var f="image/gif image/jpeg image/png text/html text/javascript text/html_doc_ref text/html_doc_lit_mobile application/x-javascript application/javascript".split(" "),v=!1,C=this._rendererController.getAdInstance(),P=this,O=C.getSlot(),N=function(){if(!O)return 1;switch(O.getTimePositionClass()){case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_MIDROLL:case a.TIME_POSITION_CLASS_POSTROLL:return 2;case a.TIME_POSITION_CLASS_OVERLAY:return 4;case a.TIME_POSITION_CLASS_DISPLAY:return O&&!O.getBase()?8:1;default:return 1}}(),D=this._rendererController.getCompanionSlots().filter(function(e){if(!e)return!1;switch(e.getTimePositionClass()){case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_MIDROLL:case a.TIME_POSITION_CLASS_PAUSE_MIDROLL:case a.TIME_POSITION_CLASS_POSTROLL:return!1;default:return!0}});t("Checking CompanionSlots, length = "+D.length+", this._rendererController.getCompanionSlots().length = "+this._rendererController.getCompanionSlots().length+", AdInstance.getCompanionSlots.length = "+C.getCompanionSlots().length);var y=C.getActiveCreativeRendition().getContentType(),L=C.getActiveCreativeRendition().getCreativeApi()||"None";this.log("ExpectedDrivingContentType:"+y+", ExpectedDrivingAPI:"+L);var M=C.getActiveCreativeRendition().getWrapperType();l.prototype={init:function(e,t,i,n,a,r,s,o){var l;if(this.log("init("+[].slice.call(arguments,0).join(",")+")"),this.url=e,this.width=1*t,this.height=1*i,this.creativeType=n,this.resourceType=a,this.bitrate=r,(l=s)&&0!==l.length)switch(l.toLowerCase()){case"flashvar":case"flashvars":l="clickTag";break;case"vpaid":l="VPAID";break;case"mraid":l="MRAID-1.0"}else l="None";this.creativeApi=l,this.code=o||null},log:function(e){a.log("VastTranslator.VastRendition\t"+e)},toString:function(){var e,t=[];for(e in this)this.hasOwnProperty(e)&&"function"!=typeof this[e]&&"ad"!==e&&t.push(e+":"+this[e]);return t.join(",")}},l.prototype.constructor=l,_.prototype={parse:function(e){if(this.log("parse()"),e["@attributes"]&&e["@attributes"].hasOwnProperty("skipoffset")&&C._setSkipOffset(e["@attributes"].skipoffset),e.Duration)if(e.Duration.value){var t=/(\d+):(\d+):(\d+)/.exec(e.Duration.value);t?this.duration=3600*t[1]+60*t[2]+1*t[3]:this.warn("Failed to parse duration value for creative "+e)}else this.warn("No duration value set for creative "+e);e.VideoClicks&&(e.VideoClicks=[].concat(e.VideoClicks),a.Util.forEachOnArray(e.VideoClicks,function(e){var t;if(e.ClickThrough&&e.ClickThrough.value&&(this.clickThrough=s(e.ClickThrough.value)),e.ClickTracking){e.ClickTracking=[].concat(e.ClickTracking);for(var i=0;i<e.ClickTracking.length;i++)(t=s(e.ClickTracking[i].value))&&this.clickTrackings.push(t)}if(e.CustomClick)for(e.CustomClick=[].concat(e.CustomClick),i=0;i<e.CustomClick.length;i++){var n=null;e.CustomClick[i]["@attributes"]&&(n=e.CustomClick[i]["@attributes"].id),(t=s(e.CustomClick[i].value))&&this.customClicks.push({id:n,url:t})}},this)),e.MediaFiles&&e.MediaFiles.MediaFile&&(e.MediaFiles.MediaFile=[].concat(e.MediaFiles.MediaFile),a.Util.forEachOnArray(e.MediaFiles.MediaFile,function(e){var t=s(e.value),i=NaN,n=NaN,a=null,r="None",o=NaN;e["@attributes"]&&(i=e["@attributes"].width||NaN,n=e["@attributes"].height||NaN,a=e["@attributes"].type,r=e["@attributes"].api
1Framework||"None",o=e["@attributes"].bitrate||NaN),t&&-1!==t.indexOf(":")?((e=new l(this)).init(t,i,n,a,"",o,r,null),e.clickThrough=this.clickThrough,this.vastRenditions.push(e),(isNaN(i)||isNaN(n))&&this.log("continue with missing [width,height]"+[i,n])):this.warn("will ignore this mediaFile because some required field is missing [url,width,height]:"+[t,i,n])},this)),e.TrackingEvents&&this.parseTrackingEvents(e.TrackingEvents,this.setTrackingEvents()),e.AdParameters&&(this.log("parse() got AdParameters:"+e.AdParameters.value),this.creativeData=e.AdParameters.value),e.Companion&&(e.Companion=[].concat(e.Companion),a.Util.forEachOnArray(e.Companion,function(e){var t=null,i=null,n="",o="",d=null,_=null,h=!1;e.CompanionClickThrough&&(o=s(e.CompanionClickThrough.value)),e.StaticResource&&(t=s(e.StaticResource.value),e.StaticResource["@attributes"]&&(i=e.StaticResource["@attributes"].creativeType),n="static"),e.IFrameResource&&(t=s(e.IFrameResource.value))&&(i="text/html_doc_ref",n="iframe"),e.HTMLResource&&(d=e.HTMLResource["#cdata-section"]||"",d=a.Util.trim(d))&&(i="text/html_doc_lit_mobile",n="HTML"),e.TrackingEvents&&(_=e.TrackingEvents);var c=new u(this.adp);if(c.sequence=this.sequence,c.clickThrough=o,_&&c.parseTrackingEvents(_,c.setTrackingEvents()),e["@attributes"]){_=e["@attributes"].width||NaN;var E=e["@attributes"].height||NaN;if(e=e["@attributes"].apiFramework||"None",(t&&-1!==t.indexOf(":")||d)&&!isNaN(_)&&!isNaN(E)&&r(i)||this.adp.isWrapper){var p=new l(c);p.init(t,_,E,i,n,NaN,e,d),p.clickThrough=o,c.vastRenditions.push(p)}else h=!0,this.warn("will ignore this rendition because some required fields is missing or incompatible [creativeType,url,code,width,height]:"+[i,t,d,_,E])}else this.adp.isWrapper||(h=!0,this.warn("for InLine ad package, No attributes found for the Companion ads:"+e));h?this.adp.isWrapper&&this.adp.companionAds.push(c):this.adp.companionAds.push(c)},this)),e.NonLinear&&(e.NonLinear=[].concat(e.NonLinear),a.Util.forEachOnArray(e.NonLinear,function(e){var t=null,i=null,n="",o="",d="",_=null,h=!1;e.AdParameters&&(d=e.AdParameters.value),e.NonLinearClickThrough&&(o=s(e.NonLinearClickThrough.value)),e.StaticResource&&(t=s(e.StaticResource.value),e.StaticResource["@attributes"]&&(i=e.StaticResource["@attributes"].creativeType),n="static"),e.IFrameResource&&(t=s(e.IFrameResource.value),i="text/html_doc_ref",n="iframe"),e.HTMLResource&&(_=e.HTMLResource["#cdata-section"]||"",_=a.Util.trim(_),i="text/html_doc_lit_mobile",n="HTML");var u=new c(this.adp);if(u.sequence=this.sequence,u.clickThrough=o,u._trackingEvents=this._trackingEvents,d&&(u.creativeData=d),e["@attributes"]){d=e["@attributes"].width||NaN;var E=e["@attributes"].height||NaN;if(e=e["@attributes"].apiFramework||"None",!t&&!_||isNaN(d)||isNaN(E)||!r(i))h=!0,this.warn("will ignore this rendition because some required fields is missing or incompatible:[creativeType,url,code,width,height]:"+[i,t,_,d,E]);else{var p=new l(u);p.init(t,d,E,i,n,NaN,e,_),p.clickThrough=o,u.vastRenditions.push(p)}}else this.adp.isWrapper||(h=!0,this.warn("for InLine ad package, No attributes found for the NonLinear ads:"+e));this.adp.nonLinearAds.push(u),h?this.adp.isWrapper&&this.adp.nonLinearAds.push(u):this.adp.nonLinearAds.push(u)},this))},parseLinears:function(e){2!==N?(this.log("TargetAdType != TARGET_LINEAR, skipping parse"),v=!0):this.parse(e)},parseNonLinears:function(e){4!==N?(this.log("TargetAdType != TARGET_NONLINEAR, skipping parse"),v=!0):this.parse(e)},parseCompanionAds:function(e){this.parse(e)},setTrackingEvents:function(){return this._trackingEvents||(this._trackingEvents=new d),this._trackingEvents},parseTrackingEvents:function(e,t){this.log("parseTrackingEvents"),e.Tracking&&(e.Tracking=[].concat(e.Tracking),a.Util.forEachOnArray(e.Tracking,function(e){var i=e["@attributes"].event,n=s(e.value);if(n)switch(i){case"creativeView":case"start":case"firstQuartile":case"midpoint":case"thirdQuartile":case"complete":case"mute":case"unmute":case"pause":case"resume":case"rewind":case"replay":case"fullscreen":case"expand":case"collapse":case"acceptInvitation":case"stop":case"skip":t[i].push(n);break;case"progress":-1!=(e=a.Util.offsetStringToSecond(e["@attributes"].offset,this.duration))&&(t.progress[e]||(t.progress[e]=[]),t.progress[e].push(n));break;
1case"close":t.stop.push(n)}},this),a.debug("********** events:",t))},toString:function(){return this.constructor.name+", renditions:"+this.vastRenditions},log:function(e){a.log("VastTranslator."+this.constructor.name+"\t"+e)},warn:function(e){a.warn("VastTranslator."+this.constructor.name+"\t"+e)}},e=Object.defineProperty||function(e,t,i){i.get&&e.__defineGetter__(t,i.get),i.set&&e.__defineSetter__(t,i.set)},e(_.prototype,"trackingEvents",{get:function(){return this.log("get trackingEvents()"),this._trackingEvents?this._trackingEvents:this.isDrivingAd?this.adp.trackingEvents:null}}),e(_.prototype,"impressions",{set:function(e){this._impressions=e},get:function(){return this.isDrivingAd?this._impressions.concat(this.adp.impressions):this._impressions}}),_.prototype.constructor=_,h.prototype=new _,h.prototype.constructor=h,c.prototype=new _,c.prototype.constructor=c,u.prototype=new _,u.prototype.getPrimaryRendition=function(){return this.vastRenditions[0]||null},e(u.prototype,"impressions",{get:function(){return 8===N?this._impressions.concat(this.adp.impressions):this._impressions}}),u.prototype.constructor=u;var b=function(){this.impressions=[],this.errorTrackings=[],this.linearAds=[],this.nonLinearAds=[],this.companionAds=[],this.extensions=[],this.tagUrl="",this.isWrapper=!1,this.surveyUrl=null,this.selectedDrivingRenditions=[],this.selectedDrivingAd=null,this.selectedCompanionAds={},this.adVerifications=[]};b.prototype={parse:function(e){if(this.log("parse("+e+")"),e)if(this.isWrapper||e.Creatives&&e.Creatives.Creative){e.Creatives=e.Creatives||[],n(this.impressions,e.Impression),n(this.extensions,e.Extensions),n(this.errorTrackings,e.Error),this.isWrapper&&e.VASTAdTagURI&&(this.tagUrl=e.VASTAdTagURI.value||""),e.Survey&&e.Survey.value&&0<e.Survey.value.length&&(this.surveyUrl=e.Survey.value),e.Creatives.Creative=e.Creatives.Creative?[].concat(e.Creatives.Creative):[];for(var t=0;t<e.Creatives.Creative.length;t++){var i=e.Creatives.Creative[t],a=-1;if(i["@attributes"]&&(a=i["@attributes"].sequence||-1,a*=1),i.Linear){var r=new h(this);r.sequence=a,r.parseLinears(i.Linear),this.linearAds.push(r)}else i.NonLinearAds?((r=new c(this)).sequence=a,r.parseNonLinears(i.NonLinearAds)):i.CompanionAds&&((r=new u(this)).sequence=a,r.parseCompanionAds(i.CompanionAds));r&&i.UniversalAdId?(r.universalAdId={idRegistry:i.UniversalAdId["@attributes"].idRegistry,idValue:i.UniversalAdId["@attributes"].idValue},this.log("Universal Ad ID with idRegistry "+r.universalAdId.idRegistry+" and idValue "+r.universalAdId.idValue)):this.log("No Universal Ad ID is present in the VAST response.")}e.Extensions&&e.Extensions.Extension&&o(e.Extensions.Extension,this),e.AdVerifications&&o(e,this)}else this.warn("parse(): no creative found!");else this.warn("parse(): empty adpackage")},testAndUpdatePackageForTemporalSlot:function(e){if(this.log("testAndUpdatePackageForTemporalSlot("+e+")"),1>(e=e?this.linearAds:this.nonLinearAds).length)return!1;this.log("testAndUpdatePackageForTemporalSlot(), ads.length = "+e.length);var t=!1;if(!t)for(var i=0;i<e.length;i++){var n=this.findRenditionGroupByContentType(e[i]);if(0<n.length){this.log("testAndUpdatePackageForTemporalSlot() : found driving ad and renditions group: "+n),this.selectedDrivingRenditions=n,this.selectedDrivingAd=e[i],t=!0;break}}return t},testAndUpdatePackageForPageSlots:function(e){var t=!1,i=this.companionAds,n=D.slice(0);if(this.log("testAndUpdatePackageForPageSlots("+e+"), ads are "+i.join(",")+", slots are "+n.join(",")),e){if(0<(e=this.matchAdsToSlots(i,n)).length)for(t=!0,i=0;i<e.length;i++){var a=(n=e[i]).ad;this.selectedCompanionAds[n.slot.getCustomId()]=a}}else 1===(e=this.matchAdsToSlots(i,[O])).length?(t=!0,this.selectedDrivingAd=e[0].ad):this.selectedDrivingAd=null;return t},renditionFitsInSlot:function(e,t){return!!e&&e.width<=t.getWidth()&&e.height<=t.getHeight()},calcDeadSpaceRatio:function(e,t){return(e=e.getPrimaryRendition())?(this.log("ad w,h  slot w,h"+[e.width,e.height,t.getWidth(),t.getHeight()]),this.renditionFitsInSlot(e,t)?1-e.width*e.height/t.getWidth()*t.getHeight():1):0},matchAdsToSlots:function(e,t){this.log("matchAdsToSlots(ads="+e.join(",")+", slots="+t.join(",")+")");for(var i=[],n=null,a=null,r=1,s=0;s<e.length;s++)for(var o=e[s],l=0;l<t.length;l++){var d=t[l],_=this.calcDeadSpaceRatio(o,d);_<r&&(n=o,a=d,r=_)}return null!=n&&(i.push({ad:n,slot:a}),e.splice(e.indexOf(n),1),t.splice(t.indexOf(a),1),i=i.concat(this.matchAdsToSlots(e,t))),this.log("matchAdsToSlots: winningAd:"+n+" winningSlot:"+a+" ratio:"+r),i},getAllRenditions:function(e){return e.vastRenditions},findRenditionGroupByContentType:function(e){this.log("findRenditionGroupByContentType:"+e);var t=[];if(e instanceof h&&isNaN(e.duration))return this.warn("findRenditionGroupByContentType(), duration of linear ad is NaN, will not used for scheduling"),t;for(var i=this.getAllRenditions(e),n=0;n<i.length;n++){var s=i[n];
1if(e instanceof h){if(null==s.creativeType||""===a.Util.trim(s.creativeType)){this.warn("findRenditionGroupByContentType, the contentType "+s.creativeType+" not supported for linearAd");continue}}else if(!r(s.creativeType)){this.warn("findRenditionGroupByContentType, the contentType "+s.creativeType+" not supported for non-linearAd");continue}t.push(s)}return t},formalizeString:function(e){return e?a.Util.trim(e).toLowerCase():""},getAdsByTargetType:function(){this.log("getAdsByTargetType");var e=[];switch(N){case 8:e=this.companionAds;break;case 2:e=this.linearAds;break;case 4:e=this.nonLinearAds}for(var t=0;t<e.length;t++)e[t].isDrivingAd=!0;return e},getImpressionOfWrapper:function(){this.log("getImpressionOfWrapper");for(var e=this.getAdsByTargetType(),t=null,i=0;i<e.length;i++){var n=e[i];if(n&&n._impressions&&0<n._impressions.length){t=n._impressions;break}}return t||(t=this.impressions),t},getTrackingEventsOfWrapper:function(){this.log("getTrackingEventsOfWrapper");for(var e=this.getAdsByTargetType(),t=null,i=0;i<e.length;i++){var n=e[i];if(n&&n._trackingEvents){t=n._trackingEvents;break}}return t},getClickThroughOfWrapper:function(){this.log("getClickThroughOfWrapper");for(var e=this.getAdsByTargetType(),t=null,i=0;i<e.length;i++){var n=e[i];if(n){n.clickThrough&&(t=n.clickThrough),n=n.vastRenditions;for(var a=0;a<n.length;a++){var r=n[a];if(r.clickThrough){t=r.clickThrough;break}}if(t)break}}return t},getClickTrackingsOfWrapper:function(){this.log("getClickTrackingsOfWrapper");for(var e=this.getAdsByTargetType(),t=null,i=0;i<e.length;i++){var n=e[i];if(n){n.clickTrackings&&0<n.clickTrackings.length&&(t=n.clickTrackings),n=n.vastRenditions;for(var a=0;a<n.length;a++){var r=n[a];if(r.clickTrackings&&0<r.clickTrackings.length){t=r.clickTrackings;break}}if(t)break}}return t},getCustomClicksOfWrapper:function(){this.log("getCustomClicksOfWrapper");for(var e=this.getAdsByTargetType(),t=null,i=0;i<e.length;i++){var n=e[i];if(n){n.customClicks&&0<n.customClicks.length&&(t=n.customClicks),n=n.vastRenditions;for(var a=0;a<n.length;a++){var r=n[a];if(r.customClicks&&0<r.customClicks.length){t=r.customClicks;break}}if(t)break}}return t},testWrapperForRedirect:function(){return this.log("testAndUpdateWrapperForRedirect()"),this.tagUrl&&0<this.tagUrl.length},log:function(e){a.log("VastTranslator.VastAdPackage\t"+e)},warn:function(e){a.warn("VastTranslator.VastAdPackage\t"+e)}},b.prototype.constructor=b,E.prototype={getVastVersion:function(e){return this.log("getVastVersion("+e+")"),e&&0!==e.indexOf(".")?0<e.indexOf(".")?parseInt(e.substring(0,e.indexOf("."))):parseInt(e):-1},parseAdData:function(e){this.log("parseAdData()");var t,i={selectedPackage:null,redirectPackage:null},n=a.Util.xmlToJson(e);if(n)if(n.VAST&&n.VAST["@attributes"])if(this.getVastVersion(n.VAST["@attributes"].version)<a.MINIMUM_VAST_VERSION_SUPPORTED||this.getVastVersion(n.VAST["@attributes"].version)>a.MAXIMUM_VAST_VERSION_SUPPORTED)P.onTranslatorFailed(a.ERROR_PARSE,"wrapperUrl="+V,a.ERROR_VAST_VERSION_NOT_SUPPORTED);else{if(n.VAST.Ad){n.VAST.Ad=[].concat(n.VAST.Ad);var r=[];for(e=[],t=0;t<n.VAST.Ad.length;t++){var s=new b;s.isWrapper=!!n.VAST.Ad[t].Wrapper,s.isWrapper?(s.parse(n.VAST.Ad[t].Wrapper),e.push(s)):(s.parse(n.VAST.Ad[t].InLine),r.push(s))}if(n=!1,0===r.length&&0===e.length)return this.log("parseAdData(): no ads from vast response!!!"),[i];for(this.log("parseAdData(): "+r.length+"inline ads, "+e.length+" wrapper ads."),s=null,t=0;t<r.length;t++)if(this.selectUsableAdsForDrivingSlot(r[t])){this.log("parseAdData(): package for driving slot is found!!!"),s=r[t];break}if(t=0<D.length&&C.getSlot().getTimePositionClass()!==a.TIME_POSITION_CLASS_DISPLAY,s)t&&this.selectUsableAdsCompanionSlots(s)&&this.log("parseAdData(): companion ads are found for companion slots, with driving slot"),i.selectedPackage=s;else if(t){t=!1;for(var o=0;o<r.length;o++)s=r[o],this.selectUsableAdsCompanionSlots(s)&&(this.log("parseAdData(): companion ads are found for companion slots,without driving slot"),i.selectedPackage=s,t=!0);t||(this.log("parseAdData(): companion ads are not found for companion slots,without driving slot"),n=!0)}else this.log("parseAdData(): no usable ads found in vast response!!!"),n=!0;if(n&&0<e.length)for(r=0;r<e.length;r++)if(this.testWrapperForRedirect(e[r])){i.redirectPackage=e[r],C.incrementWrapperCount(),this.selectUsableAdsCompanionSlots(e[r])&&this.log("parseAdData(): companion ads are found for wrapper ad");break}return[i]}n.VAST.Error&&p(C,a.EVENT_ERROR,a.EVENT_TYPE_ERROR,n.VAST.Error.value),P.onTranslatorFailed(a.ERROR_NO_AD_AVAILABLE,"wrapperUrl="+V,a.ERROR_VAST_NO_AD)}else P.onTranslatorFailed(a.ERROR_PARSE,"wrapperUrl="+V,a.ERROR_VAST_SCHEMA_VALIDATION);else P.onTranslatorFailed(a.ERROR_PARSE,"wrapperUrl="+V,a.ERROR_VAST_XML_PARSING)},selectUsableAdsForDrivingSlot:function(e){switch(this.log("selectUsableAdsForDrivingSlot()"),N){case 2:e=this.testAndUpdatePackageForTemporalSlot(e,!0);break;case 4:e=this.testAndUpdatePackageForTemporalSlot(e,!1);break;case 8:e=this.testAndUpdatePackageForPageSlots(e,!1);break;default:e=!1}return e},selectUsableAdsCompanionSlots:function(e){return this.log("selectUsableAdsCompanionSlots(pk)"),this.testAndUpdatePackageForPageSlots(e,!0)},testAndUpdatePackageForTemporalSlot:function(e,t){return this.log("testAndUpdatePackageForTemporalSlot(pk,isLinear), isLinear = "+t),e.testAndUpdatePackageForTemporalSlot(t)},testAndUpdatePackageForPageSlots:function(e,t){return this.log("testAndUpdatePackageForPageSlots(pk,isCompanion) isCompanion = "+t),e.testAndUpdatePackageForPageSlots(t)},testWrapperForRedirect:function(e){return this.log("testWrapperForRedirect(pk)"),e.testWrapperForRedirect()},log:function(e){a.log("VastTranslator.VastParser\t"+e)},warn:function(e){a.warn("VastTranslator.VastParser\t"+e)}};var V=C.getActiveCreativeRendition().getWrapperUrl();if(e=C.getActiveCreativeRendition().getWrapperType(),t("AdInstance.getActiveCreativeRendition().getWrapperUrl()="+V+", getWrapperType()="+e),0!==e.indexOf("external/vast-"))P.onTranslatorFailed(a.ERROR_NO_RENDERER,"wrapperType="+e+";wrapperUrl="+V,a.ERROR_VAST_TRACKING_ERROR);else if(V&&0!==V.length){var w=a.VAST_DEFAULT_MAX_WRAPPER_COUNT;if((e=this._rendererController.getParameter(a.PARAMETER_VAST_MAX_WRAPPER_COUNT))&&0<Number(e)&&(w=Number(e)),C.getWrapperCount()>=w)P.onTranslatorFailed(a.ERROR_IO,"maximum wrapper limit is reached "+C.getWrapperCount(),a.ERROR_VAST_WRAPPER_LIMIT_REACH);else{w=this._rendererController.getParameter("translator.vast.asyncLoad"),t("will load vast xml, asyncAjax:"+(w=!0===a.Util.str2bool(w)));var U=this._rendererController.getParameter("translator.vast.loadWithCookie");U=!0===a.Util.str2bool(U);var x=null,k=5e3;(e=this._rendererController.getParameter(a.PARAMETER_VAST_TIMEOUT_IN_MILLISECONDS))&&0<Number(e)&&(k=Number(e));try{window.XDomainRequest?(x=new XDomainRequest,w=!0):(x=new XMLHttpRequest).withCredentials=U,P._request=x,w?(x.open("GET",V),window.XDomainRequest?x.onload=function(){var e=new ActiveXObject("Microsoft.XMLDOM");e.async=!1,e.loadXML(x.responseText),x.responseXML=e,x.status=200,S(x)}:(x.timeout=k,x.onreadystatechange=function(){4===x.readyState&&S(x)}),x.ontimeout=function(){P.onTranslatorFailed(a.ERROR_TIMEOUT,"wrapperUrl="+V+" timed out.",a.ERROR_VAST_URI_TIMEOUT)},x.onerror=function(){window.XDomainRequest&&(x.status=0),0===x.status?(i("CORS error"),P.onTranslatorFailed(a.ERROR_SECURITY,"wrapperUrl="+V)):(i("exception:"+x.statusText),P.onTranslatorFailed(a.ERROR_UNKNOWN,"wrapperUrl="+V+";exception="+x.statusText))},x.send()):(x.open("GET",V,!1),x.send(),S(x))}catch(t){e=!1,window.XMLHttpRequestException?t instanceof XMLHttpRequestException&&t.code===XMLHttpRequestException.NETWORK_E
1RR&&(e=!0):t.code===DOMException.NETWORK_ERR&&(i("CORS in IE10"),e=!0),e?(i("CORS error:"+t),P.onTranslatorFailed(a.ERROR_SECURITY,"wrapperUrl="+V)):(i("exception:"+t),P.onTranslatorFailed(a.ERROR_UNKNOWN,"wrapperUrl="+V+";exception="+t))}}}else P.onTranslatorFailed(a.ERROR_NULL_ASSET,"wrapperUrl="+V,a.ERROR_VAST_TRACKING_ERROR)},info:function(){return{moduleType:a.MODULE_TYPE_TRANSLATOR}},log:function(e){a.log("VastTranslator\t"+e)},warn:function(e){a.warn("VastTranslator\t"+e)},getPlayheadTime:function(){return-1},getDuration:function(){return-1},stop:function(){a.debug("VastTranslator stop"),this._request&&(this._request.abort(),a.log("VastTranslator Stop: request aborted")),this._request=null,this._rendererController&&this._rendererController.handleStateTransition(a.TRANSLATOR_STATE_COMPLETED)},onTranslatorFailed:function(e,t,i){this._request&&(this._request=null);var n={};n[a.INFO_KEY_ERROR_MODULE]="VastTranslator",n[a.INFO_KEY_ERROR_CODE]=e,n[a.INFO_KEY_VAST_ERROR_CODE]=i,t&&(n[a.INFO_KEY_ERROR_INFO]=t),this._rendererController.handleStateTransition(a.TRANSLATOR_STATE_FAILED,n)}},a.VastTranslator.prototype.constructor=a.VastTranslator,a.ContentVideoExtension=function(){this.autoSourceRestore=this.respondPauseResume=!0,this._originalTime=0,this._contentVideoControls=this._contentVideoSrc=null},a.ContentVideoExtension.prototype={_isEnabled:function(){var e=this._context.getParameter(a.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED);return(null==e||!0===a.Util.str2bool(e))&&null!=this._context.getContentVideoElement()},init:function(e){a.debug("ContentVideoExtension.init(context)"),this._context=e,this._fixContentVideoCurrentTime=a.Util.bind(this,function(e){if(a.log("_fixContentVideoCurrentTime: event = "+e.type),!(0>=this._context.getContentVideoElement().currentTime||0>=this._context.getContentVideoElement().seekable.length)&&(this._context.getContentVideoElement().removeEventListener("timeupdate",this._fixContentVideoCurrentTime,!1),0<this._context.getContentVideoElement().currentTime&&1>this._context.getContentVideoElement().currentTime&&1<this._originalTime)){a.log("ContentVideoExtension: seeking to original time",this._originalTime);try{this._context.getContentVideoElement().currentTime=this._originalTime}catch(e){a.warn("ContentVideoExtension: seek error")}}}),this._pause=a.Util.bind(this,function(e){a.log("_pause: event = "+e.type),this._isEnabled()?this._respondPauseResume()&&(a.debug("ContentVideoExtension: EVENT_CONTENT_VIDEO_PAUSE_REQUEST pausing content video",this._context.getContentVideoElement().src),this._originalTime=this._context.getContentVideoElement().currentTime,this._context.getContentVideoElement().pause()):a.debug("ContentVideoExtension: extension is not enabled, do nothing.")}),this._resume=a.Util.bind(this,function(e){a.log("_resume: event = "+e.type),this._isEnabled()?this._respondPauseResume()&&(a.debug("ContentVideoExtension: EVENT_CONTENT_VIDEO_RESUME_REQUEST resume content video",this._context.getContentVideoElement().src),!this._context._videoAsset||null!=this._context._videoAsset._state&&this._context._videoAsset._state!==a.VIDEO_STATE_COMPLETED?(a.log("ContentVideoExtension: resume content video"),this._context.getContentVideoElement().play(),a.PLATFORM_AUTO_SEEK_AFTER_MIDROLL&&!0===a.Util.getBooleanParameter(a.PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACK,!0)&&this._context.getContentVideoElement().addEventListener("timeupdate",this._fixContentVideoCurrentTime,!1)):a.warn("ContentVideoExtension: video state is uninitialized or completed, skip resume.")):a.debug("ContentVideoExtension: extension is not enabled, do nothing.")}),this._onAttach=a.Util.bind(this,function(e){if(this._isEnabled()){if(this._autoSourceRestore())switch(e.slot.getTimePositionClass()){case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_POSTROLL:a.debug("ContentVideoExtension: store current content video src",this._context.getContentVideoElement().src),this._contentVideoSrc=this._context.getContentVideoElement().src,this._contentVideoControls=this._context.getContentVideoElement().controls,this._context.getContentVideoElement().paused||this._context.getContentVideoElement().pause()}}else a.debug("ContentVideoExtension: extension is not enabled, do nothing.")}),this._onDetach=a.Util.bind(this,function(e){if(this._isEnabled()){if
1(this._autoSourceRestore())switch(e=e.slot.getTimePositionClass(),e){case a.TIME_POSITION_CLASS_PREROLL:case a.TIME_POSITION_CLASS_POSTROLL:a.debug("ContentVideoExtension: restore content video src to",this._contentVideoSrc),this._context.getContentVideoElement().src!==this._contentVideoSrc&&(this._context.getContentVideoElement().src=this._contentVideoSrc),this._context.getContentVideoElement().controls=this._contentVideoControls,e===a.TIME_POSITION_CLASS_PREROLL&&this._context.getContentVideoElement().load()}}else a.debug("ContentVideoExtension: extension is not enabled, do nothing.")}),a.debug("ContentVideoExtension: enabling content video pause resume request handling."),this._context.addEventListener(a.EVENT_CONTENT_VIDEO_PAUSE_REQUEST,this._pause),this._context.addEventListener(a.EVENT_CONTENT_VIDEO_RESUME_REQUEST,this._resume),a.debug("ContentVideoExtension: enabling content video source management."),this._context.addEventListener(a.EVENT_SLOT_STARTED,this._onAttach),this._context.addEventListener(a.EVENT_SLOT_ENDED,this._onDetach)},_respondPauseResume:function(){return a.Util.getBooleanParameter(a.PARAMETER_EXTENSION_CONTENT_VIDEO_RESPOND_PAUSE_RESUME,!0)},_autoSourceRestore:function(){return a.Util.getBooleanParameter(a.PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SOURCE_RESTORE,!0)},dispose:function(){a.debug("ContentVideoExtension.dispose()"),this._context&&(this._context.removeEventListener(a.EVENT_CONTENT_VIDEO_PAUSE_REQUEST,this._pause),this._context.removeEventListener(a.EVENT_CONTENT_VIDEO_RESUME_REQUEST,this._resume),this._context.removeEventListener(a.EVENT_SLOT_STARTED,this._onAttach),this._context.removeEventListener(a.EVENT_SLOT_ENDED,this._onDetach),this._context=null)}},a.ContentVideoExtension.prototype.constructor=a.ContentVideoExtension,a},t.tv.freewheel.SDK||(t.tv.freewheel.SDK=t.tv.freewheel[h]("tv.freewheel.SDK"))}()},77710(e,t,i){"use strict";i.d(t,{X:()=>s});var n,a,r,s={};i.r(s),i.d(s,{Qk:()=>n,nT:()=>a,iM:()=>r}),function(e){e.VAST="vast",e.VMAP="vmap:vmap",e.UNKNOWN="unknown"}(n||(n={})),function(e){e.PREROLL="preroll",e.MIDROLL="midroll",e.POSTROLL="postroll",e.DISPLAY="display",e.OVERLAY="overlay",e.PAUSE_AD="pause_ad",e.SPONSOR="sponsor",e.LBANNER="lbanner",e.UNKNOWN="unknown"}(a||(a={})),a.LBANNER,a.PAUSE_AD,function(e){e.Error="error",e.BreakStart="breakStart",e.BreakEnd="breakEnd",e.Start="start",e.Click="click",e.ImpressionEnd="impressionEnd",e.Impression="impression",e.Viewable="viewable",e.NotViewable="notViewable",e.ViewUndetermined="viewUndetermined",e.Complete="complete",e.FirstQuartile="firstQuartile",e.Midpoint="midpoint",e.ThirdQuartile="thirdQuartile",e.Mute="mute",e.Unmute="unmute",e.Fullscreen="fullscreen",e.Skip="skip",e.EngagedView="engagedView",e.Collapse="collapse",e.Expand="expand",e.Pause="pause",e.Resume="resume",e.Rewind="rewind",e.AcceptInvitation="acceptInvitation",e.Close="close",e.CloseLinear="closeLinear",e.CreativeView="creativeView",e.VerificationNotExecuted="verificationNotExecuted"}(r||(r={}))},7299(e,t,i){var n=i(21998),a=i(40491);n.adapters.Freewheel=n.Adapter.extend({getVersion:function(){return a.version+"-"+a.name+"-"+a.tech},getPlayhead:function(){return this._getAdInstanceMethodCall("getPlayheadTime")},getDuration:function(){return this._getAdInstanceMethodCall("getDuration")},getTitle:function(){try{if(this.titles)return this.titles[this._getAdNumber()]._adId}catch(e){}return"unknown"},getResource:function(){var e=null,t=this._getAdInstanceMethodCall("getActiveCreativeRendition");if(t)if("function"==typeof t.getPrimaryCreativeRenditionAsset){const i=t.getPrimaryCreativeRenditionAsset();i&&"function"==typeof i.getUrl&&(e=i.getUrl())}else"function"==typeof t.getWrapperUrl&&(e=t.getWrapperUrl());return e},getPlayerVersion:function(){var e=null;return"undefined"!=typeof tv&&tv.freewheel&&tv.freewheel.SDK&&(e=tv.freewheel.SDK.version),e},getPlayerName:function(){return"Freewheel"},getPosition:function(){return this.position},getIsVisible:function(){if(!this.contentPlayer)for(var e in this.player){var t=this.player[e];if(t&&t.videoHeight&&t.clientHeight){this.contentPlayer=t;break}}return n.Util.calculateAdViewability(this.contentPlayer)},getAudioEnabled:function(){for(var e in this.player){var t=this.player[e];if(t&&t.adManager&&t.adManager._context&&t.adManager._context.getAdVolume)return!!t.adManager._context.getAdVolume()}},getGivenAds:function(){return this.slot.getAdCount()},getBreaksTime:function(){var e=this.getSlots();if(!e)return null;var t=[];for(var i in e){var n=e[i];if(n.getAdCount()>0){var a=n.getAdInstances();for(var r in a)if("video"===a[r]._creativeRenditions[0]._baseUnit){var s=this.plugin.getDuration(),o=n.getTimePosition();t.push(s&&o>s?s:o);break}}}return t},getGivenBreaks:function(){var e=this.getSlots();if(!e)return null;var t=0;for(var i in e){var n=e[i];if(n.getAdCount()>0){var a=n.getAdInstances();for(var r in a)if("video"===a[r]._creativeRenditions[0]._baseUnit){t++;break}}}return t},getCreativeId:function(){var e=null;if(this.slot){var t=this.slot.getAdInstances(),i=this._getAdNumber();t&&t[i]&&(e=t[i]._creativeId)}return e},getSlots:function(){if(this.player.currentAdContext)return this.player.currentAdContext._adResponse.getTemporalSlots();for(var e in this.player){var t=this.player[e];if(t&&t._adResponse&&t._adResponse.getTemporalSlots)return t}return null},_getAdNumber:function(){return(this.plugin.requestBuilder.lastSent.adNumber||1)-1}
1,_getAdInstanceMethodCall:function(e){var t=null;if(this.slot){var i=this.slot.getAdInstances(),n=this._getAdNumber();i&&i[n]&&"function"==typeof i[n][e]&&(t=i[n][e]())}return t},registerListeners:function(){for(var e in this.canRemoveListeners=!0,this.events=tv.freewheel.SDK,this.manifestNoResponse=[this.events.ERROR_SECURITY,this.events.ERROR_TIMEOUT],this.manifestEmpty=[this.events.ERROR_NO_AD_AVAILABLE,this.events.ERROR_VAST_NO_AD],this.manifestWrong=[this.events.ERROR_VAST_VERSION_NOT_SUPPORTED,this.events.ERROR_VAST_WRAPPER_LIMIT_REACH,this.events.ERROR_VAST_XML_PARSING,this.events.ERROR_PARSE],this.ignoredErrors=[this.events.ERROR_ADINSTANCE_UNAVAILABLE],this.references={},this.references[this.events.EVENT_AD]=this.logListener.bind(this),this.references[this.events.EVENT_ERROR]=this.errorListener.bind(this),this.references[this.events.EVENT_SLOT_STARTED]=this.slotListener.bind(this),this.references[this.events.EVENT_SLOT_ENDED]=this.closeListener.bind(this),this.manifestNoResponse)this.references[e]=this.noResponseManifestListener.bind(this);for(var t in this.manifestEmpty)this.references[t]=this.manifestEmptyListener.bind(this);for(var i in this.manifestWrong)this.references[i]=this.manifestWrongListener.bind(this);for(var n in this.references)this.player.currentAdContext.addEventListener(n,this.references[n])},unregisterListeners:function(){if(this.player&&this.references){for(var e in this.references)this.player.currentAdContext.removeEventListener(e,this.references[e]);this.references={}}},noResponseManifestListener:function(e){this.fireManifest(n.Constants.ManifestError.NO_RESPONSE,"No response")},manifestEmptyListener:function(e){this.fireManifest(n.Constants.ManifestError.EMPTY,"Empty manifest")},manifestWrongListener:function(e){this.fireManifest(n.Constants.ManifestError.WRONG,"Wrong manifest format")},logListener:function(e){if(n.Log.debug(e.subType),e.errorCode||e.errorInfo||e.errorModule)this.errorListener(e);else switch(e.subType){case this.events.EVENT_AD_PAUSE:this.pauseListener(e);break;case this.events.EVENT_AD_RESUME:this.resumeListener(e);break;case this.events.EVENT_AD_IMPRESSION_END:this.endedListener(e);break;case this.events.EVENT_AD_INITIATED:this.playListener(e);break;case this.events.EVENT_AD_IMPRESSION:this.playingListener(e);break;case this.events.EVENT_AD_SKIPPED:this.skipListener(e);break;case this.events.EVENT_SLOT_STARTED:this.slotListener(e);break;case this.events.EVENT_AD_CLOSE:case this.events.EVENT_SLOT_ENDED:this.closeListener(e);break;case this.events.EVENT_AD_CLICK:this.clickListener(e);break;case this.events.EVENT_AD_FIRST_QUARTILE:this.fireQuartile(1);break;case this.events.EVENT_AD_MIDPOINT:this.fireQuartile(2);break;case this.events.EVENT_AD_THIRD_QUARTILE:this.fireQuartile(3);break;case this.events.ERROR_SECURITY:case this.events.ERROR_TIMEOUT:this.noResponseManifestListener(e);break;case this.events.ERROR_NO_AD_AVAILABLE:case this.events.ERROR_VAST_NO_AD:this.manifestEmptyListener(e);break;case this.events.ERROR_VAST_VERSION_NOT_SUPPORTED:case this.events.ERROR_VAST_WRAPPER_LIMIT_REACH:case this.events.ERROR_VAST_XML_PARSING:case this.events.ERROR_PARSE:this.manifestWrongListener(e)}},slotListener:function(e){this.slot=e.slot;var t=this.plugin.getAdapter();switch(this.disable=!1,this.slot.getTimePositionClass()){case"POSTROLL":this.position=n.Constants.AdPosition.Postroll;break;case"MIDROLL":this.position=n.Constants.AdPosition.Midroll;break;case"PREROLL":t&&t.flags.isJoined?this.position=n.Constants.AdPosition.Midroll:this.position=n.Constants.AdPosition.Preroll;break;default:this.disable=!0}this.disable||(this.titles=this.slot.getAdInstances(),this.unregister(),this.plugin.fireInit(),this.fireInit())},playListener:function(e){this.disable||this.fireStart()},playingListener:function(e){this.disable||(this.fireStart(),this.fireJoin(),this.fireResume())},pauseListener:function(e){this.firePause()},resumeListener:function(e){this.playListener(),this.fireResume()},endedListener:function(e){this.fireStop()},skipListener:function(e){this.fireSkip()},clickListener:function(e){var t=e.adInstance.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0],i=(new Date).getTime();this.lastUrl===t&&i<(this.lastTime||0)+2e3||(this.lastUrl=t,this.lastTime=i,this.fireClick(t))},closeListener:function(e){this.register(),this.position!==n.Constants.AdPosition.Postroll||this.disable||this.plugin.fireStop()},errorListener:function(e){this.fireError(e.errorCode||e.subType,e.errorInfo),this.fireStop(),this.register()},register:function(e){var t=this.plugin.getAdapter();t&&!this.canRemoveListeners&&(t.registerListeners(),t.fireResume(),this.canRemoveListeners=!0)},unregister:function(e){var t=this.plugin.getAdapter();t&&this.canRemoveListeners&&(this.canRemoveListeners=!1,t.unregisterListeners(),t.firePause())},changeVideo:function(e){(this.flags.isStarted||this.flags.isInited)&&(this.fireStop(),this.plugin.fireStop(),this.register())}}),e.exports=n.adapters.Freewheel},40491(e){"use strict";e.exports=JSON.parse('{"name":"freewheel","type":"adapter","tech":"js","author":"Nice People At Work","version":"6.8.5","built":"2023-11-29","repo":"https://bitbucket.org/npaw/freewheel-adapter-js","libVersion":"^6.8.28","features":{"buffer":"monitor","seek":"monitor","error":true,"stop":true,"pause":true,"resume":true,"getters":["getPlayhead","getDuration","getTitle","getResource","getPlayerVersion","getPosition","getGivenBreaks","getBreaksTime","getGivenAds","getIsVisible","getAudioEnabled","getCreativeId"]},"ads":[]}')}}]);
2//# sourceMappingURL=sourcemaps/6752-474fac59bb133be1.bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.