@flowplayer/player 3.0.8 → 3.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.js +2 -2
- package/default.js +2 -2
- package/embed.js +97 -93
- package/flowplayer.css +1 -1
- package/index.d.ts +3 -2
- package/package.json +1 -1
- package/plugins/ads.js +22 -3
- package/plugins/consent.js +1 -1
- package/plugins/dash.js +1 -1
- package/plugins/float-on-scroll.js +1 -1
- package/plugins/health.js +1 -16
- package/plugins/id3.js +1 -16
- package/plugins/ovp.js +1 -1
package/plugins/ads.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ads=t())}(this,(function(){"use strict";function e(e){return e&&e.
|
|
2
|
-
/*!
|
|
3
|
-
var t,n=e(function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=112)}([function(e,t,n){t.a={AD_INIT:"ad-initialized",AD_PLAYBACK_ERROR:"ad-playback-error",AD_TEARDOWN:"ad-teardown",AD_VIDEOTAG_ATTACHED:"ad-videotag-attached",AD_BLOCKED:"ad-blocked",AD_REQUEST_ERROR:"ad-request-error",AD_REQUESTED:"ad-requested",AD_REQUEST_COMPLETED:"ad-request-completed",AD_PAUSE_CONTENT:"ad-pause-content",AD_STARTED:"ad-started",AD_COMPLETED:"ad-completed",AD_PAUSED:"ad-paused",AD_RESUMED:"ad-resumed",AD_WAITING:"ad-waiting",AD_PROGRESS:"ad-progress",AD_SKIPPED:"ad-skipped",AD_MUTED:"ad-muted",AD_VOLUME_CHANGED:"ad-volume-changed",AD_FULLSCREEN:"ad-fullscreen",AD_TIMEOUT:"ad-timeout",AD_BREAK_COMPLETED:"ad-break-completed",AD_POSTROLL_FINISHED:"ad-postroll-finished",AD_PREROLL_FINSIHED:"ad-preroll-finished",AD_MIDROLL_FINISHED:"ad-midroll-finished",VPAID_INIT:"vpaid-init",IMA_ADAPTER_INIT:"ad-ima-adapter-init",IMA_BEFORE_ADS_REQUEST:"ad-ima-before-ads-request",IMA_ADS_RENDERING_SETTINGS:"ad-ima-rendeding-settings",ADAPTER_INIT_FAILED:"ad-adapter-init-failed",AD_PLAY_REQUESTED:"ad-play-requested",RELOAD_AD_REQUESTED:"reload-ad-requested"}},function(e,t,n){e.exports=n(83)},function(e,t){function n(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,u,"next",e)}function u(e){n(o,i,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(28);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){r(e,t,n[t])}))}return e}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t,n){var r,i,a,o;function s(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,n,r)}return n[o].exports}for(var a=!1,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r=1e3,i=6e4,a=60*i,o=24*a;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}t.exports=function(e,t){t=t||{};var n,c,l=u(e);if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===l&&!1===isNaN(e))return t.long?(n=e,(c=Math.abs(n))>=o?s(n,c,o,"day"):c>=a?s(n,c,a,"hour"):c>=i?s(n,c,i,"minute"):c>=r?s(n,c,r,"second"):n+" ms"):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=a?Math.round(e/a)+"h":t>=i?Math.round(e/i)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],2:[function(e,t,n){var r,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],d=!1,f=-1;function p(){d&&c&&(d=!1,c.length?l=c.concat(l):f=-1,l.length&&h())}function h(){if(!d){var e=u(p);d=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,d=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function g(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new v(e,t)),1!==l.length||d||u(h)},v.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],3:[function(e,t,n){t.exports=function(t){function n(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){var t;function o(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(o.enabled){var a=o,s=Number(new Date),u=s-(t||s);a.diff=u,a.prev=t,a.curr=s,t=s,n[0]=r.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,t){if("%%"===e)return e;c++;var i=r.formatters[t];if("function"==typeof i){var o=n[c];e=i.call(a,o),n.splice(c,1),c--}return e})),r.formatArgs.call(a,n);var l=a.log||r.log;l.apply(a,n)}}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=n(e),o.destroy=i,o.extend=a,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function i(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){var n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){var e=[].concat(s(r.names.map(o)),s(r.skips.map(o).map((function(e){return"-"+e})))).join(",");return r.enable(""),e},r.enable=function(e){var t;r.save(e),r.names=[],r.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var a=r.instances[t];a.enabled=r.enabled(a.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=e("ms"),Object.keys(t).forEach((function(e){r[e]=t[e]})),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:1}],4:[function(e,t,n){(function(r){n.log=function(){var e;return"object"===("undefined"==typeof console?"undefined":u(console))&&console.log&&(e=console).log.apply(e,arguments)},n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),e.splice(i,0,n)}},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){var e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(n),t.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,e("_process"))},{"./common":3,_process:2}]},{},[4])(4)},"object"===u(t)&&void 0!==e?e.exports=o():(i=[],void 0===(a="function"==typeof(r=o)?r.apply(t,i):r)||(e.exports=a))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){n.d(t,"a",(function(){return s}));var r=n(4),i=n.n(r),a=n(3),o=n.n(a),s=function(){function e(t,n){i()(this,e),this._nextIndex=0,this._postroll=0,this._loadPending=!1,this._opts=n||{},this.reset(t)}return o()(e,null,[{key:"of",value:function(t,n){return new e(t,n)}}]),o()(e,[{key:"toJSON",value:function(){var e=(this._ads||[]).slice(this._nextIndex);return this._postroll&&e.push(this._postroll),e}},{key:"reset",value:function(e){this.setAds(e),this._nextIndex=0,this._postrollActive=!1}},{key:"resetCounter",value:function(){this._nextIndex=0,this._postrollActive=!1}},{key:"setAds",value:function(e){this._ads=e||[],this.sort()}},{key:"getAds",value:function(){return this._ads}},{key:"getNextAd",value:function(e){return this._ads[this._nextIndex]||e}},{key:"getCurrentAd",value:function(){return this._postrollActive?this._postroll:this._loadPending?0:this._ads[this._nextIndex-1]}},{key:"getPostroll",value:function(){return this._postroll}},{key:"isDrained",value:function(){return this._nextIndex+1>this._ads.length}},{key:"setPostrollActive",value:function(){this._postrollActive=!0}},{key:"updateContentDuration",value:function(e){this._opts.content_duration=e}},{key:"increment",value:function(){++this._nextIndex}},{key:"decrement",value:function(){this._nextIndex>0&&--this._nextIndex}},{key:"getNextIndex",value:function(){return this._nextIndex}},{key:"getCurrentType",value:function(){return this.getCurrentAd()&&e.kindOf(this.getCurrentAd().time)}},{key:"sort",value:function(){var e=this;this._postroll=this._ads.filter((function(e){return-1===e.time}))[0],this._ads=this._ads.filter((function(t){return t!==e._postroll})).sort((function(t,n){return t.time===n.time?e._ads.indexOf(t)-e._ads.indexOf(n):t.time-n.time}))}},{key:"shallPlayAd",value:function(e){if(this._loadPending)return!1;var t=this.getCurrentAd()||this.getNextAd();return!!(t&&t.time<=e&&-1!==t.time)}},{key:"shallPlayNext",value:function(){var e=this.getNextAd(),t=this.getCurrentAd();return!(!e||!t||e.time!==t.time)}},{key:"waitForLoad",value:function(e,t,n){if(this._loadPending=!1,!t)return!1;var r=n?this._opts.preload_advance:0;return t.time>=0?this._loadPending=e<t.time-r:-1===t.time&&(this._loadPending=this._opts.content_duration>0&&-1!==e?e<this._opts.content_duration-r:-1!==e),this._loadPending}}],[{key:"hasPreroll",value:function(e){return!!e.find((function(e){return 0===e.time}))}},{key:"isOutstream",value:function(t){return e.hasPreroll(t)&&!!t[0].outstream}},{key:"kindOf",value:function(e){switch(e){case 0:return"preroll";case-1:return"postroll";default:return"midroll"}}}]),e}()},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(6),i=n(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t,n){var r=n(52);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){e.exports=!n(23)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(13),i=n(10),a=n(22),o=n(61),s=n(34),u=function(e,t,n){var c,l,d,f,p=e&u.F,h=e&u.G,v=e&u.S,g=e&u.P,m=e&u.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,_=h?i:i[t]||(i[t]={}),A=_.prototype||(_.prototype={});for(c in h&&(n=t),n)d=((l=!p&&y&&void 0!==y[c])?y:n)[c],f=m&&l?s(d,r):g&&"function"==typeof d?s(Function.call,d):d,y&&o(y,c,d,e&u.U),_[c]!=d&&a(_,c,f),g&&A[c]!=d&&(A[c]=d)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(86),i=n(87),a=n(88);e.exports=function(e,t){return r(e)||i(e,t)||a()}},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,r,i,a=e[1]||"",o=e[3];if(!o)return a;if(t&&"function"==typeof btoa){var s=(n=o,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),u=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot).concat(e," */")}));return[a].concat(u).concat([s]).join("\n")}return[a].join("\n")}(t,e);return t[2]?"@media ".concat(t[2],"{").concat(n,"}"):n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];null!=a&&(r[a]=!0)}for(var o=0;o<e.length;o++){var s=e[o];null!=s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="(".concat(s[2],") and (").concat(n,")")),t.push(s))}},t}},function(e,t,n){var r,i={},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}();function o(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[o]?r[o].parts.push(s):n.push(r[o]={id:o,parts:[s]})}return n}function s(e,t){for(var n=0;n<e.length;n++){var r=e[n],a=i[r.id],o=0;if(a){for(a.refs++;o<a.parts.length;o++)a.parts[o](r.parts[o]);for(;o<r.parts.length;o++)a.parts.push(v(r.parts[o],t))}else{for(var s=[];o<r.parts.length;o++)s.push(v(r.parts[o],t));i[r.id]={id:r.id,refs:1,parts:s}}}}function u(e){var t=document.createElement("style");if(void 0===e.attributes.nonce){var r=n.nc;r&&(e.attributes.nonce=r)}if(Object.keys(e.attributes).forEach((function(n){t.setAttribute(n,e.attributes[n])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var c,l=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function d(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function f(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i&&e.setAttribute("media",i),a&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,h=0;function v(e,t){var n,r,i;if(t.singleton){var a=h++;n=p||(p=u(t)),r=d.bind(null,n,a,!1),i=d.bind(null,n,a,!0)}else n=u(t),r=f.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).attributes="object"==typeof t.attributes?t.attributes:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=o(e,t);return s(n,t),function(e){for(var r=[],a=0;a<n.length;a++){var u=n[a],c=i[u.id];c&&(c.refs--,r.push(c))}e&&s(o(e,t),t);for(var l=0;l<r.length;l++){var d=r[l];if(0===d.refs){for(var f=0;f<d.parts.length;f++)d.parts[f]();delete i[d.id]}}}}},function(e,t,n){n.d(t,"b",(function(){return j})),n.d(t,"a",(function(){return F}));var r=n(47),i=n.n(r),a=n(4),o=n.n(a),s=n(3),u=n.n(s),c=n(28),l=n.n(c),d=n(7),f=n.n(d),p=n(18),h=n.n(p),v={ok:f()("fpads:analytics:request-queue"),err:f()("fpads:analytics:request-queue:err"),warn:f()("fpads:analytics:request-queue:warn")},g=function(){function e(){o()(this,e),this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return u()(e,null,[{key:"of",value:function(){return new e}},{key:"is_empty",value:function(e){return 0==e.pending.size}},{key:"is_high_water",value:function(t){return t.open.size==e.MAX_OPEN_REQUESTS}},{key:"maybe_spawn_req",value:function(t){if(e.is_empty(t))return v.ok("maybe_spawn_req called Queue that is EMPTY"),t;if(e.is_high_water(t))return v.warn("maybe_spawn_req called on Queue that is HIGH_WATER"),t;try{e.request(t,e.lpop(t))}catch(e){v.err(e)}}},{key:"increment_failures",value:function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t}},{key:"handle_error",value:function(t,n){e.rm(t,n),e.increment_failures(t)}},{key:"request",value:function(t,n){var r=h()(n,3),i=r[0],a=r[1],o=r[2];if(v.ok("Request[".concat(o.event_type,"] request"),o,t.stats),Date.now()<t.stats.ttl)return v.warn("Request[".concat(o.event_type,"] skipping because too many errors too quickly"),t.stats);var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s),v.warn("Request[".concat(o.event_type,"] timed out in ").concat(s.timeout,"ms"),t.stats)},s.onerror=function(n){e.handle_error(t,s),n&&v.err(n),v.warn("Request[".concat(o.event_type,"] encountered an Error"),s.responseText,t.stats)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--,v.ok("Request[".concat(o.event_type,"] :ok"),s.stats)},s.open(a,i),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(o))}catch(e){v.err(e)}}},{key:"rpush",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(n){if(t.pending.length>=e.HIGH_WATER_PENDING)return v.warn("Too many open requests, skipping",t.stats);t.pending.push(n),e.maybe_spawn_req(t)})),t}},{key:"lpop",value:function(e){return e.pending.shift()}},{key:"rm",value:function(e,t){var n=e.open.lastIndexOf(t);return~n&&e.open.splice(n,1),e}}]),e}();g.MAX_OPEN_REQUESTS=3,g.MAX_PENDING=5,g.REQUEST_TIMEOUT_MS=4e3,g.REQUEST_TTL_MS=5e3,g.MAX_FAILURE_COUNT=3;var m=n(48),y=n.n(m),_=n(49),A=n(7)("fpads:device"),b=y.a.parse(window.navigator.userAgent),w=b.platform,E=b.os,k=b.browser;A(b);var S=function(e){return e&&e.toLowerCase()},L={rnd:Math.random().toString(36).substr(2,32),os:S(E.name+(E.versionName?" ".concat(E.versionName):"")),device:S(w.type),browser:S(k.name),browser_version:(k&&k.version?k.version:"unknown").split(".").shift(),plugin_version:_.version},x=n(0),T="https://fp-eu-w1-aai.flowplayer.com/in",M="POST",O=[x.a.AD_REQUESTED,x.a.AD_REQUEST_ERROR,x.a.AD_REQUEST_COMPLETED,x.a.AD_COMPLETED,x.a.AD_STARTED,x.a.AD_ERROR,x.a.AD_SKIPPED],C=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],R=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],D=f()("fpads:analytics"),P=g.of(),N=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object.assign.apply(Object,[{}].concat(t))},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(t,n){return Object.assign(t,l()({},n,e[n]))}),{})},F=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o()(this,e),this.metadata=N(L,n.metadata||{}),this.emitter=t,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),D(this),this.wireup()}return u()(e,null,[{key:"of",value:function(t,n){return new e(t,n)}},{key:"ensure_required_keys",value:function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))}},{key:"pluck_valid_keys",value:function(e,t){return I.apply(void 0,[t].concat(i()(e.valid_keys)))}},{key:"mergeMetadata",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.metadata=e.pluck_valid_keys(t,N(t.metadata,n,{player_version:window.flowplayer.version})),t}}]),u()(e,[{key:"wireup",value:function(){var t=this;t.events.forEach((function(n){t.emitter.on(n,(function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=N(t.metadata,{event_type:n},r),a=e.pluck_valid_keys(t,i),o=e.ensure_required_keys(t,a);if(D("Event[".concat(n,"]"),{payload:a,observation:r}),o.length)return D("Analytics.validate_metadata() failed for \n Event[".concat(n,"]\n missing keys: ").concat(o),a);g.rpush(P,[T,M,a])}))}))}},{key:"destroy",value:function(){this.metadata=void 0,this.emitter=void 0,this.events=void 0,this.required_keys=void 0,this.optional_keys=void 0,this.valid_keys=void 0}}]),e}(),j=function(e){return F.of(e,{required_keys:C,optional_keys:R,events:O})}},function(e,t,n){var r=n(55),i=n(60);e.exports=n(14)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(10),i=n(13),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(63)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(27),i=n(37);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(36);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){n(8);var r=n(85);function i(t,n,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(n):a.value}},i(t,n,a||t)}e.exports=i},function(e,t,n){var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,i),r(n)},e.once("error",a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(c(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n<c;++n)a(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(89),i=n(90),a=n(45);e.exports={formats:a,parse:i,stringify:r}},function(e,t,n){n.d(t,"a",(function(){return f}));var r=n(1),i=n.n(r),a=n(2),o=n.n(a),s=(new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"}));function u(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function c(e,t){var n=e.muted,r=e.timeout,i=e.inline,a=t(),o=a.element,s=a.source,u=void 0,c=void 0,l=void 0;return o.muted=n,!0===n&&o.setAttribute("muted","muted"),!0===i&&o.setAttribute("playsinline","playsinline"),o.src=s,new Promise((function(e){u=o.play(),c=setTimeout((function(){l(!1,new Error("Timeout "+r+" ms has been reached"))}),r),l=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(c),e({result:t,error:n})},void 0!==u?u.then((function(){return l(!0)})).catch((function(e){return l(!1,e)})):l(!0)}))}var l=function(e){return c(e=u(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(s)}}))},d=void 0;function f(){return p.apply(this,arguments)}function p(){return(p=o()(i.a.mark((function e(){var t,n=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(n.length>0&&void 0!==n[0])||n[0],!d){e.next=3;break}return e.abrupt("return",d);case 3:return e.next=5,l({timeout:500,muted:t});case 5:return d=e.sent,e.abrupt("return",d);case 7:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(64);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(66),i=n(70);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(39),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(37);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(14),i=n(35),a=n(26),o=n(40).f;e.exports=function(e){return function(t){for(var n,s=a(t),u=i(s),c=u.length,l=0,d=[];c>l;)n=u[l++],r&&!o.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}}},function(e,t,n){var r=n(25)("wks"),i=n(24),a=n(13).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},function(e,t,n){var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var u=o[s],c=a[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:u}),n.push(c))}return function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],i=0;i<t.length;++i)void 0!==t[i]&&r.push(t[i]);n.obj[n.prop]=r}}return t}(t)},decode:function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},encode:function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),n="",r=0;r<t.length;++r){var a=t.charCodeAt(r);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n+=t.charAt(r):a<128?n+=i[a]:a<2048?n+=i[192|a>>6]+i[128|63&a]:a<55296||a>=57344?n+=i[224|a>>12]+i[128|a>>6&63]+i[128|63&a]:(r+=1,a=65536+((1023&a)<<10|1023&t.charCodeAt(r)),n+=i[240|a>>18]+i[128|a>>12&63]+i[128|a>>6&63]+i[128|63&a])}return n},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(Array.isArray(t))t.push(n);else{if("object"!=typeof t)return[t,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!=typeof t)return[t].concat(n);var o=t;return Array.isArray(t)&&!Array.isArray(n)&&(o=a(t,i)),Array.isArray(t)&&Array.isArray(n)?(n.forEach((function(n,a){r.call(t,a)?t[a]&&"object"==typeof t[a]?t[a]=e(t[a],n,i):t.push(n):t[a]=n})),t):Object.keys(n).reduce((function(t,a){var o=n[a];return r.call(t,a)?t[a]=e(t[a],o,i):t[a]=o,t}),o)}}},function(e,t,n){var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){n.d(t,"a",(function(){return r})),new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"});var r=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"})},function(e,t,n){var r=n(91),i=n(92),a=n(93);e.exports=function(e){return r(e)||i(e)||a()}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,u=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18),o=function(){function e(){}var t;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},(t=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}();t.default=o,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=u(n(92)),i=u(n(93)),a=u(n(94)),o=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=r.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=i.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find((function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return Object.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(i[t]=o,a+=1):"object"==typeof o&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),s=o.find((function(e){return t.isOS(e)}));if(s){var u=this.satisfies(n[s]);if(void 0!==u)return u}var c=o.find((function(e){return t.isPlatform(e)}));if(c){var l=this.satisfies(n[c]);if(void 0!==l)return l}}if(a>0){var d=Object.keys(i).find((function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows/i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},function(e){e.exports=JSON.parse('{"name":"@flowplayer/ads","version":"1.16.7","description":"","main":"index.js","scripts":{"lint":"eslint src","test:debug":"DEBUG=collector:* jest -i","test":"jest -i","dev":"NODE_ENV=development TARGET=unlocked webpack-dev-server --progress --colors --port 8844 --host 0.0.0.0","prod":"webpack -p","build":"webpack","prepublish":"rm -rf dist/ && NO_DEMOS=true npm run build:unlocked && npx uglifyjs dist/native.js","build:locked":"TARGET=locked webpack","build:unlocked":"TARGET=unlocked webpack","collector":"node node_modules/.bin/collector","rel":"git tag -d production && git push origin :production && git tag production && git push origin --tags","test:browserstack":"jest -i --testMatch=**/test/browserstack/*.spec.js","test:unit":"jest -i --env jsdom --testMatch \'<rootDir>/test/unit/**/*.spec.js\'"},"husky":{"hooks":{"pre-commit":"yarn lint","post-merge":"yarn"}},"jest":{"testMatch":["**/__tests__/**/*.js?(x)","**/?(*.)(spec|test).js?(x)"],"testURL":"https://flowplayer.com/videos/fake","moduleNameMapper":{"<%TARGET%>":"<rootDir>/test/jest/transform.js"},"globalSetup":"./test/jest/setup","globalTeardown":"./test/jest/teardown","testEnvironment":"./test/jest/browserstack","bail":true},"author":"","license":"ISC","devDependencies":{"@babel/core":"^7.1.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-syntax-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.1.0","@babel/preset-env":"^7.1.0","@babel/runtime":"^7.0.0","@flowplayer/collector":"^0.2.2","babel-core":"^7.0.0-bridge.0","babel-eslint":"^10.0.1","babel-jest":"^23.6.0","babel-loader":"^8.0.2","chai":"^4.1.2","css-loader":"^3.1.0","eslint":"^5.5.0","eslint-import-resolver-webpack":"^0.12.0","eslint-plugin-import":"^2.14.0","git-rev-sync":"^2.0.0","handlebars":"^4.7.7","handlebars-loader":"^1.7.0","html-webpack-plugin":"^4.0.3","husky":"^4.3.0","jest":"^26.4.2","moment":"^2.19.2","sass":"^1.49.0","sass-loader":"^8.0.0","style-loader":"^1.0.0","webpack":"^4.37.0","webpack-cli":"^3.1.1","webpack-dev-server":"^3.1.11"},"dependencies":{"bean":"^1.0.15","bowser":"^2.7.0","can-autoplay":"^3.0.0","core-js":"^2.5.7","debug":"^4.0.1","es6-event-emitter":"^1.10.2"}}')},function(e,t,n){function r(e,t){var n=!1,r=function(){var r,i=(r=e.getBoundingClientRect()).top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+r.height&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+r.width;i!==n&&t(i),n=i};return setTimeout(r),document.addEventListener("scroll",r),function(){return document.removeEventListener("scroll",r)}}n.d(t,"a",(function(){return r}))},function(e,t,n){n.d(t,"a",(function(){return ae}));var r=n(1),i=n.n(r),a=n(2),o=n.n(a),s=n(5),u=n.n(s),c=n(4),l=n.n(c),d=n(3),f=n.n(d),p=n(11),h=n.n(p),v=n(8),g=n.n(v),m=n(12),y=n.n(m),_=n(17),A=n.n(_),b=n(29),w=n.n(b),E=n(0),k=n(6),S=n.n(k),L=n(7)("fpads:timers"),x=-1,T=function(){function e(){l()(this,e),this.intervals={},this.timers={}}return f()(e,null,[{key:"of",value:function(){return new e}},{key:"id",value:function(){return++x}},{key:"createTimeout",value:function(t,n,r){var i=setTimeout((function(){delete t.timers[i],r()}),n);if(L("TimerRegistry.createTimeout() -> ".concat(i),t.timers),"object"==S()(i)){var a=e.id();return t.timers[a]=i,a}return t.timers[i]=i,i}},{key:"removeTimeout",value:function(e,t){return L("TimerRegistry.removeTimeout() -> ".concat(t),e.timers),clearTimeout(e.timers[t]),delete e.timers[t],e}},{key:"createInterval",value:function(t,n,r){var i=setInterval(r,n);if(L("TimerRegistry.createInterval() -> ".concat(i),t.intervals),"object"==S()(i)){var a=e.id();return t.intervals[a]=i,a}return t.intervals[i]=i,i}},{key:"removeInterval",value:function(e,t){return L("TimerRegistry.removeInterval() -> ".concat(t),e.intervals),clearInterval(e.intervals[t]),delete e.intervals[t],e}},{key:"empty",value:function(t){if(t)return L("TimerRegistry.empty()",Object.keys(t.timers),Object.keys(t.intervals)),Object.keys(t.intervals).forEach((function(n){return e.removeInterval(t,n)})),Object.keys(t.timers).forEach((function(n){return e.removeTimeout(t,n)})),t}}]),e}(),M=n(9),O=function(e,t){var n="".concat(e,"() not implemented by the adapter");if(t)throw new Error(n);console.warning(n)},C=function(){function e(){l()(this,e)}var t,n,r;return f()(e,[{key:"initialize",value:function(e){O("initialize",!0)}},{key:"reset",value:function(){O("reset",!0)}},{key:"destroy",value:function(){O("destroy",!0)}},{key:"stop",value:function(){O("stop",!0)}},{key:"initAd",value:(r=o()(i.a.mark((function e(t,n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O("initAd",!0);case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"playAd",value:(n=o()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O("playAd",!0);case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"pause",value:function(){O("pause",!1)}},{key:"resume",value:function(){O("resume",!1)}},{key:"volume",value:function(e){O("volume",!1)}},{key:"contentComplete",value:(t=o()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O("contentComplete",!1);case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"onResize",value:function(e){O("onResize",!1)}},{key:"isUiDisabled",value:function(){return!1}},{key:"getAdPodInfo",value:function(){return null}},{key:"isAdPod",value:function(){return!1}},{key:"canDismissNonLinear",value:function(){return!1}}]),e}(),R=n(7)("fpads:adapter:base"),D=function(e){function t(e){var n;return l()(this,t),(n=h()(this,g()(t).call(this))).eventHandler=e,n.opts={},n._prepared=void 0,n._initialized=void 0,n._videoTag=void 0,n._dimensions=void 0,n._sharedVideoTag=void 0,n._autoplayResult=void 0,n._adLinear=!0,n._paused=!0,n}var n,r,a;return y()(t,e),f()(t,[{key:"destroy",value:function(){this.eventHandler=void 0,this._videoTag=void 0}},{key:"stop",value:function(){}},{key:"isReady",value:function(){return!!this._initialized}},{key:"init",value:(a=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(R("init",this._videoTag,t),this.opts=t,this._dimensions={width:t.width,height:t.height},this._prepared=!0,this._initialized||!this._videoTag){e.next=7;break}return e.next=7,this.initAdapter();case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"setVideoTag",value:(r=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._videoTag=t,this._initialized||!this._prepared){e.next=4;break}return e.next=4,this.initAdapter();case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"initAdapter",value:(n=o()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R("initAdapter",this.opts),e.prev=1,e.next=4,this.initialize(this.opts);case 4:this._initialized=!0,e.next=12;break;case 7:e.prev=7,e.t0=e.catch(1),R("initAdapter failed:",e.t0),this._prepared=!1,this.eventHandler.trigger(E.a.ADAPTER_INIT_FAILED);case 12:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(){return n.apply(this,arguments)})},{key:"setIOSPlaysInline",value:function(e){R("setIOSPlaysInline",e),this._sharedVideoTag=!e,this.initialize(u()({},this.opts,{DisableCustomPlaybackForIOS10Plus:e}))}},{key:"resize",value:function(e){var t=e.width,n=e.height,r=e.linear,i=e.silent,a=e.resize_non_linear;!1===r&&(t+=10,n+=10),this._adLinear=void 0===r?this._adLinear:r,this.onResize({width:t,height:n,linear:this._adLinear,silent:i,resize_non_linear:a}),this._dimensions={width:t,height:n,linear:r}}},{key:"dimensions",get:function(){return this._dimensions}},{key:"videoTag",get:function(){return this._videoTag}},{key:"adLinear",get:function(){return this._adLinear}},{key:"sharedVideoTag",get:function(){return this._sharedVideoTag}},{key:"paused",get:function(){return this._paused}}]),t}(C);function P(e){try{return e.getAdPodInfo().getPodIndex()}catch(e){return}}var N=n(7)("fpads:adapter:ima"),I=function(e){function t(e){var n;return l()(this,t),(n=h()(this,g()(t).call(this,e)))._adHandlers=[],n._timers=T.of(),n._started=!1,n._volumeLevel=0,n._adLoaded=!1,n._currentDuration=0,n._currentRemaining=0,n._currentDisplayTs=0,n}var n,r,a,s;return y()(t,e),f()(t,[{key:"destroy",value:function(){w()(g()(t.prototype),"destroy",this).call(this),T.empty(this._timers),this._adHandlers&&this._adHandlers.forEach((function(e){return e()})),this._adHandlers=void 0,this._adDisplayContainer&&this._adDisplayContainer.destroy(),this._adDisplayContainer=void 0,this._adsLoader&&this._adsLoader.destroy(),this._adsLoader=void 0,this._adsManager&&this._adsManager.destroy(),this._adsManager=void 0}},{key:"stop",value:function(){w()(g()(t.prototype),"stop",this).call(this),this._adsManager&&this._adsManager.stop()}},{key:"initialize",value:function(e){var n=this,r=this.isAdPod(),i=this._adLoaded||r;this.cleanup();var a=this;this.opts=e,this._volumeLevel=e.volume;var o=google.ima.settings;e.NumRedirects=e.NumRedirects||e.redirects,Object.keys(e).forEach((function(t){void 0!==o["set".concat(t)]&&o["set".concat(t)](e[t])}));var s={VpaidMode:google.ima.ImaSdkSettings.VpaidMode.INSECURE,DisableCustomPlaybackForIOS10Plus:!0};Object.keys(s).filter((function(t){return void 0===e[t]})).forEach((function(e){return o["set".concat(e)](s[e])})),this._adDisplayContainer=new google.ima.AdDisplayContainer(e.container,this.videoTag),this._adDisplayContainer.initialize(),this._adsLoader=new google.ima.AdsLoader(this._adDisplayContainer),N("ima.initialise(:wait -> ADS_MANAGER_LOADED)",u()({},e,{volume:this.videoTag.volume,muted:this.videoTag.muted})),this._adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(r){N("ima.initialise(:done -> ADS_MANAGER_LOADED)\n%o",u()({},e,{volume:n.videoTag.volume,muted:n.videoTag.muted}));var i=new google.ima.AdsRenderingSettings;N("ima.rendering(preload: %s)",!!e.preload_ads),i.useStyledNonLinearAds=!0,i.enablePreloading=!!e.preload_ads,"number"==typeof e.media_timeout&&(i.loadVideoTimeout=e.media_timeout),i.restoreCustomPlaybackStateOnAdBreakComplete=!e.DisableCustomPlaybackForIOS10Plus,n.sharedVideoTag&&(i.playAdsAfterTime=n.videoTag.currentTime),n.eventHandler.trigger(E.a.IMA_ADS_RENDERING_SETTINGS,i);var o=n._adsManager=r.getAdsManager(n.videoTag,i);n.eventHandler.trigger(E.a.IMA_ADAPTER_INIT,o),o.addEventListener(google.ima.AdEvent.Type.LOADED,(function(){N("debug(ima.adsManager): google.ima.AdEvent.Type.LOADED")})),o.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(){N("debug(ima.adsManager): google.ima.AdErrorEvent.Type.AD_ERROR")})),o.addEventListener(google.ima.AdEvent.Type.STARTED,(function(){N("debug(ima.adsManager): google.ima.AdEvent.Type.STARTED")})),o.addEventListener(google.ima.AdEvent.Type.STARTED,(function(e){a.debugEvent(e);var r=e.getAd();a._currentDuration=r.getDuration(),a._currentDisplayTs=Date.now(),n.emitWithAd(E.a.AD_STARTED,r),r.isLinear()&&t.pollRemaining({ima:a,adsManager:o})})),o.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(e){a.debugEvent(e),a.emitWithAd(E.a.AD_COMPLETED,e.getAd()),T.empty(n._timers)})),o.addEventListener(google.ima.AdEvent.Type.SKIPPED,(function(e){a.debugEvent(e),a.emitWithAd(E.a.AD_SKIPPED,e.getAd())})),o.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(e){a.debugEvent(e),a.emitWithAd(E.a.AD_PAUSE_CONTENT,e.getAd())})),o.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(e){a.debugEvent(e),a._started=!1,a._currentDisplayTs=0,a.eventHandler.trigger(E.a.AD_BREAK_COMPLETED)})),o.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,(function(e){N("IMA::volume(type: %s, event: %o)",e.type,e);var t=o.getVolume();a._volumeLevel=t,a.eventHandler.trigger(E.a.AD_VOLUME_CHANGED,t)}));var s=function(e){a._paused=e,a.eventHandler.trigger(e?E.a.AD_PAUSED:E.a.AD_RESUMED)};o.addEventListener(google.ima.AdEvent.Type.PAUSED,(function(){return s(!0)})),o.addEventListener(google.ima.AdEvent.Type.RESUMED,(function(){return s(!1)})),o.addEventListener(google.ima.AdEvent.Type.STARTED,(function(){return s(!1)})),o.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,(function(e){N("IMA::volume(type: %s, event: %o)",e.type,e),a.eventHandler.trigger(E.a.AD_MUTED)})),o.init(n.opts.width,n.opts.height,google.ima.ViewMode.NORMAL),N("ima.initialise: done initializing")})),i&&(N("Event(reload: %s)",E.a.RELOAD_AD_REQUESTED),a.eventHandler.trigger(E.a.RELOAD_AD_REQUESTED,r)),this.eventHandler.trigger(E.a.AD_INIT,this)}},{key:"destroyManager",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unknown";if(!this._adsManager)return N("ima::destroyManager(:skip, label: %s)",e);N("ima::destroyManager(:ok, label: %s)",e),this._adsManager.destroy()}},{key:"reset",value:function(){this.destroyManager("reset"),T.empty(this._timers),this.clearAdHandlers(),this._started=!1,this._adLoaded=!1}},{key:"cleanup",value:function(){this.destroyManager("cleanup"),this._adsLoader&&this._adsLoader.destroy(),this._adDisplayContainer&&this._adDisplayContainer.destroy(),this._adLoaded=!1}},{key:"waitForAdsManager",value:function(){var e=this;return new Promise((function(t){N("ima.waitForAdsManager:",e._adsManager),e.once(e._adsLoader,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(){N("ima.waitForAdsManager(:ok)",e._adsManager),t(e._adsManager)}))}))}},{key:"initAd",value:(s=o()(i.a.mark((function e(t){var n,r=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:5e3,N("ima.initAd(adTag: ".concat(t,", timeout: ").concat(n,")")),e.prev=2,e.next=5,this.requestAd(t,n);case 5:this._adLoaded=!0,e.next=13;break;case 8:throw e.prev=8,e.t0=e.catch(2),N("ima.initAd:",e.t0),this._adLoaded=!1,e.t0;case 13:return e.prev=13,T.empty(this._timers),e.finish(13);case 16:case"end":return e.stop()}}),e,this,[[2,8,13,16]])}))),function(e){return s.apply(this,arguments)})},{key:"requestAd",value:(a=o()(i.a.mark((function e(t,n){var r,a,s,c,l,d,f,p,h,v=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.destroyManager("requestAd"),r=this,s=this.opts.autoplay,c=void 0!==s&&s,l=Date.now(),d=this.videoTag.muted,this._volumeLevel=this.videoTag.volume,f=d||0==this._volumeLevel,r._all_ads_completed=!1,N("ima.requestAd(%o)",u()({},this.opts,{autoplay:c,muted:d,timeout:n,adTag:t,_volumeLevel:this._volumeLevel,manager:this._adsManager})),this.clearAdHandlers(),(p=new google.ima.AdsRequest).adTagUrl=t,p.linearAdSlotWidth=this.opts.width,p.linearAdSlotHeight=this.opts.height,this.opts.disable_non_linear_ads||(p.nonLinearAdSlotWidth=this.opts.width),this.opts.disable_non_linear_ads||(p.nonLinearAdSlotHeight=this.opts.height-50),p.setAdWillAutoPlay(c),p.setAdWillPlayMuted(f),p.vastLoadTimeout=n,this.eventHandler.trigger(E.a.IMA_BEFORE_ADS_REQUEST,{request:p}),this._adsLoader.requestAds(p),h=new Promise(function(){var e=o()(i.a.mark((function e(t,o){var s,u,c,d,p;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){clearTimeout(c),t.apply(void 0,arguments)},u=function(){clearTimeout(c),o.apply(void 0,arguments)},v.once(v._adsLoader,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){v.emitError(E.a.AD_REQUEST_ERROR,e),u(new Error("Ad load failed"))})),c=setTimeout((function(){var e=new Error("Ad internal timeout reached");v.eventHandler.trigger(E.a.AD_TIMEOUT,e),o(e)}),1.5*(n+(v.opts.media_timeout||5e3))),e.next=6,r.waitForAdsManager();case 6:if(d=e.sent,v.volume(f?0:v._volumeLevel),r.eventHandler.trigger(E.a.AD_VOLUME_CHANGED,v._volumeLevel),!(p=v.cuepoints())||!p.length||0===p[0]){e.next=12;break}return e.abrupt("return",s({ad:!1,adsManager:d}));case 12:v.once(d,google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){v.emitError(E.a.AD_PLAYBACK_ERROR,e),u(e)})),v.once(d,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(){v._all_ads_completed=!0,s()})),v.once(d,google.ima.AdEvent.Type.LOADED,(function(e){v.eventHandler.trigger(E.a.AD_REQUEST_COMPLETED,{request_load_time:Date.now()-l}),a=e.getAd(),N("ima.requestAd: AD_REQUEST_COMPLETED",a.getContentType()),"application/javascript"==a.getContentType()&&v.eventHandler.trigger(E.a.VPAID_INIT,a),s()})),v.once(d,google.ima.AdEvent.Type.CLICK,(function(){N("ima.requestAd: click event"),r.pause()}));case 16:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()),e.abrupt("return",h);case 23:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"playAd",value:(r=o()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N("ima.playAd()",this),this._adsManager&&this._adLoaded){e.next=3;break}return e.abrupt("return");case 3:if(t=this._adsManager.getCurrentAd()){e.next=6;break}return e.abrupt("return");case 6:if(!this.sharedVideoTag||t.isLinear()){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,e.next=11,this.startAndWaitForAdCompletion(this._adsManager,t.isLinear());case 11:e.next=17;break;case 13:throw e.prev=13,e.t0=e.catch(8),N("ima.playAd",e.t0),e.t0;case 17:return e.prev=17,this._adLoaded=!1,T.empty(this._timers),e.finish(17);case 21:case"end":return e.stop()}}),e,this,[[8,13,17,21]])}))),function(){return r.apply(this,arguments)})},{key:"startAndWaitForAdCompletion",value:function(e,n){var r=this;if(!this._started){N("ima.startAndWaitForAdCompletion(manager: %o)",{volume:e.getVolume()});var a=this;return new Promise((function(s,u){var c=!1;a.once(e,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(){if(N("ima.startAndWaitForAdCompletion: CONTENT_RESUME_REQUESTED <<< happened"),a._started=!1,c)return N("ima.startAndWaitForAdCompletion: Content resume requested, but trying to recover from ad error");s()})),a.once(e,google.ima.AdErrorEvent.Type.AD_ERROR,function(){var e=o()(i.a.mark((function e(n){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N("ima.startAndWaitForAdCompletion: beginning error recovery ->",n),c=!0,e.prev=2,e.next=5,t.pollForFatalError({err:n,ima:a});case 5:e.sent.ok&&(c=!1),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(2),a._started=!1,u(n);case 14:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t){return e.apply(this,arguments)}}()),n&&(r._started=!0),e.start(),r.eventHandler.trigger(E.a.AD_PLAY_REQUESTED)}))}}},{key:"pause",value:function(){N("ima.pause()"),this._adsManager&&this._adsManager.pause()}},{key:"resume",value:function(){N("ima.resume()"),this._adsManager&&this._adsManager.resume()}},{key:"volume",value:function(e){try{return arguments.length>0&&"number"==typeof e&&this._adsManager.setVolume(e),this._volumeLevel=this._adsManager.getVolume()}catch(e){N("ima.volume() failed (%o)",e)}}},{key:"onResize",value:function(e){var t=e.width,n=e.height,r=e.linear,i=e.silent,a=e.resize_non_linear;this.opts&&(t||n)&&(r&&(this.opts.width=t,this.opts.height=n),this._adsManager&&(r||a)&&(i||N("ima.onResize %s x %s",t,n),this._adsManager.resize(t,n,google.ima.ViewMode.NORMAL)))}},{key:"currentAd",value:function(){return this._adsManager&&this._adsManager.getCurrentAd()}},{key:"isAdPod",value:function(){return this.cuepoints()&&this.cuepoints().length>1}},{key:"cuepoints",value:function(){return this._adsManager&&this._adsManager.getCuePoints()}},{key:"contentComplete",value:(n=o()(i.a.mark((function e(){var n=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N("ima.contentComplete() -> ",this),this._adsLoader&&this._adsLoader.contentComplete(),this.cuepoints()&&-1!==this.cuepoints().indexOf(-1)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,new Promise((function(e){t.race(n.eventHandler,[E.a.AD_BREAK_COMPLETED,E.a.AD_ERROR],e)}));case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"isUiDisabled",value:function(){return this.currentAd()&&this.currentAd().isUiDisabled()}},{key:"getAdPodInfo",value:function(){try{return this.currentAd()&&this.currentAd().getAdPodInfo()}catch(e){return null}}},{key:"canDismissNonLinear",value:function(){var e=this.currentAd();if(!e||e.isLinear()||!this._adsManager||!this._currentDisplayTs)return!0;var t=Date.now(),n=e.getMinSuggestedDuration();return t-this._currentDisplayTs>1e3*n}},{key:"once",value:function(e,t,n){this._adHandlers.push(function(e,t,n){var r=function r(i){n(i),e.removeEventListener(t,r)};return e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}}(e,t,n))}},{key:"clearAdHandlers",value:function(){N("ima.clearAdHandlers"),this._adHandlers.forEach((function(e){return e()})),this._adHandlers=[]}},{key:"emitWithAd",value:function(e,t){var n={ad_type:M.a.kindOf(P(t)),ad:{duration:t.getDuration(),width:t.getWidth(),height:t.getHeight()},volume:this._adsManager.getVolume(),vast_ad_id:t.getAdId(),linear:t.isLinear(),mime_type:t.getContentType(),ima_event:!0};N("emitWithAd::event(name: ".concat(e,", data: %o, ad: %o)"),n,t),this.eventHandler.trigger(e,n)}},{key:"emitError",value:function(e,t){var n={vast_error_type:t.getError().getType(),reason:t.getError().getMessage(),vast_error:t.getError().getErrorCode()};N("ima.error(".concat(e,")"),n),this.eventHandler.trigger(e,n)}},{key:"debugEvent",value:function(e){try{var t=e.getAd();if(!t)return;N("ima.event.".concat(e.type," ->"),{event:e,data:e.getAdData(),position:P(t),ad:t})}catch(e){}}}],[{key:"unwrapError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"function"==typeof e.getMessage?e.getMessage():e.message?e.message:t}},{key:"pollForFatalError",value:function(e){var n,r=e.err,i=e.ima;try{var a=r.getError(),o=t.unwrapError(a.getInnerError(),a);n={reason:o,type:a.getType(),code:a.getErrorCode()},N("ima.pollForFatalError",n)}catch(r){N("ima.pollForFatalError",r)}var s=i._currentRemaining;return new Promise((function(e,t){var r=setTimeout((function(){N("ima.pollForFatalError: Ad errored and not progressing, reject"),i.eventHandler&&i.eventHandler.trigger(E.a.AD_PLAYBACK_ERROR,n),t(new Error("Ad not progressing"))}),2500);i.eventHandler.once(E.a.AD_PROGRESS,(function(t){-1!==t.remaining&&t.remaining<s&&(N("ima.pollForFatalError: Ad still progressing even though errored, skip error rejection"),clearTimeout(r),e({ok:1}))}))}))}},{key:"pollRemaining",value:function(e){var t=e.ima,n=e.adsManager;return N("ima.pollRemaining"),T.createInterval(t._timers,250,(function(){t._currentRemaining=n.getRemainingTime(),t.eventHandler.trigger(E.a.AD_PROGRESS,{remaining:t._currentRemaining,duration:t._currentDuration})}))}},{key:"race",value:function(e,t,n){t.forEach((function(r){e.on(r,(function r(){t.forEach((function(t){return e.removeListener(t,r)}));for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];n(a)}))}))}}]),t}(D),F=function(){function e(){l()(this,e)}return f()(e,null,[{key:"create",value:function(e,t){return e.adapter?new e.adapter(t):new I(t)}}]),e}(),j=n(30),B=n(18),U=n.n(B),H=n(31),z=n.n(H),G=n(7)("fpads:macros"),V=/\[([\s\S]+?)\]/g,q=function(){function e(t,n){l()(this,e),this.vars=t,this.pattern=n}return f()(e,null,[{key:"of",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V;return new e(t,n)}},{key:"run",value:function(e){try{return e()}catch(e){return void console.error(e)}}},{key:"merge",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return Object.assign(e,t)}),{})}},{key:"cast",value:function(t){var n=S()(t);return"undefined"===n?"":("function"===n&&(t=e.run(t)),encodeURIComponent(t))}},{key:"normalize",value:function(e){return e.trim()}},{key:"process_obj",value:function(t,n,r){return Object.keys(t).reduce((function(i,a){var o=e.process_str(a,n,r,!0),s=t[a];return null===s?(i[o]=s,i):"object"==S()(s)?(i[o]=e.process_obj(s,n,r),i):"string"==typeof s?(i[o]=e.process_str(s,n,r),i):void console.error(new Error("".concat(s," at ").concat(a," not a handled Macro type")))}),{})}},{key:"process_str",value:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.replace(n.pattern,(function(t,n){var a=e.normalize(n);if(!(a in r)||void 0===r[a])return t;var o=r[a],s=i?o:e.cast(o);return G("Macro.replace(raw: %s, macro: %s, value: %s)",i,n,s),s}))}}]),f()(e,[{key:"fork",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pattern,r=e.merge(this.vars,t);return e.of(r,n)}},{key:"compile",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.merge(this.vars,n),i=t.split("?"),a=U()(i,2),o=a[0],s=a[1],u=z.a.parse(s||"",{strictNullHandling:!0,decoder:function(e){return e}}),c=z.a.stringify(e.process_obj(u,this,r),{encode:!1,strictNullHandling:!0});return e.process_str(o,this,r,!0)+"?"+c}}]),e}();function W(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:0,height:0};try{var i=document.createElement("a");i.href=t=window.location!=window.parent.location?document.referrer:document.location.href,n=i.hostname}catch(e){console.error(e)}var a=r.width,o=r.height,s=e||{},c=s.video_source,l="object"==S()(window.__flowplayerAdParameters)?window.__flowplayerAdParameters:{};return u()({random:Date.now(),page_url:t,domain:n,player_width:a,player_height:o,video_url:c,videourl:c},l)}function Q(e){return K.apply(this,arguments)}function K(){return(K=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof t){e.next=2;break}return e.abrupt("return",t);case 2:return e.prev=2,e.next=5,t();case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),e.abrupt("return","");case 11:case"end":return e.stop()}}),e,this,[[2,8]])})))).apply(this,arguments)}function Y(e){return Z.apply(this,arguments)}function Z(){return(Z=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=S()(t),e.next="function"===e.t0||"string"===e.t0?3:"object"===e.t0?7:8;break;case 3:return e.next=5,Q(t);case 5:return e.t1=e.sent,e.abrupt("return",[e.t1]);case 7:return e.abrupt("return",Array.isArray(t)?Promise.all(t.map(Q)):Y(t.adTag||[]));case 8:throw new Error("\n unhandled ads type ".concat(S()(t),":\n ").concat(JSON.stringify(t),"\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n "));case 9:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}Object.assign(q,{patterns:{BRACKETS:V,CURLY:/\{([\s\S]+?)\}/g,UNDERSCORE:/__([\s\S]+?)__/g}});var J=Object.prototype,X=Object.getPrototypeOf;function $(e){return null!==e&&"object"===S()(e)&&X(e)===J}var ee=n(7)("fpads:ads:state"),te={IDLE:0,INITIALIZING:1,FETCHING_AD:2,AD_AVAILABLE:4,BREAK_ACTIVE:8,PLAYING:16,FATAL_ERROR:32},ne=function(){function e(){l()(this,e),this._state=0}return f()(e,null,[{key:"of",value:function(){return new e}}]),f()(e,[{key:"reset",value:function(){this._state=0}},{key:"toString",value:function(){var e=this;return 0==this._state?"AdState(None)":"AdState("+Object.keys(te).reduce((function(t,n){return e.hasAny(te[n])?t+n+": "+!!e.hasAny(te[n])+" ":t}),"").trim()+")"}},{key:"toggleState",value:function(e,t){return void 0===e&&ee(new Error("AdState cannot toggleState for `undefined`")),null==S()(t)?this._state^=e:t?void(this._state|=e):this._state&=~e}},{key:"hasAll",value:function(e){return this._state==(this._state|e)}},{key:"hasAny",value:function(e){return this._state&e}},{key:"state",get:function(){return this._state}}]),e}(),re=n(7)("fpads:ads"),ie={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10},ae=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,t),(e=h()(this,g()(t).call(this))).adapter=F.create(n,A()(A()(e))),e.opts=u()({},ie),e.analytics=void 0,e._state=ne.of(),e._schedule=void 0,e._lastAd=void 0,e._macros=q.of(n.parameters||{}),e.wireup(),e}var n,r,a,s,c,d,p,v;return y()(t,e),f()(t,[{key:"reset",value:function(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}},{key:"destroy",value:function(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy(),this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}},{key:"stop",value:function(){this.adapter&&this.adapter.stop()}},{key:"wireup",value:function(){var e=this,t=function(){return e._state.toggleState(te.PLAYING,!0)};this.on(E.a.AD_PLAY_REQUESTED,t),this.on(E.a.AD_STARTED,t),this.on(E.a.AD_RESUMED,t);var n=function(){return e._state.toggleState(te.PLAYING,!1)};this.on(E.a.AD_BREAK_COMPLETED,n),this.on(E.a.AD_TEARDOWN,n),this.on(E.a.AD_PLAYBACK_ERROR,n),this.on(E.a.AD_REQUEST_ERROR,n),this.on(E.a.AD_PAUSED,n),this.on(E.a.AD_SKIPPED,n),this.on(E.a.AD_COMPLETED,n),this.on(E.a.AD_BREAK_COMPLETED,(function(){e._state.toggleState(te.BREAK_ACTIVE,!1)})),this.on(E.a.ADAPTER_INIT_FAILED,(function(){console.error("Adapter init failed"),n(),e._state.toggleState(te.FATAL_ERROR,!0)})),this.on(E.a.RELOAD_AD_REQUESTED,function(){var t=o()(i.a.mark((function t(r){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(re("Ads.on(RELOAD_AD_REQUESTED)",r),n(),!r){t.next=4;break}return t.abrupt("return",e._schedule.reset(e._schedule.getAds()));case 4:e._state.hasAny(te.AD_AVAILABLE)&&(e._schedule.decrement(),e._state.toggleState(te.AD_AVAILABLE,!1));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}())}},{key:"initialize",value:(v=o()(i.a.mark((function e(t){var n,r,a=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},r=a.length>2?a[2]:void 0,re("Ads.initialize():",t,n,r),this._state.toggleState(te.INITIALIZING,!0),this.opts=Object.assign({},this.opts,n),Array.isArray(t)&&this.setSchedule(t),e.next=8,this.adapter.init(this.opts);case 8:if(this._macros=this._macros.fork(Object.assign({},n.parameters||{},{autoplay:n.autoplay,muted:n.muted})),!this.adapter.isReady()){e.next=12;break}return e.next=12,this.adapterInitialized(r);case 12:return e.abrupt("return",this);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"setVideoTag",value:(p=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re("Ads.setVideoTag():",t),e.next=3,this.adapter.setVideoTag(t);case 3:if(this.trigger(E.a.AD_VIDEOTAG_ATTACHED,t),!this.adapter.isReady()){e.next=7;break}return e.next=7,this.adapterInitialized();case 7:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"waitForVideoTag",value:function(){var e=this;return new Promise((function(t){var n=e.adapter.videoTag;if(n)return t(n);e.on(E.a.AD_VIDEOTAG_ATTACHED,(function(n){e.once(E.a.AD_INIT,(function(){return t(n)}))}))}))}},{key:"adapterInitialized",value:(d=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re("Ads.adapterInitialized()"),this._state.toggleState(te.INITIALIZING,!1),this._state.toggleState(te.BREAK_ACTIVE,this.hasPreroll()),e.next=5,this.setCurrentTime(0,t);case 5:this.checkIfBreakComplete(),t&&!this.opts.autoplay||this.trigger(E.a.AD_TEARDOWN);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"fetchNextAd",value:(c=o()(i.a.mark((function e(t){var n,r,a=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:0,this.adapter.isReady()){e.next=3;break}return e.abrupt("return");case 3:if(!(n>50)){e.next=7;break}throw this._state.toggleState(te.FATAL_ERROR,!0),this._state.toggleState(te.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");case 7:if(!(r=this._schedule.getNextAd()||this._schedule.getPostroll())||this.adapter.canDismissNonLinear()||-1===t){e.next=10;break}return e.abrupt("return",!1);case 10:if(!this._schedule.waitForLoad(t,r,this.opts.preload_ads)){e.next=13;break}return this._state.toggleState(te.FETCHING_AD,!1),e.abrupt("return",!1);case 13:if(r===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),r){e.next=18;break}return this._state.toggleState(te.FETCHING_AD,!1),e.abrupt("return",!1);case 18:return re("Ads.fetchNextAd",r),this._state.toggleState(te.FETCHING_AD,!0),e.prev=20,e.next=23,this.requestAd(r);case 23:return this._state.toggleState(te.AD_AVAILABLE,!0),this._state.toggleState(te.FETCHING_AD,!1),e.abrupt("return",this);case 28:if(e.prev=28,e.t0=e.catch(20),re("Ads.fetchNextAd(err: %o, ad: %o)",e.t0,r),this.setLastAd(r),r===this._schedule.getPostroll()){e.next=36;break}return e.next=35,this.fetchNextAd(t,++n);case 35:return e.abrupt("return",e.sent);case 36:case"end":return e.stop()}}),e,this,[[20,28]])}))),function(e){return c.apply(this,arguments)})},{key:"skipAdsOnSeek",value:function(e){for(var t=this._schedule.getNextAd();t&&t.time<e;)this._schedule.increment(),t=this._schedule.getNextAd()}},{key:"setCurrentTime",value:(s=o()(i.a.mark((function e(t,n){var r,a,o=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>2&&void 0!==o[2]&&o[2],this._schedule){e.next=3;break}return e.abrupt("return");case 3:if(this.adapter.isReady()){e.next=5;break}return e.abrupt("return");case 5:if(!this._state.hasAny(te.FETCHING_AD)){e.next=7;break}return e.abrupt("return");case 7:if(!this._state.hasAny(te.PLAYING)||!this.adapter.adLinear){e.next=9;break}return e.abrupt("return");case 9:if(a=0===t&&0===this._schedule.getNextIndex(),e.prev=10,r&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(t),this._state.hasAny(te.AD_AVAILABLE)){e.next=15;break}return e.next=15,this.fetchNextAd(t);case 15:if(this._state.hasAny(te.AD_AVAILABLE)&&this.shallPlayAd(t)&&!n){e.next=17;break}return e.abrupt("return");case 17:return e.next=19,this.playAd();case 19:return e.next=21,this.setCurrentTime(t);case 21:this.checkIfBreakComplete(),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(10),re("setCurrentTime: Error(from: setCurrentTime, message: %s)",e.t0.message);case 27:return e.prev=27,a&&this.trigger(E.a.AD_PREROLL_FINSIHED),e.finish(27);case 30:case"end":return e.stop()}}),e,this,[[10,24,27,30]])}))),function(e,t){return s.apply(this,arguments)})},{key:"playAd",value:(a=o()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._state.hasAny(te.AD_AVAILABLE)){e.next=2;break}return e.abrupt("return");case 2:return this._state.toggleState(te.AD_AVAILABLE,!1),this._state.toggleState(te.BREAK_ACTIVE,!0),e.prev=4,t=this._schedule.getCurrentAd(),e.next=8,this.adapter.playAd();case 8:t&&this.setLastAd(t),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),console.error("Ads.playAd: error",e.t0);case 14:case"end":return e.stop()}}),e,this,[[4,11]])}))),function(){return a.apply(this,arguments)})},{key:"checkIfBreakComplete",value:function(){if(!this._state.hasAny(te.BREAK_ACTIVE))return re("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());re("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(te.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger(E.a.AD_BREAK_COMPLETED)}},{key:"resetScheduleCounter",value:function(){this._schedule&&this._schedule.resetCounter()}},{key:"setSchedule",value:function(e,t){if(!isNaN(t)&&this._schedule&&this._schedule.updateContentDuration(t),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(e);this._schedule=M.a.of(e,{preload_advance:this.opts.preload_advance,content_duration:isNaN(t)?0:t})}},{key:"toJSON",value:function(){return this._schedule?this._schedule.toJSON():[]}},{key:"trigger",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._state){if(e===E.a.AD_BREAK_COMPLETED&&this._state.hasAny(te.BREAK_ACTIVE)&&!this.adapter.isAdPod())return re("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if($(t)&&(t=Object.assign({},this.adapter.opts||{},this._schedule.getCurrentAd()||{},{ad_type:this.ad_type},t)).ima_event&&"preroll"===t.ad_type&&(t.ad_type=this.ad_type),this.adapter.videoTag){var n=document.createEvent("Event");n.initEvent(e,!1,!1),n.data=t,this.adapter.videoTag.dispatchEvent(n)}j.EventEmitter.prototype.emit.apply(this,[e,t])}}},{key:"shouldRestartContent",value:function(){var e=this.getLastAd();return!e.outstream&&!1!==e.restart}},{key:"finished",value:(r=o()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re("Ads.finished"),!(this.adapter.sharedVideoTag&&this._state.hasAny(te.PLAYING)&&this.adapter.adLinear)){e.next=3;break}return e.abrupt("return");case 3:if(re("Ads.finished: trying to play postroll"),e.prev=4,this._schedule.getPostroll()){e.next=10;break}return re("Ads.finished: no postroll found"),e.next=9,this.adapter.contentComplete();case 9:return e.abrupt("return",e.sent);case 10:if(this._state.hasAny(te.AD_AVAILABLE)){e.next=13;break}return e.next=13,this.fetchNextAd(-1);case 13:return e.next=15,this.playAd();case 15:this.adapter.contentComplete(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(4),re("Ads.finished: postroll failed:",e.t0);case 21:return e.prev=21,this.trigger(E.a.AD_POSTROLL_FINISHED),this.checkIfBreakComplete(),"function"==typeof t&&t(),e.finish(21);case 26:case"end":return e.stop()}}),e,this,[[4,18,21,26]])}))),function(e){return r.apply(this,arguments)})},{key:"hasPreroll",value:function(){return this._schedule&&M.a.hasPreroll(this._schedule.getAds())}},{key:"shallPlayAd",value:function(e){return(!this.adapter||!this.adapter.isAdPod())&&!(!this._state||this._state.hasAny(te.FATAL_ERROR))&&this._schedule.shallPlayAd(e)}},{key:"setLastAd",value:function(e){return this._lastAd=e,this}},{key:"getLastAd",value:function(){return this._lastAd||{}}},{key:"mergeMacros",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._macros=this._macros.fork(Object.assign({},e)),this}},{key:"pause",value:function(){this.adapter&&this.adapter.pause()}},{key:"resume",value:function(){this.adapter&&this.adapter.resume()}},{key:"resize",value:function(e){this.adapter&&this.adapter.resize(e)}},{key:"requestAd",value:(n=o()(i.a.mark((function e(t){var n,r,a,o,s,u=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:0,r=u.length>2&&void 0!==u[2]?u[2]:this.opts.timeout,this._state){e.next=4;break}return e.abrupt("return");case 4:return re("Ads.requestAd(ad: %o)",{ad:t,timeout:r,idx:n}),e.next=7,Y(t);case 7:if(void 0!==(a=e.sent)[n]){e.next=10;break}return e.abrupt("return",Promise.reject(new Error("Ad failed, no fallbacks left")));case 10:if(a[n]){e.next=14;break}return e.next=13,this.requestAd(a,n+1,r);case 13:return e.abrupt("return",e.sent);case 14:return this.trigger(E.a.AD_REQUESTED,t),o=this._macros.compile(a[n],W(this.opts,this.adapter.dimensions)),e.prev=16,e.next=19,this.adapter.initAd(o,r);case 19:return s=e.sent,e.abrupt("return",{ok:s});case 23:return e.prev=23,e.t0=e.catch(16),re("Ads.requestAd(:fallback, idx: ".concat(n,", length: ").concat(a.length,", adTag: ").concat(a[n],")\nError "),{adTag:a,err:e.t0}),e.abrupt("return",this.requestAd(a,n+1,r));case 27:case"end":return e.stop()}}),e,this,[[16,23]])}))),function(e){return n.apply(this,arguments)})},{key:"resetSchedule",value:function(e){this._schedule&&this._schedule.reset(e)}},{key:"ad_type",get:function(){return this._schedule&&this._schedule.getCurrentType()}},{key:"paused",get:function(){return this.adapter&&this.adapter.paused}},{key:"adPlaying",get:function(){return this._state&&this._state.hasAny(te.PLAYING)}},{key:"adBreak",get:function(){return this._state&&this._state.hasAny(te.BREAK_ACTIVE)}}]),t}(j.EventEmitter)},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){n(54),e.exports=n(10).Object.assign},function(e,t,n){var r=n(15);r(r.S+r.F,"Object",{assign:n(65)})},function(e,t,n){var r=n(56),i=n(57),a=n(59),o=Object.defineProperty;t.f=n(14)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(16);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(14)&&!n(23)((function(){return 7!=Object.defineProperty(n(58)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(16),i=n(13).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(16);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(13),i=n(22),a=n(33),o=n(24)("src"),s=n(62),u=(""+s).split("toString");n(10).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(a(n,o)||i(n,o,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[o]||s.call(this)}))},function(e,t,n){e.exports=n(25)("native-function-to-string",Function.toString)},function(e,t){e.exports=!1},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(14),i=n(35),a=n(71),o=n(40),s=n(41),u=n(27),c=Object.assign;e.exports=!c||n(23)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r}))?function(e,t){for(var n=s(e),c=arguments.length,l=1,d=a.f,f=o.f;c>l;)for(var p,h=u(arguments[l++]),v=d?i(h).concat(d(h)):i(h),g=v.length,m=0;g>m;)p=v[m++],r&&!f.call(h,p)||(n[p]=h[p]);return n}:c},function(e,t,n){var r=n(33),i=n(26),a=n(67)(!1),o=n(69)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){var r=n(26),i=n(38),a=n(68);e.exports=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(39),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(25)("keys"),i=n(24);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){n(73),e.exports=n(10).Object.values},function(e,t,n){var r=n(15),i=n(42)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){n(75),e.exports=n(10).Object.entries},function(e,t,n){var r=n(15),i=n(42)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){n(77),e.exports=n(10).Array.find},function(e,t,n){var r=n(15),i=n(78)(5),a=!0;"find"in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(82)("find")},function(e,t,n){var r=n(34),i=n(27),a=n(41),o=n(38),s=n(79);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,d=6==e,f=5==e||d,p=t||s;return function(t,s,h){for(var v,g,m=a(t),y=i(m),_=r(s,h,3),A=o(y.length),b=0,w=n?p(t,A):u?p(t,0):void 0;A>b;b++)if((f||b in y)&&(g=_(v=y[b],b,m),e))if(n)w[b]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return b;case 2:w.push(v)}else if(l)return!1;return d?-1:c||l?l:w}}},function(e,t,n){var r=n(80);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(16),i=n(81),a=n(43)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(36);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(43)("unscopables"),i=Array.prototype;null==i[r]&&n(22)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,a=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(84),i)r.regeneratorRuntime=a;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){var n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag",u="object"==typeof e,c=t.regeneratorRuntime;if(c)u&&(e.exports=c);else{(c=t.regeneratorRuntime=u?e.exports:{}).wrap=v;var l={},d={};d[a]=function(){return this};var f=Object.getPrototypeOf,p=f&&f(f(L([])));p&&p!==n&&r.call(p,a)&&(d=p);var h=_.prototype=m.prototype=Object.create(d);y.prototype=h.constructor=_,_.constructor=y,_[s]=y.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(h),e},c.awrap=function(e){return{__await:e}},A(b.prototype),b.prototype[o]=function(){return this},c.AsyncIterator=b,c.async=function(e,t,n,r){var i=new b(v(e,t,n,r));return c.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(h),h[s]="Generator",h[a]=function(){return this},h.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=L,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function v(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new S(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=w(o,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=g(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function g(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function m(){}function y(){}function _(){}function A(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function b(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=g(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(c).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=g(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function L(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:x}}function x(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},function(e,t,n){var r=n(8);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){var r=n(44),i=n(45),a={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return o.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,n,i,a,o,u,c,l,d,f,p,h){var v=t;if("function"==typeof c)v=c(n,v);else if(v instanceof Date)v=f(v);else if(null===v){if(a)return u&&!h?u(n,s.encoder):n;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||r.isBuffer(v))return u?[p(h?n:u(n,s.encoder))+"="+p(u(v,s.encoder))]:[p(n)+"="+p(String(v))];var g,m=[];if(void 0===v)return m;if(Array.isArray(c))g=c;else{var y=Object.keys(v);g=l?y.sort(l):y}for(var _=0;_<g.length;++_){var A=g[_];o&&null===v[A]||(m=Array.isArray(v)?m.concat(e(v[A],i(n,A),i,a,o,u,c,l,d,f,p,h)):m.concat(e(v[A],n+(d?"."+A:"["+A+"]"),i,a,o,u,c,l,d,f,p,h)))}return m};e.exports=function(e,t){var n=e,o=t?r.assign({},t):{};if(null!==o.encoder&&void 0!==o.encoder&&"function"!=typeof o.encoder)throw new TypeError("Encoder has to be a function.");var c=void 0===o.delimiter?s.delimiter:o.delimiter,l="boolean"==typeof o.strictNullHandling?o.strictNullHandling:s.strictNullHandling,d="boolean"==typeof o.skipNulls?o.skipNulls:s.skipNulls,f="boolean"==typeof o.encode?o.encode:s.encode,p="function"==typeof o.encoder?o.encoder:s.encoder,h="function"==typeof o.sort?o.sort:null,v=void 0!==o.allowDots&&o.allowDots,g="function"==typeof o.serializeDate?o.serializeDate:s.serializeDate,m="boolean"==typeof o.encodeValuesOnly?o.encodeValuesOnly:s.encodeValuesOnly;if(void 0===o.format)o.format=i.default;else if(!Object.prototype.hasOwnProperty.call(i.formatters,o.format))throw new TypeError("Unknown format option provided.");var y,_,A=i.formatters[o.format];"function"==typeof o.filter?n=(_=o.filter)("",n):Array.isArray(o.filter)&&(y=_=o.filter);var b,w=[];if("object"!=typeof n||null===n)return"";b=o.arrayFormat in a?o.arrayFormat:"indices"in o?o.indices?"indices":"repeat":"indices";var E=a[b];y||(y=Object.keys(n)),h&&y.sort(h);for(var k=0;k<y.length;++k){var S=y[k];d&&null===n[S]||(w=w.concat(u(n[S],S,E,l,d,f?p:null,_,h,v,g,A,m)))}var L=w.join(c),x=!0===o.addQueryPrefix?"?":"";return L.length>0?x+L:""}},function(e,t,n){var r=n(44),i=Object.prototype.hasOwnProperty,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,o=/(\[[^[\]]*])/.exec(r),s=o?r.slice(0,o.index):r,u=[];if(s){if(!n.plainObjects&&i.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;null!==(o=a.exec(r))&&c<n.depth;){if(c+=1,!n.plainObjects&&i.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(o[1])}return o&&u.push("["+r.slice(o.index)+"]"),function(e,t,n){for(var r=t,i=e.length-1;i>=0;--i){var a,o=e[i];if("[]"===o)a=(a=[]).concat(r);else{a=n.plainObjects?Object.create(null):{};var s="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,u=parseInt(s,10);!isNaN(u)&&o!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=r:a[s]=r}r=a}return r}(u,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:a.delimiter,n.depth="number"==typeof n.depth?n.depth:a.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:a.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:a.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:a.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:a.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:a.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:a.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:a.strictNullHandling,""===e||null==e)return n.plainObjects?Object.create(null):{};for(var s="string"==typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,o),u=0;u<s.length;++u){var c,l,d=s[u],f=d.indexOf("]="),p=-1===f?d.indexOf("="):f+1;-1===p?(c=t.decoder(d,a.decoder),l=t.strictNullHandling?null:""):(c=t.decoder(d.slice(0,p),a.decoder),l=t.decoder(d.slice(p+1),a.decoder)),i.call(n,c)?n[c]=[].concat(n[c]).concat(l):n[c]=l}return n}(e,n):e,u=n.plainObjects?Object.create(null):{},c=Object.keys(s),l=0;l<c.length;++l){var d=c[l],f=o(d,s[d],n);u=r.merge(u,f,n)}return r.compact(u)}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){var r=n(97);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){var r=n(52);function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function a(t,n,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,n){n.r(t),n.d(t,"default",(function(){return ie}));var r={};n.r(r),n.d(r,"STICKY_CONTROLS",(function(){return b})),n.d(r,"NO_FULLSCREEN",(function(){return w})),n.d(r,"NO_AD_INDICATOR",(function(){return E})),n.d(r,"AD_ATTRIBUTION",(function(){return k})),n.d(r,"AD_CHOICES",(function(){return S})),n.d(r,"REMAINING_TIME",(function(){return L})),n.d(r,"VOLUME_BAR",(function(){return x}));var i=n(5),a=n.n(i),o=n(6),s=n.n(o),u=n(94),c=n.n(u),l=n(1),d=n.n(l),f=n(2),p=n.n(f),h=n(4),v=n.n(h),g=n(3),m=n.n(g),y=n(95),_=n.n(y),A=(n(98),n(100),n(102),n(104),n(0)),b=1,w=2,E=4,k=8,S=16,L=32,x=64;function T(e,t,n){for(var r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);r.length;){if(null==e)return n;var i=r.shift();if("string"!=typeof i)return n;e=e[i]}return null==e?n:e}var M="undefined"!=typeof document&&"undefined"!=typeof window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,O="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout,C=function(){var e,t=document.createElement("div");return(e=t.classList).add.apply(e,arguments),t},R=n(7)("fpads:native:ui"),D="is-ad-showing",P="is-ad-linear",N="is-ad-nonlinear",I="ad-playing",F="no-fullscreen",j="ad-hide-first-frame",B=function(){function e(t){var n,r,i,a,o=this,s=t.root,u=t.content,c=t.config,l=t.initial,d=t.ads;v()(this,e),Object.assign(this,{root:s,content:u,initial:l,ads:d,config:c}),this.progress={percent:0},this.animation=(n=function(e){if(o.halt_animation())return o.animation.running=!1;o.set_progress_bar(Math.round(o.progress.percent)),requestAnimationFrame(o.animation)},r=Math.ceil(1e3/60),i=0,a=null,function(){var e=Date.now()-i;null===a&&(a=O((function(){a=null,n.apply(this,arguments),i=Date.now()}),r-e))}),d.ui=this,this.render().wireup(),u.on("reap",(function(e){return o.destroy()}))}return m()(e,null,[{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _()(e,n)}},{key:"as_progress",value:function(e){var t=e.remaining,n=e.duration;return{percent:Math.min(100,Math.max(0,(n-t)/n*100))}}},{key:"clone",value:function(e,t,n){var r=t.querySelector(n);if(r){var i=r.cloneNode(!0);return e.append(i),i}}},{key:"createCustomElement",value:function(e,t,n){var r=new(window.customElements.get(n))(t);return e.append(r),r}}]),m()(e,[{key:"halt_animation",value:function(){return!this.progress_bar||0==this.content.reaper||!this.wrapper||!this.wrapper.classList.contains(I)}},{key:"animate",value:function(){this.animation.running||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e.apply(void 0,n)}(this.animation)}},{key:"resize",value:function(e){if(e.linear)return this.toggle(a()({on:!0},e));R("UI.resize(): ",e),this.adContainer.style.width=e.width+"px",this.wrapper.style.height=e.height+"px";var t=this.root.querySelector(".fp-controls"),n=t?e.height+t.clientHeight:e.height;this.wrapper.style.marginTop="-".concat(n,"px")}},{key:"set_progress_bar",value:function(e){this.progress_bar&&(this.progress_bar.style.width="".concat(e,"%"))}},{key:"reset_styles",value:function(){var e=this;this.progress.percent=0,"height width marginLeft marginTop".split(" ").forEach((function(t){e.wrapper.style[t]="",e.adContainer.style[t]=""}));try{window.emit("resize")}catch(e){}}},{key:"reset",value:function(){return this.wrapper.className="fp-ad-container",this.reset_styles(),this.progress={percent:0},this}},{key:"isShowing",value:function(){return this.root.classList.contains(D)}},{key:"hideFirstFrame",value:function(){return this.root.classList.toggle(j,!0),this}},{key:"showFirstFrame",value:function(){return this.root.classList.toggle(j,!1),this}},{key:"toggle",value:function(e){var t=e.on,n=e.linear;if(this.root)return R("UI.toggle(): ",arguments[0]),this.showFirstFrame(),t||this.reset(),n&&this.reset_styles(),this.root.classList.toggle(D,t),this.root.classList.toggle(P,t&&n),this.root.classList.toggle(N,t&&!n),this}},{key:"addClass",value:function(){var e;this.wrapper&&(e=this.wrapper.classList).add.apply(e,arguments)}},{key:"removeClass",value:function(){var e;this.wrapper&&(e=this.wrapper.classList).remove.apply(e,arguments)}},{key:"render",value:function(){var t=this,n=document.createDocumentFragment(),r=this,i=T(this,"config.ima.flags",T(this,"config.ima.ui",0));return this.wrapper=C("fp-ad-container"),this.ad_wrapper=C("fp-ad-wrapper"),this.adContainer=C("fp-ad"),this.controls=C("fp-ad-controls"),this.progress_wrapper=C("fp-ad-progress-wrapper"),this.progress_bar=C("fp-ad-progress","fp-color"),this.waiting=e.createCustomElement(this.wrapper,this.content,"flowplayer-wait"),this.play_btn=e.createCustomElement(this.controls,this.content,"flowplayer-control-buttons"),this.volume_btn=e.createCustomElement(this.controls,this.content,"flowplayer-volume-icon"),this.volume_bar=e.createCustomElement(this.controls,this.content,"flowplayer-volume-bar"),this.fs_btn=e.createCustomElement(this.controls,this.content,"flowplayer-header-right-zone"),x&i&&this.root.classList.toggle("ad-volume-bar"),this.fs_btn&&this.fs_btn.classList.remove("fp-togglable"),this.root.classList.toggle("is-ad-controls-sticky",b&i),this.root.classList.toggle("is-ad-attribution",k&i),this.root.classList.toggle(F,w&i),M&&this.content.once([A.a.AD_BREAK_COMPLETED,A.a.AD_REQUEST_ERROR,A.a.AD_STARTED],(function(e){t.root.classList.toggle(F,w&i||e.type===A.a.AD_STARTED)})),!T(this,"config.ima.indicator",!0)||E&i||(this.indicator=C("ad-indicator"),this.controls.prepend(this.indicator),this.indicator.classList.add("fp-color-text")),L&i&&(this.remaining=C("fp-ad-remaining"),this.remaining.classList.add("fp-color-text"),this.controls.prepend(this.remaining)),S&i&&(this.root.classList.toggle("is-ad-choices",!0),this.ad_choices=C("fp-ad-choices"),this.ad_choices.textContext="AdChoices",this.ad_choices.addEventListener("click",(function(e){e.preventDefault(),r.ads.pause(),window.open("https://adssettings.google.com","_blank")}))),this.ad_wrapper.append(this.adContainer),this.progress_wrapper.append(this.progress_bar),n.appendChild(this.wrapper),this.wrapper.append(this.ad_wrapper,this.controls,this.progress_wrapper),this.ad_choices&&this.wrapper.appendChild(this.ad_choices),this.content.renderPlugin(n),this}},{key:"ad_loading",value:function(e){R("ad_loading",e),this.wrapper&&this.wrapper.classList.toggle("is-waiting",e)}},{key:"update_time_remaining",value:function(e){this.remaining&&(this.remaining.textContent=function(e){var t,n=Math.floor(e/60);return n+":"+(t=e-=60*n,(t=parseInt(t,10))>=10?t:"0"+t)}(e))}},{key:"update_ad_indicator",value:function(){if(this.indicator){var e=this.maybe_adapter((function(e){return e.getAdPodInfo()}));if(e){R("IMA -> ",e);var t=this.content.i18n("ads.indicator","ADS");this.indicator.textContent="".concat(t," ").concat(e.getAdPosition()," / ").concat(e.getTotalAds())}}}},{key:"wireup",value:function(){var t=this;this.ads.on(A.a.AD_REQUESTED,(function(e){t.ad_loading(!0)})),this.ads.on(A.a.AD_VOLUME_CHANGED,(function(e){R("Event(%s, level: %o)",A.a.AD_VOLUME_CHANGED,e),t.content.muted||(t.content.volume=e)})),this.ads.on(A.a.AD_STARTED,(function(e){t.playback_changed(!0),t.update_ad_indicator()})),this.ads.on(A.a.AD_COMPLETED,(function(e){t.set_progress_bar(0)})),this.ads.on(A.a.AD_PAUSED,(function(e){return t.playback_changed(!1)})),this.ads.on(A.a.AD_RESUMED,(function(e){return t.playback_changed(!0)})),this.ads.on(A.a.AD_PROGRESS,(function(n){t.update_time_remaining(n.remaining,n.duration),t.progress=e.as_progress(n)})),this.volume_btn&&this.volume_btn.addEventListener("click",(function(){return t.maybe_adapter((function(e){t.content.muted=e.volume()>0,e.volume(t.content.muted?0:0==t.content.volume?.1:t.content.volume)}))}))}},{key:"playback_changed",value:function(e){this.ad_loading(!1),e&&this.animate(),this.wrapper.classList.toggle(I,e),this.wrapper.classList.toggle("ad-paused",!e),this.wrapper.classList.toggle("ad-ui-disabled",this.maybe_adapter((function(e){return e.isUiDisabled()})))}},{key:"maybe_adapter",value:function(e){return this.ads&&this.ads.adapter?e(this.ads.adapter):0}},{key:"destroy",value:function(){this.ads.ui=this.root=this.content=this.config=this.wrapper=this.adContainer=0}},{key:"classList",get:function(){return this.wrapper.classList}}]),e}();function U(e){return{width:e.clientWidth,height:e.clientHeight}}function H(e,t,n){return"number"==typeof n&&(n+="px"),e.style.setProperty(t,n),e}n(7)("fpads:dom");var z=n(7)("fpads:plugin:native"),G={on:!0},V={on:!1},q=[A.a.AD_PLAYBACK_ERROR,A.a.AD_TEARDOWN,A.a.AD_BREAK_COMPLETED],W=function(){function e(){v()(this,e)}var t,n,r,i;return m()(e,null,[{key:"user_gesture",value:function(){return flowplayer.events.BEFORE_PLAY}},{key:"snapshot",value:function(e,t){return{muted:!(t||!e.muted),volume:e.volume}}},{key:"start_from_user_gesture",value:function(t){var n=t.content,r=t.ads,i=t.config,a=t.ui,o=t.state,s=t.initial,u=t.adContainer,c=t.ima,l=e.user_gesture();n.once(l,function(){var t=p()(d.a.mark((function t(l){return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.in_viewport||"touchend"!=l.type){t.next=2;break}return t.abrupt("return");case 2:if(r.shallPlayAd(0)){t.next=4;break}return t.abrupt("return");case 4:return!M&&l.preventDefault(),e.add_time_listeners({ads:r,content:n,ui:a,state:o}),z("LifeCycle.user_gesture(:intercept) -> shallPlayAd(0: %s)",r.shallPlayAd(0)),i.muted=s.muted,t.next=10,e.start({ads:r,content:n,state:o,adContainer:u,ima:c,config:i});case 10:e.update_time({ads:r,content:n,ui:a});case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}())}},{key:"init",value:(i=p()(d.a.mark((function t(n){var r,i,a,o,s,u,c,l,f,p,h,v;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.config,i=n.root,a=n.content,o=n.ads,s=n.ima,a.autoplay=!1,u=r.autoplay===(flowplayer.autoplay||flowplayer.autoplay_options).AUDIO_REQUIRED,c=e.snapshot(a,u),l=flowplayer,f=l.events,a.on(f.VOLUME_CHANGE,(function(){c.volume=a.volume,c.muted=a.muted})),p=B.of({ads:o,content:a,config:r,initial:c,root:a.root}),h=p.adContainer,v={listening:!1,preload:T(r,"ima.preload_ads",!1)},z("LifeCycle.initial()",{initial:c}),o.setVideoTag(a),!r.autoplay){t.next=18;break}return z("Trying to autoplay"),p.hideFirstFrame(),t.next=16,e.peek_content(a,u);case 16:t.sent?(z("Can autoplay, start ad"),a.opts.autoplay=!0,e.start({ads:o,content:a,state:v,adContainer:h,ima:s,config:r})):(z("cannot autoplay(audioRequired: %s), fallback to poster state",u),r.autoplay=!1,p.showFirstFrame(),a.setState("is-starting",!0));case 18:r.autoplay||o.hasPreroll()&&e.start_from_user_gesture({content:a,ads:o,config:r,ui:p,state:v,initial:c,adContainer:h,ima:s}),!r.autoplay&&o.hasPreroll()&&v.preload&&e.start({ads:o,content:a,state:v,adContainer:h,ima:s,config:r}),e.ui_listeners({config:r,root:i,content:a,ads:o,state:v,adContainer:h,ui:p,ima:s,initial:c}),a.on(f.SOURCE,(function(){a.once(f.BEFORE_PLAY,(function(){return o.resetScheduleCounter()}))}));case 22:case"end":return t.stop()}}),t,this)}))),function(e){return i.apply(this,arguments)})},{key:"start",value:(r=p()(d.a.mark((function e(t){var n,r,i,o,s,u,l,f,p,h,v;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ads,r=t.content,i=t.adContainer,o=t.ima,s=t.state,u=t.config,l=void 0===u?{}:u,!s.started){e.next=3;break}return e.abrupt("return");case 3:return s.started=!0,o.ads,f=c()(o,["ads"]),p=l.dimensions||U(r.root),h=T(l,"muted",r.muted),v=Object.assign(a()({container:i,volume:h?0:T(l,"volume",r.volume),muted:h,autoplay:T(l,"autoplay",!1),video_source:r.original_src,DisableCustomPlaybackForIOS10Plus:T(l,"fake_fullscreen",M),preload_ads:T(l,"ima.preload_ads",!1)},f,p)),z("LifeCycle.start():",v,s),e.next=11,n.initialize(!1,v,s.preload);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"ui_listeners",value:function(t){var n=t.config,r=t.root,i=t.content,o=t.ads,s=t.initial,u=t.adContainer,c=t.state,l=t.ui,f=t.ima;z("LifeCycle.ui_listeners()");var h=flowplayer,v=h.events,g=h.states;i.once(v.PLAYING,function(){var t=p()(d.a.mark((function t(s){return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o){t.next=2;break}return t.abrupt("return");case 2:if(z("LifeCycle.ui_listeners() -> content started playing"),e.add_time_listeners({ads:o,content:i,ui:l,state:c}),o.shallPlayAd(0)&&o.adapter.adLinear){t.next=9;break}return z("LifeCycle.ui_listeners() -> no more preroll ads -> resume content"),t.next=8,e.start({ads:o,content:i,state:c,adContainer:u,ima:f,config:n});case 8:return t.abrupt("return",t.sent);case 9:return i.pause(),t.next=12,e.start({ads:o,content:i,state:c,adContainer:u,ima:f,config:n});case 12:if(o.shallPlayAd(0)&&o.adapter.adLinear){t.next=14;break}return t.abrupt("return");case 14:l.toggle(a()({},G,{linear:!0})),r.classList.add(g.WAITING),e.update_time({ads:o,content:i,ui:l});case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()),i.on([v.PORTRAIT,v.LANDSCAPE,v.RESIZE],(function(){if(o){var e=i.clientWidth||i.parentNode.clientWidth||r.clientWidth,t=i.clientHeight||i.parentNode.clientHeight||r.clientHeight;o.resize({height:t,width:e})}})),i.on(v.ENDED,(function(e){o&&(z("LifeCycle.ui_listeners(:%s, event: %o)",e.type,e.data),e.data&&e.data.from===o||(e.preventDefault(),o.finished((function(){i.emit(v.ENDED,{from:o})}))))})),o.on(A.a.AD_REQUESTED,(function(){r.classList.toggle(g.WAITING,!0)})),o.once(A.a.AD_STARTED,(function(){var e=flowplayer.events;i.on([e.BEFORE_PLAY,e.BEFORE_PAUSE],(function(t){if(o.adBreak&&o.adapter.adLinear){t.preventDefault();var n=T(t,"data.forced",!1)?t.type===e.BEFORE_PLAY:!o.adPlaying;n&&o.paused&&o.resume(),n||o.paused||o.pause()}}))})),o.on(A.a.AD_STARTED,(function(e){var t=e.linear,n=e.ad,u=e.ad_type;if(z("Ad[linear: ".concat(t,", currentTime: ").concat(i.currentTime,"] starting"),n),"preroll"==u&&!t&&i.paused&&i.play(),"preroll"==u&&t&&i.currentTime>0&&!i.opt("start_time")&&!i.opt("live")&&(z("Preroll[rewind: true]",i.currentTime),i.currentTime=0),o.resize({width:n.width,height:n.height,linear:t,resize_non_linear:!0}),l.resize({linear:t,resizeContainerAlso:!0,width:t?void 0:n.width,height:t?void 0:n.height}),r.classList.remove(g.WAITING),l.toggle(a()({},G,{linear:t,ad:n})),!t)try{i.togglePlay(!0),i.volume=s.volume,i.muted=s.muted}catch(e){z(e)}})),o.on(A.a.AD_PAUSE_CONTENT,(function(){l.resize({linear:!0,resizeContainerAlso:!0,width:void 0,height:void 0})})),q.forEach((function(t){return o.on(t,(function(n){return e.teardown({root:r,content:i,ui:l,initial:s,err:n,event:t})}))}))}},{key:"add_time_listeners",value:function(t){var n=t.ads,r=t.content,i=t.ui,a=t.state,o=flowplayer.events;a.listening||(r.on([o.TIME_UPDATE,o.SEEKED,o.PLAYING,o.SEEKING],(function(t){n&&(n.adPlaying&&n.adapter.adLinear&&!n.adapter.sharedVideoTag&&!r.paused&&r.pause(),e.update_time({ads:n,content:r,ui:i,seek:t.type===o.SEEKING}))})),a.listening=!0)}},{key:"update_time",value:function(e){var t=e.ads,n=e.content,r=e.seek,i=void 0!==r&&r;t&&t.setCurrentTime(n.currentTime,void 0,i)}},{key:"teardown",value:(n=p()(d.a.mark((function t(n){var r,i,a,o,s,u,c,l,f,p;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.root,i=n.content,a=n.ui,o=n.event,s=n.err,u=void 0===s?{}:s,a.isShowing()||i.paused){t.next=3;break}return t.abrupt("return",{noop:1});case 3:if(c=flowplayer,l=c.states,r.classList.add("is-seamless"),a.classList.remove("is-vpaid"),r.classList.remove(l.WAITING),z("LifeCycle.teardown(event: %s)",o),u.reason&&z("LifeCycle.teardown(:err, reason: %s) %o",u.reason),a.toggle(V),f=i.ads,p=f.getLastAd(),f.shouldRestartContent()){t.next=15;break}return z("Lifecycle.teardown(:skip_restart, reason: %s)","Ad prevented restarting content"),t.abrupt("return",e.on_content_playing(r));case 15:if(!(i.currentTime>0&&i.currentTime>=i.duration||"postroll"==f.ad_type||!1===p.restart)){t.next=18;break}return z("Lifecycle.teardown(:skip_restart, reason: %s)","was a postroll ad"),t.abrupt("return",e.on_content_playing(r));case 18:if(""===i.currentSrc&&i.setSrc(i.original_src),!i.paused||!f.shouldRestartContent()){t.next=23;break}return z("Lifecycle.teardown(:toggle_play, %s)","attempting to restart content"),t.next=23,i.togglePlay(!0);case 23:if(i.paused){t.next=26;break}return z("Lifecycle.teardown(:ok)","restarted video content"),t.abrupt("return",e.on_content_playing(r));case 26:case"end":return t.stop()}}),t,this)}))),function(e){return n.apply(this,arguments)})},{key:"on_content_playing",value:function(e){e.classList.remove("is-seamless")}},{key:"maybe_blocked",value:function(e){z("google.ima not found in window"),[].slice.call(document.getElementsByTagName("script")).filter((function(e){return t=e.src,(n=document.createElement("a")).href=t,"imasdk.googleapis.com/js/sdkloader/ima3.js"=="".concat(n.host).concat(n.pathname);var t,n})).length>0&&e.emit(A.a.AD_BLOCKED)}},{key:"peek_content",value:(t=p()(d.a.mark((function t(n,r){var i,a,o,s,u,c;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=[n.muted,n.volume],z("LifeCycle::peek_content(:muted => %s, :volume => %s)",a=i[0],o=i[1]),s=function(){return new Promise((function(e){return setTimeout(e,0,!1)}))},u=function(){return new Promise((function(e){return setTimeout((function(){return e(n.play())}))}))},c=function(){return new Promise((function(e){return setTimeout((function(){return e(n.pause())}))}))},r&&(n.muted=!1,n.volume=n.volume?n.volume:1),t.prev=6,t.next=9,e.wait_for_source(n);case 9:return n.volume&&(n.volume=.01),z("LifeCycle::peek_content::play"),t.next=13,u();case 13:return z("LifeCycle::peek_content::pause"),t.next=16,c();case 16:return n.volume=o,z("LifeCycle::peek_content::true"),t.abrupt("return",!0);case 21:if(t.prev=21,t.t0=t.catch(6),n.volume=o,!r){t.next=30;break}return n.muted=!1,0==n.volume&&(n.volume=1),t.next=29,s();case 29:return t.abrupt("return",t.sent);case 30:if(!a&&o){t.next=35;break}return z("LifeCycle::peek_content::false"),t.next=34,s();case 34:return t.abrupt("return",t.sent);case 35:return z("LifeCycle::peek_content::recover"),n.muted=!0,t.next=39,e.peek_content(n);case 39:if(!t.sent){t.next=41;break}return t.abrupt("return",!0);case 41:return n.muted=a,z("LifeCycle::peek_content::false"),t.next=45,s();case 45:return t.abrupt("return",t.sent);case 46:case"end":return t.stop()}}),t,this,[[6,21]])}))),function(e,n){return t.apply(this,arguments)})},{key:"wait_for_source",value:function(e){return z("LifeCycle::wait_for_source"),new Promise((function(t,n){var r=0,i=setInterval((function(){if(++r>40)return clearInterval(i),n(new Error("No source in ".concat(2e3,"ms, giving up")));e.currentSrc&&(t(),clearInterval(i))}),50)}))}}]),e}();W.TERMINAL_EVENTS=q;var Q=n(51),K=n(21),Y="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;function Z(e){var t=0,n=null;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=Date.now()-t;null===n&&(n=Y((function(){n=null,e.apply(void 0,i),t=Date.now()}),16-o))}}n(106);var J=n(32),X=n(46),$=n(50),ee=n(7)("fpads:native:outstream"),te={OUTSTREAM_VISIBLE:"ads-outstream-visible",OUTSTREAM_VIEWPORT_UPDATE:"ads-outstream-viewport-update",OUTSTREAM_TEARDOWN:"ads-outstream-teardown",OUTSTREAM_ENDSCREEN_READY:"ads-outstream-endscreen-ready"},ne=function(){function e(t){var n=this,r=t.ads,i=t.container,a=t.video,o=t.ima;v()(this,e),r.outstream=this,this.video=a,this.ads=r,this.container=i,this.ima=o,this.aspect_ratio=i.aspect_ratio.style.paddingTop,this.dimensions=function(e){if(e.clientWidth>0||e.clientHeight)return U(e);var t={height:e.style.height};H(e,"opacity",0),H(e,"display","absolute"),H(e,"display","inline-block"),H(e,"height","auto");var n=U(e);return H(e,"height",t.height),H(e,"opacity",1),n}(this.container),ee("creating Outstream instance"),this.hide(),this.poll_viewport_exit=e.fps_60_visibilty_checker({outstream:this}),this.setup();var s=Object($.a)(this.container,function(){var e=p()(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return s(),e.next=5,n.begin_life_cycle();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}())}var t;return m()(e,null,[{key:"of",value:function(t){return new e(t)}},{key:"fps_60_visibilty_checker",value:function(e){var t=e.outstream;return Z((function(){if(!t.disposed){var e=t.percent_in_viewport();if(t.ads.emit(te.OUTSTREAM_VIEWPORT_UPDATE,{percent:e}),!(e>.5&&t.ads.adPlaying))return e>.5?t.ads.resume():void t.ads.pause()}}))}}]),m()(e,[{key:"hide",value:function(){return this}},{key:"restore_aspect_ratio",value:function(){return ee("Outstream.restore_aspect_ratio(".concat(this.aspect_ratio,")")),this.container.aspect_ratio.style.paddingTop=this.aspect_ratio,this}},{key:"percent_in_viewport",value:function(){return e=this.video.root.getBoundingClientRect(),t=window.innerHeight,(n=e.y)>t||n+e.height<0?0:e.y<0?(e.height+n)/e.height:t-e.y>e.height?1:Math.abs((t-e.y)/e.height);var e,t,n}},{key:"show",value:function(){this.container.removeClass(e.CLASS.HIDDEN),this.container.addClass(e.CLASS.SHOWING),this.ui.toggle({linear:!0,on:!0})}},{key:"begin_life_cycle",value:(t=p()(d.a.mark((function e(){var t,n,r,i,o,s=this;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J.a(!1);case 2:return t=e.sent,n=t.error,r=t.result,e.next=7,J.a(!0);case 7:return i=e.sent,o=i.result,this.attach_ad_listeners(),this.ui.initial={can_autoplay:!(!r&&!o),muted:!r},ee("Outstream.show() :autoplay >> ",this,{error:n,can_autoplay_audio:r}),n&&this.video&&!r&&(this.video.muted=!0,this.video.volume=0),e.next=15,this.ads.setVideoTag(this.video);case 15:return this.ads.on(A.a.AD_PAUSE_CONTENT,(function(e){var t=e.linear;s.ads.resize({width:s.dimensions.width,height:s.dimensions.height,linear:t})})),e.next=18,W.start({ads:this.ads,content:this.video,adContainer:this.adContainer,ima:this.ima,state:{},opts:a()({},this.video.opts,{muted:!0,dimensions:this.dimensions})});case 18:W.update_time({content:this.video,ads:this.ads,ui:this.ui});case 19:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"attach_ad_listeners",value:function(){var e=this,t=this,n=t.ads;n.once(A.a.AD_PAUSE_CONTENT,(function(){t.show(),t.poll_viewport_exit(),document.addEventListener("scroll",t.poll_viewport_exit),window.emit("resize")})),t.ima.always_show_controls||n.on(A.a.VPAID_INIT,(function(){return t.ui.addClass("is-vpaid")}));var r=function n(r){W.TERMINAL_EVENTS.forEach((function(e){return t.ads.removeListener(e,n)}));var i,a,o=(i=te.OUTSTREAM_TEARDOWN,(a=document.createEvent("Event")).initEvent(i,!1,!0),a);ee("Outstream(:teardown)",o),e.video.dispatchEvent(o)};W.TERMINAL_EVENTS.forEach((function(e){return t.ads.once(e,r)})),this.video.once(te.OUTSTREAM_TEARDOWN,(function(e){setTimeout((function(){if(e.defaultPrevented)return t.handle_endscreen();t.dispose()}),0)}))}},{key:"handle_endscreen",value:function(){this.reset_ui(),this.ads.reset(),this.ui.wireup(),W.ui_listeners(a()({},this,{content:this.video,root:this.video.root,state:{started:!0},initial:{muted:!0}}))}},{key:"empty_src",value:function(){this.video.setSrc({type:"video/mp4",src:URL.createObjectURL(X.a)})}},{key:"setup",value:function(){this.container.addClass(e.CLASS.IS),this.container.addClass(e.CLASS.HIDDEN),this.empty_src(),this.ui=B.of({root:this.video.root,content:this.video,ads:this.ads,config:this.video.opts}),this.adContainer=this.ui.adContainer}},{key:"poll_viewport_exit",value:function(){this.ads.adPlaying&&this.ads.pause()}},{key:"reset_ui",value:function(){var t=this.container;t.removeClass(e.CLASS.SHOWING),t.removeClass(e.CLASS.IS),document.removeEventListener("scroll",this.poll_viewport_exit),this.ui.toggle({on:!1})}},{key:"dispose",value:function(){if(!this.disposed){var t=this.container,n=this.video;this.reset_ui(),t.addClass(e.CLASS.IS),t.addClass(e.CLASS.DONE),this.video=this.container=this.ads=0,this.disposed=1,n.destroy()}}}]),e}();ne.CLASS={IS:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"},ne.events=ne.EVENT=te;var re=n(9);function ie(e,t,n){if(!("google"in window))return W.maybe_blocked(n);var i=e.autoplay;n.autoplay=e.autoplay=!1;var o=n.ads=new Q.a,s=o.analytics=Object(K.b)(o),u=!1;o.resize(U(t)),flowplayer.ads||(flowplayer.ads={}),flowplayer.ads.version="1.16.7",flowplayer.ads.commit="8017b3e4c408cd0f212db2300242817be04b6d2c",flowplayer.ads.events=A.a,flowplayer.ads.ui=r,M&&(n.on([flowplayer.events.FULLSCREEN_ENTER,flowplayer.events.FULLSREEN_EXIT,"webkitendfullscreen"],(function(e){var t=e.type===flowplayer.events.FULLSCREEN_ENTER;n.ads.adapter.setIOSPlaysInline(!t)})),o.on(A.a.AD_POSTROLL_FINISHED,(function(){o.adapter.sharedVideoTag&&o.once(A.a.AD_BREAK_COMPLETED,(function(){n.src=n.original_src,n.once(flowplayer.events.CAN_PLAY,(function(e){n.pause()})),n.webkitExitFullscreen()}))}))),flowplayer.Outstream=ne,n.on(flowplayer.events.REAP,(function(){o&&o.destroy(),s=o=void 0})),n.on(flowplayer.events.SOURCE,(function(){o&&o.stop()})),n.on(flowplayer.events.CONFIG,(function(r){var c=r.data,l=c.ima||{};if(Array.isArray(l.ads)){var d=c.duration||n.duration;if(l.ads=function(e,t){return Array.isArray(e)&&e.map((function(e,n){return"number"==typeof e.time||e.lazy?e:isNaN(e.percentage)?(console.warn("Ad[index: ".concat(n,"] passed without 'time' property or 'percentage' properties")),e):isNaN(t)?(console.warn("Ad[index: ".concat(n,"] passed with 'percentage' property but both content and config 'duration' was ").concat(t)),e):"number"==typeof e.percentage?(e.time=Math.floor(e.percentage*t),e):e}),[])}(l.ads,d),o.setSchedule(l.ads,d),c.metadata&&K.a.mergeMetadata(s,c.metadata),c.metadata&&o.mergeMacros(c.metadata),c.metadata&&l.parameters&&(l.parameters=a()({},l.parameters,c.metadata)),K.a.mergeMetadata(s,{muted:c.muted||!1,autoplay:c.autoplay||!1}),!u){if(u=!0,e.lang&&!l.Locale&&(l.Locale=e.lang),re.a.isOutstream(l.ads))return ne.of({container:t,video:n,ads:o,ima:l});W.init({config:a()({},e,{autoplay:i}),root:t,content:n,ads:o,ima:l})}}else void 0!==i?e.autoplay=i:delete e.autoplay}))}Object.assign(A.a,ne.events),window.addEventListener("resize",Z((function(){null!=("undefined"==typeof flowplayer?"undefined":s()(flowplayer))&&Array.isArray(flowplayer.instances)&&flowplayer.instances.forEach((function(e){return e.ads&&e.ads.resize(U(e))}))}))),ie.events=A.a,ie.ui=r,ie.Outstream=ne,ie.version="1.16.7",ie.commit="8017b3e4c408cd0f212db2300242817be04b6d2c"},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}},function(e,t,n){var r=n(99);"string"==typeof r&&(r=[[e.i,r,""]]),n(20)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(19)(!1)).push([e.i,'.fp-ad-container .fp-color{background-color:gold}.fp-ad-container .fp-color-text{color:gold;font-weight:700;line-height:1.8em}.fp-ad-container{position:absolute;z-index:-1;background:#333;top:0;left:0;right:0;bottom:0;opacity:0}.fp-ad-controls{position:absolute;direction:ltr;top:100%;left:0;margin-top:-3.2em;height:3em;z-index:1000;display:none;padding:.72em 0em .72em 2em;justify-content:space-between;align-items:center;font-weight:500;text-align:right}.fp-ad-controls .fp-volumebtn:after{filter:drop-shadow(0 0 2px rgba(0, 0, 0, 0.4))}.fp-ad-controls .fp-secondary{filter:drop-shadow(0 0 2px rgba(0, 0, 0, 0.4));position:relative;left:0;top:0}.is-small .ad-indicator{display:none}.is-small .fp-ad-controls>*{transform:scale(0.8)}.is-tiny .fp-ad-controls>*{transform:scale(0.7)}.fp-ad-controls .fp-fullscreen,.fp-ad-controls .fp-fullscreen-exit{visibility:visible !important;position:relative;top:.2em}.fp-ad-controls .fp-volumebtn{margin-right:2.38em}.fp-ad-controls .fp-btns,.fp-ad-controls .ad-indicator,.fp-ad-controls .fp-volume{margin-right:1em}.no-fullscreen .fp-ad-controls .fp-fullscreen,.no-fullscreen .fp-ad-controls .fp-fullscreen-exit{visibility:hidden !important;height:0;width:0}.fp-ad-controls .ad-indicator:before{margin-right:.5em}.fp-ad-controls .fp-volumebtn{width:1.12em}.fp-ad-controls .fp-volume{display:none;margin-left:-2em}.fp-ad-controls .fp-skip-next{display:none}.ad-volume-bar .fp-volume{display:flex}.fp-ad-controls .fp-volumebtn{height:100%}.fp-ad-controls .fp-volumebtn:after{font-size:230% !important;line-height:inherit !important}.fp-ad-controls .fp-btns{width:1.8em}.fp-ad-container.ad-paused .fp-small-play{display:inline-block}.fp-ad-container.ad-playing .fp-small-pause{display:inline-block}.fp-ad-container.ad-playing .fp-small-play{display:none}.fp-ad-container .fp-volume-mute-unmute{height:100%}.fp-ad-remaining:after{content:"·";margin-left:.5em;margin-right:.5em}.fp-ad-progress-wrapper{direction:ltr}.fp-ad-progress{height:.2em;top:100%;margin-top:-0.2em;width:0%;position:absolute;transition:width .2s}.logo-on-right .fp-secondary>*{margin:0}.fp-ad-choises-icon{display:none}.is-ad-attribution .fp-ad-container::after{content:"Advertisement";position:absolute;width:100%;text-align:center;z-index:10;color:gray;background-color:rgba(255,255,255,.2);font-size:11px;font-weight:500}.is-ad-choices .fp-ad-choices{position:absolute;width:77px;height:15px;right:0;border-bottom-left-radius:8px;padding-left:5px;color:#000;background-color:rgba(255,255,255,.7);font-size:11px;font-weight:500;z-index:11}.is-ad-choices .fp-ad-choices::after{content:" ";background-image:url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9Ii4yIDAgMTkuNCAyMCIgd2lkdGg9IjI0MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTIuMiAyMGMxIDAgMS43LS41IDIuNC0uOS42LS4zIDEuMi0uNyAxLjktMSAzLjItMS43IDYuNC0zLjUgOS42LTUuMyAxLS41IDIuMy0xIDMtMS45LjItLjMuNS0uNy40LTEuMi0uMy0xLjEtMS43LTEuNS0yLjYtMi0yLjItMS4yLTQuNS0yLjUtNi43LTMuNy0uOC0uNS0yLTEuNC0zLS43LS40LjItLjYuNC0uNy43LS4xLjQgMCAuOSAwIDEuM3YzLjJjMCAuOS0uMSAxLjYuNSAyIC4yLjEuNi4yLjkuMSAxLS40LjctMi4yLjctMy42di0xLjFjMS43LjkgMy40IDEuOCA1LjEgMi42LjYuMyAxLjYuNiAxLjggMS40LjIuOS0xLjcgMS42LTIuMyAxLjlsLTYuOSAzLjljLS41LjMtMS44IDEuMy0yLjYgMS0uMy0uMS0uNS0uNC0uNS0uNi0uMS0uNC0uMS0xLS4xLTEuNXYtMy4yLTUuNGMwLS44LS4xLTEuOC4yLTIuMy43LTEgMi4zLjggMi44LS44LjEtLjQtLjEtLjgtLjMtMS0uNC0uNi0yLjItMS41LTIuOS0xLjctLjItLjEtLjctLjItMS0uMi0xLjcuMy0xLjMgMy0xLjMgNXY5LjljMCAxLjUtLjIgMy41LjQgNC40LjMuNS42LjUgMS4yLjd6bTUuMi02LjVjMS41IDAgMS42LTEuOS4yLTIuMi0uOC0uMS0xLjQuNy0xLjIgMS40LjIuNS41LjYgMSAuOHoiIGZpbGw9IiMwMGFlY2QiLz48L3N2Zz4=");background-size:contain;display:inline-block;position:absolute;width:13px;height:13.747px;right:1px;top:1px}.ad-hide-first-frame .fp-wait{opacity:1}.ad-hide-first-frame .fp-engine{display:none}.ad-hide-first-frame>.fp-ui .fp-switch{display:none}',""])},function(e,t,n){var r=n(101);"string"==typeof r&&(r=[[e.i,r,""]]),n(20)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(19)(!1)).push([e.i,".is-ad-linear .fp-ad-container{z-index:1;opacity:1}.is-ad-linear.is-hovered .fp-ad div{background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 15%),linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 20%)}.is-ad-linear.is-hovered .fp-ad-controls,.is-ad-linear.is-ad-controls-sticky .fp-ad-controls,.is-ad-linear .ad-paused .fp-ad-controls{display:flex}.is-ad-linear .fp-ad-container.ad-ui-disabled .fp-ad-controls,.is-ad-linear .fp-ad-container.ad-ui-disabled .fp-ad-progress{display:none !important}.ad-paused .fp-ad-controls .fp-btns svg.fp-small-play{display:inline}.ad-paused .fp-ad-controls .fp-btns svg.fp-small-pause{display:none}.ad-playing .fp-ad-controls .fp-btns svg.fp-small-pause{display:inline}.ad-playing .fp-ad-controls .fp-btns svg.fp-small-play{display:none}.fp-ad-container.ad-paused .fp-wait,.fp-ad-container.ad-playing .fp-wait{display:none !important}.fp-ad-container.is-waiting .fp-ad-controls,.fp-ad-container.is-waiting .fp-ad-progress{display:none}.fp-ad-container.is-waiting .fp-wait{position:absolute;height:2em;opacity:1;top:50%;z-index:1;width:4em;left:50%;margin-left:-2em;margin-top:-1em}",""])},function(e,t,n){var r=n(103);"string"==typeof r&&(r=[[e.i,r,""]]),n(20)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(19)(!1)).push([e.i,".is-ad-nonlinear .fp-ad-controls,.is-ad-nonlinear .fp-ad-progress{display:none}.is-ad-nonlinear .fp-ad-container{background:transparent}.is-ad-nonlinear.is-ad-showing .fp-ad-container{left:0%;top:100%;width:100%;z-index:1;opacity:1}.is-ad-nonlinear.is-ad-showing .fp-ad-wrapper{position:relative}.is-ad-nonlinear.is-ad-showing .fp-ad{margin:0 auto}",""])},function(e,t,n){var r=n(105);"string"==typeof r&&(r=[[e.i,r,""]]),n(20)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(19)(!1)).push([e.i,".fp-ad-container.is-vpaid .fp-ad-controls{display:none}",""])},function(e,t,n){var r=n(107);"string"==typeof r&&(r=[[e.i,r,""]]),n(20)(r,{insert:"head",singleton:!1}),r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(19)(!1)).push([e.i,".flowplayer.is-outstream{background:transparent}.flowplayer.is-outstream .fp-ui{visibility:hidden}.flowplayer.is-outstream-hidden>video,.flowplayer.is-outstream-done>video{display:none}.flowplayer.is-outstream-visible{height:auto}.flowplayer.is-outstream-visible .fp-ad-container{left:0px;top:0px}",""])},,,,,function(e,t,n){n(53),n(72),n(74),n(76),e.exports=n(96)}]).default})));!function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(t||(t={}));const r=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function i(e,t){return!!~r.indexOf(e)||e.indexOf(t)===e.length-t.length}i.check_whitelist=function(e){return!!~r.indexOf(e)};function a(e){this.message=e}a.prototype=new Error,a.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new a("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};var s=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(o(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return o(t)}};function u(e){this.message=e}u.prototype=new Error,u.prototype.name="InvalidTokenError";var c=function(e,t){if("string"!=typeof e)throw new u("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(s(e.split(".")[n]))}catch(e){throw new u("Invalid token specified: "+e.message)}};c.InvalidTokenError=u;const l="production";function d(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=c(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&d.validate(n),n}function f(e){return{grant:e,is_granted:t=>(e&t)===t}}d.validate=function(e){if("string"==typeof e&&(e=d(e)),!e||!e.raw){if(i.check_whitelist(window.location.hostname)||"dev"===l.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=i.bind(null,t);if("dev"!==l.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==l.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},d.id=function(e){if(e)return"string"==typeof e&&(e=d(e)),e.data.id},f.of=f,f.from_token=function(e){const t=d(e,{require_valid_token:!0});return f.of(t.data.acl)},f.permissions=t;const{samsung_tv:p}=function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),a=/SamsungBrowser/.test(t),o=a&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:i,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:a,samsung_tv:a&&o,touch:!!("ontouchstart"in window)}}();class Ads{init(e,t,r){if(f.from_token(e.token||"").is_granted(f.permissions.ADS)&&!p)return n(e,t,r)}}return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Object.assign(Ads,n)),Ads}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.ads=t())}(this,(function(){"use strict";var e;!function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN"}(e||(e={}));const t=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function s(e,s){return!!~t.indexOf(e)||e.indexOf(s)===e.length-s.length}s.check_whitelist=function(e){return!!~t.indexOf(e)};function i(e){this.message=e}i.prototype=new Error,i.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new i("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,r,n=0,a=0,o="";r=t.charAt(a++);~r&&(s=n%4?64*s+r:r,n++%4)?o+=String.fromCharCode(255&s>>(-2*n&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};var n=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return r(t)}};function a(e){this.message=e}a.prototype=new Error,a.prototype.name="InvalidTokenError";var o=function(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var s=!0===(t=t||{}).header?0:1;try{return JSON.parse(n(e.split(".")[s]))}catch(e){throw new a("Invalid token specified: "+e.message)}};o.InvalidTokenError=a;const d="production";function l(e,t){const s={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let i={c:"{}",exp:0};t=t||{};try{i=o(e),s.valid_jwt=!0}catch(e){}return s.raw=e,s.data=JSON.parse(i.c),s.exp=i.exp,t.require_valid_token&&l.validate(s),s}function c(e){return{grant:e,is_granted:t=>(e&t)===t}}function u(e){return{width:e.clientWidth,height:e.clientHeight}}function h(e,t,s){return"number"==typeof s&&(s+="px"),e.style.setProperty(t,s),e}l.validate=function(e){if("string"==typeof e&&(e=l(e)),!e||!e.raw){if(s.check_whitelist(window.location.hostname)||"dev"===d.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,i=s.bind(null,t);if("dev"!==d.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(i))throw new Error("Domain not allowed");if("dev"!==d.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},l.id=function(e){if(e)return"string"==typeof e&&(e=l(e)),e.data.id},c.of=c,c.from_token=function(e){const t=l(e,{require_valid_token:!0});return c.of(t.data.acl)},c.permissions=e;const p="undefined"!=typeof document&&"undefined"!=typeof window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;var g;function m(e,t){const s=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),i=(...i)=>{const r=(null==t?void 0:t.debug)||s;r&&e.match(r)&&console.log(e,...i)};return i.log=i,i}!function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(g||(g={}));const f=(e,t)=>new(((e,t)=>{const s=e.get(t);if(!s)throw new Error(`no flowplayer component with the name ${t} exists`);const i=window.customElements.get(t);if(!i)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(s);return"function"!=typeof r?i:r})(e._customElements,t))(e),y=(e,t,s)=>{window.customElements.get(t)||window.customElements.define(t,s),e.customElements.get(t)||e.customElements.set(t,t)},_=m("ads/lifecycle"),v=["ad-playback-error","ad-teardown","ad-break-completed"];async function A({config:e,root:t,content:s,ads:i,ima:r}){s.autoplay=!1;const n=e.autoplay===g.AUDIO_REQUIRED,a=function(e,t){return{muted:!(t||!e.muted),volume:e.volume}}(s,n);s.on("volumechange",()=>{a.volume=s.volume,a.muted=s.muted});const o=f(s,"flowplayer-ad-ui"),d=o.adContainer;t.append(o);const l={listening:!1,preload:null==r?void 0:r.preload_ads};if(_("initial",a),i.setVideoTag(s),e.autoplay){_("Trying to autoplay"),o.hideFirstFrame(t);await async function e(t,s){const[i,r]=[t.muted,t.volume];_("Lifecycle::peek_content(:muted => %s, :volume => %s)",i,r);const n=()=>new Promise(e=>setTimeout(e,0,!1));s&&(t.muted=!1,t.volume=t.volume?t.volume:1);try{return await async function(e){return _("Lifecycle::wait_for_source"),new Promise((t,s)=>{let i=0;const r=setInterval(()=>{if(++i>40)return clearInterval(r),s(new Error("No source in 2000ms, giving up"));e.currentSrc&&(t(null),clearInterval(r))},50)})}(t),t.volume&&(t.volume=.01),_("Lifecycle::peek_content::play"),await new Promise(e=>setTimeout(()=>e(t.play()))),_("Lifecycle::peek_content::pause"),await new Promise(e=>setTimeout(()=>e(t.pause()))),t.volume=r,_("Lifecycle::peek_content::true"),!0}catch(a){return t.volume=r,s?(t.muted=!1,0==t.volume&&(t.volume=1),await n()):i||!r?(_("Lifecycle::peek_content::false"),await n()):(_("Lifecycle::peek_content::recover"),t.muted=!0,!!await e(t)||(t.muted=i,_("Lifecycle::peek_content::false"),await n()))}}(s,n)?(_("Can autoplay, start ad"),s.opts.autoplay=1,w({ads:i,content:s,state:l,adContainer:d,ima:r,config:e})):(_("cannot autoplay(audioRequired: %s), fallback to poster state",n),e.autoplay=0,o.showFirstFrame(t),s.setState("is-starting",!0))}e.autoplay||i.hasPreroll()&&function({content:e,ads:t,config:s,state:i,initial:r,adContainer:n,ima:a}){e.once("beforeplay",(async function(o){(e.hasState("is-in-viewport")||"touchend"!=o.type)&&t.shallPlayAd(0)&&(!p&&o.preventDefault(),S({ads:t,content:e,state:i}),_("user_gesture(:intercept) -> shallPlayAd(0: %s)",t.shallPlayAd(0)),s.muted=r.muted,await w({ads:t,content:e,state:i,adContainer:n,ima:a,config:s}),T({ads:t,content:e}))}))}({content:s,ads:i,config:e,state:l,initial:a,adContainer:d,ima:r}),!e.autoplay&&i.hasPreroll()&&l.preload&&w({ads:i,content:s,state:l,adContainer:d,ima:r,config:e}),E({config:e,root:t,content:s,ads:i,state:l,adContainer:d,ui:o,ima:r,initial:a}),s.on("src",()=>{s.once("beforeplay",()=>i.resetScheduleCounter())})}async function w({ads:e,content:t,adContainer:s,ima:i,state:r,config:n}){var a;if(r.started)return;r.started=!0;const o=
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
function(e,t){var s={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(s[i[r]]=e[i[r]])}return s}(i,["ads"]),d=u(t.root),l=(null==n?void 0:n.muted)||t.muted,c=Object.assign(Object.assign(Object.assign({container:s,volume:l?0:t.volume,muted:l,autoplay:(null==n?void 0:n.autoplay)||!1,video_source:t.original_src,DisableCustomPlaybackForIOS10Plus:p,preload_ads:null===(a=null==n?void 0:n.ima)||void 0===a?void 0:a.preload_ads},o),d));_("start():",c,r),await e.initialize(!1,c,r.preload)}function b(e,t){var s,i;return{content_width:e.clientWidth||(null===(s=e.parentNode)||void 0===s?void 0:s.clientWidth)||t.clientWidth,content_height:e.clientHeight||(null===(i=e.parentNode)||void 0===i?void 0:i.clientHeight)||t.clientHeight}}function E({config:e,root:t,content:s,ads:i,initial:r,adContainer:n,state:a,ui:o,ima:d}){_("addUIListeners()"),s.once("playing",async r=>{if(i){if(_("addUIListeners() -> content started playing"),S({ads:i,content:s,state:a}),!i.shallPlayAd(0)||!i.adapter.isLinearAd())return _("addUIListeners() -> no more preroll ads -> resume content"),await w({ads:i,content:s,state:a,adContainer:n,ima:d,config:e});s.pause(),await w({ads:i,content:s,state:a,adContainer:n,ima:d,config:e}),i.shallPlayAd(0)&&i.adapter.isLinearAd()&&(o.classList.add("on","linear"),t.classList.add("is-waiting"),T({ads:i,content:s}))}}),s.on(["portrait","landscape"],(function(){if(!i)return;const{content_width:e,content_height:r}=b(s,t);i.resize({height:r,width:e})})),s.on("resize",e=>{if(!i||!e.detail)return;const{width:t,height:s}=e.detail.contentRect;i.resize({width:t,height:s})}),s.on("ended",e=>{var t;i&&(_("ui_listeners(:%s, event: %o)",e.type,e.detail),(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.from)!==i&&(e.preventDefault(),i.finished((function(){s.emit("ended",{from:i})}))))}),i.on("ad-requested",()=>{t.classList.toggle("is-waiting",!0)}),i.once("ad-started",()=>{s.on(["beforeplay","beforepause"],e=>{var t;if(!i.adBreak||!i.adapter.isLinearAd())return;e.preventDefault();const s=(null===(t=e.detail)||void 0===t?void 0:t.forced)?"beforeplay"===e.type:!i.adPlaying;s&&i.paused&&i.resume(),s||i.paused||i.pause()})}),i.on("ad-started",e=>{const n=e.detail,{linear:a,ad:d,ad_type:l}=n;let c;if(_(`Ad[linear: ${a}, currentTime: ${s.currentTime}] starting`,d),"preroll"==l&&!a&&s.paused&&s.play(),"preroll"==l&&a&&s.currentTime>0&&!s.opt("start_time")&&!s.opt("live")&&(_("Preroll[rewind: true]",s.currentTime),s.currentTime=0),a&&(c=b(s,t)),i.resize({width:c?c.content_width:d.width,height:c?c.content_height:d.height,linear:a,resize_non_linear:!0}),o.resize({linear:a,resizeContainerAlso:!0,width:a?void 0:d.width,height:a?void 0:d.height}),t.classList.remove("is-waiting"),o.classList.add("on"),o.classList.toggle("linear",a),o.classList.toggle("non-linear",!a),!a){_("non-linear ad / restarting content");try{s.togglePlay(!0),s.volume=r.volume,s.muted=r.muted}catch(e){_(e)}}}),i.on("ad-pause-content",()=>{o.resize({linear:!0,width:0,height:0})}),v.forEach(e=>i.on(e,r=>async function({root:e,content:t,ads:s,ui:i,eventName:r,err:n={reason:""}}){if(!i.classList.contains("on")&&!t.paused)return;e.classList.add("is-seamless"),i.classList.remove("is-vpaid"),e.classList.remove("is-waiting"),_("teardown(event: %s)",r),n.reason&&_("teardown(:err, reason: %s) %o",n.reason);i.classList.remove("on");const a=s.getLastAd();if(i.showFirstFrame(e),!s.shouldRestartContent())return _("Lifecycle.teardown(:skip_restart, reason: %s)","Ad prevented restarting content"),L(e);if(t.currentTime>0&&t.currentTime>=t.duration||"postroll"==s.ad_type||!1===(null==a?void 0:a.restart))return _("Lifecycle.teardown(:skip_restart, reason: %s)","was a postroll ad"),L(e);""===t.currentSrc&&t.setSrc(t.original_src);t.paused&&s.shouldRestartContent()&&(_("Lifecycle.teardown(:toggle_play, %s)","attempting to restart content"),await t.togglePlay(!0));if(!t.paused)return _("Lifecycle.teardown(:ok)","restarted video content"),L(e)}({root:t,content:s,ads:i,ui:o,err:r.detail,eventName:e})))}function S({ads:e,content:t,state:s}){s.listening||(t.on(["timeupdate","seeked","playing","seeking"],s=>{e.adPlaying&&e.adapter.isLinearAd()&&!e.adapter.isSharedVideoTag()&&!t.paused&&t.pause(),T({ads:e,content:t,seek:"seeking"===s.type})}),s.listening=!0)}function T({ads:e,content:t,seek:s=!1}){e&&e.setCurrentTime(t.currentTime,void 0,s)}function L(e){e.classList.remove("is-seamless")}const O=m("ads/timers");class TimerRegistry{constructor(e={},t={}){this.intervals=e,this.timers=t}}let M=-1;function R(e,t,s){const i=setInterval(s,t);if(O("TimerRegistry.createInterval() -> "+i,e.intervals),"object"==typeof i){const t=++M;return e.intervals[t]=t,t}return e.intervals[i]=i,i}function k(e){if(e)return O("TimerRegistry.empty()",Object.keys(e.timers),Object.keys(e.intervals)),Object.keys(e.intervals).forEach(t=>function(e,t){return O("TimerRegistry.removeInterval() -> "+t,e.intervals),clearInterval(e.intervals[t]),delete e.intervals[t],e}(e,t)),Object.keys(e.timers).forEach(t=>function(e,t){return O("TimerRegistry.removeTimeout() -> "+t,e.timers),clearTimeout(e.timers[t]),delete e.timers[t],e}(e,t)),e}class Schedule{constructor(e,t={}){this._ads=e,this._opts=t,this._nextIndex=0,this._postroll=void 0,this._loadPending=!1,this._postrollActive=!1,this.reset(this._ads)}toJSON(){const e=(this._ads||[]).slice(this._nextIndex);return this._postroll&&e.push(this._postroll),e}reset(e){this.setAds(e),this._nextIndex=0,this._postrollActive=!1}resetCounter(){this._nextIndex=0,this._postrollActive=!1}setAds(e){this._ads=e||[],this.sort()}getAds(){return this._ads}getNextAd(e){return this._ads[this._nextIndex]||e}getCurrentAd(){return this._postrollActive?this._postroll:this._loadPending?0:this._ads[this._nextIndex-1]}getPostroll(){return this._postroll}isDrained(){return this._nextIndex+1>this._ads.length}setPostrollActive(){this._postrollActive=!0}updateContentDuration(e){this._opts.content_duration=e}increment(){++this._nextIndex}decrement(){this._nextIndex>0&&--this._nextIndex}getNextIndex(){return this._nextIndex}getCurrentType(){const e=this.getCurrentAd();if(e)return Schedule.kindOf(e.time)}sort(){this._postroll=this._ads.find(e=>-1===e.time),this._ads=this._ads.filter(e=>e!==this._postroll).sort((e,t)=>e.time===t.time?this._ads.indexOf(e)-this._ads.indexOf(t):e.time-t.time)}shallPlayAd(e){if(this._loadPending)return!1;const t=this.getCurrentAd()||this.getNextAd();return!!(t&&t.time<=e&&-1!==t.time)}shallPlayNext(){const e=this.getNextAd(),t=this.getCurrentAd();return!(!e||!t||e.time!==t.time)}waitForLoad(e,t,s){if(this._loadPending=!1,!t)return!1;const i=s?this._opts.preload_advance:0;return t.time>=0?this._loadPending=e<t.time-i:-1===t.time&&(this._loadPending=this._opts.content_duration>0&&-1!==e?e<this._opts.content_duration-i:-1!==e),this._loadPending}static hasPreroll(e){return!!e.find(e=>0===e.time)}static isOutstream(e){return Schedule.hasPreroll(e)&&!!e[0].outstream}static kindOf(e){switch(e){case 0:return"preroll";case-1:return"postroll";default:return"midroll"}}}function P(e){try{return e.getAdPodInfo().getPodIndex()}catch(e){return}}class IMA{constructor(e){this.eventHandler=e,this.log=m("ads/adapter/ima"),this.google=window.google,this._adHandlers=[],this._timers=new TimerRegistry,this._started=!1,this._volumeLevel=0,this._adLoaded=!1,this._paused=!1,this._all_ads_completed=!1,this._currentDuration=0,this._currentRemaining=0,this._currentDisplayTs=0,this._iosPlaysInline=!1,this.sharedVideoTag=!1,this._isInitialized=!1,this._prepared=!1,this.opts={}}async init(e){this.log("init",this.videoTag,e),this.opts=e,this._dimensions={width:e.width,height:e.height,linear:e.linear},this._prepared=!0,!this._isInitialized&&this.videoTag&&await this.initAdapter()}async initAdapter(){this.log("initAdapter",this.opts);try{await this.initialize(this.opts),this._isInitialized=!0}catch(e){this.log("initAdapter failed:",e),this._prepared=!1,this.eventHandler.trigger("ad-adapter-init-failed")}}isReady(){return!!this._isInitialized}setIOSPlaysInline(e){this.log("setIOSPlaysInline",e),this.sharedVideoTag=!e,this.initialize(Object.assign(Object.assign({},this.opts),{DisableCustomPlaybackForIOS10Plus:e}))}getIOSPlaysInline(){return this._iosPlaysInline}setVideoTag(e){this.videoTag=e}isLinearAd(){return!!this._adLinear}isSharedVideoTag(){return!!this.sharedVideoTag}getVideoTag(){return this.videoTag}getDimensions(){return this._dimensions||{}}getOpts(){return this.opts}isPaused(){return this._paused}destroy(){k(this._timers),this._adHandlers&&this._adHandlers.forEach(e=>e()),this._adHandlers=void 0,this._adDisplayContainer&&this._adDisplayContainer.destroy(),this._adDisplayContainer=void 0,this._adsLoader&&this._adsLoader.destroy(),this._adsLoader=void 0,this._adsManager&&this._adsManager.destroy(),this._adsManager=void 0}stop(){this._adsManager&&this._adsManager.stop()}initialize(e){const t=this.isAdPod(),s=this._adLoaded||t;if(this.cleanup(),!this.videoTag)return console.warn("videoTag not set during initialization");this.opts=e,this._volumeLevel=e.volume;const i=this.google.ima.settings;e.NumRedirects=e.NumRedirects||e.redirects;const r={VpaidMode:this.google.ima.ImaSdkSettings.VpaidMode.INSECURE,DisableCustomPlaybackForIOS10Plus:!0};if(i.setVpaidMode(e.VpaidMode||r.VpaidMode),i.setDisableCustomPlaybackForIOS10Plus(e.DisableCustomPlaybackForIOS10Plus||r.DisableCustomPlaybackForIOS10Plus),"NumRedirects"in e&&i.setNumRedirects(e.NumRedirects),"AutoPlayAdBreaks"in e&&i.setAutoPlayAdBreaks(e.AutoPlayAdBreaks),"Locale"in e&&i.setLocale(e.Locale),"Ppid"in e&&i.setPpid(e.Ppid),!document.body.contains(e.container))throw new Error("AdDisplayContainer was not found in the document.body");this._adDisplayContainer=new this.google.ima.AdDisplayContainer(e.container,this.videoTag),this._adDisplayContainer.initialize(),this._adsLoader=new this.google.ima.AdsLoader(this._adDisplayContainer),this.log("ima.initialise(:wait -> ADS_MANAGER_LOADED)",Object.assign(Object.assign({},e),{volume:this.videoTag.volume,muted:this.videoTag.muted})),this._adsLoader.addEventListener(this.google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t=>{if(!this.videoTag)return;this.log("ima.initialise(:done -> ADS_MANAGER_LOADED)\n%o",Object.assign(Object.assign({},e),{volume:this.videoTag.volume,muted:this.videoTag.muted}));const s=new this.google.ima.AdsRenderingSettings;this.log("ima.rendering(preload: %s)",!!e.preload_ads),s.useStyledNonLinearAds=!0,s.enablePreloading=!!e.preload_ads,"number"==typeof e.media_timeout&&(s.loadVideoTimeout=e.media_timeout),s.restoreCustomPlaybackStateOnAdBreakComplete=!e.DisableCustomPlaybackForIOS10Plus,this.sharedVideoTag&&(s.playAdsAfterTime=this.videoTag.currentTime),this.eventHandler.trigger("ad-ima-rendering-settings",s);const i=this._adsManager=t.getAdsManager(this.videoTag,s);this.eventHandler.trigger("ad-ima-adapter-init",i),i.addEventListener(this.google.ima.AdEvent.Type.LOADED,()=>{this.log("debug(ima.adsManager): google.ima.AdEvent.Type.LOADED")}),i.addEventListener(this.google.ima.AdErrorEvent.Type.AD_ERROR,()=>{this.log("debug(ima.adsManager): google.ima.AdErrorEvent.Type.AD_ERROR")}),i.addEventListener(this.google.ima.AdEvent.Type.STARTED,()=>{this.log("debug(ima.adsManager): google.ima.AdEvent.Type.STARTED")}),i.addEventListener(this.google.ima.AdEvent.Type.STARTED,e=>{this.debugEvent(e);const t=e.getAd();t&&(this._currentDuration=t.getDuration(),this._currentDisplayTs=Date.now(),this.emitWithAd("ad-started",t),t.isLinear()&&IMA.pollRemaining({ima:this,adsManager:i}))}),i.addEventListener(this.google.ima.AdEvent.Type.COMPLETE,e=>{this.debugEvent(e);const t=e.getAd();t&&this.emitWithAd("ad-completed",t),k(this._timers)}),i.addEventListener(this.google.ima.AdEvent.Type.SKIPPED,e=>{this.debugEvent(e);const t=e.getAd();t&&this.emitWithAd("ad-skipped",t)}),i.addEventListener(this.google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,e=>{this.debugEvent(e);const t=e.getAd();t&&this.emitWithAd("ad-pause-content",t)});const r=()=>{this._started=!1,this._currentDisplayTs=0,this.eventHandler.trigger("ad-break-completed")};i.addEventListener(this.google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,e=>{this.debugEvent(e),r()}),i.addEventListener(this.google.ima.AdEvent.Type.VOLUME_CHANGED,e=>{this.log("IMA::volume(type: %s, event: %o)",e);const t=i.getVolume();this._volumeLevel=t,this.eventHandler.trigger("ad-volume-changed",t)});const n=e=>{this._paused=e,this.eventHandler.trigger(e?"ad-paused":"ad-resumed")};i.addEventListener(this.google.ima.AdEvent.Type.PAUSED,()=>n(!0)),i.addEventListener(this.google.ima.AdEvent.Type.RESUMED,()=>n(!1)),i.addEventListener(this.google.ima.AdEvent.Type.STARTED,()=>n(!1)),i.addEventListener(this.google.ima.AdEvent.Type.VOLUME_MUTED,e=>{this.log("IMA::volume(type: %s, event: %o)","mute",e),this.eventHandler.trigger("ad-muted")});const{width:a,height:o}=e;a&&o&&(i.init(a,o,this.google.ima.ViewMode.NORMAL),this.log("ima.initialise: done initializing"))}),s&&(this.log("Event(reload: %s)","reload-ad-requested"),this.eventHandler.trigger("reload-ad-requested",t)),this.eventHandler.trigger("ad-initialized",this)}destroyManager(e="unknown"){if(!this._adsManager)return this.log("ima::destroyManager(:skip, label: %s)",e);this.log("ima::destroyManager(:ok, label: %s)",e),this._adsManager.destroy()}reset(){this.destroyManager("reset"),k(this._timers),this.clearAdHandlers(),this._started=!1,this._adLoaded=!1}cleanup(){this.destroyManager("cleanup"),this._adsLoader&&this._adsLoader.destroy(),this._adDisplayContainer&&this._adDisplayContainer.destroy(),this._adLoaded=!1}waitForAdsManager(){return new Promise(e=>{this.log("ima.waitForAdsManager:",this._adsManager),this.once(this._adsLoader,this.google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,()=>{this.log("ima.waitForAdsManager(:ok)",this._adsManager),e(this._adsManager)})})}async initAd(e,t=5e3){this.log(`ima.initAd(adTag: ${e}, timeout: ${t})`);try{await this.requestAd(e,t),this._adLoaded=!0}catch(e){throw this.log("ima.initAd:",e),this._adLoaded=!1,e}finally{k(this._timers)}}async requestAd(e,t){if(this.destroyManager("requestAd"),!this.videoTag)return;const{autoplay:s=!1}=this.opts,i=Date.now(),r=this.videoTag.muted;this._volumeLevel=this.videoTag.volume;const n=r||0==this._volumeLevel;this._all_ads_completed=!1,this.log("ima.requestAd(%o)",Object.assign(Object.assign({},this.opts),{autoplay:s,muted:r,timeout:t,adTag:e,_volumeLevel:this._volumeLevel,manager:this._adsManager})),this.clearAdHandlers();const a=new this.google.ima.AdsRequest;a.adTagUrl=e;const{height:o,width:d}=this.opts;if(d&&(a.linearAdSlotWidth=d),o&&(a.linearAdSlotHeight=o),!this.opts.disable_non_linear_ads&&d&&(a.nonLinearAdSlotWidth=d),!this.opts.disable_non_linear_ads&&o&&(a.nonLinearAdSlotHeight=o-50),a.setAdWillAutoPlay(s),a.setAdWillPlayMuted(n),a.vastLoadTimeout=t,this.eventHandler.trigger("ad-ima-before-ads-request",{request:a}),!this._adsLoader)return;this._adsLoader.requestAds(a);return new Promise(async(e,s)=>{const r=t=>{clearTimeout(o),e(t)},a=e=>{clearTimeout(o),s(e)};this.once(this._adsLoader,this.google.ima.AdErrorEvent.Type.AD_ERROR,e=>{this.emitError("ad-request-error",e),a(new Error("Ad load failed"))});const o=setTimeout(()=>{const e=new Error("Ad internal timeout reached");this.eventHandler.trigger("ad-timeout",e),s(e)},1.5*(t+(this.opts.media_timeout||5e3))),d=await this.waitForAdsManager();this.volume(n?0:this._volumeLevel),this.eventHandler.trigger("ad-volume-changed",this._volumeLevel);const l=this.cuepoints();if(l&&l.length&&0!==l[0])return r({ad:!1,adsManager:d});this.once(d,this.google.ima.AdErrorEvent.Type.AD_ERROR,e=>{this.emitError("ad-playback-error",e),a(e)}),this.once(d,this.google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{this._all_ads_completed=!0,r(null)}),this.once(d,this.google.ima.AdEvent.Type.LOADED,e=>{this.eventHandler.trigger("ad-request-completed",{request_load_time:Date.now()-i});const t=e.getAd();t&&(this.log("ima.requestAd: AD_REQUEST_COMPLETED",t.getContentType()),"application/javascript"==t.getContentType()&&this.eventHandler.trigger("vpaid-init",t),r(null))}),this.once(d,this.google.ima.AdEvent.Type.CLICK,()=>{this.log("ima.requestAd: click event"),this.pause()})})}async playAd(){if(this.log("ima.playAd()",this),!this._adsManager||!this._adLoaded)return;const e=this.currentAd();if(e&&(!this.sharedVideoTag||e.isLinear()))try{await this.startAndWaitForAdCompletion(this._adsManager,e.isLinear())}catch(e){throw this.log("ima.playAd",e),e}finally{this._adLoaded=!1,k(this._timers)}}startAndWaitForAdCompletion(e,t){if(!this._started)return this.log("ima.startAndWaitForAdCompletion(manager: %o)",{volume:e.getVolume()}),new Promise((s,i)=>{let r=!1;this.once(e,this.google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,()=>{if(this.log("ima.startAndWaitForAdCompletion: CONTENT_RESUME_REQUESTED <<< happened"),this._started=!1,r)return this.log("ima.startAndWaitForAdCompletion: Content resume requested, but trying to recover from ad error");s()}),this.once(e,this.google.ima.AdErrorEvent.Type.AD_ERROR,async e=>{this.log("ima.startAndWaitForAdCompletion: beginning error recovery ->",e),r=!0;try{const{ok:t}=await IMA.pollForFatalError({err:e,ima:this});t&&(r=!1)}catch(t){this._started=!1,i(e)}}),t&&(this._started=!0),e.start(),this.eventHandler.trigger("ad-play-requested")})}pause(){this.log("ima.pause()"),this._adsManager&&this._adsManager.pause()}resume(){this.log("ima.resume()"),this._adsManager&&this._adsManager.resume()}volume(e){if(this._adsManager)try{return arguments.length>0&&"number"==typeof e&&this._adsManager.setVolume(e),this._volumeLevel=this._adsManager.getVolume()}catch(e){this.log("ima.volume() failed (%o)",e)}}onResize({width:e,height:t,linear:s,silent:i,resize_non_linear:r}){this._adsManager&&(this._adLinear=void 0===s?this._adLinear:s,this.opts&&(e||t)&&(!1===s&&(e+=10,t+=10),this._dimensions={width:e,height:t,linear:s},s&&(this.opts.width=e,this.opts.height=t),(this._adLinear||r)&&(i||this.log("ima.onResize %s x %s",e,t),this._adsManager.resize(e,t,this.google.ima.ViewMode.NORMAL))))}getAdInfo(){const e=this.currentAd();if(e)return{duration:e.getDuration(),currentTime:this._currentRemaining}}currentAd(){const e=this._adsManager;if(e)return e.getCurrentAd()}isAdPod(){const e=this.cuepoints();return!!(e&&e.length>1)}cuepoints(){return this._adsManager&&this._adsManager.getCuePoints()}async contentComplete(){this.log("ima.contentComplete() -> ",this),this._adsLoader&&this._adsLoader.contentComplete();const e=this.cuepoints();e&&-1!==e.indexOf(-1)&&await new Promise(e=>{IMA.race(this.eventHandler,["ad-break-completed","ad-error"],e)})}isUiDisabled(){try{const e=this.currentAd();return e&&e.isUiDisabled()}catch(e){return null}}getAdPodInfo(){try{const e=this.currentAd();return e&&e.getAdPodInfo()}catch(e){return null}}canDismissNonLinear(){const e=this.currentAd();if(!e||e.isLinear()||!this._adsManager||!this._currentDisplayTs)return!0;const t=Date.now(),s=e.getMinSuggestedDuration();return t-this._currentDisplayTs>1e3*s}static unwrapError(e,t){if(!e)return"";if("function"==typeof e.getMessage){return e.getMessage()}return e.message?e.message:t||""}static pollForFatalError({err:e,ima:t}){let s;try{const t=e.getError(),i=t.getInnerError(),r=i?IMA.unwrapError(i,t.message):"";s={reason:r,type:t.getType(),code:t.getErrorCode()}}catch(e){}const i=t._currentRemaining;return new Promise((e,r)=>{const n=setTimeout(()=>{t.eventHandler&&t.eventHandler.trigger("ad-playback-error",s),r(new Error("Ad not progressing"))},2500);t.eventHandler.once("ad-progress",t=>{const s=t.detail.remaining;-1!==s&&s<i&&(clearTimeout(n),e({ok:1}))})})}static pollRemaining({ima:e,adsManager:t}){let s=-1;return R(e._timers,250,(function(){e._currentRemaining=t.getRemainingTime(),s!=e._currentRemaining&&(s=e._currentRemaining,e.eventHandler.trigger("ad-progress",{remaining:e._currentRemaining,duration:e._currentDuration}))}))}once(e,t,s){this._adHandlers.push(function(e,t,s){const i=r=>{s(r),e.removeEventListener(t,i)};return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}(e,t,s))}static race(e,t,s){t.forEach(i=>{const r=(...i)=>{t.forEach(t=>e.removeListener(t,r)),s(i)};e.on(i,r)})}clearAdHandlers(){this.log("ima.clearAdHandlers"),this._adHandlers.forEach(e=>e()),this._adHandlers=[]}emitWithAd(e,t){if(this.log("ima.emitWithAd",e,t),!this._adsManager)return;const s=P(t),i=s?Schedule.kindOf(s):"unknown",r=function(e){try{return e.getAdPodInfo().getAdPosition()}catch(e){return}}(t),n=function(e){try{return e.getAdPodInfo().getTotalAds()}catch(e){return}}(t),a={ad_type:i,ad:{duration:t.getDuration(),width:t.getWidth(),height:t.getHeight(),position:r,totals:n},volume:this._adsManager.getVolume(),vast_ad_id:t.getAdId(),linear:t.isLinear(),mime_type:t.getContentType(),ima_event:!0};this.log(`emitWithAd::event(name: ${e}, data: %o, ad: %o)`,a,t),this.eventHandler.trigger(e,a)}emitError(e,t){const s={vast_error_type:t.getError().getType(),reason:t.getError().getMessage(),vast_error:t.getError().getErrorCode()};this.log(`ima.error(${e})`,s),this.eventHandler.trigger(e,s)}debugEvent(e){try{const t=e.getAd();if(!t)return;this.log(`ima.event.${e.type} ->`,{event:e,data:e.getAdData(),position:P(t),ad:t})}catch(e){}}}var C=String.prototype.replace,U=/%20/g,I="RFC3986",N={default:I,formatters:{RFC1738:function(e){return C.call(e,U,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:I},D=Object.prototype.hasOwnProperty,F=Array.isArray,x=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),B=function(e,t){for(var s=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)void 0!==e[i]&&(s[i]=e[i]);return s},j={arrayToObject:B,assign:function(e,t){return Object.keys(t).reduce((function(e,s){return e[s]=t[s],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],s=[],i=0;i<t.length;++i)for(var r=t[i],n=r.obj[r.prop],a=Object.keys(n),o=0;o<a.length;++o){var d=a[o],l=n[d];"object"==typeof l&&null!==l&&-1===s.indexOf(l)&&(t.push({obj:n,prop:d}),s.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),s=t.obj[t.prop];if(F(s)){for(var i=[],r=0;r<s.length;++r)void 0!==s[r]&&i.push(s[r]);t.obj[t.prop]=i}}}(t),e},decode:function(e,t,s){var i=e.replace(/\+/g," ");if("iso-8859-1"===s)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(e){return i}},encode:function(e,t,s,i,r){if(0===e.length)return e;var n=e;if("symbol"==typeof e?n=Symbol.prototype.toString.call(e):"string"!=typeof e&&(n=String(e)),"iso-8859-1"===s)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var a="",o=0;o<n.length;++o){var d=n.charCodeAt(o);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||r===N.RFC1738&&(40===d||41===d)?a+=n.charAt(o):d<128?a+=x[d]:d<2048?a+=x[192|d>>6]+x[128|63&d]:d<55296||d>=57344?a+=x[224|d>>12]+x[128|d>>6&63]+x[128|63&d]:(o+=1,d=65536+((1023&d)<<10|1023&n.charCodeAt(o)),a+=x[240|d>>18]+x[128|d>>12&63]+x[128|d>>6&63]+x[128|63&d])}return a},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(F(e)){for(var s=[],i=0;i<e.length;i+=1)s.push(t(e[i]));return s}return t(e)},merge:function e(t,s,i){if(!s)return t;if("object"!=typeof s){if(F(t))t.push(s);else{if(!t||"object"!=typeof t)return[t,s];(i&&(i.plainObjects||i.allowPrototypes)||!D.call(Object.prototype,s))&&(t[s]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(s);var r=t;return F(t)&&!F(s)&&(r=B(t,i)),F(t)&&F(s)?(s.forEach((function(s,r){if(D.call(t,r)){var n=t[r];n&&"object"==typeof n&&s&&"object"==typeof s?t[r]=e(n,s,i):t.push(s)}else t[r]=s})),t):Object.keys(s).reduce((function(t,r){var n=s[r];return D.call(t,r)?t[r]=e(t[r],n,i):t[r]=n,t}),r)}},q=Object.prototype.hasOwnProperty,V={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},H=Array.isArray,z=String.prototype.split,Q=Array.prototype.push,W=function(e,t){Q.apply(e,H(t)?t:[t])},G=Date.prototype.toISOString,$=N.default,K={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:j.encode,encodeValuesOnly:!1,format:$,formatter:N.formatters[$],indices:!1,serializeDate:function(e){return G.call(e)},skipNulls:!1,strictNullHandling:!1},Y=function e(t,s,i,r,n,a,o,d,l,c,u,h,p,g){var m,f=t;if("function"==typeof o?f=o(s,f):f instanceof Date?f=c(f):"comma"===i&&H(f)&&(f=j.maybeMap(f,(function(e){return e instanceof Date?c(e):e}))),null===f){if(r)return a&&!p?a(s,K.encoder,g,"key",u):s;f=""}if("string"==typeof(m=f)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||j.isBuffer(f)){if(a){var y=p?s:a(s,K.encoder,g,"key",u);if("comma"===i&&p){for(var _=z.call(String(f),","),v="",A=0;A<_.length;++A)v+=(0===A?"":",")+h(a(_[A],K.encoder,g,"value",u));return[h(y)+"="+v]}return[h(y)+"="+h(a(f,K.encoder,g,"value",u))]}return[h(s)+"="+h(String(f))]}var w,b=[];if(void 0===f)return b;if("comma"===i&&H(f))w=[{value:f.length>0?f.join(",")||null:void 0}];else if(H(o))w=o;else{var E=Object.keys(f);w=d?E.sort(d):E}for(var S=0;S<w.length;++S){var T=w[S],L="object"==typeof T&&void 0!==T.value?T.value:f[T];if(!n||null!==L){var O=H(f)?"function"==typeof i?i(s,T):s:s+(l?"."+T:"["+T+"]");W(b,e(L,O,i,r,n,a,o,d,l,c,u,h,p,g))}}return b},J=Object.prototype.hasOwnProperty,Z=Array.isArray,X={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:j.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ee=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},te=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},se=function(e,t,s,i){if(e){var r=s.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,n=/(\[[^[\]]*])/g,a=s.depth>0&&/(\[[^[\]]*])/.exec(r),o=a?r.slice(0,a.index):r,d=[];if(o){if(!s.plainObjects&&J.call(Object.prototype,o)&&!s.allowPrototypes)return;d.push(o)}for(var l=0;s.depth>0&&null!==(a=n.exec(r))&&l<s.depth;){if(l+=1,!s.plainObjects&&J.call(Object.prototype,a[1].slice(1,-1))&&!s.allowPrototypes)return;d.push(a[1])}return a&&d.push("["+r.slice(a.index)+"]"),function(e,t,s,i){for(var r=i?t:te(t,s),n=e.length-1;n>=0;--n){var a,o=e[n];if("[]"===o&&s.parseArrays)a=[].concat(r);else{a=s.plainObjects?Object.create(null):{};var d="["===o.charAt(0)&&"]"===o.charAt(o.length-1)?o.slice(1,-1):o,l=parseInt(d,10);s.parseArrays||""!==d?!isNaN(l)&&o!==d&&String(l)===d&&l>=0&&s.parseArrays&&l<=s.arrayLimit?(a=[])[l]=r:"__proto__"!==d&&(a[d]=r):a={0:r}}r=a}return r}(d,t,s,i)}},ie=function(e,t){var s=function(e){if(!e)return X;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?X.charset:e.charset;return{allowDots:void 0===e.allowDots?X.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:X.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:X.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:X.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:X.comma,decoder:"function"==typeof e.decoder?e.decoder:X.decoder,delimiter:"string"==typeof e.delimiter||j.isRegExp(e.delimiter)?e.delimiter:X.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:X.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:X.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:X.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:X.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:X.strictNullHandling}}(t);if(""===e||null==e)return s.plainObjects?Object.create(null):{};for(var i="string"==typeof e?function(e,t){var s,i={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,n=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,n),o=-1,d=t.charset;if(t.charsetSentinel)for(s=0;s<a.length;++s)0===a[s].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[s]?d="utf-8":"utf8=%26%2310003%3B"===a[s]&&(d="iso-8859-1"),o=s,s=a.length);for(s=0;s<a.length;++s)if(s!==o){var l,c,u=a[s],h=u.indexOf("]="),p=-1===h?u.indexOf("="):h+1;-1===p?(l=t.decoder(u,X.decoder,d,"key"),c=t.strictNullHandling?null:""):(l=t.decoder(u.slice(0,p),X.decoder,d,"key"),c=j.maybeMap(te(u.slice(p+1),t),(function(e){return t.decoder(e,X.decoder,d,"value")}))),c&&t.interpretNumericEntities&&"iso-8859-1"===d&&(c=ee(c)),u.indexOf("[]=")>-1&&(c=Z(c)?[c]:c),J.call(i,l)?i[l]=j.combine(i[l],c):i[l]=c}return i}(e,s):e,r=s.plainObjects?Object.create(null):{},n=Object.keys(i),a=0;a<n.length;++a){var o=n[a],d=se(o,i[o],s,"string"==typeof e);r=j.merge(r,d,s)}return j.compact(r)},re=function(e,t){var s,i=e,r=function(e){if(!e)return K;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||K.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=N.default;if(void 0!==e.format){if(!q.call(N.formatters,e.format))throw new TypeError("Unknown format option provided.");s=e.format}var i=N.formatters[s],r=K.filter;return("function"==typeof e.filter||H(e.filter))&&(r=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:K.addQueryPrefix,allowDots:void 0===e.allowDots?K.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:K.charsetSentinel,delimiter:void 0===e.delimiter?K.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:K.encode,encoder:"function"==typeof e.encoder?e.encoder:K.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:K.encodeValuesOnly,filter:r,format:s,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:K.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:K.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:K.strictNullHandling}}(t);"function"==typeof r.filter?i=(0,r.filter)("",i):H(r.filter)&&(s=r.filter);var n,a=[];if("object"!=typeof i||null===i)return"";n=t&&t.arrayFormat in V?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var o=V[n];s||(s=Object.keys(i)),r.sort&&s.sort(r.sort);for(var d=0;d<s.length;++d){var l=s[d];r.skipNulls&&null===i[l]||W(a,Y(i[l],l,o,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset))}var c=a.join(r.delimiter),u=!0===r.addQueryPrefix?"?":"";return r.charsetSentinel&&("iso-8859-1"===r.charset?u+="utf8=%26%2310003%3B&":u+="utf8=%E2%9C%93&"),c.length>0?u+c:""};const ne=m("fpads:macros"),ae=/\[([\s\S]+?)\]/g;class Macros{constructor(e={},t=ae){this.vars=e,this.pattern=t}static run(e){try{return e()}catch(e){return void console.error(e)}}static merge(...e){return e.reduce((e,t)=>Object.assign(e,t),{})}static cast(e){return void 0===e?"":"function"==typeof e?encodeURIComponent(Macros.run(e)||""):"string"==typeof e?encodeURIComponent(e):""}static normalize(e){return e.trim()}static process_obj(e,t,s){return Object.keys(e).reduce((i,r)=>{const n=Macros.process_str(r,t,s,!0),a=e[r];return null===a?(i[n]=a,i):"object"==typeof a?(i[n]=Macros.process_obj(a,t,s),i):"string"==typeof a?(i[n]=Macros.process_str(a,t,s),i):(console.error(new Error(`${a} at ${r} not a handled Macro type`)),i)},{})}static process_str(e,t,s,i=!1){return e.replace(t.pattern,(e,t)=>{const r=Macros.normalize(t);if(!(r in s)||void 0===s[r])return e;const n=s[r],a=i?n:Macros.cast(n);return ne("Macro.replace(raw: %s, macro: %s, value: %s)",i,t,a),a})}fork(e={},t=this.pattern){const s=Macros.merge(this.vars,e);return new Macros(s,t)}compile(e,t={}){const s=Macros.merge(this.vars,t),[i,r]=e.split("?"),n=ie(r||"",{strictNullHandling:!0,decoder:e=>e}),a=re(Macros.process_obj(n,this,s),{encode:!1,strictNullHandling:!0});return Macros.process_str(i,this,s,!0)+"?"+a}}function oe(e,t={width:0,height:0}){let s,i;try{const e=document.createElement("a");e.href=s=window.location!=window.parent.location?document.referrer:document.location.href,i=e.hostname}catch(e){console.error(e)}const{width:r,height:n}=t,{video_source:a}=e||{},o=function(){const e=window;return"object"==typeof e.__flowplayerAdParameters?e.__flowplayerAdParameters:{}}();return Object.assign({random:Date.now(),page_url:s,domain:i,player_width:r,player_height:n,video_url:a,videourl:a},o)}async function de(e){if("function"!=typeof e)return e;try{return await e()}catch(e){return""}}Macros.patterns={BRACKETS:ae,CURLY:/\{([\s\S]+?)\}/g,UNDERSCORE:/__([\s\S]+?)__/g};const le=Object.prototype,ce=Object.getPrototypeOf;const ue=m("fpads:ads:state");var he;!function(e){e[e.IDLE=0]="IDLE",e[e.INITIALIZING=1]="INITIALIZING",e[e.FETCHING_AD=2]="FETCHING_AD",e[e.AD_AVAILABLE=4]="AD_AVAILABLE",e[e.BREAK_ACTIVE=8]="BREAK_ACTIVE",e[e.PLAYING=16]="PLAYING",e[e.FATAL_ERROR=32]="FATAL_ERROR"}(he||(he={}));class AdsState{constructor(e=0){this._state=e}static of(){return new AdsState}reset(){this._state=0}toggleState(e,t){return void 0===e&&ue(new Error("AdState cannot toggleState for `undefined`")),null==typeof t?this._state^=e:t?void(this._state|=e):this._state&=~e}hasAll(e){return this._state==(this._state|e)}hasAny(e){return!!(this._state&e)}get state(){return this._state}}function pe(e,t,s){const i=function(e,t){const s=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(s,"data",{get:()=>t}),s}(t,s);return e.dispatchEvent(i),e}!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const ge={ok:m("fpads:analytics:request-queue"),err:m("fpads:analytics:request-queue:err"),warn:m("fpads:analytics:request-queue:warn")};class RequestQueue{constructor(e=[],t=[],s={failures:0,ttl:0}){this.pending=e,this.open=t,this.stats=s}static of(){return new RequestQueue}static is_empty(e){return 0==e.pending.length}static is_high_water(e){return e.open.length==RequestQueue.MAX_OPEN_REQUESTS}static maybe_spawn_req(e){if(RequestQueue.is_empty(e))return ge.ok("maybe_spawn_req called Queue that is EMPTY"),e;if(RequestQueue.is_high_water(e))return ge.warn("maybe_spawn_req called on Queue that is HIGH_WATER"),e;try{const t=RequestQueue.lpop(e);t&&RequestQueue.request(e,t)}catch(e){ge.err(e)}}static increment_failures(e){return e.stats.failures++,e.stats.failures>RequestQueue.MAX_FAILURE_COUNT&&(e.stats.ttl=Date.now()+RequestQueue.REQUEST_TTL_MS),e}static handle_error(e,t){RequestQueue.rm(e,t),RequestQueue.increment_failures(e)}static request(e,[t,s,i]){if(ge.ok(`Request[${i.event_type}] request`,i,e.stats),Date.now()<e.stats.ttl)return ge.warn(`Request[${i.event_type}] skipping because too many errors too quickly`,e.stats);const r=new XMLHttpRequest;e.open.push(r),r.timeout=RequestQueue.REQUEST_TIMEOUT_MS,r.ontimeout=function(){RequestQueue.handle_error(e,r),ge.warn(`Request[${i.event_type}] timed out in ${r.timeout}ms`,e.stats)},r.onerror=function(t){RequestQueue.handle_error(e,r),t&&ge.err(t),ge.warn(`Request[${i.event_type}] encountered an Error`,r.responseText,e.stats)},r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&RequestQueue.rm(e,r),Math.floor(r.status/100)},r.onload=function(){RequestQueue.rm(e,r),e.stats.failures&&e.stats.failures--,ge.ok(`Request[${i.event_type}] :ok`,r.status)},r.open(s,t),r.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{r.send(JSON.stringify(i))}catch(e){ge.err(e)}}static rpush(e,...t){return t.forEach(t=>{if(RequestQueue.is_high_water(e))return ge.warn("Too many open requests, skipping",e.stats);e.pending.push(t),RequestQueue.maybe_spawn_req(e)}),e}static lpop(e){return e.pending.shift()}static rm(e,t){const s=e.open.lastIndexOf(t);return~s&&e.open.splice(s,1),e}}RequestQueue.MAX_OPEN_REQUESTS=3,RequestQueue.REQUEST_TIMEOUT_MS=4e3,RequestQueue.REQUEST_TTL_MS=5e3,RequestQueue.MAX_FAILURE_COUNT=3;const me={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},fe={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},ye={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},_e={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ve={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(e,t){const s=t.match(e);return s&&s.length>0&&s[1]||""}static getSecondMatch(e,t){const s=t.match(e);return s&&s.length>1&&s[2]||""}static matchAndReturnConst(e,t,s){if(e.test(t))return s}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,s=!1){const i=Utils.getVersionPrecision(e),r=Utils.getVersionPrecision(t);let n=Math.max(i,r),a=0;const o=Utils.map([e,t],e=>{const t=n-Utils.getVersionPrecision(e),s=e+new Array(t+1).join(".0");return Utils.map(s.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(s&&(a=n-Math.min(i,r)),n-=1;n>=a;){if(o[0][n]>o[1][n])return 1;if(o[0][n]===o[1][n]){if(n===a)return 0;n-=1}else if(o[0][n]<o[1][n])return-1}}static map(e,t){const s=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(i=0;i<e.length;i+=1)s.push(t(e[i]));return s}static find(e,t){let s,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(s=0,i=e.length;s<i;s+=1){const i=e[s];if(t(i,s))return i}}static assign(e,...t){const s=e;let i,r;if(Object.assign)return Object.assign(e,...t);for(i=0,r=t.length;i<r;i+=1){const e=t[i];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{s[t]=e[t]})}}return e}static getBrowserAlias(e){return me[e]}static getBrowserTypeByAlias(e){return fe[e]||""}}const Ae=/version\/(\d+(\.?_?\d+)+)/i,we=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},s=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},s=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},s=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},s=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},s=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},s=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},s=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},s=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},s=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},s=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},s=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},s=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},s=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},s=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},s=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return s&&(t.version=s),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},s=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},s=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},s=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},s=Utils.getFirstMatch(Ae,e)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},s=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},s=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},s=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},s=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},s=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},s=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},s=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},s=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},s=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test(e){const t=!e.test(/like android/i),s=e.test(/android/i);return t&&s},describe(e){const t={name:"Android Browser"},s=Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},s=Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},s=Utils.getFirstMatch(Ae,e);return s&&(t.version=s),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Utils.getFirstMatch(t,e),version:Utils.getSecondMatch(t,e)}}}];var be=[{test:[/Roku\/DVP/],describe(e){const t=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:_e.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:_e.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),s=Utils.getWindowsVersionName(t);return{name:_e.Windows,version:t,versionName:s}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:_e.iOS},s=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return s&&(t.version=s),t}},{test:[/macintosh/i],describe(e){const t=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),s=Utils.getMacOSVersionName(t),i={name:_e.MacOS,version:t};return s&&(i.versionName=s),i}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:_e.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),s=e.test(/android/i);return t&&s},describe(e){const t=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),s=Utils.getAndroidVersionName(t),i={name:_e.Android,version:t};return s&&(i.versionName=s),i}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),s={name:_e.WebOS};return t&&t.length&&(s.version=t),s}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Utils.getFirstMatch(/\bbb(\d+)/i,e);return{name:_e.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:_e.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:_e.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:_e.Linux})},{test:[/CrOS/],describe:()=>({name:_e.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:_e.PlayStation4,version:t}}}],Ee=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=Utils.getFirstMatch(/(can-l01)/i,e)&&"Nova",s={type:ye.mobile,vendor:"Huawei"};return t&&(s.model=t),s}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:ye.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:ye.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:ye.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:ye.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:ye.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:ye.tablet})},{test(e){const t=e.test(/ipod|iphone/i),s=e.test(/like (ipod|iphone)/i);return t&&!s},describe(e){const t=Utils.getFirstMatch(/(ipod|iphone)/i,e);return{type:ye.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:ye.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:ye.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:ye.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:ye.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:ye.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:ye.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:ye.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:ye.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:ye.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:ye.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:ye.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:ye.tv})}],Se=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ve.Blink};const t=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ve.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ve.Trident},s=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ve.Presto},s=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test(e){const t=e.test(/gecko/i),s=e.test(/like gecko/i);return t&&!s},describe(e){const t={name:ve.Gecko},s=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ve.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ve.WebKit},s=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return s&&(t.version=s),t}}];class Parser{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Utils.find(we,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Utils.find(be,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Utils.find(Ee,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Utils.find(Se,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(e){const t={};let s=0;const i={};let r=0;if(Object.keys(e).forEach(n=>{const a=e[n];"string"==typeof a?(i[n]=a,r+=1):"object"==typeof a&&(t[n]=a,s+=1)}),s>0){const e=Object.keys(t),s=Utils.find(e,e=>this.isOS(e));if(s){const e=this.satisfies(t[s]);if(void 0!==e)return e}const i=Utils.find(e,e=>this.isPlatform(e));if(i){const e=this.satisfies(t[i]);if(void 0!==e)return e}}if(r>0){const e=Object.keys(i),t=Utils.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(i[t])}}isBrowser(e,t=!1){const s=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const r=Utils.getBrowserTypeByAlias(i);return t&&r&&(i=r.toLowerCase()),i===s}compareVersion(e){let t=[0],s=e,i=!1;const r=this.getBrowserVersion();if("string"==typeof r)return">"===e[0]||"<"===e[0]?(s=e.substr(1),"="===e[1]?(i=!0,s=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?s=e.substr(1):"~"===e[0]&&(i=!0,s=e.substr(1)),t.indexOf(Utils.compareVersions(r,s,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
|
|
17
|
+
/*!
|
|
18
|
+
* Bowser - a browser detector
|
|
19
|
+
* https://github.com/lancedikson/bowser
|
|
20
|
+
* MIT License | (c) Dustin Diaz 2012-2015
|
|
21
|
+
* MIT License | (c) Denis Demchenko 2015-2019
|
|
22
|
+
*/const Te=class Bowser{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Parser(e,t)}static parse(e){return new Parser(e).getResult()}static get BROWSER_MAP(){return fe}static get ENGINE_MAP(){return ve}static get OS_MAP(){return _e}static get PLATFORMS_MAP(){return ye}}.parse(window.navigator.userAgent),{platform:Le,os:Oe,browser:Me}=Te,Re=e=>e&&e.toLowerCase();var ke={rnd:Math.random().toString(36).substr(2,32),os:Re(Oe.name+(Oe.versionName?" "+Oe.versionName:"")),device:Re(Le.type),browser:Re(Me.name),browser_version:(Me&&Me.version?Me.version:"unknown").split(".").shift(),plugin_version:"3.1.0-rc.2"};const Pe="https://fp-eu-w1-aai.flowplayer.com/in",Ce="POST",Ue=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],Ie=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],Ne=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],De=m("ads/analytics"),Fe=RequestQueue.of(),xe=(...e)=>Object.assign({},...e);class Analytics{constructor(e,t={}){this.emitter=e,this.metadata=xe(ke,t.metadata||{}),this.emitter=e,this.events=t.events||[],this.required_keys=t.required_keys||[],this.optional_keys=t.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),De(this),this.wireup()}static of(e,t){return new Analytics(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(e,t){return((e,...t)=>Object.keys(e).filter(e=>~t.indexOf(e)).reduce((t,s)=>Object.assign(t,{[s]:e[s]}),{}))(t,...e.valid_keys)}static mergeMetadata(e,t={}){return e.metadata=Analytics.pluck_valid_keys(e,xe(e.metadata,t,{player_version:"3.1.0-rc.2"})),e}wireup(){this.events.forEach(e=>{this.emitter.on(e,t=>{const s=t.detail,i=xe(this.metadata,{event_type:e},s),r=Analytics.pluck_valid_keys(this,i),n=Analytics.ensure_required_keys(this,r);if(De(`Event[${e}]`,{payload:r,observation:s}),n.length)return De(`Analytics.validate_metadata() failed for\n Event[${e}]\n missing keys: ${n}`,r);RequestQueue.rpush(Fe,[Pe,Ce,r])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}const Be=m("ads/controller"),je={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends class EventBus{constructor(e=document.createElement("div"),t=[]){this._bus=e,this._listeners=t}removeAllListeners(){this._listeners.length=0,this._bus=document.createElement("div")}emit(e,t){const s=new CustomEvent(e,{detail:t||{}});this._bus.dispatchEvent(s)}on(e,t){this._listeners.push([e,t]),this._bus.addEventListener(e,t,{passive:!0})}once(e,t){this._bus.addEventListener(e,t,{once:!0})}removeListener(e,t){this._bus.removeEventListener(e,t)}}{constructor(e={}){var t;super(),this.adapter=function(e,t){return e.adapter?new e.adapter(t):new IMA(t)}(e,this),this.opts=Object.assign(Object.assign({},je),e),this.analytics=(t=this,Analytics.of(t,{required_keys:Ie,optional_keys:Ne,events:Ue})),this._state=AdsState.of(),this._schedule=void 0,this._lastAd=void 0,this._macros=new Macros(e.parameters||{}),this.wireup()}reset(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}destroy(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy();this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}stop(){this.adapter&&this.adapter.stop()}wireup(){const e=()=>{var e;const t=new CustomEvent("ad/playing");null===(e=this.videoTag)||void 0===e||e.dispatchEvent(t),this._state.toggleState(he.PLAYING,!0)};this.on("ad-play-requested",e),this.on("ad-started",e),this.on("ad-resumed",e);const t=()=>{var e;const t=new CustomEvent("ad/paused");null===(e=this.videoTag)||void 0===e||e.dispatchEvent(t),this._state.toggleState(he.PLAYING,!1)};this.on("ad-break-completed",t),this.on("ad-teardown",t),this.on("ad-playback-error",t),this.on("ad-request-error",t),this.on("ad-paused",t),this.on("ad-skipped",t),this.on("ad-completed",t),this.on("ad-break-completed",()=>{var e;const t=new CustomEvent("ad/complete");null===(e=this.videoTag)||void 0===e||e.dispatchEvent(t),this._state.toggleState(he.BREAK_ACTIVE,!1)}),this.on("ad-adapter-init-failed",()=>{console.error("Adapter init failed"),t(),this._state.toggleState(he.FATAL_ERROR,!0)}),this.on("reload-ad-requested",async e=>{if(Be("Ads.on(RELOAD_AD_REQUESTED)",e),this._schedule){if(t(),e)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(he.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(he.AD_AVAILABLE,!1))}})}async initialize(e,t={},s){return Be("Ads.initialize():",e,t,s),this._state.toggleState(he.INITIALIZING,!0),Object.assign(this.opts,t),Array.isArray(e)&&this.setSchedule(e),await this.adapter.init(this.opts),this._macros=this._macros.fork(Object.assign({},t.parameters||{},{autoplay:t.autoplay,muted:t.muted})),this.adapter.isReady()&&await this.adapterInitialized(s),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(e){Be("Ads.setVideoTag():",e),await this.adapter.setVideoTag(e),this.trigger("ad-videotag-attached",e),this.adapter.isReady()&&await this.adapterInitialized(),e.on("request/ad/pause",()=>this.adapter.pause()),e.on("request/ad/play",()=>this.adapter.resume()),e.on("request/ad/muteunmute",()=>{var t;e.muted=(null!==(t=this.adapter.volume())&&void 0!==t?t:0)>0,this.adapter.volume(e.muted?0:0==e.volume?.1:e.volume)})}waitForVideoTag(){return new Promise(e=>{const t=this.adapter.getVideoTag();if(t)return e(t);this.on("ad-videotag-attached",t=>{this.once("ad-initialized",()=>e(t))})})}async adapterInitialized(e){Be("Ads.adapterInitialized()"),this._state.toggleState(he.INITIALIZING,!1),this._state.toggleState(he.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,e),this.checkIfBreakComplete(),e&&!this.opts.autoplay||this.trigger("ad-teardown")}async fetchNextAd(e,t=0){var s,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(t>50)throw this._state.toggleState(he.FATAL_ERROR,!0),this._state.toggleState(he.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const r=(null===(s=this._schedule)||void 0===s?void 0:s.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!r||this.adapter.canDismissNonLinear()||-1===e)if(this._schedule.waitForLoad(e,r,this.opts.preload_ads))this._state.toggleState(he.FETCHING_AD,!1);else if(r===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),r){Be("Ads.fetchNextAd",r),this._state.toggleState(he.FETCHING_AD,!0);try{return await this.requestAd(r),this._state.toggleState(he.AD_AVAILABLE,!0),void this._state.toggleState(he.FETCHING_AD,!1)}catch(s){if(Be("Ads.fetchNextAd(err: %o, ad: %o)",s,r),this.setLastAd(r),r!==this._schedule.getPostroll())return await this.fetchNextAd(e,++t)}}else this._state.toggleState(he.FETCHING_AD,!1)}skipAdsOnSeek(e){if(!this._schedule)return;let t=this._schedule.getNextAd();for(;t&&t.time<e;)this._schedule.increment(),t=this._schedule.getNextAd()}async setCurrentTime(e,t=!1,s=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(he.FETCHING_AD))return;if(this._state.hasAny(he.PLAYING)&&this.adapter.isLinearAd())return;const i=0===e&&0===this._schedule.getNextIndex();try{if(s&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(e),this._state.hasAny(he.AD_AVAILABLE)||await this.fetchNextAd(e),!this._state.hasAny(he.AD_AVAILABLE)||!this.shallPlayAd(e)||t)return;await this.playAd(),await this.setCurrentTime(e),this.checkIfBreakComplete()}catch(e){Be("setCurrentTime: Error(from: setCurrentTime, message: %s)",e.message)}finally{i&&this.trigger("ad-preroll-finished")}}async playAd(){var e;if(this._state.hasAny(he.AD_AVAILABLE)){this._state.toggleState(he.AD_AVAILABLE,!1),this._state.toggleState(he.BREAK_ACTIVE,!0);try{const t=null===(e=this._schedule)||void 0===e?void 0:e.getCurrentAd();await this.adapter.playAd(),t&&this.setLastAd(t)}catch(e){console.error("Ads.playAd: error",e)}}}checkIfBreakComplete(){if(!this._state.hasAny(he.BREAK_ACTIVE))return Be("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());Be("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(he.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger("ad-break-completed")}resetScheduleCounter(){this._schedule&&this._schedule.resetCounter()}setSchedule(e,t){if(t&&!isNaN(t)&&this._schedule&&this._schedule.updateContentDuration(t),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(e);this._schedule=new Schedule(e,{preload_advance:this.opts.preload_advance,content_duration:t?0:t})}toJSON(){return this._schedule?this._schedule.toJSON():[]}trigger(e,t={}){var s;if(!this.adapter.getVideoTag())return;if(!this._state)return;if("ad-break-completed"===e&&this._state.hasAny(he.BREAK_ACTIVE)&&!this.adapter.isAdPod())return Be("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=t)||"object"!=typeof i||ce(i)!==le)return this.dispatch(e,t);var i;const r=Object.assign({},this.adapter.getOpts()||{},(null===(s=this._schedule)||void 0===s?void 0:s.getCurrentAd())||{},{ad_type:this.ad_type},t);return t.ima_event&&"preroll"===t.ad_type&&(r.ad_type=this.ad_type),this.dispatch(e,r)}dispatch(e,t){const s=this.adapter.getVideoTag();if(s){Be(":dispatch",e,t);try{const i={event:"ads/"+e,detail:{outstream:t.outstream,ad_type:t.ad_type,ad_break_time:t.time,ad_remaining_seconds:t.remaining,ad_muted:t.muted,ad_duration_seconds:t.duration,ad_error_reason:t.reason,ad_vast_error:t.vast_error,ad_vast_error_type:t.vast_error_type,ad_request_load_type:t.request_load_time}};s.dispatchEvent(new CustomEvent("health:record",{detail:i}))}catch(e){Be(":error",e)}pe(s,e,t),this.emit(e,t)}}get ad_type(){return this._schedule&&this._schedule.getCurrentType()}shouldRestartContent(){if(this.adapter.isAdPod())return!0;const e=this.getLastAd();return!!e&&(!e.outstream&&!1!==e.restart)}async finished(e){if(this._schedule&&(Be("Ads.finished"),!(this.adapter.isSharedVideoTag()&&this._state.hasAny(he.PLAYING)&&this.adapter.isLinearAd()))){Be("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return Be("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(he.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(e){Be("Ads.finished: postroll failed:",e)}finally{this.trigger("ad-postroll-finished"),this.checkIfBreakComplete(),"function"==typeof e&&e()}}}hasPreroll(){return this._schedule&&Schedule.hasPreroll(this._schedule.getAds())}shallPlayAd(e){var t;return(!this.adapter||!this.adapter.isAdPod())&&(!(!this._state||this._state.hasAny(he.FATAL_ERROR))&&!!(null===(t=this._schedule)||void 0===t?void 0:t.shallPlayAd(e)))}setLastAd(e){return this._lastAd=e,this}getLastAd(){return this._lastAd}mergeMacros(e={}){return this._macros=this._macros.fork(Object.assign({},e)),this}get paused(){return this.adapter&&this.adapter.isPaused()}pause(){this.adapter&&this.adapter.pause()}resume(){this.adapter&&this.adapter.resume()}resize(e){this.adapter&&this.adapter.onResize(e)}async requestAd(e,t=0,s=this.opts.timeout){if(!this._state)return;Be("Ads.requestAd(ad: %o)",{ad:e,timeout:s,idx:t});const i=await async function e(t){if("function"==typeof t)return[await de(t)];if("string"==typeof t)return[await de(t)];if(Array.isArray(t)){const e=t;return await Promise.all(e.map(de))}if("object"==typeof t&&t&&t.adTag)return await e(t.adTag);throw new Error(`\n unhandled ads type ${typeof t}:\n ${JSON.stringify(t)}\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n `)}(e);if(void 0===i[t])return Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[t])return await this.requestAd(i,t+1,s);this.trigger("ad-requested",e);const r=this._macros.compile(i[t],oe(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(r,s)}catch(e){return Be(`Ads.requestAd(:fallback, idx: ${t}, length: ${i.length}, adTag: ${i[t]})\nError `,{adTag:i,err:e}),this.requestAd(i,t+1,s)}}resetSchedule(e){this._schedule&&this._schedule.reset(e)}get adPlaying(){return this._state&&this._state.hasAny(he.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(he.BREAK_ACTIVE)}}var qe=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),Ve=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function He(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function ze(e,t){var s=e.muted,i=e.timeout,r=e.inline,n=t(),a=n.element,o=n.source,d=void 0,l=void 0,c=void 0;return a.muted=s,!0===s&&a.setAttribute("muted","muted"),!0===r&&a.setAttribute("playsinline","playsinline"),a.src=o,new Promise((function(e){d=a.play(),l=setTimeout((function(){c(!1,new Error("Timeout "+i+" ms has been reached"))}),i),c=function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(l),e({result:t,error:s})},void 0!==d?d.then((function(){return c(!0)})).catch((function(e){return c(!1,e)})):c(!0)}))}var Qe={audio:function(e){return ze(e=He(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(qe)}}))},video:function(e){return ze(e=He(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(Ve)}}))}};let We=void 0;async function Ge(e=!0){return We||(We=await Qe.video({timeout:500,muted:e}),We)}const $e=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"}),Ke=["progress","duration"];class AdUI extends HTMLElement{constructor(e,t=document.createElement("div")){super(),this.player=e,this.adContainer=t,this.render(),e.addEventListener("ad/playing",e=>this.updateState(e.type)),e.addEventListener("ad/paused",e=>this.updateState(e.type)),e.addEventListener("ad/complete",e=>this.updateState(e.type))}static get observedAttributes(){return Ke}updateState(e){this.classList.toggle("ad-paused","ad/paused"==e),this.classList.toggle("ad-playing","ad/playing"==e)}hideFirstFrame(e){e.classList.toggle("ad-hide-first-frame",!0)}showFirstFrame(e){e.classList.toggle("ad-hide-first-frame",!1)}resize(e){const t=this.style;e.linear?e.width&&(t.width=e.width+"px"):e.width?this.adContainer.style.width=e.width+"px":t.removeProperty("width"),e.height?t.height=e.height+"px":t.removeProperty("height")}attributeChangedCallback(e,t,s){switch(e){case"duration":return this.onDurationChange(parseFloat(s));case"progress":return this.onProgress(parseFloat(t),parseFloat(s))}}onDurationChange(e){}onProgress(e,t){}render(){this.adContainer.classList.add("fp-ad-container"),this.append(this.adContainer);const e=f(this.player,"flowplayer-ad-controls"),t=f(this.player,"flowplayer-ad-countdown");this.append(e,t)}}const Ye=m("fpads:native:outstream"),Je={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var Ze,Xe;!function(e){e.OUTSTREAM_VISIBLE="ads-outstream-visible",e.OUTSTREAM_VIEWPORT_UPDATE="ads-outstream-viewport-update",e.OUTSTREAM_TEARDOWN="ads-outstream-teardown",e.OUTSTREAM_ENDSCREEN_READY="ads-outstream-endscreen-ready"}(Ze||(Ze={})),function(e){e[e.None=0]="None",e[e.Booting=1]="Booting",e[e.Ready=2]="Ready",e[e.Disposed=3]="Disposed"}(Xe||(Xe={}));class Outstream{constructor({ads:e,root:t,content:s,ima:i}){this.state=Xe.None,Ye("creating Outstream instance"),this.content=s,this.ads=e,this.root=t,this.ima=i,this.aspectRatio=s.videoHeight/s.videoWidth,this.dimensions=function(e){if(e.clientWidth>0||e.clientHeight)return u(e);const t={height:e.style.height};h(e,"opacity",0),h(e,"display","absolute"),h(e,"display","inline-block"),h(e,"height","auto");const s=u(e);return h(e,"height",t.height),h(e,"opacity",1),s}(this.root),this.adUi=new AdUI(s),this.adContainer=this.adUi.adContainer,this.initialVolumeState={},t.classList.add(Je.OUTSTREAM),t.append(this.adUi),this.hide(),this.ads.on("ad-pause-content",e=>{var t;if(this.state==Xe.Disposed)return;const s=!!(null===(t=e.detail)||void 0===t?void 0:t.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:s}))}),s.on("resize",e=>{if(this.state==Xe.Disposed)return;const t=e.detail;t&&(this.dimensions={width:t.contentRect.width,height:t.contentRect.height},this.ads.resize(this.dimensions))}),s.on("intersectionchange",e=>{if(this.state==Xe.Disposed)return;const t=e.detail;if(t)switch(this.state){case Xe.Booting:return Ye(":boot skipping intersectionchange");case Xe.None:return this.state=Xe.Booting,this.begin_life_cycle();case Xe.Ready:if(t.ratio>=.5&&this.ads.adPlaying)return;t.ratio>=.5&&this.ads.resume(),t.ratio<.5&&this.ads.pause()}}),this.setup()}hide(){return this}restore_aspect_ratio(){return Ye(`Outstream.restore_aspect_ratio(${this.aspectRatio})`),this.content.setOpts({ratio:this.aspectRatio}),this}show(){this.root.classList.remove(Outstream.CLASS.HIDDEN),this.root.classList.add(Outstream.CLASS.SHOWING),this.adUi.classList.add("linear","on")}async begin_life_cycle(){this.state=Xe.Ready;const{error:e,result:t}=await Ge(!1),{result:s}=await Ge(!0);this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!t&&!s),muted:!t},Ye("Outstream.show() :autoplay >> sound="+t),e&&this.content&&!t&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await w({ads:this.ads,content:this.content,adContainer:this.adContainer,ima:this.ima,state:{listening:!1},config:this.content.opts}),T({content:this.content,ads:this.ads}),this.state=Xe.Ready}attach_ad_listeners(){const e=this.ads;e.once("ad-pause-content",()=>{this.show(),this.ads.adPlaying&&this.ads.pause()}),this.ima.always_show_controls||e.on("vpaid-init",()=>this.adUi.classList.add("is-vpaid"));const t=()=>{v.forEach(e=>this.ads.removeListener(e,t));const e=new CustomEvent(Ze.OUTSTREAM_TEARDOWN);Ye("Outstream(:teardown)",e),this.content.dispatchEvent(e)};v.forEach(e=>this.ads.once(e,t)),this.content.once(Ze.OUTSTREAM_TEARDOWN,e=>{setTimeout(()=>{if(e.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),E({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adContainer,ima:this.ima,content:this.content,root:this.content.root,state:{started:!0,listening:!1},initial:{muted:!0,volume:1}})}empty_src(){this.content.setSrc({type:"video/mp4",src:URL.createObjectURL($e)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.empty_src()}reset_ui(){const e=this.root;e.classList.remove(Outstream.CLASS.SHOWING),e.classList.remove(Outstream.CLASS.OUTSTREAM),this.adUi.classList.remove("on")}dispose(){if(this.state==Xe.Disposed)return;const e=this.root,t=this.content;this.reset_ui(),e.classList.add(Outstream.CLASS.OUTSTREAM),e.classList.add(Outstream.CLASS.DONE);this.video=this.container=this.ads=0,this.state=Xe.Disposed,t.destroy(),e.innerHTML=""}}function et(e){return e&&"number"==typeof e.time}function tt(e){return e&&"number"==typeof e.percent&&"number"!=typeof e.time}function st(e,t,s){if(!("google"in window))return console.warn("google.ima unavailable");const i=e.autoplay;s.autoplay=!1,e.autoplay=0;const r=s.ads=new AdsController,n=r.analytics;let a=!1;r.resize(u(t)),p&&(s.on(["fullscreenenter","fullscreenexit","webkitendfullscreen"],e=>{var t;const i="fullscreenenter"===e.type;null===(t=null==s?void 0:s.ads)||void 0===t||t.adapter.setIOSPlaysInline(!i)}),r.on("ad-postroll-finished",()=>{r.adapter.isSharedVideoTag()&&r.once("ad-break-completed",()=>{s.src=s.original_src,s.once("canplay",()=>{s.pause()}),s.webkitExitFullscreen()})})),s.on("reap",(function(){r&&r.destroy()})),s.on("src",()=>{r&&r.stop()}),s.on("config",(function({detail:o}){const d=o.ima;if(!d)return;if(!Array.isArray(d.ads))return void(void 0!==i?e.autoplay=i:delete e.autoplay);const l=o.duration||s.duration;if(d.ads=function(e,t){return Array.isArray(e)?e.filter(e=>et(e)||tt(e)).reduce((e,s)=>{if(et(s))return e.push(s),e;if(s.lazy)return e.push(s),e;if(tt(s)){const i=Object.assign({},s);return i.time=Math.floor(s.percentage*t),e.push(i),e}return e},[]):(console.warn("AdSchedule was not an Array"),[])}(d.ads,l),r.setSchedule(d.ads,l),o.metadata&&Analytics.mergeMetadata(n,o.metadata),o.metadata&&r.mergeMacros(o.metadata),o.metadata&&d.parameters&&(d.parameters=Object.assign(Object.assign({},d.parameters),o.metadata)),Analytics.mergeMetadata(n,{muted:o.muted||!1,autoplay:o.autoplay||!1}),!a){if(a=!0,e.lang&&!d.Locale&&(d.Locale=e.lang),Schedule.isOutstream(d.ads))return new Outstream({root:t,content:s,ads:r,ima:d});A({config:Object.assign(Object.assign({},e),{autoplay:i}),root:t,content:s,ads:r,ima:d})}}))}Outstream.CLASS=Je;class AdControls extends HTMLElement{constructor(e){super(),this.player=e,this.render(),e.on("ad-started",e=>{if(!this.indicatorControl)return;const{position:t,totals:s}=e.detail.ad;this.indicatorControl.textContent=`ADS ${t} / ${s}`})}render(){this.classList.add("fp-ad-controls"),this.indicatorControl=document.createElement("div"),this.indicatorControl.classList.add("ad-indicator","fp-color-text"),this.indicatorControl.textContent="ADS";const e=document.createElement("div");e.classList.add("ad-playback-controls");const t=f(this.player,"flowplayer-small-play-icon");t.addEventListener("click",()=>this.player.emit("request/ad/play"));const s=f(this.player,"flowplayer-small-pause-icon");s.addEventListener("click",()=>this.player.emit("request/ad/pause")),e.append(t,s);const i=f(this.player,"flowplayer-volume-icon");i.addEventListener("click",()=>this.player.emit("request/ad/muteunmute"));const r=f(this.player,"flowplayer-header-right-zone");this.append(this.indicatorControl,e,i,r)}}class AdCountdown extends HTMLElement{constructor(e){super(),this.player=e,e.on("ad-progress",e=>{const{duration:t,remaining:s}=e.detail;this.setAttribute("duration",t+""),this.setAttribute("remaining",s+"")}),this.addEventListener("animationend",()=>{const e=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",e)})}static get observedAttributes(){return["remaining"]}attributeChangedCallback(e,t){switch(e){case"remaining":return this.onRemaining(t)}}onRemaining(e){const t=parseFloat(this.getAttribute("duration")||"0");e||(e=t+"");const s=parseFloat(e),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const r=((t-s)/t*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",r),this.classList.add("go")})}}const{samsung_tv:it}=function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",s=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),i=/Android/.test(t)&&!/Firefox/.test(t),r=/^((?!chrome|android).)*safari/i.test(t),n=/SamsungBrowser/.test(t),a=n&&/SMART-TV/.test(t);return{controls:!s,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:i,iphone:s,safari:r,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:n,samsung_tv:n&&a,touch:!!("ontouchstart"in window)}}();class Ads{constructor(e){this.umd=e,y(e,"flowplayer-ad-ui",AdUI),y(e,"flowplayer-ad-controls",AdControls),y(e,"flowplayer-ad-countdown",AdCountdown)}init(e,t,s){if(c.from_token(e.token||"").is_granted(c.permissions.ADS)&&!it)return st(e,t,s)}}return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const s=e.flowplayer;"function"==typeof s?s(t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t))}(window,Ads),Ads}));
|