"use strict";(self.webpackJsonp1721376996340=self.webpackJsonp1721376996340||[]).push([[324],{1441:(e,t,n)=>{n.d(t,{A:()=>r});const r={AD_METADATA:"adMetadata",ALL_ADS_COMPLETED:"allAdsCompleted",CLICK:"click",COMPLETE:"complete",DURATION_CHANGE:"durationChange",FIRST_QUARTILE:"firstQuartile",IMPRESSION:"impression",INTERACTION:"interaction",LINEAR_CHANGED:"linearChanged",LOADED:"loaded",LOG:"log",MIDPOINT:"midpoint",PAUSED:"pause",RESUMED:"resume",SKIPPABLE_STATE_CHANGED:"skippableStateChanged",SKIPPED:"skip",STARTED:"start",THIRD_QUARTILE:"thirdQuartile",USER_CLOSE:"userClose",VOLUME_CHANGED:"volumeChange",VOLUME_MUTED:"mute",VIEWABLE_IMPRESSION:"viewable_impression",AD_ERROR:"adError",AD_PROGRESS:"adProgress"}},7913:(e,t,n)=>{n.d(t,{Ss:()=>b,s3:()=>se,DA:()=>h,sF:()=>_,nH:()=>w,Rp:()=>T});var r,i=n(1441);!function(e){e.AD_LOAD="adLoadError",e.AD_PLAY="adPlayError"}(r||(r={}));const o=function(){function e(e){this.vastAdError=e}return e.prototype.getErrorCode=function(){return this.vastAdError.code},e.prototype.getMessage=function(){return this.vastAdError.message},e.prototype.getType=function(){return this.vastAdError.type||901===this.getErrorCode()?r.AD_PLAY:r.AD_LOAD},e.prototype.getVastErrorCode=function(){return this.vastAdError.code},e.prototype.getInnerError=function(){return new Error(this.getMessage())},e}();var a=function(e,t){void 0===t&&(t={withCredentials:!1});var n=e.method||"GET",r=e.headers||{};return new Promise((function(i,o){var a=new XMLHttpRequest;a.onreadystatechange=function(){var t,n,r;4===a.readyState&&(a.status>=200&&a.status<300?(n=a.responseText,r=a.getResponseHeader("Content-Type"),i(/application\/json/.test((r||"").toLowerCase())?JSON.parse(n):n)):(t=a.status,o(new TypeError("Network request failed (".concat(t,") to ").concat(e.url)))))},a.open(n,e.url,!0),a.withCredentials=t.withCredentials||!1;for(var u=Object.keys(e.headers||{}),s=0;s=n)throw new o({code:302,message:"The maximum number of VAST wrapper redirects has been reached."});return _(e,t).then((function(e){return g(e,t,n,++r,i)}))}function g(e,t,n,r,i){return void 0===t&&(t=f),void 0===n&&(n=v),void 0===r&&(r=0),void 0===i&&(i=[]),T(e).then((function(e){if(e.adTagUri){var o=e.tracking.reduce((function(e,t){return t.type===c.error&&e.push(t.pixel),e}),i);return m(e.adTagUri,t,n,r,o).then((function(t){return w(e,t)}))}return e})).catch((function(e){var t=e,n=void 0;try{n=t.getErrorCode()}catch(e){}throw i.forEach((function(e){var t=new Image;t.setAttribute("loading","eager"),t.src=l(e,void 0,n)})),e}))}function _(e,t){return void 0===t&&(t=f),t(p(e)).catch((function(t){throw new o({code:1012,message:t&&t.message||"unable to fetch vast "+e})}))}var y=function(e){return{version:4,tracking:[],clickThrough:"",mediafiles:[],wrappers:[],adSystem:"",adId:"",adTagUri:"",adTitle:"",adParameters:"",duration:-2,creativeId:"",viewableImpressions:[],xml:e,extensions:[],verifications:[]}};function T(e){return new Promise((function(t,n){var r=function(e){return n(new o(e))},i=y(e),a=u.getXMLDoc(e).documentElement;if("parsererror"!==a.tagName)if("VAST"===a.tagName){Array.from(a.getElementsByTagName("Error")).forEach((function(e){var t=u.getNodeContent(e);t&&i.tracking.push({pixel:t,type:c.error})}));var d=a.getElementsByTagName("Ad")[0];if(d){var l=!!d.getElementsByTagName("Wrapper").length,v=!!d.getElementsByTagName("InLine").length;if(l||v)if(i.version=parseInt(u.getAttributeValue(a,"version")||"0",10),!i.version||i.version<2)r({code:102,message:"unsupported VAST version "+i.version});else{var f=d.getElementsByTagName("Creative")[0];f&&(i.creativeId=u.getAttributeValue(f,"id")||""),i.adId=u.getAttributeValue(d,"id")||"",i.adTagUri=u.getNodeContent(d.getElementsByTagName("VASTAdTagURI")[0])||"",i.adTitle=u.getNodeContent(d.getElementsByTagName("AdTitle")[0])||"",i.adSystem=u.getNodeContent(d.getElementsByTagName("AdSystem")[0])||"";var p=d.getElementsByTagName("ClickThrough")[0];p&&(i.clickThrough=u.getNodeContent(p)||""),Array.from(d.getElementsByTagName("Impression")).forEach((function(e){i.tracking.push({pixel:u.getNodeContent(e)||"",type:c.impression,offset:null})})),Array.from(d.getElementsByTagName("ClickTracking")).forEach((function(e){i.tracking.push({pixel:u.getNodeContent(e)||"",type:c.click,offset:null})}));var h=d.getElementsByTagName("Linear")[0];if(h)i.duration=E(u.getNodeContent(h.getElementsByTagName("Duration")[0]))||-2,i.adParameters=u.getNodeContent(h.getElementsByTagName("AdParameters")[0])||"",Array.from(h.getElementsByTagName("Tracking")).forEach((function(e){var t=u.getAttributeValue(e,"event")||null;t&&i.tracking.push({pixel:u.getNodeContent(e)||"",type:t,offset:E(u.getAttributeValue(e,"offset"),i.duration)})})),i.mediafiles=Array.from(h.getElementsByTagName("MediaFile")).map((function(e){var t=u.getAttributeValue(e,"type")||"";return{id:u.getAttributeValue(e,"id")||"",type:t,url:u.getNodeContent(e)||"",width:parseInt(u.getAttributeValue(e,"width")||"",10),height:parseInt(u.getAttributeValue(e,"height")||"",10),delivery:u.getAttributeValue(e,"delivery")||"",bitrate:parseInt(u.getAttributeValue(e,"bitrate")||"",10),apiFramework:u.getAttributeValue(e,"apiFramework")||"",scalable:!!u.getAttributeValue(e,"scalable"),minBitrate:parseInt(u.getAttributeValue(e,"minBitrate")||"",10),maxBitrate:parseInt(u.getAttributeValue(e,"maxBitrate")||"",10),maintainAspectRatio:"true"===u.getAttributeValue(e,"maintainAspectRatio"),codec:u.getAttributeValue(e,"codec")||"",adParameters:/(javascript|flash)/g.test(t)?String(i.adParameters):""}}));else if(v)return void r({code:201,message:"Ad does not contains tag"});i.viewableImpressions=Array.from(d.getElementsByTagName("ViewableImpression")||[]).map((function(e){return{id:u.getAttributeValue(e,"id")||"",viewable:u.getNodeContent(e.getElementsByTagName("Viewable")[0])||"",notViewable:u.getNodeContent(e.getElementsByTagName("NotViewable")[0])||"",viewUndetermined:u.getNodeContent(e.getElementsByTagName("ViewUndetermined")[0])||""}})),i.extensions=Array.from(a.getElementsByTagName("Extension")).map((function(e){return e.outerHTML}));var A=i.version>3?a.querySelector("InLine > AdVerifications"):a.querySelector("Extensions");i.verifications=null!==A?i.verifications=function(e){for(var t=[],n=0,r=Array.from(e.getElementsByTagName("Verification"));n tag available"})}else r({code:100,message:"no tag in the file"});else r({code:100,message:"XML Parsing error"})}))}var b=function(e){return JSON.parse(JSON.stringify(e))};function w(e,t){try{var n=b(e);return n.version>t.version&&(n.version=t.version),n.verifications=n.verifications.concat(t.verifications),!n.adId&&t.adId&&(n.adId=t.adId),t.adTagUri?n.adTagUri=t.adTagUri:n.adTagUri="",t.clickThrough&&(n.clickThrough=t.clickThrough),n.tracking=n.tracking.concat(t.tracking),n.adSystem=t.adSystem||n.adSystem,n.mediafiles=t.mediafiles,n.adParameters=t.adParameters,n.duration=t.duration,n.extensions=n.extensions.concat(t.extensions),n.viewableImpressions=n.viewableImpressions.concat(t.viewableImpressions),n.wrappers.push(b(t)),n.wrappers=n.wrappers.concat(t.wrappers.map((function(e){return b(e)}))),n}catch(e){var r=e instanceof Error?e.message:"".concat(e);throw new o({code:100,message:"merge throw an exception "+r})}}function E(e,t){if(void 0===t&&(t=0),!e)return null;var n=e.match(/^\d{2}:\d{2}:\d{2}(\.\d{3})?$/),r=e.match(/^(\d+)|(\d+\.\d+)%$/);if(n){var i=e.split(":").map((function(e,t){return parseInt(e,10)*Math.pow(60,2-t)})).reduce((function(e,t){return e+t}));return Math.floor(i)||null}return r&&Math.ceil(parseInt(r[1],10)*t/100)||null}function G(e){if(isNaN(e)||e<0)return"00:00:00";if(e<60)return"00:00:"+(e<10?"0":"")+e;var t=Math.floor(e/60),n=e-60*t;return"00:"+(t<10?"0":"")+t+":"+(n<10?"0":"")+n}var I,S='\n\n \n <%%vastType%%>\n %%adSystem%%\n %%vastAdTagUri%%\n \n %%verificationsTag%%\n %%errorTag%%\n %%impressionTag%%\n %%viewableImpressionsTag%%\n \n \n \n %%duration%%\n %%adParameters%%\n %%trackingEvents%%\n %%videoClickTag%%\n %%mediafilesTag%%\n \n \n \n %%extensionsTag%%\n \n \n\n',k=function(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r={});var i=Object.keys(r).length>0?" "+Object.keys(r).map((function(e){return"".concat(e,'="').concat(r[e]||"",'"')})).join(" "):"",o=n?""):t;return"<".concat(e).concat(i,">").concat(o,"")},x=["id","type","width","height","delivery","bitrate","minBitrate","maxBitrate","maintainAspectRatio","scalable","codec","apiFramework"];function C(e){try{var t={click:[],impression:[],error:[],event:[]};e.tracking.forEach((function(e){switch(e.type){case c.error:t.error.push(e);break;case c.impression:t.impression.push(e);break;case c.click:t.click.push(e);break;default:t.event.push(e)}}));var n=t.event.length>0?t.event.map((function(e){var t={event:e.type};return e.offset&&(t.offset=G(e.offset)),k("Tracking",e.pixel,!0,t)})).join(""):"",r=t.click.length>0?t.click.map((function(e){return k("ClickTracking",e.pixel,!0)})).join(""):"",i=e.clickThrough&&k("ClickThrough",e.clickThrough,!0),a=e.adTagUri?"":""+e.mediafiles.map((function(e){return k("MediaFile",e.url,!0,x.filter((function(t){return t in e})).reduce((function(t,n){return t[n]=e[n]||"",t}),{}))})).join("")+"",u=e.adTagUri?""):"",s=e.adTagUri?"":""+G(e.duration)+"",d=e.adParameters?""):"",l=function(e){var t,n=[];n.push("");for(var r=0,i=e;r'));for(var a=0,u=o.javascriptResources;a')):n.push('')),n.push("")),n.push("")}n.push(""),n.push("")),n.push(""),n.push("");for(var c=0,d=o.events;c')),n.push("")),n.push("")}n.push(""),n.push("")}return n.push(""),n.join("")}(e.verifications),v=e.extensions.filter((function(e){return!e.match(/^3?f=l:v.push(''.concat(l,""));var p=e.viewableImpressions?e.viewableImpressions.map((function(e){return'\n ').concat(k("Viewable",e.viewable,!0),"\n ").concat(k("NotViewable",e.notViewable,!0),"\n ").concat(k("ViewUndetermined",e.viewUndetermined,!0),"\n ")})).join(""):"";return S.replace(/%%version%%/gi,String(e.version)).replace(/%%adId%%/gi,e.adId).replace(/%%adSystem%%/gi,e.adSystem).replace(/%%adTitle%%/gi,e.adTitle).replace(/%%creativeId%%/gi,String(e.creativeId)).replace(/%%errorTag%%/gi,t.error.map((function(e){return k("Error",e.pixel,!0)})).join("")).replace(/%%impressionTag%%/gi,t.impression.map((function(e){return k("Impression",e.pixel,!0)})).join("")).replace(/%%verificationsTag%%/gi,f).replace(/%%viewableImpressionsTag%%/gi,p).replace(/%%duration%%/gi,s).replace(/%%trackingEvents%%/gi,n).replace(/%%videoClickTag%%/gi,i+r).replace(/%%mediafilesTag%%/gi,a).replace(/%%extensionsTag%%/gi,v.join("")).replace(/%%adParameters%%/gi,d).replace(/%%vastType%%/gi,e.adTagUri?"Wrapper":"InLine").replace(/%%vastAdTagUri%%/gi,u)}catch(e){var h=e instanceof Error?e.message:"".concat(e);throw new o({code:100,message:"toVastXml generate an error "+h})}}!function(e){e.LATEST="latest",e.v3_330_0="3.330.0"}(I||(I={}));var N=Math.round(1e11*Math.random());function P(e,t){void 0===e&&(e={}),void 0===t&&(t="seedtag_creative");var n=document.createElement("iframe");return n.id=t,n.name=t,n.title="".concat(t,"-").concat(N),n.style.position="static",n.style.margin="0px",n.style.padding="0px",n.style.width="100%",n.style.height="100%",n.style.border="0px",n.style.overflow="hidden",n.style.setProperty("min-height","initial","important"),n.style.setProperty("min-width","initial","important"),n.setAttribute("scrolling","no"),n.setAttribute("loading","eager"),n.frameBorder="0",n.style.maxWidth="unset",Object.keys(e).forEach((function(t){n.style[t]=e[t]})),n}function L(e,t){D(e,t)||(e.className+=" "+t,e.className=e.className.trim())}function R(e,t){if(D(e,t)){var n=e.className.split(" ");n.splice(n.indexOf(t),1),e.className=n.join(" ").trim()}}function D(e,t){return-1!==e.className.split(" ").indexOf(t)}var V,M,H=function(e){return String(e.getAd().getApiFramework()).toLocaleLowerCase().indexOf("vpaid")>-1},J=function(e){try{return e===e.parent?e:e.parent.document?J(e.parent):e}catch(t){return e}},j=n(5608),z=function(){function e(t,n){if(void 0===n&&(n={}),this.type=t,this.data={},"object"==typeof n&&Array.isArray(n))switch(t){case e.AdLog:case e.AdError:this.data.code=901,this.data.message=n[0];break;case e.AdClickThru:this.data={url:n[0],id:n[1],playerHandles:n[2]};break;case e.AdInteraction:this.data={id:n[0]}}else if("object"==typeof n)this.data=n;else if("string"==typeof n)switch(t){case e.AdLog:case e.AdError:this.data.code=901,this.data.message=n;break;case e.AdInteraction:this.data={id:n}}}return e.AdLoaded="AdLoaded",e.AdStarted="AdStarted",e.AdStopped="AdStopped",e.AdSkipped="AdSkipped",e.AdLinearChange="AdLinearChange",e.AdSizeChange="AdSizeChange",e.AdExpandedChange="AdExpandedChange",e.AdSkippableStateChange="AdSkippableStateChange",e.AdRemainingTimeChange="AdRemainingTimeChange",e.AdDurationChange="AdDurationChange",e.AdVolumeChange="AdVolumeChange",e.AdImpression="AdImpression",e.AdVideoStart="AdVideoStart",e.AdVideoFirstQuartile="AdVideoFirstQuartile",e.AdVideoMidpoint="AdVideoMidpoint",e.AdVideoThirdQuartile="AdVideoThirdQuartile",e.AdVideoComplete="AdVideoComplete",e.AdClickThru="AdClickThru",e.AdInteraction="AdInteraction",e.AdUserAcceptInvitation="AdUserAcceptInvitation",e.AdUserMinimize="AdUserMinimize",e.AdUserClose="AdUserClose",e.AdPaused="AdPaused",e.AdPlaying="AdPlaying",e.AdLog="AdLog",e.AdError="AdError",e}(),O=function(){function e(){this.listeners={},this.listenersScope={},this.eventQueue=[],this.isProcessing=!1}return e.prototype.subscribe=function(e,t,n){this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e),this.listenersScope[t]=this.listenersScope[t]||[],this.listenersScope[t].push(n||null)},e.prototype.unsubscribe=function(e,t){if(this.listeners[t]){var n=this.listeners[t].indexOf(e);n>=0&&(this.listeners[t][n]=function(){})}},e.prototype.clearListeners=function(){this.listeners={},this.listenersScope={}},e.prototype.handleEvent=function(e){this.eventQueue.push(e),this.processQueue()},e.prototype.processQueue=function(){if(!this.isProcessing&&this.eventQueue.length>0){var e=this.eventQueue.shift();e&&this.processEvent(e)}},e.prototype.processEvent=function(e){if(!this.isProcessing){this.isProcessing=!0;for(var t=this.listeners[e.type]||[],n=0,r=t.length;n0&&this.video.currentTime>=0?this.video.duration-this.video.currentTime:-1},e.prototype.getAdDuration=function(){return this.video&&this.video.duration>0?this.video.duration:-1},e.prototype.getAdVolume=function(){return this.video?this.video.muted?0:this.video.volume:0},e.prototype.setAdVolume=function(e){return this.video?(this.video.muted=0===e,this.video.volume=e,this.video.muted?0:this.video.volume):0},e.prototype.expandAd=function(){return!1},e.prototype.collapseAd=function(){return!1},e.prototype.getAdLinear=function(){return!0},e.prototype.getAdWidth=function(){return this.width},e.prototype.getAdHeight=function(){return this.height},e.prototype.getAdExpanded=function(){return!1},e.prototype.getAdSkippableState=function(){return!0},e.prototype.getAdCompanions=function(){return""},e.prototype.getAdIcons=function(){return!1},e.prototype.handshakeVersion=function(e){return"2.0"},e.prototype.subscribe=function(e,t,n){this.eventHandler.subscribe(e,t,n)},e.prototype.unsubscribe=function(e,t){this.eventHandler.unsubscribe(e,t)},e.prototype.initAd=function(e,t,n,r,i,o){var a,u=this;this.status=M.LOADING,this.width=e,this.height=t,this.viewMode=n;try{i=function(e){if("object"==typeof e&&e.AdParameters&&"string"==typeof e.AdParameters&&(e=e.AdParameters),e&&"string"==typeof e){t=e,(n=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$").exec(t))&&n.length>0?e=q(e):0===e.indexOf("%7B")&&(e=decodeURIComponent(e));try{e=JSON.parse(e)}catch(t){throw"Unable to JSON.parse adParameter string: "+e}}var t,n;if(!e||"object"!=typeof e)throw"adParameter is not an object: "+e;return e}(i)}catch(e){return void this.dispatchVpaidEvent(z.AdError,"invalid creative data : "+i)}for(var s in this.parameters=this.config,i)this.parameters[s]=i[s];if(null===(a=this.parameters.videoSources)||void 0===a?void 0:a.length)if(this.environmentVars=o,this.environmentVars.videoSlot||(this.environmentVars.videoSlot=document.createElement("video")),this.environmentVars.videoSlot.setAttribute&&(this.environmentVars.videoSlot.setAttribute("webkit-playsinline","true"),this.environmentVars.videoSlot.setAttribute("playsinline","true"),this.environmentVars.videoSlot.setAttribute("muted","true")),this.environmentVars.slot){if(this.video=this.environmentVars.videoSlot,this.video.style.backgroundColor="black",this.initListeners(),this.createContainer(this.environmentVars.slot),this.video.addEventListener("error",(function(e){u.handleVideoError(e)})),this.video.preload="metadata",1===this.parameters.videoSources.length&&this.parameters.videoSources[0].url.endsWith(".mpd")&&void 0!==dashjs)dashjs.MediaPlayer().create().initialize(this.video,this.parameters.videoSources[0].url,!0);else for(var c=0,d=this.parameters.videoSources;c=3?Promise.resolve():new Promise((function(t){var n=e.oncanplay;e.oncanplay=function(r){n&&n.bind(e,r)(),t()}}))).then((function(){t.video.play().then((function(){t.dispatchVpaidEvent(z.AdImpression),t.dispatchVpaidEvent(z.AdVideoStart)})).catch((function(e){t.handleException(e,"startAd")}))}))},e.prototype.skipAd=function(){this.status<=M.SKIPPING?this.dispatchVpaidEvent(z.AdLog,"Ad is already stopped or is skipping"):(this.status=M.SKIPPING,this.video.pause(),this.video.style.display="none",this.dispatchVpaidEvent(z.AdSkipped))},e.prototype.stopAd=function(){this.status<=M.STOPPING?this.dispatchVpaidEvent(z.AdLog,"Ad is already stopped"):(this.status=M.STOPPING,this.parameters.keepVideoOnStop||(this.removeVideo(),this.dispatchVpaidEvent(z.AdStopped)),this.eventHandler.clearListeners())},e.prototype.resizeAd=function(e,t,n){this.setSize(e,t),this.dispatchVpaidEvent(z.AdSizeChange)},e.prototype.pauseAd=function(){try{this.video.pause()}catch(e){this.handleException(e,"pauseAd")}},e.prototype.resumeAd=function(){try{this.video.play()}catch(e){this.handleException(e,"resumeAd")}},e.prototype.createContainer=function(e){this.container||(this.container=document.createElement("div"),this.container.style.position="relative",e.appendChild(this.container))},e.prototype.onAdVideoCompleteDispatched=function(){var e=this;this.parameters.noAutoStop?(this.video.addEventListener("seeked",(function(){e.video.pause()}),!1),this.video.currentTime=1):this.stopAd()},e.prototype.dispatchVpaidEvent=function(e,t){this.handleVPAIDEvent(new z(e,t))},e.prototype.handleVPAIDEvent=function(e){if(!(this.status===M.SKIPPING&&e.type!==z.AdSkipped||this.status===M.STOPPING&&e.type!==z.AdStopped||this.status<=M.STOPPED||this.status===M.STOPPING&&e.type!==z.AdStopped)){switch(e.type){case z.AdLoaded:this.status=M.LOADED;break;case z.AdStarted:this.status=M.STARTED;break;case z.AdVideoStart:case z.AdPlaying:this.status=M.PLAYING;break;case z.AdPaused:this.status=M.PAUSED;break;case z.AdSkipped:this.status=M.SKIPPED;break;case z.AdStopped:this.status=M.STOPPED;break;case z.AdDurationChange:case z.AdRemainingTimeChange:var t=this.getAdDuration(),n=t-this.getAdRemainingTime();t>0&&n>=.25*t&&!this.trackingRaised.AdVideoFirstQuartile?this.dispatchVpaidEvent(z.AdVideoFirstQuartile):t>0&&n>=.5*t&&!this.trackingRaised.AdVideoMidpoint?this.dispatchVpaidEvent(z.AdVideoMidpoint):t>0&&n>=.75*t&&!this.trackingRaised.AdVideoThirdQuartile&&this.dispatchVpaidEvent(z.AdVideoThirdQuartile);break;case z.AdVideoFirstQuartile:case z.AdVideoMidpoint:case z.AdVideoThirdQuartile:if(this.trackingRaised[e.type])return;this.trackingRaised[e.type]=!0;break;case z.AdVideoComplete:this.status=M.COMPLETE}this.eventHandler.handleEvent(e),this.status===M.SKIPPED&&this.stopAd(),e.type===z.AdVideoComplete&&this.onAdVideoCompleteDispatched()}},e.prototype.handleException=function(e,t){var n='method "'+t+'" threw an exception: '+e.toString();this.dispatchVpaidEvent(z.AdError,n)},e.prototype.removeVideo=function(){try{this.video&&this.video.parentNode&&this.video.parentNode.removeChild(this.video)}catch(e){this.dispatchVpaidEvent(z.AdLog,"cannot remove video from DOM")}},e.prototype.setSize=function(e,t){this.width=e,this.height=t,this.video&&(this.video.width=this.width,this.video.height=this.height),this.container.style.width=e+"px",this.container.style.height=t+"px"},e.prototype.initListeners=function(){var e=this;for(var t in this.eventMap)this.video.addEventListener(t,(function(t){e.handleVideoEvent(t)}),!1)},e.prototype.handleVideoError=function(e){if("error"===e.type){var t=this.video?this.video.error:null;if(t)switch(t.code){case 1:break;case 2:this.dispatchVpaidEvent(z.AdError,"video error : A network error caused the ressource to stop being fetched");break;case 3:this.dispatchVpaidEvent(z.AdError,"video error : A decoding error caused the ressource to stop being fetched");break;case 4:this.dispatchVpaidEvent(z.AdError,"video error : The associated ressource has been detected to be not suitable")}else this.dispatchVpaidEvent(z.AdError,"video error : unkown error")}},e.prototype.handleVideoEvent=function(e){try{var t=this.eventMap[e.type];switch(e.type){case"pause":if(this.video.currentTime===this.video.duration||this.status<=M.SKIPPING||this.status===M.COMPLETE)return;break;case"play":case"playing":if(this.status!==M.PAUSED)return}this.dispatchVpaidEvent(t)}catch(t){var n='Creative threw an exception when handling "'+e.type+'" HTML5 video event: '+(t instanceof Error?t.message:"".concat(t));this.dispatchVpaidEvent(z.AdLog,n),this.dispatchVpaidEvent(z.AdError,n)}},e}(),F=function(){function e(){this.eventHandler=new O}return e.prototype.getVPAID=function(){return this.vpaidAd},e.prototype.getAdRemainingTime=function(){return this.vpaidAd?this.vpaidAd.getAdRemainingTime():-2},e.prototype.getAdDuration=function(){return this.vpaidAd?this.vpaidAd.getAdDuration():0},e.prototype.getAdVolume=function(){return this.vpaidAd?this.vpaidAd.getAdVolume():0},e.prototype.setAdVolume=function(e){return this.vpaidAd&&this.vpaidAd.setAdVolume(e),e},e.prototype.expandAd=function(){return!1},e.prototype.collapseAd=function(){return!1},e.prototype.getAdLinear=function(){return!0},e.prototype.getAdWidth=function(){return this.vpaidAd?this.vpaidAd.getAdWidth():0},e.prototype.getAdHeight=function(){return this.vpaidAd?this.vpaidAd.getAdHeight():0},e.prototype.getAdExpanded=function(){return!1},e.prototype.getAdSkippableState=function(){return!0},e.prototype.getAdCompanions=function(){return""},e.prototype.getAdIcons=function(){return!1},e.prototype.handshakeVersion=function(e){return"2.0"},e.prototype.initAd=function(e,t,n,r,i,o){this.vpaidAd&&this.vpaidAd.initAd(e,t,n,r,i,o)},e.prototype.startAd=function(){this.vpaidAd&&this.vpaidAd.startAd()},e.prototype.stopAd=function(){this.vpaidAd&&this.vpaidAd.stopAd()},e.prototype.skipAd=function(){this.vpaidAd&&this.vpaidAd.skipAd()},e.prototype.pauseAd=function(){this.vpaidAd&&this.vpaidAd.pauseAd()},e.prototype.resumeAd=function(){this.vpaidAd&&this.vpaidAd.resumeAd()},e.prototype.resizeAd=function(e,t,n){this.vpaidAd&&this.vpaidAd.resizeAd(e,t,n)},e.prototype.subscribe=function(e,t,n){this.eventHandler.subscribe(e,t,n)},e.prototype.unsubscribe=function(e,t){this.eventHandler.unsubscribe(e,t)},e.prototype.triggerEvent=function(e,t){void 0===t&&(t={}),this.eventHandler.handleEvent(new z(e,t))},e.prototype.setVPAID=function(e){var t=this;Object.keys(z).map((function(n){var r=z[n];e.subscribe((function(){for(var e=[],n=0;n0?e:this.vastAd.duration},e.prototype.getHeight=function(){return this.vpaidAd.getAdHeight()},e.prototype.getMediaUrl=function(){return this.mediafile&&this.mediafile.url||""},e.prototype.getSkipTimeOffset=function(){return 0},e.prototype.getTitle=function(){return this.vastAd.adTitle||""},e.prototype.getVastMediaHeight=function(){return this.mediafile&&this.mediafile.height||0},e.prototype.getVastMediaWidth=function(){return this.mediafile&&this.mediafile.width||0},e.prototype.getWidth=function(){return this.vpaidAd.getAdWidth()},e.prototype.getWrapperAdIds=function(){return this.vastAd.wrappers.map((function(e){return e.adId||""}))},e.prototype.getWrapperAdSystems=function(){return this.vastAd.wrappers.map((function(e){return e.adSystem||""}))},e.prototype.getWrapperCreativeIds=function(){return this.vastAd.wrappers.map((function(e){return e.creativeId||""}))},e.prototype.isLinear=function(){return!0},e}();var X;!function(e){e.VPAIDJS="vpaidjs",e.MP4="mp4",e.WEBM="webm",e.MPEG="mpeg",e.DASH="mpd"}(X||(X={}));var Z=function(){function e(){this.res=[[/javascript/i,X.VPAIDJS],[/video\/mp4/i,X.MP4],[/video\/webm/i,X.WEBM],[/video\/mpe?g/i,X.MPEG],[/application\/dash\+xml/,X.DASH]]}return e.prototype.match=function(e){for(var t=0,n=this.res;t=1?{diffA:Math.abs(e.width-r),diffB:Math.abs(t.width-r)}:{diffA:Math.abs(e.height-i),diffB:Math.abs(t.height-i)},u=a.diffA,s=a.diffB;return u!==s?u-s:n.formatsPriority[n.formatMatcher.match(e.type)]-n.formatsPriority[n.formatMatcher.match(t.type)]}))},e}();const $=K;var ee,te,ne=((ee={})[z.AdError]="error",ee[z.AdClickThru]="click",ee[z.AdPaused]="pause",ee[z.AdPlaying]="resume",ee[z.AdSkipped]="skip",ee[z.AdStarted]="creativeView",ee[z.AdVideoStart]="start",ee[z.AdVideoFirstQuartile]="firstQuartile",ee[z.AdVideoMidpoint]="midpoint",ee[z.AdVideoThirdQuartile]="thirdQuartile",ee[z.AdVideoComplete]="complete",ee[z.AdImpression]="impression",ee[z.AdUserClose]="close",ee[z.AdRemainingTimeChange]="progress",ee[z.AdLoaded]="loaded",ee),re=[z.AdError,z.AdSkipped,z.AdStarted,z.AdVideoStart,z.AdVideoFirstQuartile,z.AdVideoMidpoint,z.AdVideoThirdQuartile,z.AdVideoComplete,z.AdImpression,z.AdUserClose,z.AdClickThru],ie=((te={})[i.A.ALL_ADS_COMPLETED]=z.AdStopped,te[i.A.COMPLETE]=z.AdVideoComplete,te[i.A.DURATION_CHANGE]=z.AdDurationChange,te[i.A.FIRST_QUARTILE]=z.AdVideoFirstQuartile,te[i.A.IMPRESSION]=z.AdImpression,te[i.A.INTERACTION]=z.AdInteraction,te[i.A.LINEAR_CHANGED]=z.AdLinearChange,te[i.A.LOADED]=z.AdLoaded,te[i.A.LOG]=z.AdLog,te[i.A.MIDPOINT]=z.AdVideoMidpoint,te[i.A.PAUSED]=z.AdPaused,te[i.A.RESUMED]=z.AdPlaying,te[i.A.SKIPPABLE_STATE_CHANGED]=z.AdSkippableStateChange,te[i.A.SKIPPED]=z.AdSkipped,te[i.A.STARTED]=z.AdStarted,te[i.A.THIRD_QUARTILE]=z.AdVideoThirdQuartile,te[i.A.USER_CLOSE]=z.AdUserClose,te[i.A.VOLUME_CHANGED]=z.AdVolumeChange,te[i.A.AD_ERROR]=z.AdError,te[i.A.CLICK]=z.AdClickThru,te[i.A.AD_PROGRESS]=z.AdRemainingTimeChange,te),oe=Object.keys(ie).map((function(e){return{adEventName:e,vpaidEventName:ie[e]}})).reduce((function(e,t){return e[t.vpaidEventName]=t.adEventName,e}),{}),ae=["skip","creativeView","start","impression","firstQuartile","midpoint","thirdQuartile","complete","error","progress"],ue=function(){function e(e,t,n){void 0===n&&(n={});var r=this;this.mediafiles=[],this.vpaidAd=new F,this.listeners=new Map,this.tracking=[],this.vpaidEventQueue=[],this.isProcessingVpaidEvent=!1,this.viewableImpressions=[],this.isMuted=!0,this.isStopped=!1,this.settings={timeout:8e3},this.triggeredEvents=[],this.vastAd=e,this.viewableImpressions=this.vastAd.viewableImpressions.map((function(e){return(0,j.Cl)((0,j.Cl)({},e),{tracked:!1})})),this.container=t,this.settings=(0,j.Cl)((0,j.Cl)({},this.settings),n),this.resolver=new $({mediaPlayerSupport:new Q}),Object.keys(z).forEach((function(e){r.vpaidAd.subscribe((function(){for(var t=[],n=0;n-1;v.resizeVpaidContainer(e,t),r||(v.vpaidContainer.appendChild(v.videoContent),i||(v.videoContent.style.background=v.settings.backgroundColor||"black"));var o,a,u,s=function(i,o,a){var u;v.vpaidAd.setVPAID(i);var s=setTimeout((function(){v.handleVpaidEvent(new z(z.AdError,{code:402,message:"timeout initAd after "+v.settings.timeout}))}),v.settings.timeout);v.vpaidAd.subscribe((function(){return clearTimeout(s)}),z.AdLoaded),v.vpaidAd.initAd(e,t,n,(null===(u=v.mediafiles)||void 0===u?void 0:u.length)&&v.mediafiles[0].bitrate||512,o,{slot:a,videoSlot:r||v.videoContent,videoSlotCanAutoPlay:!0})};i?(o=f.url,a=v.vpaidContainer,u={timeout:v.settings.timeout},void 0===u&&(u={}),new Promise((function(e,t){var n=document.createElement("div");n.style.position="relative",n.style.width="100%",n.style.height="100%",a.appendChild(n);var r=Date.now()+Math.round(1e3*Math.random()),i=P();i.id="vpaid-"+r,i.style.width="100%",i.style.height="100%",n.appendChild(i);var s=a.ownerDocument.defaultView,c=i.contentWindow,d="vpaidjsload_"+r,l="ad-container",v=function(e){s[d]=function(){},t(e)};s[d]=function(t,n){if(s[d]=function(){},t)try{var r=c.getVPAIDAd(),i=c.document.getElementById(l);e({vpaidAd:r,container:i})}catch(e){return void v("getVPAIDAd() throw an exception "+(e&&e.message))}else v("callback failled : "+n)};var f=""+"")+'