@castlabs/prestoplay 6.32.0-beta.2 → 6.32.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +18 -18
  5. package/cjs/cl.cast.js +126 -126
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +604 -604
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +1 -29
  11. package/cjs/cl.freewheel.js +26 -26
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +352 -352
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +25 -25
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +2 -2
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +14 -14
  37. package/cl.cast.js +100 -100
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +488 -487
  40. package/cl.crypto.js +8 -8
  41. package/cl.dash.js +75 -75
  42. package/cl.externs.js +1 -25
  43. package/cl.freewheel.js +20 -20
  44. package/cl.hls.js +65 -65
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +19 -19
  48. package/cl.mediatailor.js +2 -2
  49. package/cl.mse.js +200 -200
  50. package/cl.muxdata.js +12 -12
  51. package/cl.onboard.js +3 -3
  52. package/cl.persistent.js +8 -8
  53. package/cl.playlist.js +4 -4
  54. package/cl.simid.js +2 -2
  55. package/cl.smooth.js +47 -47
  56. package/cl.thumbnails.js +12 -12
  57. package/cl.tizen.js +41 -41
  58. package/cl.ttml.js +10 -10
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +3 -3
  62. package/cl.vtt.js +11 -11
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +27 -27
  65. package/package.json +1 -1
  66. package/typings.d.ts +6 -22
  67. package/cjs/cl.cdn.js +0 -13
  68. package/cl.cdn.js +0 -7
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var pT="CLPP Subtitle Styles",qT="Unsupported unit",rT="clpp-text-plain",sT="clpp-text-ttml",tT="clpp.htmlcue.HtmlTextDisplayer",uT="initial",vT=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},wT=function(a){return _.Ri(a,{mi:function(b,c){return b.ua(c)}})},xT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},yT=function(){},zT=function(a){if(!a.input)return null;
3
- var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},BT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return AT[c]});return a},DT=function(a,b){CT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){CT(a,c)})},CT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},ET=function(a,b){return 0===a?"0":a+b},FT=function(a,b){return 1>Math.abs(a-b)||a<b},GT=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},HT=function(a,b){return a>b&&1<Math.abs(a-b)},IT=function(a,b){return 1>Math.abs(a-b)||a>b},JT=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},KT=function(a){return new JT(a.left,a.f,a.top,a.a,a.height,a.width)},LT=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
- 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new JT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},MT=function(a,b){return b.some(function(c){return GT(a.left,c.f)&&HT(a.f,c.left)&&GT(a.top,c.a)&&HT(a.a,c.top)})},NT=function(a,b){return IT(a.top,b.top)&&FT(a.a,b.a)&&IT(a.left,b.left)&&FT(a.f,b.f)},OT=function(a,b,c){switch(c){case "+x":return GT(a.left,b.left);case "-x":return HT(a.f,b.f);
6
- case "+y":return GT(a.top,b.top);case "-y":return HT(a.a,b.a);default:throw Error("Unknown axis");}},PT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},QT=function(a,b,c){PT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},ST=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return RT(a)?b:c},VT=function(a,b,c){return RT(a)&&_.N.ya(c)?ET(c,_.Pf):(TT(a)||
7
- UT(a))&&_.N.ya(b)?ET(b,"%"):uT},TT=function(a){return a.f.writingMode===_.Rg},UT=function(a){return a.f.writingMode===_.Sg},RT=function(a){return a.f.writingMode===_.Fp},WT=function(a,b,c){return(TT(a)||UT(a))&&_.N.ya(c)?ET(c,_.Pf):TT(a)&&_.N.R(c)?ET(0,_.Pf):RT(a)&&_.N.ya(b)?ET(b,"%"):uT},XT=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.He:return a.f.position;case "auto":case _.nd:return a.f.position-a.f.size/2;case _.Ie:return a.f.position-a.f.size}return 0},
8
- YT=function(a){switch(a.f.positionAlign){case _.He:return _.Ee;case "auto":case _.nd:return _.Ep;case _.Ie:return _.Wf}return a.f.textAlign},ZT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.jg:case _.Ee:return _.He;case _.Ep:return _.nd;case _.oe:case _.Wf:return _.Ie}return a.f.positionAlign},$T=function(a){switch(a.f.writingMode){case _.Fp:return"horizontal-tb";case _.Rg:return _.Rg;case _.Sg:return _.Sg;default:throw Error("Unknown writing mode");}},aU=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=LT(a.a);this.h=[]},bU=function(a,b){if(a.j)switch(b.writingMode){case _.Fp:return["-y"];case _.Rg:return["+x"];case _.Sg:return["-x"]}var c=[];switch(b.writingMode){case _.Fp:c=["+y","-y"];break;case _.Rg:c=["+x","-x"];break;case _.Sg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},cU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=LT(a.l.a)},dU=function(a,b,c){PT.call(this,a,b,c);this.h=null;this.l=[]},eU=function(a,b){dU.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},fU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Kp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(qT);},hU=function(a){this.g=new _.M("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=gU(this,this.h);this.f=gU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},iU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
- a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},jU=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
- c)},gU=function(a,b,c){var d=document.createElement(_.pg),e=d.dataset;e.name=pT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);kU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},kU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===pT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
- c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},nU=function(a){_.Ev.call(this,a);var b=this;this.g=new _.M(tT);this.m=a;this.L=lU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new hU(a.getSurface().getUniqueCssClass());this.a=new dU(null,"clpp-text-container",{});this.w=new _.xv(a.getSurface(),this.pl.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
- this.G=new _.lj(function(){mU(b)});this.A=new Map;this.l=null},lU=function(a){a=_.N.xb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},oU=function(a,b){return a.startTime<=b&&a.endTime>b},mU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=pU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,qU(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Jv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.$g:k="clpp-text-vtt";break;case _.Eg:k=sT;break;case _.Dp:k=rT}k&&!g.classList.contains(k)&&_.dj(g,k);g=LT(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
- else{CT({fontSize:rU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.$g;var l=e.payloadType===_.Eg;e.region&&(k||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new eU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new QT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},pU=function(a,b){var c=vT(a.f,function(e){return oU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&oU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- oU(a.f[c+1],b);)c++;return{start:d,end:c}},sU=function(a){qU(a);a.J=null;a.l=null;a.f=[]},qU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(sT);b.classList.remove(rT);a=a.a;cU(a.h);a.l=[]}},rU=function(a,b){var c=LT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Pf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Pf;d=a.getFontSizePercent();return Math.round(c*d)+_.Pf},tU=function(){},
18
- uU=function(){};
19
- yT.prototype.parse=function(a){a={input:a};for(var b=_.fj(_.Xd),c=[],d=b,e;null!==(e=zT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=vU[f];k?(k=_.fj(k),(f=wU[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||xU[g.localName]&&xU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
- d=g)}}else d.appendChild(document.createTextNode(BT(e)));return b};var vU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},wU={v:"voice",lang:"lang"},xU={rt:"ruby"},AT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};PT.prototype.init=function(){this.j=!0};PT.prototype.A=function(){return!1};_.w(QT,PT);QT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- QT.prototype.init=function(a){PT.prototype.init.call(this,a);if(this.h)_.dj(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Eg){var c=_.fj(_.Xd);c.innerHTML=b.payload;b=c}else b.payloadType===_.$g?b=(new yT).parse(b.payload):(c=_.fj(_.Xd),c.textContent=b.payload,b=c);_.dj(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.dj(b,d.value);CT({writingMode:$T(this)},b);this.a.appendChild(b);_.dj(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.dj(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Gp,this.f.line=RT(this)?-1:0);c=$T(this);CT({writingMode:c,webkitWritingMode:c,direction:uT,textAlign:YT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=XT(this,ZT(this));d=WT(this,c,null);var e=VT(this,
23
- c,null),f=UT(this)&&_.N.R(null)?ET(0,_.Pf):uT;CT({position:"absolute",left:d,right:f,top:e,width:RT(this)?ET(this.f.size,"%"):uT,height:TT(this)||UT(this)?ET(this.f.size,"%"):uT},this.a);d=this.f;a=RT(this)?a.height:a.width;e=ST(this);if(d.lineInterpretation===_.Gp)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.nd:g-=f/2;break;case _.oe:g-=f}f=Math.round(g/100*a)}UT(this)&&(f=a-f-e);a=f;d=WT(this,c,a);e=UT(this)&&_.N.R(a)?
24
- ET(0,_.Pf):uT;CT({left:d,right:e,top:VT(this,c,a)},this.a)}DT(this.D,b)}};QT.prototype.o=function(){return _.fj(_.Xd)};aU.prototype.append=function(a){var b=a.a;b.style.visibility=_.we;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=LT(a.a);var d=bU(this,a.f),e=ST(a),f=KT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;OT(c,this.a,l)||NT(c,this.a)&&MT(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||NT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
- l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=KT(c),k=l);c=KT(f)}c=g||f}CT({top:ET(c.top-this.a.top,_.Pf),bottom:ET(this.a.a-c.a,_.Pf),left:ET(c.left-this.a.left,_.Pf),right:ET(this.a.f-c.f,_.Pf),height:ET(c.height,_.Pf),width:ET(c.width,_.Pf)},a.a)}b.style.visibility="visible";this.h.push(LT(a.a))};_.w(dU,PT);dU.prototype.init=function(){this.h=new aU(this);this.j=!0};dU.prototype.o=function(){var a=_.fj(_.Xd);_.dj(a,this.w);this.id&&(a.id=this.id);return a};dU.prototype.appendChild=function(a){cU(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(eU,dU);
26
- eU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Kp:b=b.width/100*a.width;break a;default:throw Error(qT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Kp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(qT);d=a.height;var e=fU(this,d,a.height);CT(this.B,this.a);CT({left:ET(c,_.Pf),top:ET(e,_.Pf),width:ET(b,_.Pf),height:ET(d,_.Pf)},this.a);this.f.writingMode&&CT({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&CT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.dj(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Kp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new QT(new _.Jp(0,1,"Lorem ipsum",_.Dp),{},{});c=d.a;this.a.appendChild(c);d.init(LT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(qT);
28
- }a=fU(this,b,a.height);CT({top:ET(a,_.Pf),height:ET(b,_.Pf)},this.a);this.h=new aU(this,!0);this.j=!0};eU.prototype.getId=function(){return this.f.id};hU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=jU(this,a);if(iU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
- hU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.w(nU,_.Ev);_.r=nU.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=xT(this.f,wT(a));this.l=null;mU(this,!1)}};_.r.ec=function(){null==this.h||mU(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();sU(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;mU(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
- _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Rb(.25),this.L.enableResizeObserver&&this.w.start(),mU(this,!0)):(this.G.stop(),this.w.stop(),sU(this)))};_.r.pl=function(){mU(this,!0)};_.K(tT,nU);nU.prototype.setTextVisibility=nU.prototype.setTextVisibility;nU.prototype.isTextVisible=nU.prototype.isTextVisible;nU.prototype.remove=nU.prototype.remove;nU.prototype.destroy=nU.prototype.destroy;nU.prototype.append=nU.prototype.append;tU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.vj()};tU.prototype.create=function(a){return new nU(a)};_.w(uU,_.jv);uU.prototype.install=function(){_.cu(_.ye,new tU)};uU.prototype.uninstall=function(){_.au.has(_.ye)&&(_.au["delete"](_.ye),_.bu.info("Removed factory: 'html'"))};uU.prototype.id=function(){return _.rg};_.K("clpp.htmlcue.HtmlCueComponent",uU);};
2
+ var f=function(window){var kT="CLPP Subtitle Styles",lT="Unsupported unit",mT="clpp-text-plain",nT="clpp-text-ttml",oT="clpp.htmlcue.HtmlTextDisplayer",pT="initial",qT=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},rT=function(a){return _.Ni(a,{ji:function(b,c){return b.ua(c)}})},sT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},tT=function(){},uT=function(a){if(!a.input)return null;
3
+ var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},wT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return vT[c]});return a},yT=function(a,b){xT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){xT(a,c)})},xT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},zT=function(a,b){return 0===a?"0":a+b},AT=function(a,b){return 1>Math.abs(a-b)||a<b},BT=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},CT=function(a,b){return a>b&&1<Math.abs(a-b)},DT=function(a,b){return 1>Math.abs(a-b)||a>b},ET=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},FT=function(a){return new ET(a.left,a.f,a.top,a.a,a.height,a.width)},GT=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
+ 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new ET(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},HT=function(a,b){return b.some(function(c){return BT(a.left,c.f)&&CT(a.f,c.left)&&BT(a.top,c.a)&&CT(a.a,c.top)})},IT=function(a,b){return DT(a.top,b.top)&&AT(a.a,b.a)&&DT(a.left,b.left)&&AT(a.f,b.f)},JT=function(a,b,c){switch(c){case "+x":return BT(a.left,b.left);case "-x":return CT(a.f,b.f);
6
+ case "+y":return BT(a.top,b.top);case "-y":return CT(a.a,b.a);default:throw Error("Unknown axis");}},KT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},LT=function(a,b,c){KT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},NT=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return MT(a)?b:c},QT=function(a,b,c){return MT(a)&&_.N.ya(c)?zT(c,_.Pf):(OT(a)||
7
+ PT(a))&&_.N.ya(b)?zT(b,"%"):pT},OT=function(a){return a.f.writingMode===_.Rg},PT=function(a){return a.f.writingMode===_.Sg},MT=function(a){return a.f.writingMode===_.Bp},RT=function(a,b,c){return(OT(a)||PT(a))&&_.N.ya(c)?zT(c,_.Pf):OT(a)&&_.N.R(c)?zT(0,_.Pf):MT(a)&&_.N.ya(b)?zT(b,"%"):pT},ST=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.He:return a.f.position;case "auto":case _.od:return a.f.position-a.f.size/2;case _.Ie:return a.f.position-a.f.size}return 0},
8
+ TT=function(a){switch(a.f.positionAlign){case _.He:return _.Ee;case "auto":case _.od:return _.Ap;case _.Ie:return _.Wf}return a.f.textAlign},UT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.jg:case _.Ee:return _.He;case _.Ap:return _.od;case _.pe:case _.Wf:return _.Ie}return a.f.positionAlign},VT=function(a){switch(a.f.writingMode){case _.Bp:return"horizontal-tb";case _.Rg:return _.Rg;case _.Sg:return _.Sg;default:throw Error("Unknown writing mode");}},WT=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=GT(a.a);this.h=[]},XT=function(a,b){if(a.j)switch(b.writingMode){case _.Bp:return["-y"];case _.Rg:return["+x"];case _.Sg:return["-x"]}var c=[];switch(b.writingMode){case _.Bp:c=["+y","-y"];break;case _.Rg:c=["+x","-x"];break;case _.Sg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},YT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=GT(a.l.a)},ZT=function(a,b,c){KT.call(this,a,b,c);this.h=null;this.l=[]},$T=function(a,b){ZT.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},aU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Gp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(lT);},cU=function(a){this.g=new _.M("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=bU(this,this.h);this.f=bU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},dU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
+ a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},eU=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
+ c)},bU=function(a,b,c){var d=document.createElement(_.pg),e=d.dataset;e.name=kT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);fU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},fU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===kT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
+ c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},iU=function(a){_.Av.call(this,a);var b=this;this.g=new _.M(oT);this.m=a;this.L=gU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new cU(a.getSurface().getUniqueCssClass());this.a=new ZT(null,"clpp-text-container",{});this.w=new _.sv(a.getSurface(),this.ml.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.hj(function(){hU(b)});this.A=new Map;this.l=null},gU=function(a){a=_.N.xb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},jU=function(a,b){return a.startTime<=b&&a.endTime>b},hU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=kU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,lU(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Rv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.$g:k="clpp-text-vtt";break;case _.Eg:k=nT;break;case _.zp:k=mT}k&&!g.classList.contains(k)&&_.$i(g,k);g=GT(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
+ else{xT({fontSize:mU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.$g;var l=e.payloadType===_.Eg;e.region&&(k||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new $T(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new LT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},kU=function(a,b){var c=qT(a.f,function(e){return jU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&jU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ jU(a.f[c+1],b);)c++;return{start:d,end:c}},nU=function(a){lU(a);a.J=null;a.l=null;a.f=[]},lU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(nT);b.classList.remove(mT);a=a.a;YT(a.h);a.l=[]}},mU=function(a,b){var c=GT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Pf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Pf;d=a.getFontSizePercent();return Math.round(c*d)+_.Pf},oU=function(){},
18
+ pU=function(){};
19
+ tT.prototype.parse=function(a){a={input:a};for(var b=_.bj(_.Yd),c=[],d=b,e;null!==(e=uT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=qU[f];k?(k=_.bj(k),(f=rU[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||sU[g.localName]&&sU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
+ d=g)}}else d.appendChild(document.createTextNode(wT(e)));return b};var qU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},rU={v:"voice",lang:"lang"},sU={rt:"ruby"},vT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};KT.prototype.init=function(){this.j=!0};KT.prototype.A=function(){return!1};_.w(LT,KT);LT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ LT.prototype.init=function(a){KT.prototype.init.call(this,a);if(this.h)_.$i(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Eg){var c=_.bj(_.Yd);c.innerHTML=b.payload;b=c}else b.payloadType===_.$g?b=(new tT).parse(b.payload):(c=_.bj(_.Yd),c.textContent=b.payload,b=c);_.$i(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
+ c.next();!d.done;d=c.next())_.$i(b,d.value);xT({writingMode:VT(this)},b);this.a.appendChild(b);_.$i(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.$i(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Cp,this.f.line=MT(this)?-1:0);c=VT(this);xT({writingMode:c,webkitWritingMode:c,direction:pT,textAlign:TT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=ST(this,UT(this));d=RT(this,c,null);var e=QT(this,
23
+ c,null),f=PT(this)&&_.N.R(null)?zT(0,_.Pf):pT;xT({position:"absolute",left:d,right:f,top:e,width:MT(this)?zT(this.f.size,"%"):pT,height:OT(this)||PT(this)?zT(this.f.size,"%"):pT},this.a);d=this.f;a=MT(this)?a.height:a.width;e=NT(this);if(d.lineInterpretation===_.Cp)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.od:g-=f/2;break;case _.pe:g-=f}f=Math.round(g/100*a)}PT(this)&&(f=a-f-e);a=f;d=RT(this,c,a);e=PT(this)&&_.N.R(a)?
24
+ zT(0,_.Pf):pT;xT({left:d,right:e,top:QT(this,c,a)},this.a)}yT(this.D,b)}};LT.prototype.o=function(){return _.bj(_.Yd)};WT.prototype.append=function(a){var b=a.a;b.style.visibility=_.xe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=GT(a.a);var d=XT(this,a.f),e=NT(a),f=FT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;JT(c,this.a,l)||IT(c,this.a)&&HT(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||IT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
+ l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=FT(c),k=l);c=FT(f)}c=g||f}xT({top:zT(c.top-this.a.top,_.Pf),bottom:zT(this.a.a-c.a,_.Pf),left:zT(c.left-this.a.left,_.Pf),right:zT(this.a.f-c.f,_.Pf),height:zT(c.height,_.Pf),width:zT(c.width,_.Pf)},a.a)}b.style.visibility="visible";this.h.push(GT(a.a))};_.w(ZT,KT);ZT.prototype.init=function(){this.h=new WT(this);this.j=!0};ZT.prototype.o=function(){var a=_.bj(_.Yd);_.$i(a,this.w);this.id&&(a.id=this.id);return a};ZT.prototype.appendChild=function(a){YT(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w($T,ZT);
26
+ $T.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Gp:b=b.width/100*a.width;break a;default:throw Error(lT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Gp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(lT);d=a.height;var e=aU(this,d,a.height);xT(this.B,this.a);xT({left:zT(c,_.Pf),top:zT(e,_.Pf),width:zT(b,_.Pf),height:zT(d,_.Pf)},this.a);this.f.writingMode&&xT({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&xT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.$i(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Gp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new LT(new _.Fp(0,1,"Lorem ipsum",_.zp),{},{});c=d.a;this.a.appendChild(c);d.init(GT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(lT);
28
+ }a=aU(this,b,a.height);xT({top:zT(a,_.Pf),height:zT(b,_.Pf)},this.a);this.h=new WT(this,!0);this.j=!0};$T.prototype.getId=function(){return this.f.id};cU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=eU(this,a);if(dU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
+ cU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.w(iU,_.Av);_.r=iU.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=sT(this.f,rT(a));this.l=null;hU(this,!1)}};_.r.ec=function(){null==this.h||hU(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();nU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;hU(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
+ _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Rb(.25),this.L.enableResizeObserver&&this.w.start(),hU(this,!0)):(this.G.stop(),this.w.stop(),nU(this)))};_.r.ml=function(){hU(this,!0)};_.J(oT,iU);iU.prototype.setTextVisibility=iU.prototype.setTextVisibility;iU.prototype.isTextVisible=iU.prototype.isTextVisible;iU.prototype.remove=iU.prototype.remove;iU.prototype.destroy=iU.prototype.destroy;iU.prototype.append=iU.prototype.append;oU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.rj()};oU.prototype.create=function(a){return new iU(a)};_.w(pU,_.fv);pU.prototype.install=function(){_.Zt(_.ze,new oU)};pU.prototype.uninstall=function(){_.Xt.has(_.ze)&&(_.Xt["delete"](_.ze),_.Yt.info("Removed factory: 'html'"))};pU.prototype.id=function(){return _.rg};_.J("clpp.htmlcue.HtmlCueComponent",pU);};
32
32
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
33
33
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
34
34
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,30 +1,30 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var US="clpp.ima.AdsManagerFactory",VS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},WS=function(){},XS=function(a){this.a=a},YS=function(){this.a=this.h=this.f=null},ZS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},$S=function(){},aT=function(a){var b=a.ze("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Gd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
- this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.xb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.zv;this.g=new _.M("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.rm;this.W=!1;this.L=new _.Bi;this.ha=new WS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Fn.bind(this));
4
- c.on(this.j,d,this.En.bind(this));c.on(this.m,_.pe,this.Nn.bind(this))},bT=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.un.bind(a));c.on(b,d.LOADED,a.tl.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.On.bind(a));c.on(b,d.STARTED,a.wl.bind(a));c.on(b,d.LOG,a.yn.bind(a));c.on(b,d.AD_PROGRESS,a.ul.bind(a));c.on(b,d.AD_BUFFERING,a.vn.bind(a));c.on(b,d.FIRST_QUARTILE,a.rl.bind(a));c.on(b,d.MIDPOINT,a.zn.bind(a));c.on(b,d.THIRD_QUARTILE,a.xl.bind(a));c.on(b,d.PAUSED,a.Bn.bind(a));
5
- c.on(b,d.RESUMED,a.Cn.bind(a));c.on(b,d.CLICK,a.ql.bind(a));c.on(b,d.SKIPPED,a.vl.bind(a));c.on(b,d.IMPRESSION,a.sl.bind(a));c.on(b,d.COMPLETE,a.wn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Pn.bind(a))},cT=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.cd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
6
- Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.cd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},fT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.y(b,dT(a,3),2);case 2:return _.y(b,a.m.pause(),3);case 3:return _.y(b,eT(a),4);case 4:a.a.start(),_.A(b)}})},hT=function(a){a.M=!1;a.w=null;gT(a,_.Cc);
7
- a.m.getSurface().hide(a.X)},eT=function(a){return _.I(function(b){if(1==b.a)return _.y(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.A(b)})},dT=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){a.m.getState()>=b&&(clearInterval(g),clearTimeout(f),d())},200)}))})},iT=function(a){_.ej(a.o,{visibility:"visible"})},gT=function(a,b,
8
- c){c=c&&c.getAd();var d=null;c&&(d={ad:new VS(c,a.D,a.B)});a.m.trigger(new _.Q(b,d))},jT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},kT=function(a){var b=_.qj()||_.rj()||_.vj();return!1===a.A.disableCustomPlayback&&b},lT=function(a){return kT(a)&&a.a.isCustomPlaybackUsed()},nT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.y(d,a.T.canPlay(b),2);c=d.f;if(!c&&!lT(a))return gT(a,_.ad),
9
- a.g.warn(_.na),d["return"]();mT(a);_.A(d)})},mT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);lT(a)?a.A.isVast&&fT(a):a.a.start();a.W=!0},oT=function(){this.Fa=new _.M(US)};_.r=VS.prototype;_.r.lb=function(){return"Google IMA SDK"};_.r.nb=function(){return google.ima.VERSION};_.r.pb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Jb=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
10
- _.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Lb=function(){return this.f?this.f.getIsBumper():!1};
11
- _.r.$a=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.$e&&typeof b[d].clickThroughUrl===_.ng});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.fb=function(){return this.a.getVastMediaWidth()};_.r.eb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
12
- _.r.zb=function(){return this.f?this.f.getTimeOffset():0};_.r.ob=function(){return this.f?this.f.getAdPosition():1};_.r.gb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Kb=function(){return null};VS.prototype.getVideoElement=VS.prototype.Kb;
13
- VS.prototype.getWrapperCreativeIds=VS.prototype.getWrapperCreativeIds;VS.prototype.getWrapperAdSystems=VS.prototype.getWrapperAdSystems;VS.prototype.canSeek=VS.prototype.canSeek;VS.prototype.getWrapperAdIds=VS.prototype.getWrapperAdIds;VS.prototype.getSequenceLength=VS.prototype.gb;VS.prototype.getPositionInSequence=VS.prototype.ob;VS.prototype.getPodTimeOffset=VS.prototype.zb;VS.prototype.getPodIndex=VS.prototype.getPodIndex;VS.prototype.getPodType=VS.prototype.Ha;VS.prototype.getMediaBitrate=VS.prototype.Ga;
14
- VS.prototype.getMediaHeight=VS.prototype.eb;VS.prototype.getMediaWidth=VS.prototype.fb;VS.prototype.getMediaUrl=VS.prototype.getMediaUrl;VS.prototype.getClickThroughUrl=VS.prototype.$a;VS.prototype.isBumper=VS.prototype.Lb;VS.prototype.getSkipTimeOffset=VS.prototype.getSkipTimeOffset;VS.prototype.getPosition=VS.prototype.getPosition;VS.prototype.getDuration=VS.prototype.getDuration;VS.prototype.getTitle=VS.prototype.getTitle;VS.prototype.getAdvertiserName=VS.prototype.getAdvertiserName;
15
- VS.prototype.getAdSystem=VS.prototype.getAdSystem;VS.prototype.getApiFramework=VS.prototype.getApiFramework;VS.prototype.getSourceId=VS.prototype.Jb;VS.prototype.getCreativeId=VS.prototype.getCreativeId;VS.prototype.getId=VS.prototype.getId;VS.prototype.getTechnology=VS.prototype.pb;VS.prototype.getAdManagerVersion=VS.prototype.nb;VS.prototype.getAdManagerName=VS.prototype.lb;WS.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};XS.prototype.getCuePoints=function(){return this.a};XS.prototype.ac=function(){return 0<=this.a.indexOf(0)||0===this.a.length};XS.prototype.$b=function(){return 0<=this.a.indexOf(-1)};XS.prototype.hasPostroll=XS.prototype.$b;XS.prototype.hasPreroll=XS.prototype.ac;XS.prototype.getCuePoints=XS.prototype.getCuePoints;_.w(YS,_.gw);_.r=YS.prototype;_.r.onPlayerCreated=function(a){if(ZS())return a.onError(new _.O(1,9,1E4));this.f=_.cj(_.Xd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.ya);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
16
- _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.um=function(){return this.a};_.r.sm=function(){return this.h};_.r.Gd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",YS);YS.prototype.getAdContainer=YS.prototype.Gd;YS.prototype.getAdDisplayContainer=YS.prototype.sm;YS.prototype.getAdsLoader=YS.prototype.um;YS.Id="ima";
17
- YS.isSdkMissing=ZS;$S.prototype.create=function(){return new YS};_.r=aT.prototype;
18
- _.r.Fn=function(a){var b=this;this.a=a.getAdsManager(this.o,cT(this));this.a.isCustomPlaybackUsed()&&!kT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Cc()):(this.setMuted(this.l),this.Pa(this.H),this.h=new _.xv(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.K=new XS(a),this.m.trigger(new _.Q(_.Fc,{adsTimeline:this.K})),
19
- bT(this));this.f.resolve()};_.r.En=function(a){jT(this,a.getError());this.f.resolve()};_.r.On=function(a){this.J=!0;lT(this)||(this.m.pause(),_.ej(this.o,{visibility:_.we}));gT(this,_.ic,a);this.h.start()};_.r.un=function(){lT(this)?fT(this):this.a.start()};_.r.tl=function(a){a.getAd().isLinear()?gT(this,_.tc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.wl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();gT(this,_.Bc,a);this.m.getSurface().show(this.X)};
20
- _.r.yn=function(a){a=a.getAdData();jT(this,a?a.adError:null);hT(this)};_.r.ul=function(a){gT(this,_.yc,a)};_.r.vn=function(a){gT(this,_.kc,a)};_.r.rl=function(a){gT(this,_.nc,a)};_.r.zn=function(a){gT(this,_.vc,a)};_.r.xl=function(a){gT(this,_.Dc,a)};_.r.Bn=function(a){this.G=!0;gT(this,_.xc,a)};_.r.Cn=function(a){this.G=!1;gT(this,_.zc,a)};_.r.ql=function(a){this.pause();gT(this,_.lc,a)};_.r.vl=function(a){gT(this,_.Ac,a);hT(this)};_.r.sl=function(a){gT(this,_.rc,a)};
21
- _.r.wn=function(a){gT(this,_.mc,a);hT(this)};
22
- _.r.Pn=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!lT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());iT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.y(d,_.ap(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.y(d,dT(a,2),5);case 5:return _.y(d,a.m.play(),6);case 6:return _.y(d,a.m.pause(),7);case 7:return _.y(d,dT(a,4),8);case 8:return _.y(d,a.m.setPosition(a.I),
23
- 2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.y(d,a.m.play(),10);case 10:gT(a,_.jc),_.A(d)}})};_.r.Nn=function(){this.B=!0;this.j.contentComplete()};
24
- _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.ng)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.T.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.T.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
25
- return g["return"](a.f)})};_.r.Cb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.ac())return nT(this),!1;this.ba.initialize();mT(this);return!0}return this.Ab()&&this.a?(this.a.resume(),!1):!0};_.r.Uc=function(){};_.r.Rc=function(){return!0};_.r.rb=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
26
- _.r.Pa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.rb()};_.r.resume=function(){this.Cb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.Ab=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
27
- _.r.Cc=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;iT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};aT.prototype.getPosition=aT.prototype.getPosition;aT.prototype.resume=aT.prototype.resume;aT.prototype.pause=aT.prototype.pause;aT.prototype.getVolume=aT.prototype.getVolume;aT.prototype.setVolume=aT.prototype.setVolume;aT.prototype.getAdVolume=aT.prototype.getAdVolume;aT.prototype.skip=aT.prototype.skip;aT.prototype.pauseAd=aT.prototype.rb;oT.prototype.name=function(){return US};oT.prototype.a=function(a,b){return a.namespace()===_.xd?!1:ZS()?(this.Fa.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};oT.prototype.create=function(a){return new aT(a)};_.ki(new oT);_.fp(new $S);};
2
+ var f=function(window){var QS="clpp.ima.AdsManagerFactory",RS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},SS=function(){},TS=function(a){this.a=a},US=function(){this.a=this.h=this.f=null},VS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WS=function(){},XS=function(a){var b=a.Ae("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Gd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
+ this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.xb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.vv;this.g=new _.M("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.nm;this.W=!1;this.L=new _.xi;this.ha=new SS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Bn.bind(this));
4
+ c.on(this.j,d,this.An.bind(this));c.on(this.m,_.qe,this.Jn.bind(this))},YS=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.qn.bind(a));c.on(b,d.LOADED,a.ql.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Kn.bind(a));c.on(b,d.STARTED,a.tl.bind(a));c.on(b,d.LOG,a.un.bind(a));c.on(b,d.AD_PROGRESS,a.rl.bind(a));c.on(b,d.AD_BUFFERING,a.rn.bind(a));c.on(b,d.FIRST_QUARTILE,a.ol.bind(a));c.on(b,d.MIDPOINT,a.vn.bind(a));c.on(b,d.THIRD_QUARTILE,a.ul.bind(a));c.on(b,d.PAUSED,a.xn.bind(a));
5
+ c.on(b,d.RESUMED,a.yn.bind(a));c.on(b,d.CLICK,a.nl.bind(a));c.on(b,d.SKIPPED,a.sl.bind(a));c.on(b,d.IMPRESSION,a.pl.bind(a));c.on(b,d.COMPLETE,a.sn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Ln.bind(a))},ZS=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.dd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
6
+ Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.dd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},aT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.x(b,$S(a,3),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,a.m.detach(),4);case 4:a.a.start(),_.A(b)}})},cT=function(a){a.M=!1;a.w=null;
7
+ bT(a,_.Cc);a.m.getSurface().hide(a.X)},$S=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){a.m.getState()>=b&&(clearInterval(g),clearTimeout(f),d())},200)}))})},dT=function(a){_.aj(a.o,{visibility:"visible"})},bT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new RS(c,a.D,a.B)});a.m.trigger(new _.Q(b,d))},eT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):
8
+ null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},fT=function(a){var b=_.mj()||_.nj()||_.rj();return!1===a.A.disableCustomPlayback&&b},gT=function(a){return fT(a)&&a.a.isCustomPlaybackUsed()},iT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.T.canPlay(b),2);c=d.f;if(!c&&!gT(a))return bT(a,_.bd),a.g.warn(_.na),d["return"]();hT(a);_.A(d)})},hT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);gT(a)?
9
+ a.A.isVast&&aT(a):a.a.start();a.W=!0},jT=function(){this.Fa=new _.M(QS)};_.r=RS.prototype;_.r.kb=function(){return"Google IMA SDK"};_.r.lb=function(){return google.ima.VERSION};_.r.ob=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Jb=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};
10
+ _.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Lb=function(){return this.f?this.f.getIsBumper():!1};_.r.Za=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.$e&&typeof b[d].clickThroughUrl===_.ng});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};
11
+ _.r.eb=function(){return this.a.getVastMediaWidth()};_.r.cb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.zb=function(){return this.f?this.f.getTimeOffset():0};_.r.nb=function(){return this.f?this.f.getAdPosition():1};_.r.fb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};
12
+ _.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Kb=function(){return null};RS.prototype.getVideoElement=RS.prototype.Kb;RS.prototype.getWrapperCreativeIds=RS.prototype.getWrapperCreativeIds;RS.prototype.getWrapperAdSystems=RS.prototype.getWrapperAdSystems;RS.prototype.canSeek=RS.prototype.canSeek;RS.prototype.getWrapperAdIds=RS.prototype.getWrapperAdIds;
13
+ RS.prototype.getSequenceLength=RS.prototype.fb;RS.prototype.getPositionInSequence=RS.prototype.nb;RS.prototype.getPodTimeOffset=RS.prototype.zb;RS.prototype.getPodIndex=RS.prototype.getPodIndex;RS.prototype.getPodType=RS.prototype.Ha;RS.prototype.getMediaBitrate=RS.prototype.Ga;RS.prototype.getMediaHeight=RS.prototype.cb;RS.prototype.getMediaWidth=RS.prototype.eb;RS.prototype.getMediaUrl=RS.prototype.getMediaUrl;RS.prototype.getClickThroughUrl=RS.prototype.Za;RS.prototype.isBumper=RS.prototype.Lb;
14
+ RS.prototype.getSkipTimeOffset=RS.prototype.getSkipTimeOffset;RS.prototype.getPosition=RS.prototype.getPosition;RS.prototype.getDuration=RS.prototype.getDuration;RS.prototype.getTitle=RS.prototype.getTitle;RS.prototype.getAdvertiserName=RS.prototype.getAdvertiserName;RS.prototype.getAdSystem=RS.prototype.getAdSystem;RS.prototype.getApiFramework=RS.prototype.getApiFramework;RS.prototype.getSourceId=RS.prototype.Jb;RS.prototype.getCreativeId=RS.prototype.getCreativeId;RS.prototype.getId=RS.prototype.getId;
15
+ RS.prototype.getTechnology=RS.prototype.ob;RS.prototype.getAdManagerVersion=RS.prototype.lb;RS.prototype.getAdManagerName=RS.prototype.kb;SS.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};TS.prototype.getCuePoints=function(){return this.a};TS.prototype.ac=function(){return 0<=this.a.indexOf(0)||0===this.a.length};TS.prototype.$b=function(){return 0<=this.a.indexOf(-1)};TS.prototype.hasPostroll=TS.prototype.$b;TS.prototype.hasPreroll=TS.prototype.ac;TS.prototype.getCuePoints=TS.prototype.getCuePoints;_.w(US,_.cw);_.r=US.prototype;_.r.onPlayerCreated=function(a){if(VS())return a.onError(new _.O(1,9,1E4));this.f=_.Zi(_.Yd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.ya);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
16
+ _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.qm=function(){return this.a};_.r.om=function(){return this.h};_.r.Gd=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",US);US.prototype.getAdContainer=US.prototype.Gd;US.prototype.getAdDisplayContainer=US.prototype.om;US.prototype.getAdsLoader=US.prototype.qm;US.Id="ima";
17
+ US.isSdkMissing=VS;WS.prototype.create=function(){return new US};_.r=XS.prototype;
18
+ _.r.Bn=function(a){var b=this;this.a=a.getAdsManager(this.o,ZS(this));this.a.isCustomPlaybackUsed()&&!fT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Cc()):(this.setMuted(this.l),this.Oa(this.H),this.h=new _.sv(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.K=new TS(a),this.m.trigger(new _.Q(_.Fc,{adsTimeline:this.K})),
19
+ YS(this));this.f.resolve()};_.r.An=function(a){eT(this,a.getError());this.f.resolve()};_.r.Kn=function(a){this.J=!0;gT(this)||(this.m.pause(),_.aj(this.o,{visibility:_.xe}));bT(this,_.ic,a);this.h.start()};_.r.qn=function(){gT(this)?aT(this):this.a.start()};_.r.ql=function(a){a.getAd().isLinear()?bT(this,_.uc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.tl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();bT(this,_.Bc,a);this.m.getSurface().show(this.X)};
20
+ _.r.un=function(a){a=a.getAdData();eT(this,a?a.adError:null);cT(this)};_.r.rl=function(a){bT(this,_.yc,a)};_.r.rn=function(a){bT(this,_.kc,a)};_.r.ol=function(a){bT(this,_.nc,a)};_.r.vn=function(a){bT(this,_.wc,a)};_.r.ul=function(a){bT(this,_.Dc,a)};_.r.xn=function(a){this.G=!0;bT(this,_.xc,a)};_.r.yn=function(a){this.G=!1;bT(this,_.zc,a)};_.r.nl=function(a){this.pause();bT(this,_.lc,a)};_.r.sl=function(a){bT(this,_.Ac,a);cT(this)};_.r.pl=function(a){bT(this,_.rc,a)};
21
+ _.r.sn=function(a){bT(this,_.mc,a);cT(this)};
22
+ _.r.Ln=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!gT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());dT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.x(d,_.Xo(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.x(d,$S(a,2),5);case 5:return _.x(d,a.m.play(),6);case 6:return _.x(d,a.m.pause(),7);case 7:return _.x(d,$S(a,4),8);case 8:return _.x(d,a.m.setPosition(a.I),
23
+ 2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.x(d,a.m.play(),10);case 10:bT(a,_.jc),_.A(d)}})};_.r.Jn=function(){this.B=!0;this.j.contentComplete()};
24
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.ng)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.T.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.T.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
25
+ return g["return"](a.f)})};_.r.Cb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.ac())return iT(this),!1;this.ba.initialize();hT(this);return!0}return this.Ab()&&this.a?(this.a.resume(),!1):!0};_.r.Uc=function(){};_.r.Rc=function(){return!0};_.r.qb=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
26
+ _.r.Oa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Oa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.qb()};_.r.resume=function(){this.Cb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.Ab=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
27
+ _.r.Cc=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;dT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};XS.prototype.getPosition=XS.prototype.getPosition;XS.prototype.resume=XS.prototype.resume;XS.prototype.pause=XS.prototype.pause;XS.prototype.getVolume=XS.prototype.getVolume;XS.prototype.setVolume=XS.prototype.setVolume;XS.prototype.getAdVolume=XS.prototype.getAdVolume;XS.prototype.skip=XS.prototype.skip;XS.prototype.pauseAd=XS.prototype.qb;jT.prototype.name=function(){return QS};jT.prototype.a=function(a,b){return a.namespace()===_.yd?!1:VS()?(this.Fa.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};jT.prototype.create=function(a){return new XS(a)};_.fi(new jT);_.bp(new WS);};
28
28
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
29
29
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
30
30
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var RS=function(){this.g=new _.M("clpp.mediatailor.MediaTailorPlugin")},SS=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.y(l,fetch(b,{method:_.rb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.y(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Ij:_.Dn(f,b),oq:g?_.Dn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Ij);return l["return"](k)})},TS=function(){};_.w(RS,_.gw);
3
- RS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.y(g,SS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.Ij,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.P,9,7003,"Media Tailor session failed to initialize.");})};RS.prototype.id=function(){return"mediatailor"};
4
- TS.prototype.create=function(){return new RS};_.fp(new TS);};
2
+ var f=function(window){var NS=function(){this.g=new _.M("clpp.mediatailor.MediaTailorPlugin")},OS=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.rb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Fj:_.zn(f,b),jq:g?_.zn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Fj);return l["return"](k)})},PS=function(){};_.w(NS,_.cw);
3
+ NS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,OS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.Fj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.P,9,7003,"Media Tailor session failed to initialize.");})};NS.prototype.id=function(){return"mediatailor"};
4
+ PS.prototype.create=function(){return new NS};_.bp(new PS);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}