/*! * artplayer-plugin-vast.js v1.0.0 * Github: https://github.com/zhw2590582/ArtPlayer * (c) 2017-2025 Harvey Zack * Released under the MIT License. */ !function(e,t,i,n,s){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o="function"==typeof r[n]&&r[n],a=o.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,i){if(!a[t]){if(!e[t]){var s="function"==typeof r[n]&&r[n];if(!i&&s)return s(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var h=Error("Cannot find module '"+t+"'");throw h.code="MODULE_NOT_FOUND",h}c.resolve=function(i){var n=e[t][1][i];return null!=n?n:i},c.cache={};var l=a[t]=new d.Module(t);e[t][0].call(l.exports,c,l,l.exports,this)}return a[t].exports;function c(e){var t=c.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=a,d.parent=o,d.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(d,"root",{get:function(){return r[n]}}),r[n]=d;for(var h=0;hr);var s=e("@glomex/vast-ima-player");function r(e){return async t=>{let{template:i,constructor:n}=t,{createElement:r,setStyles:o,append:a}=n.utils,{$video:u,$player:d}=i;await (0,s.loadImaSdk)();let h=window.google.ima,l=new h.AdsRenderingSettings,c=new s.PlayerOptions,f=`art-${Date.now()}`,p=r("div");a(d,p),p.id=f,o(p,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"150",display:"none"});let v=new s.Player(h,u,p,l,c);return"function"==typeof e&&await e({art:t,id:f,ima:h,imaPlayer:v,$container:p,playUrl:function(e){let t=new h.AdsRequest;t.adTagUrl=e,v.playAds(t)},playRes:function(e){let t=new h.AdsRequest;t.adsResponse=e,v.playAds(t)}}),{name:"artplayerPluginVast"}}}"undefined"!=typeof window&&(window.artplayerPluginVast=r)},{"@glomex/vast-ima-player":"bQPGX","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bQPGX:[function(e,t,i){var n,s,r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(i),r.export(i,"Player",()=>eu),r.export(i,"PlayerError",()=>j),r.export(i,"PlayerEvent",()=>k),r.export(i,"PlayerOptions",()=>M),r.export(i,"loadImaSdk",()=>u);var o=null,a=function(){o=null},u=function(){var e=window;return e.google&&e.google.ima?Promise.resolve(e.google.ima):o||((o=new Promise(function(e,t){var i=document.createElement("script");i.async=!0,i.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",i.onload=e,i.onerror=t,document.body.appendChild(i)}).then(function(){return e.google.ima})).then(a).catch(a),o)};function d(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=Array(t);i-1&&(g(this,J)[J].splice(t,1),this.g(g(this,J)[J]))},i.resizeAd=function(e,t){g(this,F)[F]=e,g(this,G)[G]=t,g(this,V)[V]&&g(this,V)[V].resize(e,t,this.k()),g(this,N)[N].style.width=e+"px",g(this,N)[N].style.height=t+"px"},i.reset=function(e){void 0===e&&(e=!1),e&&(g(this,X)[X]=!1,g(this,K)[K]=!1,g(this,Z)[Z]=!1),this.C(),g(this,J)[J]=[],g(this,er)[er]=!1,g(this,ei)[ei]=void 0,g(this,V)[V]&&g(this,V)[V].destroy(),g(this,V)[V]=void 0,g(this,z)[z].settings.setAutoPlayAdBreaks(!0),e&&this.P(),g(this,N)[N].style.display="none"},i.P=function(){g(this,H)[H]&&(g(this,H)[H].removeEventListener(g(this,z)[z].AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.u,!1),g(this,H)[H].removeEventListener(g(this,z)[z].AdErrorEvent.Type.AD_ERROR,this.l,!1),g(this,H)[H].destroy()),g(this,B)[B]&&g(this,B)[B].destroy()},i.destroy=function(){var e,t,i,n,s=this;this.reset(!0),g(this,x)[x].destroy(),I.forEach(function(e){g(s,L)[L].removeEventListener(e,s.o)}),null==(e=g(this,H)[H])||e.removeEventListener(g(this,z)[z].AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.u,!1),null==(t=g(this,B)[B])||t.destroy(),null==(i=g(this,H)[H])||i.destroy(),g(this,X)[X]=!1,g(this,Z)[Z]=!1,g(this,K)[K]=!1,null==(n=g(this,q)[q])||n.disconnect()},i.isCustomPlaybackUsed=function(){return!1===g(this,z)[z].settings.getDisableCustomPlaybackForIOS10Plus()&&!g(this,N)[N].querySelector("video")},i.C=function(){window.clearTimeout(g(this,en)[en]),window.clearTimeout(g(this,es)[es]),g(this,en)[en]=void 0,g(this,es)[es]=void 0,g(this,Q)[Q]=void 0,g(this,ee)[ee]=void 0,g(this,et)[et]=void 0,g(this,N)[N].style.display="none",g(this,N)[N].classList.remove("nonlinear"),g(this,V)[V]&&this.R()},i.o=function(e){var t=this;if(g(this,x)[x].enabled||"volumechange"===e.type){if("timeupdate"===e.type){if(g(this,L)[L].currentTime<.5)return;if(g(this,V)[V]){var i=g(this,V)[V].getCuePoints().filter(function(e){return e>=0&&e-1&&(g(this,L)[L].currentTime=g(this,L)[L].duration-1e-5,g(this,Z)[Z]=!0),g(this,H)[H].contentComplete(),g(this,V)[V]||this.T()),!window.ResizeObserver&&g(this,W)[W].autoResize&&"loadedmetadata"===e.type){var n=g(this,L)[L],s=n.offsetHeight,r=n.offsetWidth;g(this,F)[F]=r,g(this,G)[G]=s,this.R()}g(this,$)[$]&&"volumechange"!==e.type||this.dispatchEvent(new T(e.type))}},i.S=function(e){var t=this,i=g(this,z)[z].AdEvent;switch(e.type){case i.Type.LOADED:var n=e.getAd();g(this,ei)[ei]&&0===g(this,J)[J].length?g(this,ei)[ei]({ad:n,start:function(){t.M(),g(t,ei)[ei]=void 0},startWithoutReset:function(){t.M()}}):g(this,Y)[Y]=n;break;case i.Type.AD_BREAK_READY:this.C(),g(this,ei)[ei]?(g(this,ei)[ei]({ad:g(this,Y)[Y],adBreakTime:e.getAdData().adBreakTime,start:function(){t.M(),g(t,ei)[ei]=void 0},startWithoutReset:function(){t.M()}}),g(this,Y)[Y]=void 0):this.M();break;case i.Type.STARTED:var s=g(this,Q)[Q]=e.getAd();s.getAdPodInfo().getAdPosition()>1&&g(this,V)[V].setVolume(g(this,V)[V].getVolume()),g(this,N)[N].classList.remove("nonlinear"),this.R(),s.isLinear()?(g(this,x)[x].disable(),g(this,et)[et]=s.getDuration(),g(this,ee)[ee]=0):(g(this,N)[N].classList.add("nonlinear"),this.I()),g(this,N)[N].style.display="",g(this,er)[er]&&(g(this,er)[er]=!1,g(this,V)[V].pause());break;case i.Type.ALL_ADS_COMPLETED:if(g(this,Z)[Z])return;this.isCustomPlaybackUsed()&&g(this,Q)[Q]&&-1!==g(this,Q)[Q].getAdPodInfo().getTimeOffset()&&this.I(),this.reset();break;case i.Type.CONTENT_PAUSE_REQUESTED:this.C(),g(this,Q)[Q]=e.getAd(),g(this,N)[N].style.display="",g(this,L)[L].pause(),this.R(),g(this,Q)[Q]&&this.A(g(this,Q)[Q].getAdPodInfo().getTimeOffset()),g(this,V)[V].setVolume(g(this,L)[L].muted?0:g(this,L)[L].volume),g(this,x)[x].disable(),g(this,et)[et]=g(this,Q)[Q].getDuration(),g(this,ee)[ee]=0;break;case i.Type.CONTENT_RESUME_REQUESTED:var r=!!g(this,Q)[Q];if(r){var o=g(this,V)[V].getVolume();g(this,L)[L].muted=0===o,g(this,L)[L].volume=g(this,eo)[eo]}g(this,Z)[Z]&&(g(this,L)[L].currentTime=g(this,L)[L].duration+1,g(this,Z)[Z]=!1),g(this,L)[L].ended?(this.reset(),this.T()):this.C(),r&&(g(this,er)[er]=!1,this.I());break;case i.Type.AD_METADATA:this.g(g(this,V)[V].getCuePoints()),-1===g(this,J)[J].indexOf(0)&&(g(this,ei)[ei]?g(this,ei)[ei]({start:function(){t.I(),g(t,ei)[ei]=void 0},startWithoutReset:function(){t.I()}}):this.I());break;case i.Type.AD_PROGRESS:var a=e.getAdData();g(this,ee)[ee]=a.currentTime,g(this,et)[et]=a.duration;break;case i.Type.LOG:var u=e.getAdData();g(this,ei)[ei]?g(this,ei)[ei]({start:function(){t.I(),g(t,ei)[ei]=void 0},startWithoutReset:function(){t.I()}}):u.adError&&!g(this,Q)[Q]&&this.I();break;case i.Type.VOLUME_CHANGED:var d=g(this,V)[V].getVolume();d>0&&(g(this,eo)[eo]=d)}},i.l=function(e){this.j(this.B(e))},i.u=function(e){var t,i=this,n=g(this,z)[z],s=n.AdEvent,r=n.AdErrorEvent.Type.AD_ERROR;window.clearTimeout(g(this,en)[en]);var o=g(this,V)[V]=e.getAdsManager(g(this,x)[x],g(this,U)[U]);Object.keys(s.Type).forEach(function(e){o.addEventListener(s.Type[e],function(t){if(i.S(t),k[e]){var n=["LOG","AD_PROGRESS"].indexOf(e)>-1;i.dispatchEvent(new T(k[e],{detail:{ad:t.getAd()||g(i,Q)[Q],adData:n?t.getAdData():{}}}))}})}),o.addEventListener(r,function(e){return i.j(i.B(e))});try{o.init(g(this,F)[F],g(this,G)[G],this.k()),o.setVolume(g(this,L)[L].muted?0:g(this,L)[L].volume),null==(t=g(this,B)[B])||t.initialize(),g(this,ei)[ei]||this.M()}catch(e){this.j(new j(e.message))}},i.M=function(){if(g(this,K)[K]||(this.dispatchEvent(new T(k.MEDIA_START)),g(this,K)[K]=!0),g(this,V)[V])try{g(this,V)[V].start()}catch(e){this.j(new j(e.message))}else this.I()},i.T=function(){var e=this;setTimeout(function(){g(e,X)[X]=!1,g(e,K)[K]=!1,g(e,Z)[Z]=!1,e.dispatchEvent(new T(k.MEDIA_STOP))},1)},i.v=function(e){for(var t,i=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return m(e,void 0);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?m(e,void 0):void 0}}(e))){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(t=i()).done;){var n=t.value;n.contentBoxSize&&1===n.contentBoxSize.length?(g(this,F)[F]=n.contentBoxSize[0].inlineSize,g(this,G)[G]=n.contentBoxSize[0].blockSize):n.contentBoxSize&&n.contentBoxSize.inlineSize?(g(this,F)[F]=n.contentBoxSize.inlineSize,g(this,G)[G]=n.contentBoxSize.blockSize):(g(this,F)[F]=n.contentRect.width,g(this,G)[G]=n.contentRect.height)}this.R()},i.R=function(){if(g(this,W)[W].autoResize&&g(this,V)[V]){var e=g(this,Q)[Q],t=this.k();e&&!e.isLinear()?e&&(e.getWidth()>g(this,F)[F]||e.getHeight()>g(this,G)[G]?this.resizeAd(g(this,F)[F],g(this,G)[G]):(g(this,V)[V].resize(e.getWidth(),e.getHeight()+20,t),g(this,N)[N].style.width=e.getWidth()+"px",g(this,N)[N].style.height=e.getHeight()+20+"px")):this.resizeAd(g(this,F)[F],g(this,G)[G])}},i.k=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||g(this,L)[L].webkitDisplayingFullscreen?g(this,z)[z].ViewMode.FULLSCREEN:g(this,z)[z].ViewMode.NORMAL},i.I=function(){var e=this;g(this,N)[N].style.display="none",g(this,L)[L].ended||(g(this,x)[x].enable(),g(this,er)[er]?(g(this,L)[L].pause(),this.dispatchEvent(new T("pause"))):(this.p().then(function(){}).catch(function(){e.dispatchEvent(new T("pause"))}),this.dispatchEvent(new T("play")),this.dispatchEvent(new T(k.MEDIA_RESUMED))),g(this,er)[er]=!1)},i.B=function(e){var t=e.getError(),i=new j(t.getMessage());return i.type=t.getType(),i.errorCode=t.getErrorCode(),i.vastErrorCode=t.getVastErrorCode&&t.getVastErrorCode(),i.innerError=t.getInnerError(),i},i.j=function(e){var t=this;this.dispatchEvent(new T(k.AD_ERROR,{detail:{error:e}})),this.C(),g(this,ei)[ei]?g(this,ei)[ei]({start:function(){t.I(),g(t,ei)[ei]=void 0},startWithoutReset:function(){t.I()}}):this.I()},h(t,[{key:"volume",get:function(){return!g(this,x)[x].enabled&&g(this,V)[V]?g(this,V)[V].getVolume():g(this,L)[L].volume},set:function(e){!g(this,x)[x].enabled&&g(this,V)[V]&&g(this,V)[V].setVolume(e),g(this,L)[L].volume=e}},{key:"muted",get:function(){return!g(this,x)[x].enabled&&g(this,V)[V]?0===g(this,V)[V].getVolume():g(this,L)[L].muted},set:function(e){!g(this,x)[x].enabled&&g(this,V)[V]&&g(this,V)[V].setVolume(e?0:g(this,eo)[eo]),g(this,L)[L].muted=e}},{key:"currentTime",get:function(){return void 0!==g(this,ee)[ee]?g(this,ee)[ee]:g(this,L)[L].currentTime},set:function(e){g(this,x)[x].enabled&&(g(this,L)[L].currentTime=e)}},{key:"duration",get:function(){return void 0!==g(this,et)[et]?g(this,et)[et]:g(this,L)[L].duration}},{key:"cuePoints",get:function(){return[].concat(g(this,J)[J])}}]),t}(C)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9pCYc":[function(e,t,i){i.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},i.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.exportAll=function(e,t){return Object.keys(e).forEach(function(i){"default"===i||"__esModule"===i||Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[i]}})}),t},i.export=function(e,t,i){Object.defineProperty(e,t,{enumerable:!0,get:i})}},{}]},["iW4Tm"],"iW4Tm","parcelRequire4dc0");