!function(a,b,c,d){"use strict";function e(a,b){for(var c=0,d=a.length;c>0),z="attached",A="detached",B="extends",C="ADDITION",D="MODIFICATION",E="REMOVAL",F="DOMAttrModified",G="DOMContentLoaded",H="DOMSubtreeModified",I="<",J="=",K=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,L=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],M=[],N=[],O="",P=b.documentElement,Q=M.indexOf||function(a){for(var b=this.length;b--&&this[b]!==a;);return b},R=c.prototype,S=R.hasOwnProperty,T=R.isPrototypeOf,U=c.defineProperty,V=c.getOwnPropertyDescriptor,W=c.getOwnPropertyNames,X=c.getPrototypeOf,Y=c.setPrototypeOf,Z=!!c.__proto__,$=c.create||function a(b){return b?(a.prototype=b,new a):this},_=Y||(Z?function(a,b){return a.__proto__=b,a}:W&&V?function(){function a(a,b){for(var c,d=W(b),e=0,f=d.length;e>>0,g=0;g>>0,g=0;g>>0;if(e>d.length)throw new TypeError("negative length");for(var f=[],g=0;g>>0;if(e>d.length)throw new TypeError("negative length");for(var f=0;f>>0;if(0===e)return-1;var f=+c||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;var g=Math.max(f>=0?f:e-Math.abs(f),0);try{for(;g-1},a.fromNodeList=function(a){return Array.prototype.slice.call(a)},a.map=function(a,b,c){if(null==a)throw new TypeError("array is null or undefined");if("function"!=typeof b)throw new TypeError("callback must be a function");for(var d,e,f=Object(a),g=f.length>>>0,h=new Array(g),i=0;i>>0;if(0===d&&void 0===c)throw new TypeError("reduce of empty array with no initial value");var e,f=0;if(void 0!==c)e=c;else for(;;){if(f in a){e=a[f++];break}if(++f>=d)throw new TypeError("reduce of empty array with no initial value")}for(;f0?2==f.length?"function"==typeof f[1]?b[f[0]]=f[1].call(this,h):b[f[0]]=f[1]:3==f.length?"function"!=typeof f[1]||f[1].exec&&f[1].test?b[f[0]]=h?h.replace(f[1],f[2]):void 0:b[f[0]]=h?f[1].call(this,h,f[2]):void 0:4==f.length&&(b[f[0]]=h?f[3].call(this,h.replace(f[1],f[2])):void 0):b[f]=h?h:void 0;i+=2}return b},str:function(a,c){for(var d in c)if("object"==typeof c[d]&&c[d].length>0){for(var e=0;e=0?{$ref:d[g]}:(c.push(e),d.push(f),Array.isArray(e)?(h=[],e.forEach(function(b,c){h[c]=a(b,f+"["+c+"]")})):(h={},Object.keys(e).forEach(function(b){h[b]=a(e[b],f+"["+JSON.stringify(b)+"]")})),h))}(a,"$")},JSON.escMap={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},JSON.escFunc=function(a){return teads.JSON.escMap[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)},JSON.escRE=/[\\"\u0000-\u001F\u2028\u2029]/g,JSON}();teads.JSON=JSON}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){function b(){var b=a.Cookie.get("teadsDebugLevel");b&&(g=b.split(","),a.ArrayHelper.indexOf(g,"all")>=0&&(g=["debug","info","warn","error"]));var d=a.Cookie.get("teadsDebugNamespace");d&&(h=d.split(","),i="all"===String(d).toLowerCase()),g.length&&!a.Logger&&(c?(f.log("Teads Media Framework > Debug mode"),f.log("Package: teads-format-framework v2.9.2")):(f.log("%cTeads Media Framework %c> Debug mode","color:#7ebde5;font-family:Helvetica,sans-serif;font-size:2em;","color:#aaa;font-family:Helvetica,sans-serif;font-size:2em;"),f.log("%cPackage: teads-format-framework v2.9.2","color:#7ebde5;font-style:italic;")))}a.START_TIME=a.START_TIME||Date.now(),a.FULL_LOGS=a.FULL_LOGS||[];var c=!1;try{var d=navigator.userAgent;c=/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i.test(d)||/(?:ms|\()(ie)\s([\w\.]+)/i.test(d)||/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i.test(d)}catch(e){}var f,g=[],h=[],i=!1,j=function(){function a(){}return a.prototype.log=function(){},a}();f=window.console&&console.log?window.console:new j,b();var k=function(){function d(a){this.namespace=a,this.console=f}return d.prototype._log=function(e,j){var k=this;if(b(),j.length){for(var l=Date.now()-a.START_TIME,m=(l/1e3).toFixed(3)+"s",n="",o=0;o0&&(n+=" + "),"object"==typeof j[o])try{n+=a.JSON.stringify(j[o])}catch(p){n+=j[o]}else n+=j[o];if(a.FULL_LOGS.push({level:e,message:m+" ["+this.namespace+"] "+n}),!(a.ArrayHelper.indexOf(g,e)<0)){if(!i&&h.length){var q=a.ArrayHelper.some(h,function(a){return 0===k.namespace.indexOf(a)});if(!q)return}d.logs.push({level:e,message:m+" ["+this.namespace+"] "+j.join(" ")}),c?j=["Teads "+m+" ["+this.namespace+"] "+j.join(" ")]:j.unshift("Teads %c"+m+" "+this.namespace,"color:#7ebde5;");var r=f[e]||f.log;try{r.apply(f,j)}catch(s){Function.prototype.apply.apply(r,[f,j])}}}},d.prototype.debug=function(){for(var a=[],b=0;b0?b:null)},d.getLogs=function(){return d.logs},d.getFullLogs=function(){return a.FULL_LOGS},d.clear=function(){d.logs=[],a.FULL_LOGS=[]},d.logs=[],d}();a.Logger=k}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function a(){}return a.compareIdentifiers=function(a,b){return ab?1:0},a.compareMain=function(b,c){return a.compareIdentifiers(b.major,c.major)||a.compareIdentifiers(b.minor,c.minor)||a.compareIdentifiers(b.patch,c.patch)},a.compare=function(b,d){var e=new c(b),f=new c(d);return e.isValid&&f.isValid?a.compareMain(e,f):null},a.isGreaterThan=function(b,c){var d=a.compare(b,c);return null!==d&&d>0},a.isLowerThan=function(b,c){var d=a.compare(b,c);return null!==d&&d<0},a.isGreaterOrEqual=function(b,c){var d=a.compare(b,c);return null!==d&&d>=0},a.isLowerOrEqual=function(b,c){var d=a.compare(b,c);return null!==d&&d<=0},a.numeric=/^[0-9]+$/,a.MAX_LENGTH=256,a.MAX_SAFE_INTEGER=9007199254740991,a.NUMERICIDENTIFIER="0|[1-9]\\d*",a.MAINVERSION="("+a.NUMERICIDENTIFIER+")\\.("+a.NUMERICIDENTIFIER+")\\.("+a.NUMERICIDENTIFIER+")",a.FULL=new RegExp("^v?"+a.MAINVERSION+".*?$"),a}();a.Semver=b;var c=function(){function a(c){if(this.isValid=!0,"string"!=typeof c&&(c=""+c),c.length>b.MAX_LENGTH)return void(this.isValid=!1);var d=c.trim().match(b.FULL);if(!d){var e=c.split(".").length;return e<3?new a(c+".0"):void(this.isValid=!1)}return this.raw=c,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>b.MAX_SAFE_INTEGER||this.major<0?void(this.isValid=!1):this.minor>b.MAX_SAFE_INTEGER||this.minor<0?void(this.isValid=!1):this.patch>b.MAX_SAFE_INTEGER||this.patch<0?void(this.isValid=!1):void(this.version=this.major+"."+this.minor+"."+this.patch)}return a.prototype.toString=function(){return this.version},a}()}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){a.CONTEXT_IS_INITIALIZED=!1;var b=function(){function b(a){this.name=a.name||"",this.version=a.version||""}return b.prototype.toString=function(){return a.StringHelper.separate("|",this.name,this.version).toLowerCase()},b}();a.UABrowser=b;var c=function(){function b(a){this.name=a.name||"",this.version=a.version||""}return b.prototype.toString=function(){return a.StringHelper.separate("|",this.name,this.version).toLowerCase()},b}();a.UAOs=c;var d=function(){function b(c){this.model=c.model||"",this.type=c.type||(b.typeRegExp.test(e.getOS().name)?a.Ua.DESKTOP:""),this.vendor=c.vendor||""}return b.prototype.toString=function(){return a.StringHelper.separate("|",this.model,this.type,this.vendor).toLowerCase()},b.typeRegExp=/^windows|mac\s+os|linux|bsd|dragonfly|chromium\s+os|haiku|ubuntu|slackware|gentoo|solaris|debian|fedora|arch|beos|mint|gnu|os|suse\/2$/i,b}();a.UADevice=d;var e=function(){function e(){}return e.init=function(){a.CONTEXT_IS_INITIALIZED||(e.checkUserAgent(),e.checkLanguage(),e.os=new c(a.Ua.mapper.rgx.apply(this,a.Ua.regexes.os)),e.browser=new b(a.Ua.mapper.rgx.apply(this,a.Ua.regexes.browser)),e.device=new d(a.Ua.mapper.rgx.apply(this,a.Ua.regexes.device)),e.checkAmp(),e.checkFacebookIA(),e.checkIabSF(),e.checkEdgeTouchScreen(),e.checkUiWebview(),e.checkObserveIntersection(),e.cacheBrowserValues(),e.cacheOsValues(),e.cacheDeviceValues(),e.cacheVersionValues(),e.cacheCustomValues(),a.CONTEXT_IS_INITIALIZED=!0)},e.isReliable=function(){return e.reliable},e.ignore=function(){e.reliable=!1},e.checkUserAgent=function(){try{e.userAgent=navigator.userAgent}catch(a){e.logger.error("Could not get `navigator.userAgent`",a),e.userAgent="",e.ignore()}},e.checkLanguage=function(){try{e.language=window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||"en"}catch(a){e.logger.error("Could not get navigator language",a),e.language="en"}},e.checkAmp=function(){try{e.cache.amp=!!window._teads_amp}catch(a){e.logger.error("Could not check if `!!window._teads_amp`",a),e.cache.amp=!1}},e.checkFacebookIA=function(){try{e.cache.fbia=!!window._teads_fbia}catch(a){e.logger.error("Could not check if `!!window._teads_fbia`",a),e.cache.fbia=!1}},e.checkIabSF=function(){try{e.cache.iabsf=!!window.$sf&&!!window.$sf.ext}catch(a){e.logger.error("Could not check if `!!window.$sf.ext`",a),e.cache.iabsf=!1}},e.checkEdgeTouchScreen=function(){try{e.cache.edgeTouchScreen=navigator.maxTouchPoints&&navigator.maxTouchPoints>0}catch(a){e.logger.error("Could not check if `navigator.maxTouchPoints > 0`",a),e.cache.edgeTouchScreen=!1}},e.checkUiWebview=function(){try{e.cache.uiWebview=window.navigator.standalone}catch(a){e.logger.error("Could not check if `navigator.maxTouchPoints > 0`",a),e.cache.uiWebview=!1}},e.checkObserveIntersection=function(){ try{e.cache.observeIntersection=!(!window.context||!window.context.observeIntersection)}catch(a){e.logger.error("Could not check if `!!window.context.observeIntersection`",a),e.cache.observeIntersection=!1}},e.cacheBrowserValues=function(){e.cache.isIE="IE"===e.browser.name||/MSIE|Trident/.test(e.userAgent),e.cache.isFirefox="Firefox"===e.browser.name||/Firefox/i.test(e.userAgent),e.cache.isEdge="Edge"===e.browser.name||/Edge/i.test(e.userAgent),e.cache.isSafari="Safari"===e.browser.name||"Mobile Safari"===e.browser.name,e.cache.isChrome="Chrome"===e.browser.name,e.cache.isChromeWebView="Chrome WebView"===e.browser.name,e.cache.isEdgeTouchScreen=e.isEdge()&&e.cache.edgeTouchScreen,e.cache.isChromeIos=/CriOS/i.test(e.userAgent),e.cache.isAndroidNative="Android Browser"===e.browser.name,e.cache.isFacebookWebview="Facebook"===e.browser.name||/FBAN|FBIOS|FBAV|FBBV|FBDV|FBMD|FBSN|FBSV|FBSS|FBCR|FBID|FBLC|FBOP/i.test(e.userAgent)},e.cacheOsValues=function(){e.cache.isIpad="iPad"===e.device.model||/iPad/i.test(e.userAgent),e.cache.isIphone="iPhone"===e.device.model||/iPhone/i.test(e.userAgent),e.cache.isIos="iOS"===e.os.name||e.isIpad()||e.isIphone(),e.cache.isAndroid="Android"===e.os.name||/Android/i.test(e.userAgent)},e.cacheDeviceValues=function(){var a=/(m|M)obile/.test(e.userAgent);e.cache.isTablet="tablet"===e.device.type||e.isIpad()||e.isAndroid()&&!a,e.cache.isMobile="mobile"===e.device.type||e.isIos()&&!e.isIpad()||e.isAndroid()&&a,e.cache.isDesktop=!e.isMobile()&&!e.isTablet()},e.cacheVersionValues=function(){e.cache.ieVersion=e.isIE()?e.browser.version:null,e.cache.iOsVersion=e.isIos()?e.os.version:null,e.cache.androidVersion=e.isAndroid()?e.os.version:null,e.cache.chromeVersion=e.isChrome()?e.browser.version:null,e.cache.chromeWebViewVersion=e.isChromeWebView()?e.browser.version:null},e.cacheCustomValues=function(){e.cache.isAndroidMobile=e.isAndroid()&&e.isMobile(),e.cache.isAmpObserveIntersection=e.cache.amp&&e.cache.observeIntersection,e.cache.isUIWebview=(e.isIphone()||e.isIpad())&&!e.isSafari()&&!e.cache.uiWebview,e.cache.isIos10Safari=a.Semver.isGreaterOrEqual(e.getIosVersion(),"10")&&!e.isUIWebview()&&!e.isChromeIos()},e.isDesktop=function(){return e.cache.isDesktop},e.isIpad=function(){return e.cache.isIpad},e.isTablet=function(){return e.cache.isTablet},e.isMobile=function(){return e.cache.isMobile},e.isChromeIos=function(){return e.cache.isChromeIos},e.isFacebookWebview=function(){return e.cache.isFacebookWebview},e.isAndroidNative=function(){return e.cache.isAndroidNative},e.isAndroid=function(){return e.cache.isAndroid},e.isIos=function(){return e.cache.isIos},e.isIphone=function(){return e.cache.isIphone},e.isAndroidMobile=function(){return e.cache.isAndroidMobile},e.isIE=function(){return e.cache.isIE},e.isChrome=function(){return e.cache.isChrome},e.isChromeWebView=function(){return e.cache.isChromeWebView},e.isFirefox=function(){return e.cache.isFirefox},e.isEdge=function(){return e.cache.isEdge},e.isAmp=function(){return e.cache.amp},e.isFacebookIA=function(){return e.cache.fbia},e.isAmpObserveIntersection=function(){return e.cache.isAmpObserveIntersection},e.isIABSafeFrame=function(){return e.cache.iabsf},e.isEdgeTouchScreen=function(){return e.cache.isEdgeTouchScreen},e.getIEVersion=function(){return e.cache.ieVersion},e.getAndroidVersion=function(){return e.cache.androidVersion},e.getChromeVersion=function(){return e.cache.chromeVersion},e.getChromeWebViewVersion=function(){return e.cache.chromeWebViewVersion},e.getIosVersion=function(){return e.cache.iOsVersion},e.isUIWebview=function(){return e.cache.isUIWebview},e.isSafari=function(){return e.cache.isSafari},e.isIos10Safari=function(){return e.cache.isIos10Safari},e.isWhiteListedIos10Safari=function(a){return void 0===a&&(a=null),e.isIos10Safari()&&!e.blackListRealHtml5Player.test(a)},e.videoSupport=function(a){return!!a.createElement("video").canPlayType},e.getLanguage=function(){return e.language},e.getUA=function(){return e.userAgent},e.setUA=function(a){e.userAgent=a},e.getDevice=function(){return e.device},e.getOS=function(){return e.os},e.getBrowser=function(){return e.browser},e.canChromeAndroidAutoPlay=function(b,c){if(null===e.chromeAndroidAutoPlayEnable&&"function"==typeof b&&"string"==typeof c)if(e.isAndroid()&&(a.Semver.isGreaterOrEqual(e.getChromeVersion(),"53")||a.Semver.isGreaterOrEqual(e.getChromeWebViewVersion(),"53"))){var d=document.createElement("video");d.src=c,d.style.display="none",d.muted=!0,document.body.appendChild(d);var f=null,g=Date.now(),h=function(a,c){clearTimeout(f);var h=Date.now()-g;null===e.chromeAndroidAutoPlayEnable&&(e.chromeAndroidAutoPlayEnable=a,b(c+"-"+h),d.pause(),document.body.removeChild(d))};d.play().then(function(){h(!0,"autoplay enable")}).catch(function(){h(!1,"autoplay disable")}),f=setTimeout(function(){h(!0,"autoplay timeout")},200)}else e.chromeAndroidAutoPlayEnable=!1,b();return e.chromeAndroidAutoPlayEnable},e.isCanvasNeededOnAndroid=function(){return e.isAndroid()&&(a.Semver.isGreaterOrEqual(e.getChromeWebViewVersion(),"56")||a.Semver.isGreaterOrEqual(e.getChromeVersion(),"56"))&&!e.chromeAndroidAutoPlayEnable},e.getContextSummary=function(){var a=e.isMobile()&&!e.isTablet()?"mob":e.isTablet()?"tab":"desk",b=e.isAndroid()?"android":e.isIos()?"ios":e.isIE()?"ie":e.isChrome()?"ch":e.isFirefox()?"ff":"ot";return[a,b].join(" ")},e.logger=new a.Logger("Context"),e.reliable=!0,e.cache={},e.blackListRealHtml5Player=/^(23027|24539|25695|25696|25697|25698|25699|25700|25701|25702|25703|25704|25705|25706|25707|25708|25709|25710|25711|26170|26231|26561|26566|26567|26568|26569|26570|26572|27446|28204|28206|28207|28210|28211|28212|28827|28831|31814|34907|43985|49718|52375|53276|53824|53837|53838|53840|53842|55491|57698|57699|57702|57907|60178|60578|61059|61123)$/,e.chromeAndroidAutoPlayEnable=null,e}();a.Context=e,e.init()}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.hasFlash=function(){if(a.Context.isMobile()||a.Context.isTablet())return!1;var c=b.getFlashVersion().map(function(a){return parseInt(a,10)});return c[0]>=b.requiredVersion[0]&&c[1]>=b.requiredVersion[1]},b.hasFlashVersion=function(a){return a>=parseInt(b.getFlashVersion()[0],10)},b.getFlashVersion=function(){try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{a.AllowScriptAccess="always"}catch(b){return["6","0","0"]}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1].split(",")}catch(c){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1].split(",")}catch(d){}}return["0","0","0"]},b.requiredVersion=[10,0],b}();a.FlashHelper=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.seconds=function(a){if(!a)return NaN;var b=a.split("."),c=b[0].split(":"),d=3600*Number(c[0])+60*Number(c[1])+Number(c[2]);return 2===b.length&&(d=Number(d+"."+b[1])),d},b.offset=function(b){void 0===b&&(b=0);var c=b?Math.floor(b/3600):0;b-=3600*c;var d=b?Math.floor(b/60):0;b-=60*d;var e=(b%1).toFixed(3).substr(1);return b=Math.floor(b),a.StringHelper.pad(c)+":"+a.StringHelper.pad(d)+":"+a.StringHelper.pad(b)+e},b.hasFlash=function(){return a.FlashHelper.hasFlash()},b.getAudioContext=function(){return window.AudioContext||window.webkitAudioContext},b.extend=function(){for(var a=[],c=0;ctype>subtype>level>pid "},b.LOG_LEVELS={CLASSIC:{INFO:"info",METADATA:"metadata",WARNING:"warning",ERROR:"error"},LIGHT:{INFO:"info",METADATA:"meta",WARNING:"warn",ERROR:"err"}},b.CONFIGS={FORMAT:{collector:b.COLLECTORS.FORMAT,prefixPattern:b.PREFIX_PATTERNS.CLASSIC,logLevels:b.LOG_LEVELS.CLASSIC,formattingType:a.LogSender.FORMATTING_TYPES.JSON},PLAYER:{collector:b.COLLECTORS.PLAYER,prefixPattern:b.PREFIX_PATTERNS.CLASSIC,logLevels:b.LOG_LEVELS.CLASSIC,formattingType:a.LogSender.FORMATTING_TYPES.JSON},ROUTER:{collector:b.COLLECTORS.ROUTER,prefixPattern:b.PREFIX_PATTERNS.CLASSIC,logLevels:b.LOG_LEVELS.CLASSIC,formattingType:a.LogSender.FORMATTING_TYPES.JSON}},b}();a.Sumologic=b}(teads||(teads={}));var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function a(a,b){this.code=a,this.error=b}return a.get=function(b,c,d){return new a({id:b,message:c},d)},a.prototype.getMessage=function(){return"Error #"+this.code.id+": "+this.code.message},a.prototype.getId=function(){return this.code.id},a.prototype.getStackTrace=function(){return this.error&&this.error.stack?this.error.stack:""},a.prototype.toString=function(){return this.getMessage()},a}();a.Exception=b;var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.XML_PARSE={id:100,message:"XML parsing error"},b.XML_INVALID_SCHEMA={id:101,message:'VAST schema validation error: expected "%s" but found "%s"'},b.UNSUPPORTED_VERSION={id:102,message:"VAST version of response not supported. Expected VAST2 or VAST3 but VAST1 found"},b.TRAFFICKING={id:200,message:"Trafficking error. Video player received an Ad type that it was not expecting and/or cannot display"},b.LINEARITY={id:201,message:"Video player expecting different linearity"},b.DURATION={id:202,message:"Video player expecting different duration"},b.SIZE={id:203,message:"Video player expecting different size"},b.WRAPPER={id:300,message:"General Wrapper error"},b.WRAPPER_TIMEOUT={id:301,message:"Timeout of VAST URI provided in Wrapper element, or of VAST URI provided in a subsequent Wrapper element (URI was either unavailable or reached a timeout as defined by the video player)"},b.WRAPPER_LIMIT={id:302,message:"Wrapper limit reached, as defined by the video player. Too many Wrapper responses have been received with no InLine response"},b.NO_ADS={id:303,message:"No Ads VAST response after one or more Wrappers"},b.GENERAL_LINEAR={id:400,message:"General Linear error. Video player is unable to display the Linear Ad."},b.FILE_NOT_FOUND={id:401,message:"File not found. Unable to find Linear/MediaFile from URI."},b.MEDIAFILE_TIMEOUT={id:402,message:"Timeout of MediaFile URI."},b.UNSUPPORTED_MEDIAFILE={id:403,message:"Could not find MediaFile that is supported by this video player, based on the attributes of the MediaFile element."},b.MEDIAFILE_DISPLAY={id:405,message:"Problem displaying MediaFile. Video player found a MediaFile with supported type but could not display it. MediaFile may include: unsupported codecs, different MIME type than MediaFile@type, unsupported delivery method, etc."},b.GENERAL_NONLINEAR={id:500,message:"General NonLinearAds error."},b.CREATIVE_DIMENSIONS={id:501,message:"Unable to display NonLinear Ad because creative dimensions do not align with creative display area (i.e. creative dimension too large)."},b.NONLINEAR_FETCH={id:502,message:"Unable to fetch NonLinearAds/NonLinear resource."},b.SUPPORTED_NONLINEAR_NOT_FOUND={id:503,message:"Could not find NonLinear resource with supported type."},b.GENERAL_COMPANION={id:600,message:"General CompanionAds error."},b.COMPANION_DIMENSIONS={id:601,message:"Unable to display Companion because creative dimensions do not fit within Companion display area (i.e., no available space)."},b.COMPANION_DISPLAY={id:602,message:"Unable to display Required Companion."},b.COMPANION_FETCH={id:603,message:"Unable to fetch CompanionAds/Companion resource."},b.SUPPORTED_COMPANION_NOT_FOUND={id:604,message:"Could not find Companion resource with supported type."},b.UNDEFINED={id:900,message:"Undefined Error"},b.GENERAL={id:901,message:"General VPAID error"},b}(b);a.VastException=c}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.getBoundingClientRect=function(b){var c;try{c=b.getBoundingClientRect()}catch(d){return{left:0,top:0,right:0,bottom:0,width:0,height:0}}if(a.Context.isIE()&&b.ownerDocument.body){var e=b.ownerDocument;if(c.left-=e.documentElement.clientLeft+e.body.clientLeft,c.top-=e.documentElement.clientTop+e.body.clientTop,void 0===c.width&&b.offsetWidth)return{left:c.left,top:c.top,right:c.right,bottom:c.bottom,width:b.offsetWidth,height:b.offsetHeight}}return c},b.getSize=function(c){var d=c.offsetWidth,e=c.offsetHeight,f=a.Context.getUA().indexOf("WebKit")>-1&&!d&&!e;if((!d||f)&&c.getBoundingClientRect){var g=b.getBoundingClientRect(c);return{width:g.right-g.left,height:g.bottom-g.top}}return{width:d,height:e}},b.getTextContent=function(c,d){if(a.ArrayHelper.indexOf(b.TAGS_TO_IGNORE,c.nodeName)>=0);else if(c.nodeType===b.NODE_TYPES.TEXT)d.push(c.nodeValue);else if(c.nodeName in b.PREDEFINED_TAG_VALUES)d.push(b.PREDEFINED_TAG_VALUES[c.nodeName]);else for(var e=c.firstChild;e;)b.getTextContent(e,d),e=e.nextSibling},b.isEmpty=function(c,d){if(void 0===d&&(d=window),c){var e=c.tagName.toLowerCase(),f=["iframe","object","img"];return!(a.ArrayHelper.includes(f,e)||b.querySelectorAll(f.join(","),d,c).length>0||""!==c.textContent.trim())}},b.querySelectorAll=function(a,b,c){return void 0===c&&(c=null),c=c||b.document,c.querySelectorAll(a)},b.isInternalLink=function(a,b){return!("A"!==a.tagName||!a.href)&&(b.document.location.host===a.host&&(!(a.target&&!/^_(self|top)$/i.test(a.target))&&b.document.location.href.split("#")[0]!==a.href.split("#")[0]))},b.getWindowSize=function(b){if(void 0===b&&(b=window),a.Context.isIABSafeFrame()){var c=window.$sf.ext.geom();return{width:c.win.w,height:c.win.h}}return"number"==typeof b.innerWidth?{width:b.innerWidth,height:b.innerHeight}:b.document.documentElement&&(b.document.documentElement.clientWidth||b.document.documentElement.clientHeight)?{width:b.document.documentElement.clientWidth,height:b.document.documentElement.clientHeight}:b.document.body&&(b.document.body.clientWidth||b.document.body.clientHeight)?{width:b.document.body.clientWidth,height:b.document.body.clientHeight}:{width:1e3,height:600}},b.inject=function(a,b){void 0===b&&(b=window);var c=b.document.getElementsByTagName("head")[0]||b.document.body;c.appendChild(a)},b.addEventListener=function(a,c,d){c.addEventListener?c.addEventListener(a,d,!0):c.attachEvent?c.attachEvent("on"+a,d):b.logger.warn("Trying to addEventListener on bad object",c)},b.removeEventListener=function(a,c,d){try{c.removeEventListener?c.removeEventListener(a,d,!0):c.attachEvent?c.detachEvent("on"+a,d):b.logger.warn("Trying to removeEventListener on bad object",c)}catch(e){}},b.onDomReady=function(a,c){void 0===c&&(c=window),!c.document||"complete"!==c.document.readyState&&"loaded"!==c.document.readyState&&"interactive"!==c.document.readyState?c.addEventListener?c.addEventListener("DOMContentLoaded",a,!1):c.attachEvent&&c===c.top?1===b.readyQueue.push(a)&&b.readyIEtop(c):c.attachEvent&&c.attachEvent("onload",a):"interactive"===c.document.readyState&&c.document.attachEvent?c.document.attachEvent("onreadystatechange",function(){"complete"!==c.document.readyState&&"loaded"!==c.document.readyState||a()}):a()},b.onDomComplete=function(a,c,d){void 0===c&&(c=window),void 0===d&&(d=this),"complete"===c.document.readyState?a.call(d):b.addEventListener("load",c,function(){a.call(d)})},b.getScrollLeft=function(a){return a.pageXOffset?a.pageXOffset:"CSS1Compat"===(a.document.compatMode||"")?a.document.documentElement.scrollLeft:a.document.body.scrollLeft},b.getScrollTop=function(a){return a.pageYOffset?a.pageYOffset:"CSS1Compat"===(a.document.compatMode||"")?a.document.documentElement.scrollTop:a.document.body.scrollTop},b.getElementsByClassName=function(a,c,d){if(void 0===d&&(d=window),c=c||d.document,c.getElementsByClassName)return c.getElementsByClassName(a);for(var e=a.split(" "),f="",g=0,h=e.length;g=c._teads_amp.change.boundingClientRect.height*d;if(a.Context.isIABSafeFrame()){var f=c.$sf.ext.geom();return!(!f||!f.self)&&f.self.yiv>=d}var g=a.Dom.getWindowSize(c),h=a.Dom.getBoundingClientRect(b),i=h.top+e*d,j=h.top+e*(1-d),k=i>=0&&i=0&&j0?f.height-g.top:g.top+d,i=h/d;return i=i>0?i:0,i=i<1?i:1},b.findFloatingHeaders=function(c,d){void 0===c&&(c=window),void 0===d&&(d=[]);for(var e,f,g,h=[],i=a.Dom.getWindowSize(c),j=i.width/2,k=i.height*b.MAX_FLOATING_TOP,l=k*b.MAX_FLOATING_TOP,m=1;m0?b.join("="):void 0;c[d]=e}),c):c},b}();a.URIHelper=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){var b=this;this.serviceUrl=a.Utils.getProtocol()+(location.hostname.match(/sandbox.teads.net$/)?"//"+location.hostname+":18091":"//wigo.teads.tv"),this.domain=/teads\.(tv|net:\d+)$/,this.color="blue",this.statusDetails="";var c=a.HTMLHelper.findParentWindows(document.body);this.topWindow=c.pop()||window;var d=function(a){var c=a.data.wigoLiveDebug;a.origin.match(b.domain)&&c&&c.length&&c.length>1&&(b.debugKey=c[1],b.createDebugButton(b.color),b.recordUserActions())};try{this.topWindow.addEventListener("message",d)}catch(e){this.topWindow=window,this.topWindow.addEventListener("message",d)}this.elapsedTime=0,this.logfile={date:(new Date).toString(),device:a.Context.getDevice().toString().replace(/\|/g," "),os:a.Context.getOS().toString().replace(/\|/g," "),browser:a.Context.getBrowser().toString().replace(/\|/g," "),url:location.href,steps:[],logs:[],timeline:[]}}return b.prototype.recordUserActions=function(){var b=this;this.elapsedTime<3e5&&setTimeout(function(){var c,d=b.topWindow.document.getElementsByClassName("teads-player")[0];c=d?{time:b.elapsedTime,scrollX:a.Dom.getScrollLeft(b.topWindow),scrollY:a.Dom.getScrollTop(b.topWindow),screenWidth:a.Dom.getWindowSize(b.topWindow).width,screenHeight:a.Dom.getWindowSize(b.topWindow).height,player:{top:a.Dom.getBoundingClientRect(d).top,height:a.Dom.getBoundingClientRect(d).height,left:a.Dom.getBoundingClientRect(d).left,width:a.Dom.getBoundingClientRect(d).width}}:{time:b.elapsedTime,scrollX:a.Dom.getScrollLeft(b.topWindow),scrollY:a.Dom.getScrollTop(b.topWindow),screenWidth:a.Dom.getWindowSize(b.topWindow).width,screenHeight:a.Dom.getWindowSize(b.topWindow).height,player:{top:0,height:0,left:0,width:0}};var e=b.logfile.timeline[b.logfile.timeline.length-1];e?b.compareTimeEvents(c,e)||b.logfile.timeline.push(c):b.logfile.timeline.push(c),b.elapsedTime+=100,b.recordUserActions()},100)},b.prototype.valid=function(a,c,d,e){this.addValidEvent(a,c,{store:d,type:e}),e==b.infoType.ERROR?this.setStatus(!1,d):3==a&&2==c&&this.setStatus(!0,"ready")},b.prototype.videoEvent=function(a,b,c,d){this.addValidEvent(0,0,{store:{name:a,time:b,percent:c,pixels:d},type:"videoEvent"})},b.prototype.addValidEvent=function(a,b,c){var d={step:a,substep:b,info:c};this.logfile.steps.push(d)},b.prototype.createDebugButton=function(b){var c=this;if(this.debugKey&&!this.button){var d=this.topWindow.document.createElement("div");d.innerHTML='
\n
\n',this.button=d.firstChild,this.button.onclick=function(a){c.saveFile(),a.stopPropagation()},this.topWindow.document.body.appendChild(this.button),this.status=this.button.firstChild,this.status.style.backgroundColor=b,this.status.innerHTML=this.statusDetails,this.loader=this.status.nextSibling,"blue"!=this.color?(this.status.style.display="block",this.loader.style.display="none"):(this.status.style.display="none", this.loader.style.display="block"),a.Context.isAmp()&&teads.helper.AmpResize&&("red"===b&&(teads.helper.AmpResize.ratio=4),setTimeout(function(){return c.forceAmpOpen()},1e3))}},b.prototype.setStatus=function(a,b){void 0===b&&(b="");var c=a?"green":"red";this.button?(this.status.style.backgroundColor=c,this.status.style.display="block",this.loader.style.display="none",this.status.innerHTML=b):(this.color=c,this.statusDetails=b)},b.prototype.forceAmpOpen=function(){var a=this;if(!teads.helper.AmpResize.isVisible()){var b=setTimeout(function(){return a.forceAmpOpen()},1e3);teads.helper.AmpResize.open(function(){a.button.style.display="none",setTimeout(function(){return a.button.style.display="block"},100),clearTimeout(b)})}},b.prototype.saveFile=function(){var b=this;if(this.debugKey){this.button.onclick=function(a){a.stopPropagation()},this.logfile.logs=a.Logger.getFullLogs();var c=this.debugKey+"_"+Date.now()+".json",d=function(){setTimeout(function(){b.button.onclick=function(a){b.saveFile(),a.stopPropagation()}},500)},e=a.Request.createXmlHttpRequest();e.open("PUT",this.serviceUrl+"/livedebug/upload/"+c,!0),e.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.onload=function(){d()},e.send(a.JSON.stringify(this.logfile,!0)),e.onerror=function(){d()},window.open(this.serviceUrl+"/livedebug?file="+c)}},b.prototype.compareTimeEvents=function(a,b){return a.scrollX==b.scrollX&&a.scrollY==b.scrollY&&a.screenWidth==b.screenWidth&&a.screenHeight==b.screenHeight&&a.player.top==b.player.top&&a.player.height==b.player.height&&a.player.left==b.player.left&&a.player.width==b.player.width},b.prototype.getDebugKey=function(){return this.debugKey},b.infoType={MODAL:"modal",STRING:"string",VIDEO_EVENT:"videoEvent",ERROR:"error"},b}();a.Wigo=b,a.WIGOI=a.WIGOI||new b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.decode=function(b){if("object"==typeof b&&b.AdParameters&&"string"==typeof b.AdParameters&&(b=b.AdParameters),b&&"string"==typeof b){a.Base64.isBase64(b)?b=a.Base64.decode(b):0===b.indexOf("%7B")&&(b=decodeURIComponent(b));try{b=a.JSON.parse(b)}catch(c){throw"Unable to JSON.parse adParameter string: "+b}}if(!b||"object"!=typeof b)throw"adParameter is not an object: "+b;return b},b}();a.AdParameterHelper=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function a(){}return a.isBase64=function(a){var b=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"),c=b.exec(a);return!!(c&&c.length>0)},a.encode=function(a){return window.btoa?btoa(a):a},a.decode=function(a){return window.atob?atob(a):a},a}();a.Base64=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){this.logger=new a.Logger("EventListenerManager"),this.listeners={}}return b.prototype.add=function(b,c,d){var e="string"==typeof b;e||this.logger.warn("First argument of EventListenerManager.add must be a string",b),this.logger.debug("Add listener to event",b),this.listeners[b]||(this.listeners[b]=[]),this.listeners[b].push({context:c,callback:d}),a.Dom.addEventListener(b,c,d)},b.prototype.addMultiple=function(b,c,d){var e=this,f="[object Array]"===Object.prototype.toString.call(b);f||this.logger.warn("First argument of EventListenerManager.addMultiple must be an array of strings",b),a.ArrayHelper.forEach(b,function(a){e.add(a,c,d)})},b.prototype.remove=function(b){var c="string"==typeof b;c||this.logger.warn("First argument of EventListenerManager.add must be a string",b),this.logger.debug("Remove listener from event",b),a.ArrayHelper.forEach(this.listeners[b],function(c){a.Dom.removeEventListener(b,c.context,c.callback)})},b.prototype.removeMultiple=function(b){var c=this,d="[object Array]"===Object.prototype.toString.call(b);d||this.logger.warn("First argument of EventListenerManager.addMultiple must be an array of strings",b),a.ArrayHelper.forEach(b,function(a){c.remove(a)})},b.prototype.removeAll=function(){for(var b in this.listeners)this.listeners.hasOwnProperty(b)&&a.ArrayHelper.forEach(this.listeners[b],function(c){a.Dom.removeEventListener(b,c.context,c.callback)})},b}();a.EventListenerManager=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(c,d,e){var f=this;if(this.win=c,this.onVisible=d,this.onHidden=e,this.prefixes=["","webkit","ms","moz"],this.props=["VisibilityState","visibilitychange","Hidden"],this.isInitialState=!0,this.enabled=!0,this.isAmpVisible=!0,this.eventTimeout=null,this.intervalIABSafeFrame=null,this.intervalFocus=null,this.windows=[],b.logger.debug("init"),this.eventListenerManager=new a.EventListenerManager,a.Context.isAmp()){b.logger.debug("Init AMP visibility plugin");var g=function(a){window.context.hidden&&f.isAmpVisible?(b.logger.debug("AMP visibility, window is hidden, call hidden callback"),f.isAmpVisible=!1,f.onHiddenCallback()):window.context.hidden||f.isAmpVisible||(b.logger.debug("AMP visibility, window is visible, call visibile callback"),f.isAmpVisible=!0,f.onVisibleCallback())};return void this.eventListenerManager.add("amp:visibilitychange",window,g)}if(a.Context.isIABSafeFrame()){var h,i=!0;return void(this.intervalIABSafeFrame=setInterval(function(){h=f.isVisible(),h&&!i?(i=!0,f.onVisibleCallback()):!h&&i&&(i=!1,f.onHiddenCallback())},500))}this.prefix=this.getPrefix(),this.addWindow(this.win),this.visibleWindow=this.win}return b.listenWindow=function(a,c,d){var e=new b(a,c,d);return e},b.prototype.destroy=function(){var c=this;try{if(a.Context.isAmp())return void this.eventListenerManager.remove("amp:visibilitychange");a.Context.isIABSafeFrame()&&clearInterval(this.intervalIABSafeFrame),clearInterval(this.intervalFocus),this.eventListenerManager.removeAll(),a.ArrayHelper.forEach(this.windows,function(a){a.focus(),c.removeWindow(a,!1,!1)}),b.logger.debug("destroy")}catch(d){b.logger.error("Visibility could not be fully destroyed.",d)}finally{this.disable(),this.windows=[]}},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.isEnabled=function(){return this.enabled},b.prototype.isVisible=function(){var b;return b=a.Context.isAmp()?this.isAmpVisible:a.Context.isIABSafeFrame()?window.$sf.ext.winHasFocus?window.$sf.ext.winHasFocus():!document.hidden:!!this.visibleWindow},b.prototype.addWindow=function(b){var c=this;a.ArrayHelper.indexOf(this.windows,b)===-1&&this.windows.push(b),this.addListener(b,function(){return c.setWindowVisible(b)},function(){return c.setWindowHidden(b)})},b.prototype.removeWindow=function(b,c,d){if(void 0===c&&(c=!0),void 0===d&&(d=!0),a.ArrayHelper.indexOf(this.windows,b)>-1){var e=this.isVisible();d&&this.windows.splice(a.ArrayHelper.indexOf(this.windows,b),1),c&&e&&!this.isVisible()&&this.onHiddenCallback()}},b.prototype.getWindows=function(){return this.windows},b.prototype.addListener=function(c,d,e){var f=this;try{var g=c.document;if(this.prefixesSupported(g)){var h=function(){g[f.getPrefixedMethod(f.props[2])]?e():d()};this.eventListenerManager.add(this.getPrefixedMethod(this.props[1]),g,h)}else if(g.hasFocus)b.logger.debug("Add listener on hasFocus method with an interval of 100ms"),clearInterval(this.intervalFocus),this.intervalFocus=setInterval(function(){g.hasFocus()?d():e()},100);else{var i=a.HTMLHelper.findParentWindows(this.win.document.body).concat(a.HTMLHelper.findChildWindows(this.win.document.body,!0));a.ArrayHelper.forEach(i,function(a){f.addWindow(a)}),b.logger.debug("Add listener on focus and blur events");var j=function(a){b.logger.debug("Exec callback visible"),d()},k=function(a){b.logger.debug("Exec callback hidden"),c===a.target&&e()};c.tt_visibility_visible=j,c.tt_visibility_hidden=k,c.hasOwnProperty("onpageshow")&&(this.eventListenerManager.add("pageshow",c,function(a){b.logger.debug("pageshow event received"),j(a)}),this.eventListenerManager.add("pagehide",c,function(a){b.logger.debug("pagehide event received"),k(a)})),this.eventListenerManager.add("focus",c,function(a){b.logger.debug("focus event received"),clearTimeout(f.eventTimeout),j(a)}),this.eventListenerManager.add("blur",c,function(a){b.logger.debug("blur event received"),f.eventTimeout=setTimeout(function(){k(a)},10)})}}catch(l){}},b.prototype.setWindowVisible=function(a){this.isInitialState||this.isVisible()||(b.logger.debug("onVisible callback exec"),this.onVisibleCallback(),this.visibleWindow=a)},b.prototype.setWindowHidden=function(c){this.isInitialState=!1,a.Context.isIABSafeFrame()&&this.isVisible()||this.isVisible()&&(this.visibleWindow=null,b.logger.debug("onHidden callback exec"),this.onHiddenCallback())},b.prototype.onVisibleCallback=function(){this.enabled&&this.onVisible()},b.prototype.onHiddenCallback=function(){this.enabled&&this.onHidden()},b.prototype.getPrefixedMethod=function(a,b){return b=b||(void 0!==this.prefix?this.prefix:""),""===b?a.toLowerCase():b+a},b.prototype.getPrefix=function(a){a||(a=window.document);for(var b=0,c=this.prefixes.length;b
';this.creativeContainer.contentWindow.document.write(j),this.creativeContainer.contentWindow.document.close(),this.vpaidContainer=this.creativeContainer.contentWindow.document.getElementById("vpaid-container"),this.videoContainer=this.creativeContainer.contentWindow.document.getElementById("video-container"),this.loadTimeoutId=setTimeout(function(){h||i(b.ErrorCode.LOAD_VPAID_TIMEOUT)},b.Timeout.loadVpaid)},d.prototype.getEnvironmentVars=function(c){var d=this;if(!this.environmentVars){var e,f=this.vpaidContainer;this.config.useCustomVideo?(this.creativeContainer.contentWindow.document.registerElement||(this.creativeContainer.contentWindow.document.registerElement=document.registerElement),this.creativeContainer.contentWindow.teads=this.creativeContainer.contentWindow.teads||a,this.creativeContainer.contentWindow.teads.video=a.video,e=new this.creativeContainer.contentWindow.teads.video.HTMLVideoCanvas,e.addEventListener(a.video.dom.MediaEvent.error,function(c){if(d.logger.error("receive video error event",c,e.error),d.callback){d.logger.debug("callback ready to handle video error");var f="unknow video error";switch(e.error.code){case a.video.constant.MediaError.MEDIA_ERR_NETWORK:f="MediaProxy not ready"}d.logger.error(f),d.callback(new b.VPAIDEvent(b.VPAIDEvent.AdError,{message:f,id:a.VastException.UNSUPPORTED_MEDIAFILE.id}))}else d.logger.error("callback not ready to handle video error")},!1)):(e=this.creativeContainer.contentWindow.document.createElement("video"),e.setAttribute("webkit-playsinline","true"),e.setAttribute("playsinline","true"),e.setAttribute("muted","true"));var g=[/^((http|https)\:){0,1}\/\/.*\.moatads\.com\/[^\/]*\/moatwrapper\.js.*/,/^((http|https)\:){0,1}\/\/.*\.measuread\.com\/TL\.js.*/,/^((http|https)\:){0,1}\/\/.*\.serving\-sys\.com\/.*\/.*VPAIDAPI\.js$/];this.url&&this.videoContainer&&a.ArrayHelper.forEach(g,function(a){a.test(d.url)&&d.videoContainer.appendChild(e)}),e.addEventListener("playing",function(){e.parentNode||d.videoContainer.appendChild(e)});var h={slot:f,videoSlot:e,videoSlotCanAutoPlay:!0};c||(c=h);for(var i in h)c[i]||(c[i]=h[i]);this.environmentVars=c,this.environmentVars.slot!==f&&(this.mainContainer.style.display="none")}return this.environmentVars},d.prototype.destroy=function(){c.prototype.destroy.call(this),this.mainContainer&&this.mainContainer.parentNode&&(this.mainContainer.parentNode.removeChild(this.mainContainer),this.mainContainer=null,this.videoContainer=null)},d.prototype.resize=function(a,b){if(this.currentWidth=a,this.currentHeight=b,this.mainContainer&&(this.mainContainer.style.width=a+"px",this.mainContainer.style.height=b+"px"),this.creativeContainer&&(this.creativeContainer.style.width=a+"px",this.creativeContainer.style.height=b+"px"),this.videoContainer){this.videoContainer.style.width=a+"px",this.videoContainer.style.height=b+"px";var c=this.videoContainer.getElementsByTagName("video")[0];c&&(c.videoWidth=a,c.videoHeight=b,c.width=a,c.height=b,c.style.width=a+"px",c.style.height=b+"px")}this.vpaidContainer&&(this.vpaidContainer.style.width=a+"px",this.vpaidContainer.style.height=b+"px")},d.prototype.setBackground=function(a){c.prototype.setBackground.call(this,a),this.videoContainer&&(this.videoContainer.style.backgroundColor=this.backgroundColor)},d.prototype.getType=function(){return b.CreativeType.JS},d.prototype.registerVPAIDEventHandler=function(a){this.callback=a;for(var c in b.VPAIDEvent)this.vpaid.subscribe(b.VPAIDHelper.createVPAIDEventCallback(a,c),c,this);for(var c in b.CustomVPAIDEvent)this.vpaid.subscribe(b.VPAIDHelper.createVPAIDEventCallback(a,c),c,this)},d}(b.BaseVPAIDContainer);b.VPAIDJSContainer=c}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){a.asset={vpaidswfwrapper:"vpaidwrapper.swf",sandbox:"vpaid-sandbox.html"}}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(){c.apply(this,arguments)}return __extends(d,c),d.prototype.loadVpaid=function(c,d,e){var f=this;if(!a.Utils.hasFlash())return e(b.ErrorCode.FLASH_PLUGIN_MISSING);var g=!1,h=!1,i=function(b){if(!h)try{a.player.playerSumologic.sendInfo("wrapper ko",{},!0)}catch(c){}e(b),f.destroy()};this.callbackName="handleVPAIDEvent"+this.id,this.window=a.HTMLHelper.getWindow(this.container),this.window[this.callbackName]=function(b){return"wrapper"===b.type?void(h=!0):(g=!0,clearTimeout(f.loadTimeoutId),f.window[f.callbackName]=function(){},"ready"===b.type?(f.vpaid=f.creativeContainer,d(f.vpaid),f.logger.info("getVPAIDAd - Retrieve ad from creative"),void(a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(3,0))):void("error"===b.type&&i(b.data)))};var j="vpaid-"+this.id,k=this.config.path+"/"+b.asset.vpaidswfwrapper;this.container.innerHTML='',this.creativeContainer=this.window.document.getElementById(j),this.loadTimeoutId=setTimeout(function(){g||i(b.ErrorCode.LOAD_VPAID_TIMEOUT)},b.Timeout.loadVpaid)},d.prototype.setBackground=function(a){if(c.prototype.setBackground.call(this,a),this.creativeContainer)for(var b=this.creativeContainer.getElementsByTagName("param"),d=0;d=0&&(this.listeners[c][d]=function(){})}},c.prototype.clearListeners=function(){this.listeners={},this.listenersScope={}},c.prototype.handleEvent=function(a,c){for(var d=this.listeners[a.type]||[],e=0,f=d.length;e=0?this.vpaidAttribute[a]:this.postMessage.callMethod(a,b)},c.prototype.getIframeContainer=function(){return this.iframeContainer},c.prototype.subscribe=function(a,b,c){this.eventHandler.subscribe(a,b,c)},c.prototype.unsubscribe=function(a,b){this.eventHandler.unsubscribe(a,b)},c.prototype.onVpaidLoaded=function(a){var c=this;this.vpaid=new b.PostMessageVPAID(this),this.postMessage.setClientCallback(function(a){return a.type===b.PostMessageServer.ATTRIBUTE_EVENT?void(c.vpaidAttribute=a.data):void c.eventHandler.handleEvent(a)}),a(this.vpaid)},c.GETATTRIBUTESVALUES_METHOD="getAttributesValues",c.LOADVPAID_METHOD="loadVpaid",c.SETCONFIG_METHOD="setConfig",c.getters=["getAdWidth","getAdHeight","getAdDuration","getAdRemainingTime","getAdSkippableState","getAdLinear","getAdExpanded","getAdVolume"],c}();b.PostMessageClient=c}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.loadVpaid=function(b,c,d){var e=this,f=new a.PostMessageClient(this.container,this.config);this.creativeContainer=f.getIframeContainer();var g=this.config.sandboxUrl||this.config.path+"/"+a.asset.sandbox;f.initAPI(g,function(){f.loadVpaid(b,function(a){e.vpaid=a,c(a)},d)},d)},c.prototype.getType=function(){return a.CreativeType.POSTMESSAGE},c}(a.VPAIDJSContainer);a.PostMessageContainer=b}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function b(){}return b.isVPAID2=function(a){return Number(a.handshakeVersion("2.0"))>=2},b.createVPAIDEventCallback=function(b,c){return function(){for(var d=[],e=0;e=a.VpaidStatus.LOADING)throw"VPAID already initalized, cannot call initAd twice";break;case"startAd":if(c=a.VpaidStatus.STARTING)throw"Ad already started, cannot call startAd twice"}},b}();a.VPAIDHelper=b}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){a.adManagerList=["vpaid-empty.swf","liverail.com/swf/v4/admanager.swf","teads.tv/swf/vpaid/vpaid-ad"]}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function b(){}return b.isAdManager=function(b){for(var c=0;c-1)return!0;return!1},b}();a.AdManagerHelper=b}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){!function(a){a[a.REMOVED=-6]="REMOVED",a[a.REMOVING=-5]="REMOVING",a[a.ERROR=-4]="ERROR",a[a.STOPPED=-3]="STOPPED",a[a.STOPPING=-2]="STOPPING",a[a.SKIPPED=-1]="SKIPPED",a[a.SKIPPING=0]="SKIPPING",a[a.READY=1]="READY",a[a.LOADING=2]="LOADING",a[a.LOADED=3]="LOADED",a[a.STARTING=5]="STARTING",a[a.STARTED=6]="STARTED",a[a.PAUSING=7]="PAUSING",a[a.PAUSED=8]="PAUSED",a[a.RESUMING=9]="RESUMING",a[a.PLAYING=10]="PLAYING",a[a.COMPLETE=11]="COMPLETE"}(a.VpaidStatus||(a.VpaidStatus={}));a.VpaidStatus}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(){c.apply(this,arguments),this.status=b.VpaidStatus.READY,this.type=b.CreativeType.JS,this.timeoutId={},this.dispatchedEvents={},this.eventHandler=new b.EventHandler}return __extends(d,c),d.log=function(b){a.ArrayHelper.indexOf(d.hasLogged,b)<0&&(d.logger.info(b),d.hasLogged.push(b))},d.prototype.initAd=function(d,e,f,g,h,i){var j=this;void 0===h&&(h="");try{b.VPAIDHelper.checkVpaidStatus("initAd",this.status)}catch(k){return this.dispatchEvent(b.VPAIDEvent.AdLog,k)}this.status=b.VpaidStatus.LOADING,this.timeoutId.initAd=setTimeout(function(){j.dispatchedEvents[b.VPAIDEvent.AdLoaded]||j.dispatchEvent(b.VPAIDEvent.AdError,{message:"Creative did not initiated after "+b.Timeout.initAd+"ms (current status "+j.status+")",id:a.VastException.GENERAL.id})},b.Timeout.initAd),this.environmentVars=i,c.prototype.initAd.call(this,d,e,f,g,h,i)},d.prototype.startAd=function(){var d=this;try{b.VPAIDHelper.checkVpaidStatus("startAd",this.status)}catch(e){return this.dispatchEvent(b.VPAIDEvent.AdLog,e)}this.status=b.VpaidStatus.STARTING,this.timeoutId.startAd=setTimeout(function(){d.dispatchedEvents[b.VPAIDEvent.AdStarted]||d.dispatchEvent(b.VPAIDEvent.AdError,{message:"Creative did not start after "+b.Timeout.startAd+"ms",id:a.VastException.GENERAL.id})},b.Timeout.startAd),c.prototype.startAd.call(this)},d.prototype.stopAd=function(){var a=this;this.status>b.VpaidStatus.STOPPING&&(this.status=b.VpaidStatus.STOPPING,this.clearAllTimeout(),this.timeoutId.stopAd=setTimeout(function(){a.dispatchedEvents[b.VPAIDEvent.AdStopped]||(a.dispatchEvent(b.VPAIDEvent.AdLog,"Creative did not stop after "+b.Timeout.stopAd+"ms, force stop !"),a.dispatchEvent(b.VPAIDEvent.AdStopped))},b.Timeout.stopAd),this.environmentVars&&this.environmentVars.videoSlot&&(this.environmentVars.videoSlot.volume=0),c.prototype.stopAd.call(this))},d.prototype.skipAd=function(){var a=this;this.getAdSkippableState()&&this.status>b.VpaidStatus.SKIPPING&&(this.status=b.VpaidStatus.SKIPPING,this.timeoutId.skipAd=setTimeout(function(){a.status>=b.VpaidStatus.SKIPPING&&(a.dispatchEvent(b.VPAIDEvent.AdLog,"Creative did not skip after "+b.Timeout.skipAd+"ms, force skip !"),a.dispatchEvent(b.VPAIDEvent.AdSkipped),a.stopAd())},b.Timeout.skipAd),c.prototype.skipAd.call(this))},d.prototype.subscribe=function(a,b,c){this.eventHandler.subscribe(a,b,c)},d.prototype.unsubscribe=function(a,b){this.eventHandler.unsubscribe(a,b)},d.prototype.getAdWidth=function(){var a=this.vpaid.getAdWidth();return String(a).indexOf("%")>-1?a=this.environmentVars.slot.offsetWidth:String(a).indexOf("px")&&(a=parseInt(String(a).replace("px",""),10)),a},d.prototype.getAdHeight=function(){var a=this.vpaid.getAdHeight();return String(a).indexOf("%")>-1?a=this.environmentVars.slot.offsetHeight:String(a).indexOf("px")&&(a=parseInt(String(a).replace("px",""),10)),a},d.prototype.vpaidguard=function(c,d){void 0===d&&(d=[]);try{if(this.status!==b.VpaidStatus.REMOVED)return this.callVPAIDMethod(c,d)}catch(e){switch(c){case"initAd":case"startAd":case"resizeAd":this.dispatchEvent(b.VPAIDEvent.AdError,{message:"error call "+c+": "+e,id:a.VastException.GENERAL.id});break;default:this.dispatchEvent(b.VPAIDEvent.AdLog,"error call "+c+": "+e)}}},d.prototype.dispatchEvent=function(a,c){return this.handleVpaidEvent(new b.VPAIDEvent(a,c))},d.prototype.handleVpaidEvent=function(c){if(this.status!==b.VpaidStatus.REMOVED){var e=[b.VPAIDEvent.AdLoaded,b.VPAIDEvent.AdStarted,b.VPAIDEvent.AdVideoStart,b.VPAIDEvent.AdVideoComplete,b.VPAIDEvent.AdSkipped,b.VPAIDEvent.AdStopped,b.VPAIDEvent.AdError];if(!(a.ArrayHelper.indexOf(e,c.type)>-1&&this.dispatchedEvents[c.type])){if(this.status>b.VpaidStatus.STOPPED)switch(c.type){case b.VPAIDEvent.AdLoaded:this.status=b.VpaidStatus.LOADED,this.clearTimeout("initAd"),d.log("AdLoaded - Response from initAd"),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(3,2);break;case b.VPAIDEvent.AdStarted:this.status=this.status=0&&a.lastAdRemainingTime!==c&&(a.lastAdRemainingTime=c,a.dispatchEvent(b.VPAIDEvent.AdRemainingTimeChange),a.dispatchEvent(b.VPAIDEvent.AdDurationChange))},250))},d.prototype.stopTimer=function(){this.timerId&&clearInterval(this.timerId)},d}(b.BaseVPAIDJSWrapper);b.VPAIDWrapper=c}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(b){function c(c){b.call(this,c),this.adDuration=-2,this.isVpaid2=a.VPAIDHelper.isVPAID2(this.vpaid)}return __extends(c,b),c.prototype.handshakeVersion=function(a){return"2.0"},c.prototype.initAd=function(c,d,e,f,g,h){this.adWidth=c,this.adHeight=d,this.dispatchEvent(a.VPAIDEvent.AdLog,"VPAID 1.0 creative"),b.prototype.initAd.call(this,c,d,e,f,g,h),this.isVpaid2=a.VPAIDHelper.isVPAID2(this.vpaid)},c.prototype.resizeAd=function(c,d,e){return this.adWidth=c,this.adHeight=d,this.isVpaid2?b.prototype.resizeAd.call(this,c,d,e):(b.prototype.resizeAd.call(this,c,d),void this.dispatchEvent(a.VPAIDEvent.AdSizeChange))},c.prototype.getAdWidth=function(){return this.adWidth},c.prototype.getAdHeight=function(){return this.adHeight},c.prototype.skipAd=function(){this.isVpaid2&&b.prototype.skipAd.call(this)},c.prototype.getAdSkippableState=function(){return!!this.isVpaid2&&b.prototype.getAdSkippableState.call(this)},c.prototype.getAdIcons=function(){return!!this.isVpaid2&&b.prototype.getAdIcons.call(this)},c.prototype.getAdCompanions=function(){return this.isVpaid2?b.prototype.getAdCompanions.call(this):""},c.prototype.getAdDuration=function(){return this.isVpaid2?b.prototype.getAdDuration.call(this):this.adDuration},c.prototype.handleVpaidEvent=function(c){if(!this.isVpaid2)switch(c.type){case a.VPAIDEvent.AdRemainingTimeChange:this.getAdRemainingTime()>0&&(this.adDuration<=0||this.getAdRemainingTime()>this.adDuration)&&(this.adDuration=this.getAdRemainingTime())}b.prototype.handleVpaidEvent.call(this,c)},c}(a.VPAIDWrapper);a.VPAID2Over1=b}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.startAd=function(){try{a.VPAIDHelper.checkVpaidStatus("startAd",this.status)}catch(b){return this.dispatchEvent(a.VPAIDEvent.AdLog,b)}this.status=a.VpaidStatus.STARTING,this.adStarted=!0,this.dispatchEvent(a.VPAIDEvent.AdStarted),this.dispatchEvent(a.VPAIDEvent.AdImpression),this.vpaid.resumeAd()},c.prototype.handleVpaidEvent=function(c){if(!this.adStarted)switch(c.type){case a.VPAIDEvent.AdSkippableStateChange:case a.VPAIDEvent.AdLog:case a.VPAIDEvent.AdVolumeChange:break;case a.VPAIDEvent.AdError:this.adError=!0;break;case a.VPAIDEvent.AdStopped:this.adError||this.dispatchEvent(a.VPAIDEvent.AdError,"AdManagerWrapper : this VPAID creative got no Ads");break;case a.VPAIDEvent.AdLoaded:return this.vpaidguard("startAd");case a.VPAIDEvent.AdImpression:c=new a.VPAIDEvent(a.VPAIDEvent.AdLoaded);break;case a.VPAIDEvent.AdStarted:return this.vpaidguard("pauseAd");default:return}b.prototype.handleVpaidEvent.call(this,c)},c}(a.VPAID2Over1);a.AdManagerWrapper=b}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(){c.apply(this,arguments)}return __extends(d,c),d.prototype.loadVpaid=function(a,b,e){a===d.CANVAS?this.loadBundled(d.CANVAS,b,e):a===d.VIDEO?this.loadBundled(d.VIDEO,b,e):c.prototype.loadVpaid.call(this,a,b,e)},d.prototype.loadBundled=function(c,e,f){this.mainContainer=document.createElement("div"),this.mainContainer.style.position="relative",this.container.appendChild(this.mainContainer),this.creativeContainer=a.HTMLHelper.createIframe(),this.creativeContainer.id="vpaid-"+this.id,this.mainContainer.appendChild(this.creativeContainer);var g='
';switch(this.creativeContainer.contentWindow.document.write(g),this.creativeContainer.contentWindow.document.close(),this.vpaidContainer=this.creativeContainer.contentWindow.document.getElementById("vpaid-container"),this.videoContainer=this.creativeContainer.contentWindow.document.getElementById("video-container"),this.creativeContainer.contentWindow.teads=a,this.creativeContainer.contentWindow.teads.api=this.config.api||{},c){case d.VIDEO:this.vpaid=new this.creativeContainer.contentWindow.teads.video.VPAIDVideo;break;case d.CANVAS:this.vpaid=new this.creativeContainer.contentWindow.teads.video.VPAIDCanvas;break;default:return f(b.ErrorCode.BUNDLE_ASSET_NOT_EXISTING)}e(this.vpaid)},d.CANVAS="canvas",d.VIDEO="video",d}(b.VPAIDJSContainer);b.BundledContainer=c}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(a,c){this.container=a,this.config=c,this.status=b.LoaderStatus.READY}return c.prototype.load=function(d,e,f){var g=this;if(!(this.status>b.LoaderStatus.READY)){var h,i;this.config.sandbox?(this.creativeType=b.CreativeType.POSTMESSAGE,i=b.PostMessageContainer):(i=this.findContainerConstructor(d),this.creativeType=i===b.VPAIDSWFContainer?b.CreativeType.SWF:b.CreativeType.JS),this.container.innerHTML="",this.status=b.LoaderStatus.LOADING;var j=function(i){g.status=b.VpaidStatus.LOADED,g.wrapperClass||(g.wrapperClass=g.creativeType!==b.CreativeType.SWF||b.VPAIDHelper.isVPAID2(i)?b.VPAIDWrapper:b.VPAID2Over1,b.AdManagerHelper.isAdManager(d)&&(g.wrapperClass=b.AdManagerWrapper));var j=new g.wrapperClass(h);try{e(j)}catch(k){var l=b.ErrorCode.SUCCESS_CALLBACK_ERROR;l.message+=k,f(l)}var m=b.VPAIDHelper.isVPAID2(i)?"2.0":"1.0";c.logger.info("handshakeVersion - Creative vpaid version "+m),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(3,1,m,a.Wigo.infoType.STRING)};h=new i(this.container,this.config),this.config.background&&h.setBackground(this.config.background),h.loadVpaid(d,j,f)}},c.prototype.findContainerConstructor=function(c){if(c===b.BundledContainer.VIDEO||c===b.BundledContainer.CANVAS)return b.BundledContainer;var d=a.URIHelper.parse(c);return".swf"===d.pathname.substr(-4)?b.VPAIDSWFContainer:b.VPAIDJSContainer},c.logger=new a.Logger("vpaid.VPAIDLoader"),c}();b.VPAIDLoader=c}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.FullscreenRequest="FullscreenRequest",b.PlayPauseRequest="PlayPauseRequest",b.SkipRequest="SkipRequest",b.CloseRequest="CloseRequest",b.UIButtonRequest="UIButtonRequest",b.ClickToPlayRequest="ClickToPlayRequest",b.ClickRequest="ClickRequest",b.CallRequest="CallRequest",b.SoundToggleRequest="SoundToggleRequest",b.ReplayRequest="ReplayRequest",b.EndscreenInit="EndscreenInit",b}(a.VPAIDEvent);b.VPAIDUIEvent=c}(b=a.ui||(a.ui={}))}(b=a.vpaid||(a.vpaid={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(){function c(c,d,e,f,g){var h=this;if(this.ui=c,this.element=d,this.vpaid=e,this.config=f,this.globalVpaidEventHandler=g,this.eventHandler=new a.vpaid.EventHandler,this.showOnVideoStart=!0,f.style){var i=d.getAttribute("style");d.setAttribute("style",(i?i+";":"")+f.style)}var j=new RegExp(a.ui.componentBaseClassName+"([a-z]*)"),k=d.className.match(j);if(this.id=k&&k[1]?k[1]:"",this.logger=new a.Logger("teads.ui.Component"+(this.id?"."+this.id:"")),d.style.zIndex||(d.style.zIndex="2"),this.hide(),this.vpaid.subscribe(function(){h.onVideoStart()},a.vpaid.VPAIDEvent.AdVideoStart),f.startOffset){this.showOnVideoStart=!1;var l;l=function(){var c=b.VPAIDHelper.getCurrentTime(h.vpaid);c>=f.startOffset&&(h.vpaid.unsubscribe(l,a.vpaid.VPAIDEvent.AdRemainingTimeChange),h.show())},this.vpaid.subscribe(l,a.vpaid.VPAIDEvent.AdRemainingTimeChange)}this.bindClick()}return c.prototype.init=function(){},c.prototype.getConfig=function(){return this.config},c.prototype.isEnabled=function(){return!this.config.disable},c.prototype.getElement=function(){return this.element},c.prototype.show=function(){a.HTMLHelper.removeClass(this.getElement(),"hide"),a.HTMLHelper.addClass(this.getElement(),"show")},c.prototype.hide=function(){a.HTMLHelper.removeClass(this.getElement(),"show"),a.HTMLHelper.addClass(this.getElement(),"hide")},c.prototype.isVisible=function(){return this.getElement().className.indexOf("show")>-1},c.prototype.getVpaid=function(){return this.vpaid},c.prototype.subscribe=function(a,b,c){this.eventHandler.subscribe(a,b,c)},c.prototype.unsubscribe=function(a,b){this.eventHandler.unsubscribe(a,b)},c.prototype.getOverridenEvents=function(){return[]},c.prototype.getOverridenMethods=function(){return[]},c.prototype.onMethod=function(a,b){void 0===b&&(b=[])},c.prototype.onOverridenMethod=function(a,b){void 0===b&&(b=[])},c.prototype.remove=function(){this.getElement().parentNode&&this.getElement().parentNode.removeChild(this.getElement())},c.prototype.onVideoStart=function(){this.showOnVideoStart&&this.show()},c.prototype.dispatchVpaidEvent=function(a,b){if(this.globalVpaidEventHandler)try{this.globalVpaidEventHandler({type:a,data:b})}catch(c){this.logger.error("error calling dispatchVpaidEvent "+a,b)}else this.logger.error("no globalVpaidEventHandler given. Dispatch "+a+" failed",b)},c.prototype.bindClick=function(){var b=this;a.Dom.addEventListener("click",this.getElement(),function(a){b.onClick(a)})},c.prototype.onClick=function(a){this.dispatchUiEvent(this.eventName)},c.prototype.dispatchUiEvent=function(a){a&&(this.logger.info("dispatch UI event "+a),this.dispatchVpaidEvent(a))},c}();c.Component=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(c){function d(){c.apply(this,arguments),this.template='\n\n\n
    \n \n
  • \n \n \n \n \n \n \n \n \n \n \n \n \n \n
  • \n
\n\n\n\n\n \n \n\n\n\n',this.timerClass="countdown-timer"}return __extends(d,c),d.prototype.init=function(){if(this.countdown=Number(this.config.countdown),this.countdown<=0||isNaN(this.countdown))return void this.onEnded();var c=b.TemplateHelper.replacePlaceholders(this.template,{"countdown-duration":this.countdown,"countdown-id":"countdown-"+a.StringHelper.rand(10)});this.getElement().innerHTML=c,this.countdownTextElement=this.getElement().querySelector("."+this.timerClass)},d.prototype.initTimer=function(){var a=this,b=function(){a.isPaused()||a.countdown--,a.countdown<=0?(a.hide(),a.onEnded()):a.updateDisplay()};this.timerInterval=setInterval(b,1e3),this.updateDisplay()},d.prototype.stopTimer=function(){clearInterval(this.timerInterval)},d.prototype.setCountdown=function(a){this.countdown=a,this.updateDisplay()},d.prototype.resume=function(){this.paused=!1},d.prototype.pause=function(){this.paused=!0},d.prototype.isPaused=function(){return this.paused},d.prototype.isEnded=function(){return this.ended},d.prototype.setEndedCallback=function(a){this.callback=a},d.prototype.removeEndedCallback=function(){this.callback=null},d.prototype.onEnded=function(){if(clearInterval(this.timerInterval),this.ended=!0,this.hide(),this.callback&&"function"==typeof this.callback)try{this.callback()}catch(a){this.logger.error("countdown ended callback failled",a)}},d.prototype.updateDisplay=function(){this.countdownTextElement&&this.countdownTextElement.setAttribute&&this.countdownTextElement.setAttribute("data-countdown",String(this.countdown))},d}(c.Component);c.Countdown=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(c){function d(){c.apply(this,arguments)}return __extends(d,c),d.prototype.init=function(){var c=this,d=this.config.countdown>=0?this.config.countdown:this.ui.getConfig().skipoffset;this.eventName=a.vpaid.ui.VPAIDUIEvent.CloseRequest;var e=document.createElement("div");e.className="countdown",this.getElement().appendChild(e),this.countdown=new b.Countdown(this.ui,e,this.vpaid,{countdown:d}),this.vpaid.subscribe(function(){c.videoEnded=!0},a.vpaid.VPAIDEvent.AdVideoComplete),this.config.listenSkippableState?this.vpaid.subscribe(function(){c.vpaid.getAdSkippableState()?(c.onCountdownEnded(),c.show()):c.hide()},a.vpaid.VPAIDEvent.AdSkippableStateChange):this.countdown.setEndedCallback(function(){c.onCountdownEnded()})},d.prototype.onMethod=function(a,b){switch(a){case"pauseAd":case"resumeAd":this.countdown&&this.countdownInitiated&&("pauseAd"===a?this.countdown.pause():this.countdown.resume())}},d.prototype.onVideoStart=function(){this.countdownInitiated||this.config.listenSkippableState||(c.prototype.onVideoStart.call(this),this.countdown.init(),this.countdown.show(),this.countdownInitiated=!0,this.countdown.initTimer())},d.prototype.onClick=function(b){this.countdownEnded&&(c.prototype.onClick.call(this,b),this.videoEnded||this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdSkipped))},d.prototype.onCountdownEnded=function(){if(!this.countdownEnded){this.countdown.hide(),this.countdownEnded=!0;var a=document.createElement("div");a.className="close-button icon-close",this.getElement().appendChild(a)}},d}(b.Component);b.CloseButton=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b=function(a){function b(){a.apply(this,arguments),this.defaultLink={inRead:"http://inread-experience.teads.tv",inBoard:"http://teads.tv/en/teads-media/"}}return __extends(b,a),b.prototype.init=function(){var a=/\[([^\]]*)\]/g;if(!this.config.text){var b="inRead";"inboard"===this.config.formatName&&(b="inBoard"),this.config.text="["+b+"] invented by Teads"}var c=this.config.text.replace(a,'$1'),d=this.config.url||this.defaultLink[b]||"http://teads.tv/en";this.getElement().innerHTML=''+c+"",this.show()},b}(a.Component);a.Credits=b}(b=a.component||(a.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){this.eventName=a.vpaid.ui.VPAIDUIEvent.FullscreenRequest,this.showOnVideoStart=!1,b.prototype.init.call(this),this.show()},c.prototype.bindClick=function(){var b=this;a.Dom.addEventListener("mousedown",this.getElement(),function(a){b.onClick(a)})},c}(b.Component);b.FullscreenButton=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b=function(a){function b(){a.apply(this,arguments),this.defaultText="Advertising"}return __extends(b,a),b.prototype.init=function(){var a=this.config.html&&""!==this.config.html?this.config.html:this.config.text||this.defaultText;this.getElement().innerHTML=a,this.getElement().setAttribute("style",this.config.style||""),this.show()},b}(a.Component);a.Label=b}(b=a.component||(a.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var c=this;this.eventName=a.vpaid.ui.VPAIDUIEvent.PlayPauseRequest,this.vpaid.subscribe(function(){c.onPause()},a.vpaid.VPAIDEvent.AdPaused),this.vpaid.subscribe(function(){c.onPause()},a.vpaid.VPAIDEvent.AdVideoComplete),this.vpaid.subscribe(function(){c.onPlay()},a.vpaid.VPAIDEvent.AdPlaying),this.vpaid.subscribe(function(){c.onPlay()},a.vpaid.VPAIDEvent.AdVideoStart),b.prototype.init.call(this)},c.prototype.onClick=function(a){b.prototype.onClick.call(this,a),this.isPlaying?this.vpaid.pauseAd():this.vpaid.resumeAd()},c.prototype.onPlay=function(){this.isPlaying=!0,a.HTMLHelper.addClass(this.getElement(),"playing")},c.prototype.onPause=function(){this.isPlaying=!1,a.HTMLHelper.removeClass(this.getElement(),"playing")},c}(b.Component);b.PlayPauseButton=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.getCurrentTime=function(a){return Number(a.getAdDuration())>0?a.getAdDuration()-a.getAdRemainingTime():0},a.isMuted=function(a){return!(a.getAdVolume()>0)},a}();a.VPAIDHelper=b}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(c){function d(){c.apply(this,arguments)}return __extends(d,c),d.prototype.init=function(){var b=this;return this.progressbar=a.Dom.getElementsByClassName("progress",this.getElement(),this.ui.getContentWindow())[0],this.progressbar?(this.vpaid.subscribe(function(){b.onProgress()},a.vpaid.VPAIDEvent.AdRemainingTimeChange),this.vpaid.subscribe(function(){b.hide()},a.vpaid.VPAIDEvent.AdVideoComplete),void c.prototype.init.call(this)):this.hide()},d.prototype.onProgress=function(){var a=b.VPAIDHelper.getCurrentTime(this.vpaid); this.vpaid.getAdDuration()>0&&a>0?(this.isVisible()||this.show(),this.progressbar.style.width=a/this.vpaid.getAdDuration()*100+"%"):this.hide()},d}(c.Component);c.ProgressBar=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var b=this;this.vpaid.subscribe(function(){var a=b.vpaid.getAdRemainingTime();isNaN(a)&&(a=b.vpaid.getAdDuration()),b.getElement().innerHTML="Your video in "+Math.ceil(a)+" sec"},a.vpaid.VPAIDEvent.AdRemainingTimeChange)},c}(b.Component);b.ProgressText=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(c){function d(){c.apply(this,arguments)}return __extends(d,c),d.prototype.init=function(){var d=this,e=this.ui.getConfig();if(this.eventName=a.vpaid.ui.VPAIDUIEvent.SkipRequest,this.config.listenSkippableState)return void this.hide();var f=setInterval(function(){if(!d.vpaid.getAdSkippableState()&&e.skipoffset>0){var a=Math.floor(e.skipoffset-b.VPAIDHelper.getCurrentTime(d.vpaid));d.getElement().innerHTML="Skip in "+(isNaN(a)?e.skipoffset:a<0?0:a)+" sec",d.show()}else d.vpaid.getAdSkippableState()&&(clearInterval(f),d.getElement().style.cursor="pointer",d.getElement().innerHTML="Skip Ad >>",d.show())},1e3);c.prototype.init.call(this)},d.prototype.onClick=function(a){c.prototype.onClick.call(this,a),this.vpaid.getAdSkippableState()&&this.vpaid.skipAd()},d}(c.Component);c.SkipButton=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(c){function d(){c.apply(this,arguments),this.lastVolume=1}return __extends(d,c),d.prototype.init=function(){var d=this;this.isMuted=b.VPAIDHelper.isMuted(this.vpaid),this.eventName=a.vpaid.ui.VPAIDUIEvent.SoundToggleRequest,this.vpaid.subscribe(function(){d.isMuted=b.VPAIDHelper.isMuted(d.vpaid),d.onMuteChange()},a.vpaid.VPAIDEvent.AdStarted),this.vpaid.subscribe(function(){d.isMuted=b.VPAIDHelper.isMuted(d.vpaid)},a.vpaid.VPAIDEvent.AdVideoStart),this.vpaid.subscribe(function(){d.hide()},a.vpaid.VPAIDEvent.AdVideoComplete),this.vpaid.subscribe(function(){(!d.isMuted&&b.VPAIDHelper.isMuted(d.vpaid)||d.isMuted&&!b.VPAIDHelper.isMuted(d.vpaid))&&(d.lastVolume=b.VPAIDHelper.isMuted(d.vpaid)?d.lastVolume:d.vpaid.getAdVolume(),d.isMuted=b.VPAIDHelper.isMuted(d.vpaid),d.onMuteChange())},a.vpaid.VPAIDEvent.AdVolumeChange),this.onMuteChange(),c.prototype.init.call(this)},d.prototype.onMuteChange=function(){a.HTMLHelper[b.VPAIDHelper.isMuted(this.vpaid)?"addClass":"removeClass"](this.getElement(),"muted")},d.prototype.setAdVolume=function(){this.vpaid.setAdVolume(this.isMuted?this.lastVolume:0)},d.prototype.onClick=function(a){c.prototype.onClick.call(this,a),this.setAdVolume(),this.isMuted=!this.isMuted,this.onMuteChange()},d}(c.Component);c.MuteButton=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(){function a(){}return a.EQUALIZER="equalizer",a.MUTE="mute",a}(),d=function(){function a(){}return a.OFF="icon-muteoff",a.ON="icon-muteon",a}(),e=function(b){function e(){b.apply(this,arguments),this.paused=!1}return __extends(e,b),e.prototype.init=function(){var e=this;if(b.prototype.init.call(this),this.eventName=a.vpaid.ui.VPAIDUIEvent.SoundToggleRequest,this.config.type===c.EQUALIZER)this.initEqualizer();else{var f=document.createElement("div");f.className=d.OFF,this.getElement().appendChild(f);var g=function(){a.HTMLHelper.replaceClass(f,e.vpaid.getAdVolume()>0?d.OFF:d.ON,e.vpaid.getAdVolume()>0?d.ON:d.OFF)};this.vpaid.subscribe(g,a.vpaid.VPAIDEvent.AdVolumeChange),this.vpaid.subscribe(g,a.vpaid.VPAIDEvent.AdStarted)}},e.prototype.setAdVolume=function(){},e.prototype.onClick=function(a){this.config.type!==c.EQUALIZER&&b.prototype.onClick.call(this,a)},e.prototype.initEqualizer=function(){var b=this,c=4,d=document.createElement("div");d.className="equalizer",this.getElement().appendChild(d);for(var e=0;e.5&&(f.style.height=Math.max(3,Math.floor(15*Math.random()+1))+"px")}}};g(),setInterval(g,200),this.vpaid.subscribe(function(){b.pause()},a.vpaid.VPAIDEvent.AdPaused),this.vpaid.subscribe(function(){b.resume()},a.vpaid.VPAIDEvent.AdPlaying)},e.prototype.resume=function(){this.paused=!1},e.prototype.pause=function(){this.paused=!0},e.prototype.isPaused=function(){return this.paused},e}(b.MuteButton);b.SoundButton=e}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.replacePlaceholders=function(a,b){if(b)for(var c in b)a=a.replace(new RegExp(this.placeholderStartSymbol+c+this.placeholderEndSymbol,"g"),b[c]);return a},b.getPlaceholders=function(b){var c=/\{\{([^\}]*)\}\}/g,d=/\{\{|\}\}/g,e=b.match(c);if(e){var f=a.ArrayHelper.map(e,function(a){return a.replace(d,"")});return a.ArrayHelper.unique(f)}return[]},b.placeholderStartSymbol="{{",b.placeholderEndSymbol="}}",b}();b.TemplateHelper=c}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.secondToTimecode=function(a){var b="00";if(a>60){var c=Math.floor(a/60);b=c<10?"0":""}return b+=":"+(a<10?"0":"")+a},a}();a.StringHelper=b}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(c){function d(){c.apply(this,arguments),this.placeholders=["currentTime","totalTime","remainingTime","countdown"]}return __extends(d,c),d.prototype.init=function(){this.setText(this.config.text)},d.prototype.setText=function(b){var c=this;this.renderText(b),this.havePlaceholder(b)&&!this.haveProgressCallback&&(this.haveProgressCallback=!0,this.vpaid.subscribe(function(){c.renderText(b)},a.vpaid.VPAIDEvent.AdRemainingTimeChange))},d.prototype.renderText=function(a){this.textNode&&this.getElement().removeChild(this.textNode),this.textNode=document.createElement("span"),this.textNode.innerHTML=this.havePlaceholder(a)?this.replacePlaceholders(a):a,this.getElement().appendChild(this.textNode)},d.prototype.replacePlaceholders=function(a){var c=this,d={};return this.placeholders.forEach(function(a){d[a]=c.getPlaceholderValue(a)}),b.TemplateHelper.replacePlaceholders(a,d)},d.prototype.havePlaceholder=function(a){var b=new RegExp("({{"+this.placeholders.join("}}|{{")+"}})","g");return!!a.match(b)},d.prototype.getPlaceholderValue=function(a){var c=b.VPAIDHelper.getCurrentTime(this.vpaid);c=c<0||isNaN(c)?0:Math.floor(c);var d=Math.floor(this.vpaid.getAdRemainingTime());switch(a){case"currentTime":return b.StringHelper.secondToTimecode(c);case"totalTime":return b.StringHelper.secondToTimecode(Math.floor(this.vpaid.getAdDuration()));case"remainingTime":return b.StringHelper.secondToTimecode(d);case"countdown":return String(this.config.countdown-c)}},d}(c.Component);c.TextField=d}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){this.showOnVideoStart=!1,this.eventName=a.vpaid.ui.VPAIDUIEvent.ClickToPlayRequest},c.prototype.onMethod=function(b,c){void 0===c&&(c=[]),"startAd"===b&&(this.show(),this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdStarted))},c.prototype.getOverridenEvents=function(){return[a.vpaid.VPAIDEvent.AdStarted]},c.prototype.getOverridenMethods=function(){return["startAd"]},c.prototype.onClick=function(c){var d=this;b.prototype.onClick.call(this,c),a.HTMLHelper.addClass(this.getElement(),"loading"),this.vpaid.subscribe(function(){d.remove()},a.vpaid.VPAIDEvent.AdStarted),this.remove(),this.vpaid.startAd()},c}(b.Component);b.ClickToPlay=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var b=this,c=!0;this.eventName=a.vpaid.ui.VPAIDUIEvent.UIButtonRequest,a.Dom.addEventListener("click",this.getElement(),function(d){b.onClick(d),c?b.ui.hideAllComponents():b.ui.showAllComponents(),b.ui.showComponent("uibutton"),c=!c,a.HTMLHelper.toggleClass(b.getElement(),"ui-invisible")})},c}(b.Component);b.UIButton=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var b=this;if(this.clickthrough=this.ui.getConfig().clickthrough,this.eventName=a.vpaid.ui.VPAIDUIEvent.ClickRequest,this.config.text&&this.clickthrough){var c=document.createElement("div");c.className="text",c.innerHTML=this.config.text,this.getElement().appendChild(c)}else this.hide();this.vpaid.subscribe(function(){b.hide()},a.vpaid.VPAIDEvent.AdVideoComplete)},c.prototype.onVideoStart=function(){this.showOnVideoStart&&this.config.text&&this.clickthrough&&this.show()},c.prototype.onClick=function(c){b.prototype.onClick.call(this,c),this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdClickThru,{url:this.clickthrough,id:this.config.id,playerHandles:!0})},c}(b.TextField);b.ClickButton=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(c){function d(){c.apply(this,arguments),this.template='
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n'}return __extends(d,c),d.prototype.init=function(){var b=this;this.logger.debug("init endscreen"),this.showOnVideoStart=!1;var c=this.element.getAttribute("style");this.element.setAttribute("style",(c?c+";":"")+" opacity: 0.8!important; background-color: #ffffff;"),this.getElement().innerHTML=this.template,this.vpaid.subscribe(function(){if(b.logger.debug("video complete"),b.videoComplete=!0,b.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdVideoComplete),b.ui.getConfig().noAutoStop){b.show(),b.initLayout();var c=b.ui.getVPAIDContainer();c.style.filter="blur(3px)",c.style.webkitFilter="blur(3px)",b.dispatchVpaidEvent(a.vpaid.ui.VPAIDUIEvent.EndscreenInit)}},a.vpaid.VPAIDEvent.AdVideoComplete),this.vpaid.subscribe(function(){b.videoComplete&&!b.ui.getConfig().noAutoStop&&(b.show(),b.initLayout(),b.dispatchVpaidEvent(a.vpaid.ui.VPAIDUIEvent.EndscreenInit))},a.vpaid.VPAIDEvent.AdStopped),this.hide()},d.prototype.getOverridenEvents=function(){return this.videoComplete?[a.vpaid.VPAIDEvent.AdStopped]:[a.vpaid.VPAIDEvent.AdVideoComplete]},d.prototype.getOverridenMethods=function(){return this.isVisible()?["pauseAd","resumeAd"]:[]},d.prototype.onOverridenMethod=function(a,b){this.countdown&&("pauseAd"===a?this.countdown.pause():"resumeAd"===a&&this.countdown.resume())},d.prototype.onMethod=function(b,c){void 0===c&&(c=[]),"resizeAd"===b&&this.videoComplete&&(this.logger.debug("resizeAd from endscreen",c),this.resize(c[0],c[1]),this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdSizeChange))},d.prototype.initLayout=function(){var c=this;if(this.replayButton=a.Dom.getElementsByClassName("replay-button",this.getElement(),this.ui.getContentWindow())[0],this.replayButton){a.Dom.addEventListener("click",this.replayButton,function(){c.onReplayClick()});try{a.Dom.getElementsByClassName("text",this.replayButton,this.ui.getContentWindow())[0].innerHTML=this.config.replayButton.text}catch(e){this.logger.error("No text on replay button")}a.Context.isEdgeTouchScreen()&&(this.replayButton.className="button edge-touch-screen replay-button")}else this.logger.debug("No replayButton on endscreen !");if(this.callButton=a.Dom.getElementsByClassName("call-button",this.getElement(),this.ui.getContentWindow())[0],this.callButton&&this.config.callButton&&this.ui.getConfig().clickthrough){if(a.Dom.addEventListener("click",this.callButton,function(){c.dispatchUiEvent(a.vpaid.ui.VPAIDUIEvent.ClickRequest),c.onActionClick()}),this.config.callButton.text){var f=this.callButton.querySelector(".icon span");if(f){var g=d.CSSClassMapping[this.config.callButton.type]||function(){for(var a in d.CSSClassMapping)return d.CSSClassMapping[a]}();a.HTMLHelper.addClass(f,g)}try{a.Dom.getElementsByClassName("text",this.callButton,this.ui.getContentWindow())[0].innerHTML=this.config.callButton.text}catch(e){this.logger.error("No text on callButton")}a.Context.isEdgeTouchScreen()&&(this.callButton.className="button edge-touch-screen call-button")}}else this.callButton&&this.callButton.parentNode&&this.callButton.parentNode.removeChild(this.callButton),this.logger.debug("No callButton on endscreen !");this.closeButton=a.Dom.getElementsByClassName("close-button",this.getElement(),this.ui.getContentWindow())[0],this.closeButton?this.config.closeButton.disable||this.config.closeButton.listenSkippableState&&!this.vpaid.getAdSkippableState()?(a.HTMLHelper.removeClass(this.closeButton,"show"),a.HTMLHelper.addClass(this.closeButton,"hide")):a.Dom.addEventListener("click",this.closeButton,function(){c.closeAd()}):this.logger.debug("No closeButton on endscreen !");var h=a.Dom.getElementsByClassName("countdown",this.getElement(),this.ui.getContentWindow())[0];h?(this.countdown=new b.Countdown(this.ui,h,this.vpaid,{countdown:this.config.countdown}),this.config.autoClose&&this.countdown.setEndedCallback(function(){c.logger.debug("Countdown ended and autoClose on, close ad"),c.closeAd()}),this.countdown.init(),this.countdown.initTimer(),this.countdown.show()):this.logger.debug("No countdown on endscreen"),this.resize(this.ui.getAdWidth(),this.ui.getAdHeight())},d.prototype.resize=function(b,c){if(!(b<=0||c<=0)){var d=a.Dom.getElementsByClassName("button-container",this.getElement())[0];if(d){d.style.top="0px",d.style.left="0px";var e=a.Dom.getBoundingClientRect(d),f=(c-e.height)/2,g=(b-e.width)/2;d.style.top=f+"px",d.style.left=g+"px"}}},d.prototype.onClick=function(a){},d.prototype.onReplayClick=function(){this.clearCloseInterval(),this.ui.getConfig().noAutoStop&&this.vpaid.stopAd(),this.videoComplete=!1,this.dispatchUiEvent(a.vpaid.ui.VPAIDUIEvent.ReplayRequest)},d.prototype.onActionClick=function(){var b=this.ui.getConfig().clickthrough||null;this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdClickThru,{url:b,id:null,playerHandles:!0})},d.prototype.clearCloseInterval=function(){this.countdown&&(this.countdown.removeEndedCallback(),this.countdown.stopTimer())},d.prototype.closeAd=function(){this.clearCloseInterval(),this.dispatchUiEvent(a.vpaid.ui.VPAIDUIEvent.CloseRequest)},d.CSSClassMapping={learnMore:"icon-learnmore",shopNow:"icon-shop",contactUs:"icon-contact",signUp:"icon-signup"},d}(b.Component);b.EndScreen=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var b=this;this.clickthrough=this.ui.getConfig().clickthrough,this.eventName=a.vpaid.ui.VPAIDUIEvent.ClickRequest;var c=function(){b.getElement().style.setProperty("background-image","url("+b.config.url+")")};this.load(c)},c.prototype.load=function(a){var b=this,c=new Image;c.onload=function(){return a()},c.onerror=function(a){return b.hide()},c.src=this.config.url},c.prototype.onVideoStart=function(){this.showOnVideoStart&&this.show()},c.prototype.onClick=function(c){b.prototype.onClick.call(this,c),this.clickthrough&&this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdClickThru,{url:this.clickthrough,id:this.config.id,playerHandles:!0})},c}(b.Component);b.BrandLogo=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.init=function(){var b=this;this.showOnVideoStart=!1,this.element.style.zIndex="0";var c=this.ui.getVPAIDContainer().style.backgroundColor;this.ui.getVPAIDContainer().style.backgroundColor="transparent",this.show(),this.vpaid.subscribe(function(){b.ui.getVPAIDContainer().style.backgroundColor=c,b.hide()},a.vpaid.VPAIDEvent.AdStarted)},c}(b.Component);b.StartScreen=c}(c=b.component||(b.component={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){a.components={fullscreenbutton:a.component.FullscreenButton,mutebutton:a.component.MuteButton,progressbar:a.component.ProgressBar,playpausebutton:a.component.PlayPauseButton,progresstext:a.component.ProgressText,skipbutton:a.component.SkipButton,closebutton:a.component.CloseButton,uibutton:a.component.UIButton,textfield:a.component.TextField,clicktoplay:a.component.ClickToPlay,clickbutton:a.component.ClickButton,soundbutton:a.component.SoundButton,label:a.component.Label,credits:a.component.Credits,endscreen:a.component.EndScreen,brandlogo:a.component.BrandLogo,countdown:a.component.Countdown,startscreen:a.component.StartScreen},a.componentBaseClassName="teads-ui-component-",a.vpaidContainerId="vpaid-container",a.mainComponentsContainerId="main-container",a.videoComponentsContainerId="layout-video-component"}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.getOverridenEvents=function(b){var c=[];return a.ArrayHelper.map(b,function(b){a.ArrayHelper.map(b.getOverridenEvents(),function(d){b.isEnabled()&&a.ArrayHelper.indexOf(c,d)===-1&&c.push(d)})}),c},b.getOverridenEventComponents=function(b,c){return a.ArrayHelper.filter(b,function(b){return b.isEnabled()&&a.ArrayHelper.indexOf(b.getOverridenEvents(),c)!==-1})},b.getOverridenMethodComponents=function(b,c){return a.ArrayHelper.filter(b,function(b){return b.isEnabled()&&a.ArrayHelper.indexOf(b.getOverridenMethods(),c)!==-1})},b.showHideComponent=function(a,b,c){void 0===c&&(c=!0);var d=a[b];d&&d.isEnabled()&&(c?d.show():d.hide())},b.showHideAllComponents=function(b,c){void 0===c&&(c=!0),a.ArrayHelper.forEach(b,function(a){a.isEnabled()&&(c?a.show():a.hide())})},b}();b.ComponentHelper=c}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(b){function c(b){var c=[];return c.length>0&&(b=b.replace('id="'+a.mainComponentsContainerId+'"','id="'+a.mainComponentsContainerId+'" class="'+c.join(" ")+'"')),b}b.inread=c('\n\n \n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n\n'); }(b=a.template||(a.template={}))}(b=a.ui||(a.ui={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(d,e,f){if(c.call(this),this.mainContainer=d,this.config=f,this.isFullscreen=!1,this.components=[],this.componentsByName={},this.logger=new a.Logger("ui.VPAIDUI"),this.logger.debug("Init Layout",d,f),this.config.container){this.container=this.config.container;var g=this.mainContainer.ownerDocument.getElementById(b.mainComponentsContainerId);g&&this.mainContainer.removeChild(g)}else this.container=a.HTMLHelper.createIframe(),this.container.style.width="1px",this.container.style.height="1px";this.container.parentNode||this.mainContainer.appendChild(this.container),this.container.contentWindow.document.write(e),this.container.contentWindow.document.close(),this.mainComponentsContainer=this.container.contentWindow.document.getElementById(b.mainComponentsContainerId),(a.Context.isAmp()||a.Context.isIABSafeFrame())&&(this.mainContainer.appendChild(this.mainComponentsContainer),this.mainContainer.removeChild(this.container)),this.videoComponentsContainer=this.mainComponentsContainer.ownerDocument.getElementById(b.videoComponentsContainerId)}return __extends(d,c),d.prototype.initAd=function(a,b,d,e,f,g){return void 0===f&&(f=""),this.vpaid?(this.resize(a,b,d),this.logger.debug("initAd"),c.prototype.initAd.call(this,a,b,d,e,f,g)):void this.logger.error("You must register vpaid creative to be wrapped using setVPAID() method")},d.prototype.startAd=function(){return this.status=a.vpaid.VpaidStatus.STARTING?void this.dispatchEvent(a.vpaid.VPAIDEvent.AdLog,"cannot call startAd() twice, already started"):(this.render(this.getVPAID()),this.logger.debug("stardAd"),void c.prototype.startAd.call(this))},d.prototype.resizeAd=function(a,b,d){void 0===d&&(d="normal"),a<=0||b<=0||(this.resize(a,b,d),c.prototype.resizeAd.call(this,a,b,d))},d.prototype.stopAd=function(){var b=this,d=function(){try{b.mainContainer.removeChild(b.container)}catch(c){b.logger.warn("error removing DOM node on StopAd")}b.dispatchedEvents[a.vpaid.VPAIDEvent.AdStopped]||b.dispatchEvent(a.vpaid.VPAIDEvent.AdStopped)};this.isStopped?(this.logger.debug("Wrapped vpaid already stopped, remove UI"),d()):(this.logger.debug("Wrapped vpaid not stopped, try to stop it"),this.vpaid.subscribe(d,a.vpaid.VPAIDEvent.AdStopped),c.prototype.stopAd.call(this))},d.prototype.pauseAd=function(){this.callVPAIDMethod("pauseAd")},d.prototype.resumeAd=function(){this.callVPAIDMethod("resumeAd")},d.prototype.getAdWidth=function(){return this.isRendered&&!this.isStopped&&c.prototype.getAdWidth.call(this)?c.prototype.getAdWidth.call(this):a.Dom.getBoundingClientRect(this.getMainComponentsContainer()).width},d.prototype.getAdHeight=function(){return this.isRendered&&!this.isStopped&&c.prototype.getAdHeight.call(this)?c.prototype.getAdHeight.call(this):a.Dom.getBoundingClientRect(this.getMainComponentsContainer()).height},d.prototype.setAdVolume=function(a){return isNaN(a)?(this.logger.warn("setAdVolume: volume argument is NaN"),this.getAdVolume()):c.prototype.setAdVolume.call(this,a)},d.prototype.getAdExpanded=function(){return this.isFullscreen},d.prototype.setVPAID=function(d){var e=this;if(this.vpaid)return void this.logger.warn("setVPAID() : vpaid ad already register, can't use twice",d);this.logger.debug("setVPAID() : Register vpaid ad",d),c.prototype.setVPAID.call(this,d),d.subscribe(function(){e.isStopped=!0},a.vpaid.VPAIDEvent.AdStopped);var f=function(a){var c=b.ComponentHelper.getOverridenEventComponents(e.components,a.type);0===c.length&&e.handleVpaidEvent(a)};for(var g in a.vpaid.VPAIDEvent)if(a.vpaid.VPAIDEvent.hasOwnProperty(g)){var h=a.vpaid.VPAIDEvent[g];d.subscribe(a.vpaid.VPAIDHelper.createVPAIDEventCallback(f,h),h)}for(var g in a.vpaid.CustomVPAIDEvent)if(a.vpaid.CustomVPAIDEvent.hasOwnProperty(g)){var h=a.vpaid.CustomVPAIDEvent[g];d.subscribe(a.vpaid.VPAIDHelper.createVPAIDEventCallback(f,h),h)}},d.prototype.getVPAID=function(){return this.vpaid},d.prototype.getVPAIDContainer=function(){return this.mainComponentsContainer.ownerDocument.getElementById(b.vpaidContainerId)},d.prototype.getMainContainer=function(){return this.mainContainer},d.prototype.getMainComponentsContainer=function(){return this.mainComponentsContainer.ownerDocument.getElementById(b.mainComponentsContainerId)},d.prototype.getVideoComponentsContainer=function(){return this.mainComponentsContainer.ownerDocument.getElementById(b.videoComponentsContainerId)},d.prototype.getConfig=function(){return this.config},d.prototype.getContainer=function(){return this.container},d.prototype.getContentWindow=function(){return this.getContainer().contentWindow},d.prototype.render=function(c){var d=this;if(!this.isRendered){this.isRendered=!0,this.show(),this.resize(c.getAdWidth(),c.getAdHeight());var e=function(a){d.handleVpaidEvent(a)};this.logger.debug("init components:",this.config.components);for(var f in b.components)if(b.components.hasOwnProperty(f)&&b.components[f])for(var g=b.componentBaseClassName+f,h=a.Dom.getElementsByClassName(g,this.getMainComponentsContainer(),this.getContentWindow()),i=0,j=h.length;i0)y=a.Utils.seconds(y);else{var z=a.StringHelper.trim(y).match(/^([0-9\.]+)%$/);if(!z){this.logger.error("Wrong offset for progress tracking: "+y);continue}y=f.duration*parseInt(z[1],10)/100}f.tracking[x].push({url:b.XMLHelper.getNodeContent(w[r]),data:y})}}var A=p.getElementsByTagName("MediaFile");for(r=0,s=A.length;r=400){var b=a.Exception.get(a.VastException.WRAPPER_TIMEOUT.id,"invalid XHR status code "+n.status);return i.logger.warn("server return an invalid status code : "+b.toString()),404===n.status&&(l=!0),m(b)}o()}}:(n.onerror=function(){m(a.Exception.get(a.VastException.WRAPPER_TIMEOUT.id,"XHR onerror"))},n.onprogress=function(){},n.onload=function(){return o()}),n.send();var p=e.timeout||b.VASTLib.TIMEOUT;k=setTimeout(function(){l=!0,m(a.Exception.get(a.VastException.WRAPPER_TIMEOUT.id,"no response after "+p+"ms"))},p)}catch(q){this.logger.warn("Could not load XML file directly",q),l=!0,m(a.Exception.get(a.VastException.UNDEFINED.id,"VASTLoader.load error "+q,q))}},c.loadWithFlash=function(d,e,f,g){var h=this,i="vastloader_"+Date.now()+"_"+Math.round(1e3*Math.random());this.logger.debug("try loading file with flash cors proxy",i);var j,k=e.timeout||b.VASTLib.TIMEOUT,l=!1;window[i]=function(e,k){if(!l){if(clearTimeout(j),e)c.logXhr(2),h.logger.debug("Flash CORS proxy successfully load VAST file",d),f(a.StringHelper.trim(decodeURIComponent(k)));else{h.logger.error("Unable to load VAST file with flash CORS proxy"),c.logXhr(3);var m=a.Exception.get(a.VastException.WRAPPER_TIMEOUT.id,"flash CORS proxy fail to load XML");g(m,new b.LinearAd)}window[i]=void 0}};var m=e.assetsUrl+"/"+b.asset.corsswf,n=document.createElement("div");n.innerHTML='',document.body.appendChild(n),j=setTimeout(function(){l=!0;var c=a.Exception.get(a.VastException.WRAPPER_TIMEOUT.id,"flash cors have no response after "+k+"ms");g(c,new b.LinearAd)},k)},c.updateUrlPlaceholder=function(b){try{var c=a.StringHelper.rand(8);return b.replace(/\[timestamp\]/gi,String(Date.now())).replace(/\[(random|cachebusting|random_number|TTD_CACHEBUSTER)\]/gi,c).replace(/ord=(%n|\{RANDOMNUM\}|%25%25TTD_CACHEBUSTER%25%25)/gi,"ord="+c)}catch(d){this.logger.warn("updateUrlPlaceholder threw an exception: "+d)}return b},c.logger=new a.Logger("vast.VASTLoader"),c}();b.VASTLoader=c}(b=a.vast||(a.vast={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b){this.config=b,this.logger=new a.Logger("vast.VASTLib"),this.logger.debug("new",this),this.wrappersLimit=this.config.wrappersLimit||c.WRAPPERS_LIMIT}return c.prototype.load=function(a,b,c){this.processVast(!0,a,b,c)},c.prototype.parse=function(a,b,c){this.processVast(!1,a,b,c)},c.prototype.processVast=function(c,d,e,f){var g=Date.now(),h=function(b){var c=Date.now()-g;try{a.player.playerSumologic.sendInfo("parse "+b.wrappers.length+" "+c)}catch(d){}e(b)},i=function(a,b){f(a,b)};c?this.loadXml(new b.LinearAd,d,h,i):this.parseXml(new b.LinearAd,d,h,i)},c.prototype.loadXml=function(a,c,d,e){var f=this;a.url||(a.url=c),b.VASTLoader.load(c,this.config,function(b){f.parseXml(a,b,d,e)},e)},c.prototype.parseXml=function(c,d,e,f){var g=this;b.VASTParser.parse(d,function(b){if(c.merge(b),b.adTagUri)c.wrappers.length>g.wrappersLimit?f(new a.VastException(a.VastException.WRAPPER_LIMIT),c):(g.logger.info("load wrapper",b.adTagUri),g.loadXml(c,b.adTagUri,e,function(a,b){f(a,c)}));else if(0===c.mediaFiles.length){var d=a.Exception.get(a.VastException.WRAPPER.id,"empty mediafiles in VAST definition");g.logger.error(d.getMessage()),f(d,c)}else e(c)},function(a,b){c.merge(b),f(a,c)})},c.TIMEOUT=7e3,c.WRAPPERS_LIMIT=10,c}();b.VASTLib=c}(b=a.vast||(a.vast={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(a,b,c,d,e,f){void 0===b&&(b=[]),void 0===c&&(c=[]),void 0===d&&(d=!1),void 0===e&&(e=!0),void 0===f&&(f=[]),this.name=a,this.before=b,this.after=c,this.multiple=d,this.metadata=e,this.resources=f,this.tracked=[],this.eventIsTracked=!1,"progress"===a&&(this.multiple=!0)}return b.prototype.getName=function(){return this.name},b.prototype.getBefore=function(){return this.before},b.prototype.getAfter=function(){return this.after},b.prototype.isMultiple=function(){return this.multiple},b.prototype.isMetadata=function(){return this.metadata},b.prototype.getResources=function(b){return a.ArrayHelper.filter(this.resources,function(a){return!(a.offset>0)||b>=0&&a.offset>=0&&b>=a.offset&&!a.fired})},b.prototype.getAllResources=function(){return this.resources},b.prototype.removeResources=function(){this.resources=[]},b.prototype.hasResources=function(){return this.resources.length>0},b.prototype.addResource=function(a,b){this.resources.push({url:a,offset:b})},b.prototype.setTracked=function(){this.eventIsTracked=!0},b.prototype.isTracked=function(){return this.eventIsTracked},b.prototype.addTracked=function(a,b){this.tracked.push({time:b,url:a})},b.prototype.getTracked=function(){return this.tracked},b.prototype.isTrackable=function(){return!this.eventIsTracked||this.isMultiple()},b}();b.Tracking=c}(b=a.tracker||(a.tracker={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b,c,d){if(void 0===d&&(d=!0),this.key=b,this.value=c,this.multiple=d,this.logger=new a.Logger("tracker.Metadata"),!b)throw new Error("Metadata key is mandatory")}return b.prototype.isMultiple=function(){return this.multiple},b.prototype.getKey=function(){return this.key},b.prototype.getValue=function(){var a=this.value;if("function"==typeof a)try{return String(a()||"")}catch(b){return this.logger.warn("getValue: error while trying to execute value function:",b),""}return String(a||"")},b.prototype.getUrlPiece=function(){return encodeURIComponent(this.getKey())+"="+encodeURIComponent(this.getValue())},b}();b.Metadata=c}(b=a.tracker||(a.tracker={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.format=[{name:"placementCall"},{name:"passback-integration"},{name:"passback-noAd"},{name:"noSlot-dom"},{name:"noSlot-selector"},{name:"noSlot-filter"},{name:"noSlot-avoid"},{name:"noSlot-size"},{name:"noSlot-BTF"},{name:"noSlot-minimum"},{name:"noSlot-minimumBelow"},{name:"noSlot-content"},{name:"noSlot-position"},{name:"incompatibility-browser"},{name:"incompatibility-context"},{name:"incompatibility-format"},{name:"incompatibility-video"},{name:"placementCapping"},{name:"slotAvailable"},{name:"adNotAvailable-networkError"},{name:"adNotAvailable-serverError"},{name:"adAvailable-error-parseTimeout"},{name:"adAvailable-error-badResponse"},{name:"adAvailable-error-vast-100"},{name:"adAvailable-error-vast-101"},{name:"adAvailable-error-vast-102"},{name:"adAvailable-error-vast-200"},{name:"adAvailable-error-vast-201"},{name:"adAvailable-error-vast-202"},{name:"adAvailable-error-vast-203"},{name:"adAvailable-error-vast-300"},{name:"adAvailable-error-vast-301"},{name:"adAvailable-error-vast-302"},{name:"adAvailable-error-vast-303"},{name:"adAvailable-error-vast-304"},{name:"adAvailable-error-vast-400"},{name:"adAvailable-error-vast-401"},{name:"adAvailable-error-vast-402"},{name:"adAvailable-error-vast-403"},{name:"adAvailable-error-vast-405"},{name:"adAvailable-error-vast-500"},{name:"adAvailable-error-vast-501"},{name:"adAvailable-error-vast-502"},{name:"adAvailable-error-vast-503"},{name:"adAvailable-error-vast-600"},{name:"adAvailable-error-vast-601"},{name:"adAvailable-error-vast-602"},{name:"adAvailable-error-vast-603"},{name:"adAvailable-error-vast-604"},{name:"adAvailable-error-vast-900"},{name:"adAvailable-error-vast-901"},{name:"adAvailable-error-settings"},{name:"adAvailable-error-emptyArray"},{name:"adAvailable-success"},{name:"adCall"},{name:"noAd-serverError"},{name:"noAd-networkError"},{name:"noAd-notFilled"},{name:"noAd-vastError-100"},{name:"noAd-vastError-101"},{name:"noAd-vastError-102"},{name:"noAd-vastError-200"},{name:"noAd-vastError-201"},{name:"noAd-vastError-202"},{name:"noAd-vastError-203"},{name:"noAd-vastError-300"},{name:"noAd-vastError-301"},{name:"noAd-vastError-302"},{name:"noAd-vastError-303"},{name:"noAd-vastError-304"},{name:"noAd-vastError-400"},{name:"noAd-vastError-401"},{name:"noAd-vastError-402"},{name:"noAd-vastError-403"},{name:"noAd-vastError-405"},{name:"noAd-vastError-500"},{name:"noAd-vastError-501"},{name:"noAd-vastError-502"},{name:"noAd-vastError-503"},{name:"noAd-vastError-600"},{name:"noAd-vastError-601"},{name:"noAd-vastError-602"},{name:"noAd-vastError-603"},{name:"noAd-vastError-604"},{name:"noAd-vastError-900"},{name:"noAd-vastError-901"},{name:"noAd-parseTimeout"},{name:"noAd-settingsError"},{name:"noAd-badResponse"},{name:"ad"}],a.vast=[{name:"error"},{name:"fullscreen",multiple:!0},{name:"exitFullscreen",multiple:!0},{name:"click",multiple:!0},{name:"creativeView"},{name:"impression"},{name:"start"},{name:"firstQuartile"},{name:"midpoint"},{name:"thirdQuartile"},{name:"complete"},{name:"pause",before:["start"],multiple:!0},{name:"resume",before:["pause"],multiple:!0},{name:"mute",multiple:!0},{name:"unmute",multiple:!0},{name:"expand",multiple:!0},{name:"collapse",multiple:!0},{name:"rewind",multiple:!0},{name:"skip"},{name:"close"},{name:"progress",multiple:!0},{name:"acceptInvitationLinear"},{name:"acceptInvitation"},{name:"closeLinear"},{name:"noAd"},{name:"noLinearAd"},{name:"customClicks"}],a}();a.Config=b}(b=a.tracker||(a.tracker={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(c,d,e){void 0===d&&(d=null),void 0===e&&(e=!1),this.useMultipleBillable=e,this.logger=new a.Logger("tracker.Tracker"),this.trackings={},this.metadatas=[],this.errors=[],this.errorUrls=[],this.sumoTracker=new a.Sumologic,this.trackedEvents={},this.alreadyBilledAdvertiser={whenAnalyticsOnlyEqualsFalse:!1,whenAnalyticsOnlyEqualsTrue:!1},this.sumoTracker.init(a.Sumologic.CONFIGS.PLAYER,d),c instanceof Array?this.setTrackings(c):this.setTrackings(b.Config.vast),this.logger.debug("new",this)}return c.prototype.setTrackings=function(b){return b instanceof Array?void a.ArrayHelper.forEach(b,function(a){this.setTracking(a)},this):void this.logger.error("setTrackings param error, expected array.",b)},c.prototype.setTracking=function(a){return a.name?void(this.trackings[a.name]=new b.Tracking(a.name,a.before,a.after,a.multiple,a.metadata,a.resources)):void this.logger.error("Name of tracking is needed",a)},c.prototype.getTracking=function(a){return this.trackings[a]},c.prototype.getTrackedEvents=function(){var a,b=[];for(var c in this.trackings)this.trackings.hasOwnProperty(c)&&(a=this.trackings[c],a.isTracked()&&b.push(a));return b},c.prototype.addResource=function(b,c,d){if(c&&!a.StringHelper.isURL(c)&&this.sumoTracker.sendInfo(["invalid-tracking",c].join(";")),"progress"===b&&!d)return this.logger.error('Adding a "progress" tracking requires an associated offset',c),!1;if(!c||c.trim&&!c.trim())return this.logger.error("Adding a tracking requires an url not empty",c),!1;var e=this.getTracking(b);if(e){var f=e.getAllResources();if(f.length){var g=!1;if(a.ArrayHelper.forEach(f,function(a){g||(g=c===a.url)}),g)return this.logger.warn("URL already exists"),!1}return e.addResource(c,d),!0}return this.logger.error("This event ("+b+") does not exist in config"),!1},c.prototype.addResources=function(b){return b instanceof Array&&(a.ArrayHelper.forEach(b,function(b){a.ArrayHelper.forEach(b.resources,function(a){this.addResource(b.event,a.url,a.offset)},this)},this),!0)},c.prototype.isTrackable=function(b){var c=this.getTracking(b);if(!c)return this.trackError(b,"This event ("+b+") does not exist in config"),!1;if(!c.isTrackable())return!1;if(!c.hasResources())return!0;if(c){var d=!0,e=!0,f=c.getBefore(),g=c.getAfter();return f.length&&(d=a.ArrayHelper.some(f,function(a){var b=this.getTracking(a),c=b&&!b.isTrackable(),d=b&&b.isTracked();return d||c||!b},this),d||this.trackError(b,"Previous event ["+c.getBefore().join(",")+"] was not tracked")),g.length&&(e=a.ArrayHelper.some(g,function(a){var b=this.getTracking(a),c=b&&b.isTrackable(),d=b&&!b.isTracked();return d||c||!b},this),e||this.trackError(b,"Next event ["+c.getAfter().join(",")+"] are already tracked")),d&&e}},c.prototype.track=function(b,c,d,e){var f=this; void 0===c&&(c={});var g=this.getTracking(b);if(!this.isTrackable(b))return this.logger.warn("This event ("+b+") is not trackable"),!1;if("progress"===b&&(null===d||isNaN(d)))return this.trackError(b,"This event ("+b+") needs the current progress time (in seconds)"),!1;var h=g.getResources(d);return a.ArrayHelper.forEach(h,function(a){var e=a.url;g&&g.isMetadata()&&(e=f.processMetadata(e));for(var h in c)c.hasOwnProperty(h)&&(e=e.replace(h,c[h]));e=f.useMultipleBillable?f.removeBillableParamsDuplicates(e):e,f.triggerUrl(e),a.fired=!0,f.logger.debug("track ["+b+(d?"@"+d.toFixed(2)+"s":"")+"]: ",e),g.addTracked(e,d),f.callback(b,!0)},this),g.setTracked(),this.trackedEvents[b]=this.trackedEvents[b]||0,this.trackedEvents[b]++,a.WIGOI&&a.WIGOI.videoEvent&&a.WIGOI.videoEvent(b,d?d.toFixed(2)||d.toString():"undefined",e?100*d/e:0,h),!0},c.prototype.triggerUrl=function(a){var b=new Image;b.src=a},c.prototype.getTrackedCount=function(a){return this.trackedEvents[a]||0},c.prototype.setMetadata=function(a,c,d){if(void 0===d&&(d=!0),"string"!=typeof a||!a)return this.logger.warn("setMetadata: key is mandatory (string).",a),!1;if("string"!=typeof c&&"function"!=typeof c)return this.logger.warn("setMetadata: value: String or Function expected.",c),!1;if("boolean"!=typeof d)return this.logger.warn("setMetadata: multiple: Boolean expected.",d),!1;var e=new b.Metadata(a,c,d);return!!e&&(this.metadatas.push(e),!0)},c.prototype.processMetadata=function(a){for(var b,c,d=this.metadatas.length-1;d>=0;d--)b=this.metadatas[d],c=b.getKey(),0===c.indexOf("[")?a=a.replace(c,b.getValue()):a+=(a.indexOf("?")>=0?"&":"?")+b.getUrlPiece(),b.isMultiple()||this.metadatas.splice(d,1);return a},c.prototype.getTrackingsInfo=function(){var b,c={};for(var d in this.trackings)if(this.trackings.hasOwnProperty(d)){b=this.trackings[d];var e=b.getTracked();a.ArrayHelper.forEach(e,function(a,d){var e=new Date(a.time);c[b.getName()+"-"+d]={event:b.getName(),url:a.url,time:e.toTimeString().substr(0,8)+"."+e.getMilliseconds()}})}this.logger.table(c),this.logger.table(this.errors)},c.prototype.setTrackingError=function(b){return a.StringHelper.isURL(b)?void this.errorUrls.push(b):(this.logger.error("setTrackingError: wrong URL format",b),!1)},c.prototype.trackError=function(b,c){this.logger.warn("Track errors:",b,c),this.callback(b,"false");var d=new Date;this.errors.push({event:b,message:c,time:d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+"."+d.getMilliseconds()}),a.ArrayHelper.forEach(this.errorUrls,function(a){a+="&event="+encodeURIComponent(b),a+="&message="+encodeURIComponent(c);var d=new Image;d.src=a})},c.prototype.callback=function(a,b){if("function"==typeof this.handler)try{this.handler(a,b)}catch(c){this.logger.error("Callback error ("+a+"):",c)}},c.prototype.setCallback=function(a){"function"==typeof a&&(this.handler=a)},c.prototype.removeBillableParamsDuplicates=function(b){var c=this,d=a.URIHelper.parse(b),e=d.hostname,f=["teads.tv","teads.net"],g=!!a.ArrayHelper.filter(f,function(b){return"string"==typeof e&&a.StringHelper.endsWith(e,b)}).length;if(g&&(b.indexOf("?revenue=")>-1||b.indexOf("&revenue=")>-1))if(b.indexOf("analyticsOnly=false")>-1&&this.alreadyBilledAdvertiser.whenAnalyticsOnlyEqualsFalse||b.indexOf("analyticsOnly=true")>-1&&this.alreadyBilledAdvertiser.whenAnalyticsOnlyEqualsTrue)try{var h=a.URIHelper.parseQueryString(d.search),i=["revenue","revenue_curr","srevenue","srevenue_curr"];h.cost||i.push("analyticsOnly"),a.ArrayHelper.forEach(i,function(a){if(h.hasOwnProperty(a)){var d=a+"="+h[a];b=b.replace("?"+d+"&","?"),b=b.replace("&"+d,""),b=b.replace("?"+d,"?"),(b.indexOf("?"+a+"=")>-1||b.indexOf("&"+a+"=")>-1)&&c.sumoTracker.sendWarning(["billable not-removed "+a,b].join(";"),null,1)}})}catch(j){this.sumoTracker.sendWarning(["billable error-removing-duplicates",b,j].join(";"),null,1)}else b.indexOf("analyticsOnly=false")>-1?this.alreadyBilledAdvertiser.whenAnalyticsOnlyEqualsFalse=!0:b.indexOf("analyticsOnly=true")>-1&&(this.alreadyBilledAdvertiser.whenAnalyticsOnlyEqualsTrue=!0);return b},c}();b.Tracker=c}(b=a.tracker||(a.tracker={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b;!function(a){var b=function(){function a(){}return a.applyVendorProperties=function(b,c,d){b.style[c]=d,c=a.capitalize(c),b.style["Moz"+c]=d,b.style["webkit"+c]=d,b.style["O"+c]=d,b.style["ms"+c]=d},a.capitalize=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},a.now=function(){return window.performance?window.performance.now():Date.now()},a.fillArray=function(a,b){for(var c=0,d=a.length;c>1),p=0,q=4*this.decoderWidth,r=4*this.decoderWidth,s=this.decoderWidth>>1,t=this.decoderHeight>>1,u=0;u>8)-179,e=(88*b>>8)-44+(183*c>>8)-91,f=b+(198*b>>8)-227;var w=g[k++],x=g[k++];j[p]=w+d,j[p+1]=w-e,j[p+2]=w+f,j[p+4]=x+d,j[p+5]=x-e,j[p+6]=x+f,p+=8;var y=g[l++],z=g[l++];j[q]=y+d,j[q+1]=y-e,j[q+2]=y+f,j[q+4]=z+d,j[q+5]=z-e,j[q+6]=z+f,q+=8}k+=m,l+=m,p+=r,q+=r,n+=o}},c.prototype.renderFrame2D=function(a){this.YCbCrToRGBA(a),this.canvasContext.putImageData(this.currentRGBA,0,0)},c}(b.EventDispatcher);b.Canvas=c}(b=a.components||(a.components={}))}(b=a.player||(a.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b;!function(a){!function(a){a[a.FULL=0]="FULL",a[a.SMART=1]="SMART",a[a.NO_STREAM=2]="NO_STREAM"}(a.StreamType||(a.StreamType={}));a.StreamType}(b=a.model||(a.model={}))}(b=a.player||(a.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b;!function(a){!function(a){a[a.INIT=0]="INIT",a[a.INIT_VIDEO=1]="INIT_VIDEO",a[a.INIT_AUDIO=2]="INIT_AUDIO",a[a.CAN_PLAY=3]="CAN_PLAY",a[a.PLAYING=4]="PLAYING",a[a.PAUSED=5]="PAUSED",a[a.LOADED=6]="LOADED",a[a.STALLED=7]="STALLED",a[a.ENDED=8]="ENDED"}(a.MediaState||(a.MediaState={}));a.MediaState}(b=a.model||(a.model={}))}(b=a.player||(a.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){var d=function(c){function d(d,e,f,g){c.call(this),this.meta=e,this.player=g,this.logger=new a.Logger("canvas.player.components.Video"),this.head=0,this.targetTime=0,this.decodeFinish=!1,this.benchFps=0,this.benchFpsRetained=0,this.benchFpsCount=0,this.fpsLimit=0,this.frameRate=24,this.frameStart=1,this.frameCachedLimit=24,this.videoFrames=[],this.frameWait=Math.floor(1e3/this.frameRate);var h=b.helper.Utils.blob('importScripts("'+this.player.parameters.assetsPath+'/teads-mpeg-decoder.min.js")');this.worker=new Worker(b.helper.Utils.url().createObjectURL(h)),this.worker.onmessage=this.onmessage.bind(this),this.worker.postMessage(["init",d,e]),this.state=b.model.MediaState.INIT}return __extends(d,c),d.prototype.canplay=function(){return this.state===b.model.MediaState.CAN_PLAY||this.state===b.model.MediaState.PLAYING||this.state===b.model.MediaState.PAUSED||this.state===b.model.MediaState.LOADED||this.state===b.model.MediaState.ENDED},d.prototype.play=function(){this.state!==b.model.MediaState.PLAYING&&(this.state=b.model.MediaState.PLAYING,this.loopPlay())},d.prototype.pause=function(){this.state!==b.model.MediaState.STALLED&&(this.state=b.model.MediaState.PAUSED)},d.prototype.getCurrentTime=function(){return this.state===b.model.MediaState.INIT?0:this.head/this.frameRate},d.prototype.setCurrentTime=function(a){var b=Math.ceil(a*this.frameRate);return!!this.videoFrames[b]&&(this.cleanFrame(this.head,b),this.head=b,!0)},Object.defineProperty(d.prototype,"duration",{get:function(){return this.decodeFinish?this.videoFrames.length/this.frameRate:parseFloat(this.meta.infos.duration)},enumerable:!0,configurable:!0}),d.prototype.cleanStallTimeout=function(){clearTimeout(this.timeoutStalled),this.timeoutStalled=null,this.state=b.model.MediaState.PAUSED},d.prototype.onload=function(){this.dispatch(b.model.mediaEvents.LOADED),this.decodeFinish=!0},d.prototype.oninit=function(){this.benchFps=b.helper.Utils.now(),this.state=b.model.MediaState.INIT_VIDEO,this.renderFrame()},d.prototype.oncanplay=function(){this.state=b.model.MediaState.CAN_PLAY,this.dispatch(b.model.mediaEvents.CAN_PLAY)},d.prototype.onstalled=function(){var a=this;this.state=b.model.MediaState.STALLED,this.dispatch(b.model.mediaEvents.STALLED),this.listen(b.model.mediaEvents.LOADED,function(){return a.onresumestalled()})},d.prototype.onresumestalled=function(){this.state===b.model.MediaState.STALLED&&(this.cleanStallTimeout(),this.dispatch(b.model.mediaEvents.RESUME_AFTER_STALLED))},d.prototype.ondecodeframe=function(){this.state!==b.model.MediaState.ENDED&&this.dispatch(b.model.mediaEvents.TIME_UPDATE)},d.prototype.onfinish=function(){this.state=b.model.MediaState.ENDED,this.dispatch(b.model.mediaEvents.ENDED)},d.prototype.onmessage=function(a){var b=a.data[0];switch(b){case"frame":this.appendFrames(a.data),this.videoFrames.length===this.frameStart?this.oninit():this.videoFrames.length===this.frameCachedLimit&&this.oncanplay();break;case"initCanvas":this.player.resize(a.data[1],a.data[2]);break;case"finish":this.averageDecodingTime=a.data[1],this.onload();break;default:this.logger.debug(a.data)}},d.prototype.appendFrames=function(a){var c=this;if(this.videoFrames.push({codedWidth:a[1],halfWidth:a[2],currentY:new Uint8Array(a[3]),currentCr:new Uint8Array(a[4]),currentCb:new Uint8Array(a[5])}),this.averageDecodingTime=a[6],this.benchFpsCount++,this.benchFpsCount===this.frameCachedLimit){this.benchFpsRetained=b.helper.Utils.now()-this.benchFps;var d=Math.ceil(this.frameRate*this.benchFpsRetained/1e3);this.fpsLimit=Math.max(3,Math.min(this.frameCachedLimit,d+1))}this.state===b.model.MediaState.STALLED&&this.head+this.frameCachedLimit<=this.videoFrames.length&&(this.averageDecodingTime<=1e3/this.frameRate?this.timeoutStalled||(this.logger.warn("We are stalled and have",this.frameCachedLimit,"in memory, but stalled for download, so wait",2*this.benchFpsRetained,"ms"),this.timeoutStalled=setTimeout(function(){return c.onresumestalled()},2*this.benchFpsRetained),this.dispatch(b.model.mediaEvents.BENCH_FPS,2*this.benchFpsRetained)):this.onresumestalled())},d.prototype.loopPlay=function(){var a=this;this.head++;var c=this.targetTime?Math.max(-(this.frameWait/2),Math.min(0,this.targetTime-b.helper.Utils.now())):0,d=this.head>=this.videoFrames.length-1;d?(this.decodeFinish?this.onfinish():this.onstalled(),this.targetTime=0):this.state===b.model.MediaState.PLAYING&&(this.targetTime=b.helper.Utils.now()+this.frameWait,window.setTimeout(function(){return a.loopPlay()},this.frameWait+c)),this.renderFrame(),this.head%this.frameRate===0&&this.ondecodeframe()},d.prototype.renderFrame=function(){this.videoFrames[this.head]&&(this.player.renderFrame(this.videoFrames[this.head]),this.videoFrames[this.head]=null,this.videoFrames.length=3&&!this.reading&&this.readResponseRecursive()},d.prototype.readResponseRecursive=function(){if(this.reading){var a=b.helper.Utils.now(),c=this.xhr.responseText.substr(this.headBuffer,4*this.meta.infos.averageFrameSize),d=new RegExp("frame\\[("+this.videoFrames.length+")\\](.*)frame\\["+(this.videoFrames.length+1)+"\\]"),e=d.exec(c);if(this.extractTime+=b.helper.Utils.now()-a,this.extractCount++,e)this.headBuffer+=7+this.videoFrames.length.toString().length+e[2].length,this.extractFrame(e);else if(this.loaded){var f=new RegExp("frame\\[("+this.videoFrames.length+")\\](.*)"),g=f.exec(c);g&&(this.headBuffer+=7+this.videoFrames.length.toString().length+g[2].length,this.extractFrame(g))}this.headBuffer>=this.xhr.responseText.length&&(this.reading=!1,this.stopTickTimer())}else this.reading=!0,this.initTickTimer()},d.prototype.initTickTimer=function(){var a=this;if(this.useWorker())try{var c=b.helper.Utils.blob('self.setInterval(function(){self.postMessage("tick")}, 1)');this.worker=new Worker(b.helper.Utils.url().createObjectURL(c)),this.worker.onmessage=function(b){return a.readResponseRecursive()}}catch(d){this.tickInterval=setInterval(function(){return a.readResponseRecursive()},1),this.sumologic.sendError("Cannot create worker")}else this.tickInterval=setInterval(function(){return a.readResponseRecursive()},1)},d.prototype.stopTickTimer=function(){this.worker?this.worker.terminate():this.tickInterval&&(clearInterval(this.tickInterval),this.tickInterval=null)},d.prototype.useWorker=function(){return a.Context.isAmp()&&!!window.Worker&&!!b.helper.Utils.url()&&!!b.helper.Utils.url().createObjectURL},d.prototype.onload=function(){this.loaded=!0,this.dispatch(b.model.mediaEvents.LOADED)},d.prototype.oninit=function(){this.benchFps=b.helper.Utils.now(),this.state=b.model.MediaState.INIT_VIDEO,this.player.resize(this.videoFrames[0].width,this.videoFrames[0].height),this.player.videoWidth=this.videoFrames[0].width,this.player.videoHeight=this.videoFrames[0].height,this.player.dispatch(b.model.mediaEvents.LOADED_METADATA),this.player.dispatch(b.model.mediaEvents.DURATION_CHANGE),this.player.dispatch(b.model.mediaEvents.LOADED_DATA),this.player.renderHtmlImageElement(this.videoFrames[0])},d.prototype.oncanplay=function(){this.state===b.model.MediaState.INIT_VIDEO&&(this.state=b.model.MediaState.CAN_PLAY,this.dispatch(b.model.mediaEvents.CAN_PLAY))},d.prototype.onstalled=function(){var a=this;this.state=b.model.MediaState.STALLED,this.dispatch(b.model.mediaEvents.STALLED),this.listen(b.model.mediaEvents.LOADED,function(){return a.onresumestalled()})},d.prototype.onresumestalled=function(){this.state===b.model.MediaState.STALLED&&this.dispatch(b.model.mediaEvents.RESUME_AFTER_STALLED)},d.prototype.ondecodeframe=function(){this.state!==b.model.MediaState.ENDED&&this.dispatch(b.model.mediaEvents.TIME_UPDATE)},d.prototype.onfinish=function(){this.state=b.model.MediaState.ENDED,this.dispatch(b.model.mediaEvents.ENDED),this.videoFrames=[]},d.prototype.extractFrame=function(a){var c=this,d=b.helper.Utils.now(),e=this.videoFrames[a[1]]=new Image;e.src="data:image/jpeg;base64,"+a[2],e.onload=function(){return c.decodingTime+=b.helper.Utils.now()-d},1===this.videoFrames.length?e.onload=function(){return c.oninit()}:this.videoFrames.length>=this.frameCachedLimit&&this.oncanplay(),this.head+this.frameCachedLimit<=this.videoFrames.length&&this.onresumestalled()},d.prototype.loopPlay=function(){var a=this;this.head++;var c=this.targetTime?Math.max(-(this.frameWait/2),this.targetTime-b.helper.Utils.now()):0,d=this.head>=this.videoFrames.length-1;d?(this.loaded&&!this.reading?this.onfinish():this.onstalled(),this.targetTime=0):this.state===b.model.MediaState.PLAYING&&(this.targetTime=b.helper.Utils.now()+this.frameWait+c,window.setTimeout(function(){return a.loopPlay()},this.frameWait+c)),this.head&&this.videoFrames&&this.videoFrames[this.head]&&this.player.renderHtmlImageElement(this.videoFrames[this.head]),this.head%this.frameRate===0&&this.ondecodeframe()},d}(c.EventDispatcher);c.JpegVideo=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){var d=function(d){function e(e,f,g,h){d.call(this),this.meta=f,this.player=g;var i=e+"/"+f.mp4;this.authorized=!!c.PLAYERS[i],this.state=b.model.MediaState.INIT_VIDEO,this.load(i),this.authorized||a.Dom.addEventListener("touchstart",h,this.authorize.bind(this))}return __extends(e,d),e.prototype.canplay=function(){return!0},e.prototype.play=function(){this.state!==b.model.MediaState.PLAYING&&(this.state=b.model.MediaState.PLAYING,this.video.play())},e.prototype.pause=function(){this.state!==b.model.MediaState.STALLED&&(this.state=b.model.MediaState.PAUSED,this.video.pause())},e.prototype.getCurrentTime=function(){return this.video.currentTime},e.prototype.setCurrentTime=function(a){return!!(this.video.currentTime=a)},Object.defineProperty(e.prototype,"duration",{get:function(){return parseFloat(this.meta.infos.duration)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageDecodingTime",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageExtractTime",{get:function(){return 0},enumerable:!0,configurable:!0}),e.prototype.cleanStallTimeout=function(){},e.prototype.authorize=function(){this.authorized||(this.authorized=!0,this.video.play(),this.state!==b.model.MediaState.PLAYING&&this.video.pause(),this.oncanplay())},e.prototype.load=function(a){var d=this;this.video=c.PLAYERS[a]=c.PLAYERS[a]||document.createElement("video"),this.video.setAttribute("webkit-playsinline","true"),this.video.src=a,this.video.onload=function(){return d.onload()},this.video.onended=function(){return d.onfinish()},this.video.ontimeupdate=function(){return d.ondecodeframe()},this.video.onloadedmetadata=function(){d.player.videoWidth=d.video.videoWidth,d.player.videoHeight=d.video.videoHeight,d.player.dispatch(b.model.mediaEvents.LOADED_METADATA),d.player.dispatch(b.model.mediaEvents.DURATION_CHANGE),d.player.dispatch(b.model.mediaEvents.LOADED_DATA),d.oncanplay()},this.player.useCustomDisplay(this.video)},e.prototype.onload=function(){this.dispatch(b.model.mediaEvents.LOADED)},e.prototype.oncanplay=function(){this.state===b.model.MediaState.INIT_VIDEO&&this.authorized&&(this.state=b.model.MediaState.CAN_PLAY,this.dispatch(b.model.mediaEvents.CAN_PLAY))},e.prototype.ondecodeframe=function(){this.state!==b.model.MediaState.ENDED&&this.dispatch(b.model.mediaEvents.TIME_UPDATE)},e.prototype.onfinish=function(){this.state=b.model.MediaState.ENDED,this.dispatch(b.model.mediaEvents.ENDED)},e}(c.EventDispatcher);c.Mp4Video=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){var d=function(d){function e(e,f,g,h){d.call(this),this.meta=f,this.player=g,this.targetTime=0,this.frameWait=1e3/24,this.frameWaitS=1/24;var i=e+"/"+f.mp4;this.authorized=!!c.PLAYERS[i]||!a.Context.isMobile()&&!a.Context.isTablet(),this.state=b.model.MediaState.INIT_VIDEO,this.load(i),this.authorized||a.Dom.addEventListener("touchstart",h,this.authorize.bind(this));var j=document.createElement("div"),k="\n";j.innerHTML=k,this.player.container.appendChild(j.firstChild)}return __extends(e,d),e.prototype.canplay=function(){return!0},e.prototype.play=function(){var a=this;this.state!==b.model.MediaState.PLAYING&&this.authorized?(this.state=b.model.MediaState.PLAYING,this.loopPlay()):this.authorized||this.listen(b.model.mediaEvents.CAN_PLAY,function(){return a.play()})},e.prototype.pause=function(){this.state!==b.model.MediaState.STALLED&&(this.state=b.model.MediaState.PAUSED, this.timer&&(clearTimeout(this.timer),this.timer=null))},e.prototype.getCurrentTime=function(){return this.video.currentTime},e.prototype.setCurrentTime=function(a){return!!(this.video.currentTime=a)},Object.defineProperty(e.prototype,"duration",{get:function(){return parseFloat(this.meta.infos.duration)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageDecodingTime",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageExtractTime",{get:function(){return 0},enumerable:!0,configurable:!0}),e.prototype.cleanStallTimeout=function(){},e.prototype.authorize=function(){this.authorized||(this.video.play(),this.video.pause(),this.authorized=!0,this.oncanplay())},e.prototype.load=function(a){var d=this,e=!!c.PLAYERS[a];this.video=c.PLAYERS[a]=c.PLAYERS[a]||document.createElement("video"),this.video.muted=!0,e||(this.video.src=a),this.player.useCustomDisplay(this.video),this.video.onload=function(){return d.onload()},this.video.ontimeupdate=function(){return d.ondecodeframe()},this.video.onloadedmetadata=function(){d.player.videoWidth=d.video.videoWidth,d.player.videoHeight=d.video.videoHeight,d.player.dispatch(b.model.mediaEvents.LOADED_METADATA),d.player.dispatch(b.model.mediaEvents.DURATION_CHANGE),d.player.dispatch(b.model.mediaEvents.LOADED_DATA),d.oncanplay()}},e.prototype.onload=function(){this.dispatch(b.model.mediaEvents.LOADED)},e.prototype.oncanplay=function(){this.state===b.model.MediaState.INIT_VIDEO&&this.authorized&&(this.state=b.model.MediaState.CAN_PLAY,this.dispatch(b.model.mediaEvents.CAN_PLAY))},e.prototype.ondecodeframe=function(){this.state!==b.model.MediaState.ENDED&&this.dispatch(b.model.mediaEvents.TIME_UPDATE)},e.prototype.onfinish=function(){this.pause(),this.video.currentTime=0,this.state=b.model.MediaState.ENDED,this.dispatch(b.model.mediaEvents.ENDED)},e.prototype.loopPlay=function(){var a=this;if(this.video.currentTime+this.frameWaitS>this.video.duration)return this.video.currentTime=this.video.duration,this.onfinish();this.video.currentTime+=this.frameWaitS;var c=this.targetTime?Math.max(-(this.frameWait/2),this.targetTime-b.helper.Utils.now()):0;this.state===b.model.MediaState.PLAYING&&(this.targetTime=b.helper.Utils.now()+this.frameWait+c,this.timer=window.setTimeout(function(){return a.loopPlay()},this.frameWait+c))},e}(c.EventDispatcher);c.Mp4CTVideo=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){c.PLAYERS=c.PLAYERS||{};var d=function(d){function e(e,f,g,h){var i=this;d.call(this),this.meta=f,this.player=h,this.sumologic=new a.Sumologic;var j=a.HTMLHelper.findParentWindows(document.body).pop(),k=j===window.top,l=a.Context.isChromeIos()&&a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"10");this.sumologic.init(a.Sumologic.CONFIGS.PLAYER,this.player.parameters.sumologicSessionId),k&&this.meta.mp4&&("HTML5"===this.player.parameters.type||a.Context.isIpad()&&a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"9.2")&&"CANVAS"!==this.player.parameters.type)?(this.api=new c.Mp4Video(e,f,h,j),this.sumologic.sendInfo("canvas video mp4")):k&&this.meta.mp4&&"CANVAS"!==this.player.parameters.type&&a.Semver.isGreaterThan(a.Context.getIosVersion(),"9.1")&&!l?(this.api=new c.Mp4CTVideo(e,f,h,j),this.sumologic.sendInfo("canvas video mp4CT")):this.meta.tv?(this.api=new c.JpegVideo(e,f,g,h),this.sumologic.sendInfo("canvas video tv")):(this.api=new c.MpegVideo(e,f,g,h),this.sumologic.sendInfo("canvas video mpeg")),this.api.listen(b.model.mediaEvents.CAN_PLAY,function(){return i.dispatch(b.model.mediaEvents.CAN_PLAY)}),this.api.listen(b.model.mediaEvents.LOADED,function(){return i.dispatch(b.model.mediaEvents.LOADED)}),this.api.listen(b.model.mediaEvents.STALLED,function(){return i.dispatch(b.model.mediaEvents.STALLED)}),this.api.listen(b.model.mediaEvents.RESUME_AFTER_STALLED,function(){return i.dispatch(b.model.mediaEvents.RESUME_AFTER_STALLED)}),this.api.listen(b.model.mediaEvents.TIME_UPDATE,function(){return i.dispatch(b.model.mediaEvents.TIME_UPDATE)}),this.api.listen(b.model.mediaEvents.ENDED,function(){return i.dispatch(b.model.mediaEvents.ENDED)}),this.api.listen(b.model.mediaEvents.BENCH_FPS,function(a){return i.dispatch(b.model.mediaEvents.BENCH_FPS,a)})}return __extends(e,d),e.prototype.canplay=function(){return this.api.canplay()},e.prototype.play=function(){this.api.play()},e.prototype.pause=function(){this.api.pause()},e.prototype.getCurrentTime=function(){return this.api.getCurrentTime()},e.prototype.setCurrentTime=function(a){return this.api.setCurrentTime(a)},Object.defineProperty(e.prototype,"duration",{get:function(){return this.api.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this.api.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"videoFrames",{get:function(){return this.api.videoFrames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageDecodingTime",{get:function(){return this.api.averageDecodingTime},enumerable:!0,configurable:!0}),e.prototype.cleanStallTimeout=function(){this.api.cleanStallTimeout()},e}(c.EventDispatcher);c.Video=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b;!function(a){}(b=a.model||(a.model={}))}(b=a.player||(a.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){var d=function(c){function d(b,d,e){c.call(this),this.baseUrl=b,this.chunkUrls=d,this.streamType=e,this.chunkLoaded=0,this.chunkLength=0,this.loggerF=new a.Logger("canvas.player.components.File"),this.chunkNumStart=1,this.chunkNumCanPlay=3,this.chunkLength=this.chunkUrls.length,this.streamLoad()}return __extends(d,c),d.prototype.canplay=function(){return this.state===b.model.MediaState.CAN_PLAY||this.state===b.model.MediaState.PLAYING||this.state===b.model.MediaState.PAUSED||this.state===b.model.MediaState.LOADED||this.state===b.model.MediaState.ENDED},d.prototype.streamLoad=function(){var c=this,d=window.location.protocol.match(/http|https/gi)?"":"http:",e=d+this.baseUrl+"/"+this.chunkUrls.shift(),f=a.Request.createXmlHttpRequest();f.open("GET",e,!0),f.responseType="arraybuffer",f.addEventListener("load",function(a){c.chunkLoaded++,c.chunkLoaded===c.chunkNumStart?c.dispatch(b.model.mediaEvents.LOADED_DATA,f.response):c.dispatch(b.model.mediaEvents.PROGRESS,f.response),(c.chunkLoaded===c.chunkNumCanPlay||c.chunkLength=3},enumerable:!0,configurable:!0}),d.prototype.canplay=function(){return!0},d.prototype.playing=function(){return this.state===b.model.MediaState.PLAYING},d.prototype.release=function(){},d}(c.EventDispatcher);c.HtmlAudioElement=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c;!function(c){var d=function(d){function e(a,b,c,e){d.call(this),this.baseUrl=a,this.meta=b,this.stream=c,this.player=e,b.audio.length&&this.init()}return __extends(e,d),e.prototype.authorizeAudio=function(a){this.api?this.api.authorizeAudio(a):a()},e.prototype.play=function(a){void 0===a&&(a=0),this.api&&this.api.play(a)},e.prototype.pause=function(){this.api&&this.api.pause()},Object.defineProperty(e.prototype,"duration",{get:function(){return this.api?this.api.duration:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.api?this.api.currentTime:0},set:function(a){this.api&&(this.api.currentTime=a)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this.api?this.api.volume:0},set:function(a){this.api&&(this.api.volume=a)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"authorized",{get:function(){return!this.api||this.api.authorized},enumerable:!0,configurable:!0}),e.prototype.canplay=function(){return!this.api||this.api.canplay()},e.prototype.playing=function(){return!!this.api&&this.api.playing()},e.prototype.release=function(){this.api&&this.api.release()},e.prototype.init=function(){var d=this;(a.Context.isAndroid()||a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"9.1")&&this.meta.infos.audio_size<4e5)&&a.Utils.getAudioContext()?this.api=new c.WebAudioApi(this.baseUrl,this.meta,this.stream,this.player.defaultVolume):this.api=new c.HtmlAudioElement(this.baseUrl,this.meta,this.player.defaultVolume),this.api.listen(b.model.mediaEvents.CAN_PLAY,function(){return d.dispatch(b.model.mediaEvents.CAN_PLAY)})},e}(c.EventDispatcher);c.Audio=d}(c=b.components||(b.components={}))}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b;!function(b){var c=function(){function b(b){var c=this;this.player=b,this.initBufferDiv(),this.player.video.listen(a.model.mediaEvents.STALLED,function(){return c.show()}),this.player.video.listen(a.model.mediaEvents.RESUME_AFTER_STALLED,function(){return c.hide()}),this.player.video.listen(a.model.mediaEvents.TIME_UPDATE,function(){return c.hide()}),this.player.listen(a.model.mediaEvents.RESIZE,function(a){return c.resize(a)})}return b.prototype.show=function(){this.player.container.insertBefore(this.container,this.player.html5video||this.player.canvas||null)},b.prototype.hide=function(){this.container.parentNode&&this.player.container.removeChild(this.container)},b.prototype.resize=function(a){this.container.style.top=a.height/2-this.container.offsetHeight+"px",this.container.style.left=a.width/2-this.container.offsetWidth/2+"px"},b.prototype.initBufferDiv=function(){var a=document.createElement("div");this.template="
\n\nloading...
\n",a.innerHTML=this.template,this.container=a.firstChild},b}();b.Buffering=c}(b=a.components||(a.components={}))}(b=a.player||(a.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(c){function d(b,d,e,f){void 0===f&&(f={}),c.call(this,b,d,e),this.parameters=f,this.defaultVolume=0,this.logger=new a.Logger("canvas.player.CanvasPlayer"),this.audioSyncDiff=.5,this.waitForPlay=!1,this.logger.debug("constructor()",b,d,e,f.assetsPath),this.parameters.assetsPath&&this.parameters.assetsPath.match(/http:|https:/)||(this.logger.warn("assetsPath replace with default (relative path not allow)"),this.parameters.assetsPath=window.location.protocol+"//cdn.teads.tv/media/player")}return __extends(d,c),d.prototype.load=function(a,c,d){var e=this;void 0===c&&(c=!1),void 0===d&&(d=b.model.StreamType.NO_STREAM),this.logger.debug("load()",a,c,d),this.url=a.replace(/http:|https:/,""),this.dispatch(b.model.mediaEvents.LOAD_START),this.getMeta(this.url,function(a){var f=e.url.split("/");f.pop(),e.video=new b.components.Video(f.join("/"),a,d,e),e.audio=new b.components.Audio(f.join("/"),a,d,e),e.buffer=new b.components.Buffering(e),c&&e.listen(b.model.mediaEvents.CAN_PLAY,function(){return e.play()}),e.buffer.show(),e.listen(b.model.mediaEvents.CAN_PLAY,function(){return e.buffer.hide()}),e.listen(b.model.mediaEvents.ENDED,function(){return e.audio.release()}),e.video.listen(b.model.mediaEvents.STALLED,function(){return e.dispatch(b.model.mediaEvents.STALLED)}),e.video.listen(b.model.mediaEvents.STALLED,function(){return e.pause(!0)}),e.video.listen(b.model.mediaEvents.RESUME_AFTER_STALLED,function(){return e.dispatch(b.model.mediaEvents.RESUME_AFTER_STALLED)}),e.video.listen(b.model.mediaEvents.RESUME_AFTER_STALLED,function(){return e.play()}),e.video.listen(b.model.mediaEvents.TIME_UPDATE,function(){return e.onVideoProgress()}),e.video.listen(b.model.mediaEvents.CAN_PLAY,function(){return e.canPlayAll()}),e.audio.listen(b.model.mediaEvents.CAN_PLAY,function(){return e.canPlayAll()}),e.video.listen(b.model.mediaEvents.ENDED,function(){return e.dispatch(b.model.mediaEvents.ENDED)}),e.video.listen(b.model.mediaEvents.LOADED,function(){return e.dispatch(b.model.mediaEvents.LOADED)}),e.video.listen(b.model.mediaEvents.ERROR,function(){return e.dispatch(b.model.mediaEvents.ERROR,{error:"An error occured with the video."})})})},d.prototype.play=function(){var a=this;this.logger.info("play()"),this.canplay()?(this.waitForPlay=!1,this.video.play(),this.audio.play(),this.dispatch(b.model.mediaEvents.PLAY),this.dispatch(b.model.mediaEvents.PLAYING)):this.waitForPlay||(this.waitForPlay=!0,this.dispatch(b.model.mediaEvents.STALLED),this.dispatch(b.model.mediaEvents.PAUSE),this.listen(b.model.mediaEvents.CAN_PLAY,function(){a.dispatch(b.model.mediaEvents.RESUME_AFTER_STALLED),a.play()}))},d.prototype.pause=function(a){void 0===a&&(a=!1),this.video&&this.audio?(this.video.pause(),this.audio.pause(),this.dispatch(b.model.mediaEvents.PAUSE),this.logger.info("pause()"),a||this.video.state!==b.model.MediaState.STALLED||(this.video.cleanStallTimeout(),this.buffer.hide())):(this.muteEvent(b.model.mediaEvents.CAN_PLAY),this.waitForPlay=!1)},d.prototype.canplay=function(){return!(!this.video||!this.audio)&&(this.video.canplay()&&this.audio.canplay())},Object.defineProperty(d.prototype,"src",{get:function(){return this.url},set:function(a){this.load(a,!1,b.model.StreamType.FULL)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"currentTime",{get:function(){return this.video?this.video.getCurrentTime():0},set:function(a){this.video&&(this.logger.info("set currentTime",a),this.dispatch(b.model.mediaEvents.SEEKING),this.video.setCurrentTime(a)&&(this.audio.currentTime=a),this.dispatch(b.model.mediaEvents.SEEKED))},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"duration",{get:function(){return this.video&&this.audio?this.video.duration||this.audio.duration:0},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"volume",{get:function(){return this.audio?this.audio.volume:0},set:function(a){var c=this;if(this.logger.debug("set volume",a),this.audio){this.audio.volume=a;var d=function(){return c.audio.play(c.currentTime)};this.audio.canplay()&&this.video.state===b.model.MediaState.PLAYING&&d(),this.dispatch(b.model.mediaEvents.VOLUME_CHANGE,{value:a})}else this.defaultVolume=a},enumerable:!0,configurable:!0}),d.prototype.onVideoProgress=function(){if(this.audio.api&&this.audio.playing()){var a=this.audio.currentTime-this.currentTime,c=Math.abs(a);c>=this.audioSyncDiff&&(a>0||this.video.meta.tv?this.video.setCurrentTime(this.audio.currentTime)||this.video.setCurrentTime(this.currentTime+this.audioSyncDiff):this.audio.currentTime=this.currentTime,this.logger.debug("sync audio (diff/audioTime)",c,this.audio.currentTime),this.dispatch(b.model.mediaEvents.AUDIO_SYNC,{value:c}))}this.dispatch(b.model.mediaEvents.TIME_UPDATE)},d.prototype.canPlayAll=function(){this.canplay()&&(this.dispatch(b.model.mediaEvents.CAN_PLAY),this.dispatch(b.model.mediaEvents.LOADED_METADATA))},d.prototype.getMeta=function(c,d){var e=this,f=a.Request.createXmlHttpRequest();f.open("GET",c.replace(/(\.mpg|\.mpeg|\.tv)(?!\/)/gi,".meta?v2"),!0),f.responseType="json",f.addEventListener("load",function(c){if(f.response){var g="string"==typeof f.response?a.JSON.parse(f.response):f.response;!g.tv&&(a.Context.isChromeIos()||a.Context.isUIWebview()||a.Context.isFacebookWebview()||a.Context.isIpad())?e.dispatch(b.model.mediaEvents.ERROR,{error:"The metadata are missing."}):d(g)}else e.dispatch(b.model.mediaEvents.ERROR,{error:"No response from the HTTPRequest, did the file exist?"})}),f.addEventListener("error",function(a){e.dispatch(b.model.mediaEvents.ERROR,{error:"An error occured with the HTTPRequest."}),e.logger.error.bind(e.logger)}),f.send()},d}(b.components.Canvas);b.CanvasPlayer=c}(c=b.player||(b.player={}))}(b=a.canvas||(a.canvas={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(){this.status=a.vpaid.VpaidStatus.READY,this.eventHandler=new a.vpaid.EventHandler,this.trackingRaised={AdVideoFirstQuartile:!1,AdVideoMidpoint:!1,AdVideoThirdQuartile:!1},this.parameters={},this.skippable=!1,this.expanded=!1}return c.prototype.getVPAID=function(){return this},c.prototype.handshakeVersion=function(a){return"2.0"},c.prototype.subscribe=function(a,b,c){this.eventHandler.subscribe(a,b,c)},c.prototype.unsubscribe=function(a,b){this.eventHandler.unsubscribe(a,b)},c.prototype.initAd=function(c,d,e,f,g,h){this.status=a.vpaid.VpaidStatus.LOADING,this.width=c,this.height=d,this.viewMode=e;try{g=a.AdParameterHelper.decode(g)}catch(i){return void this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdError,"invalid creative data : "+g)}for(var j in g)this.parameters[j]=g[j];return this.environmentVars=h,this.environmentVars.videoSlot||(this.environmentVars.videoSlot=b.PLAYER=b.PLAYER||document.createElement("video")),this.environmentVars.videoSlot.setAttribute&&(this.environmentVars.videoSlot.setAttribute("webkit-playsinline","true"),this.environmentVars.videoSlot.setAttribute("playsinline","true"),null===this.environmentVars.videoSlot.getAttribute("muted")&&this.environmentVars.videoSlot.setAttribute("muted","true")),this.environmentVars.slot?(this.video=this.environmentVars.videoSlot,void this.createContainer(this.environmentVars.slot)):void this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdError,"no slot provided in environmentVars")},c.prototype.startAd=function(){this.status=a.vpaid.VpaidStatus.STARTING},c.prototype.skipAd=function(){this.status=a.vpaid.VpaidStatus.SKIPPING},c.prototype.stopAd=function(){this.status=a.vpaid.VpaidStatus.STOPPING},c.prototype.resizeAd=function(a,b,c){this.width=a,this.height=b,this.viewMode=c},c.prototype.expandAd=function(){return!1},c.prototype.collapseAd=function(){return!1},c.prototype.getAdLinear=function(){return!0},c.prototype.getAdWidth=function(){return this.width},c.prototype.getAdHeight=function(){return this.height},c.prototype.getAdExpanded=function(){return a.HTMLHelper.isFullscreen()||this.expanded},c.prototype.getAdSkippableState=function(){return this.skippable},c.prototype.getAdCompanions=function(){return""},c.prototype.getAdIcons=function(){return!1},c.prototype.getAdDuration=function(){throw"not implemented"},c.prototype.getAdRemainingTime=function(){throw"not implemented"},c.prototype.getStatus=function(){return this.status},c.prototype.createContainer=function(a){this.container||(this.container=document.createElement("div"),this.container.style.position="relative",a.appendChild(this.container))},c.prototype.onAdVideoCompleteDispatched=function(){var a=this;this.parameters.noAutoStop?(this.video.addEventListener("seeked",function(){a.video.pause()},!1),this.video.currentTime=1):this.stopAd()},c.prototype.dispatchVpaidEvent=function(b,c){this.handleVPAIDEvent(new a.vpaid.VPAIDEvent(b,c))},c.prototype.handleVPAIDEvent=function(b){if(!(this.status===a.vpaid.VpaidStatus.SKIPPING&&b.type!==a.vpaid.VPAIDEvent.AdSkipped||this.status===a.vpaid.VpaidStatus.STOPPING&&b.type!==a.vpaid.VPAIDEvent.AdStopped||this.status<=a.vpaid.VpaidStatus.STOPPED||this.status===a.vpaid.VpaidStatus.STOPPING&&b.type!==a.vpaid.VPAIDEvent.AdStopped)){switch(b.type){case a.vpaid.VPAIDEvent.AdLoaded:this.status=a.vpaid.VpaidStatus.LOADED;break;case a.vpaid.VPAIDEvent.AdStarted:this.status=a.vpaid.VpaidStatus.STARTED;break;case a.vpaid.VPAIDEvent.AdVideoStart:case a.vpaid.VPAIDEvent.AdPlaying:this.status=a.vpaid.VpaidStatus.PLAYING;break;case a.vpaid.VPAIDEvent.AdPaused:this.status=a.vpaid.VpaidStatus.PAUSED;break;case a.vpaid.VPAIDEvent.AdVideoComplete:this.status=a.vpaid.VpaidStatus.COMPLETE;break;case a.vpaid.VPAIDEvent.AdSkipped:this.status=a.vpaid.VpaidStatus.SKIPPED;break;case a.vpaid.VPAIDEvent.AdStopped:this.status=a.vpaid.VpaidStatus.STOPPED;break;case a.vpaid.VPAIDEvent.AdDurationChange:case a.vpaid.VPAIDEvent.AdRemainingTimeChange:var c=this.getAdDuration(),d=c-this.getAdRemainingTime();c>0&&d>=.25*c&&!this.trackingRaised.AdVideoFirstQuartile?this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdVideoFirstQuartile):c>0&&d>=.5*c&&!this.trackingRaised.AdVideoMidpoint?this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdVideoMidpoint):c>0&&d>=.75*c&&!this.trackingRaised.AdVideoThirdQuartile&&this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdVideoThirdQuartile);break;case a.vpaid.VPAIDEvent.AdVideoFirstQuartile:case a.vpaid.VPAIDEvent.AdVideoMidpoint:case a.vpaid.VPAIDEvent.AdVideoThirdQuartile:if(this.trackingRaised[b.type])return;this.trackingRaised[b.type]=!0;break;case a.vpaid.VPAIDEvent.AdVideoComplete:this.status=a.vpaid.VpaidStatus.COMPLETE}this.eventHandler.handleEvent(b),this.status===a.vpaid.VpaidStatus.SKIPPED&&this.stopAd(),b.type===a.vpaid.VPAIDEvent.AdVideoComplete&&this.onAdVideoCompleteDispatched()}},c.prototype.handleException=function(b,c){var d='method "'+c+'" threw an exception: '+b.toString();this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLog,d),this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdError,d)},c}();b.BaseVPAIDCreative=c}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b=function(){function a(a,b,c){this.id=c,this.layer=document.createElement("div"),this.layer.className+="vpaid-clickthrough",this.layer.style.cursor="pointer",this.layer.style.opacity="0",this.layer.style.backgroundColor="#FFFFFF",this.layer.style.position="absolute",this.layer.style.zIndex="65000",this.layer.addEventListener("click",function(d){a(b,c,!0)},!1)}return a.prototype.resize=function(a,b){this.layer.style.width=a+"px",this.layer.style.height=b+"px"},a.prototype.remove=function(){this.layer.parentNode&&this.layer.parentNode.removeChild(this.layer)},a.prototype.append=function(a){a.firstChild?a.insertBefore(this.layer,a.firstChild):a.appendChild(this.layer)},a}();a.ClickThrough=b}(b=a.component||(a.component={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){!function(a){a[a.HAVE_NOTHING=0]="HAVE_NOTHING",a[a.HAVE_METADATA=1]="HAVE_METADATA",a[a.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",a[a.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",a[a.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(a.NetworkState||(a.NetworkState={}));a.NetworkState;!function(a){a[a.NETWORK_EMPTY=0]="NETWORK_EMPTY",a[a.NETWORK_IDLE=1]="NETWORK_IDLE",a[a.NETWORK_LOADING=2]="NETWORK_LOADING",a[a.NETWORK_NO_SOURCE=3]="NETWORK_NO_SOURCE"}(a.ReadyState||(a.ReadyState={}));a.ReadyState}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(){c.apply(this,arguments),this.config={url:"",skippable:!0,skipoffset:0,gradients:!0},this.eventMap={durationchange:"AdDurationChange",resize:"AdSizeChange",volumechange:"AdVolumeChange",ended:"AdVideoComplete",play:"AdPlaying",playing:"AdPlaying",pause:"AdPaused",timeupdate:"AdRemainingTimeChange",error:"AdError"}}return __extends(d,c),d.prototype.initAd=function(b,d,e,f,g,h){var i=this;if(this.status!==a.vpaid.VpaidStatus.READY)return void this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLog,"creative is not in ready state, cannot call initAd");try{this.parameters=this.config,c.prototype.initAd.call(this,b,d,e,f,g,h),a.Dom.addEventListener("error",this.video,function(a){i.handleVideoError(a)}),a.Dom.addEventListener("loadedmetadata",this.video,function(b){return i.dispatchVpaidEvent(a.vpaid.CustomVPAIDEvent.AdVideoMetadata,{ width:i.video.videoWidth,height:i.video.videoHeight})}),this.beginingTimestamp=Date.now(),this.video.preload="metadata",this.video.src=this.parameters.url,this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLoaded)}catch(j){this.handleException(j,"initAd")}},d.prototype.startAd=function(){var d=this;if(this.status>a.vpaid.VpaidStatus.LOADED)return void this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLog,"try to call startAd but ad is starting or is already started");if(this.status=Number(this.parameters.skipoffset)&&(this.skippable=!0,this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdSkippableStateChange)),this.videoHasStarted||this.sendAdVideoStartEvent()}this.dispatchVpaidEvent(c)}catch(d){var e='Creative threw an exception when handling "'+b.type+'" HTML5 video event: '+d.toString();this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLog,e),this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdError,{message:e,id:a.VastException.GENERAL.id})}},d.GRADIENT="iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAYAAADtlXTHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjM0ODU0RjM1QkFEMTFFNUE5RDI5OTE4QkFCM0I3NzciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjM0ODU0RjQ1QkFEMTFFNUE5RDI5OTE4QkFCM0I3NzciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCMzQ4NTRGMTVCQUQxMUU1QTlEMjk5MThCQUIzQjc3NyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCMzQ4NTRGMjVCQUQxMUU1QTlEMjk5MThCQUIzQjc3NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/",d.GRADIENT_TOP=d.GRADIENT+"Psk0S98AAAAgSURBVHjaYmBgYJBiAhIMIOI/nEDj0oNgYGaAAYAAAwAH4xg8FtOkrgAAAABJRU5ErkJggg==",d.GRADIENT_BOTTOM=d.GRADIENT+"PkIta+gAAAAaSURBVHjaYmBABoxMMIKBCYVLDwLJSoAAAwAWTwBRQ43+sgAAAABJRU5ErkJggg==",d}(b.BaseVPAIDCreative);b.VPAIDVideo=c}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(){b.apply(this,arguments)}return __extends(c,b),c.prototype.initAd=function(c,d,e,f,g,h){var i=this;try{h.videoSlot&&h.videoSlot.parentNode&&h.videoSlot.parentNode.removeChild(h.videoSlot),this.createContainer(h.slot);var j=a.AdParameterHelper.decode(g);h.videoSlot=new a.canvas.player.CanvasPlayer(this.container,c,d,j),h.videoSlot.addEventListener(a.canvas.player.model.mediaEvents.ERROR,function(a){return i.dispatchVpaidEvent(i.eventMap[a.type])}),b.prototype.initAd.call(this,c,d,e,f,j,h)}catch(k){this.handleException(k,"initAd")}},c.prototype.startAd=function(){if(this.status>a.vpaid.VpaidStatus.LOADED)return void this.dispatchVpaidEvent(a.vpaid.VPAIDEvent.AdLog,"try to call startAd but ad is starting or is already started");if(this.status-1},a.getPercentValue=function(a){return parseInt(a.replace("%",""),10)/100},a.isPixelValue=function(a){return String(a).indexOf("px")>-1},a.getPixelValue=function(a){return parseInt(a.replace("px",""),10)},a.getBooleanValue=function(a){return"true"===a||"false"!==a&&!!a},a.parseAttributes=function(b){var c=["width","height","src","preload","autoplay","loop"];c.forEach(function(c){b.hasAttribute(c)&&a.updateAttribute(b,c)})},a.updateAttribute=function(b,c){var d=b.getAttribute(c);switch(c){case"width":case"height":b.style[c]=d+(a.isPercentValue(d)||a.isPixelValue(d)?"":"px");break;case"src":case"preload":b[c]=d;break;case"autoplay":case"loop":b[c]=a.getBooleanValue(d)}},a}();a.CustomElementHelper=b}(b=a.helper||(a.helper={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(){function b(){}return b.ping=function(b,c){var d,e,f,g=a.Request.createXmlHttpRequest(),h=Date.now(),i=function(b){d||(clearTimeout(f),d=Date.now()-h,e=d<=100?1e3:d<200?700:d<400?500:300,c(d,e),(new a.Sumologic).sendInfo("ping "+[d,b].join(";")))};f=setTimeout(function(){return i("timeout")},500),g.open("HEAD",b+(b.indexOf("?")>-1?"&":"?")+h,!0),g.addEventListener("load",function(){return i("load")}),g.addEventListener("error",function(){return i("error")}),g.send()},b}();b.NetworkHelper=c}(c=b.helper||(b.helper={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){!function(a){a[a.ERROR=-1]="ERROR",a[a.UNSTARTED=0]="UNSTARTED",a[a.WAITING=1]="WAITING",a[a.READY=2]="READY"}(a.MediaProxyStatus||(a.MediaProxyStatus={}));a.MediaProxyStatus}(b=a.constant||(a.constant={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){var b=function(){function a(){}return a.READY="ready",a.ERROR="error",a.WAITING="waiting",a}();a.MediaProxyEvent=b}(b=a.constant||(a.constant={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b;!function(a){!function(a){a[a.MEDIA_ERR_ABORTED=1]="MEDIA_ERR_ABORTED",a[a.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",a[a.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",a[a.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED"}(a.MediaError||(a.MediaError={}));a.MediaError}(b=a.constant||(a.constant={}))}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(){c.apply(this,arguments),this.status=b.constant.MediaProxyStatus.UNSTARTED,this.sumologic=new a.Sumologic}return __extends(d,c),d.prototype.getStatus=function(){return this.status},d.prototype.getVideoUrl=function(){return this.videoUrl},d.prototype.load=function(c,d){var e=this;this.sumologic.isInitialized()||this.sumologic.init(a.Sumologic.CONFIGS.PLAYER),this.status=b.constant.MediaProxyStatus.WAITING,this.dispatch(b.constant.MediaProxyEvent.WAITING);var f=location.hostname.match(/.+\.sandbox\.teads\.net|localdocker/),g=a.Utils.getProtocol()+"//[HOST]/transcode?url=[URL]&bitrate=[BITRATE]".replace(/\[HOST\]/,f?f[0]+":18088":"mp.teads.tv").replace(/\[URL\]/,encodeURIComponent(c)).replace(/\[BITRATE\]/,d.toString()),h=a.Request.createXmlHttpRequest(),i=!1;h.open("GET",g,!0),h.onreadystatechange=function(){if(4===h.readyState&&!i){switch(h.status){case 200:e.videoUrl=h.responseText,e.status=b.constant.MediaProxyStatus.READY,e.dispatch(b.constant.MediaProxyEvent.READY,{errorCode:h.status}),i=!0;break;case 416:case 202:case 201:default:e.status=b.constant.MediaProxyStatus.ERROR,e.dispatch(b.constant.MediaProxyEvent.ERROR,{errorCode:h.status}),i=!0}e.sumologic.sendInfo(["proxy","resp",h.status].join(" "),null,1)}},h.send(),this.sumologic.sendInfo("proxy call",null,1)},d}(a.canvas.player.components.EventDispatcher);b.MediaProxy=c}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){function c(){var c=this;this.logger=new a.Logger("HTMLVideoCanvas"),this._mainContainer=document.createElement("div"),this._mainContainer.style.backgroundColor="black",this._mainContainer.style.position="relative",this._mainContainer.style.width="100%",this._mainContainer.style.height="100%",this._mainContainer.style.zIndex=1,this.appendChild(this._mainContainer),this._videoContainer=document.createElement("div"),this._videoContainer.style.position="absolute",this._videoContainer.style.top=0,this._videoContainer.style.left=0,this._videoContainer.style.zIndex=2,this._videoContainer.style.width="100%",this._videoContainer.style.height="100%",this._mainContainer.appendChild(this._videoContainer),this.canvasPlayer=new a.canvas.player.CanvasPlayer(this._videoContainer,1,1,{type:"CANVAS"}),this.mediaProxy=new b.MediaProxy,this.mediaProxy.listen(b.constant.MediaProxyEvent.READY,function(){c.logger.debug("MediaProxy return video url",c.mediaProxy.getVideoUrl()),c.canvasPlayer.src=c.mediaProxy.getVideoUrl(),c.autoplay&&c.canvasPlayer.play(),c.volume=c._volume}),this.mediaProxy.listen(b.constant.MediaProxyEvent.ERROR,function(){c.logger.debug("MediaProxy didn't return video url"),c._error={code:b.constant.MediaError.MEDIA_ERR_NETWORK},c.canvasPlayer.dispatch(b.dom.MediaEvent.error)}),this.canvasPlayer.canvas.style.position="absolute",this.canvasPlayer.canvas.style.maxHeight="none",this.canvasPlayer.canvas.style.maxWidth="none",this.canvasPlayer.canvas.style.top="0",this.canvasPlayer.canvas.style.left="0",b.dom.VideoWrapper.call(this,this.canvasPlayer),this.listeners={};var d=function(a){if(c.listeners[a.type]&&c.listeners[a.type].length){for(var b=0,e=c.listeners[a.type].length;b=0&&(this.listeners[a][e]=function(){})}else HTMLElement.prototype.removeEventListener.call(this,a,c,d)},c.prototype._handleResize=function(){this.canvasPlayer.width=this.width,this.canvasPlayer.height=this.height,this.style.backgroundColor="black"},c.prototype.createdCallback=function(){c.call(this)},c.prototype.attributeChangedCallback=function(a,c,d){this.logger.debug("attributeChangedCallback",a,c,d),b.helper.CustomElementHelper.updateAttribute(this,a)},c.prototype.detachedCallback=function(){this.logger.debug("detached callback called"),this.canvasPlayer.pause()},c.prototype.attachedCallback=function(){var b=this;this.logger.debug("attachedCallback called"),this.attachedCallbackCalled=!0;try{this.style.display="block",this.style.overflow="hidden",this.style.objectFit="contain";var c=["width","height","position","top","left"],d=this.ownerDocument.defaultView||this.ownerDocument.parentWindow,e=this.ownerDocument.createElement("video");this.parentNode.appendChild(e);var f=d.getMatchedCSSRules(e);if(e.parentNode.removeChild(e),f)for(var g=0;g"),this._iframeResizer.contentWindow.document.close();var i=function(){b._width=b._iframeResizer.contentWindow.innerWidth,b._height=b._iframeResizer.contentWindow.innerHeight,b.logger.debug("component resized",b.width,b.height),b._handleResize()};this._iframeResizer.contentWindow.addEventListener("resize",i,!1),this._handleResize(),this.style.backgroundColor="black"}catch(j){this.logger.debug("attachedCallback throw an exception",j)}},b.HTMLVideoCanvas=function(){if(a.Context.isIE())return HTMLVideoElement;try{var b=window.teads.video.HTMLVideoCanvas;return new b,b}catch(d){return document.registerElement("video-canvas",{prototype:c.prototype})}}(),b.HTMLVideoCanvas.prototype.addEventListener=c.prototype.addEventListener}(b=a.video||(a.video={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){a.ASSETS={vpaidvideojs:"teads-vpaid-video.min.js",vpaidcanvas:"teads-vpaid-canvas.min.js",vpaidvideoswf:"teads-vpaid-video.swf",vastcorsloader:"cors.swf",vpaidswfwrapper:"vpaidwrapper.swf"}}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.canPlayType=function(a){try{return!!document.createElement("video").canPlayType(a).replace(/^no/,"")}catch(b){return!1}},a}();a.VideoHelper=b}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){!function(a){a[a.UNSUPPORTED=0]="UNSUPPORTED",a[a.FLASH=1]="FLASH",a[a.JS=2]="JS",a[a.VPAID=3]="VPAID",a[a.CANVAS=4]="CANVAS"}(a.MediaProvider||(a.MediaProvider={}));a.MediaProvider}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){!function(a){a[a.CANVAS=0]="CANVAS",a[a.HTML5=1]="HTML5",a[a.ANY=2]="ANY"}(a.PLAYER_TYPE||(a.PLAYER_TYPE={}));a.PLAYER_TYPE}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){b.trackingMapping={error:a.vpaid.VPAIDEvent.AdError,click:a.vpaid.VPAIDEvent.AdClickThru,pause:a.vpaid.VPAIDEvent.AdPaused,resume:a.vpaid.VPAIDEvent.AdPlaying,skip:a.vpaid.VPAIDEvent.AdSkipped,creativeView:a.vpaid.VPAIDEvent.AdStarted,start:a.vpaid.VPAIDEvent.AdVideoStart,firstQuartile:a.vpaid.VPAIDEvent.AdVideoFirstQuartile,midpoint:a.vpaid.VPAIDEvent.AdVideoMidpoint,thirdQuartile:a.vpaid.VPAIDEvent.AdVideoThirdQuartile,complete:a.vpaid.VPAIDEvent.AdVideoComplete,impression:a.vpaid.VPAIDEvent.AdImpression,close:a.vpaid.VPAIDEvent.AdUserClose,closeLinear:a.vpaid.VPAIDEvent.AdUserClose,progress:a.vpaid.VPAIDEvent.AdRemainingTimeChange}}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.whitelist=[/^((http|https)\:){0,1}\/\/cdn-tags\.brainient\.com\/.*/,/^((http|https)\:){0,1}\/\/.*\.brainient\.com\/vpaid\/\d+/,/^((http|https)\:){0,1}\/\/rawgit\.com\/ybootin\/.*/,/^((http|https)\:){0,1}\/\/[^\/]+\.teads\.(tv|net)+\/.*/,/^((http|https)\:){0,1}\/\/ad\.atdmt\.com\/as\/vpaid\.js;.*/,/^((http|https)\:){0,1}\/\/.*\.serving\-sys\.com\/.*\/.*VPAIDAPI\.js$/,/^((http|https)\:){0,1}\/\/(s\-){0,1}static\.innovid\.com\/mobileapps\/(s\/){0,1}js\/vpaid\/.*/,/^((http|https)\:){0,1}\/\/vpaid\.doubleverify\.com\/\-\/vpaid2\/[\d+\/]+\/main\-dv\.js/,/^((http|https)\:){0,1}\/\/.*\.moatads\.com\/[^\/]*\/moatwrapper\.js.*/,/^((http|https)\:){0,1}\/\/cdn\.adtags\.mobi\/shared\/js\/vpaid\.js/,/^((http|https)\:){0,1}\/\/.*\.adsafeprotected\.com\/IASVideo\.js\?.*/,/^((http|https)\:){0,1}\/\/imasdk\.googleapis\.com\/js\/sdkloader\/vpaid_adapter\.js/,/^((http|https)\:){0,1}\/\/b\.measuread\.com\/TL\.js.*/,/^((http|https)\:){0,1}\/\/.*\.videostat\.com\/script\/gppVpaidCallbackAd\.js.*/,/^((http|https)\:){0,1}\/\/.*\.tubemogul\.com\/js\/prod\/.*\.js.*/],b.whitelistIos10=[/^((http|https)\:){0,1}\/\/.*\.mxcdn\.net\/bb\-serve\/vpaid_js\/VPAID\-JS\.js/,/^((http|https)\:){0,1}\/\/.*\.yimg\.com\/ff\/vista\.js/],b.blacklist=[/^((http|https)\:){0,1}\/\/.*\.adnxs\.com\/.*/,/^((http|https)\:){0,1}\/\/securecdn\.videologygroup\.com\/.*/,/^((http|https)\:){0,1}\/\/vpaid\.pubmatic\.com\/.*/,/^((http|https)\:){0,1}\/\/aka\.spotxcdn\.com\/.*/,/^((http|https)\:){0,1}\/\/cdn\.optimatic\.com\/.*/,/^((http|https)\:){0,1}\/\/.*\.vidible\.tv\/.*/,/^((http|https)\:){0,1}\/\/.*\.tremorvideo\.com\/vpaid\-proxy\.min\.js.*/,/^((http|https)\:){0,1}\/\/.*\.stickyadstv\.com\/.*/,/^((http|https)\:){0,1}\/\/.*\.adap\.tv\/.*/,/^((http|https)\:){0,1}\/\/.*\.dashbida\.com\/.*/],b.isAuthorized=function(a){return b.isWhitelisted(a)&&!b.isBlacklisted(a)},b.isWhitelisted=function(c){return a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"10")?b.isIos10Whitelisted(c):b.isInList(b.whitelist,c)},b.isIos10Whitelisted=function(c){return a.Context.isWhiteListedIos10Safari()?b.isInList(b.whitelist.concat(b.whitelistIos10),c):b.isInList(b.whitelist,c)},b.isBlacklisted=function(a){return b.isInList(b.blacklist,a)},b.isInList=function(a,b){for(var c=0,d=a.length;c-1?c.weight+=e?this.weights.light:this.weights.extralight:a.Context.isMobile()||a.Context.isTablet()||!a.Utils.hasFlash()?c.weight=this.weights.zero:c.weight+=e?this.weights.extralight:this.weights.light),"video/mp4"===c.type?c.weight+=this.weights.heavy:"video/x-flv"!==c.type||a.Context.isMobile()||a.Context.isIpad()||!a.Utils.hasFlash()||(c.weight+=this.weights.extralight),"video/x-flv"!==c.type||a.Utils.hasFlash()||(c.weight=this.weights.zero),a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"8")&&"vpaid"===c.api&&c.type.indexOf("javascript")>-1?b.VPAIDJSListIOS.isAuthorized(c.url)?c.weight+=this.weights.light:(a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"10")&&b.playerSumologic.sendInfo("rejected-vpaid-ios "+c.url+"|"+c.adParameters,null,.01),c.weight=this.weights.zero):a.Context.isAndroid()&&d===b.PLAYER_TYPE.CANVAS&&"vpaid"===c.api&&c.type.indexOf("javascript")>-1&&b.VPAIDJSListAndroid.isAuthorized(c.url)?c.weight+=this.weights.light:(a.Context.isIphone()||a.Context.isIpad()||d===b.PLAYER_TYPE.CANVAS)&&(c.weight=this.weights.zero),"video/mp4"===c.type&&(a.Context.isWhiteListedIos10Safari()||d===b.PLAYER_TYPE.HTML5&&a.Context.isIos())&&(c.weight+=this.weights.infinite),"video/mpg"!==c.type&&"video/mpeg"!==c.type||(d===b.PLAYER_TYPE.CANVAS?c.weight+=this.weights.infinite:a.Context.isMobile()||a.Context.isIpad()?a.Context.isIphone()&&a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"8")?c.weight+=this.weights.heavy:a.Context.isAndroid()?a.Context.isAndroidMobile()&&a.Semver.isGreaterOrEqual(a.Context.getAndroidVersion(),"4.4.2")?c.weight+=this.weights.medium:c.weight+=this.weights.light:a.Context.isIpad()&&(c.weight+=this.weights.light):a.Context.isIE()||(c.weight+=this.weights.medium)),c&&0===c.url.indexOf("rtmp://")&&(c.weight=this.weights.zero),c},c.extractMediaFilesByBitrate=function(b,c){var d;return a.ArrayHelper.forEach(b,function(a,b){var e=Math.abs(a.bitrate-c);(!d||e=h?a.weight:h,!!a.weight}),d=a.ArrayHelper.filter(d,function(a){return a.weight===h}),d.length&&b.playerSumologic.sendInfo("media "+d[0].type),d.length>1&&d[1].type===d[0].type)c.sortByPing(d,f);else if(d.length>=1)f(d,null);else if((g===b.PLAYER_TYPE.CANVAS||a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"8"))&&i)c.ping(i.url,function(a,d){c.waitForProxy(i.url,d,function(c){i.url=c,i.type="video/tv",f(c?[i]:[],a),b.playerSumologic.sendInfo("media video/tv")})});else{f(d,null);var j="No Mediafile for this context";this.logger.info("getOptimalMediaFiles",j),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(2,2,j,a.Wigo.infoType.ERROR)}},c.sortByPing=function(a,b){c.ping(a[0].url,function(d,e){a=c.extractMediaFilesByBitrate(a,e),b(a,d)})},c.ping=function(c,d){var e,f,g,h=a.Request.createXmlHttpRequest(),i=Date.now(),j=function(a){e||(clearTimeout(g),e=Date.now()-i,f=e<=100?1e3:e<200?700:e<400?500:300,d(e,f),b.playerSumologic.sendInfo("ping "+[e,a].join(";")))};g=setTimeout(function(){return j("timeout")},500),h.open("HEAD",c+(c.indexOf("?")>-1?"&":"?")+i,!0),h.addEventListener("load",function(){return j("load")}),h.addEventListener("error",function(){return j("error")}),h.send()},c.waitForProxy=function(d,e,f){var g,h=this,i=location.hostname.match(/.+\.sandbox\.teads\.net|localdocker/),j=a.Utils.getProtocol()+"//[HOST]/transcode?url=[URL]&bitrate=[BITRATE]".replace(/\[HOST\]/,i?i[0]+":18088":"mp.teads.tv").replace(/\[URL\]/,encodeURIComponent(d)).replace(/\[BITRATE\]/,e.toString()),k=a.Request.createXmlHttpRequest(),l=!1;k.open("GET",j,!0),k.onreadystatechange=function(){var i;if(4===k.readyState&&!l){switch(k.status){case 200:f(k.responseText),l=!0;break;case 202:var j=parseInt(k.getResponseHeader("ETA"),10);g=j?1e3*j:1e4,setTimeout(function(){return c.waitForProxy(d,e,f)},g),i="Mediaproxy - encoding ongoing - need wait";break;case 416:c.waitForProxy(d,e,f);break;case 201:i="Mediaproxy - encoding init - need one more call to encode",f(null),l=!0;break;case 410:i="Mediaproxy - encoding failed",f(null),l=!0;break;case 400:i="Mediaproxy - bad request",f(null),l=!0;break;default:i="Mediaproxy - other error - "+k.status,f(null),l=!0}h.logger.debug("proxy resp",k.status),b.playerSumologic.sendInfo(["proxy","resp",k.status].join(" "),null,1)}i&&(h.logger.info("waitForProxy",i),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(2,2,i,a.Wigo.infoType.ERROR))},k.send(),b.playerSumologic.sendInfo("proxy call",null,1)},c.getOptimalMediaFile=function(a,b,d,e){c.getOptimalMediaFiles(a,b,function(a,b){d(a.length?a[0]:null),c.sendMediasToWigo(a,b)},e)},c.getOptimalHeight=function(a,b,c){if(!b)return 0;var d=!this.isInternalMediafile(a.url);return!a.height||!a.width||!c&&d&&a.api&&"vpaid"===a.api.toLowerCase()&&a.width>a.height?Math.ceil(b/16*9):Math.ceil(a.height*(b/a.width))},c.getAssetFromMediaProvider=function(a){var c;switch(a){case b.MediaProvider.JS:c=b.ASSETS.vpaidvideojs;break;case b.MediaProvider.FLASH:c=b.ASSETS.vpaidvideoswf;break;case b.MediaProvider.CANVAS:c=b.ASSETS.vpaidcanvas;break;default:c=""}return c},c.getEncodingCandidate=function(a){var b;return a.forEach(function(a){var c=a.type||"";switch(a.weight=0,c.split("/").pop()){case"mov":a.weight=150;break;case"mp4":a.weight=100;break;case"flv":case"x-flv":a.weight=75;break;case"webm":case"ogg":case"ogv":a.weight=50}(!b||b.weight<=a.weight)&&(b=b||a,(b.weight "))}catch(h){this.logger.error("sendMediasToSumologic error",h)}},c.sendMediasToWigo=function(b,c){if(a.WIGOI&&b.length&&a.WIGOI.valid){var d=b[0].url+(c?" -> ping: "+c+"ms":"");this.logger.info("getOptimalMediaFile",d),a.WIGOI.valid(2,2,d,a.Wigo.infoType.STRING)}},c.logger=new a.Logger("player.MediaFileHelper"),c.weights={infinite:2e3,heavy:100,medium:75,light:50,extralight:10,zero:0},c}();b.MediaFileHelper=c}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(){function c(b,c,d,e,f,g){this.container=b,this.config=c,this.vpaidAd=d,this.mediaFile=e,this.linearAd=f,this.logger=new a.Logger("player.plugin.Responsive")}return c.prototype.init=function(){this.logger.debug("init plugin"),this.vpaidAd.subscribe(this.onVideoMetadata,a.vpaid.CustomVPAIDEvent.AdVideoMetadata,this),this.vpaidAd.subscribe(this.onVpaidStart,a.vpaid.VPAIDEvent.AdStarted,this)},c.prototype.deinit=function(){this.logger.debug("deinit plugin"),this.vpaidAd.unsubscribe(this.onVpaidStart,a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.unsubscribe(this.onVideoMetadata,a.vpaid.CustomVPAIDEvent.AdVideoMetadata),this.unsetResponsive()},c.prototype.resize=function(c){if(!a.HTMLHelper.isFullscreen())try{var d=a.Dom.getBoundingClientRect(this.container).width;if(d!==this.vpaidAd.getAdWidth()||c){var e=b.MediaFileHelper.getOptimalHeight(this.mediaFile,d,!!this.metadata||!!this.teadsStudio),f=this.vpaidAd.getAdWidth(),g=this.vpaidAd.getAdHeight();f===d&&g===e||(this.vpaidAd.resizeAd(d,e,"normal"),this.logger.debug("container width change, resize from "+f+"x"+g+" to "+d+"x"+e))}}catch(h){this.logger.error("resize throw an Exception",h),this.unsetResponsive()}},c.prototype.setResponsive=function(){var b=this;return!this.iframe&&(this.vpaidAd.subscribe(function(){b.unsetResponsive()},a.vpaid.VPAIDEvent.AdError),this.vpaidAd.subscribe(function(){b.unsetResponsive()},a.vpaid.VPAIDEvent.AdStopped),this.resize(),this.iframe=document.createElement("iframe"),this.iframe.style.height="0",this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.margin="0",this.iframe.style.padding="0",this.container.appendChild(this.iframe),this.iframe.contentWindow.document.write(""),this.iframe.contentWindow.document.close(),this.resizeCallback=function(){return b.resize()},a.Dom.addEventListener("resize",this.iframe.contentWindow,this.resizeCallback),!0)},c.prototype.unsetResponsive=function(){try{return!!this.iframe&&(a.Dom.removeEventListener("resize",this.iframe.contentWindow,this.resizeCallback),this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,!0)}catch(b){return!1}},c.prototype.onVideoMetadata=function(a){this.logger.debug("Receive metadata from video",a),a.width&&a.height&&(this.metadata=a,this.mediaFile.width=a.width,this.mediaFile.height=a.height,Math.ceil(this.vpaidAd.getAdWidth()/this.vpaidAd.getAdHeight())!==Math.ceil(a.width/a.height)&&(this.logger.debug("vpaid ratio differ from mediafile ratio, force resize !"),this.resize(!0)))},c.prototype.onVpaidStart=function(){if(!this.config.width)try{this.logger.debug("set player responsive !"),this.teadsStudio=b.TeadsStudioExtension.get(this.linearAd),this.logger.debug("teadsStudio",this.teadsStudio),this.setResponsive()}catch(a){this.logger.error("Exception raised while trying to initialize",a)}},c}();c.Responsive=d}(c=b.plugin||(b.plugin={}))}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(b){var c=function(){function b(a,b,c,d,e,f){this.vpaidAd=c,this.linearAd=e}return b.prototype.init=function(){this.vpaidAd.subscribe(this.onClickThrough,a.vpaid.VPAIDEvent.AdClickThru,this)},b.prototype.deinit=function(){this.vpaidAd.unsubscribe(this.onClickThrough,a.vpaid.VPAIDEvent.AdClickThru)},b.prototype.onClickThrough=function(a,b,c){var d=a||this.linearAd.clickThrough[0];c&&d&&window.open(d)},b}();b.ClickThrough=c}(c=b.plugin||(b.plugin={}))}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b,c){var d=this;this.linearAd=b,this.config=c,this.logger=new a.Logger("VASTEventTracker"),this.tracker=new a.tracker.Tracker(null,c.sumologicSessionId,!!c.useMultipleBillable);for(var e in this.linearAd.tracking)a.ArrayHelper.forEach(this.linearAd.tracking[e]||[],function(a,b,c){d.tracker.addResource(e,a.url,a.data)})}return c.getTrackingMacros=function(b,c,d){var e={};return e[a.vast.TrackingMacro.CONTENTPLAYHEAD]=b>=0?a.Utils.offset(b):"0",e[a.vast.TrackingMacro.CACHEBUSTING]=a.StringHelper.rand(8),e[a.vast.TrackingMacro.ERRORCODE]=String(c)||"",e[a.vast.TrackingMacro.ASSETURI]=d||"",e},c.getMainDomain=function(b){var c=["uk"],d=b.split("."),e=d.length>1?d[d.length-2]:b;return a.ArrayHelper.indexOf(c,d[d.length-1])>-1&&(e=d[d.length-3]),e},c.getExtensionFromMimeType=function(a){var b=a.split("/")[1]||a;switch(b){case"javascript":case"x-javascript":b="js";break;case"x-shockwave-flash":b="swf";break;case"mpeg":b="mpg";break;case"x-flv":b="flv"}return b},c.prototype.getTracker=function(){return this.tracker},c.prototype.track=function(d,e,f,g,h){var i=c.getTrackingMacros(f,h?h.getId():null,e?e.url.toString():null);if(this.tracker.track(d,i,f,g),"error"===d)try{var j=a.URIHelper.parse(this.linearAd.url),k=0===j.protocol.indexOf("https:")?1:0,l="-",m="-",n="-",o="teads";this.linearAd.wrappers.length>0?o=c.getMainDomain(a.URIHelper.parse(this.linearAd.wrappers[this.linearAd.wrappers.length-1]).hostname):this.linearAd.url&&(o=c.getMainDomain(j.hostname));var p=this.linearAd.wrappers.length,q=this.linearAd.wrappers.filter(function(a,b){return b-1&&i.vpaidAd.subscribe(function(d){c===a.vpaid.VPAIDEvent.AdError&&d||(d=""),b.playerSumologic.sendInfo([c,a.Context.getContextSummary(),d].join("|"))},c),k.indexOf(c)===-1&&i.vpaidAd.subscribe(function(a){void 0===a&&(a=""),i.logger.info(c+" "+a)},c)})}return c.prototype.init=function(){var c=this;this.logger.debug("init");try{var d,e,f={},g=[],h=[a.vast.TrackingEvent.skip,a.vast.TrackingEvent.creativeView,a.vast.TrackingEvent.start,a.vast.TrackingEvent.impression,a.vast.TrackingEvent.firstQuartile,a.vast.TrackingEvent.midpoint,a.vast.TrackingEvent.thirdQuartile,a.vast.TrackingEvent.complete,a.vast.TrackingEvent.error],i=function(){d=c.vpaidAd.getAdDuration(),e=c.vpaidAd.getAdRemainingTime()};i(),this.vpaidAd.subscribe(i,a.vpaid.VPAIDEvent.AdDurationChange),this.vpaidAd.subscribe(i,a.vpaid.VPAIDEvent.AdRemainingTimeChange);var j=function(b,i,k,l){void 0===i&&(i=null);try{k=k&&!isNaN(k)?k:d-e||0}catch(m){k=0}var n=Math.floor(k);if(b!==a.vast.TrackingEvent.progress||!g[n]){var o;switch(i){case a.vpaid.VPAIDEvent.AdError:var p=function(b){for(var c in a.VastException)if(a.VastException[c].id===b)return a.VastException[c].message},q=l&&l[1]&&"number"==typeof l[1]&&!isNaN(l[1])?l[1]:a.VastException.GENERAL.id,r=l[0];o=a.Exception.get(q,"AdError : "+(r||p(q)))}switch(b){case a.vast.TrackingEvent.start:f[a.vast.TrackingEvent.impression]||j(a.vast.TrackingEvent.impression);break;case a.vast.TrackingEvent.complete:j(a.vast.TrackingEvent.progress,a.vpaid.VPAIDEvent.AdRemainingTimeChange,Math.ceil(k)+1);case a.vast.TrackingEvent.firstQuartile:case a.vast.TrackingEvent.midpoint:case a.vast.TrackingEvent.thirdQuartile:f[a.vast.TrackingEvent.start]||j(a.vast.TrackingEvent.start);break;case a.vast.TrackingEvent.progress:g[n]=!0;var s=n-1;s>0&&!g[s]&&(c.logger.debug("track missing previous progress "+s),j(b,i,s));break;case a.vast.TrackingEvent.mute:if(!f[a.vast.TrackingEvent.impression])return}a.ArrayHelper.indexOf(h,b)>-1&&f[b]||(c.tracker.track(b,c.mediaFile,k,d,o),f[b]=!0)}},k=function(a){c.vpaidAd.subscribe(function(){for(var c=[],d=0;d0?j(a.vast.TrackingEvent.unmute,a.vpaid.VPAIDEvent.AdVolumeChange):m||0!==c.vpaidAd.getAdVolume()||j(a.vast.TrackingEvent.mute,a.vpaid.VPAIDEvent.AdVolumeChange),m=!c.vpaidAd.getAdVolume()},o=function(){m=!c.vpaidAd.getAdVolume()};this.vpaidAd.subscribe(o,a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.subscribe(n,a.vpaid.VPAIDEvent.AdVolumeChange);var p;this.vpaidAd.subscribe(function(){var b=a.HTMLHelper.isFullscreen()||c.vpaidAd.getAdExpanded();!p&&b?(j(a.vast.TrackingEvent.fullscreen),j(a.vast.TrackingEvent.expand)):p&&!b&&(j(a.vast.TrackingEvent.exitFullscreen),j(a.vast.TrackingEvent.collapse)),p=b},a.vpaid.VPAIDEvent.AdExpandedChange)}catch(q){this.tracker.track("error",this.mediaFile,null,null,new a.VastException({id:900,message:"plugin.Tracker throw an exception on init "+q}))}},c.prototype.deinit=function(){this.logger.debug("deinit")},c.prototype.getTracker=function(){return this.tracker.getTracker()},c.prototype.removeResources=function(a){try{this.getTracker().getTracking(a).removeResources()}catch(b){this.logger.error("Remove tracking resources for event "+a+" throw an exception",b)}},c}();c.Tracker=d}(c=b.plugin||(b.plugin={}))}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(){function c(b,c,d,e,f,g){var h=this;this.container=b,this.config=c,this.vpaidAd=d,this.mediaFile=e,this.bufferingTimer=null,this.bufferingDone=!1,this.elapseTime=0,this.logger=new a.Logger("player.plugin.Bench");try{var i=a.HTMLHelper.getWindow(this.container),j=function(){h.elapseTime>1e3&&0===h.getCurrentTime()&&(h.clearBufferingTimer(!0),h.visibility.destroy())};this.visibility=a.Visibility.listenWindow(i,j,function(){})}catch(k){this.logger.error("Error with visibility init",k)}this.vpaidAd.subscribe(function(){h.getBuffering()},a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.subscribe(function(){h.clearBufferingTimer()},a.vpaid.VPAIDEvent.AdPaused),this.vpaidAd.subscribe(function(){h.getBuffering()},a.vpaid.VPAIDEvent.AdPlaying)}return c.prototype.init=function(){},c.prototype.deinit=function(){},c.prototype.getBuffering=function(c){var d=this;void 0===c&&(c=500),this.bufferingDone||(this.bufferingTimer=setTimeout(function(){try{d.elapseTime=c;var e=d.getCurrentTime();if(e>0){var f=c-1e3*e>0?c-1e3*e:0;"number"==typeof f&&f>=0&&(d.logger.debug("Buffering: "+f+"ms"),b.playerSumologic.sendInfo("Buffering: "+f+"ms with "+d.mediaFile.type+" on "+a.Context.getContextSummary())),d.bufferingDone=!0,d.visibility.destroy()}else d.getBuffering(c+=500)}catch(g){d.logger.error("Error with buffering method",g)}},500))},c.prototype.clearBufferingTimer=function(a){void 0===a&&(a=!1);try{this.bufferingTimer&&(clearTimeout(this.bufferingTimer),this.bufferingTimer=null,a&&(this.logger.warn("Stop buffering calculation"),this.bufferingDone=!0))}catch(b){this.logger.error("An error occured while cleaning the buffering timer",b)}},c.prototype.getCurrentTime=function(){return this.vpaidAd.getAdDuration()-this.vpaidAd.getAdRemainingTime()?this.vpaidAd.getAdDuration()-this.vpaidAd.getAdRemainingTime():0},c}();c.Bench=d}(c=b.plugin||(b.plugin={}))}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.get=function(c){var d,e=this;return c&&c.extensions&&c.extensions.length>0&&a.ArrayHelper.forEach(c.extensions,function(a){a.type===e.EXTENSION_TYPE&&(d=b.parse(a.content))}),d},b.parse=function(b){try{return a.JSON.parse(b)}catch(c){new a.Logger("TeadsStudioExtension").error(this.EXTENSION_TYPE+" extension throw an exception",c)}},b.EXTENSION_TYPE="teads-studio",b}();b.TeadsStudioExtension=c}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c;!function(c){var d=function(){function c(b,c,d,e,f,g){this.container=b,this.config=c,this.vpaidAd=d,this.mediaFile=e,this.linearAd=f,this.logger=new a.Logger("player.plugin.Extensions")}return c.prototype.init=function(){var c=this;a.ArrayHelper.forEach(this.linearAd.extensions,function(a){switch(a.type){case b.TeadsStudioExtension.EXTENSION_TYPE:var d=b.TeadsStudioExtension.parse(a.content);d&&d.width&&d.height&&(c.mediaFile.width=d.width,c.mediaFile.height=d.height);break;case"MoatJs":c.initMoatTracking(a);break;case"Visibility":case"Html":case"Iframe":c.injectIframe(a.content);break;case"Alenty":case"Script":c.injectJs(a.content)}})},c.prototype.deinit=function(){},c.prototype.initMoatTracking=function(b){var d=this,e=this.vpaidAd.getAdDuration();e<=0&&(e=this.linearAd.duration),this.externalAdVolume=this.vpaidAd.getAdVolume();var f,g=a.JSON.parse(b.content),h=a.HTMLHelper.findParentWindows(this.container),i=h.pop()||window,j=this.config.formatConfig.threshold.value,k=[],l=this;a.Context.isDesktop()?f="desktop":a.Context.isTablet()?f="tablet":a.Context.isMobile()&&(f="mobile");var m={adData:{ids:g,duration:e,url:this.mediaFile.url},dispatchEvent:function(d){try{var h=l.vpaidAd.getAdDuration()-l.vpaidAd.getAdRemainingTime()>0?l.vpaidAd.getAdDuration()-l.vpaidAd.getAdRemainingTime():0,m=g.level3.match(/(\d+)/)?g.level3.match(/(\d+)/)[1]:g.level3,n=a.HTMLHelper.percentageInView(l.container,i),o="nowrapp";b.definition.id!==l.linearAd.id&&(o=b.definition.adSystem&&b.definition.adSystem.match(/teads/i)?"wrappteads":"wrappnotteads");var p=["[MOAT] "+m,g.slicer2,d.type||d,l.vpaidAd.getAdVolume(),e+"s",n===-1?"Error":Math.floor(100*n)+"%",f,h.toFixed?h.toFixed(3):h,a.HTMLHelper.isInView(l.container,i,j/100),j,i.location.hostname];a.player.playerSumologic.sendInfo(p.join(" - "),null,c.MOAT_TEST_INSERTIONID.test(m)?1:.01)}catch(q){var m;g&&g.level3&&(m=g.level3.match(/(\d+)/)?g.level3.match(/(\d+)/)[1]:g.level3),a.player.playerSumologic.sendInfo("[MOAT error] "+q,null,c.MOAT_TEST_INSERTIONID.test(m)?1:.01)}if(this.sendEvent){var r=d;k&&(k.push(d),r=k,k=null),this.sendEvent(r)}else k.push(d)}};this.logger.debug("intialized MOAT with",m.adData);var n=["AdStopped","AdVideoStart","AdVideoFirstQuartile","AdVideoMidpoint","AdVideoThirdQuartile","AdVideoComplete","AdPaused","AdPlaying"];a.ArrayHelper.forEach(n,function(a){d.vpaidAd.subscribe(function(){var b={type:a,adVolume:d.externalAdVolume};d.logger.debug("sending MOAT event",b),m.dispatchEvent(b)},a)}),this.vpaidAd.subscribe(function(){if(d.externalAdVolume!==d.vpaidAd.getAdVolume()){var a={type:"AdVolumeChanged",adVolume:d.vpaidAd.getAdVolume()};d.logger.debug("sending MOAT event",a),m.dispatchEvent(a),d.externalAdVolume=d.vpaidAd.getAdVolume()}},"AdVolumeChange");var o="_moatApi"+a.StringHelper.rand(8);window[o]=m;var p=document.createElement("script"),q=window.location.protocol,r="https:"===q?"z":"js";p.src=q+"//"+r+".moatads.com/"+c.MOAT_PARTNER_CODE+"/moatvideo.js#"+o,this.container.insertBefore(p,this.container.childNodes[0])},c.prototype.injectJs=function(a){var b=document.createElement("script");b.async=!0,b.src=a,document.body.appendChild(b)},c.prototype.injectIframe=function(a){var b=document.createElement("iframe");b.style.width="10px",b.style.height="10px",b.style.position="absolute",b.style.left="-999em",b.style.top="0",document.body.appendChild(b);var c=b.contentWindow.document;c.open(),c.write(a.indexOf(""+a+"":a),c.close()},c.MOAT_PARTNER_CODE="teads245638586802",c.MOAT_TEST_INSERTIONID=/^103055$/,c}();c.Extensions=d}(c=b.plugin||(b.plugin={}))}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){b.playerSumologic=new a.Sumologic;var c=function(){function c(c,d){this.container=c,this.config=d,this.logger=new a.Logger("player.VASTPlayer"),this.plugins={},this.logger.info("new VASTPlayer",this.container,this.config),this.vastLib=new a.vast.VASTLib({assetsUrl:this.config.path}),b.playerSumologic.init(a.Sumologic.CONFIGS.PLAYER,this.config.sumologicSessionId),b.playerSumologic.sendMetadata("2.4.19;"+a.Context.getContextSummary()),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(2,0)}return c.prototype.loadVast=function(a,b,c){this.vastLib.load(a,this.getOnVastLoadedCallback(b),this.getOnVastErrorCallback(c))},c.prototype.parseVast=function(a,b,c){this.vastLib.parse(a,this.getOnVastLoadedCallback(b),this.getOnVastErrorCallback(c))},c.prototype.setLinearAd=function(c){this.linearAd=c,this.vastTracker=new b.VASTEventTracker(c,this.config),this.logger.info("setLinearAd",c),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(2,1,c,a.Wigo.infoType.MODAL)},c.prototype.getLinearAd=function(){return this.linearAd},c.prototype.getMediafile=function(){return this.mediafile},c.prototype.getConfig=function(){return this.config},c.prototype.setConfigUI=function(a){this.config.ui=a},c.prototype.getOptimalMediaFile=function(c,d,e){var f=this;return void 0===e&&(e={}),b.MediaFileHelper.getOptimalMediaFile(this.linearAd.mediaFiles,e,function(e){if(e)c(e);else{var g=a.Exception.get(a.VastException.UNSUPPORTED_MEDIAFILE.id,"VASTPlayer.getOptimalMediaFile didn't find mediafile");f.onVastError(d,g,f.linearAd)}b.MediaFileHelper.sendMediasToSumologic(f.linearAd,e?1:0)},this.config.type)},c.prototype.playOptimalMediaFile=function(a,b,c){var d=this;this.getOptimalMediaFile(function(a){d.playMediaFile(a,b,c)},c,a)},c.prototype.loadOptimalMediaFile=function(a,b){var c=this;this.getOptimalMediaFile(function(d){c.loadMediaFile(d,a,b)},b)},c.prototype.playMediaFile=function(b,c,d){if(!b){var e=a.Exception.get(a.VastException.UNSUPPORTED_MEDIAFILE.id,"no mediafile provided in VASTPlayer.playMediaFile");return this.onVastError(d,e,this.linearAd)}var f=function(b,d){c(b,d),b.subscribe(function(){b.startAd()},a.vpaid.VPAIDEvent.AdLoaded),b.initAd(d.width,d.height,d.mode,d.bitrate,d.parameters)};this.loadMediaFile(b,f,d)},c.prototype.loadMediaFile=function(d,e,f){var g=this,h=function(a){g.onVastError(f,a,g.linearAd)};if(!d)return h(a.Exception.get(a.VastException.UNSUPPORTED_MEDIAFILE.id,"no mediafile provided in VASTPlayer.loadMediaFile"));this.mediafile=d;var i=b.MediaFileHelper.getMediaProvider(d),j=d.url,k=this.config.width?this.config.width:this.container.offsetWidth,l={width:k,height:this.config.height?this.config.height:b.MediaFileHelper.getOptimalHeight(d,k),mode:"normal",bitrate:d.bitrate||512,parameters:this.linearAd.adParameters},m=this.linearAd.clickThrough.length?this.linearAd.clickThrough[0]:null,n=function(b){h(a.Exception.get(a.VastException.UNSUPPORTED_MEDIAFILE.id,b))},o=this.config.useCustomVideo||!1,p=!1;switch(i){case b.MediaProvider.VPAID:a.Context.isIos()&&!a.Context.isWhiteListedIos10Safari()&&"vpaid"===d.api&&d.type.indexOf("javascript")>-1?o=!0:a.Context.isAndroid()&&this.config.type===b.PLAYER_TYPE.CANVAS&&(o=!0);break;case b.MediaProvider.FLASH:case b.MediaProvider.JS:case b.MediaProvider.CANVAS:j=this.config.path+"/"+b.MediaFileHelper.getAssetFromMediaProvider(i),i===b.MediaProvider.JS?j=a.vpaid.BundledContainer.VIDEO:i===b.MediaProvider.CANVAS&&(j=a.vpaid.BundledContainer.CANVAS);var q=this.config.path.match("/dist")||0===this.config.path.indexOf("http")?this.config.path.match("/dist")&&0!==this.config.path.indexOf("http")?window.location.protocol+window.location.host+this.config.path:this.config.path:window.location.protocol+this.config.path;p=function(){try{return!g.config.ui.config.components.endscreen.disable}catch(a){return!1}}(),l.parameters={url:d.url,debug:this.config.debug,clickThrough:m,skippable:this.linearAd.skippable,skipoffset:this.linearAd.skipDelay,assetsPath:q,type:b.PLAYER_TYPE[this.config.type],sumologicSessionId:this.config.sumologicSessionId,noAutoStop:p,timeout:c.MEDIAFILE_TIMEOUT_DELAY},i===b.MediaProvider.FLASH?l.parameters=a.JSON.stringify(l.parameters):l.parameters={AdParameters:a.JSON.stringify(l.parameters)},a.vpaid.Timeout.initAd=c.MEDIAFILE_TIMEOUT_DELAY+2e3;break;case b.MediaProvider.UNSUPPORTED:default:return n("media not supported "+d.type)}if(i===b.MediaProvider.FLASH&&!a.Utils.hasFlash()||i===b.MediaProvider.VPAID&&!a.Utils.hasFlash()&&d.url.indexOf(".swf")>-1)return n("Flash plugin is required");var r={path:this.config.path,useCustomVideo:o,api:this.config.vpaidApi};a.vpaid.Timeout.loadVpaid=c.MEDIAFILE_TIMEOUT_DELAY,this.config.background&&(r.background=this.config.background);var s=this.container;if(this.config.ui){var t;if(this.config.ui.template)t=this.config.ui.template;else{if(!a.ui.template[this.config.ui.name]){var u=a.Exception.get(a.VastException.UNDEFINED.id,"VASTPlayer: cannot find template for VPAID-UI");return h(u)}t=a.ui.TemplateHelper.replacePlaceholders(a.ui.template[this.config.ui.name],{assetsPath:this.config.path+"/assets"})}this.config.ui.config=this.config.ui.config||{},this.config.ui.config.clickthrough=m,this.config.ui.config.noAutoStop=p,this.ui&&this.ui.getContainer()&&(this.config.ui.config.container=this.ui.getContainer()),this.ui=new a.ui.VPAIDUI(this.container,t,this.config.ui.config),s=this.ui.getVPAIDContainer()}var v=new a.vpaid.VPAIDLoader(s,r),w=function(c){g.config.ui?(g.ui.setVPAID(c),g.vpaidAd=g.ui):g.vpaidAd=c;for(var f in b.plugin)try{var j=b.plugin[f];g.plugins[f]&&g.plugins[f].deinit(),g.plugins[f]=new j(g.container,g.config,g.vpaidAd,d,g.linearAd,g.vastTracker),g.plugins[f].init()}catch(k){g.logger.error("Could not initialize plugin "+f,k)}try{e(g.vpaidAd,l)}catch(m){var n=a.Exception.get(a.VastException.UNDEFINED.id,"loadMediaFile success callback failled "+m,m);h(n)}g.logger.info("loadMediaFile",b.MediaProvider[i]),a.WIGOI&&a.WIGOI.valid(2,3,b.MediaProvider[i],a.Wigo.infoType.STRING)};v.load(j,w,function(b){var c=a.VastException.UNDEFINED.id;switch(b.id){case a.vpaid.ErrorCode.GETVPAIDAD_EXCEPTION.id:case a.vpaid.ErrorCode.FLASH_SECURITY_ERROR.id:case a.vpaid.ErrorCode.FLASH_UNKNOWN_ERROR.id: case a.vpaid.ErrorCode.FLASH_INIT_ERROR.id:c=a.VastException.GENERAL.id;break;case a.vpaid.ErrorCode.LOAD_VPAID_FILE_NOT_FOUND.id:case a.vpaid.ErrorCode.FLASH_IO_ERROR.id:c=a.VastException.FILE_NOT_FOUND.id;break;case a.vpaid.ErrorCode.LOAD_VPAID_TIMEOUT.id:c=a.VastException.MEDIAFILE_TIMEOUT.id;break;case a.vpaid.ErrorCode.FLASH_PLUGIN_MISSING.id:c=a.VastException.UNSUPPORTED_MEDIAFILE.id}var d=b.message||"vpaidloader error";h(a.Exception.get(c,d))})},c.prototype.getPlugin=function(a){return this.plugins[a]},c.prototype.getPlugins=function(){return this.plugins},c.prototype.getOnVastLoadedCallback=function(a){var b=this;return function(c){b.setLinearAd(c),a(b.linearAd)}},c.prototype.getOnVastErrorCallback=function(a){var b=this;return function(c,d){b.setLinearAd(d),b.onVastError(a,c,d)}},c.prototype.onVastError=function(a,b,c){this.vastTracker.track("error",this.mediafile,null,null,b),a(b,c)},c.MEDIAFILE_TIMEOUT_DELAY=15e3,c}();b.VASTPlayer=c}(b=a.player||(a.player={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function a(a){this.lang=a,this.translations={ar:{label:"إعلان"},cs:{label:"REKLAMA"},de:{label:"WERBUNG"},da:{label:"ANNONCE"},en:{label:"ADVERTISING"},es:{label:"PUBLICIDAD"},fr:{label:"PUBLICITÉ"},fi:{label:"MAINONTA"},hr:{label:"OGLAŠAVANJE"},hu:{label:"HIRDETÉS"},id:{label:"ADVERTISING"},it:{label:"PUBBLICITÀ"},ja:{label:"広告"},jamobile:{label:"タップして音声が流れます"},jamobilePR:{label:"[PR]タップして音が流れます"},ko:{label:"광고"},kr:{label:"광고"},mo:{label:"ADVERTISING"},nl:{label:"ADVERTENTIE"},no:{label:"ANNONSERING"},pl:{label:"REKLAMA"},pt:{label:"PUBLICIDADE"},ro:{label:"PUBLICITATE"},ru:{label:"РЕКЛАМА"},sr:{label:"ОГЛАШАВАЊЕ"},sk:{label:"REKLAMA"},sl:{label:"OGLAŠAVANJE"},sw:{label:"REKLAM"},tr:{label:"ILAN"},zh:{label:"广告"},"zh-hk":{label:"廣告"},"zh-tw":{label:"廣告"}}}return a.prototype.translate=function(a){return(this.translations[this.lang]||{})[a]},a}();a.L10n=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.init=function(){try{this.performance=window.top.performance||window.top.webkitPerformance||window.top.msPerformance||window.top.mozPerformance}catch(a){}},b.mark=function(a){return this.performance&&a&&"string"==typeof a?void(b.performance&&b.performance.mark&&b.performance.mark(a)):null},b.measure=function(a,c,d){if(!(this.performance&&a&&"string"==typeof a&&c&&"string"==typeof c&&d&&"string"==typeof d))return null;try{if(b.performance&&b.performance.measure)return b.performance.measure(a,c,d),b.performance.getEntriesByName(a)}catch(e){return b.logger.warn(e),null}},b.getLastEntryByName=function(a){try{if(!this.performance||b.performance&&b.performance.getEntriesByName){var c=b.performance.getEntriesByName(a);return c[c.length-1]}}catch(d){return b.logger.warn(d),null}},b.getTimingByRegex=function(a){var c=[];if(!this.performance||b.performance&&b.performance.getEntries){var d=b.performance.getEntriesByType("resource");for(var e in d)d.hasOwnProperty(e)&&a.test(d[e].name)&&c.push(d[e])}return c},b.getResourceCount=function(){if(!this.performance||b.performance&&b.performance.getEntries)return b.performance.getEntries().length},b.logger=new a.Logger("helper.Timing"),b}();a.Timing=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.SLIDER_WHITELIST=window.SLIDER_WHITELIST||/^(25030|27511|27935|28418|29824|30767|35627|35655|35781|35782|35878|35883|35892|36168|36851|36886|36909|37252|37270|37431|37432|37440|37450|37513|37648|37652|37655|37656|37664|37666|37676|37678|37703|37704|37790|37791|37803|37811|37812|37814|37921|37925|37926|37928|37932|37955|37958|37959|37967|38033|38037|38038|38039|38043|38044|38049|38050|38051|38052|38053|38054|38055|38056|38057|38059|38219|38221|38297|38299|38309|38310|38328|38329|38331|38343|38424|38686|38908|38983|38984|39456|39457|39955|40236|40237|40239|40249|40250|40427|41206|41207|41259|41391|41660|42628|42712|42811|42812|43215|43260|43323|43678|43701|43702|44019|44020|44031|44223|44328|44329|44330|44333|44334|44495|44496|45036|45037|45040|45041|45058|45119|45125|45572|45573|45575|45681|45872|46011|46012|46053|46056|46058|46066|46274|46374|46407|46426|46435|46514|46819|47135|47136|47160|47161|47165|47443|47534|47535|47575|47576|47577|47578|47579|47580|47587|47588|47589|47590|47591|47592|47593|47594|47595|47596|47597|47598|47600|47924|47925|47926|47930|47931|47932|47956|48034|48408|48409|48431|48820|48822|48824|48826|48830|48967|49069|49677|49678|50244|50245|50487|50797|50800|51583|51805|51936|52085|52186|52288|52289|52290|52432|52433|52437|52866|52867|52894|52897|53252|53325|53359|53376|53397|53892|53948|54108|54125|54561|55060|55061|55062|55097|55160|55229|55231|55233|55235|55746|55819|55973|55975|55992|56493|56664|56665|58062|59565|60075|60294|60298|60612|61013|61018|61180|61334|61335|61409|61502|61503|61522|61524|61525|61561|61570|61761|61762|61797|62102|62143|62242|62245|62267|62341|62385|62391|62461|62586|62587|62619|62622|62650|62730|62749|62909|62910|62948|62963|63068|63069|63080|63081|63083|63093|63201|63203|63204|63205|63206|63207|63208|63209|63210|63280|63289|63572|63574|63757|63784|63786|63788|63790|63792|63794|63796|63798|63800|63802|63804|63859|64010|64018|64224|64339|64399|64469|64481|64482|64534|64650|64836|64837|64999|65000|65034|65043|65046|65257|65464|65599|65765|65840|65853|65865|65978|65988|66226|66337|66338|66339|66371|66537|66538|66706|67325|67335|67713)$/,b.FORCE_EXPAND_ANIMATION_LIST=/^(19503|19593|19742|20405|20406|20993|21076|21077|21918|22041|22268|22313|22560|23278|23388|23861|23862|24283|24642|24666|24857|24858|24991|24992|24993|24997|24998|24999|25000|25001|25058|25088|25129|25897|26007|26071|26072|26073|26074|26075|26076|26077|26078|26079|26248|26318|26403|26512|26547|26631|26632|26942|27348|27593|27696|28019|28222|28320|28321|28361|28419|28588|28589|28626|28627|28647|28687|28854|29017|29018|29019|29020|29399|29401|29402|29404|29715|29757|29758|29929|29930|29931|30964|30967|31752|31753|31760|31761|31762|31777|31778|31779|32105|32106|32107|32281|32282|32283|32284|32329|32330|32557|32601|32674|32675|32676|32677|33032|33033|33110|33366|33508|33521|33522|33523|33524|33525|33526|33538|33703|33704|33705|33706|33707|33708|33870|33896|33897|33898|33899|34364|34441|34574|34575|34709|34710|34711|34712|34713|34714|34804|34805|34806|34807|34894|34895|35173|35326|35327|35365|35636|35637|35982|35983|35985|35986|36125|36136|36184|36185|36186|36187|36188|36189|36190|36191|36192|36461|36462|36463|36464|36465|36466|36467|36468|36469|36470|36471|36472|36473|36476|36477|36478|36479|36480|36481|36482|36483|36484|36742|36743|36744|36745|36746|37071|37072|37073|37280|37950|37951|38197|38198|38199|38388|38762|38763|38764|38765|38766|39893|39969|40075|41033|41034|41035|41036|41043|41044|41045|41303|41493|41494|41910|41911|41912|41913|41914|41915|42084|42270|42271|42272|42273|42274|42275|42510|42511|42512|42513|42710|42711|42780|42781|42838|42839|42931|43102|43103|43104|43105|43106|43107|43112|43113|43356|43654|43658|43763|43765|43862|43863|43993|43994|43995|44005|44006|44322|44323|44404|44405|44588|45253|45254|45255|45256|45257|45258|45259|45260|45261|45262|45263|45264|45265|45266|45267|45268|45269|45270|45271|45272|45273|45274|45275|45277|45278|45279|45280|45281|45282|45283|45284|45285|45286|45287|45288|45289|45290|45291|45292|45293|45294|45295|45296|45297|45298|45299|45300|45351|45352|45353|45354|45355|45356|45357|45358|45359|45360|45361|45362|45363|45364|45365|45366|45367|45368|45369|45370|45371|45372|45373|45374|45375|45376|45377|45378|45379|45380|45381|45382|45383|45384|45385|45386|45387|45388|45389|45424|45425|45426|45427|45428|45429|45430|45431|45432|45481|45482|45483|45519|45520|45521|45522|45641|45642|45643|45735|45879|45892|45897|45949|45950|45951|45952|45954|45955|45961|45963|45964|46136|46137|46138|46244|46245|46246|46351|46379|46380|46383|46384|46385|46386|46447|46609|46610|46611|46612|46613|46614|46615|46616|46617|46618|46619|46620|46621|46622|46623|46624|46625|46626|46627|46628|46629|46630|46631|46632|46633|46634|46635|46636|46637|46638|46639|46640|46641|46642|46643|46644|46695|46696|46697|46698|46699|46700|46701|46703|46704|46705|46722|46723|46724|46726|46727|46728|46729|46730|46731|46732|46733|46734|46736|46737|46738|46739|46740|46741|46765|46766|46767|46768|46769|46770|46999|47000|47001|47002|47003|47004|47027|47028|47029|47074|47075|47076|47077|47078|47166|47167|47168|47169|47170|47171|47172|47173|47226|47261|47262|47263|47264|47440|47525|47526|47527|47620|47621|47677|47678|47679|47680|47681|47682|47683|47684|47685|47697|47698|47737|47738|47739|47740|47741|47742|47743|47744|47745|47746|47747|47748|47751|47752|47753|47754|47755|47756|47814|47815|47831|47841|47842|47946|47947|47948|47949|47950|47951|47952|47953|47979|47988|48088|48089|48091|48134|48135|48136|48137|48138|48139|48140|48141|48142|48143|48144|48145|48234|48235|48368|48379|48403|48404|48405|48466|48467|48468|48470|48510|48511|48512|48525|48552|48555|48558|48559|48596|48597|48598|48599|48600|48601|48602|48612|48667|48671|48673|48674|48675|48676|48677|48678|48679|48680|48681|48682|48683|48684|48685|48686|48687|48688|48689|48690|48691|48692|48693|48694|48695|48696|48895|48896|48897|48898|48906|48965|49101|49195|49247|49257|49260|49262|49264|49302|49303|49316|49317|49318|49319|49333|49334|49335|49359|49405|49431|49792|49798|49799|50062|50081|50167|50286|50287|50382|50392|50395|50396|50397|50467|50468|50469|50560|50561|50563|50564|50752|50753|51020|51073|51074|51123|51124|51286|51295|51296|51300|51308|51388|51651|51978|52057|52058|52059|52060|52061|52067|52098|52165|52169|52211|52240|52245|52248|52253|52538|52676|52677|52679|52680|52691|52708|52709|52711|52797|52801|52802|52829|52928|52979|53055|53056|53057|53058|53059|53060|53061|53062|53063|53064|53065|53066|53067|53257|53323|53324|53456|53457|53458|53814|53815|53816|53817|53818|53819|53820|53821|53906|53911|53939|53941|53942|54004|54005|54029|54034|54042|54147|54148|54149|54150|54151|54303|54304|54305|54310|54311|54422|54425|54426|54428|54429|54433|54548|54580|54581|54594|54639|54653|54654|54655|54656|54657|54658|54659|54660|54661|54728|54729|54834|54908|54970|54971|55034|55109|55165|55180|55184|55338|55339|55340|55414|55415|55416|55417|55419|55505|55506|55507|55508|55513|55514|55652|55653|55654|55655|55656|55657|55956|56182|56183|56184|56241|56242|56244|56444|56532|56536|56537|56538|56560|56561|56562|56563|56564|56565|56568|56570|56571|56572|56573|56574|56576|56579|56587|56593|56594|56596|56675|56676|56677|56678|56679|56680|56681|56682|56683|56684|56685|56688|56689|56690|56691|56692|56693|56694|56695|56696|56697|56698|56699|56700|56701|56702|56703|56704|56705|56781|56782|56783|56927|56928|56940|57247|57248|57249|57370|57461|57463|57611|58148|58149|58150|58151|58153|58154|58211|58305|58321|58322|58371|58389|58440|58473|58483|58933|58982|59013|59014|59019|59241|59284|59290|59378|59379|59579|59580|59956|59957|59958|59959|59961|59962|59965|59967|59999|60139|60140|60141|60142|60143|60144|60145|60146|60147|61067|61068|61069|61070|61199|61200|61205|61206|61363|61364|61381|61508|61779|61780|61781|61782|61783|61784|61785|61786|61787|61788|61789|61790|61819|61855|61856|61857|62302|62303|62354|62355|62356|62357|62358|62359|62362|62363|62364|62654|62656|62658|62659|62881|63215|63299|63300|63303|63304|63306|63307|63366|63367|63381|63382|63385|63386|63538|63539|63554|63829|63830|63831|63835|63969|63970|63972|64061|64062|64063|64064|64065|64066|64068|64069|64155|64156|64157|64158|64159|64247|64248|64249|64250|64251|64349|64350|64351|64352|64353|64354|64355|64356|64427|64433|64434|64548|64549|64550|64551|64552|64561|64562|64563|64564|64737|64738|64825|64826|64828|64829|64830|64971|64972|65222|65223|65226|65227|65228|65229|65230|65369|65370|65373|65374|65375|65376|65611|65612|65613|65614|65663|65808|65875|65876|65877|65878|65879|65880|65881|65882|65884|65885|65886|65887|65888|65889|65890|65891|65893|65895|65896|65897|65898|65900|65901|65902|65903|65904|65905|65906|65907|66078|66079|66080|66081|66082|66083|66084|66085|66086|66087|66088|66089|66382|66383|66384|66385|66386|66387|66662|66663|66666|66667|66668|66719|66975|66976|67222|67223|67224|67225|67281|67282|67404|67405|67406|67407|67410|67411|67412|67413|67543|67544|67545|67546|67547|67548|67549|67550|67551|67635|67636|67649|67650|67744|67745|67746|67747|67748|67749|68000|68001|68004|68005|68029|68031|68032|68033|68211|68214|68254|68255|68256|68257|68258|68259|68260|68261|68262|68263|68264|68265|68266|68267|68268|68269|68270|68271|68272|68414|68415|68416|68417|68419|68436|68437|68438|68440|68592|68593|68594|68595|68596|68597|68598|68599|68601|68602)$/,b.CONFIG={assetsURL:a.Utils.getProtocol()+"//cdn.teads.tv/media/format/v3",rasURL:a.Utils.getProtocol()+"//a.teads.tv/page/{id}/ad",trackingURL:a.Utils.getProtocol()+"//t.teads.tv/track",syncURL:a.Utils.getProtocol()+"//sync.teads.tv/iframe",timeoutPost:5e3},b.RESPONSIVE={xs:{className:"xs-screen",size:480},sm:{className:"sm-screen",size:640}},b.INREAD_IMPACT_PARALLAX_WIDTH=224,b.INREAD_IMPACT_BASE_WIDTH=640,b.INREAD_IMPACT_BASE_HEIGHT=234,b.FORMAT={inread:"inread",inboard:"inboard"},b.SLOT_TYPE={native:"native",corner:"corner",top:"top"},b.TRACKING={placementCall:"placementCall",fallback:{integration:"passback-integration",noAd:"passback-noAd"},noSlot:{selector:"noSlot-selector",filter:"noSlot-filter",avoid:"noSlot-avoid",size:"noSlot-size",btf:"noSlot-BTF",minimum:"noSlot-minimum",minimumBelow:"noSlot-minimumBelow",content:"noSlot-content",position:"noSlot-position",videoArticle:"noSlot-videoArticle",videoSlot:"noSlot-videoSlot",imageSlot:"noSlot-imageSlot",safeFrame:"noSlot-safeFrame"},incompatibility:{browser:"incompatibility-browser",context:"incompatibility-context",format:"incompatibility-format",video:"incompatibility-video"},placementCapping:"placementCapping",slotAvailable:"slotAvailable",adNotAvailable:{networkError:"adNotAvailable-networkError",serverError:"adNotAvailable-serverError"},adAvailable:{error:{parseTimeout:"adAvailable-error-parseTimeout",badResponse:"adAvailable-error-badResponse",vast:"adAvailable-error-vast-{code}",settings:"adAvailable-error-settings"},success:"adAvailable-success"},adCall:"adCall",noAd:{serverError:"noAd-serverError",networkError:"noAd-networkError",notFilled:"noAd-notFilled",vastError:"noAd-vastError-{code}",parseTimeout:"noAd-parseTimeout",settingsError:"noAd-settingsError",badResponse:"noAd-badResponse"},ad:"ad",impression:"impression",openExpand:"open-expand",open:"open",visible:"visible",click:"click"},b.COMSCORE_URL={"http:":"http://b.scorecardresearch.com/p?C1=1&C2=17198971&C5=01","https:":"https://sb.scorecardresearch.com/p?C1=1&C2=17198971&C5=01"},b.DEFAULT_VIDEO_SIZE_RATIO=16/9,b.MIN_Z_INDEX_VALUE=0,b.MAX_Z_INDEX_VALUE=2147483647,b.FACEBOOK_IA={entersViewport:"enters_viewport",centerEntersViewport:"center_enters_viewport",exitsViewport:"exits_viewport",centerExitsViewport:"center_exits_viewport"},b}();a.Constant=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b,c){void 0===c&&(c=0),this.scoreValues={WIDTH:20,HEIGTH:20,LENGTH:20,HIGH_MIN_SLOT:-5,LOW_MIN_SLOT:500,EQUAL_MIN_SLOT:1e3},this.element=b,this.index=c;var d=a.Dom.getSize(b);this.width=d.width,this.height=d.height,this.resolveSize()}return c.prototype.resolveSize=function(){var b=this.element.style.overflow;this.element.style.overflow="hidden";var c=a.Dom.getSize(this.element);c.height=c.width/a.Constant.DEFAULT_VIDEO_SIZE_RATIO,this.element.style.overflow=b,this.width=c.width,this.height=c.height},c.prototype.getElement=function(){return this.element},c.prototype.getElementRect=function(){return this.elementRect?this.elementRect:(this.elementRect=a.Dom.getBoundingClientRect(this.element),this.elementRect)},c.prototype.getWidth=function(){return this.width},c.prototype.getHeight=function(){return this.height},c.prototype.getScore=function(){return this.score},c.prototype.getIndex=function(){return this.index},c.prototype.computeScore=function(c){var d=b.Checker.configScore,e=0,f=c.minimum.get(),g=c.parentWindow.getWindow();this.width>c.minimumWidth.get()+d.WIDTH_MARGIN&&(e+=this.scoreValues.WIDTH),this.height>d.MIN_LONG_HEIGHT+d.HEIGHT_MARGIN&&(e+=this.scoreValues.HEIGTH),this.height>c.minimumTextLength.get()+d.LENGTH_MARGIN&&(e+=this.scoreValues.LENGTH),e+=this.index>f+d.LENGTH_MARGIN?this.scoreValues.EQUAL_MIN_SLOT:this.index>=0&&f?this.scoreValues.HIGH_MIN_SLOT:this.scoreValues.LOW_MIN_SLOT;var h=a.Dom.getBoundingClientRect(this.getElement()),i=g.document.body||g.document.documentElement,j=h.top+(g.pageYOffset||i.scrollTop);e-=j/20,this.score=e},c}();b.Slot=c}(b=a.placement||(a.placement={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.extendAd=function(a,b){var c={settings:{}},d=!(!b.type||!b.content);return d?(c.type=b.type,c.content=b.content):(c.type=a.type,c.content=a.content),c.settings=a.settings,c},b.checkEnvironment=function(b){var c={status:!0,reasons:[]},d=b.parentWindow.getWindow();a.Context.videoSupport(d.document)||a.FlashHelper.hasFlashVersion(10)||(c.status=!1,c.reasons.push(a.Constant.TRACKING.incompatibility.video));var e=a.Context.isMobile()&&b.isMobile(),f=a.Context.isTablet()&&b.isTablet(),g=a.Context.isDesktop()&&b.isDesktop();return e||f||g||(c.status=!1,c.reasons.push(a.Constant.TRACKING.incompatibility.context)),a.Semver.isLowerOrEqual(a.Context.getIEVersion(),"8")&&(c.status=!1,c.reasons.push(a.Constant.TRACKING.incompatibility.browser)),c},b}();b.Compatibility=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b){this.abstractFormat=b,this.logger=new a.Logger("teads.helper.smartPosition"),this.active=!1,this.started=!1,this.stopped=!1,this.isTop=!1,this.isCorner=!1,this.isResponsive=!1,this.eventListenerManager=new a.EventListenerManager,this.creativeLimits={top:0,bottom:0},this.windowLimits={top:0,bottom:0},this.adSize={width:0,height:0},this.maxRatio=1,this.currentTop=0,this.getCreativeLimitsTries=0,this.originalPlayerZIndex=String(a.Constant.MIN_Z_INDEX_VALUE),this.parentContainer=b.parentContainer,this.playerContainer=b.playerContainer,this.placementConfig=b.placement.placementConfig,this.electedSlot=b.placement.getElectedSlot(),this.vpaidAd=b.getVpaidAd(),this.responsiveHelper=b.responsive,this.fullscreenHelper=b.getFullscreenHelper(),this.components=b.components,this.win=b.placement.placementConfig.parentWindow.getWindow(),this.config=b.formatConfig.smartPosition.getValue(),this.maxTop=a.Dom.getWindowSize(this.win).height*c.MAX_FLOATING_TOP,a.Context.isMobile()?this.config.top?this.isTop=!0:this.config.corner&&(this.isCorner=!0):this.config.corner?this.isCorner=!0:this.config.top&&(this.isTop=!0),this.logger.debug("isTop, isCorner",this.isTop,this.isCorner),this.isTop?this.maxRatio=c.MAX_SIZE_RATIO_TOP:this.isCorner&&(this.maxRatio=c.MAX_SIZE_RATIO_CORNER),this.originalPlayerZIndex=this.playerContainer.style.zIndex}return c.prototype.isActive=function(){return this.active},c.prototype.hasStarted=function(){return this.started},c.prototype.onScroll=function(a){this.started&&!this.stopped&&(this.windowLimits=this.getWindowLimits(),this.active?this.canStop()&&this.stop():this.canStart()&&this.start())},c.prototype.onTouch=function(a){this.started&&!this.stopped&&(this.windowLimits=this.getWindowLimits(),this.active&&this.canStop()&&this.stop())},c.prototype.init=function(){var b=this;if(!this.started&&(this.isTop||this.isCorner)){this.logger.debug("initializing"),this.responsiveHelper.unsetResponsive(),this.compensationDiv=this.initCompensationDiv();var c=a.Utils.throttle(function(){return b.onResizeEnd()},100,this);this.responsiveHelper.addResizeListener(function(a){return c(a)}),this.fullscreenHelper.addBeforeOpenEventListener(function(){return b.onFullscreenOpen()}),this.fullscreenHelper.addCloseEventListener(function(){return b.onFullscreenClose()}),this.responsiveHelper.addOrientationChangeListener(function(){return b.onOrientationChange()}),this.eventListenerManager.addMultiple(["touchstart","touchmove","touchend"],this.win,function(a){return b.onTouch(a)}),this.creativeLimits=this.getCreativeLimits(),this.currentTop=this.getCurrentTop(),this.logger.debug("init",this.currentTop),this.started=!0,this.responsiveHelper.setResponsive()}},c.prototype.deinit=function(){if(!this.stopped){this.stopped=!0;try{this.stop()}catch(c){}this.eventListenerManager.removeAll(),this.abstractFormat.slotType===a.Constant.SLOT_TYPE.native&&this.compensationDiv.parentNode.removeChild(this.compensationDiv),b.Debug.hideCreativeLimits()}},c.prototype.start=function(){var b=this;if(!this.active){if(this.responsiveHelper.unsetResponsive(),this.compensationDiv.style.height=a.Dom.getBoundingClientRect(this.playerContainer).height+"px",this.setResponsive(),this.playerContainer.style.zIndex=String(a.Constant.MAX_Z_INDEX_VALUE),this.playerContainer.style.position="fixed",this.compensationDiv.style.display="block",this.isTop)this.currentMode===c.MODES.TOP&&(this.currentTop=this.getCurrentTop(),this.playerContainer.style.top=this.currentTop+"px");else{if(!this.isCorner)return this.logger.error("Starting smartPosition with unsupported mode."),void this.stop();this.win.setTimeout(function(){b.playerContainer.style.bottom="0px",b.playerContainer.style.right="0px"},1)}this.active=!0}},c.prototype.getOptimalDimension=function(){return this.responsiveHelper.getOptimalDimension(this.parentContainer,this.maxRatio)},c.prototype.getCreativeLimits=function(){var d=this,e=this.active?this.compensationDiv:this.playerContainer,f=a.Dom.getBoundingClientRect(e);if(f.top===f.bottom&&this.getCreativeLimitsTriesthis.creativeLimits.top&&(this.currentMode=c.MODES.TOP,a=!0):this.isCorner&&(this.windowLimits.bottomthis.creativeLimits.bottom&&(this.currentMode=c.MODES.BOTTOM,a=!0)),a},c.prototype.canStop=function(){var a=!1;return this.isTop?this.currentMode===c.MODES.TOP&&this.windowLimits.top<=this.creativeLimits.top&&(a=!0):this.isCorner&&(this.currentMode===c.MODES.TOP&&this.windowLimits.bottom>=this.creativeLimits.top?a=!0:this.currentMode===c.MODES.BOTTOM&&this.windowLimits.top<=this.creativeLimits.bottom&&(a=!0)),a},c.prototype.setResponsive=function(){var b=this;this.isResponsive=!0;var c=function(){b.isActive()&&b.isResponsive&&(b.handleResize(),b.resizeInterval=a.HTMLHelper.requestAnimationFrame(c,100))};this.resizeInterval=a.HTMLHelper.requestAnimationFrame(c,100)},c.prototype.handleResize=function(b){if(void 0===b&&(b=!1),!this.fullscreenHelper.isActive()){var d=this.getOptimalDimension();if((b||this.vpaidAd.getAdHeight()!==d.height)&&(this.adSize=d,this.logger.debug("resize to "+this.adSize.width+"x"+this.adSize.height),this.resizeAd(this.adSize.width,this.adSize.height)),d=this.responsiveHelper.getOptimalDimension(this.parentContainer,1),(b||a.Dom.getBoundingClientRect(this.compensationDiv).height!==d.height)&&(this.compensationDiv.style.height=d.height+"px"),this.isTop){this.maxTop=a.Dom.getWindowSize(this.win).height*c.MAX_FLOATING_TOP;var e=this.getTop();this.currentTop!==e&&(this.currentTop=e,this.playerContainer.style.top=this.currentTop+"px")}}},c.prototype.unsetResponsive=function(){a.HTMLHelper.cancelAnimationFrame(this.resizeInterval),this.isResponsive=!1},c.prototype.resizeAd=function(b,c){var d=Math.round(a.Dom.getBoundingClientRect(this.compensationDiv).width),e=(d-b)/2+"px";this.vpaidAd.resizeAd(b,c),this.isTop?(this.playerContainer.style.marginLeft=e,this.playerContainer.style.marginRight=e):(this.playerContainer.style.marginLeft="0px",this.playerContainer.style.marginRight="0px")},c.prototype.initCompensationDiv=function(){var b=this.win.document.createElement("div");return b.className="teads-player teads-compensation-div",b.style.display="none",b.style.opacity="0",this.abstractFormat.slotType===a.Constant.SLOT_TYPE.native&&(this.playerContainer.nextSibling?this.playerContainer.parentNode.insertBefore(b,this.playerContainer.nextSibling):this.playerContainer.parentNode.appendChild(b)),b},c.prototype.onResizeEnd=function(){this.fullscreenHelper.isActive()||(this.creativeLimits=this.getCreativeLimits(),this.onScroll())},c.prototype.onOrientationChange=function(){this.creativeLimits=this.getCreativeLimits(),this.isTop&&(this.currentTop=this.getTop(),this.logger.debug("onOrientationChange",this.currentTop)),this.active&&!this.fullscreenHelper.isActive()&&(this.unsetResponsive(),this.handleResize(!0),this.setResponsive())},c.prototype.onFullscreenOpen=function(){this.active&&this.stop()},c.prototype.onFullscreenClose=function(){this.onScroll()},c.prototype.getTop=function(){for(var b=0,c=a.HTMLHelper.findFloatingHeaders(this.win,[this.playerContainer]),d=0,e=c.length;d0?b:f+b,h=Math.max(0,Math.min(this.maxTop,g));return this.logger.debug(g,h,c),h},c.prototype.getCurrentTop=function(){return this.isTop&&!this.active?this.getTop():this.currentTop},c.MAX_SIZE_RATIO_CORNER=a.Context.isDesktop()?.3:.25,c.MAX_SIZE_RATIO_TOP=a.Context.isDesktop()?.3:.5,c.MAX_FLOATING_TOP=a.Context.isDesktop()?.25:.2,c.MAX_GET_CREATIVE_LIMITS_TRIES=5,c.MODES={TOP:"TOP",BOTTOM:"BOTTOM"},c}();b.SmartPosition=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){}return b.get=function(c){var d=null;try{d=localStorage.getItem(c)}catch(e){b.logger.debug("localStorage.getItem not supported")}if(!d)try{d=a.Cookie.get(c)}catch(e){b.logger.debug("Cookie.get not supported")}try{return a.JSON.parse(d)}catch(e){return b.logger.warn("Could not JSON-decode this locally stored string:",d,e),null}},b.set=function(c,d){d=a.JSON.stringify(d);try{localStorage.setItem(c,d)}catch(e){b.logger.debug("localStorage.setItem not supported")}try{a.Cookie.set(c,d)}catch(e){b.logger.debug("cookie.set not supported")}},b.remove=function(c){try{localStorage.removeItem(c)}catch(d){b.logger.debug("localStorage.removeItem not supported")}try{a.Cookie.remove(c)}catch(d){b.logger.debug("Cookie.remove not supported")}},b.logger=new a.Logger("Store"),b}();a.Store=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.get=function(){return a.value||(a.value=a.generate()),a.value},a.generate=function(){for(var a=[],b=0;b<256;b++)a[b]=(b<16?"0":"")+b.toString(16);var c=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*Math.random()|0,f=4294967295*Math.random()|0,g=a[255&c]+a[c>>8&255]+a[c>>16&255]+a[c>>24&255]+"-"+a[255&d]+a[d>>8&255]+"-"+a[d>>16&15|64]+a[d>>24&255]+"-"+a[63&e|128]+a[e>>8&255]+"-"+a[e>>16&255]+a[e>>24&255]+a[255&f]+a[f>>8&255]+a[f>>16&255]+a[f>>24&255];return g},a}();a.UserId=b}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(){}return c.insert=function(c){var d=a.HTMLHelper.createIframe(),e=function(e){d.src=a.USER_SYNC_URL+"?pid="+c+"&userId="+b.UserId.get()+"&"+(new Date).getTime(),d.style.display="none",a.Timing.mark("markUserSyncRequest"),e.document.body.appendChild(d)};try{var f=a.HTMLHelper.findParentWindows(window.document.body).pop();f&&e(f)}catch(g){this.logger.warn("Cannot write in document of top window, writing in document of current window..."),e(window)}return d},c.logger=new a.Logger("helper.UserSync"),c}();b.UserSync=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b){this.win=b,this.logger=new a.Logger("helper.SmartSlot")}return b.findArticle=function(c,d,e,f){e.length=0,e.currentScore=0,e.childrenScore=0,e.isOverMinimumWidth=!1;var g=c.innerText||c.textContent||c.nodeValue,h=c.nodeName.toUpperCase();if(g&&(3===c.nodeType||b.textNodes[h]))e.length=g.replace(/\s+/g," ").length;else if(c===d.document.body||1===c.nodeType&&b.nodeScores[h]){for(var i=0,j=0,k=0,l=c.childNodes.length;k=b.MINIMUM_WIDTH)&&(e.isOverMinimumWidth=!0)}e.currentScore=i,e.childrenScore=j}if(e.childrenScore&&e.isOverMinimumWidth&&e.childrenScore>b.MINIMUM_CHARS){for(var n,o=b.nodeScores[h]||0,p=c.className.split(" "),q=1,k=0,l=p.length;ke.article.score&&(e.article.score=w,e.article.node=c,f&&f.debug("found a better node scoring ",e.article.score,e.article.node))}return e},b.prototype.find=function(){a.Timing.mark("markFormatSmartSlotStart");var c={length:0,currentScore:0,childrenScore:0,isOverMinimumWidth:!1,article:{score:0,node:null}},d=b.findArticle(this.win.document.body,this.win,c,this.logger);if(d.article&&d.article.node){var e=this.findParagraph(d.article.node);return a.Timing.mark("markFormatSmartSlotEnd"),e}return null},b.prototype.findParagraph=function(a){var b,c,d=["P","DIV"];for(c=0;c0)this.mute(),this.lastUserInteractionSound=c.HAS_MUTED,a.ArrayHelper.forEach(this.muteCallbacks,function(a){return a()});else{var b=a.Context.isDesktop()?this.formatConfig.volume.getMouseover():this.formatConfig.volume.getMain();this.setVolume(b),this.lastUserInteractionSound=c.HAS_UNMUTED,a.ArrayHelper.forEach(this.unmuteCallbacks,function(a){return a()})}},b.prototype.userAlreadyInteracted=function(){return this.lastUserInteractionSound!==c.NO},b.prototype.stopFade=function(){this.clock=b.FADE_RATE,clearInterval(this.interval)},b.prototype.startAt=function(b){var c=this,d=function(){var e=c.vpaidAd.getAdDuration()-c.vpaidAd.getAdRemainingTime();e>=b&&(c.vpaidAd.unsubscribe(d,a.vpaid.VPAIDEvent.AdRemainingTimeChange),c.hasStarted||(c.hasStarted=!0,c.fade(c.formatConfig.volume.getMain())))};this.vpaidAd.subscribe(d,a.vpaid.VPAIDEvent.AdRemainingTimeChange)},b.prototype.fadeMain=function(a){void 0===a&&(a=!0),this.fade(this.formatConfig.volume.getMain(),a)},b.prototype.fadeMouseover=function(a){void 0===a&&(a=!0),this.fade(this.formatConfig.volume.getMouseover(),a)},b.prototype.fade=function(a,c){var d=this;if(void 0===c&&(c=!0),this.hasStarted=!0,this.getVolume()!==a){var e=this.getVolume();c&&this.formatConfig.volume.getFadeDuration()?(this.clock=0,clearInterval(this.interval),this.interval=setInterval(function(){if(d.clock>=b.FADE_RATE)d.setVolume(a),clearInterval(d.interval);else{var c=e+(a-e)*d.clock/b.FADE_RATE;e=c,d.setVolume(c)}d.clock++},this.formatConfig.volume.getFadeDuration()/b.FADE_RATE)):(this.stopFade(),this.setVolume(a))}},b.prototype.mute=function(){this.setVolume(0)},b.prototype.isMuted=function(){return 0===this.getVolume()},b.prototype.onMouseOver=function(){this.userAlreadyInteracted()||this.abstractFormat.states.hasCompleted||(this.formatConfig.soundOver.isOver()||this.formatConfig.soundOver.isOnceOver())&&this.fadeMouseover()},b.prototype.onMouseOut=function(){this.userAlreadyInteracted()||this.abstractFormat.states.hasCompleted||(this.formatConfig.soundOver.isOver()||this.formatConfig.soundOver.isOnceOver())&&(this.stopFade(),this.formatConfig.soundOver.isOver()?this.formatConfig.soundStart.isUnmute()?this.fadeMain(!1):this.formatConfig.soundStart.isMute()?this.fade(0,!1):this.formatConfig.soundStart.isCountdown()&&this.fadeMain(!1):this.formatConfig.soundOver.isOnceOver()&&this.fadeMain(!1))},b.prototype.onAdVideoStart=function(){if(this.formatConfig.soundStart.isUnmute()?this.fadeMain():this.formatConfig.soundStart.isCountdown()&&this.startAt(this.formatConfig.soundStart.getCountdown()),a.Context.isDesktop()&&!a.Context.isIABSafeFrame()){var b=a.Dom.getBoundingClientRect(this.abstractFormat.parentContainer),c=this.cursorCoords.x>=b.left&&this.cursorCoords.x<=b.right,d=this.cursorCoords.y>=b.top&&this.cursorCoords.y<=b.bottom;c&&d&&(this.formatConfig.soundOver.isOver()||this.formatConfig.soundOver.isOnceOver())?this.fadeMouseover():this.setVolume(0),this.eventListenerManager.remove("mousemove")}else this.setVolume(0)},b.prototype.replay=function(){var b=this,c=a.Dom.getBoundingClientRect(this.abstractFormat.parentContainer);a.Context.isDesktop()&&(this.cursorCoords={x:Math.floor(c.left+c.width/2),y:Math.floor(c.top+c.height/2)},this.eventListenerManager.add("mousemove",this.abstractFormat.placement.placementConfig.parentWindow.getWindow().document.body,function(a){b.cursorCoords={x:a.clientX,y:a.clientY}}))},b.prototype.startInView=function(){if(!this.userAlreadyInteracted()){var a=this.formatConfig.soundMute.isThreshold()&&this.hasStarted&&(this.formatConfig.soundStart.isCountdown()||this.formatConfig.soundStart.isUnmute()||this.formatConfig.soundOver.isOnceOver());a&&this.fadeMain()}},b.prototype.endInView=function(){!this.userAlreadyInteracted()&&this.formatConfig.soundMute.isThreshold()&&this.hasStarted&&this.fade(0,!1)},b.prototype.addMuteCallback=function(b){a.ArrayHelper.indexOf(this.muteCallbacks,b)<0&&this.muteCallbacks.push(b)},b.prototype.addUnmuteCallback=function(b){a.ArrayHelper.indexOf(this.unmuteCallbacks,b)<0&&this.unmuteCallbacks.push(b)},b.FADE_RATE=10,b}();b.VolumeController=d}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b,c,d,e,f,g){var h=this;if(this.formatContainer=b,this.vpaidAd=c,this.visibility=d,this.components=e,this.responsive=f,this.win=g,this.originalVpaidSize={width:0,height:0},this.fullscreenFormatStyle={width:"100%",height:"100%",top:"0",left:"0",position:"fixed","z-index":String(a.Constant.MAX_Z_INDEX_VALUE),"background-color":"#000000",margin:"0","max-width":"none"},this.originalFormatStyle={width:"",height:"",top:"",left:"",position:"","z-index":"","background-color":"",margin:"","max-width":""},this.canvasTag=null,this.active=!1,this.isVideoPaused=!1,this.wasVideoPaused=!1,this.wasVisibilityEnabled=!1,this.eventListenerManager=new a.EventListenerManager,this.beforeOpenEventListeners=[],this.closeEventListeners=[],this.logger=new a.Logger("FullscreenHelper"),this.parentsPropertiesList=[],this.logger.debug("new"),this.vpaidAd.subscribe(function(){return h.isVideoPaused=!0},a.vpaid.VPAIDEvent.AdPaused),this.vpaidAd.subscribe(function(){return h.isVideoPaused=!1},a.vpaid.VPAIDEvent.AdPlaying),!a.Context.isIos()){var i=["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"];this.eventListenerManager.addMultiple(i,this.win,function(b){a.HTMLHelper.isFullscreen(h.win.document)?h.vpaidAd.resizeAd(h.win.screen.width,h.win.screen.height,"fullscreen"):(a.ArrayHelper.forEach(h.closeEventListeners,function(a){a()}),h.close())}),this.vpaidAd.subscribe(function(){return h.eventListenerManager.removeMultiple(i)},a.vpaid.VPAIDEvent.AdStopped)}this.responsive&&this.responsive.addOrientationChangeListener(function(){return h.handleOrientationChange()})}return b.getPropertyToSave=function(a,b){return{name:b,value:a.style.getPropertyValue(b),priority:a.style.getPropertyPriority(b)}},b.prototype.handleOrientationChange=function(){this.active&&(this.logger.debug("orientation change, resizeAd"),this.responsive.resize(!0))},b.prototype.isActive=function(){return this.active},b.prototype.init=function(a){this.vpaidEnvironmentVars=a,this.vpaidEnvironmentVars.videoSlot&&(this.canvasTag=this.vpaidEnvironmentVars.videoSlot.canvas)},b.prototype.addBeforeOpenEventListener=function(b){a.ArrayHelper.indexOf(this.beforeOpenEventListeners,b)<0&&this.beforeOpenEventListeners.push(b)},b.prototype.addCloseEventListener=function(b){a.ArrayHelper.indexOf(this.closeEventListeners,b)<0&&this.closeEventListeners.push(b)},b.prototype.open=function(){this.active||(this.active=!0,a.ArrayHelper.forEach(this.beforeOpenEventListeners,function(a){a()}),this.visibility.isEnabled()?(this.wasVisibilityEnabled=!0,this.visibility.disable()):this.wasVisibilityEnabled=!1,a.HTMLHelper.addClass(this.vpaidAd.getMainComponentsContainer(),"fullscreen"),a.Context.isIos()?(this.overrideParentsProperties(),this.originalVpaidSize.width=a.Dom.getBoundingClientRect(this.formatContainer).width,this.originalVpaidSize.height=this.vpaidAd.getAdHeight(),a.HTMLHelper.addClass(this.formatContainer,"no-transition"),this.applyStyleRules(),this.components.hideAllComponents()):a.HTMLHelper.openFullscreen(this.vpaidAd.getContainer()),this.responsive.resize(!0),this.isVideoPaused?(this.vpaidAd.resumeAd(),this.wasVideoPaused=!0):this.wasVideoPaused=!1)},b.prototype.close=function(){var b=this;this.active&&(this.wasVisibilityEnabled&&this.visibility.enable(),a.HTMLHelper.removeClass(this.vpaidAd.getMainComponentsContainer(),"fullscreen"),a.Context.isIos()?(this.restoreParentsProperties(),a.HTMLHelper.removeClass(this.formatContainer,"no-transition"),this.components.showAllComponents(),this.restoreStyleRules()):a.Context.isAndroid()?setTimeout(function(){return a.HTMLHelper.closeFullscreen(b.vpaidAd.getContainer())},100):a.HTMLHelper.closeFullscreen(this.vpaidAd.getContainer()),this.wasVideoPaused&&this.vpaidAd.pauseAd(),this.active=!1,this.responsive.resize(!0),this.canvasTag&&this.resetCanvas(),a.ArrayHelper.forEach(this.closeEventListeners,function(a){a()}))},b.prototype.applyStyleRules=function(){for(var a in this.originalFormatStyle)this.originalFormatStyle.hasOwnProperty(a)&&(this.originalFormatStyle[a]=this.formatContainer.style.getPropertyValue(a));for(var a in this.fullscreenFormatStyle)this.fullscreenFormatStyle.hasOwnProperty(a)&&this.formatContainer.style.setProperty(a,this.fullscreenFormatStyle[a])},b.prototype.restoreStyleRules=function(){for(var a in this.originalFormatStyle)this.originalFormatStyle.hasOwnProperty(a)&&this.formatContainer.style.setProperty(a,this.originalFormatStyle[a])},b.prototype.resetCanvas=function(){this.logger.debug("reset canvas"),this.canvasTag.style.setProperty("position","relative"),this.canvasTag.style.setProperty("top","0"),this.canvasTag.style.setProperty("left","0")},b.prototype.overrideParentsProperties=function(){var c=this;this.parentsPropertiesList=[];var d=a.HTMLHelper.findParentElements(this.formatContainer);a.ArrayHelper.forEach(d,function(d){var e={element:d,properties:[]},f=c.win.getComputedStyle(d);f.zIndex&&"auto"!==f.zIndex&&(e.properties.push(b.getPropertyToSave(d,"z-index")),d.style.setProperty("z-index","auto","important"));var g=["transform","-webkit-transform","transition","-webkit-transition"];a.ArrayHelper.forEach(g,function(a){e.properties.push(b.getPropertyToSave(d,a)),d.style.setProperty(a,"none","important")}),c.parentsPropertiesList.push(e)}),this.parentsPropertiesList.push({element:this.win.document.body,properties:[b.getPropertyToSave(this.win.document.body,"overflow")]}),this.win.document.body.style.setProperty("overflow","hidden")},b.prototype.restoreParentsProperties=function(){a.ArrayHelper.forEach(this.parentsPropertiesList,function(b){a.ArrayHelper.forEach(b.properties,function(a){b.element.style.removeProperty(a.name),b.element.style.setProperty(a.name,a.value,a.priority)})})},b}();b.FullscreenHelper=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b){this.format=b,this.isInitialized=!1,this.active=!1,this.logger=new a.Logger("BrandingMode")}return b.prototype.isActive=function(){return this.active},b.prototype.init=function(){var b=this;if(this.logger.debug("init called"),this.isInitialized)return void this.logger.warn("Branding mode helper has already been initialized");this.isInitialized=!0,this.vpaidEnvironmentVars=this.format.getEnvironmentVars();var c=this.format.getVpaidAd();c.showComponent("fullscreenbutton");var d=this.format.states.isReplay;this.format.getFullscreenHelper().init(this.vpaidEnvironmentVars),d&&a.Context.isAndroid()&&c.subscribe(function(){b.setVolume(b.format.formatConfig.volume.getMain()),b.initialVolume=b.format.getVolumeController().getVolume(),b.onUnmute()},a.vpaid.VPAIDEvent.AdVideoStart);var e=function(){b.isFullscreenSupported()&&b.stop()};c.subscribe(e,a.vpaid.VPAIDEvent.AdClickThru,this),c.subscribe(function(){return c.unsubscribe(e,a.vpaid.VPAIDEvent.AdClickThru)},a.vpaid.VPAIDEvent.AdStopped),c.subscribe(this.toggle,a.vpaid.ui.VPAIDUIEvent.FullscreenRequest,this),c.subscribe(function(){return c.unsubscribe(b.toggle,a.vpaid.ui.VPAIDUIEvent.FullscreenRequest)},a.vpaid.VPAIDEvent.AdStopped),c.subscribe(this.stop,a.vpaid.ui.VPAIDUIEvent.AdVideoComplete,this),this.format.getVolumeController().addUnmuteCallback(function(){return b.onUnmute()}),this.format.getVolumeController().addMuteCallback(function(){return b.onMute()})},b.prototype.deinit=function(){var b=this;this.logger.debug("deinit called"),this.isInitialized=!1;var c=this.format.getVpaidAd(),d=function(){b.isFullscreenSupported()&&b.stop()};c.subscribe(d,a.vpaid.VPAIDEvent.AdClickThru,this),c.subscribe(function(){return c.unsubscribe(d,a.vpaid.VPAIDEvent.AdClickThru)},a.vpaid.VPAIDEvent.AdStopped),c.unsubscribe(this.toggle,a.vpaid.ui.VPAIDUIEvent.FullscreenRequest),c.unsubscribe(this.stop,a.vpaid.ui.VPAIDUIEvent.AdVideoComplete),c.hideComponent("fullscreenbutton")},b.prototype.toggle=function(){return this.isInitialized?void(this.active?this.stop():this.start()):void this.logger.warn("Cannot toggle branding mode helper before its initialization")},b.prototype.start=function(){this.active||(this.logger.debug("start"),this.initialVolume=this.format.getVolumeController().getVolume(),this.setVolume(this.format.formatConfig.volume.getMain()),this.isFullscreenSupported()?this.format.getFullscreenHelper().open():this.format.getVpaidAd().hideComponent("fullscreenbutton"),this.active=!0)},b.prototype.stop=function(){this.active&&(this.logger.debug("stop"),this.format.getVolumeController().isMuted()&&(this.initialVolume=0),this.setVolume(this.initialVolume),this.isFullscreenSupported()?this.format.getFullscreenHelper().close():this.format.getVpaidAd().showComponent("fullscreenbutton"),this.active=!1)},b.prototype.setVolume=function(a){var b=this,c=function(){return b.format.getVolumeController().fade(a,!1)};this.vpaidEnvironmentVars.videoSlot&&this.vpaidEnvironmentVars.videoSlot.audio&&!this.vpaidEnvironmentVars.videoSlot.audio.authorized?this.vpaidEnvironmentVars.videoSlot.audio.authorizeAudio(c.bind(this)):c()},b.prototype.isFullscreenSupported=function(){var b=this.format.getVpaidAd(),c=this.format.getFullscreenHelper().isActive()||b.getAdWidth()>b.getAdHeight();return!a.Context.isDesktop()&&!a.Context.isAmp()&&!a.Context.isFacebookIA()&&!a.Context.isIABSafeFrame()&&c},b.prototype.onUnmute=function(){this.isFullscreenSupported()||this.start()},b.prototype.onMute=function(){this.isFullscreenSupported()||this.stop()},b}();b.BrandingMode=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.INCOMPLETE_OBJECT={id:1,message:"Ad configuration is missing settings or placement"},b.OPTION_CHECKVALUE_MISSING={id:2,message:"checkValue function is missing"},b.OPTION_THRESHOLD_MISSING={id:3,message:"Option threshold is required"},b.OPTION_PARENTWINDOW_INVALID={id:4,message:"Option parentWindow is required"},b.OPTION_VAST_INVALID={id:5,message:"Option vast has to contain type and content"},b.MULTIPLE_PAGE_PROCESS={id:6,message:"Cannot process more than 1 page"},b.OPTION_PID_INVALID={id:7,message:"Option Pid must be a positive number"},b.OPTION_FORMAT_INVALID={id:8,message:"Option Format must be a known string"},b.LOADING_MEDIAFILE={id:9,message:"Error when loading mediafile"},b.RAS_REQUEST={id:10,message:"RAS request error"},b.RAS_TIMEOUT={id:11,message:"RAS request timeout"},b.RAS_CUSTOM_TIMEOUT={id:12,message:"RAS request custom timeout"},b.RAS_RESPONSE={id:13,message:"RAS response error"},b.RAS_RESPONSE_ADS_NOT_ARRAY={id:14,message:"RAS response ads is not an array"},b.EVENT_CALLBACK={id:15,message:"Callback threw an error"},b.FILTER_FUNCTION={id:16,message:"The filter function threw an error"},b.OPTION_NAME_REQUIRED={id:17,message:"Name must be a valid string"},b}(a.Exception);a.FormatException=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.isBoolean=function(a){return"boolean"==typeof a},a.isNumber=function(a){return"number"==typeof a},a.isArray=function(a){return a instanceof Array},a.isString=function(a){return"string"==typeof a},a.isUndefined=function(a){return"undefined"==typeof a},a.containsKeys=function(a,b){var c=!1;if(!b)return!1;for(var d in a)if(a.hasOwnProperty(d)){if(void 0===typeof b[d])return!1;c=!0}return c},a.isObject=function(a){var b=typeof a;return!!a&&"object"===b},a.isFunction=function(a){var b=Object.prototype,c=b.toString,d="[object Function]",e=typeof a;return!!a&&"function"===e&&c.call(a)===d},a}();a.MediaUtils=b}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b){if(this.name=b,this.logger=new a.Logger("option."+b),!b)throw new a.FormatException(a.FormatException.OPTION_NAME_REQUIRED);this.checkValue()}return b}();b.AbstractOption=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a,d){this.volume=d,void 0===a?this.callbacks=c.DEFAULT:this.callbacks=a,b.call(this,"Callbacks")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isObject(this.callbacks)||(this.callbacks=c.DEFAULT)},c.prototype.trigger=function(b,c,d){if(this.last===b)return this.logger.debug("Callbacks already triggered",b),!1;if(b===a.vpaid.VPAIDEvent.AdVolumeChange&&c&&(c.getVolume()===this.volume.getMain()||c.getVolume()===this.volume.getMouseover()?this.trigger("unmute"):c.isMuted()&&this.trigger("mute")),b===a.vpaid.VPAIDEvent.AdExpandedChange&&d&&(d.isActive()?this.trigger("enterFullscreen"):this.trigger("exitFullscreen")),this.callbacks&&"function"==typeof this.callbacks[b])try{return this.callbacks[b](),this.last=b,!0}catch(e){a.formatSumologic.sendError({message:'The "'+b+'" callback threw an error'}),this.logger.error('the "'+b+'" callback threw an error:',e)}else this.callbacks&&this.callbacks[b]&&this.logger.error('the "'+b+'" callback is not a function:',this.callbacks[b]);return!1},c.DEFAULT=null,c}(b.AbstractOption);b.Callbacks=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a,c){this.type=a.type,this.content=a.content,this.pid=c,this.appendPID(),b.call(this,"Vast")}return __extends(c,b),c.prototype.checkValue=function(){if(!a.helper.MediaUtils.isString(this.type)||!c.VALUES[this.type.toUpperCase()])throw new a.FormatException(a.FormatException.OPTION_VAST_INVALID);if(!a.helper.MediaUtils.isString(this.content))throw new a.FormatException(a.FormatException.OPTION_VAST_INVALID)},c.prototype.isVastUrl=function(){return this.type===c.VALUES.VASTURL},c.prototype.isVastXml=function(){return this.type===c.VALUES.VASTXML},c.prototype.isDisplayUrl=function(){return this.type===c.VALUES.DISPLAYURL},c.prototype.isDisplayXml=function(){return this.type===c.VALUES.DISPLAYXML},c.prototype.getContent=function(){return this.content},c.prototype.extractInsertionId=function(){var a,b="";return this.isVastUrl()&&(a=this.content.match(/get\/(\d+)/),a?b=a[1]:(a=this.content.match(/[&|\?]gid=(\d+)/),a&&(b=a[1]))),b},c.prototype.appendPID=function(){var b=a.URIHelper.parse(this.content);this.isVastUrl()&&"a.teads.tv"===b.hostname&&this.pid&&(this.content+=this.content.indexOf("?")===-1?"?":"&",this.content+="pid="+this.pid)},c.VALUES={VASTURL:"VastUrl",VASTXML:"VastXml",DISPLAYURL:"DisplayUrl",DISPLAYXML:"DisplayXml"},c}(b.AbstractOption);b.Vast=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){if(void 0===a&&(a=c.DEFAULT),this.originalRules=a,b.call(this,"Css"),this.originalRules){var d=c.transformStringToObject(this.originalRules);this.rules=this.processPadding(d)}}return __extends(c,b),c.transformStringToObject=function(b){var c={};if(!b)return c;var d=b.split(";");return a.ArrayHelper.forEach(d,function(b){var d=b.split(":"),e=d[0],f=d[1];e&&f&&(e=a.StringHelper.trim(e),f=a.StringHelper.trim(f),c[e]=f,"float"===e&&(c.cssFloat=f,c.styleFloat=f))}),c},c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.originalRules)||(this.originalRules=c.DEFAULT)},c.prototype.getOriginal=function(){return this.originalRules},c.prototype.applyRulesOn=function(a){this.applyCssRulesOn(a,this.rules)},c.prototype.applyCssRulesOn=function(a,b){var d,e=!1;for(var f in b)b.hasOwnProperty(f)&&(e=c.IMPORTANT_REGEX.test(b[f]),d=b[f].replace(c.IMPORTANT_REGEX,"").trim(),a.style.setProperty(f,d,e?"important":null))},c.prototype.processPadding=function(a){var b=document.createElement("div");this.applyCssRulesOn(b,a);var d=parseFloat(b.style.getPropertyValue("padding-top"))||0,e=parseFloat(b.style.getPropertyValue("padding-right"))||0,f=parseFloat(b.style.getPropertyValue("padding-bottom"))||0,g=parseFloat(b.style.getPropertyValue("padding-left"))||0;if(d){var h=parseFloat(b.style.getPropertyValue("margin-top"))||0;b.style.setProperty("margin-top",h+d+"px")}if(e){var i=parseFloat(b.style.getPropertyValue("margin-right"))||0;b.style.setProperty("margin-right",i+e+"px")}if(f){var j=parseFloat(b.style.getPropertyValue("margin-bottom"))||0;b.style.setProperty("margin-bottom",j+f+"px")}if(g){var k=parseFloat(b.style.getPropertyValue("margin-left"))||0;b.style.setProperty("margin-left",k+g+"px")}return b.style.removeProperty("padding"),c.transformStringToObject(b.style.cssText)},c.DEFAULT=null,c.IMPORTANT_REGEX=/!\s*important/i,c}(b.AbstractOption);b.Css=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e,f,g){void 0===g&&(g=null);var h=a.Context.isAmp()||a.Context.isIABSafeFrame()||a.Context.isFacebookIA()||e.isInBoard()&&f.isEnabled(),i=a.Context.isAndroid()&&!a.Context.canChromeAndroidAutoPlay()||a.Context.isIos()&&!a.Context.isWhiteListedIos10Safari(String(g));h&&i?this.value=a.player.PLAYER_TYPE.CANVAS:a.Context.isCanvasNeededOnAndroid()?this.value=a.player.PLAYER_TYPE.CANVAS:this.value=c.VALUES[d],b.call(this,"AllowedPlayer")}return __extends(c,b),c.prototype.checkValue=function(){var a=!1;for(var b in c.VALUES)c.VALUES.hasOwnProperty(b)&&(a=a||this.value===c.VALUES[b]);a||(this.value=c.DEFAULT)},c.prototype.getValue=function(){return this.value},c.VALUES={html5:a.player.PLAYER_TYPE.HTML5,canvas:a.player.PLAYER_TYPE.CANVAS,any:a.player.PLAYER_TYPE.ANY},c.DEFAULT=a.player.PLAYER_TYPE.ANY,c}(b.AbstractOption);b.AllowedPlayer=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e,f){void 0===d&&(d=c.DEFAULT),void 0===e&&(e=null),void 0===f&&(f=null),this.value=a.Utils.extend(c.DEFAULT,d),a.Constant.FORCE_EXPAND_ANIMATION_LIST.test(String(f))?this.value.expand=.5:e&&e.isInBoard()&&(this.value=c.DEFAULT_INBOARD),b.call(this,"Animations")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.setExpandDuration=function(b){var d=this;a.ArrayHelper.forEach(c.PROPERTIES,function(a){b.style.setProperty(a,d.value.expand+"s")})},c.prototype.setCollapseDuration=function(b){var d=this;a.ArrayHelper.forEach(c.PROPERTIES,function(a){b.style.setProperty(a,d.value.collapse+"s")})},c.PROPERTIES=["-webkit-transition-duration","-o-transition-duration","-moz-transition-duration","transition-duration"],c.VALUES={EXPAND:"expand",COLLAPSE:"collapse"},c.DEFAULT={expand:0,collapse:.5},c.DEFAULT_INBOARD={expand:.5,collapse:.5},c}(b.AbstractOption);b.Animations=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"Format")}return __extends(c,b),c.prototype.checkValue=function(){if(!a.helper.MediaUtils.isString(this.value)||!c.VALUES[this.value.toUpperCase()]||a.Context.isAmp()&&!this.isInRead())throw new a.FormatException(a.FormatException.OPTION_FORMAT_INVALID)},c.prototype.get=function(){return this.value},c.prototype.isInRead=function(){return this.value===c.VALUES.INREAD},c.prototype.isInBoard=function(){return this.value===c.VALUES.INBOARD},c.VALUES={INREAD:"inread",INBOARD:"inboard"},c.DEFAULT=null,c}(b.AbstractOption);b.Format=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=d,a.Context.isFacebookIA()&&a.helper.MediaUtils.isNumber(this.value)&&this.value>0&&(this.value=50),b.call(this,"Threshold")}return __extends(c,b),c.prototype.checkValue=function(){if(!a.helper.MediaUtils.isNumber(this.value)||this.value<=0||this.value>100)throw new a.FormatException(a.FormatException.OPTION_THRESHOLD_MISSING)},c.prototype.get=function(){return this.value},c.DEFAULT=null,c}(b.AbstractOption);b.Threshold=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),a.Semver.isGreaterOrEqual(a.Context.getIosVersion(),"10")?this.value=c.DEFAULT_IOS10:this.value=a.Utils.extend(c.DEFAULT,d),b.call(this,"Volume")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.getMain=function(){return this.value.main},c.prototype.getMouseover=function(){return this.value.mouseover},c.prototype.getFadeDuration=function(){return this.value.fadeDuration},c.VALUES={MAIN:"main",MOUSEOVER:"mouseover",FADEDURATION:"fadeDuration"},c.DEFAULT={main:.1,mouseover:.35,fadeDuration:1e3},c.DEFAULT_IOS10={main:1,mouseover:1,fadeDuration:0},c}(b.AbstractOption);b.Volume=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e){void 0===d&&(d=null),void 0===e&&(e="");var f={display:!!d&&d.display,url:e};this.value=a.Utils.extend(c.DEFAULT,f),b.call(this,"BrandLogo")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.getUrl=function(){return this.value.url},c.prototype.isEnabled=function(){return this.value.display},c.VALUES={DISPLAY:"display",URL:"url"},c.DEFAULT={display:!1,url:""},c}(b.AbstractOption);b.BrandLogo=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Utils.extend(c.DEFAULT,d),b.call(this,"CallButton")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value.display},c.prototype.getCountdown=function(){return this.value.countdown},c.prototype.getText=function(){return this.value.text},c.VALUES={DISPLAY:"display",COUNTDOWN:"countdown",TEXT:"text"},c.DEFAULT={display:!0,countdown:3,text:"Learn More"},c}(b.AbstractOption);b.CallButton=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){this.getValueFromVast=!d||a.helper.MediaUtils.isUndefined(d.display),this.value=a.Utils.extend(c.DEFAULT,d),a.Context.isFacebookIA()&&(this.getValueFromVast=!1,this.value={display:!1,countdown:0}),b.call(this,"CloseButton")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value.display},c.prototype.getCountdown=function(){return this.value.countdown},c.prototype.hasToGetValueFromVast=function(){return this.getValueFromVast},c.VALUES={DISPLAY:"display",COUNTDOWN:"countdown"},c.DEFAULT={display:!0,countdown:0},c}(b.AbstractOption);b.CloseButton=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e,f){void 0===e&&(e=null),void 0===f&&(f=null);var g=e&&e.isInBoard();this.value=a.Utils.extend(g?c.DEFAULT_INBOARD:c.DEFAULT_INREAD,d),this.formatName=e,f&&f.isDisplayXml()&&(this.value.display=!1),b.call(this,"Credits")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT_INREAD)},c.prototype.isEnabled=function(){return this.value.display},c.prototype.getText=function(){return this.value.text},c.prototype.getLink=function(){return this.value.link},c.VALUES={DISPLAY:"display",TEXT:"text",LINK:"link"},c.DEFAULT_INREAD={display:!0,text:"[inRead] invented by Teads",link:"http://teads.tv/inread-outstream/"},c.DEFAULT_INBOARD={display:!0,text:"[inBoard] invented by Teads",link:"http://teads.tv/inread-outstream/"},c}(b.AbstractOption);b.Credits=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Utils.extend(c.DEFAULT,d),(a.Context.isAmp()||a.Context.isFacebookIA())&&(this.value.display=!0,this.value.autoClose=!1),this.value.autoClose===!1&&(this.value.countdown=0),b.call(this,"EndScreen")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value.display},c.prototype.getCountdown=function(){return this.value.countdown},c.prototype.getCallButton=function(){return this.value.callButton},c.prototype.getReplayButton=function(){return this.value.replayButton},c.prototype.getAutoClose=function(){return this.value.autoClose},c.VALUES={DISPLAY:"display",CALLBUTTON:"callButton",REPLAYBUTTON:"replayButton",AUTOCLOSE:"autoClose",COUNTDOWN:"countdown",TYPE:"type"},c.DEFAULT={display:!0,callButton:{text:"Learn More",type:"learnMore"},replayButton:{text:"Replay"},autoClose:!1,countdown:0,type:"simple"},c}(b.AbstractOption);b.EndScreen=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Utils.extend(c.DEFAULT,d),a.Context.isFacebookIA()&&(this.value.display=!1),b.call(this,"Label")}return __extends(c,b),c.getTranslation=function(){var b=a.Context.getLanguage(),c=new a.L10n(b).translate("label");return c||(c=new a.L10n(b.substr(0,2)).translate("label")),c||(c=new a.L10n("en").translate("label")),c},c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.getHTML=function(){return this.value.html},c.prototype.getText=function(){return this.value.text},c.prototype.isEnabled=function(){return this.value.display},c.VALUES={DISPLAY:"display",TEXT:"text",HTML:"html"},c.TEXT=c.getTranslation(),c.DEFAULT={display:!0, text:c.TEXT,html:c.TEXT},c}(b.AbstractOption);b.Label=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"ProgressBar")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value},c.DEFAULT=!0,c}(b.AbstractOption);b.ProgressBar=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){this.value=a,b.call(this,"SmartPosition")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.closeButtonEnabled=function(){return this.value.closeButtonDisplay},c.VALUES={closeButtonDisplay:"closeButtonDisplay"},c.DEFAULT={closeButtonDisplay:!1},c}(b.AbstractOption);b.Slider=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Utils.extend(c.DEFAULT,d),a.Context.isIpad()&&(this.value.display=!1),(a.Context.isMobile()||a.Context.isTablet())&&(this.value=c.DEFAULT),b.call(this,"SoundButton")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value.display},c.prototype.getCountdown=function(){return this.value.countdown},c.prototype.getType=function(){return this.value.type},c.VALUES={DISPLAY:"display",COUNTDOWN:"countdown",TYPE:"type"},c.DEFAULT={display:!0,countdown:0,type:"mute"},c}(b.AbstractOption);b.SoundButton=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"Timer")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value},c.DEFAULT=!1,c}(b.AbstractOption);b.Timer=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Context.isAmp()?c.VALUES.ENDSCREEN:d,b.call(this,"End")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isCollapse=function(){return this.value===c.VALUES.COLLAPSE},c.prototype.isEndScreen=function(){return this.value===c.VALUES.ENDSCREEN},c.VALUES={COLLAPSE:"collapse",ENDSCREEN:"endScreen"},c.DEFAULT=c.VALUES.ENDSCREEN,c}(b.AbstractOption);b.End=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e){void 0===d&&(d=c.DEFAULT),void 0===e&&(e=null),a.Constant.FORCE_EXPAND_ANIMATION_LIST.test(String(e))?this.value=c.VALUES.THRESHOLD:a.Context.isAmp()||a.Context.isFacebookIA()?this.value=c.VALUES.AUTO:this.value=d,b.call(this,"Launch")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isAuto=function(){return this.value===c.VALUES.AUTO},c.prototype.isThreshold=function(){return this.value===c.VALUES.THRESHOLD},c.VALUES={AUTO:"auto",THRESHOLD:"threshold"},c.DEFAULT=c.VALUES.AUTO,c}(b.AbstractOption);b.Launch=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"OnlyNative")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.DEFAULT=!0,c}(b.AbstractOption);b.OnlyNative=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=d,a.Context.isDesktop()&&(this.value=c.VALUES.CLICK),b.call(this,"PlayerClick")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isClick=function(){return this.value===c.VALUES.CLICK},c.prototype.isFullscreen=function(){return this.value===c.VALUES.FULLSCREEN},c.VALUES={CLICK:"click",FULLSCREEN:"fullscreen"},c.DEFAULT=a.Context.isDesktop()?c.VALUES.CLICK:c.VALUES.FULLSCREEN,c}(b.AbstractOption);b.PlayerClick=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e){void 0===e&&(e=null),this.value=a.Utils.extend(c.DEFAULT,d),e&&(this.value.top=this.value.top||e.isInBoard()&&a.Context.isMobile()),(a.Semver.isLowerOrEqual(a.Context.getIosVersion(),c.MIN_IOS_VERSION)||a.Context.isAmp()||a.Context.isFacebookIA())&&(this.value.top=!1,this.value.corner=!1),b.call(this,"SmartPosition")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value.top||this.value.corner},c.prototype.isCorner=function(){return this.value.corner},c.prototype.getValue=function(){return this.value},c.prototype.setValue=function(a){this.value=a,this.checkValue()},c.MIN_IOS_VERSION="7",c.VALUES={top:"top",corner:"corner"},c.DEFAULT={top:!1,corner:!1},c}(b.AbstractOption);b.SmartPosition=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"SoundMute")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isNo=function(){return this.value===c.VALUES.NO},c.prototype.isThreshold=function(){return this.value===c.VALUES.THRESHOLD},c.VALUES={NO:"no",THRESHOLD:"threshold"},c.DEFAULT=c.VALUES.THRESHOLD,c}(b.AbstractOption);b.SoundMute=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=d,(a.Context.isMobile()||a.Context.isTablet())&&(this.value=c.VALUES.OFF),b.call(this,"SoundOver")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isOff=function(){return this.value===c.VALUES.OFF},c.prototype.isOver=function(){return this.value===c.VALUES.OVER},c.prototype.isOnceOver=function(){return this.value===c.VALUES.ONCEOVER},c.VALUES={OFF:"off",OVER:"over",ONCEOVER:"onceOver"},c.DEFAULT=c.VALUES.OVER,c}(b.AbstractOption);b.SoundOver=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=a.Utils.extend(c.DEFAULT,d),(a.Context.isMobile()||a.Context.isTablet())&&(this.value.type=c.VALUES_TYPE.MUTE),b.call(this,"SoundStart")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.containsKeys(c.VALUES,this.value)||(this.value=c.DEFAULT)},c.prototype.isMute=function(){return this.value.type===c.VALUES_TYPE.MUTE},c.prototype.isUnmute=function(){return this.value.type===c.VALUES_TYPE.UNMUTE},c.prototype.isCountdown=function(){return this.value.type===c.VALUES_TYPE.COUNTDOWN},c.prototype.getCountdown=function(){return this.value.countdown},c.VALUES={TYPE:"type",COUNTDOWN:"countdown"},c.VALUES_TYPE={MUTE:"mute",UNMUTE:"unmute",COUNTDOWN:"countdown"},c.DEFAULT={type:"mute",countdown:0},c}(b.AbstractOption);b.SoundStart=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.VALUES.THRESHOLD),this.value=a,b.call(this,"VideoPause")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isNo=function(){return this.value===c.VALUES.NO},c.prototype.isThreshold=function(){return this.value===c.VALUES.THRESHOLD},c.VALUES={NO:"no",THRESHOLD:"threshold"},c.DEFAULT=c.VALUES.THRESHOLD,c}(b.AbstractOption);b.VideoPause=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e,f){void 0===d&&(d=c.DEFAULT),void 0===e&&(e=null),void 0===f&&(f=null),this.value=d,!e||!e.isInBoard()||!a.Context.isMobile()&&!a.Context.isTablet()||f&&f.isEnabled()||(this.value=c.VALUES.CLICK),b.call(this,"VideoStart")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)&&c.VALUES[this.value.toUpperCase()]||(this.value=c.DEFAULT)},c.prototype.isAuto=function(){return this.value===c.VALUES.AUTO},c.prototype.isThreshold=function(){return this.value===c.VALUES.THRESHOLD},c.prototype.isClick=function(){return this.value===c.VALUES.CLICK},c.VALUES={AUTO:"auto",THRESHOLD:"threshold",CLICK:"click"},c.DEFAULT=c.VALUES.THRESHOLD,c}(b.AbstractOption);b.VideoStart=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(){}return a.getComponentsConfig=function(b,c,d,e){void 0===d&&(d=null);var f=e&&e.display,g=a.reconcileCloseButtonConfig(b,d,c),h=a.reconcileEndScreenCloseButtonConfig(g,b,c);return{clicktoplay:{disable:!b.videoStart.isClick()},closebutton:{disable:g.disable,countdown:g.countdown,listenSkippableState:g.listenSkippableState},soundbutton:{disable:!!f||!b.soundButton.isEnabled(),startOffset:b.soundButton.getCountdown(),type:b.soundButton.getType()},progressbar:{disable:!!f||!b.progressBar.isEnabled()},clickbutton:{disable:!!e||!b.callButton.isEnabled(),startOffset:b.callButton.getCountdown(),text:b.callButton.getText()},label:{disable:!0,html:b.label.getHTML()},credits:{formatName:b.formatName.get(),disable:!0,text:b.credits.getText(),url:b.credits.getLink()},endscreen:{disable:!!f||(b.end.isCollapse()||b.end.isEndScreen()&&!b.endScreen.isEnabled()),countdown:b.endScreen.getCountdown(),callButton:b.endScreen.getCallButton(),closeButton:{disable:h.disable,listenSkippableState:h.listenSkippableState},replayButton:b.endScreen.getReplayButton(),autoClose:b.endScreen.getAutoClose()},fullscreenbutton:{disable:!!f||!b.playerClick.isFullscreen(),preventDefault:!0},brandlogo:{disable:!b.brandLogo.isEnabled(),url:b.brandLogo.getUrl()}}},a.reconcileEndScreenCloseButtonConfig=function(a,b,c){var d={disable:a.disable,listenSkippableState:a.listenSkippableState};return c.sliderEnabled&&!b.onlyNative.get()&&(d.disable=!1,d.listenSkippableState=!1),d},a.reconcileCloseButtonConfig=function(a,b,c){var d={disable:!a.closeButton.isEnabled(),countdown:a.closeButton.getCountdown(),listenSkippableState:!1};return a.closeButton.hasToGetValueFromVast()&&(d.disable=!1,b&&b.skipDelay?d.countdown=b.skipDelay:d.listenSkippableState=!0),c.sliderEnabled&&!a.onlyNative.get()&&(d.disable=!a.slider.closeButtonEnabled(),d.listenSkippableState=!1),d},a}();a.RASHelper=b}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(b){if(this.useMultipleBillable=!1,!b.settings)throw new a.FormatException(a.FormatException.INCOMPLETE_OBJECT);var c={type:b.type,content:b.content};this.vast=new a.option.Vast(c,b.settings.values.placementId),b.settings.values=b.settings.values||{placementFormat:null,pageId:null,placementId:null,threshold:null},b.settings.components=b.settings.components||{},b.settings.behaviors=b.settings.behaviors||{},this.formatName=new a.option.Format(b.settings.values.placementFormat),this.pageId=b.settings.values.pageId,this.placementId=b.settings.values.placementId,this.threshold=new a.option.Threshold(b.settings.values.threshold),this.volume=new a.option.Volume(b.settings.values.volume),this.animations=new a.option.Animations(b.settings.values.animations,this.formatName,this.placementId),this.onlyNative=new a.option.OnlyNative(b.settings.behaviors.onlyNative),this.smartPosition=new a.option.SmartPosition(b.settings.behaviors.smartPosition,this.formatName),this.closeButton=new a.option.CloseButton(b.settings.components.closeButton),this.soundButton=new a.option.SoundButton(b.settings.components.soundButton),this.callButton=new a.option.CallButton(b.settings.components.callButton),this.timer=new a.option.Timer(b.settings.components.timer),this.progressBar=new a.option.ProgressBar(b.settings.components.progressBar),this.label=new a.option.Label(b.settings.components.label),this.credits=new a.option.Credits(b.settings.components.credits,this.formatName),this.endScreen=new a.option.EndScreen(b.settings.components.endScreen),this.brandLogo=new a.option.BrandLogo(b.settings.components.brandLogo,b.settings.values.brandLogoUrl),this.slider=new a.option.Slider(b.settings.components.slider),this.launch=new a.option.Launch(b.settings.behaviors.launch,this.placementId),this.videoStart=new a.option.VideoStart(b.settings.behaviors.videoStart,this.formatName,this.smartPosition),this.soundStart=new a.option.SoundStart(b.settings.behaviors.soundStart),this.videoPause=new a.option.VideoPause(b.settings.behaviors.videoPause),this.soundMute=new a.option.SoundMute(b.settings.behaviors.soundMute),this.soundOver=new a.option.SoundOver(b.settings.behaviors.soundOver),this.playerClick=new a.option.PlayerClick(b.settings.behaviors.playerClick),this.end=new a.option.End(b.settings.behaviors.end),this.callbacks=new a.option.Callbacks(b.callbacks,this.volume),this.allowedPlayer=new a.option.AllowedPlayer(b.settings.values.allowedPlayer,this.formatName,this.smartPosition,this.placementId),this.useMultipleBillable=!!b.settings.behaviors.useMultipleBillable}return b}();a.FormatConfig=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function a(){}return a.CREDITSCSS="\ndiv.teads-inread div.teads-ui-components-credits,\ndiv.teads-inboard div.teads-ui-components-credits,\ndiv.teads-expand div.teads-ui-components-credits {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n color: #aaa !important;\n text-align: right !important;\n padding: 1px 0 !important;\n height: 26px !important;\n line-height: 26px !important;\n padding-right: 4px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a span,\ndiv.teads-inboard div.teads-ui-components-credits a span,\ndiv.teads-expand div.teads-ui-components-credits a span {\n display: inline !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a span,\ndiv.teads-inboard div.teads-ui-components-credits a span,\ndiv.teads-expand div.teads-ui-components-credits a span,\ndiv.teads-inread div.teads-ui-components-credits a,\ndiv.teads-inboard div.teads-ui-components-credits a,\ndiv.teads-expand div.teads-ui-components-credits a {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n box-shadow: none !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-inboard.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-expand.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-inread.sm-screen div.teads-ui-components-credits a,\ndiv.teads-inboard.sm-screen div.teads-ui-components-credits a,\ndiv.teads-expand.sm-screen div.teads-ui-components-credits a,\ndiv.teads-inread.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-expand.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-inread.xs-screen div.teads-ui-components-credits a,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits a,\ndiv.teads-expand.xs-screen div.teads-ui-components-credits a {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 9px !important;\n box-shadow: none !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-credits,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits {\n font-size: 9px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread .teads-ui-components-credits a,\ndiv.teads-inboard .teads-ui-components-credits a,\ndiv.teads-expand .teads-ui-components-credits a {\n color: #aaa !important;\n text-decoration: none !important;\n font-weight: 300 !important;\n border: none !important;\n letter-spacing: 0.3px !important;\n /*\n * From @jean-pierre.colomb comment on https://jira.teads.net/browse/TT-4076\n * The gqjapan.jp website overrides properties to add 2 orange squares\n * which affects the credits link\n */\n background: none !important;\n padding: 0 !important;\n}\n\ndiv.teads-inread.sm-screen .teads-ui-components-credits a,\ndiv.teads-inboard.sm-screen .teads-ui-components-credits a,\ndiv.teads-expand.sm-screen .teads-ui-components-credits a,\ndiv.teads-inread.xs-screen .teads-ui-components-credits a,\ndiv.teads-inboard.xs-screen .teads-ui-components-credits a,\ndiv.teads-expand.xs-screen .teads-ui-components-credits a{\n font-size: 9px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits span.teads-ui-components-credits-colored,\ndiv.teads-inboard div.teads-ui-components-credits span.teads-ui-components-credits-colored,\ndiv.teads-expand div.teads-ui-components-credits span.teads-ui-components-credits-colored {\n color: #79BBE9 !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits span::before,\ndiv.teads-inboard div.teads-ui-components-credits span::before,\ndiv.teads-impact div.teads-ui-components-credits span::before,\ndiv.teads-inread div.teads-ui-components-credits span::after,\ndiv.teads-inboard div.teads-ui-components-credits span::after,\ndiv.teads-impact div.teads-ui-components-credits span::after {\n display: none !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a::before,\ndiv.teads-inboard div.teads-ui-components-credits a::before,\ndiv.teads-impact div.teads-ui-components-credits a::before,\ndiv.teads-inread div.teads-ui-components-credits a::after,\ndiv.teads-inboard div.teads-ui-components-credits a::after,\ndiv.teads-impact div.teads-ui-components-credits a::after {\n display: none !important;\n}\n",a.LABELCSS="\ndiv.teads-inread div.teads-ui-components-label,\ndiv.teads-inboard div.teads-ui-components-label,\ndiv.teads-expand div.teads-ui-components-label {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n color: #aaa;\n text-align: center !important;\n /*padding: 3px 0;*/\n text-transform: uppercase !important;\n height: 21px !important;\n line-height: 21px !important;\n letter-spacing: 0.3px !important;\n font-weight: 300 !important;\n}\n\ndiv.teads-inread div.teads-ui-components-label::before,\ndiv.teads-inboard div.teads-ui-components-label::before,\ndiv.teads-impact div.teads-ui-components-label::before,\ndiv.teads-inread div.teads-ui-components-label::after,\ndiv.teads-inboard div.teads-ui-components-label::after,\ndiv.teads-impact div.teads-ui-components-label::after {\n display: none !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-label,\ndiv.teads-inread.xs-screen div.teads-ui-components-label,\ndiv.teads-inboard.sm-screen div.teads-ui-components-label,\ndiv.teads-inboard.xs-screen div.teads-ui-components-label {\n font-size: 10px !important;\n}\n",a.EXPANDCSS="/** This will include vpaid-ui assets */\n\ndiv.teads-inread div.teads-ui-components-label,\ndiv.teads-inboard div.teads-ui-components-label,\ndiv.teads-expand div.teads-ui-components-label {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n color: #aaa;\n text-align: center !important;\n /*padding: 3px 0;*/\n text-transform: uppercase !important;\n height: 21px !important;\n line-height: 21px !important;\n letter-spacing: 0.3px !important;\n font-weight: 300 !important;\n}\n\ndiv.teads-inread div.teads-ui-components-label::before,\ndiv.teads-inboard div.teads-ui-components-label::before,\ndiv.teads-impact div.teads-ui-components-label::before,\ndiv.teads-inread div.teads-ui-components-label::after,\ndiv.teads-inboard div.teads-ui-components-label::after,\ndiv.teads-impact div.teads-ui-components-label::after {\n display: none !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-label,\ndiv.teads-inread.xs-screen div.teads-ui-components-label,\ndiv.teads-inboard.sm-screen div.teads-ui-components-label,\ndiv.teads-inboard.xs-screen div.teads-ui-components-label {\n font-size: 10px !important;\n}\n\n\ndiv.teads-inread div.teads-ui-components-credits,\ndiv.teads-inboard div.teads-ui-components-credits,\ndiv.teads-expand div.teads-ui-components-credits {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n color: #aaa !important;\n text-align: right !important;\n padding: 1px 0 !important;\n height: 26px !important;\n line-height: 26px !important;\n padding-right: 4px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a span,\ndiv.teads-inboard div.teads-ui-components-credits a span,\ndiv.teads-expand div.teads-ui-components-credits a span {\n display: inline !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a span,\ndiv.teads-inboard div.teads-ui-components-credits a span,\ndiv.teads-expand div.teads-ui-components-credits a span,\ndiv.teads-inread div.teads-ui-components-credits a,\ndiv.teads-inboard div.teads-ui-components-credits a,\ndiv.teads-expand div.teads-ui-components-credits a {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 11.5px !important;\n box-shadow: none !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-inboard.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-expand.sm-screen div.teads-ui-components-credits a span,\ndiv.teads-inread.sm-screen div.teads-ui-components-credits a,\ndiv.teads-inboard.sm-screen div.teads-ui-components-credits a,\ndiv.teads-expand.sm-screen div.teads-ui-components-credits a,\ndiv.teads-inread.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-expand.xs-screen div.teads-ui-components-credits a span,\ndiv.teads-inread.xs-screen div.teads-ui-components-credits a,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits a,\ndiv.teads-expand.xs-screen div.teads-ui-components-credits a {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-size: 9px !important;\n box-shadow: none !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread.sm-screen div.teads-ui-components-credits,\ndiv.teads-inboard.xs-screen div.teads-ui-components-credits {\n font-size: 9px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread .teads-ui-components-credits a,\ndiv.teads-inboard .teads-ui-components-credits a,\ndiv.teads-expand .teads-ui-components-credits a {\n color: #aaa !important;\n text-decoration: none !important;\n font-weight: 300 !important;\n border: none !important;\n letter-spacing: 0.3px !important;\n /*\n * From @jean-pierre.colomb comment on https://jira.teads.net/browse/TT-4076\n * The gqjapan.jp website overrides properties to add 2 orange squares\n * which affects the credits link\n */\n background: none !important;\n padding: 0 !important;\n}\n\ndiv.teads-inread.sm-screen .teads-ui-components-credits a,\ndiv.teads-inboard.sm-screen .teads-ui-components-credits a,\ndiv.teads-expand.sm-screen .teads-ui-components-credits a,\ndiv.teads-inread.xs-screen .teads-ui-components-credits a,\ndiv.teads-inboard.xs-screen .teads-ui-components-credits a,\ndiv.teads-expand.xs-screen .teads-ui-components-credits a{\n font-size: 9px !important;\n letter-spacing: 0.3px !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits span.teads-ui-components-credits-colored,\ndiv.teads-inboard div.teads-ui-components-credits span.teads-ui-components-credits-colored,\ndiv.teads-expand div.teads-ui-components-credits span.teads-ui-components-credits-colored {\n color: #79BBE9 !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits span::before,\ndiv.teads-inboard div.teads-ui-components-credits span::before,\ndiv.teads-impact div.teads-ui-components-credits span::before,\ndiv.teads-inread div.teads-ui-components-credits span::after,\ndiv.teads-inboard div.teads-ui-components-credits span::after,\ndiv.teads-impact div.teads-ui-components-credits span::after {\n display: none !important;\n}\n\ndiv.teads-inread div.teads-ui-components-credits a::before,\ndiv.teads-inboard div.teads-ui-components-credits a::before,\ndiv.teads-impact div.teads-ui-components-credits a::before,\ndiv.teads-inread div.teads-ui-components-credits a::after,\ndiv.teads-inboard div.teads-ui-components-credits a::after,\ndiv.teads-impact div.teads-ui-components-credits a::after {\n display: none !important;\n}\n\n\n.teads-expand {\n position: relative;\n}\n\n.teads-expand-closebutton {\n padding: 5px;\n text-align:center;\n color:white;\n cursor:pointer;\n position:absolute;\n top:5px;\n right:5px;\n width: 15px;\n height: 15px;\n padding: 0px;\n}\n\n.teads-expand-iframe {\n width: 100%;\n height: 100%;\n}\n\n.teads-expand-iframe iframe {\n border: 0px;\n width: 100%;\n height: 100%;\n background: #FFFFFF url({{assetsPath}}/default/img/loading.gif) no-repeat center center\n}\n\n.teads-expand-overlay {\n position: fixed;\n opacity: 0;\n background: #000000;\n border: 0;\n top: 0;\n left: 0;\n z-index: 2147483646;\n overflow: hidden;\n width: 100%;\n height: 100%;\n transition-property: opacity;\n -webkit-transition-property: opacity;\n -moz-transition-property: opacity;\n -o-transition-property: opacity;\n -ms-transition-property: opacity;\n transition-duration: {{transitionDuration}}ms;\n -webkit-transition-duration: {{transitionDuration}}ms;\n -moz-transition-duration: {{transitionDuration}}ms;\n -o-transition-duration: {{transitionDuration}}ms;\n -ms-transition-duration: {{transitionDuration}}ms;\n}\n\n.teads-expand-overlay.opened {\n opacity: 0.6\n}\n\n.teads-expand-container.opened {\n opacity: 1\n}\n\n.teads-expand-container {\n opacity: 0;\n position: fixed;\n background: #FFFFFF;\n border: 0;\n left: 0px;\n top: 0px;\n z-index: 2147483647;\n transition-property: opacity width height left top;\n -webkit-transition-property: opacity width height left top;\n -moz-transition-property: opacity width height left top;\n -o-transition-property: opacity width height left top;\n -ms-transition-property: opacity width height left top;\n transition-duration: {{transitionDuration}}ms;\n -webkit-transition-duration: {{transitionDuration}}ms;\n -moz-transition-duration: {{transitionDuration}}ms;\n -o-transition-duration: {{transitionDuration}}ms;\n -ms-transition-duration: {{transitionDuration}}ms;\n}\n\nbody.noscroll {\n overflow:hidden;\n}\n",a.EXPANDHTML='
\n
\n \n \n \n \n \n
\n
\n
\n \n
\n
\n',a.DISPLAYCSS='div.teads-display-absolute {\n position: absolute !important;\n overflow: hidden !important;\n z-index: 2 !important;\n pointer-events: none !important;\n}\n\n.teads-display-fixed {\n position: fixed !important;\n background-repeat: repeat-y !important;\n}\n\n.teads-display-format {\n /* PUT NOTHING HERE */\n}\n\n.teads-display-clickzone {\n display: block !important;\n position: absolute !important;\n top: 0px !important;\n width: 100% !important;\n height: 100% !important;\n}\n\n/******************************************************************************\n * Start closebutton and countdownclosebutton styles\n *****************************************************************************/\n div.teads-display-format .icon-close {\n \twidth: 11px !important;\n \theight: 11px !important;\n \tbackground-position: -80px 0 !important;\n background-size: 650px 40px !important;\n background-image: url("{{assetsPath}}/default/player-sprite.svg") !important;\n }\n\n div.teads-display-format .xs-screen .icon-close, div.teads-display-format .sm-screen .icon-close {\n \twidth: 11px !important;\n \theight: 11px !important;\n \tbackground-position: -80px 0 !important;\n }\n\n/*div.teads-display-format .teads-ui-component-closebutton {\n position: absolute !important;\n top: 0px !important;\n right: 0px !important;\n padding: 15px !important;\n transition: opacity 175ms linear !important;\n}*/\n\n/** disable SVG animation on closebutton countdown */\ndiv.teads-display-format .teads-ui-component-closebutton svg {\n display: none !important;\n}\n\ndiv.teads-ui-component-closebutton .components-countdown {\n display: none !important;\n position: absolute !important;\n left: 2px !important;\n bottom: 20px !important;\n}\n\n/** White countdown */\ndiv.teads-display-format .teads-ui-component-closebutton .components-countdown .countdown-circle>li {\n color: #FFFFFF !important;\n}\n\ndiv.teads-display-format .teads-ui-component-closebutton .components-countdown .show {\n display: block !important;\n}\n\ndiv.teads-display-format .teads-ui-component-closebutton .show {\n display: block !important;\n}\n\ndiv.teads-display-format .teads-ui-component-closebutton .show .close-button {\n opacity: .8 !important;\n}\n\ndiv.teads-display-format .teads-ui-component-closebutton .show:hover .close-button.show {\n opacity: 1 !important;\n}\n\ndiv.teads-display-format .sm-screen .teads-ui-component-closebutton .closebutton,\ndiv.teads-display-format .xs-screen .teads-ui-component-closebutton .closebutton {\n padding: 10px 10px 15px 15px !important;\n}\n', a.COUNTDOWNCSS="/**\n * Use default CSS defined in countdow.html\n */\n\n.teads-countdown {\n width: 100%;\n height: 100%;\n}\n\n.teads-countdown-container {\n width: 100%;\n height: 100%;\n}\n\n.teads-countdown-number {\n font-family: 'Helvetica', Arial, sans-serif !important;\n font-weight: 300;\n font-size: 30px;\n}\n\n.teads-countdown-circle-background {\n opacity: .8;\n stroke-width: 1px;\n}\n\n.teads-countdown-circle {\n position: absolute;\n width: 100px;\n height: 100px;\n}\n\n.teads-countdown-fsicon {\n width: 20px;\n height: 20px;\n position: absolute;\n top: 10px;\n right: 10px;\n}\n\n.teads-countdown-background {\n background-color: #000000;\n opacity: .6;\n width: 100%;\n height: 100%;\n}\n\n.teads-countdown-clickzone {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n",a.COUNTDOWNHTML='
\n
\n
\n \n \n \n \n 3\n \n
\n
\n \n \n \n
\n
\n',a}();a.Template=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(a,b){this.className=a,this.css=b}return b.prototype.initElement=function(){this.element=document.createElement("div"),this.element.className=this.className,this.element.innerHTML=this.getInnerHtml()},b.prototype.getElement=function(){return this.element},b.prototype.getHTML=function(){var a=this.getInnerHtml();if(a)return'
'+a+"
"},b.prototype.getCSS=function(){return a.ui.TemplateHelper.replacePlaceholders(this.css,{assetsPath:a.ASSETS_URL+"/assets"})},b.prototype.getInnerHtml=function(){return this.isEnabled()?this.innerHTML:""},b.prototype.hide=function(){this.element&&(this.element.style.display="none")},b.prototype.show=function(){this.element&&(this.element.style.display="block")},b}();b.AbstractComponent=c}(b=a.component||(a.component={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(c){b.call(this,"teads-ui-components-label",a.Template.LABELCSS),this.label=c,this.innerHTML=this.label.getText(),this.initElement()}return __extends(c,b),c.prototype.isEnabled=function(){return this.label.isEnabled()},c}(b.AbstractComponent);b.Label=c}(b=a.component||(a.component={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(c){b.call(this,"teads-ui-components-credits",a.Template.CREDITSCSS),this.config=c;var d=/\[([^\]]*)\]/g,e=this.config.getText().replace(d,'$1'),f=this.config.getLink()||"http://teads.tv/en";this.innerHTML='
'+e+"",this.initElement()}return __extends(c,b),c.prototype.isEnabled=function(){return this.config.isEnabled()},c}(b.AbstractComponent);b.Credits=c}(b=a.component||(a.component={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(a){var b=function(){function a(a){this.components=a}return a.prototype.getComponent=function(a){return this.components.hasOwnProperty(a)?this.components[a]:null},a.prototype.showComponent=function(a){this.components.hasOwnProperty(a)&&this.components[a].show()},a.prototype.hideComponent=function(a){this.components.hasOwnProperty(a)&&this.components[a].hide()},a.prototype.showAllComponents=function(){for(var a in this.components)this.components.hasOwnProperty(a)&&this.components[a].show()},a.prototype.hideAllComponents=function(){for(var a in this.components)this.components.hasOwnProperty(a)&&this.components[a].hide()},a}();a.Components=b}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b){var c=this;if(this.abstractFormat=b,this.isLandscape=!1,this.logger=new a.Logger("Format.Responsive"),this.orientationChangeListeners=[],this.resizeListeners=[],this.vpaidAd=b.getVpaidAd(),this.mainContainer=b.parentContainer,this.formatContainer=b.placement.getInnerContainer(),this.mediafile=b.player.getMediafile(),this.win=b.placement.placementConfig.parentWindow.getWindow(),this.linearAd=b.linearAd,this.vpaidAd.subscribe(function(){c.unsetResponsive()},a.vpaid.VPAIDEvent.AdError),this.vpaidAd.subscribe(function(){c.unsetResponsive()},a.vpaid.VPAIDEvent.AdStopped),a.Context.isMobile()||a.Context.isTablet()){var d=function(b){var d=a.Dom.getWindowSize(c.win);c.isLandscape=d.width>d.height};d(),this.addOrientationChangeListener(d),this.addOrientationChangeListener(function(){c.isNativeFullscreen()&&c.resize()});var e=function(a){c.win.setTimeout(function(){c.onOrientationChange(a)},200)};a.Dom.addEventListener("orientationchange",this.win,e),this.vpaidAd.subscribe(function(){a.Dom.removeEventListener("orientationchange",c.win,e)},a.vpaid.VPAIDEvent.AdStopped)}}return b.prototype.resizeOnStart=function(){var b=this;this.vpaidAd.subscribe(function(a){b.logger.debug("Receive metadata from video"),a.width&&a.height&&(b.mediafile.width!==a.width||b.mediafile.height!==a.height)&&(b.logger.debug("video size is different from VAST mediafile, force resize to good dimensions"),b.mediafile.width=a.width,b.mediafile.height=a.height,b.resize(!0))},a.vpaid.CustomVPAIDEvent.AdVideoMetadata),this.vpaidAd.subscribe(function(){return b.resize(!0)},a.vpaid.VPAIDEvent.AdVideoStart),this.vpaidAd.subscribe(function(){return b.resize(!0)},a.vpaid.VPAIDEvent.AdStarted)},b.prototype.setMainContainer=function(a){this.mainContainer=a,this.iframe&&(this.unsetResponsive(),this.setResponsive())},b.prototype.setResponsive=function(){var b=this;this.iframe||(this.iframe=document.createElement("iframe"),this.iframe.style.height="0",this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.margin="0",this.iframe.style.padding="0",this.mainContainer.appendChild(this.iframe),this.iframe.contentWindow.document.write(""),this.iframe.contentWindow.document.close(),this.resizeCallback=function(){return b.resize()},a.Dom.addEventListener("resize",this.iframe.contentWindow,this.resizeCallback),this.teadsStudio=a.player.TeadsStudioExtension.get(this.linearAd),this.resize())},b.prototype.unsetResponsive=function(){return!!this.iframe&&(a.Dom.removeEventListener("resize",this.iframe.contentWindow,this.resizeCallback),this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,!0)},b.prototype.addOrientationChangeListener=function(b){a.ArrayHelper.indexOf(this.orientationChangeListeners,b)<0&&this.orientationChangeListeners.push(b)},b.prototype.addResizeListener=function(b){a.ArrayHelper.indexOf(this.resizeListeners,b)<0&&this.resizeListeners.push(b)},b.prototype.getOptimalDimension=function(b,c){void 0===b&&(b=this.mainContainer),void 0===c&&(c=1);var d=a.Dom.getWindowSize(this.win),e=this.getContainerWidth(b),f=a.player.MediaFileHelper.getOptimalHeight(this.mediafile,e,!!this.teadsStudio),g={width:this.vpaidAd.getAdWidth(),height:this.vpaidAd.getAdHeight()};if(f>c*d.height){var h=d.height/f;g.width=h*e*c,g.height=c*d.height}else g.width===e&&g.height===f||(g.width=e,g.height=this.isFullscreen()?d.height:f);return g.width=Math.round(g.width),g.height=Math.round(g.height),g},b.prototype.resize=function(b,c){void 0===b&&(b=!1),void 0===c&&(c=this.mainContainer);var d,e={width:this.vpaidAd.getAdWidth(),height:this.vpaidAd.getAdHeight()},f=this.getContainerWidth(c),g=this.getOptimalDimension(),h=a.Dom.getWindowSize(this.win),i=!1;this.isNativeFullscreen()||this.isFullscreen()&&b?e.height===h.height&&e.width===h.width||(this.logger.debug("fullscreen resize from "+e.width+"x"+e.height+" to "+h.width+"x"+h.height),this.vpaidAd.resizeAd(h.width,h.height,"fullscreen"),i=!0):(b||e.height!==g.height||e.width!==g.width)&&(d=g.width>=f?0:(f-g.width)/2,this.formatContainer.style.marginLeft=d+"px",this.formatContainer.style.marginRight=this.formatContainer.style.marginLeft,this.logger.debug("resize from "+e.width+"x"+e.height+" to "+g.width+"x"+g.height),this.vpaidAd.resizeAd(g.width,g.height,this.isFullscreen()?"fullscreen":"normal"),i=!0),i&&this.onResize()},b.prototype.isFullscreen=function(){return a.HTMLHelper.hasClass(this.vpaidAd.getMainComponentsContainer(),"fullscreen")},b.prototype.isNativeFullscreen=function(){return a.HTMLHelper.isFullscreen(this.win.document)},b.prototype.onOrientationChange=function(b){a.ArrayHelper.forEach(this.orientationChangeListeners,function(a){a(b)})},b.prototype.onResize=function(){var b=this;this.win.setTimeout(function(){a.ArrayHelper.forEach(b.resizeListeners,function(a){a()})},100)},b.prototype.getContainerWidth=function(b){return void 0===b&&(b=this.mainContainer),this.isFullscreen()?a.Dom.getWindowSize(this.win).width:Math.round(a.Dom.getBoundingClientRect(b).width)},b}();b.Responsive=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){!function(a){a[a.Error=0]="Error",a[a.AdError=1]="AdError",a[a.ResizeAmpError=2]="ResizeAmpError",a[a.ReplayError=3]="ReplayError",a[a.AdSuccess=4]="AdSuccess",a[a.NoAdSuccess=5]="NoAdSuccess"}(b.EXIT_STATUS||(b.EXIT_STATUS={}));var c=b.EXIT_STATUS,d=function(){function b(b,c,d,e){this.placement=b,this.formatConfig=c,this.player=d,this.slotType=e,this.states={hasOpened:!1,isReady:!1,hasStarted:!1,hasStopped:!1,hasCompleted:!1,isReplay:!1,isPlaying:!1},this.adWidth=0,this.adHeight=0,this.adDuration=-2,this.adRemainingTime=NaN,this.isVertical=!1,this.campaignToTest=/^(29690|29686|30201|31079|29605|25615|31856|33457)$/,this.logger=new a.Logger("format"),this.logger.debug("new",c.formatName.get()),this.linearAd=this.player?this.player.getLinearAd():null,a.helper.Amp.setCreativeInformation(this.linearAd),this.parentContainer=this.placement.getParentContainer(),this.playerContainer=this.placement.getPlayerContainer(),this.win=b.placementConfig.parentWindow.getWindow(),this.teadsStudio=a.player.TeadsStudioExtension.get(this.linearAd),this.eventListenerManager=new a.EventListenerManager,this.volumeController=new a.helper.VolumeController,this.initComponents(),this.vpaidApi=new a.VPAIDApi(b)}return b.prototype.initComponents=function(){var b=this,c=function(){for(var a=[],c=0;c0&&this.adRemainingTime>=0?this.adDuration-this.adRemainingTime:0},b.prototype.getEnvironmentVars=function(){return this.env},b.prototype.close=function(b){var c=this;if(!this.states.hasStopped){this.states.hasStopped=!0;var d=function(){c.components.hideAllComponents(),c.formatConfig.animations.setCollapseDuration(c.parentContainer),c.parentContainer.style.height="0"};!this.states.hasOpened||a.Semver.isLowerOrEqual(a.Context.getIEVersion(),"9")||a.Context.isAmp()?(d(),this.exit(b)):(this.eventListenerManager.addMultiple(["transitionend","otransitionend","oTransitionEnd","webkitTransitionEnd"],this.parentContainer,function(){return c.exit(b)}),d())}},b.prototype.start=function(){var b=this,c=function(c,d){a.formatSumologic.sendInfo({pid:b.placement.pid,track:"adAvailable-success"}),b.placement.placementTracker.track(a.Constant.TRACKING.adAvailable.success),b.addCustomTracking(window._ttc),b.logger.debug("VPAID started",c,d),b.vpaidAd=c,b.mediafile=b.player.getMediafile(),b.onVpaidReady(),b.env={},c.initAd(d.width,d.height,d.mode,d.bitrate,d.parameters,b.env)},d=function(c){a.formatSumologic.sendError({pid:b.placement.pid,message:"Error when loading mediafile|"+c.getMessage().substr(0,120)}),b.placement.placementTracker.track(a.Constant.TRACKING.adAvailable.error.vast.replace(/\{code\}$/,String(c.getId()))),b.logger.error("VPAID play:",c),b.placement.handleNoAd()};this.mediafile?this.player.loadMediaFile(this.mediafile,c,d):this.player.loadOptimalMediaFile(c,d)},b.prototype.initInternalResponsive=function(){return!(!this.player||!this.vpaidAd)&&(this.player.getPlugin("Responsive").deinit(),this.responsive=new a.helper.Responsive(this),!0)},b.prototype.onVpaidReady=function(){var d=this;this.vpaidAd.subscribe(function(){d.states.isReady=!0,a.Context.isAmp()&&!a.helper.Amp.isOpen()&&(a.formatSumologic.sendInfo("AMP resize open request"),a.helper.Amp.renderStart(),a.helper.Amp.open(function(b){if(!b){d.close(c.ResizeAmpError),d.unlistenAmp();var e="AMP resize open request denied";a.formatSumologic.sendInfo(e),d.logger.info("AdLoaded",e),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(3,4,e,a.Wigo.infoType.ERROR)}},function(){var a=window._teads_amp.change;return!(a.boundingClientRect.top>=a.rootBounds.height)})),d.volumeController.mute(),d.eventListenerManager.add("mouseover",d.parentContainer,function(){return d.volumeController.onMouseOver()}),d.eventListenerManager.add("mouseout",d.parentContainer,function(){return d.volumeController.onMouseOut()}),d.vpaidAd.render(d.vpaidAd.getVPAID())},a.vpaid.VPAIDEvent.AdLoaded),this.vpaidAd.subscribe(function(){d.teadsStudio?d.brandingMode.deinit():d.brandingMode.init()},a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.subscribe(function(){d.close(c.AdSuccess)},a.vpaid.VPAIDEvent.AdStopped),this.vpaidAd.subscribe(function(){d.states.hasCompleted=!0},a.vpaid.VPAIDEvent.AdVideoComplete),this.initInternalResponsive(),this.isVertical=this.player.getMediafile().height>b.VERTICAL_MARGIN*this.player.getMediafile().width,a.ArrayHelper.forEach(this.linearAd.extensions,function(b){"MoatJs"===b.type&&d.campaignToTest.test(b.definition.id)&&(d.formatConfig.volume=new a.option.Volume({main:d.formatConfig.volume.getMain(),mouseover:d.formatConfig.volume.getMouseover(),fadeDuration:0}))}),this.volumeController.init(this),this.volumeController.mute();var e=function(){if(d.logger.debug("Format is visible"),!d.states.hasStopped&&d.states.hasOpened&&d.states.hasStarted){var b;b=d.formatConfig.videoPause.isThreshold()||d.states.hasCompleted?!a.HTMLHelper.isInView(d.vpaidAd.getContainer(),d.win,d.formatConfig.threshold.get()/100,null):!d.formatConfig.videoPause.isNo(),b||d.vpaidAd.resumeAd(),d.logger.debug("onVisible mustPause",b)}},f=function(){d.logger.debug("Format is hidden"),d.states.hasStarted&&d.states.isPlaying&&(!d.formatConfig.videoPause.isNo()||d.states.hasCompleted?d.vpaidAd.pauseAd():!d.formatConfig.soundMute.isNo()&&d.volumeController.getVolume()>0&&d.volumeController.mute())};this.linearAd.clickThrough&&this.linearAd.clickThrough.length&&this.vpaidAd.subscribe(function(){return f()},a.vpaid.VPAIDEvent.AdClickThru),this.visibility=a.Visibility.listenWindow(this.win,e,f),this.vpaidAd.subscribe(function(){d.env.videoSlot&&d.env.videoSlot.audio&&!d.env.videoSlot.audio.authorized?d.env.videoSlot.audio.authorizeAudio(function(){return d.volumeController.toggleVolume()}):d.volumeController.toggleVolume()},a.vpaid.ui.VPAIDUIEvent.SoundToggleRequest),this.vpaidAd.subscribe(function(){d.replay(),a.formatSumologic.sendInfo("click-replay "+a.Context.getContextSummary(),null,1)},a.vpaid.ui.VPAIDUIEvent.ReplayRequest),this.vpaidAd.subscribe(function(){d.close(c.AdSuccess)},a.vpaid.ui.VPAIDUIEvent.CloseRequest),this.vpaidAd.subscribe(function(b){var e="string"==typeof b?b:b.message?b.message:a.JSON.stringify(b),f=d.player.getLinearAd();a.formatSumologic.sendError({aid:f?f.id:-1,pid:d.placement.pid,message:"AdError: "+e}),d.logger.error("AdError:",e),d.close(c.AdError)},a.vpaid.VPAIDEvent.AdError);var g=function(a){return function(){d.formatConfig.callbacks.trigger(a,d.volumeController,d.fullscreenHelper)}};for(var h in a.vpaid.VPAIDEvent)a.vpaid.VPAIDEvent.hasOwnProperty(h)&&this.vpaidAd.subscribe(g(h),h);this.vpaidAd.subscribe(function(){d.states.hasStarted=!0,d.placement.placementConfig.capping.record(),d.volumeController.mute()},a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.subscribe(function(){d.states.hasCompleted=!1,d.states.isPlaying=!0,d.volumeController.onAdVideoStart()},a.vpaid.VPAIDEvent.AdVideoStart),this.vpaidAd.subscribe(function(){d.states.isPlaying=!1,d.unsetVisibility()},a.vpaid.VPAIDEvent.AdStopped),this.vpaidAd.subscribe(function(){d.states.isPlaying=!1},a.vpaid.VPAIDEvent.AdPaused),this.vpaidAd.subscribe(function(){d.states.isPlaying=!0},a.vpaid.VPAIDEvent.AdPlaying),this.vpaidAd.subscribe(function(){a.HTMLHelper.isInView(d.vpaidAd.getContainer(),d.win,d.formatConfig.threshold.get()/100,null)||(d.logger.debug("The video completed but it's not in view, pause it."),d.vpaidAd.pauseAd()),d.visibility&&!d.visibility.isEnabled()&&(d.visibility.enable(),d.visibility.isVisible()||f())},a.vpaid.ui.VPAIDUIEvent.EndscreenInit),this.vpaidAd.subscribe(function(){return d.onSizeChange()},a.vpaid.VPAIDEvent.AdSizeChange),this.vpaidAd.subscribe(function(){return d.onSizeChange()},a.vpaid.VPAIDEvent.AdLoaded),this.vpaidAd.subscribe(function(){return d.updateParentContainerClass()},a.vpaid.VPAIDEvent.AdSizeChange),this.vpaidAd.subscribe(function(){return d.updateParentContainerClass()},a.vpaid.VPAIDEvent.AdStarted),this.vpaidAd.subscribe(function(){return d.onDurationChange()},a.vpaid.VPAIDEvent.AdDurationChange),this.vpaidAd.subscribe(function(){return d.onTimeChange()},a.vpaid.VPAIDEvent.AdRemainingTimeChange),this.responsive&&this.responsive.resizeOnStart()},b.prototype.onTimeChange=function(){this.adRemainingTime=this.vpaidAd.getAdRemainingTime()},b.prototype.onDurationChange=function(){this.adDuration=this.vpaidAd.getAdDuration(),this.onTimeChange()},b.prototype.onSizeChange=function(){this.adWidth=this.vpaidAd.getAdWidth(),this.adHeight=this.vpaidAd.getAdHeight()},b.prototype.updateParentContainerClass=function(){var b=this;if(this.vpaidAd){var c=a.Dom.getBoundingClientRect(this.parentContainer).width;a.ArrayHelper.forEach([a.Constant.RESPONSIVE.xs.className,a.Constant.RESPONSIVE.sm.className],function(c){a.HTMLHelper.removeClass(b.parentContainer,c)}),c<=a.Constant.RESPONSIVE.xs.size?a.HTMLHelper.addClass(this.parentContainer,a.Constant.RESPONSIVE.xs.className):c<=a.Constant.RESPONSIVE.sm.size&&a.HTMLHelper.addClass(this.parentContainer,a.Constant.RESPONSIVE.sm.className)}},b.prototype.replay=function(){this.logger.debug("replay called"),this.placement.placementTracker.track("click-replay"),a.formatSumologic.sendInfo("click-replay "+a.Context.getContextSummary(),!0),this.volumeController.replay();try{var b=this.player.getPlugin("Responsive");b.unsetResponsive(),this.player.setLinearAd(this.linearAd),this.responsive&&this.responsive.unsetResponsive(),this.unsetVisibility(),this.states.isReady=!0,this.states.hasOpened=!0,this.states.hasStarted=!1,this.states.hasStopped=!1,this.states.hasCompleted=!1,this.states.isReplay=!0,this.vpaidAd=null,a.vpaid.BaseVPAIDJSWrapper.hasLogged=[],a.Context.isDesktop()&&this.formatConfig.videoStart.isClick()&&(this.formatConfig.videoStart=new a.option.VideoStart(a.option.VideoStart.DEFAULT,this.formatConfig.formatName,this.formatConfig.smartPosition)),this.start()}catch(d){this.logger.error("Replay callback threw an exception",d),this.close(c.ReplayError)}},b.prototype.unsetVisibility=function(){this.visibility&&(this.visibility.destroy(),this.visibility=null)},b.prototype.addCustomTracking=function(b){var c=this;void 0===b&&(b={});var d=this.player.getPlugin("Tracker"),e=d.getTracker();for(var f in b)if(b.hasOwnProperty(f)){var g=b[f].trackings||[];a.ArrayHelper.forEach(g,function(a){var b=a.event;"progress"!==b?e.addResource(b,a.url):c.logger.warn("Custom tracking cannot be handled",a)})}},b.VERTICAL_MARGIN=1.05,b}();b.AbstractFormat=d}(b=a.format||(a.format={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(b,d,e){c.call(this,b,d,e,a.Constant.SLOT_TYPE.native),this.placement=b,this.config=d,this.player=e,this.trackPlayNiv=!1,this.facebookPercentInView=0,a.Context.isFacebookIA()&&this.initFacebookIA()}return __extends(d,c),d.prototype.load=function(){var b=this;a.Context.isIABSafeFrame()?a.helper.SafeFrameResize.initSlot(function(){return b.start()}):this.start()},d.prototype.getTemplateName=function(){return"inread"},d.prototype.start=function(){var b=this,d=this.placement.placementConfig.scrollSelector.getSlot();a.Context.isIABSafeFrame()?a.helper.SafeFrameResize.listenGeom(function(){return b.onScroll(new Event("touchmove"))}):a.Context.isAmp()?this.unlistenAmp=this.win.context.observeIntersection(function(a){return b.onScroll(new Event("touchmove"))}):(this.eventListenerManager.add("scroll",d,function(a){return b.onScroll()}),this.eventListenerManager.addMultiple(["touchstart","touchmove","touchend"],d,function(a){return b.onScroll(a)})),this.isInView=this.getInViewState(),this.formatConfig.vast.getContent()?c.prototype.start.call(this):this.onScroll()},d.prototype.onVpaidReady=function(){var b=this;c.prototype.onVpaidReady.call(this),this.vpaidAd.subscribe(function(){if(b.fullscreenHelper.addCloseEventListener(function(){b.isSmartPositionned()||b.responsive&&b.responsive.resize(!0)}),b.isVertical){var c=function(){b.responsive.unsetResponsive(),b.parentContainer.style.display="none",b.isInView=!1,b.vpaidAd.pauseAd()};b.responsive.addOrientationChangeListener(function(a){b.isFullscreen()||(b.responsive.isLandscape?c():(b.parentContainer.style.display="block",b.responsive.setResponsive(),b.onScroll(a)))}),b.fullscreenHelper.addCloseEventListener(function(){b.responsive&&b.responsive.isLandscape&&c()})}a.Context.isDesktop()||b.vpaidAd.render(b.vpaidAd.getVPAID()),!a.Context.isIABSafeFrame()&&!a.Context.isFacebookIA()||b.states.hasOpened||b.openFormat(),b.onScroll(),b.isInView=b.getInViewState()},a.vpaid.VPAIDEvent.AdLoaded),a.ArrayHelper.forEach(this.linearAd.extensions,function(c){"MoatJs"===c.type&&b.campaignToTest.test(c.definition.id)&&b.vpaidAd.subscribe(function(){b.isInView=b.getInViewState()},a.vpaid.VPAIDEvent.AdStarted)}),this.vpaidAd.subscribe(function(){b.formatConfig.smartPosition.isEnabled()&&b.smartPositionHelper.init(),b.states.hasStarted&&b.states.hasOpened&&b.fitContainerToContent()},a.vpaid.VPAIDEvent.AdVideoStart),this.vpaidAd.subscribe(function(){b.states.hasStarted&&b.states.hasOpened&&b.fitContainerToContent()},a.vpaid.VPAIDEvent.AdSizeChange),this.fullscreenHelper=new a.helper.FullscreenHelper(this.parentContainer,this.vpaidAd,this.visibility,this.components,this.responsive,this.win),this.brandingMode=new a.helper.BrandingMode(this),this.formatConfig.smartPosition.isEnabled()&&!this.isVertical&&(this.smartPositionHelper=new a.helper.SmartPosition(this)),this.vpaidAd.subscribe(function(){b.smartPositionHelper&&b.smartPositionHelper.deinit()},a.vpaid.VPAIDEvent.AdVideoComplete)},d.prototype.startInView=function(){this.states.hasStarted&&(this.formatConfig.videoPause.isThreshold()||this.isVertical||this.states.hasCompleted)&&this.vpaidAd.resumeAd(),this.volumeController.startInView()},d.prototype.endInView=function(){this.formatConfig.videoPause.isThreshold()&&!this.formatConfig.smartPosition.isEnabled()||this.states.hasCompleted?this.vpaidAd.pauseAd():this.volumeController.endInView()},d.prototype.fitContainerToContent=function(b){if(void 0===b&&(b=!1),this.teadsStudio&&this.teadsStudio.display);else if(a.Context.isIos()&&this.env&&this.env.videoSlot&&this.env.videoSlot.canvasPlayer){var c=this.env.videoSlot.mediaProxy,d=c.getStatus();if(d!==a.video.constant.MediaProxyStatus.READY)return}if((this.states.hasOpened||b)&&!this.isFullscreen()){var e=a.Dom.getBoundingClientRect(this.placement.getInnerContainer()),f=e.height;if(a.Context.isFacebookIA()){var g=a.Dom.getBoundingClientRect(this.playerContainer).height;f+=0===g?e.width/a.Constant.DEFAULT_VIDEO_SIZE_RATIO:0}return this.parentContainer.style.height=f+"px",f}},d.prototype.manageInView=function(a){a!==this.isInView&&(a?this.startInView():this.endInView()),this.isInView=a},d.prototype.openFormat=function(){var b=this;if(this.states.hasOpened=!0,this.placement.placementConfig.css.applyRulesOn(this.parentContainer),this.formatConfig.animations.setExpandDuration(this.parentContainer),this.teadsStudio&&this.teadsStudio.display);else if(a.Context.isIos()&&this.env&&this.env.videoSlot&&this.env.videoSlot.canvasPlayer){var c=this.env.videoSlot.mediaProxy,d=c.getStatus();if(d===a.video.constant.MediaProxyStatus.READY)this.logger.debug("mediaProxy is ready !",this.env.videoSlot.src);else{if(d===a.video.constant.MediaProxyStatus.ERROR)return void this.logger.error("mediaProxy error, video is not available for the moment",this.env.videoSlot.src);if(!this.env.videoSlot.src||dthis.formatConfig.threshold.get();var b=this.vpaidAd?this.vpaidAd.getAdHeight():1;return a.HTMLHelper.isInView(this.playerContainer,this.win,this.formatConfig.threshold.get()/100,b)},d.prototype.initFacebookIA=function(){var b=this;this.eventListenerManager.add("message",this.win,function(a){b.facebookPercentInView=b.getFacebookPercentInView(a.data),b.states.isReady&&b.startFacebookIA()}),this.win.removeEventListener("message",window._teads_fbia.listener,!0);var c=a.ArrayHelper.map(window._teads_fbia.events||[],function(a){return b.getFacebookPercentInView(a)});c=a.ArrayHelper.filter(c,function(a){return 0!==a});var d=c.length;d>0&&(this.facebookPercentInView=c[d-1])},d.prototype.getFacebookPercentInView=function(b){ var c=0;switch(b){case a.Constant.FACEBOOK_IA.exitsViewport:c=-1;break;case a.Constant.FACEBOOK_IA.entersViewport:c=1;break;case a.Constant.FACEBOOK_IA.centerExitsViewport:c=49;break;case a.Constant.FACEBOOK_IA.centerEntersViewport:c=51;break;default:c=0}return c},d.prototype.startFacebookIA=function(){var a=this.getInViewState();this.states.hasOpened?this.states.isReplay&&this.responsive&&this.responsive.setResponsive():(this.formatConfig.launch.isAuto()||this.formatConfig.launch.isThreshold()&&a)&&this.openFormat(),this.states.hasStarted||(!this.formatConfig.videoStart.isThreshold()||a||this.formatConfig.smartPosition.isEnabled()||this.states.isReplay)&&this.vpaidAd.startAd(),this.manageInView(a)},d}(b.AbstractFormat);b.Inread=c}(b=a.format||(a.format={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function a(){this.version=1,this.creative=new e,this.tracking=new d,this.clickThrough=[],this.expand=[],this.title=""}return a}();b.Ad=c;var d=function(a){function b(){a.apply(this,arguments),this.open=[],this.visible=[]}return __extends(b,a),b}(a.vast.TrackingDefinition);b.DisplayTrackingDefinition=d;var e=function(){function a(){this.asset=new f}return a}();b.DisplayCreative=e;var f=function(){function a(){this.width=0,this.height=0}return a}();b.DisplayAsset=f}(b=a.display||(a.display={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b,d,e,f,g){void 0===d&&(d=document.body),void 0===e&&(e=10),void 0===f&&(f=400),this.iframeUrl=b,this.fromElement=d,this.margin=e,this.transitionDuration=f,this.scope=g,this.css=a.Template.EXPANDCSS,this.content=a.ui.TemplateHelper.replacePlaceholders(a.Template.EXPANDHTML,{iframeurl:b,assetsPath:a.ASSETS_URL+"/assets"}),g||(this.scope=a.HTMLHelper.findParentWindows(window.document.body).pop()),this.background=this.scope.document.createElement("div"),this.background.style.display="none",this.background.className="teads-expand-overlay open",this.scope.document.body.appendChild(this.background),this.container=this.scope.document.createElement("div"),this.container.style.display="none",this.container.className="teads-expand-container",this.scope.document.body.appendChild(this.container),this.setCSS(this.css),this.contentContainer=document.createElement("div"),this.contentContainer.className=c.CSSCLASSES.expandContentContainer,this.contentContainer.innerHTML=this.content,this.container.appendChild(this.contentContainer)}return c.openExpand=function(d,e,f,g,h){var i=new b.ExpandHelper(f,d),j=i.getContentElement(),k=a.Dom.getElementsByClassName(c.CSSCLASSES.expandLabel,j)[0],l=a.Dom.getElementsByClassName(c.CSSCLASSES.expandCredit,j)[0],m=function(a,b){if(a){var c=b.getHTML();!c&&a.parentNode?a.parentNode.removeChild(a):a.innerHTML=c}};m(k,new a.component.Label(e.label)),m(l,new a.component.Credits(e.credits));var n=function(){var b=a.Dom.getElementsByClassName(c.CSSCLASSES.expandIframe,j)[0],d=a.Dom.getElementsByClassName(c.CSSCLASSES.expand,j)[0],e=a.Dom.getBoundingClientRect(d).height,f=i.getContainerHeight()-e+a.Dom.getBoundingClientRect(b).height;b.style.width=i.getContainerWidth()+"px",b.style.height=f+"px"};i.open(function(){n(),g&&b.MediaUtils.isFunction(g)&&g()},function(){return n()});var o=a.Dom.getElementsByClassName(c.CSSCLASSES.expandCloseButton,j)[0];a.Dom.addEventListener("click",o,function(){i.close(function(){h&&b.MediaUtils.isFunction(h)&&h(),i.destroy()})})},c.prototype.setCSS=function(b){this.css=b;var d=this.scope.document.getElementById(c.styleNodeId);d&&d.parentNode.removeChild(d);var e=document.createElement("style");e.setAttribute("id",c.styleNodeId),e.appendChild(this.scope.document.createTextNode(a.ui.TemplateHelper.replacePlaceholders(this.css,{transitionDuration:this.transitionDuration,assetsPath:a.ASSETS_URL+"/assets"})));var d=this.scope.document.head||this.scope.document.body||this.background;d.appendChild(e)},c.prototype.open=function(b,c){var d=this;if(!this.opened){this.opened=!0,this.contentContainer.style.display="none",this.background.style.display="block",this.fitContainerToElement(this.fromElement),this.container.style.display="block";var e=function(a){c&&c()};setTimeout(function(){a.HTMLHelper.addClass(d.background,"opened"),a.HTMLHelper.addClass(d.container,"opened"),d.container.style.top=d.margin+"px",d.container.style.left=d.margin+"px",d.updateSize(),setTimeout(function(){a.HTMLHelper.addClass(d.scope.document.body,"noscroll"),e(),d.contentContainer.style.display="block",b&&"function"==typeof b&&b()},d.transitionDuration)},10);var f=function(){d.updateSize(),e()};this.resizeWindowListener=f,a.Dom.addEventListener("resize",this.scope,f)}},c.prototype.close=function(c){var d=this;this.opened&&(this.resizeWindowListener&&(a.Dom.removeEventListener("resize",this.scope,this.resizeWindowListener),this.resizeWindowListener=null),this.contentContainer.style.display="none",a.HTMLHelper.removeClass(this.scope.document.body,"noscroll"),this.fitContainerToElement(this.fromElement),a.HTMLHelper.removeClass(this.background,"opened"),a.HTMLHelper.removeClass(this.container,"opened"),setTimeout(function(){d.background.style.display="none",d.container.style.display="none",d.opened=!1,c&&b.MediaUtils.isFunction(c)&&c()},this.transitionDuration))},c.prototype.destroy=function(){this.container.parentNode.removeChild(this.container),this.background.parentNode.removeChild(this.background);var a=this.scope.document.getElementById(c.styleNodeId);a.parentNode.removeChild(a)},c.prototype.isOpened=function(){return!!this.opened},c.prototype.updateSize=function(){this.container.style.width=this.getContainerWidth()+"px",this.container.style.height=this.getContainerHeight()+"px"},c.prototype.getContentElement=function(){return this.container},c.prototype.getContainerWidth=function(){return this.scope.innerWidth-2*this.margin},c.prototype.getContainerHeight=function(){return this.scope.innerHeight-2*this.margin},c.prototype.fitContainerToElement=function(b){var c=a.Dom.getBoundingClientRect(b);this.container.style.position="fixed",this.container.style.top=c.top+"px",this.container.style.left=c.left+"px",this.container.style.width=c.width+"px",this.container.style.height=c.height+"px"},c.styleNodeId="teads-expand-helper-style",c.CSSCLASSES={expand:"teads-expand",expandIframe:"teads-expand-iframe",expandLabel:"teads-expand-label",expandCredit:"teads-expand-credits",expandCloseButton:"teads-expand-closebutton",expandContentContainer:"teads-expand-content"},c}();b.ExpandHelper=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(d,e,f,g,h,i){var j=this;this.parentContainer=d,this.clickZone=e,this.container=f,this.endCallback=g,this.clickCallback=h,this.win=i,this.logger=new a.Logger("helper.Countdown"),b.CSSHelper.embedCSS(c.CSS,this.win,c.STYLE_NODE_ID),this.container.className=c.CSSCLASSES.countdownContainer,a.Dom.addEventListener("click",this.clickZone,function(){j.onClick()})}return c.prototype.show=function(){var d=this;this.logger.debug("init countdown called"),b.CSSHelper.embedCSS(a.Template.COUNTDOWNCSS,this.win,c.CSSCLASSES.countdownStyle),this.container.style.opacity="0",this.container.innerHTML=a.ui.TemplateHelper.replacePlaceholders(a.Template.COUNTDOWNHTML,{assetsPath:a.ASSETS_URL+"/assets"});var e=a.Dom.getElementsByClassName(c.CSSCLASSES.countdownCircle,this.container)[0],f=a.Dom.getBoundingClientRect(e),g=a.Dom.getBoundingClientRect(this.parentContainer);e.style.top=(g.height-f.height)/2+"px",e.style.right=(g.width-f.width)/2+"px",setTimeout(function(){return d.container.style.opacity="1"},100);var h=a.Dom.getElementsByClassName(c.CSSCLASSES.countdownNumber,this.container)[0],i=3,j=a.Dom.getElementsByClassName(c.CSSCLASSES.countdownCircleStroke,this.container)[0],k=j.attributes["stroke-dasharray"]?Number(j.attributes["stroke-dasharray"].value):0;j.style.strokeDashoffset=String(k);var l=600,m=60,n=1e3/m,o=i*l/n,p=0,q=function(){p<=o&&(j.style.strokeDashoffset=""+(k-p/o*k),p++,d.countdownCircleStrokeTimer=a.HTMLHelper.requestAnimationFrame(q,n))};this.countdownCircleStrokeTimer=a.HTMLHelper.requestAnimationFrame(q,n),this.countdownTimer=setInterval(function(){i>0&&i--,h.textContent=String(i),0===i&&d.onEnded()},l)},c.prototype.hide=function(){this.container&&(this.container.innerHTML="",clearInterval(this.countdownTimer),a.HTMLHelper.cancelAnimationFrame(this.countdownCircleStrokeTimer))},c.prototype.onEnded=function(){if(this.endCallback&&b.MediaUtils.isFunction(this.endCallback))try{this.endCallback()}catch(a){this.logger.error("Countdown onEnded callback error",a)}},c.prototype.onClick=function(){if(this.clickCallback&&b.MediaUtils.isFunction(this.clickCallback))try{this.clickCallback()}catch(a){this.logger.error("Countdown onClick callback error",a)}},c.STYLE_NODE_ID="teads-inread-countdown",c.CSS=a.Template.COUNTDOWNCSS,c.CSSCLASSES={countdown:"teads-countdown",countdownStyle:"teads-countdown-style",countdownBackground:"teads-countdown-background",countdownCircle:"teads-countdown-circle",countdownCircleStroke:"teads-countdown-circle-main",countdownNumber:"teads-countdown-number",countdownClickZone:"teads-countdown-clickzone",countdownContainer:"teads-countdown-container",countdownMainContainer:"teads-countdown-maincontainer"},c}();b.Countdown=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(b,c,e,f){var g=this;if(this.config=b,this.clickZoneContainer=c,this.callback=e,this.win=f,this.isVisible=!0,this.countdownEnded=!1,this.logger=new a.Logger("helper.DisplayCloseButton"),!this.config.disable){this.clickZone=this.win.document.createElement("div"),this.clickZone.className=a.ui.componentBaseClassName+"closebutton",this.clickZone.style.position="absolute",this.clickZone.style.top="0px",this.clickZone.style.right="0px",this.clickZone.style.padding="15px";var h=this.win.document.createElement("div");this.countdown=new d(h,this.config.countdown,function(){return g.onCountdownEnded()}),this.clickZone.appendChild(h),this.clickZoneContainer.appendChild(this.clickZone)}}return b.prototype.hide=function(){!this.config.disable&&this.isVisible&&(this.clickZone.style.display="none",this.isVisible=!1)},b.prototype.show=function(){this.config.disable||this.isVisible||(this.clickZone.style.display="block",this.isVisible=!0)},b.prototype.resumeCoutdown=function(){this.config.disable||this.countdown.resume()},b.prototype.pauseCoutdown=function(){this.config.disable||this.countdown.pause()},b.prototype.onCountdownEnded=function(){var b=this;if(!this.countdownEnded){this.countdownEnded=!0;var c=this.win.document.createElement("div");c.className=a.ui.componentBaseClassName+"closebutton icon-close",c.style.cursor="pointer",this.clickZone.appendChild(c),a.Dom.addEventListener("click",c,function(){b.onClose()})}},b.prototype.onClose=function(){if(this.callback&&"function"==typeof this.callback)try{this.callback()}catch(a){this.logger.error("onClose callback failed",a)}},b}();b.DisplayCloseButton=c;var d=function(){function b(c,d,e){if(this.element=c,this.countdown=d,this.callback=e,this.logger=new a.Logger("helper.DisplayCloseButton.countdown"),this.element.className=b.ELEMENT_CLASS,this.countdown=Number(this.countdown),this.countdown<=0||isNaN(this.countdown))return void this.onEnded();var f=a.ui.TemplateHelper.replacePlaceholders(b.TEMPLATE,{"countdown-duration":this.countdown,"countdown-id":"countdown-"+a.StringHelper.rand(10)});this.element.innerHTML=f,this.countdownTextElement=c.querySelector("."+b.TIMER_CLASS)}return b.prototype.resume=function(){this.ended||(this.paused=!1,this.initTimer())},b.prototype.pause=function(){this.ended||(this.paused=!0,this.stopTimer())},b.prototype.onEnded=function(){if(this.ended=!0,clearInterval(this.timerInterval),this.hide(),this.callback&&"function"==typeof this.callback)try{this.callback()}catch(a){this.logger.error("countdown ended callback failed",a)}},b.prototype.initTimer=function(){var a=this,b=function(){a.paused||a.countdown--,a.countdown<=0?a.onEnded():a.updateDisplay()};this.timerInterval=setInterval(b,1e3),this.updateDisplay()},b.prototype.stopTimer=function(){clearInterval(this.timerInterval)},b.prototype.updateDisplay=function(){this.countdownTextElement&&this.countdownTextElement.setAttribute&&this.countdownTextElement.setAttribute("data-countdown",String(this.countdown))},b.prototype.hide=function(){this.element.style.display="none"},b.TEMPLATE='\n\n\n
    \n \n
  • \n \n \n \n \n \n \n \n \n \n \n \n \n \n
  • \n
\n\n\n\n\n \n \n\n\n\n',b.ELEMENT_CLASS="components-countdown",b.TIMER_CLASS="components-countdown-timer",b}()}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e,a.Constant.SLOT_TYPE.corner),this.placement=c,this.config=d,this.player=e}return __extends(c,b),c.prototype.load=function(){var b=this,c=a.Dom.getBoundingClientRect(this.playerContainer).width;this.playerContainer.style.setProperty("right","-"+String(c)+"px"),a.ArrayHelper.forEach(["","-webkit-","-moz-","-o-","-ms-"],function(a){b.playerContainer.style.setProperty(a+"transition",".3s linear all")}),this.start()},c.prototype.getTemplateName=function(){return"inread"},c.prototype.close=function(b){var c=this,d=a.Dom.getBoundingClientRect(this.playerContainer).width;a.Semver.isLowerOrEqual(a.Context.getIEVersion(),"9")?this.exit(b):this.eventListenerManager.addMultiple(["transitionend","otransitionend","oTransitionEnd","webkitTransitionEnd"],this.parentContainer,function(){c.exit(b)}),this.playerContainer.style.setProperty("right",-(d||500)+"px")},c.prototype.openFormat=function(){this.states.hasOpened=!0,this.placement.placementConfig.css.applyRulesOn(this.parentContainer),this.playerContainer.style.setProperty("right","0px")},c.prototype.onVpaidReady=function(){var c=this;b.prototype.onVpaidReady.call(this),this.placement.placementTracker.handleMirroringEvent(),this.vpaidAd.subscribe(function(){a.formatSumologic.sendInfo({feature:"slider",pid:c.placement.placementConfig.pid.get(),event:"impression"})},a.vpaid.VPAIDEvent.AdImpression),this.vpaidAd.subscribe(function(){c.smartPositionHelper.init(),c.smartPositionHelper.start(),c.vpaidAd.startAd()},a.vpaid.VPAIDEvent.AdLoaded),this.vpaidAd.subscribe(function(){var a=c.smartPositionHelper.getOptimalDimension();c.playerContainer.style.setProperty("right","-"+String(a.width)+"px"),c.openFormat()},a.vpaid.VPAIDEvent.AdVideoStart),this.fullscreenHelper=new a.helper.FullscreenHelper(this.parentContainer,this.vpaidAd,this.visibility,this.components,this.responsive,this.win),this.formatConfig.smartPosition.setValue({corner:!0,top:!1}),this.smartPositionHelper=new a.helper.SmartPosition(this)},c.prototype.replay=function(){this.smartPositionHelper.deinit(),b.prototype.replay.call(this)},c.STYLE_NODE_ID="teads-slider",c}(b.AbstractFormat);b.Slider=c}(b=a.format||(a.format={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.has=function(a){return!!b.getExtensions(a).length},b.getExtensions=function(a){for(var c=[],d=0,e=a.extensions.length;d0?i-f:i)+"px"}if(this.states.hasOpened){var j=g;for(var k in this.components)this.components.hasOwnProperty(k)&&(j+=a.Dom.getBoundingClientRect(this.components[k]).height);this.parentContainer.style.height=Math.round(j)+"px"}},d.prototype.onScroll=function(a){var b=this.getInViewState();this.trackAdCall(b),this.states.hasOpened||(this.formatConfig.launch.isAuto()||this.formatConfig.launch.isThreshold()&&b)&&this.openFormat(),this.manageInView(b)},d.prototype.getInViewState=function(){var b=a.Dom.getBoundingClientRect(this.playerContainer),c=b.height||1;return a.HTMLHelper.isInView(this.parentContainer,this.win,this.formatConfig.threshold.get()/100,c)},d.prototype.startInView=function(){var b=this;this.hasTrackedImpression||(this.tracker.track(a.Constant.TRACKING.impression),this.hasTrackedImpression=!0);var c=1e3,e=function(){clearInterval(b.visibleTimer)};this.visibleTimer=setInterval(function(){b.visibleOffset+=c;var f=b.visibleOffset/1e3;b.tracker.track(a.Constant.TRACKING.visible,{},f),f>=d.MAX_VISIBLE_OFFSET&&e()},c),this.closeButton.resumeCoutdown(),this.canUseBackgroundAttachment||this.visualCloseButton.resumeCoutdown()},d.prototype.endInView=function(){clearInterval(this.visibleTimer),this.closeButton.pauseCoutdown(),this.canUseBackgroundAttachment||this.visualCloseButton.pauseCoutdown()},d.prototype.showCountdown=function(){this.closeButton.hide(),this.canUseBackgroundAttachment||this.visualCloseButton.hide(),this.countdown.show()},d.prototype.hideCountdown=function(){this.countdown.hide(),this.closeButton.show(),this.canUseBackgroundAttachment||this.visualCloseButton.show()},d.prototype.openExpand=function(){var b=this;this.hideCountdown();var c,e=function(){clearInterval(c)},f=function(){b.tracker.track(a.Constant.TRACKING.openExpand);var f=5e3,g=0;c=setInterval(function(){g+=f;var c=g/1e3;b.logger.debug("open currentOffset",c),b.tracker.track(a.Constant.TRACKING.open,{},c),c>=d.MAX_OPEN_OFFSET&&e()},f)};a.helper.ExpandHelper.openExpand(this.placement.getInnerContainer(),this.formatConfig,this.clickThrough,f,e)},d.CSS=a.Template.DISPLAYCSS,d.CSSCLASSES={absolute:"teads-inread teads-display-format teads-display-absolute",fixed:"teads-display-fixed",clickZone:"teads-display-clickzone"},d.RATIO=a.Context.isMobile()?16/9:2.35,d.STYLE_NODE_ID="teads-inread-display",d.MAX_VISIBLE_OFFSET=1,d.MAX_OPEN_OFFSET=30,d}(b.Inread);b.InreadDisplay=c}(b=a.format||(a.format={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e){if(void 0===d&&(d=c.DEFAULT),void 0===e&&(e=null),this.capping=d,this.pid=e,b.call(this,"Capping"),this.capping&&this.pid){var f=a.Store.get("teadsCapping"+this.pid);this.logger.debug("Read capping data:",f),f&&f.expiry0)for(var d=a.Dom.querySelectorAll(c,this.win),e=0;e=768 && [WIDTH]<992",desktop:"[WIDTH]>=992 && [WIDTH]<1200",large:"[WIDTH]>=1200"}}return __extends(AbstractSelector,_super),AbstractSelector.prototype.checkScreenSelector=function(screen,win){var _this=this,selectedScreenSelector=null,currentWidth=Math.max(win.document.documentElement.clientWidth,win.innerWidth||0);return teads.ArrayHelper.forEach(screen.split("+"),function(screenSelector){if(_this.screenSizes[screenSelector])try{var screenSelectorPattern=_this.screenSizes[screenSelector].replace(/\[WIDTH\]/g,""+currentWidth);if(eval(screenSelectorPattern))return void(selectedScreenSelector=screenSelector)}catch(e){_this.logger.warn("screenSelector eval has failed")}}),selectedScreenSelector},AbstractSelector}(option.AbstractOption);option.AbstractSelector=AbstractSelector}(option=teads.option||(teads.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d,e){if(void 0===e)throw new a.FormatException(a.FormatException.OPTION_PARENTWINDOW_INVALID);this.win=e,d||(d=c.DEFAULT),this.value=d,b.call(this,"BelowSelector")}return __extends(c,b),c.prototype.checkValue=function(){this.value===c.DEFAULT||a.helper.MediaUtils.isString(this.value)||a.Dom.isHTMLElement(this.value)||a.Dom.isNodeList(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.prototype.getFirstElement=function(){if(!this.hasCachedElement){var b,c=this.value;if("object"==typeof this.value){var d;for(var e in this.value)if(this.value.hasOwnProperty(e)&&(d=this.checkScreenSelector(e,this.win),c=this.value[e],d))break;d?this.logger.debug("Below Selector",d,"selected:",c):this.logger.warn("Below Selector by device not found: ",this.value)}a.helper.MediaUtils.isString(c)&&c.length>0?b=a.Dom.querySelectorAll(c,this.win)[0]:a.Dom.isHTMLElement(c)?b=c:a.Dom.isNodeList(c)&&(b=c[0]),this.cacheElement(b)}return this.firstElement},c.prototype.getFirstElementRect=function(){return this.firstElementRect||(this.firstElementRect=a.Dom.getBoundingClientRect(this.getFirstElement())),this.firstElementRect},c.prototype.getFirstNodeBelowIndex=function(a){if(!this.firstNodeBelowIndex&&0!==this.firstNodeBelowIndex){for(var b,c=!1,d=0;!c&&a[d];)b=a[d++],b.getElementRect().top>=this.getFirstElementRect().bottom&&(c=!0);this.firstNodeBelowIndex=d-1}return this.firstNodeBelowIndex},c.prototype.cacheElement=function(a){this.firstElement=a,this.hasCachedElement=!0},c.DEFAULT=null,c}(b.AbstractSelector);b.BelowSelector=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=d,(a.Context.isFacebookIA()||a.Context.isAmp()||a.Context.isIABSafeFrame())&&(this.value=!1),b.call(this,"Btf")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.set=function(a){this.value=a},c.prototype.isEnabled=function(){return this.value},c.DEFAULT=!0,c}(b.AbstractOption);b.Btf=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.func=a,b.call(this,"Filter")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isFunction(this.func)||(this.func=c.DEFAULT)},c.prototype.trigger=function(b){var c=!0;if("function"==typeof this.func){try{c=this.func.call(this.func,b)}catch(d){a.formatSumologic.sendError({message:"The filter function threw an error"}),this.logger.error("the filter function threw an error:",d,this.func)}"boolean"!=typeof c&&(c=!0)}return c},c.DEFAULT=null,c}(b.AbstractOption);b.Filter=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"ImageFilter")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.VALUES={DISABLED:"disabled",SLOT:"slot"},c.DEFAULT=c.VALUES.DISABLED,c}(b.AbstractOption);b.ImageFilter=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"InsertBefore")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value},c.prototype.set=function(a){this.value=a},c.DEFAULT=!1,c}(b.AbstractOption);b.InsertBefore=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"InsertInside")}return __extends(c,b),c.prototype.checkValue=function(){a.Context.isAmp()?this.value=c.DEFAULT_AMP:a.helper.MediaUtils.isBoolean(this.value)||(this.value=c.DEFAULT)},c.prototype.isEnabled=function(){return this.value},c.prototype.set=function(a){this.value=a},c.DEFAULT=!1,c.DEFAULT_AMP=!0,c}(b.AbstractOption);b.InsertInside=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"MaximumWidth")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isNumber(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.DEFAULT=2e3,c}(b.AbstractOption);b.MaximumWidth=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(d){void 0===d&&(d=c.DEFAULT),this.value=d,(a.Context.isAmp()||a.Context.isIABSafeFrame()||a.Context.isFacebookIA())&&(this.value=1),b.call(this,"Minimum")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isNumber(this.value)||(this.value=c.DEFAULT)},c.prototype.set=function(a){this.value=a},c.prototype.get=function(){return this.value},c.DEFAULT=2,c}(b.AbstractOption);b.Minimum=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"MinimumBelow")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isNumber(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.DEFAULT=null,c}(b.AbstractOption);b.MinimumBelow=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"MinimumTextLength")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isNumber(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.DEFAULT=100,c}(b.AbstractOption);b.MinimumTextLength=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a){void 0===a&&(a=c.DEFAULT),this.value=a,b.call(this,"MinimumWidth")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isNumber(this.value)||(this.value=c.DEFAULT)},c.prototype.get=function(){return this.value},c.DEFAULT=100,c}(b.AbstractOption);b.MinimumWidth=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(b){function c(a,d){this.win=d,void 0===a?this.value=c.DEFAULT:this.value=a,b.call(this,"ScrollSelector")}return __extends(c,b),c.prototype.checkValue=function(){a.helper.MediaUtils.isString(this.value)||a.Dom.isHTMLElement(this.value)||(this.value=c.DEFAULT)},c.prototype.getSlot=function(){var b=this.win,c=this.value;if("string"==typeof c&&c.length>0){var d=a.Dom.querySelectorAll(c,this.win);d&&1===d.length?b=d[0]:this.logger.warn("Parameter must be a string (CSS Selector) or a DOM Element")}else a.Dom.isHTMLElement(c)&&(b=c);return b},c.DEFAULT=null,c}(b.AbstractOption);b.ScrollSelector=c}(b=a.option||(a.option={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(teads){var option;!function(option){var Selector=function(_super){function Selector(a,b){if(!b)throw new teads.FormatException(teads.FormatException.OPTION_PARENTWINDOW_INVALID);this.win=b,this.value=a,(teads.Context.isAmp()||teads.Context.isIABSafeFrame()||teads.Context.isFacebookIA())&&(this.value="body"),this.screenSizes={mobile:"[WIDTH]<768",tablet:"[WIDTH]>=768 && [WIDTH]<992",desktop:"[WIDTH]>=992 && [WIDTH]<1200",large:"[WIDTH]>=1200"},_super.call(this,"Selector")}return __extends(Selector,_super),Selector.prototype.checkValue=function(){teads.helper.MediaUtils.isString(this.value)||teads.Dom.isHTMLElement(this.value)||teads.Dom.isNodeList(this.value)||(this.value=Selector.DEFAULT)},Selector.prototype.get=function(){return this.value},Selector.prototype.getSlots=function(){var a=[],b=this.value;if("object"==typeof this.value){var c;for(var d in this.value)if(this.value.hasOwnProperty(d)&&(c=this.checkScreenSelector(d,this.win))){b=this.value[d];break}c?this.logger.debug("Slot",c,"selected:",b):this.logger.warn("Slots by device not found: ",this.value)}if(teads.helper.MediaUtils.isString(b)&&b.length>0)for(var e=teads.Dom.querySelectorAll(b,this.win),f=0;f0)){b.logger.error("Wrong offset for progress tracking: "+v);continue}v=a.Utils.seconds(v)}i.tracking[u].push({url:a.vast.XMLHelper.getNodeContent(t[o]),offset:v})}}}b.logger.info("DisplayXml loaded",i),a.WIGOI&&a.WIGOI.valid&&(a.WIGOI.valid(2,1,i,a.Wigo.infoType.MODAL),a.WIGOI.valid(2,2,i.creative.asset.url,a.Wigo.infoType.STRING),a.WIGOI.valid(2,3,"Engage",a.Wigo.infoType.STRING),a.WIGOI.valid(3,0),a.WIGOI.valid(3,1,"1.0",a.Wigo.infoType.STRING)),a.vast.CallbackHelper.execCallback(d,[i],e)}catch(w){a.vast.CallbackHelper.execCallback(e,[new a.VastException(a.VastException.XML_PARSE,w)])}},b.logger=new a.Logger("parser.Display"),b.SUPPORTED_MEDIAFILES=/.+\.(jpg|jpeg|png)$/i,b}();b.Display=c}(b=a.parser||(a.parser={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(){}return c.checkImagePrevNextElement=function(b,d){if(void 0===d&&(d=window),!b)return!1;var e,f=!1;if("img"===b.tagName.toLowerCase()?f=c.hasLargeImage([b]):(e=a.Dom.querySelectorAll("img",d,b),f=c.hasLargeImage(e)),!f){var g=c.prevNotEmpty(b);g&&("img"===g.tagName.toLowerCase()?f=c.hasLargeImage([g]):(e=a.Dom.querySelectorAll("img",d,g),f=e.length>0&&c.hasLargeImage(e)))}if(!f){var h=c.nextNotEmpty(b);h&&("img"===h.tagName.toLowerCase()?f=c.hasLargeImage([h]):(e=a.Dom.querySelectorAll("img",d,h),f=e.length>0&&c.hasLargeImage(e)))}return f},c.checkVideoPrevNextElement=function(a,b){if(void 0===b&&(b=window),!a)return!1;var d=c.checkVideoInElement(a,b);if(!d){var e=c.prevNotEmpty(a);e&&(d=c.checkVideoInElement(e,b))}if(!d){var f=c.nextNotEmpty(a);f&&(d=c.checkVideoInElement(f,b))}return d},c.checkVideoInElement=function(b,d){void 0===d&&(d=window);var e=["video","object","embed"],f=a.ArrayHelper.includes(e,b.tagName.toLowerCase());if(!f){var g=b.getAttribute("src"); f=g&&c.isVideo(g)}if(f||(f=a.Dom.querySelectorAll("video",d,b).length>0),f||(f=a.Dom.querySelectorAll("object",d,b).length>0),!f){var h=a.ArrayHelper.fromNodeList(a.Dom.querySelectorAll("[src]",d,b)),i=a.ArrayHelper.map(h,function(a){return a.getAttribute("src")}),j=function(a){return c.isVideo(a)};f=a.ArrayHelper.filter(i,j).length>0}return f},c.checkVideoSiblings=function(a,d){function e(a,b,c){if(a&&10!==c){var d=a.parentElement;return d===b?d:e(d,b,c+1)}}void 0===d&&(d=window);var f=null,g={length:0,currentScore:0,childrenScore:0,isOverMinimumWidth:!1,article:{score:0,node:null}},h=b.SmartSlot.findArticle(d.document.body,d,g);return h&&h.article&&h.article.node&&(f=e(a,h.article.node,0)),f||(f=a.parentElement),c.checkVideoInElement(f,d)},c.isVideo=function(a){var b=/youtube|youtu\.be|dailymotion|day\.ly|vimeo|instagram|vine-videos/i;return b.test(a)},c.hasLargeImage=function(b){void 0===b&&(b=[]);var d=a.ArrayHelper.map(b,function(b){return a.Dom.getSize(b).width}),e=function(a){return a>c.LARGE_IMG_THRESHOLD};return a.ArrayHelper.filter(d,e).length>0},c.prevNotEmpty=function(b,d){if(void 0===d&&(d=0),!b||d===c.MAX_TRY_CHECK_EMPTY)return b;var e=b.previousElementSibling;return e&&!a.Dom.isEmpty(e)?e:c.prevNotEmpty(e,d+1)},c.nextNotEmpty=function(b,d){if(void 0===d&&(d=0),!b||d===c.MAX_TRY_CHECK_EMPTY)return b;var e=b.nextElementSibling;return e&&!a.Dom.isEmpty(e)?e:c.nextNotEmpty(e,d+1)},c.LARGE_IMG_THRESHOLD=75,c.MAX_TRY_CHECK_EMPTY=3,c}();b.CheckerHelper=c}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function b(){}return b.isActive=function(){var b=a.Cookie.get("teadsDebugInPage");return b&&"true"===b},b.showAvoidSlot=function(a,c,d){if(b.isActive()){var e=document.createElement("div");e.setAttribute("id","teadsGhostAvoid"),e.style.position="absolute",e.style.top=c.top+"px",e.style.bottom=c.bottom+"px",e.style.left=c.left+"px",e.style.right=c.right+"px",e.style.width=c.width+"px",e.style.height=c.height+"px",e.style.background="rgba(255, 0, 0, 0.10)",e.style.pointerEvents="none",e.style.color="#F79C9C",e.style.zIndex="9999",e.style.padding="10px",e.innerText="avoidSlot",d.document.body.appendChild(e),a.style.backgroundColor="rgba(255, 0, 0, 0.20)"}},b.showCreativeLimits=function(c,d){void 0===d&&(d=window.document.body),b.hideCreativeLimits(),b.isActive()&&(b.creativeLimits=[b.getDivLine(d,0,c.top,200,c.top,"#0000CC"),b.getDivLine(d,0,c.bottom,200,c.bottom,"#CC0000")],a.ArrayHelper.forEach(b.creativeLimits,function(a){d.appendChild(a)}))},b.hideCreativeLimits=function(){b.isActive&&(a.ArrayHelper.forEach(b.creativeLimits,function(a){a.parentNode.removeChild(a)}),b.creativeLimits=[])},b.getDivLine=function(a,b,c,d,e,f){if(void 0===f&&(f="black"),c=f,reason:a.Constant.TRACKING.noSlot.btf,information:"top: "+Math.round(h)+" px >= waterline: "+f+" px"}}var i=e.bottom+d;return{status:i>=f,reason:a.Constant.TRACKING.noSlot.btf,information:"bottom: "+Math.round(i)+"px >= waterline: "+f+"px"}},b.minimum=function(b,c){var d=c.getIndex()+1;return d>=b.placementConfig.minimum.get()?{status:!0,reason:""}:{status:!1,reason:a.Constant.TRACKING.noSlot.minimum,information:"slot: "+d+" < config: "+b.placementConfig.minimum.get()}},b.minimumBelow=function(b,c,d){if(!b.placementConfig.belowSelector.get()||null===b.placementConfig.minimumBelow.get())return{status:!0,reason:""};var e=b.placementConfig.belowSelector.getFirstNodeBelowIndex(d),f=c.getIndex();return f>=b.placementConfig.minimumBelow.get()+e-1?{status:!0,reason:""}:{status:!1,reason:a.Constant.TRACKING.noSlot.minimumBelow,information:"slot: "+f+" < config: "+b.placementConfig.minimumBelow.get()}},b.height=function(b,c){var d=650,e=d/a.Constant.DEFAULT_VIDEO_SIZE_RATIO,f=b.placeFormat(c),g=typeof f,h=("object"===g&&null!==f||"function"===g)&&1===f.nodeType;if(!h)return{status:!1,reason:""};f.style.height="0px",f.style.textAlign="center",""===f.style.maxWidth&&(f.style.maxWidth="100%");var i={x:f.offsetLeft,y:f.offsetTop};f.style.overflow="hidden";var j={x:f.offsetLeft,y:f.offsetTop};f.style.marginTop=.33*e+"px";var k={x:f.offsetLeft,y:f.offsetTop};f.style.marginTop="0";var l=Math.abs(i.y-j.y)<8&&Math.abs(i.y-k.y)<.33*e+8;f.style.position="relative";var m=a.Dom.getSize(f);return m.height=m.width/a.Constant.DEFAULT_VIDEO_SIZE_RATIO,f&&f.parentNode&&f.parentNode.removeChild(f),{status:l,reason:a.Constant.TRACKING.noSlot.position,information:"Check height failed"}},b.avoid=function(b,c){if(!b.placementConfig.avoid.getSlots())return{status:!0,reason:"placement.placementConfig.avoid not set"};for(var d,e=b.placementConfig.avoid.getSlots(),f=a.Dom.getBoundingClientRect(c.getElement()),g=!0,h=0;h=":function(a,b){return a>=b},"<=":function(a,b){return a<=b}},g=[{name:"minimumHeight",property:c.getHeight(),score:a.placement.Checker.configScore.MIN_LONG_HEIGHT,operator:">="},{name:"minimumWidth",property:c.getWidth(),score:b.placementConfig.minimumWidth.get(),operator:">="},{name:"maximumHeight",property:c.getHeight(),score:a.placement.Checker.configScore.MAX_LONG_HEIGHT,operator:"<="},{name:"maximumWidth",property:c.getWidth(),score:b.placementConfig.maximumWidth.get(),operator:"<="}],h=0;d.status&&g[h];)if(e=g[h++],d.status=f[e.operator](e.property,e.score),!d.status){d.reason=a.Constant.TRACKING.noSlot.size,d.information=e.name+": "+e.property+" "+e.operator+" "+e.score;break}return d},b.positionTop=function(b,c){if(!b.placementConfig.selector.get())return{status:!0,reason:"placement.placementConfig.selector not set"};var d=c.getElement(),e=a.Dom.getScrollTop(b.placementConfig.parentWindow.getWindow()),f=a.Dom.getBoundingClientRect(d).top,g=f+e>=this.configScore.MIN_POSITION_TOP&&f+e<=this.configScore.MAX_POSITION_TOP;return{status:g,reason:a.Constant.TRACKING.noSlot.position,information:"positionTop: "+this.configScore.MIN_POSITION_TOP+" <= "+(f+e)+" <= "+this.configScore.MAX_POSITION_TOP}},b.position=function(a,c){var d=b.positionTop.apply(b,arguments);return d.status?b.height.apply(b,arguments):d},b.textLength=function(b,c){var d={status:!0,reason:a.Constant.TRACKING.noSlot.content},e=c.getElement(),f=[];a.Dom.getTextContent(e,f);var g=f.join("");return a.Dom.isSelfClosingTag(e)||(d.status=g.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").length>=b.placementConfig.minimumTextLength.get()),d},b.children=function(b,c){var d,e=0,f=c.getElement(),g=f.children||f.childNodes;if(0===g.length)return{status:!0,reason:"children empty"};do if(d=g[e++],"P"===d.nodeName||"DIV"===d.nodeName||"BR"===d.nodeName)return{status:!1,reason:a.Constant.TRACKING.noSlot.content,information:d.nodeName};while(g[e]);return{status:!0,reason:""}},b.content=function(a,b){var c=this.textLength.apply(this,arguments);return c.status?this.children.apply(this,arguments):c},b.video=function(b,c){var d={status:!0,reason:""},e=b.placementConfig.parentWindow.getWindow();return b.placementConfig.videoFilter.get()===a.option.VideoFilter.VALUES.SLOT?a.helper.CheckerHelper.checkVideoPrevNextElement(c.getElement(),e)&&(d.status=!1,d.reason=a.Constant.TRACKING.noSlot.videoSlot,d.information="slot is too close to a video"):b.placementConfig.videoFilter.get()===a.option.VideoFilter.VALUES.ARTICLE&&a.helper.CheckerHelper.checkVideoSiblings(c.getElement(),e)&&(d.status=!1,d.reason=a.Constant.TRACKING.noSlot.videoArticle,d.information="slot container (article) has a video"),d},b.image=function(b,c){var d={status:!0,reason:""},e=b.placementConfig.parentWindow.getWindow();return b.placementConfig.imageFilter.get()===a.option.ImageFilter.VALUES.SLOT&&a.helper.CheckerHelper.checkImagePrevNextElement(c.getElement(),e)&&(d.status=!1,d.reason=a.Constant.TRACKING.noSlot.imageSlot,d.information="slot is too close to an image"),d},b.safeframe=function(b,c){var d={status:!0,reason:""};return a.Context.isIABSafeFrame()&&(d.information=a.helper.SafeFrameResize.init(),d.reason=d.information?a.Constant.TRACKING.noSlot.safeFrame:"",d.status=!d.information),d},b.configScore={MIN_POSITION_TOP:100,MAX_POSITION_TOP:18e3,MIN_LONG_HEIGHT:30,MAX_LONG_HEIGHT:2e3,WIDTH_MARGIN:40,HEIGHT_MARGIN:20,LENGTH_MARGIN:150,LEVEL_POSITION:200},b}();b.Checker=c}(b=a.placement||(a.placement={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(a){this.placement=a}return b.prototype.isReplay=function(){return!!this.placement.getFormat().states.isReplay},b.prototype.activateTapMode=function(a){void 0===a&&(a=!0);var b=this.placement.getFormat().getBrandingMode();b&&(a?b.init():b.deinit())},b.prototype.performTapMode=function(){var a=this.placement.getFormat().getBrandingMode();a&&a.toggle()},b.prototype.isFullscreen=function(){return this.placement.getFormat().getFullscreenHelper().isActive()},b.prototype.requestFullscreen=function(){this.placement.getFormat().getVpaidAd().dispatchCustomEvent("FullscreenRequest")},b.prototype.setFixedBackgroundImage=function(b,c){var d=this.placement.getPlayerContainer(),e=this.placement.getFormat().getVpaidAd(),f=function(){setTimeout(function(){try{e.getVPAIDContainer().style.backgroundColor="transparent"}catch(a){}},10)};f(),e.subscribe(f,a.vpaid.VPAIDEvent.AdStarted);var g,h,i=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,j=new i.teads.Logger("api.setFixedBackgroundImage"),k=i.teads.Context.isDesktop(),l=c||function(a){},m=new Image,n=i.document.createElement("div");n.style.position="absolute",n.style.overflow="hidden",n.style.zIndex="99";var o,p=function(a){m.onerror=function(a){return l(!1)},m.onload=function(b){m.width&&m.height?(g=m.width,h=m.height,a()):(j.error("Asset size error: cannot retrieve image dimensions"),c(!1))},m.src=b},q=function(){var a=i.teads.Dom.getBoundingClientRect(d),b=i.teads.Dom.getWindowSize(i),c=Math.round(a.width),e=h*c/g;if(n.style.width=c+"px",n.style.height=Math.round(a.height)+"px",k){var f=(b.height-e)/2;n.style.backgroundSize=Math.round(c)+"px "+Math.round(e)+"px",n.style.backgroundPosition=Math.round(a.left)+"px "+f+"px"}else{o.style.width=Math.round(c)+"px",o.style.height=Math.round(1.2*(b.height+e))+"px",o.style.backgroundSize=Math.round(c)+"px "+Math.round(e)+"px",o.style.left=Math.round(a.left)+"px";var j=(b.height-e)/2%e;o.style.top=(j>0?j-e:j)+"px"}},r=function(c){k?(n.style.backgroundImage="url("+b+")",n.style.backgroundRepeat="repeat-y",n.style.backgroundAttachment="fixed"):(o=document.createElement("div"),o.style.position="fixed",o.style.backgroundImage="url("+b+")",a.Semver.isGreaterOrEqual(a.Context.getChromeVersion(),"55")&&(n.style.clipPath="inset(1px 0px)"),n.appendChild(o)),q(),c()},s=function(){return n.parentNode.removeChild(n)},t=function(){d.style.position="relative",d.style.zIndex="100",d.parentNode.insertBefore(n,d)};e.subscribe(q,a.vpaid.VPAIDEvent.AdSizeChange),e.subscribe(q,a.vpaid.VPAIDEvent.AdStarted),e.subscribe(s,a.vpaid.VPAIDEvent.AdStopped),e.subscribe(s,a.vpaid.VPAIDEvent.AdError),e.status>=a.vpaid.VpaidStatus.STARTED?t():e.subscribe(t,a.vpaid.VPAIDEvent.AdStarted),p(function(){return r(function(){j.debug("background image ready !"),l(!0)})})},b}();a.VPAIDApi=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(){function c(b,c,d,e){this.pageId=b,this.placementConfig=c,this.placementSetting=d,this.placementTracker=e,this.sliderEnabled=!1,this.logger=new a.Logger("placement"),this.moatCampaignToTest=/^(38690|38587|40036|39615|41045|39123)$/,this.pid=c.pid.get(),this.win=c.parentWindow.getWindow(),this.initContainer()}return c.prototype.canEnableSlider=function(){if(!a.Context.isDesktop()||!this.placementConfig.formatName.isInRead())return!1;var b=this.placementSetting&&this.placementSetting.slider&&this.placementSetting.slider.allowCorner();return a.Constant.SLIDER_WHITELIST.test(String(this.pid))||b},c.prototype.enableSlider=function(){this.sliderEnabled=!0,this.placementTracker.setSlotType(a.Constant.SLOT_TYPE.corner),this.placementTracker.track(a.Constant.TRACKING.adCall),this.electedSlot=new b.Slot(this.placementConfig.parentWindow.getWindow().document.body),this.placementConfig.btf.set(!1),this.placementConfig.minimum.set(0),this.placementConfig.auto.set(!1),this.placementConfig.insertBefore.set(!1),this.placementConfig.insertInside.set(!0)},c.prototype.loadVast=function(b){var c=this,d=new a.player.VASTPlayer(this.playerContainer,this.getPlayerConfig(b)),e=function(a){return c.onVastError(a)};if(b.vast.isDisplayUrl()||b.vast.isDisplayXml()){var f=function(e){c.logger.info("Ad is ready"),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,2),d.setLinearAd({}),c.onDisplaySuccess(e,b,d)};b.vast.isDisplayUrl()?a.parser.Display.load(b.vast.getContent(),f,e):b.vast.isDisplayXml()&&a.parser.Display.parse(b.vast.getContent(),f,e)}else{var f=function(e){c.logger.info("VAST is ready"),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,2),d.setConfigUI(c.getPlayerConfigUI(b,e)),a.ArrayHelper.forEach(e.extensions,function(d){"MoatJs"===d.type&&c.moatCampaignToTest.test(d.definition.id)&&(b.videoStart=new a.option.VideoStart(a.option.VideoStart.VALUES.THRESHOLD,b.formatName,b.smartPosition),b.videoPause=new a.option.VideoPause(a.option.VideoPause.VALUES.THRESHOLD),b.soundStart=new a.option.SoundStart({type:a.option.SoundStart.VALUES_TYPE.COUNTDOWN,countdown:2}),b.threshold=new a.option.Threshold(100),a.formatSumologic.sendInfo("[OVR-MOAT] "+e.id+" "+d.definition.id,null,1))}),c.onVastSuccess(d,b)};b.vast.isVastUrl()?d.loadVast(b.vast.getContent(),f,e):b.vast.isVastXml()&&d.parseVast(b.vast.getContent(),f,e)}},c.prototype.onVastError=function(b){a.formatSumologic.sendError({pid:this.pid,message:"Error when loading VAST|"+b.getMessage().substr(0,120)});var c=b.getId()||0;c===a.VastException.WRAPPER_TIMEOUT.id?this.placementTracker.track(a.Constant.TRACKING.adAvailable.error.parseTimeout):this.placementTracker.track(a.Constant.TRACKING.adAvailable.error.vast.replace(/\{code\}$/,""+c)),this.logger.error("VAST loading:",b),this.handleNoAd()},c.prototype.handleNoAd=function(){if(this.placementTracker.handleMirroringEvent(),this.placementConfig.fallback.trigger()&&(this.placementTracker.track(a.Constant.TRACKING.fallback.noAd),this.logger.info(a.Constant.TRACKING.fallback.noAd),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,2,a.Constant.TRACKING.fallback.noAd,a.Wigo.infoType.ERROR)),!this.sliderEnabled){var b=new a.FormatConfig({type:"VastUrl",content:"",settings:{values:{placementFormat:this.placementConfig.formatName.get(),pageId:this.pageId,placementId:this.pid,threshold:100},components:{},behaviors:{}}});this.onVastSuccess(null,b)}},c.prototype.loadFormat=function(b){if(!b||!b.type||!b.content)return void this.handleNoAd();var c;try{c=new a.FormatConfig(b),this.logger.info("formatConfig",c),a.Context.isDesktop()&&a.Constant.SLIDER_WHITELIST.test(String(c.placementId))&&a.formatSumologic.sendInfo({feature:"slider",pid:c.placementId,event:"config",onlyNative:c.onlyNative.get()}),this.loadVast(c)}catch(d){this.logger.warn("Error during FormatConfig instantiation",d),this.placementTracker.track(a.Constant.TRACKING.adAvailable.error.settings);var e=d.message?d.message:a.JSON.stringify(d);a.formatSumologic.sendError({pageId:this.pageId,message:a.Constant.TRACKING.adAvailable.error.settings+"|"+e.substr(0,120)}),this.handleNoAd()}},c.prototype.getFormat=function(){return this.formatInstance},c.prototype.getParentContainer=function(){return this.parentContainer},c.prototype.getPlayerContainer=function(){return this.playerContainer},c.prototype.getInnerContainer=function(){return this.innerContainer},c.prototype.processChecker=function(d,e,f){void 0===f&&(f=!1);for(var g,h,i,j,k,l=f?"auto":"selector",m=c.checkersConfig[e][l],n={report:{status:!1,reasons:[]}},o=0,p=!1;!p&&d[o];){for(h=d[o++],i=h.getElement(),g=0,k={status:!0,reason:""};k.status&&m[g];)j=m[g++],k=b.Checker[j](this,h,d),k.status||(this.logger.info("Invalid slot","["+o+"/"+d.length+"]",k.reason,"=>",k.information,i),n.report.reasons=[k.reason],n.report.status=!1,k.status=!1);k.status&&(this.logger.info("Elected slot","["+o+"/"+d.length+"]",i),n.report.status=!0,n.report.reasons=[],n.slot=h,p=!0,a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,1))}return n},c.prototype.registerInstance=function(b){this.formatInstance=b;var c=b.formatConfig.formatName.get();a.instances[c]||(a.instances[c]=[]),a.instances[c].push(b)},c.prototype.getPlayerConfig=function(b){return{path:a.ASSETS_URL,type:b.allowedPlayer.getValue(),formatConfig:b,sumologicSessionId:a.formatSumologic.getSessionId(),background:"transparent",vpaidApi:new a.VPAIDApi(this),useMultipleBillable:b.useMultipleBillable}},c.prototype.getPlayerConfigUI=function(b,c){return{name:"inread",config:{components:a.helper.RASHelper.getComponentsConfig(b,this,c,a.player.TeadsStudioExtension.get(c))}}},c.prototype.initContainer=function(){this.parentContainer=this.win.document.createElement("div"),this.parentContainer.className="teads-"+this.placementConfig.formatName.get(),this.parentContainer.style.width="100%",this.innerContainer=this.win.document.createElement("div"),this.innerContainer.style.position="relative",this.parentContainer.appendChild(this.innerContainer),this.playerContainer=this.win.document.createElement("div"),this.playerContainer.className="teads-player",this.playerContainer.id="teads"+a.currentPlayerId++,this.innerContainer.appendChild(this.playerContainer)},c.checkersConfig={inread:{auto:["safeframe","image","video","minimum","btf","position","avoid","content","size","filter"],selector:["safeframe","image","video","minimum","btf","avoid","filter"]},inboard:{auto:["safeframe","image","video","minimum","btf","avoid","filter"],selector:["safeframe","image","video","minimum","btf","avoid","filter"]}},c}();b.AbstractPlacement=c}(b=a.placement||(a.placement={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){var c=function(c){function d(a,b,d,e){c.call(this,a,b,d,e)}return __extends(d,c),d.prototype.onVastSuccess=function(b,c){var d,e=this,f=b?b.getLinearAd():null;if(this.placementTracker.setSlotDimensionOnTracking(f),b&&b.setLinearAd(f),this.sliderEnabled)if(c.onlyNative.get()){this.playerContainer.style.setProperty("display","none","important"),this.getElectedSlot().getElement().appendChild(this.playerContainer);var g=function(b,c){a.formatSumologic.sendInfo({pid:e.pid,track:"adAvailable-success"}),e.placementTracker.track(a.Constant.TRACKING.adAvailable.success),e.placementTracker.handleMirroringEvent(),e.getElectedSlot().getElement().removeChild(e.playerContainer)},h=function(b){a.formatSumologic.sendError({pid:e.pid,message:"Error when loading mediafile|"+b.getMessage().substr(0,120)}),e.placementTracker.track(a.Constant.TRACKING.adAvailable.error.vast.replace(/\{code\}$/,String(b.getId()))),e.logger.error("VPAID play:",b),e.placementTracker.handleMirroringEvent(),e.getElectedSlot().getElement().removeChild(e.playerContainer)};b.loadOptimalMediaFile(g,h)}else d=new a.format.Slider(this,c,b),a.formatSumologic.sendInfo({feature:"slider",pid:this.placementConfig.pid.get(),event:"detachableSlot"});else d=f&&a.parser.HybridExtension.has(f)?new a.format.InreadImpact(this,c,b):new a.format.Inread(this,c,b);d&&(this.registerInstance(d),this.placeFormat(this.electedSlot),d.load())},d.prototype.onDisplaySuccess=function(b,c,d){var e=new a.format.InreadDisplay(this,c,b,d);this.registerInstance(e),this.placeFormat(this.electedSlot),e.load()},d.prototype.checkSlot=function(){var c=this.placementConfig.selector.getSlots();if(c.length&&(this.electedSlotReport=this.processChecker(c,a.Constant.FORMAT.inread)),(!c.length||!this.electedSlotReport.report.status)&&this.placementConfig.auto.isEnabled()){this.smartSlot=new a.helper.SmartSlot(this.placementConfig.parentWindow.getWindow());var d=this.smartSlot.find();if(d){for(var e=[],f=0,g=d.length;f1){this.vastErrorCodeTracked=b[1];var c=a.Constant.TRACKING.noAd.vastError.replace(/\{code\}$/,this.vastErrorCodeTracked);this.logger.info(c),a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,2,c,a.Wigo.infoType.ERROR)}},b.prototype.sendToWigo=function(b){switch(b){case a.Constant.TRACKING.adNotAvailable.networkError:case a.Constant.TRACKING.adNotAvailable.serverError:case a.Constant.TRACKING.adAvailable.error.parseTimeout:case a.Constant.TRACKING.adAvailable.error.settings:case a.Constant.TRACKING.adAvailable.error.badResponse:a.WIGOI&&a.WIGOI.valid&&a.WIGOI.valid(1,2,b,a.Wigo.infoType.ERROR)}},b.vastErrorRegExp=new RegExp(a.Constant.TRACKING.adAvailable.error.vast.replace(/\{code\}$/,"(\\d+)")),b}();a.PlacementTracker=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b=function(){function b(){this.placements={},this.logger=new a.Logger("Page")}return b.getPlayerSize=function(b,c){var d={width:0,height:0};if(b){if(c.insertInside.isEnabled())d.width=b.getWidth();else if(b.getElement().parentNode){var e=a.Dom.getSize(b.getElement().parentNode);d.width=e.width}d.height=d.width/a.Constant.DEFAULT_VIDEO_SIZE_RATIO}else{var f=a.Dom.getWindowSize();d.height=f.height*a.helper.SmartPosition.MAX_SIZE_RATIO_CORNER,d.width=d.height*a.Constant.DEFAULT_VIDEO_SIZE_RATIO}return d.width=Math.round(d.width),d.height=Math.round(d.height),d},b.prototype.process=function(){var b=window._ttp||{},c=!1;for(var d in b)if(b.hasOwnProperty(d)){if(c)throw a.formatSumologic.sendError({message:"Page error: "+a.FormatException.MULTIPLE_PAGE_PROCESS.message}),new a.FormatException(a.FormatException.MULTIPLE_PAGE_PROCESS);this.checkPlacements(parseInt(d,10),b[d]),c=!0}},b.prototype.clearInstances=function(){for(var b in a.Constant.FORMAT)if(a.Constant.FORMAT.hasOwnProperty(b)&&a.instances[b])for(var c=0,d=a.instances[b].length;c not placing format");a.instances[d.ad.settings.values.placementFormat]||(a.instances[d.ad.settings.values.placementFormat]=[]),d.placement.loadFormat(d.ad)}try{a.Dom.onDomComplete(function(){b.isDomComplete=!0,b.processTiming()},a.HTMLHelper.findParentWindows(window.document.body).pop(),this)}catch(e){this.logger.warn("Can not access top window for performance",e)}},b.prototype.getAdRequestUrl=function(){var b=a.RAS_URL.replace("{id}",String(this.pageId)),c=this.getTrackingMetadata(),d=[];for(var e in c)c.hasOwnProperty(e)&&d.push(e+"="+c[e]);return b+=b.indexOf("?")>0?"&":"?",b+d.join("&")},b.prototype.getTrackingMetadata=function(){var b=null;try{var c=a.HTMLHelper.findParentWindows(window.document.body),d=(a.Context.isAmp()||a.Context.isIABSafeFrame())&&document.referrer?document.referrer.replace("cdn.ampproject.org/v/",""):"";b={windowWidth:window.innerWidth,windowHeight:window.innerHeight,windowDepth:c.length,windowReferrerUrl:encodeURIComponent(d)}}catch(e){this.logger.warn("An error occurred retrieving top window - Window metadata will be empty on the ad request")}return b},b.prototype.processTiming=function(){if(this.isDomComplete&&this.isRequestSent&&this.isUserSyncIframeBack)try{a.Timing.measure("measurePage","markPageStart","markPageEnd"),a.Timing.measure("measureSmartSlot","markFormatSmartSlotStart","markFormatSmartSlotEnd"),a.Timing.measure("measureUserSyncRequest","markUserSyncRequest","markUserSyncResponse"),a.Timing.measure("measureUserSyncAdRequestDelay","markUserSyncResponse","markAdRequest");var b=Math.round(a.Timing.getLastEntryByName("markFormatInit").startTime),c=a.Timing.getTimingByRegex(/teads-format(.min)?\.js/),d=a.Timing.getLastEntryByName("measureUserSyncRequest")?Math.round(a.Timing.getLastEntryByName("measureUserSyncRequest").duration):null,e=a.Timing.getLastEntryByName("measureUserSyncAdRequestDelay")?Math.round(a.Timing.getLastEntryByName("measureUserSyncAdRequestDelay").duration):null,f=a.Timing.getLastEntryByName("measurePage")?Math.round(a.Timing.getLastEntryByName("measurePage").duration):null,g=a.Timing.getLastEntryByName("measureSmartSlot")?Math.round(a.Timing.getLastEntryByName("measureSmartSlot").duration):null,h={pageId:this.pageId,pageDuration:f,smartSlotDuration:g,markFormatInit:b,entryCount:a.Timing.getResourceCount(),domLoading:null,domInteractive:null,domComplete:null,teadsFormatStart:Math.round(c[c.length-1].startTime),teadsFormatDuration:Math.round(c[c.length-1].duration),userSyncRequestDuration:d,userSyncAdRequestDelay:e};if(a.Timing.performance&&a.Timing.performance.timing){var i=a.Timing.performance.timing;h.domLoading=Math.round(i.domLoading-i.fetchStart),h.domInteractive=Math.round(i.domInteractive-i.fetchStart),h.domComplete=Math.round(i.domComplete-i.fetchStart)}this.logger.debug("Sending timing data"),a.formatSumologic.sendInfo(h)}catch(j){this.logger.debug("Error on timing data process")}},b}();a.Page=b}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){!function(a){a[a.Clean=0]="Clean",a[a.Close=1]="Close",a[a.Open=2]="Open"}(b.AMP_ACTION||(b.AMP_ACTION={}));var c=b.AMP_ACTION,d=function(){function d(){}return d.init=function(){a.Context.isAmp()&&d.getChangesRect()&&!d.isInitialized()&&!d.isFalsyScreenValue()&&(d.rootBounds=d.getChangesRect().rootBounds,d.width=Math.min(Math.min(d.rootBounds.width,d.rootBounds.height),window.innerWidth),d.width!==window.innerWidth&&(d.width-=2*window.context.initialIntersection.boundingClientRect.left),d.initialized||(d.bindEvents(),d.getChangesRect().boundingClientRect.height>10&&(d.close(),a.formatSumologic.sendError("AMP tag malformed "+window.context.location.href)),d.initialized=!0),d.status!==c.Open&&d.action!==c.Open||d.open())},d.isInitialized=function(){return!!d.rootBounds&&(d.initialized&&window._teads_amp.change.rootBounds.width===d.rootBounds.width)},d.clean=function(a,b){void 0===a&&(a=function(){}),void 0===b&&(b=!1),d.action=c.Clean,d.initialized&&d.recursive(0,a,d.action,b)},d.close=function(a,b){void 0===a&&(a=function(){}),void 0===b&&(b=!1),d.action=c.Close,d.initialized&&d.recursive(1,a,d.action,b)},d.open=function(a,b){void 0===a&&(a=function(){}),void 0===b&&(b=!1),d.action=c.Open,d.initialized&&d.recursive(d.getHeight(),a,d.action,b)},d.getHeight=function(){return Math.ceil(d.width/d.ratio)},d.isOpen=function(){return d.status===c.Open},d.setCreativeInformation=function(a){var b="teads-";a?(b+=a.id?a.id:"0",b+="-",b+=a.creativeId?a.creativeId:"0"):b+="0",d.creativeId=b},d.noContentAvailable=function(){window.context&&b.MediaUtils.isFunction(window.context.noContentAvailable)&&!d.hasCalled.noContentAvailable&&(d.hasCalled.noContentAvailable=!0,d.logger.debug("noContentAvailable"),window.context.noContentAvailable())},d.renderStart=function(){if(window.context&&b.MediaUtils.isFunction(window.context.renderStart)&&!d.hasCalled.renderStart){d.hasCalled.renderStart=!0;var a={height:d.getHeight(),width:d.width};d.logger.debug("renderStart",a),window.context.renderStart(a)}},d.reportRenderedEntityIdentifier=function(){if(d.creativeId&&window.context&&b.MediaUtils.isFunction(window.context.reportRenderedEntityIdentifier)&&!d.hasCalled.reportRenderedEntityIdentifier){d.hasCalled.reportRenderedEntityIdentifier=!0;var a="teads-"+d.creativeId;d.logger.debug("reportRenderedEntityIdentifier",a),window.context.reportRenderedEntityIdentifier(a)}},d.getChangesRect=function(){return window._teads_amp.change&&window.context.initialIntersection?(window._teads_amp.change||(window._teads_amp.change=window.context.initialIntersection),window._teads_amp.change):null},d.isFalsyScreenValue=function(){var a=window._teads_amp.change.rootBounds.width>1.5*window.innerWidth;return a&&d.logger.error("AMP size seems wrong",window._teads_amp.change.rootBounds.width),a},d.bindEvents=function(){window.context.onResizeDenied(function(a,b){return d.checkResize(a,b,!1)}),window.context.onResizeSuccess(function(a,b){return d.checkResize(a,b,!0)})},d.recursive=function(a,b,c,e){d.resize(a,function(f){var g="function"==typeof e?e():e;f||g?(d.action=null,d.status=f?c:null,b(f),d.isOpen()&&d.reportRenderedEntityIdentifier()):d.action===c&&setTimeout(function(){return d.recursive(a,b,c,g)},100)})},d.resize=function(b,c){a.Context.isAmp()&&window.context.requestResize&&d.initialized&&(d.resizeRequests.push({width:d.width,height:b,done:!1,callback:c}),window.context.requestResize(d.width,b),d.logger.warn("amp request resize",d.width,b))},d.checkResize=function(b,c,e){a.ArrayHelper.forEach(d.resizeRequests,function(a){b!==a.height||c!==a.width||a.done||(a.done=!0,a.callback(e))}),e?d.logger.warn("amp request resize success",c,b):d.logger.error("amp request resize denied",c,b)},d.ratio=4/3,d.resizeRequests=[],d.logger=new a.Logger("helper.Amp"),d.hasCalled={noContentAvailable:!1,renderStart:!1,reportRenderedEntityIdentifier:!1},d}();b.Amp=d}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){var b;!function(b){!function(a){a[a.Closed=0]="Closed",a[a.Init=1]="Init",a[a.Expanded=2]="Expanded"}(b.SF_ACTION||(b.SF_ACTION={}));var c=b.SF_ACTION,d=function(){function b(){}return b.init=function(){var b=this,c=this.validSafeFrameContext();if(c)return this.logger.error("init","failed",c),a.formatSumologic.sendError("SF "+c),c;this.eventListenerManager=new a.EventListenerManager;var d=this.geom.par?this.geom.par.w:this.geom.self.w;return window.$sf.ext.register(d,1,function(a,c){return b.eventHandler(a,c)}),this.logger.debug("init - register (width-innerWidth-geom)",d,window.innerWidth,this.geom),this.listenGeom(function(){return b.geom=window.$sf.ext.geom()}),c},b.listenGeom=function(a){var b=this,c=this.geomListener.push(a);return function(){return b.geomListener[c-1]=function(){}}},b.listenFocus=function(a){var b=this,c=this.focusListener.push(a);return function(){return b.focusListener[c-1]=function(){}}},b.initSlot=function(a){var b=this;if(void 0===a&&(a=function(){}),this.logger.debug("initSlot"),0===window.innerWidth){this.logger.debug("initSlot - window.innerWidth=0 so wait for resize");var d,e=function(){0!==window.innerWidth&&(b.logger.debug("SafeFrame - window resize receive - start"),b.eventListenerManager.remove("resize"),d(),a())};this.eventListenerManager.add("resize",window,e),d=this.listenGeom(e)}else if(1===this.geom.self.w&&1===this.geom.self.h)if(window.$sf.ext.supports()["exp-push"]){this.logger.debug("initSlot - 1x1 detected - need to wait to get the slot width available");var f=function(){b.logger.debug("initSlot - 1x1 detected - expand available - get width"),b.processRequest({name:"initial expand",action:function(){return window.$sf.ext.expand({r:b.geom.exp.r,push:!0})},callback:function(d){var e="expanded"===d;b.status=e?c.Init:c.Closed,e&&(b.openWidth=b.geom.exp.r,b.logger.debug("initSlot - 1x1 detected - initial expand done - width",b.openWidth),a())}})};if(this.geom.exp.r)f();else var d=this.listenGeom(function(){b.geom.exp.r&&(d(),f())})}else this.logger.error("initSlot - 1x1 detected - but exp-push not supported");else a()},b.open=function(a,b){var d=this;void 0===b&&(b=function(){});var e=function(a){return d.processRequest({name:"open "+a,action:function(){return window.$sf.ext.expand({b:a,r:d.openWidth,push:!0})},callback:function(a){var e="expanded"===a;d.status=e?c.Expanded:c.Closed,b(e)}})},f=this.geom.par?this.geom.par.h:this.geom.self.h,g=a-f;this.status!==c.Expanded&&g>0?window.$sf.ext.supports()["exp-push"]?g<=this.geom.exp.b||this.geom.par?(this.logger.debug("open (askedHeight - currentHeight - allowed - requiredHeight)",a,f,this.geom.exp.b,g),this.status===c.Init?(this.logger.debug("open - slot already open by init - close it before"),this.close(function(){var a=Math.min(Math.floor(window.$sf.ext.geom().exp.b),g);e(a)})):e(g)):(this.logger.debug("open not allowed (askedHeight - currentHeight - allowed - requiredHeight)",a,f,this.geom.exp.b,g),b(!1)):(this.logger.error("open failed - exp-push not supported"),b(!1)):(this.logger.debug("already open (askedHeight - currentHeight - requiredHeight)",a,f,g),b(!0))},b.close=function(a){void 0===a&&(a=function(){}),this.status!==c.Closed?(this.logger.debug("close"),this.processRequest({name:"close",action:function(){return window.$sf.ext.collapse()},callback:function(){return a(!0)}}),this.status=c.Closed):a(!0)},b.validSafeFrameContext=function(){var b="";return a.Context.isIABSafeFrame()||(b="not in IABSafeFrame context"),window.$sf.ext.geom?(this.geom=window.$sf.ext.geom())||(b="window.$sf.ext.geom() return falsy value"):b="window.$sf.ext.geom not present",window.$sf.ext.supports||(b="window.$sf.ext.supports not present"),b},b.processRequest=function(a){a&&(this.logger.debug("processRequest add to list",a.name),this.requestQueue.push(a)),!this.requestCurrent&&this.requestQueue.length&&(this.requestCurrent=this.requestQueue.shift(),this.logger.debug("processRequest - process",this.requestCurrent.name),this.requestCurrent.action())},b.eventHandler=function(b,c){switch(this.logger.debug("event receive",b,c),b){case"expanded":case"collapsed":case"failed":this.requestCurrent&&this.requestCurrent.callback&&this.requestCurrent.callback(b),this.requestCurrent=null,this.processRequest();break;case"geom-update":c.cmd&&"focus-update"===c.cmd?a.ArrayHelper.forEach(this.focusListener,function(a){return a(c)}):a.ArrayHelper.forEach(this.geomListener,function(a){return a(c)});break;case"focus-change":a.ArrayHelper.forEach(this.focusListener,function(a){return a(c)})}},b.status=c.Closed,b.logger=new a.Logger("helper.SafeFrameResize"),b.requestQueue=[],b.geomListener=[],b.focusListener=[],b}();b.SafeFrameResize=d}(b=a.helper||(a.helper={}))}(teads||(teads={}));try{var teads=teads||window.top.teads}catch(e){var teads=teads||window.teads}!function(a){a.ASSETS_URL=a.ASSETS_URL||a.Constant.CONFIG.assetsURL,a.RAS_URL=a.RAS_URL||a.Constant.CONFIG.rasURL,a.TRACKING_URL=a.TRACKING_URL||a.Constant.CONFIG.trackingURL,a.USER_SYNC_URL=a.USER_SYNC_URL||a.Constant.CONFIG.syncURL,a.SUMOLOGIC_ENABLED=void 0===a.SUMOLOGIC_ENABLED||!!a.SUMOLOGIC_ENABLED,a.WITH_RAS_REQUEST=void 0===a.WITH_RAS_REQUEST||!!a.WITH_RAS_REQUEST,a.instances=a.instances||{},a.currentPlayerId=a.currentPlayerId||0,a.formatSumologic=new a.Sumologic,a.Timing.init(),a.Timing.mark("markFormatInit");var b=new a.Logger("Main");if(a.WIGOI&&a.WIGOI.valid){if(!a.WIGOI.logfile.steps.length){var c={ttp:window._ttp,ttf:window._ttf,tta:window._tta,ttc:window._ttc,tts:window._tts};b.info("_ttf object successfully retrieved",c),a.WIGOI.valid(0,1,c,a.Wigo.infoType.MODAL)}a.WIGOI.valid(1,0)}if(b.info("Init - Format initialization success"),a.SUMOLOGIC_ENABLED){var d=null;window.teads.router&&window.teads.router.routerSumologic&&(d=window.teads.router.routerSumologic.getSessionId()),a.formatSumologic.init(a.Sumologic.CONFIGS.FORMAT,d),a.formatSumologic.sendMetadata({vFormat:"2.9.2",vShared:"1.5.0",vPlayer:"2.4.19",device:a.Context.getDevice().toString(),os:a.Context.getOS().toString(),browser:a.Context.getBrowser().toString(),sf:a.Context.isIABSafeFrame(),amp:a.Context.isAmp(),fb:a.Context.isFacebookIA()})}a.Context.isAmp()&&(window.context.observeIntersection(function(b){window._teads_amp.change=b.pop(),a.helper.Amp.init()}),a.helper.Amp.init()),a.page=new a.Page,a.clear=function(){a.page.clearInstances();var b=["_tta","_ttc","_ttf","_ttp","_tts","teads"];a.ArrayHelper.forEach(b,function(a){delete window[a]})},a.Context.isFacebookIA()&&(window.document.body.style.backgroundColor="#fff"),a.Context.canChromeAndroidAutoPlay(function(b){a.page.process(),b&&a.formatSumologic.sendInfo(b)},a.ASSETS_URL+"/assets/default/autoplay.mp4")}(teads||(teads={})),__extends(window.teads,teads)}(window.teads=window.teads||{});