@castlabs/prestoplay 6.24.0 → 6.25.1

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 (66) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +116 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +596 -597
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +88 -87
  10. package/cjs/cl.externs.js +42 -55
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +77 -73
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mse.js +346 -341
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +15 -15
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -16
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  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 +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +31 -31
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +84 -84
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +473 -474
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +75 -74
  41. package/cl.externs.js +42 -55
  42. package/cl.freewheel.js +15 -15
  43. package/cl.hls.js +79 -75
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +15 -14
  47. package/cl.mse.js +306 -304
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +10 -10
  51. package/cl.playlist.js +5 -5
  52. package/cl.sessions.js +10 -10
  53. package/cl.simid.js +13 -13
  54. package/cl.smooth.js +60 -59
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +26 -26
  64. package/clpp.styles.css +4 -0
  65. package/package.json +1 -1
  66. package/typings.d.ts +19 -26
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var PU="CLPP Subtitle Styles",QU="Unsupported unit",RU="clpp-text-plain",SU="clpp-text-ttml",TU="clpp.htmlcue.HtmlTextDisplayer",UU="initial",VU=function(a){return _.Yi(a,{Sh:function(b,c){return b.qa(c)}})},WU=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)},XU=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},YU=function(){},ZU=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},aV=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return $U[c]});return a},cV=function(a,b){bV(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){bV(a,c)})},bV=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},dV=function(a,b){return 0===a?"0":a+b},eV=function(a,b){return 1>Math.abs(a-b)||a<b},fV=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},gV=function(a,b){return a>b&&1<Math.abs(a-b)},hV=function(a,b){return 1>Math.abs(a-b)||a>b},iV=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},jV=function(a){return new iV(a.left,a.f,a.top,a.a,a.height,a.width)},kV=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 iV(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},lV=function(a,b){return b.some(function(c){return fV(a.left,c.f)&&gV(a.f,c.left)&&fV(a.top,c.a)&&gV(a.a,c.top)})},mV=function(a,b){return hV(a.top,b.top)&&eV(a.a,b.a)&&hV(a.left,b.left)&&eV(a.f,b.f)},nV=function(a,b,c){switch(c){case "+x":return fV(a.left,b.left);case "-x":return gV(a.f,b.f);
6
- case "+y":return fV(a.top,b.top);case "-y":return gV(a.a,b.a);default:throw Error("Unknown axis");}},oV=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},pV=function(a,b,c){oV.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},rV=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 qV(a)?b:c},uV=function(a,b,c){return qV(a)&&_.N.xa(c)?dV(c,_.Wf):(sV(a)||
7
- tV(a))&&_.N.xa(b)?dV(b,"%"):UU},sV=function(a){return a.f.writingMode===_.Vg},tV=function(a){return a.f.writingMode===_.Wg},qV=function(a){return a.f.writingMode===_.bj},vV=function(a,b,c){return(sV(a)||tV(a))&&_.N.xa(c)?dV(c,_.Wf):sV(a)&&_.N.R(c)?dV(0,_.Wf):qV(a)&&_.N.xa(b)?dV(b,"%"):UU},wV=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Oe:return a.f.position;case "auto":case _.wd:return a.f.position-a.f.size/2;case _.Pe:return a.f.position-a.f.size}return 0},
8
- xV=function(a){switch(a.f.positionAlign){case _.Oe:return _.Ke;case "auto":case _.wd:return _.aj;case _.Pe:return _.cg}return a.f.textAlign},yV=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Ke:case _.Ke:return _.Oe;case _.aj:return _.wd;case _.cg:case _.cg:return _.Pe}return a.f.positionAlign},zV=function(a){switch(a.f.writingMode){case _.bj:return"horizontal-tb";case _.Vg:return _.Vg;case _.Wg:return _.Wg;default:throw Error("Unknown writing mode");}},AV=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=kV(a.a);this.h=[]},BV=function(a,b){if(a.j)switch(b.writingMode){case _.bj:return["-y"];case _.Vg:return["+x"];case _.Wg:return["-x"]}var c=[];switch(b.writingMode){case _.bj:c=["+y","-y"];break;case _.Vg:c=["+x","-x"];break;case _.Wg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},CV=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=kV(a.l.a)},DV=function(a,b,c){oV.call(this,a,b,c);this.h=null;this.l=[]},EV=function(a,b){DV.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},FV=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.gj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(QU);},HV=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=GV(this,this.h);this.f=GV(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},IV=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},JV=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)},GV=function(a,b,c){var d=document.createElement(_.vg),e=d.dataset;e.name=PU;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);KV(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},KV=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===PU&&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()})},NV=function(a){_.Gv.call(this,a);var b=this;this.g=new _.K(TU);this.m=a;this.L=LV(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new HV(a.getSurface().getUniqueCssClass());this.a=new DV(null,"clpp-text-container",{});this.w=new _.Yu(a.getSurface(),this.Nk.bind(this));this.J=null;this.C?(this.C.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 _.li(function(){MV(b)});this.A=new Map;this.l=null},LV=function(a){a=_.N.nb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},OV=function(a,b){return a.startTime<=b&&a.endTime>b},MV=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Uq){a.J=c;var d=PV(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,QV(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.$v(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.ch:h="clpp-text-vtt";break;case _.Jg:h=SU;break;case _.$i:h=RU}h&&!g.classList.contains(h)&&_.tr(g,h);g=kV(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{bV({fontSize:RV(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.ch;var l=e.payloadType===_.Jg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new EV(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new pV(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},PV=function(a,b){var c=XU(a.f,function(e){return OV(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&OV(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- OV(a.f[c+1],b);)c++;return{start:d,end:c}},SV=function(a){QV(a);a.J=null;a.l=null;a.f=[]},QV=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(SU);b.classList.remove(RU);a=a.a;CV(a.h);a.l=[]}},RV=function(a,b){var c=kV(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Wf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Wf;d=a.getFontSizePercent();return Math.round(c*d)+_.Wf},TV=function(){},
18
- UV=function(){};
19
- YU.prototype.parse=function(a){a={input:a};for(var b=_.vr(_.fe),c=[],d=b,e;null!==(e=ZU(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 h=VV[f];h?(h=_.vr(h),(f=WV[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||XV[g.localName]&&XV[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(aV(e)));return b};var VV={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},WV={v:"voice",lang:"lang"},XV={rt:"ruby"},$U={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};oV.prototype.init=function(){this.j=!0};oV.prototype.A=function(){return!1};_.x(pV,oV);pV.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- pV.prototype.init=function(a){oV.prototype.init.call(this,a);if(this.h)_.tr(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===_.Jg){var c=_.vr(_.fe);c.innerHTML=b.payload;b=c}else b.payloadType===_.ch?b=(new YU).parse(b.payload):(c=_.vr(_.fe),c.textContent=b.payload,b=c);_.tr(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.tr(b,d.value);bV({writingMode:zV(this)},b);this.a.appendChild(b);_.tr(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.tr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.cj,this.f.line=qV(this)?-1:0);c=zV(this);bV({writingMode:c,webkitWritingMode:c,direction:UU,textAlign:xV(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=wV(this,yV(this));d=vV(this,c,null);var e=uV(this,
23
- c,null),f=tV(this)&&_.N.R(null)?dV(0,_.Wf):UU;bV({position:"absolute",left:d,right:f,top:e,width:qV(this)?dV(this.f.size,"%"):UU,height:sV(this)||tV(this)?dV(this.f.size,"%"):UU},this.a);d=this.f;a=qV(this)?a.height:a.width;e=rV(this);if(d.lineInterpretation===_.cj)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 _.wd:g-=f/2;break;case _.xe:g-=f}f=Math.round(g/100*a)}tV(this)&&(f=a-f-e);a=f;d=vV(this,c,a);e=tV(this)&&_.N.R(a)?
24
- dV(0,_.Wf):UU;bV({left:d,right:e,top:uV(this,c,a)},this.a)}cV(this.C,b)}};pV.prototype.o=function(){return _.vr(_.fe)};AV.prototype.append=function(a){var b=a.a;b.style.visibility=_.Fe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=kV(a.a);var d=BV(this,a.f),e=rV(a),f=jV(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;nV(c,this.a,l)||mV(c,this.a)&&lV(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||mV(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>h&&(g=jV(c),h=l);c=jV(f)}c=g||f}bV({top:dV(c.top-this.a.top,_.Wf),bottom:dV(this.a.a-c.a,_.Wf),left:dV(c.left-this.a.left,_.Wf),right:dV(this.a.f-c.f,_.Wf),height:dV(c.height,_.Wf),width:dV(c.width,_.Wf)},a.a)}b.style.visibility="visible";this.h.push(kV(a.a))};_.x(DV,oV);DV.prototype.init=function(){this.h=new AV(this);this.j=!0};DV.prototype.o=function(){var a=_.vr(_.fe);_.tr(a,this.w);this.id&&(a.id=this.id);return a};DV.prototype.appendChild=function(a){CV(this.h);this.l.unshift(a);a=_.w(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.x(EV,DV);
26
- EV.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.gj:b=b.width/100*a.width;break a;default:throw Error(QU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.gj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(QU);d=a.height;var e=FV(this,d,a.height);bV(this.B,this.a);bV({left:dV(c,_.Wf),top:dV(e,_.Wf),width:dV(b,_.Wf),height:dV(d,_.Wf)},this.a);this.f.writingMode&&bV({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&bV({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.tr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.gj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new pV(new _.fj(0,1,"Lorem ipsum",_.$i),{},{});c=d.a;this.a.appendChild(c);d.init(kV(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(QU);
28
- }a=FV(this,b,a.height);bV({top:dV(a,_.Wf),height:dV(b,_.Wf)},this.a);this.h=new AV(this,!0);this.j=!0};EV.prototype.getId=function(){return this.f.id};HV.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=JV(this,a);if(IV(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
- HV.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.");_.B(b)})};_.x(NV,_.Gv);_.t=NV.prototype;_.t.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(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=WU(this.f,VU(a));this.l=null;MV(this,!1)}};_.t.Xb=function(){null==this.h||MV(this,!0)};
30
- _.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();SV(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.B(b)})};_.t.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;MV(this,!0);return!0};_.t.isTextVisible=function(){return this.j};
31
- _.t.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Kb(.25),this.L.enableResizeObserver&&this.w.start(),MV(this,!0)):(this.G.stop(),this.w.stop(),SV(this)))};_.t.Nk=function(){MV(this,!0)};_.J(TU,NV);NV.prototype.setTextVisibility=NV.prototype.setTextVisibility;NV.prototype.isTextVisible=NV.prototype.isTextVisible;NV.prototype.remove=NV.prototype.remove;NV.prototype.destroy=NV.prototype.destroy;NV.prototype.append=NV.prototype.append;TV.prototype.a=function(a){return!!a.enableHtmlCue&&!_.Ul()};TV.prototype.create=function(a){return new NV(a)};_.x(UV,_.Fu);UV.prototype.f=function(){_.wq(_.Ge,new TV)};UV.prototype.a=function(){_.uq.has(_.Ge)&&(_.uq["delete"](_.Ge),_.vq.info("Removed factory: 'html'"))};UV.prototype.id=function(){return _.xg};_.J("clpp.htmlcue.HtmlCueComponent",UV);};
2
+ var f=function(window){var YU="CLPP Subtitle Styles",ZU="Unsupported unit",$U="clpp-text-plain",aV="clpp-text-ttml",bV="clpp.htmlcue.HtmlTextDisplayer",cV="initial",dV=function(a){return _.Zi(a,{Rh:function(b,c){return b.qa(c)}})},eV=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)},fV=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},gV=function(){},hV=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},jV=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return iV[c]});return a},lV=function(a,b){kV(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){kV(a,c)})},kV=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},mV=function(a,b){return 0===a?"0":a+b},nV=function(a,b){return 1>Math.abs(a-b)||a<b},oV=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},pV=function(a,b){return a>b&&1<Math.abs(a-b)},qV=function(a,b){return 1>Math.abs(a-b)||a>b},rV=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},sV=function(a){return new rV(a.left,a.f,a.top,a.a,a.height,a.width)},tV=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 rV(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},uV=function(a,b){return b.some(function(c){return oV(a.left,c.f)&&pV(a.f,c.left)&&oV(a.top,c.a)&&pV(a.a,c.top)})},vV=function(a,b){return qV(a.top,b.top)&&nV(a.a,b.a)&&qV(a.left,b.left)&&nV(a.f,b.f)},wV=function(a,b,c){switch(c){case "+x":return oV(a.left,b.left);case "-x":return pV(a.f,b.f);
6
+ case "+y":return oV(a.top,b.top);case "-y":return pV(a.a,b.a);default:throw Error("Unknown axis");}},xV=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},yV=function(a,b,c){xV.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},AV=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 zV(a)?b:c},DV=function(a,b,c){return zV(a)&&_.N.xa(c)?mV(c,_.Xf):(BV(a)||
7
+ CV(a))&&_.N.xa(b)?mV(b,"%"):cV},BV=function(a){return a.f.writingMode===_.Xg},CV=function(a){return a.f.writingMode===_.Yg},zV=function(a){return a.f.writingMode===_.cj},EV=function(a,b,c){return(BV(a)||CV(a))&&_.N.xa(c)?mV(c,_.Xf):BV(a)&&_.N.R(c)?mV(0,_.Xf):zV(a)&&_.N.xa(b)?mV(b,"%"):cV},FV=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Pe:return a.f.position;case "auto":case _.yd:return a.f.position-a.f.size/2;case _.Qe:return a.f.position-a.f.size}return 0},
8
+ GV=function(a){switch(a.f.positionAlign){case _.Pe:return _.Le;case "auto":case _.yd:return _.bj;case _.Qe:return _.dg}return a.f.textAlign},HV=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.qg:case _.Le:return _.Pe;case _.bj:return _.yd;case _.ye:case _.dg:return _.Qe}return a.f.positionAlign},IV=function(a){switch(a.f.writingMode){case _.cj:return"horizontal-tb";case _.Xg:return _.Xg;case _.Yg:return _.Yg;default:throw Error("Unknown writing mode");}},JV=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=tV(a.a);this.h=[]},KV=function(a,b){if(a.j)switch(b.writingMode){case _.cj:return["-y"];case _.Xg:return["+x"];case _.Yg:return["-x"]}var c=[];switch(b.writingMode){case _.cj:c=["+y","-y"];break;case _.Xg:c=["+x","-x"];break;case _.Yg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},LV=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=tV(a.l.a)},MV=function(a,b,c){xV.call(this,a,b,c);this.h=null;this.l=[]},NV=function(a,b){MV.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},OV=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.hj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(ZU);},QV=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=PV(this,this.h);this.f=PV(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},RV=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},SV=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)},PV=function(a,b,c){var d=document.createElement(_.wg),e=d.dataset;e.name=YU;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);TV(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},TV=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===YU&&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()})},WV=function(a){_.Iv.call(this,a);var b=this;this.g=new _.K(bV);this.m=a;this.L=UV(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new QV(a.getSurface().getUniqueCssClass());this.a=new MV(null,"clpp-text-container",{});this.w=new _.Zu(a.getSurface(),this.Jk.bind(this));this.J=null;this.C?(this.C.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 _.mi(function(){VV(b)});this.A=new Map;this.l=null},UV=function(a){a=_.N.nb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},XV=function(a,b){return a.startTime<=b&&a.endTime>b},VV=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Vq){a.J=c;var d=YV(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,ZV(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Nv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.eh:h="clpp-text-vtt";break;case _.Lg:h=aV;break;case _.aj:h=$U}h&&!g.classList.contains(h)&&_.ur(g,h);g=tV(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{kV({fontSize:$V(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.eh;var l=e.payloadType===_.Lg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new NV(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new yV(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},YV=function(a,b){var c=fV(a.f,function(e){return XV(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&XV(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ XV(a.f[c+1],b);)c++;return{start:d,end:c}},aW=function(a){ZV(a);a.J=null;a.l=null;a.f=[]},ZV=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(aV);b.classList.remove($U);a=a.a;LV(a.h);a.l=[]}},$V=function(a,b){var c=tV(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Xf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Xf;d=a.getFontSizePercent();return Math.round(c*d)+_.Xf},bW=function(){},
18
+ cW=function(){};
19
+ gV.prototype.parse=function(a){a={input:a};for(var b=_.wr(_.fe),c=[],d=b,e;null!==(e=hV(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 h=dW[f];h?(h=_.wr(h),(f=eW[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||fW[g.localName]&&fW[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(jV(e)));return b};var dW={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},eW={v:"voice",lang:"lang"},fW={rt:"ruby"},iV={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};xV.prototype.init=function(){this.j=!0};xV.prototype.A=function(){return!1};_.x(yV,xV);yV.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ yV.prototype.init=function(a){xV.prototype.init.call(this,a);if(this.h)_.ur(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===_.Lg){var c=_.wr(_.fe);c.innerHTML=b.payload;b=c}else b.payloadType===_.eh?b=(new gV).parse(b.payload):(c=_.wr(_.fe),c.textContent=b.payload,b=c);_.ur(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
22
+ c.next();!d.done;d=c.next())_.ur(b,d.value);kV({writingMode:IV(this)},b);this.a.appendChild(b);_.ur(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.ur(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.dj,this.f.line=zV(this)?-1:0);c=IV(this);kV({writingMode:c,webkitWritingMode:c,direction:cV,textAlign:GV(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=FV(this,HV(this));d=EV(this,c,null);var e=DV(this,
23
+ c,null),f=CV(this)&&_.N.R(null)?mV(0,_.Xf):cV;kV({position:"absolute",left:d,right:f,top:e,width:zV(this)?mV(this.f.size,"%"):cV,height:BV(this)||CV(this)?mV(this.f.size,"%"):cV},this.a);d=this.f;a=zV(this)?a.height:a.width;e=AV(this);if(d.lineInterpretation===_.dj)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 _.yd:g-=f/2;break;case _.ye:g-=f}f=Math.round(g/100*a)}CV(this)&&(f=a-f-e);a=f;d=EV(this,c,a);e=CV(this)&&_.N.R(a)?
24
+ mV(0,_.Xf):cV;kV({left:d,right:e,top:DV(this,c,a)},this.a)}lV(this.C,b)}};yV.prototype.o=function(){return _.wr(_.fe)};JV.prototype.append=function(a){var b=a.a;b.style.visibility=_.Ge;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=tV(a.a);var d=KV(this,a.f),e=AV(a),f=sV(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;wV(c,this.a,l)||vV(c,this.a)&&uV(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||vV(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>h&&(g=sV(c),h=l);c=sV(f)}c=g||f}kV({top:mV(c.top-this.a.top,_.Xf),bottom:mV(this.a.a-c.a,_.Xf),left:mV(c.left-this.a.left,_.Xf),right:mV(this.a.f-c.f,_.Xf),height:mV(c.height,_.Xf),width:mV(c.width,_.Xf)},a.a)}b.style.visibility="visible";this.h.push(tV(a.a))};_.x(MV,xV);MV.prototype.init=function(){this.h=new JV(this);this.j=!0};MV.prototype.o=function(){var a=_.wr(_.fe);_.ur(a,this.w);this.id&&(a.id=this.id);return a};MV.prototype.appendChild=function(a){LV(this.h);this.l.unshift(a);a=_.w(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.x(NV,MV);
26
+ NV.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.hj:b=b.width/100*a.width;break a;default:throw Error(ZU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.hj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(ZU);d=a.height;var e=OV(this,d,a.height);kV(this.B,this.a);kV({left:mV(c,_.Xf),top:mV(e,_.Xf),width:mV(b,_.Xf),height:mV(d,_.Xf)},this.a);this.f.writingMode&&kV({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&kV({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.ur(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.hj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new yV(new _.gj(0,1,"Lorem ipsum",_.aj),{},{});c=d.a;this.a.appendChild(c);d.init(tV(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(ZU);
28
+ }a=OV(this,b,a.height);kV({top:mV(a,_.Xf),height:mV(b,_.Xf)},this.a);this.h=new JV(this,!0);this.j=!0};NV.prototype.getId=function(){return this.f.id};QV.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=SV(this,a);if(RV(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
+ QV.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.");_.C(b)})};_.x(WV,_.Iv);_.u=WV.prototype;_.u.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(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=eV(this.f,dV(a));this.l=null;VV(this,!1)}};_.u.Xb=function(){null==this.h||VV(this,!0)};
30
+ _.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();aW(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.C(b)})};_.u.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;VV(this,!0);return!0};_.u.isTextVisible=function(){return this.j};
31
+ _.u.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Kb(.25),this.L.enableResizeObserver&&this.w.start(),VV(this,!0)):(this.G.stop(),this.w.stop(),aW(this)))};_.u.Jk=function(){VV(this,!0)};_.J(bV,WV);WV.prototype.setTextVisibility=WV.prototype.setTextVisibility;WV.prototype.isTextVisible=WV.prototype.isTextVisible;WV.prototype.remove=WV.prototype.remove;WV.prototype.destroy=WV.prototype.destroy;WV.prototype.append=WV.prototype.append;bW.prototype.a=function(a){return!!a.enableHtmlCue&&!_.Nl()};bW.prototype.create=function(a){return new WV(a)};_.x(cW,_.Gu);cW.prototype.f=function(){_.xq(_.He,new bW)};cW.prototype.a=function(){_.vq.has(_.He)&&(_.vq["delete"](_.He),_.wq.info("Removed factory: 'html'"))};cW.prototype.id=function(){return _.yg};_.J("clpp.htmlcue.HtmlCueComponent",cW);};
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,27 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var wU="clpp.ima.AdsManagerFactory",xU=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},yU=function(){},zU=function(a){this.a=a},AU=function(a){var b=a.ge("ima");if(!b)throw Error("IMA plugin not created.");var c=b.td(),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.");this.m=a;this.l=e;a=this.m.getConfiguration();a=_.N.nb(a.ima||{});this.G=_.N.ua({disableCustomPlayback:!1},a);this.L=
3
- c;this.M=d;this.j=b;this.J=new _.$u;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Gk;this.K=!1;this.H=new _.vi;this.P=new yU;this.o=null;this.C=this.A=this.B=!1;this.I=this.w=null;c=this.H;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.cn.bind(this));c.on(this.j,d,this.bn.bind(this));c.on(this.m,_.ye,this.jn.bind(this))},BU=function(a){var b=a.a,c=a.H,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Tm.bind(a));c.on(b,
4
- d.LOADED,a.Rk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.kn.bind(a));c.on(b,d.STARTED,a.Uk.bind(a));c.on(b,d.LOG,a.Xm.bind(a));c.on(b,d.AD_PROGRESS,a.Sk.bind(a));c.on(b,d.AD_BUFFERING,a.Um.bind(a));c.on(b,d.FIRST_QUARTILE,a.Pk.bind(a));c.on(b,d.MIDPOINT,a.Ym.bind(a));c.on(b,d.THIRD_QUARTILE,a.Vk.bind(a));c.on(b,d.PAUSED,a.$m.bind(a));c.on(b,d.RESUMED,a.an.bind(a));c.on(b,d.CLICK,a.Ok.bind(a));c.on(b,d.SKIPPED,a.Tk.bind(a));c.on(b,d.IMPRESSION,a.Qk.bind(a));c.on(b,d.COMPLETE,a.Vm.bind(a));c.on(b,
5
- d.CONTENT_RESUME_REQUESTED,a.ln.bind(a))},CU=function(a){a=a.G;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.md?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
6
- _.md&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},EU=function(a){a.o=null;DU(a,_.Nc);a.m.getSurface().hide(a.L)},FU=function(a){_.ur(a.l,{visibility:"visible"})},DU=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new xU(c,a.B,a.A)});a.m.trigger(new _.L(b,d))},GU=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},HU=function(a){return!1===a.G.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&
7
- _.Mk()},JU=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.M.initialize(),b=!!a.m.getConfiguration().muted,_.y(d,a.J.canPlay(b),2);c=d.f;if(!c&&!HU(a))return DU(a,_.kd),a.g.warn(_.oa),d["return"]();IU(a);_.B(d)})},KU=function(a,b){return _.I(function(c){if(1==c.a)return a.M.initialize(),_.y(c,b.play(),2);IU(a);_.B(c)})},IU=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},LU=function(){this.a=this.h=this.f=null},MU=function(){return!window.google||
8
- !google.ima||!google.ima.AdsLoader},NU=function(){},OU=function(){this.Ca=new _.K(wU)};_.t=xU.prototype;_.t.yb=function(){return"Google IMA SDK"};_.t.zb=function(){return google.ima.VERSION};_.t.Db=function(){return 0};_.t.getId=function(){return this.a.getAdId()};_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.cc=function(){return""};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};
9
- _.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getPosition=function(){return 0};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.gc=function(){return this.f?this.f.getIsBumper():!1};_.t.Ab=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.ff&&typeof b[d].clickThroughUrl===_.tg});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};
10
- _.t.qb=function(){return this.a.getVastMediaWidth()};_.t.pb=function(){return this.a.getVastMediaHeight()};_.t.Xa=function(){return this.a.getVastMediaBitrate()};_.t.Ya=function(){return this.h?2:this.j?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Pb=function(){return this.f?this.f.getTimeOffset():0};_.t.Cb=function(){return this.f?this.f.getAdPosition():1};_.t.rb=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};
11
- _.t.canSeek=function(){return!1};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.t.fc=function(){return null};xU.prototype.getVideoElement=xU.prototype.fc;xU.prototype.getWrapperCreativeIds=xU.prototype.getWrapperCreativeIds;xU.prototype.getWrapperAdSystems=xU.prototype.getWrapperAdSystems;xU.prototype.canSeek=xU.prototype.canSeek;xU.prototype.getWrapperAdIds=xU.prototype.getWrapperAdIds;
12
- xU.prototype.getSequenceLength=xU.prototype.rb;xU.prototype.getPositionInSequence=xU.prototype.Cb;xU.prototype.getPodTimeOffset=xU.prototype.Pb;xU.prototype.getPodIndex=xU.prototype.getPodIndex;xU.prototype.getPodType=xU.prototype.Ya;xU.prototype.getMediaBitrate=xU.prototype.Xa;xU.prototype.getMediaHeight=xU.prototype.pb;xU.prototype.getMediaWidth=xU.prototype.qb;xU.prototype.getMediaUrl=xU.prototype.getMediaUrl;xU.prototype.getClickThroughUrl=xU.prototype.Ab;xU.prototype.isBumper=xU.prototype.gc;
13
- xU.prototype.getSkipTimeOffset=xU.prototype.getSkipTimeOffset;xU.prototype.getPosition=xU.prototype.getPosition;xU.prototype.getDuration=xU.prototype.getDuration;xU.prototype.getTitle=xU.prototype.getTitle;xU.prototype.getAdvertiserName=xU.prototype.getAdvertiserName;xU.prototype.getAdSystem=xU.prototype.getAdSystem;xU.prototype.getApiFramework=xU.prototype.getApiFramework;xU.prototype.getSourceId=xU.prototype.cc;xU.prototype.getCreativeId=xU.prototype.getCreativeId;xU.prototype.getId=xU.prototype.getId;
14
- xU.prototype.getTechnology=xU.prototype.Db;xU.prototype.getAdManagerVersion=xU.prototype.zb;xU.prototype.getAdManagerName=xU.prototype.yb;yU.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}};zU.prototype.getCuePoints=function(){return this.a};zU.prototype.Sb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};zU.prototype.Rb=function(){return 0<=this.a.indexOf(-1)};zU.prototype.hasPostroll=zU.prototype.Rb;zU.prototype.hasPreroll=zU.prototype.Sb;zU.prototype.getCuePoints=zU.prototype.getCuePoints;_.t=AU.prototype;
15
- _.t.cn=function(a){var b=this;this.a=a.getAdsManager(this.l,CU(this));this.a.isCustomPlaybackUsed()&&!HU(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.Dc()):(this.h=new _.Yu(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.w=new zU(a),this.m.trigger(new _.L(_.Qc,{adsTimeline:this.w})),BU(this));this.f.resolve()};
16
- _.t.bn=function(a){GU(this,a.getError());this.f.resolve()};_.t.kn=function(a){var b=this;return _.I(function(c){switch(c.a){case 1:return b.C=!0,HU(b)?(b.I=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.ur(b.l,{visibility:_.Fe});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:DU(b,_.wc,a),b.h.start(),_.B(c)}})};_.t.Tm=function(){var a=this;return _.I(function(b){a.a.start();_.B(b)})};
17
- _.t.Rk=function(a){a.getAd().isLinear()?DU(this,_.Gc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};_.t.Uk=function(a){this.o=a.getAd().getDuration();DU(this,_.Mc,a);this.m.getSurface().show(this.L)};_.t.Xm=function(a){a=a.getAdData();GU(this,a?a.adError:null);EU(this)};_.t.Sk=function(a){DU(this,_.Jc,a)};_.t.Um=function(a){DU(this,_.yc,a)};_.t.Pk=function(a){DU(this,_.Bc,a)};_.t.Ym=function(a){DU(this,_.Hc,a)};_.t.Vk=function(a){DU(this,_.Oc,a)};_.t.$m=function(a){DU(this,_.Ic,a)};
18
- _.t.an=function(a){DU(this,_.Kc,a)};_.t.Ok=function(a){this.pause();DU(this,_.zc,a)};_.t.Tk=function(a){DU(this,_.Lc,a);EU(this)};_.t.Qk=function(a){DU(this,_.Fc,a)};_.t.Vm=function(a){DU(this,_.Ac,a);EU(this)};
19
- _.t.ln=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!HU(a)||null===a.I){if(!a.C)return b["return"](a.m.play());FU(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.Yt(a.m),3);case 3:if(a.A){b.F(2);break}return _.y(b,a.m.seek(a.I),2);case 2:a.C=!1;a.h&&a.h.stop();if(a.A){b.F(6);break}return _.y(b,a.m.play(),6);case 6:DU(a,_.xc),_.B(b)}})};_.t.jn=function(){this.A=!0;this.j.contentComplete()};
20
- _.t.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.G;try{if(typeof c.adTagUrl!==_.tg)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.J.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);
21
- return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Sb()?_.y(c,JU(b),0):_.y(c,KU(b,a),0):_.y(c,a.play(),0)})};_.t.kd=function(){};_.t.gd=function(){return!0};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
22
- _.t.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.t.Dc=function(){this.a&&(this.a.destroy(),this.a=null);FU(this);this.H.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};AU.prototype.getPosition=AU.prototype.getPosition;AU.prototype.setVolume=AU.prototype.setVolume;AU.prototype.getVolume=AU.prototype.getVolume;AU.prototype.skip=AU.prototype.skip;AU.prototype.pause=AU.prototype.pause;AU.prototype.resume=AU.prototype.resume;_.x(LU,_.ew);_.t=LU.prototype;_.t.onPlayerCreated=function(a){if(MU())return a.onError(new _.O(1,9,1E4));this.f=_.sr(_.fe,{"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(_.wa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
23
- _.t.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)};_.t.Zl=function(){return this.a};_.t.Xl=function(){return this.h};_.t.td=function(){return this.f};_.t.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",LU);LU.prototype.getAdContainer=LU.prototype.td;LU.prototype.getAdDisplayContainer=LU.prototype.Xl;LU.prototype.getAdsLoader=LU.prototype.Zl;LU.Id="ima";
24
- LU.isSdkMissing=MU;NU.prototype.create=function(){return new LU};_.bu(new NU);OU.prototype.name=function(){return wU};OU.prototype.a=function(a,b){return a.namespace()===_.Fd?!1:MU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};OU.prototype.create=function(a){return new AU(a)};_.mr(new OU);};
2
+ var f=function(window){var BU="clpp.ima.AdsManagerFactory",CU=function(a,b){return new Promise(function(c){if(a.readyState===HTMLMediaElement.HAVE_NOTHING&&0===a.networkState)c();else b.one(a,"emptied",c)})},DU=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},EU=function(){},FU=function(a){this.a=a},GU=function(a){var b=a.ge("ima");if(!b)throw Error("IMA plugin not created.");var c=b.ud(),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.f=e;a=this.m.getConfiguration();a=_.N.nb(a.ima||{});this.I=_.N.ua({disableCustomPlayback:!1},a);this.L=c;this.M=d;this.o=b;this.J=new _.bv;this.g=new _.K("clpp.ima");this.j=this.a=null;this.h=new _.xk;this.K=!1;this.l=new _.wi;this.P=new EU;this.w=null;this.H=this.B=this.C=!1;this.G=this.A=null;c=this.l;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.bn.bind(this));c.on(this.o,d,this.an.bind(this));c.on(this.m,_.ze,this.hn.bind(this))},
4
+ HU=function(a){var b=a.a,c=a.l,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Sm.bind(a));c.on(b,d.LOADED,a.Nk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.jn.bind(a));c.on(b,d.STARTED,a.Qk.bind(a));c.on(b,d.LOG,a.Wm.bind(a));c.on(b,d.AD_PROGRESS,a.Ok.bind(a));c.on(b,d.AD_BUFFERING,a.Tm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Lk.bind(a));c.on(b,d.MIDPOINT,a.Xm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Rk.bind(a));c.on(b,d.PAUSED,a.Zm.bind(a));c.on(b,d.RESUMED,a.$m.bind(a));c.on(b,d.CLICK,a.Kk.bind(a));c.on(b,
5
+ d.SKIPPED,a.Pk.bind(a));c.on(b,d.IMPRESSION,a.Mk.bind(a));c.on(b,d.COMPLETE,a.Um.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.kn.bind(a))},IU=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.nd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
+ _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.nd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},KU=function(a){a.w=null;JU(a,_.Oc);a.m.getSurface().hide(a.L)},LU=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);_.C(b)})},MU=function(a){return _.I(function(b){return _.y(b,CU(a.f,a.l),0)})},NU=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.l.on(a.f,
7
+ _.Wf,function(){a.m.getState()===_.Uq&&c()})}))})},OU=function(a){_.vr(a.f,{visibility:"visible"})},JU=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new DU(c,a.C,a.B)});a.m.trigger(new _.L(b,d))},PU=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},QU=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()},SU=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.M.initialize(),b=!!a.m.getConfiguration().muted,
8
+ _.y(d,a.J.canPlay(b),2);if(3!=d.a)return c=d.f,c||QU(a)?QU(a)?_.y(d,LU(a),3):d.F(3):(JU(a,_.ld),a.g.warn(_.oa),d["return"]());RU(a);_.C(d)})},TU=function(a,b){return _.I(function(c){if(1==c.a)return a.M.initialize(),_.y(c,b.play(),2);RU(a);_.C(c)})},RU=function(a){a.a.init(a.f.offsetWidth,a.f.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},UU=function(){this.a=this.h=this.f=null},VU=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WU=function(){},XU=function(){this.Ca=
9
+ new _.K(BU)};_.u=DU.prototype;_.u.yb=function(){return"Google IMA SDK"};_.u.zb=function(){return google.ima.VERSION};_.u.Db=function(){return 0};_.u.getId=function(){return this.a.getAdId()};_.u.getCreativeId=function(){return this.a.getCreativeId()};_.u.cc=function(){return""};_.u.getApiFramework=function(){return this.a.getApiFramework()};_.u.getAdSystem=function(){return this.a.getAdSystem()};_.u.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.u.getTitle=function(){return this.a.getTitle()};
10
+ _.u.getDuration=function(){return this.a.getDuration()};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.u.gc=function(){return this.f?this.f.getIsBumper():!1};_.u.Ab=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.gf&&typeof b[d].clickThroughUrl===_.ug});c&&(a=b[c].clickThroughUrl);return a};_.u.getMediaUrl=function(){return this.a.getMediaUrl()};_.u.qb=function(){return this.a.getVastMediaWidth()};
11
+ _.u.pb=function(){return this.a.getVastMediaHeight()};_.u.Xa=function(){return this.a.getVastMediaBitrate()};_.u.Ya=function(){return this.h?2:this.j?1:0};_.u.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.u.Pb=function(){return this.f?this.f.getTimeOffset():0};_.u.Cb=function(){return this.f?this.f.getAdPosition():1};_.u.rb=function(){return this.f?this.f.getTotalAds():1};_.u.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.u.canSeek=function(){return!1};
12
+ _.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.u.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.u.fc=function(){return null};DU.prototype.getVideoElement=DU.prototype.fc;DU.prototype.getWrapperCreativeIds=DU.prototype.getWrapperCreativeIds;DU.prototype.getWrapperAdSystems=DU.prototype.getWrapperAdSystems;DU.prototype.canSeek=DU.prototype.canSeek;DU.prototype.getWrapperAdIds=DU.prototype.getWrapperAdIds;DU.prototype.getSequenceLength=DU.prototype.rb;
13
+ DU.prototype.getPositionInSequence=DU.prototype.Cb;DU.prototype.getPodTimeOffset=DU.prototype.Pb;DU.prototype.getPodIndex=DU.prototype.getPodIndex;DU.prototype.getPodType=DU.prototype.Ya;DU.prototype.getMediaBitrate=DU.prototype.Xa;DU.prototype.getMediaHeight=DU.prototype.pb;DU.prototype.getMediaWidth=DU.prototype.qb;DU.prototype.getMediaUrl=DU.prototype.getMediaUrl;DU.prototype.getClickThroughUrl=DU.prototype.Ab;DU.prototype.isBumper=DU.prototype.gc;DU.prototype.getSkipTimeOffset=DU.prototype.getSkipTimeOffset;
14
+ DU.prototype.getPosition=DU.prototype.getPosition;DU.prototype.getDuration=DU.prototype.getDuration;DU.prototype.getTitle=DU.prototype.getTitle;DU.prototype.getAdvertiserName=DU.prototype.getAdvertiserName;DU.prototype.getAdSystem=DU.prototype.getAdSystem;DU.prototype.getApiFramework=DU.prototype.getApiFramework;DU.prototype.getSourceId=DU.prototype.cc;DU.prototype.getCreativeId=DU.prototype.getCreativeId;DU.prototype.getId=DU.prototype.getId;DU.prototype.getTechnology=DU.prototype.Db;
15
+ DU.prototype.getAdManagerVersion=DU.prototype.zb;DU.prototype.getAdManagerName=DU.prototype.yb;EU.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}};FU.prototype.getCuePoints=function(){return this.a};FU.prototype.Sb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};FU.prototype.Rb=function(){return 0<=this.a.indexOf(-1)};FU.prototype.hasPostroll=FU.prototype.Rb;FU.prototype.hasPreroll=FU.prototype.Sb;FU.prototype.getCuePoints=FU.prototype.getCuePoints;_.u=GU.prototype;
16
+ _.u.bn=function(a){var b=this;this.a=a.getAdsManager(this.f,IU(this));this.a.isCustomPlaybackUsed()&&!QU(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.Ec()):(this.j=new _.Zu(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.A=new FU(a),this.m.trigger(new _.L(_.Rc,{adsTimeline:this.A})),HU(this));this.h.resolve()};
17
+ _.u.an=function(a){PU(this,a.getError());this.h.resolve()};_.u.jn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,QU(b)?(b.G=b.m.getPosition(),_.y(c,LU(b),3)):_.y(c,b.m.pause(),4);if(3!=c.a)return _.vr(b.f,{visibility:_.Ge}),c.F(3);JU(b,_.xc,a);b.j.start();_.C(c)})};_.u.Sm=function(){var a=this;return _.I(function(b){if(1==b.a)return QU(a)?_.y(b,CU(a.f,a.l),2):b.F(2);a.a.start();_.C(b)})};
18
+ _.u.Nk=function(a){a.getAd().isLinear()?JU(this,_.Hc,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.m.play()))};_.u.Qk=function(a){this.w=a.getAd().getDuration();JU(this,_.Nc,a);this.m.getSurface().show(this.L)};_.u.Wm=function(a){a=a.getAdData();PU(this,a?a.adError:null);KU(this)};_.u.Ok=function(a){JU(this,_.Kc,a)};_.u.Tm=function(a){JU(this,_.zc,a)};_.u.Lk=function(a){JU(this,_.Cc,a)};_.u.Xm=function(a){JU(this,_.Ic,a)};_.u.Rk=function(a){JU(this,_.Pc,a)};_.u.Zm=function(a){JU(this,_.Jc,a)};
19
+ _.u.$m=function(a){JU(this,_.Lc,a)};_.u.Kk=function(a){this.pause();JU(this,_.Ac,a)};_.u.Pk=function(a){JU(this,_.Mc,a);KU(this)};_.u.Mk=function(a){JU(this,_.Gc,a)};_.u.Um=function(a){JU(this,_.Bc,a);KU(this)};
20
+ _.u.kn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.C=!0;if(!QU(a)||null===a.G){if(!a.H)return b["return"](a.m.play());OU(a);b.F(2);break}return _.y(b,MU(a),3);case 3:return _.y(b,_.Zt(a.m),4);case 4:if(a.B||!a.G){b.F(2);break}return _.y(b,NU(a),6);case 6:return _.y(b,a.m.seek(a.G),2);case 2:a.H=!1;a.j&&a.j.stop();if(a.B){b.F(8);break}return _.y(b,a.m.play(),8);case 8:JU(a,_.yc),_.C(b)}})};_.u.hn=function(){this.B=!0;this.o.contentComplete()};
21
+ _.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.ug)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.h.resolve(),g["return"](a.h)}return c.adTagUrl?_.y(g,a.J.canPlay(!1),2):(a.h.resolve(),g["return"](a.h))}if(3!=g.a)return d=g.f,_.y(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.getSettings().setAutoPlayAdBreaks(!1);a.o.requestAds(f);
22
+ return g["return"](a.h)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.A&&!b.K?b.A.Sb()?_.y(c,SU(b),0):_.y(c,TU(b,a),0):_.y(c,a.play(),0)})};_.u.kd=function(){};_.u.gd=function(){return!0};_.u.resume=function(){this.a&&this.a.resume()};_.u.pause=function(){this.a&&this.a.pause()};_.u.skip=function(){this.a&&this.a.skip()};_.u.getVolume=function(){return this.a?this.a.getVolume():1};_.u.setVolume=function(a){this.a&&this.a.setVolume(a)};
23
+ _.u.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};_.u.Ec=function(){this.a&&(this.a.destroy(),this.a=null);OU(this);this.l.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()};GU.prototype.getPosition=GU.prototype.getPosition;GU.prototype.setVolume=GU.prototype.setVolume;GU.prototype.getVolume=GU.prototype.getVolume;GU.prototype.skip=GU.prototype.skip;GU.prototype.pause=GU.prototype.pause;GU.prototype.resume=GU.prototype.resume;_.x(UU,_.gw);_.u=UU.prototype;_.u.onPlayerCreated=function(a){if(VU())return a.onError(new _.O(1,9,1E4));this.f=_.tr(_.fe,{"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(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.u.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)};_.u.Wl=function(){return this.a};_.u.Ul=function(){return this.h};_.u.ud=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",UU);UU.prototype.getAdContainer=UU.prototype.ud;UU.prototype.getAdDisplayContainer=UU.prototype.Ul;UU.prototype.getAdsLoader=UU.prototype.Wl;UU.Id="ima";
25
+ UU.isSdkMissing=VU;WU.prototype.create=function(){return new UU};_.cu(new WU);XU.prototype.name=function(){return BU};XU.prototype.a=function(a,b){return a.namespace()===_.Hd?!1:VU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};XU.prototype.create=function(a){return new GU(a)};_.nr(new XU);};
25
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
28
  else{_=this.clpp._;(f.call(g,this));}