@castlabs/prestoplay 6.27.0 → 6.28.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 (67) hide show
  1. package/CHANGELOG.md +19 -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 +113 -112
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +625 -624
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +89 -89
  10. package/cjs/cl.externs.js +80 -72
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +78 -79
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +23 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +347 -347
  18. package/cjs/cl.muxdata.js +14 -15
  19. package/cjs/cl.onboard.js +4 -3
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -17
  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 +38 -38
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +6 -5
  36. package/cl.cast.js +91 -90
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +503 -499
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +83 -82
  41. package/cl.externs.js +80 -72
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +80 -80
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -17
  47. package/cl.mediatailor.js +2 -3
  48. package/cl.mse.js +304 -305
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +4 -4
  51. package/cl.persistent.js +10 -10
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +60 -60
  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 +15 -15
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +31 -29
  64. package/package.json +1 -1
  65. package/typings.d.ts +34 -65
  66. package/cjs/cl.sessions.js +0 -21
  67. package/cl.sessions.js +0 -10
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var xU="CLPP Subtitle Styles",yU="Unsupported unit",zU="clpp-text-plain",AU="clpp-text-ttml",BU="clpp.htmlcue.HtmlTextDisplayer",CU="initial",DU=function(a){return _.Ki(a,{Bh:function(b,c){return b.ra(c)}})},EU=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)},FU=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},GU=function(){},HU=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},JU=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return IU[c]});return a},LU=function(a,b){KU(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){KU(a,c)})},KU=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},MU=function(a,b){return 0===a?"0":a+b},NU=function(a,b){return 1>Math.abs(a-b)||a<b},OU=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},PU=function(a,b){return a>b&&1<Math.abs(a-b)},QU=function(a,b){return 1>Math.abs(a-b)||a>b},RU=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},SU=function(a){return new RU(a.left,a.f,a.top,a.a,a.height,a.width)},TU=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 RU(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},UU=function(a,b){return b.some(function(c){return OU(a.left,c.f)&&PU(a.f,c.left)&&OU(a.top,c.a)&&PU(a.a,c.top)})},VU=function(a,b){return QU(a.top,b.top)&&NU(a.a,b.a)&&QU(a.left,b.left)&&NU(a.f,b.f)},WU=function(a,b,c){switch(c){case "+x":return OU(a.left,b.left);case "-x":return PU(a.f,b.f);
6
- case "+y":return OU(a.top,b.top);case "-y":return PU(a.a,b.a);default:throw Error("Unknown axis");}},XU=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},YU=function(a,b,c){XU.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.F=c},$U=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 ZU(a)?b:c},cV=function(a,b,c){return ZU(a)&&_.N.xa(c)?MU(c,_.Ef):(aV(a)||
7
- bV(a))&&_.N.xa(b)?MU(b,"%"):CU},aV=function(a){return a.f.writingMode===_.Gg},bV=function(a){return a.f.writingMode===_.Ig},ZU=function(a){return a.f.writingMode===_.Oi},dV=function(a,b,c){return(aV(a)||bV(a))&&_.N.xa(c)?MU(c,_.Ef):aV(a)&&_.N.R(c)?MU(0,_.Ef):ZU(a)&&_.N.xa(b)?MU(b,"%"):CU},eV=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ye:return a.f.position;case "auto":case _.hd:return a.f.position-a.f.size/2;case _.ze:return a.f.position-a.f.size}return 0},
8
- fV=function(a){switch(a.f.positionAlign){case _.ye:return _.ve;case "auto":case _.hd:return _.Ni;case _.ze:return _.Of}return a.f.textAlign},gV=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ag:case _.ve:return _.ye;case _.Ni:return _.hd;case _.fe:case _.Of:return _.ze}return a.f.positionAlign},hV=function(a){switch(a.f.writingMode){case _.Oi:return"horizontal-tb";case _.Gg:return _.Gg;case _.Ig:return _.Ig;default:throw Error("Unknown writing mode");}},iV=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=TU(a.a);this.h=[]},jV=function(a,b){if(a.j)switch(b.writingMode){case _.Oi:return["-y"];case _.Gg:return["+x"];case _.Ig:return["-x"]}var c=[];switch(b.writingMode){case _.Oi:c=["+y","-y"];break;case _.Gg:c=["+x","-x"];break;case _.Ig:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},kV=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=TU(a.l.a)},lV=function(a,b,c){XU.call(this,a,b,c);this.h=null;this.l=[]},mV=function(a,b){lV.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},nV=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ti)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(yU);},pV=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=oV(this,this.h);this.f=oV(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},qV=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},rV=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)},oV=function(a,b,c){var d=document.createElement(_.gg),e=d.dataset;e.name=xU;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);sV(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},sV=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===xU&&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()})},vV=function(a){_.xv.call(this,a);var b=this;this.g=new _.K(BU);this.m=a;this.L=tV(a.getConfiguration());this.j=!1;this.f=[];this.F=a.getSurface().getContainer();this.h=new pV(a.getSurface().getUniqueCssClass());this.a=new lV(null,"clpp-text-container",{});this.w=new _.iv(a.getSurface(),this.wk.bind(this));this.J=null;this.F?(this.F.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 _.Xh(function(){uV(b)});this.A=new Map;this.l=null},tV=function(a){a=_.N.hb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},wV=function(a,b){return a.startTime<=b&&a.endTime>b},uV=function(a,b){if((b||a.j)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Zq){a.J=c;var d=xV(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,yV(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Cv(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,h=null;switch(e.payloadType){case _.Rg:h="clpp-text-vtt";break;case _.vg:h=AU;break;case _.Mi:h=zU}h&&!g.classList.contains(h)&&_.yr(g,h);g=TU(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{KU({fontSize:zV(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Rg;var l=e.payloadType===_.vg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new mV(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new YU(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},xV=function(a,b){var c=FU(a.f,function(e){return wV(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&wV(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- wV(a.f[c+1],b);)c++;return{start:d,end:c}},AV=function(a){yV(a);a.J=null;a.l=null;a.f=[]},yV=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(AU);b.classList.remove(zU);a=a.a;kV(a.h);a.l=[]}},zV=function(a,b){var c=TU(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Ef}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Ef;d=a.getFontSizePercent();return Math.round(c*d)+_.Ef},BV=function(){},
18
- CV=function(){};
19
- GU.prototype.parse=function(a){a={input:a};for(var b=_.Ar(_.Od),c=[],d=b,e;null!==(e=HU(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=DV[f];h?(h=_.Ar(h),(f=EV[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||FV[g.localName]&&FV[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(JU(e)));return b};var DV={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},EV={v:"voice",lang:"lang"},FV={rt:"ruby"},IU={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};XU.prototype.init=function(){this.j=!0};XU.prototype.A=function(){return!1};_.w(YU,XU);YU.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- YU.prototype.init=function(a){XU.prototype.init.call(this,a);if(this.h)_.yr(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===_.vg){var c=_.Ar(_.Od);c.innerHTML=b.payload;b=c}else b.payloadType===_.Rg?b=(new GU).parse(b.payload):(c=_.Ar(_.Od),c.textContent=b.payload,b=c);_.yr(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())_.yr(b,d.value);KU({writingMode:hV(this)},b);this.a.appendChild(b);_.yr(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.yr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Pi,this.f.line=ZU(this)?-1:0);c=hV(this);KU({writingMode:c,webkitWritingMode:c,direction:CU,textAlign:fV(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=eV(this,gV(this));d=dV(this,c,null);var e=cV(this,
23
- c,null),f=bV(this)&&_.N.R(null)?MU(0,_.Ef):CU;KU({position:"absolute",left:d,right:f,top:e,width:ZU(this)?MU(this.f.size,"%"):CU,height:aV(this)||bV(this)?MU(this.f.size,"%"):CU},this.a);d=this.f;a=ZU(this)?a.height:a.width;e=$U(this);if(d.lineInterpretation===_.Pi)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 _.hd:g-=f/2;break;case _.fe:g-=f}f=Math.round(g/100*a)}bV(this)&&(f=a-f-e);a=f;d=dV(this,c,a);e=bV(this)&&_.N.R(a)?
24
- MU(0,_.Ef):CU;KU({left:d,right:e,top:cV(this,c,a)},this.a)}LU(this.F,b)}};YU.prototype.o=function(){return _.Ar(_.Od)};iV.prototype.append=function(a){var b=a.a;b.style.visibility=_.ne;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=TU(a.a);var d=jV(this,a.f),e=$U(a),f=SU(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;WU(c,this.a,l)||VU(c,this.a)&&UU(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||VU(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=SU(c),h=l);c=SU(f)}c=g||f}KU({top:MU(c.top-this.a.top,_.Ef),bottom:MU(this.a.a-c.a,_.Ef),left:MU(c.left-this.a.left,_.Ef),right:MU(this.a.f-c.f,_.Ef),height:MU(c.height,_.Ef),width:MU(c.width,_.Ef)},a.a)}b.style.visibility="visible";this.h.push(TU(a.a))};_.w(lV,XU);lV.prototype.init=function(){this.h=new iV(this);this.j=!0};lV.prototype.o=function(){var a=_.Ar(_.Od);_.yr(a,this.w);this.id&&(a.id=this.id);return a};lV.prototype.appendChild=function(a){kV(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(mV,lV);
26
- mV.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ti:b=b.width/100*a.width;break a;default:throw Error(yU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ti)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(yU);d=a.height;var e=nV(this,d,a.height);KU(this.B,this.a);KU({left:MU(c,_.Ef),top:MU(e,_.Ef),width:MU(b,_.Ef),height:MU(d,_.Ef)},this.a);this.f.writingMode&&KU({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&KU({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.yr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ti:b=b.height/100*a.height;break a;case 2:b=b.height;d=new YU(new _.Si(0,1,"Lorem ipsum",_.Mi),{},{});c=d.a;this.a.appendChild(c);d.init(TU(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(yU);
28
- }a=nV(this,b,a.height);KU({top:MU(a,_.Ef),height:MU(b,_.Ef)},this.a);this.h=new iV(this,!0);this.j=!0};mV.prototype.getId=function(){return this.f.id};pV.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=rV(this,a);if(qV(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
- pV.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.");_.z(b)})};_.w(vV,_.xv);_.r=vV.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=EU(this.f,DU(a));this.l=null;uV(this,!1)}};_.r.Sb=function(){null==this.h||uV(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();AV(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.F.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(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;uV(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.Gb(.25),this.L.enableResizeObserver&&this.w.start(),uV(this,!0)):(this.G.stop(),this.w.stop(),AV(this)))};_.r.wk=function(){uV(this,!0)};_.J(BU,vV);vV.prototype.setTextVisibility=vV.prototype.setTextVisibility;vV.prototype.isTextVisible=vV.prototype.isTextVisible;vV.prototype.remove=vV.prototype.remove;vV.prototype.destroy=vV.prototype.destroy;vV.prototype.append=vV.prototype.append;BV.prototype.a=function(a){return!!a.enableHtmlCue&&!_.Mk()};BV.prototype.create=function(a){return new vV(a)};_.w(CV,_.Wu);CV.prototype.f=function(){_.Bq(_.oe,new BV)};CV.prototype.a=function(){_.zq.has(_.oe)&&(_.zq["delete"](_.oe),_.Aq.info("Removed factory: 'html'"))};CV.prototype.id=function(){return _.ig};_.J("clpp.htmlcue.HtmlCueComponent",CV);};
2
+ var f=function(window){var lT="CLPP Subtitle Styles",mT="Unsupported unit",nT="clpp-text-plain",oT="clpp-text-ttml",pT="clpp.htmlcue.HtmlTextDisplayer",qT="initial",rT=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},sT=function(a){return _.Hi(a,{Lh:function(b,c){return b.ra(c)}})},tT=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)},uT=function(){},vT=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},xT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return wT[c]});return a},zT=function(a,b){yT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){yT(a,c)})},yT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},AT=function(a,b){return 0===a?"0":a+b},BT=function(a,b){return 1>Math.abs(a-b)||a<b},CT=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},DT=function(a,b){return a>b&&1<Math.abs(a-b)},ET=function(a,b){return 1>Math.abs(a-b)||a>b},FT=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},GT=function(a){return new FT(a.left,a.f,a.top,a.a,a.height,a.width)},HT=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 FT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},IT=function(a,b){return b.some(function(c){return CT(a.left,c.f)&&DT(a.f,c.left)&&CT(a.top,c.a)&&DT(a.a,c.top)})},JT=function(a,b){return ET(a.top,b.top)&&BT(a.a,b.a)&&ET(a.left,b.left)&&BT(a.f,b.f)},KT=function(a,b,c){switch(c){case "+x":return CT(a.left,b.left);case "-x":return DT(a.f,b.f);
6
+ case "+y":return CT(a.top,b.top);case "-y":return DT(a.a,b.a);default:throw Error("Unknown axis");}},LT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},MT=function(a,b,c){LT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.F=c},OT=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 NT(a)?b:c},RT=function(a,b,c){return NT(a)&&_.M.xa(c)?AT(c,_.If):(PT(a)||
7
+ QT(a))&&_.M.xa(b)?AT(b,"%"):qT},PT=function(a){return a.f.writingMode===_.Kg},QT=function(a){return a.f.writingMode===_.Lg},NT=function(a){return a.f.writingMode===_.sp},ST=function(a,b,c){return(PT(a)||QT(a))&&_.M.xa(c)?AT(c,_.If):PT(a)&&_.M.R(c)?AT(0,_.If):NT(a)&&_.M.xa(b)?AT(b,"%"):qT},TT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ze:return a.f.position;case "auto":case _.gd:return a.f.position-a.f.size/2;case _.Ae:return a.f.position-a.f.size}return 0},
8
+ UT=function(a){switch(a.f.positionAlign){case _.ze:return _.we;case "auto":case _.gd:return _.rp;case _.Ae:return _.Pf}return a.f.textAlign},VT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.cg:case _.we:return _.ze;case _.rp:return _.gd;case _.he:case _.Pf:return _.Ae}return a.f.positionAlign},WT=function(a){switch(a.f.writingMode){case _.sp:return"horizontal-tb";case _.Kg:return _.Kg;case _.Lg:return _.Lg;default:throw Error("Unknown writing mode");}},XT=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=HT(a.a);this.h=[]},YT=function(a,b){if(a.j)switch(b.writingMode){case _.sp:return["-y"];case _.Kg:return["+x"];case _.Lg:return["-x"]}var c=[];switch(b.writingMode){case _.sp:c=["+y","-y"];break;case _.Kg:c=["+x","-x"];break;case _.Lg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},ZT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=HT(a.l.a)},$T=function(a,b,c){LT.call(this,a,b,c);this.h=null;this.l=[]},aU=function(a,b){$T.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},bU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.xp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mT);},dU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=cU(this,this.h);this.f=cU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},eU=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},fU=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)},cU=function(a,b,c){var d=document.createElement(_.ig),e=d.dataset;e.name=lT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);gU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},gU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===lT&&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()})},jU=function(a){_.Cv.call(this,a);var b=this;this.g=new _.L(pT);this.m=a;this.L=hU(a.getConfiguration());this.j=!1;this.f=[];this.F=a.getSurface().getContainer();this.h=new dU(a.getSurface().getUniqueCssClass());this.a=new $T(null,"clpp-text-container",{});this.w=new _.vv(a.getSurface(),this.Jk.bind(this));this.J=null;this.F?(this.F.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 _.dj(function(){iU(b)});this.A=new Map;this.l=null},hU=function(a){a=_.M.ib(a.htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},kU=function(a,b){return a.startTime<=b&&a.endTime>b},iU=function(a,b){if((b||a.j)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=lU(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,mU(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Hv(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,h=null;switch(e.payloadType){case _.Tg:h="clpp-text-vtt";break;case _.yg:h=oT;break;case _.qp:h=nT}h&&!g.classList.contains(h)&&_.Wi(g,h);g=HT(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{yT({fontSize:nU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Tg;var l=e.payloadType===_.yg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new aU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new MT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},lU=function(a,b){var c=rT(a.f,function(e){return kU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&kU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ kU(a.f[c+1],b);)c++;return{start:d,end:c}},oU=function(a){mU(a);a.J=null;a.l=null;a.f=[]},mU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oT);b.classList.remove(nT);a=a.a;ZT(a.h);a.l=[]}},nU=function(a,b){var c=HT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.If}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.If;d=a.getFontSizePercent();return Math.round(c*d)+_.If},pU=function(){},
18
+ qU=function(){};
19
+ uT.prototype.parse=function(a){a={input:a};for(var b=_.Yi(_.Pd),c=[],d=b,e;null!==(e=vT(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=rU[f];h?(h=_.Yi(h),(f=sU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||tU[g.localName]&&tU[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(xT(e)));return b};var rU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},sU={v:"voice",lang:"lang"},tU={rt:"ruby"},wT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};LT.prototype.init=function(){this.j=!0};LT.prototype.A=function(){return!1};_.w(MT,LT);MT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ MT.prototype.init=function(a){LT.prototype.init.call(this,a);if(this.h)_.Wi(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===_.yg){var c=_.Yi(_.Pd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new uT).parse(b.payload):(c=_.Yi(_.Pd),c.textContent=b.payload,b=c);_.Wi(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())_.Wi(b,d.value);yT({writingMode:WT(this)},b);this.a.appendChild(b);_.Wi(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Wi(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.tp,this.f.line=NT(this)?-1:0);c=WT(this);yT({writingMode:c,webkitWritingMode:c,direction:qT,textAlign:UT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=TT(this,VT(this));d=ST(this,c,null);var e=RT(this,
23
+ c,null),f=QT(this)&&_.M.R(null)?AT(0,_.If):qT;yT({position:"absolute",left:d,right:f,top:e,width:NT(this)?AT(this.f.size,"%"):qT,height:PT(this)||QT(this)?AT(this.f.size,"%"):qT},this.a);d=this.f;a=NT(this)?a.height:a.width;e=OT(this);if(d.lineInterpretation===_.tp)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 _.gd:g-=f/2;break;case _.he:g-=f}f=Math.round(g/100*a)}QT(this)&&(f=a-f-e);a=f;d=ST(this,c,a);e=QT(this)&&_.M.R(a)?
24
+ AT(0,_.If):qT;yT({left:d,right:e,top:RT(this,c,a)},this.a)}zT(this.F,b)}};MT.prototype.o=function(){return _.Yi(_.Pd)};XT.prototype.append=function(a){var b=a.a;b.style.visibility=_.pe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=HT(a.a);var d=YT(this,a.f),e=OT(a),f=GT(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;KT(c,this.a,l)||JT(c,this.a)&&IT(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||JT(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=GT(c),h=l);c=GT(f)}c=g||f}yT({top:AT(c.top-this.a.top,_.If),bottom:AT(this.a.a-c.a,_.If),left:AT(c.left-this.a.left,_.If),right:AT(this.a.f-c.f,_.If),height:AT(c.height,_.If),width:AT(c.width,_.If)},a.a)}b.style.visibility="visible";this.h.push(HT(a.a))};_.w($T,LT);$T.prototype.init=function(){this.h=new XT(this);this.j=!0};$T.prototype.o=function(){var a=_.Yi(_.Pd);_.Wi(a,this.w);this.id&&(a.id=this.id);return a};$T.prototype.appendChild=function(a){ZT(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(aU,$T);
26
+ aU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.xp:b=b.width/100*a.width;break a;default:throw Error(mT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.xp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mT);d=a.height;var e=bU(this,d,a.height);yT(this.B,this.a);yT({left:AT(c,_.If),top:AT(e,_.If),width:AT(b,_.If),height:AT(d,_.If)},this.a);this.f.writingMode&&yT({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&yT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Wi(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.xp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new MT(new _.wp(0,1,"Lorem ipsum",_.qp),{},{});c=d.a;this.a.appendChild(c);d.init(HT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(mT);
28
+ }a=bU(this,b,a.height);yT({top:AT(a,_.If),height:AT(b,_.If)},this.a);this.h=new XT(this,!0);this.j=!0};aU.prototype.getId=function(){return this.f.id};dU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=fU(this,a);if(eU(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
+ dU.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.");_.z(b)})};_.w(jU,_.Cv);_.r=jU.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=tT(this.f,sT(a));this.l=null;iU(this,!1)}};_.r.Tb=function(){null==this.h||iU(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();oU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.F.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(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;iU(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.Hb(.25),this.L.enableResizeObserver&&this.w.start(),iU(this,!0)):(this.G.stop(),this.w.stop(),oU(this)))};_.r.Jk=function(){iU(this,!0)};_.K(pT,jU);jU.prototype.setTextVisibility=jU.prototype.setTextVisibility;jU.prototype.isTextVisible=jU.prototype.isTextVisible;jU.prototype.remove=jU.prototype.remove;jU.prototype.destroy=jU.prototype.destroy;jU.prototype.append=jU.prototype.append;pU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.pj()};pU.prototype.create=function(a){return new jU(a)};_.w(qU,_.Tu);qU.prototype.install=function(){_.Mt(_.re,new pU)};qU.prototype.uninstall=function(){_.Kt.has(_.re)&&(_.Kt["delete"](_.re),_.Lt.info("Removed factory: 'html'"))};qU.prototype.id=function(){return _.kg};_.K("clpp.htmlcue.HtmlCueComponent",qU);};
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,28 +1,27 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var cU="clpp.ima.AdsManagerFactory",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.be("ima");if(!b)throw Error("IMA plugin not created.");var c=b.md(),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.hb(a.ima||{});this.I=_.N.ua({disableCustomPlayback:!1},a);this.L=
3
- c;this.N=d;this.j=b;this.J=new _.kv;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.gk;this.K=!1;this.F=new _.gi;this.P=new eU;this.o=null;this.H=this.A=this.B=!1;this.G=this.w=null;c=this.F;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Pm.bind(this));c.on(this.j,d,this.Om.bind(this));c.on(this.m,_.ge,this.Wm.bind(this))},hU=function(a){var b=a.a,c=a.F,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Fm.bind(a));c.on(b,
4
- d.LOADED,a.Ak.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Xm.bind(a));c.on(b,d.STARTED,a.Dk.bind(a));c.on(b,d.LOG,a.Jm.bind(a));c.on(b,d.AD_PROGRESS,a.Bk.bind(a));c.on(b,d.AD_BUFFERING,a.Gm.bind(a));c.on(b,d.FIRST_QUARTILE,a.yk.bind(a));c.on(b,d.MIDPOINT,a.Km.bind(a));c.on(b,d.THIRD_QUARTILE,a.Ek.bind(a));c.on(b,d.PAUSED,a.Mm.bind(a));c.on(b,d.RESUMED,a.Nm.bind(a));c.on(b,d.CLICK,a.xk.bind(a));c.on(b,d.SKIPPED,a.Ck.bind(a));c.on(b,d.IMPRESSION,a.zk.bind(a));c.on(b,d.COMPLETE,a.Hm.bind(a));c.on(b,
5
- d.CONTENT_RESUME_REQUESTED,a.Ym.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===_.Yc?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
- _.Yc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},kU=function(a){a.o=null;jU(a,_.yc);a.m.getSurface().hide(a.L)},lU=function(a){return _.I(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},mU=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.F.on(a.m,_.bg,function(){a.m.getState()===_.Yq&&c()})}))})},nU=function(a){_.zr(a.l,{visibility:"visible"})},
7
- jU=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new dU(c,a.B,a.A)});a.m.trigger(new _.M(b,d))},oU=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},pU=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Fk()||_.Gk()},rU=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.N.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),2);if(3!=d.a)return c=d.f,c||pU(a)?pU(a)?_.x(d,lU(a),3):d.C(3):
8
- (jU(a,_.Wc),a.g.warn(_.na),d["return"]());qU(a);_.z(d)})},sU=function(a,b){return _.I(function(c){if(1==c.a)return a.N.initialize(),_.x(c,b.play(),2);qU(a);_.z(c)})},qU=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},tU=function(){this.a=this.h=this.f=null},uU=function(){return!window.google||!google.ima||!google.ima.AdsLoader},vU=function(){},wU=function(){this.Ca=new _.K(cU)};_.r=dU.prototype;_.r.ub=function(){return"Google IMA SDK"};
9
- _.r.vb=function(){return google.ima.VERSION};_.r.Ab=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Xb=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.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()};
10
- _.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.ac=function(){return this.f?this.f.getIsBumper():!1};_.r.wb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Re&&typeof b[d].clickThroughUrl===_.eg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.kb=function(){return this.a.getVastMediaWidth()};_.r.jb=function(){return this.a.getVastMediaHeight()};
11
- _.r.Va=function(){return this.a.getVastMediaBitrate()};_.r.Wa=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Lb=function(){return this.f?this.f.getTimeOffset():0};_.r.yb=function(){return this.f?this.f.getAdPosition():1};_.r.lb=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()};
12
- _.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.$b=function(){return null};dU.prototype.getVideoElement=dU.prototype.$b;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.lb;dU.prototype.getPositionInSequence=dU.prototype.yb;
13
- dU.prototype.getPodTimeOffset=dU.prototype.Lb;dU.prototype.getPodIndex=dU.prototype.getPodIndex;dU.prototype.getPodType=dU.prototype.Wa;dU.prototype.getMediaBitrate=dU.prototype.Va;dU.prototype.getMediaHeight=dU.prototype.jb;dU.prototype.getMediaWidth=dU.prototype.kb;dU.prototype.getMediaUrl=dU.prototype.getMediaUrl;dU.prototype.getClickThroughUrl=dU.prototype.wb;dU.prototype.isBumper=dU.prototype.ac;dU.prototype.getSkipTimeOffset=dU.prototype.getSkipTimeOffset;dU.prototype.getPosition=dU.prototype.getPosition;
14
- 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.Xb;dU.prototype.getCreativeId=dU.prototype.getCreativeId;dU.prototype.getId=dU.prototype.getId;dU.prototype.getTechnology=dU.prototype.Ab;dU.prototype.getAdManagerVersion=dU.prototype.vb;
15
- dU.prototype.getAdManagerName=dU.prototype.ub;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.Nb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};fU.prototype.Mb=function(){return 0<=this.a.indexOf(-1)};fU.prototype.hasPostroll=fU.prototype.Mb;fU.prototype.hasPreroll=fU.prototype.Nb;fU.prototype.getCuePoints=fU.prototype.getCuePoints;_.r=gU.prototype;
16
- _.r.Pm=function(a){var b=this;this.a=a.getAdsManager(this.l,iU(this));this.a.isCustomPlaybackUsed()&&!pU(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.zc()):(this.h=new _.iv(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 fU(a),this.m.trigger(new _.M(_.Bc,{adsTimeline:this.w})),hU(this));this.f.resolve()};
17
- _.r.Om=function(a){oU(this,a.getError());this.f.resolve()};_.r.Xm=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,pU(b)?(b.G=b.m.getPosition(),_.x(c,lU(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.zr(b.l,{visibility:_.ne}),c.C(3);jU(b,_.gc,a);b.h.start();_.z(c)})};_.r.Fm=function(){var a=this;return _.I(function(b){a.a.start();_.z(b)})};_.r.Ak=function(a){a.getAd().isLinear()?jU(this,_.qc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};
18
- _.r.Dk=function(a){this.o=a.getAd().getDuration();jU(this,_.wc,a);this.m.getSurface().show(this.L)};_.r.Jm=function(a){a=a.getAdData();oU(this,a?a.adError:null);kU(this)};_.r.Bk=function(a){jU(this,_.tc,a)};_.r.Gm=function(a){jU(this,_.ic,a)};_.r.yk=function(a){jU(this,_.lc,a)};_.r.Km=function(a){jU(this,_.rc,a)};_.r.Ek=function(a){jU(this,_.zc,a)};_.r.Mm=function(a){jU(this,_.sc,a)};_.r.Nm=function(a){jU(this,_.uc,a)};_.r.xk=function(a){this.pause();jU(this,_.jc,a)};
19
- _.r.Ck=function(a){jU(this,_.vc,a);kU(this)};_.r.zk=function(a){jU(this,_.pc,a)};_.r.Hm=function(a){jU(this,_.kc,a);kU(this)};
20
- _.r.Ym=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!pU(a)||null===a.G){if(!a.H)return b["return"](a.m.play());nU(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.nu(a.m),3);case 3:if(a.A||!a.G){b.C(2);break}return _.x(b,mU(a),5);case 5:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.A){b.C(7);break}return _.x(b,a.m.play(),7);case 7:jU(a,_.hc),_.z(b)}})};_.r.Wm=function(){this.A=!0;this.j.contentComplete()};
21
- _.r.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!==_.eg)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(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);
22
- return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Nb()?_.x(c,rU(b),0):_.x(c,sU(b,a),0):_.x(c,a.play(),0)})};_.r.fd=function(){};_.r.cd=function(){return!0};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
23
- _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.zc=function(){this.a&&(this.a.destroy(),this.a=null);nU(this);this.F.release();this.h&&(this.h.stop(),this.h=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;_.w(tU,_.Hv);_.r=tU.prototype;_.r.onPlayerCreated=function(a){if(uU())return a.onError(new _.O(1,9,1E4));this.f=_.xr(_.Od,{"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
- _.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.Hl=function(){return this.a};_.r.Fl=function(){return this.h};_.r.md=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",tU);tU.prototype.getAdContainer=tU.prototype.md;tU.prototype.getAdDisplayContainer=tU.prototype.Fl;tU.prototype.getAdsLoader=tU.prototype.Hl;tU.Id="ima";
25
- tU.isSdkMissing=uU;vU.prototype.create=function(){return new tU};_.ru(new vU);wU.prototype.name=function(){return cU};wU.prototype.a=function(a,b){return a.namespace()===_.rd?!1:uU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};wU.prototype.create=function(a){return new gU(a)};_.rr(new wU);};
2
+ var f=function(window){var RS="clpp.ima.AdsManagerFactory",SS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},TS=function(){},US=function(a){this.a=a},VS=function(){this.a=this.h=this.f=null},WS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},XS=function(){},YS=function(a){var b=a.de("ima");if(!b)throw Error("IMA plugin not created.");var c=b.nd(),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.l=e;a=this.m.getConfiguration();a=_.M.ib(a.ima||{});this.I=_.M.ua({disableCustomPlayback:!1},a);this.L=c;this.O=d;this.j=b;this.J=new _.xv;this.g=new _.L("clpp.ima");this.h=this.a=null;this.f=new _.am;this.K=!1;this.F=new _.ti;this.P=new TS;this.o=null;this.H=this.A=this.B=!1;this.G=this.w=null;c=this.F;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ym.bind(this));c.on(this.j,d,this.Xm.bind(this));c.on(this.m,_.ie,this.en.bind(this))},
4
+ ZS=function(a){var b=a.a,c=a.F,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Om.bind(a));c.on(b,d.LOADED,a.Nk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.fn.bind(a));c.on(b,d.STARTED,a.Qk.bind(a));c.on(b,d.LOG,a.Sm.bind(a));c.on(b,d.AD_PROGRESS,a.Ok.bind(a));c.on(b,d.AD_BUFFERING,a.Pm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Lk.bind(a));c.on(b,d.MIDPOINT,a.Tm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Rk.bind(a));c.on(b,d.PAUSED,a.Vm.bind(a));c.on(b,d.RESUMED,a.Wm.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.Qm.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.gn.bind(a))},$S=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===_.Xc?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===_.Xc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},bT=function(a){a.o=null;aT(a,_.xc);a.m.getSurface().hide(a.L)},cT=function(a){return _.I(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},dT=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.F.on(a.m,_.dg,function(){4===a.m.getState()&&
7
+ c()})}))})},eT=function(a){_.Xi(a.l,{visibility:"visible"})},aT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new SS(c,a.B,a.A)});a.m.trigger(new _.Q(b,d))},fT=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},gT=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ij()||_.jj()},iT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.O.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),
8
+ 2);if(3!=d.a)return c=d.f,c||gT(a)?gT(a)?_.x(d,cT(a),3):d.C(3):(aT(a,_.Vc),a.g.warn(_.na),d["return"]());hT(a);_.z(d)})},jT=function(a,b){return _.I(function(c){if(1==c.a)return a.O.initialize(),_.x(c,b.play(),2);hT(a);_.z(c)})},hT=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},kT=function(){this.Ca=new _.L(RS)};_.r=SS.prototype;_.r.vb=function(){return"Google IMA SDK"};_.r.wb=function(){return google.ima.VERSION};_.r.Bb=function(){return 0};
9
+ _.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Yb=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.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()};
10
+ _.r.bc=function(){return this.f?this.f.getIsBumper():!1};_.r.xb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Se&&typeof b[d].clickThroughUrl===_.gg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.lb=function(){return this.a.getVastMediaWidth()};_.r.kb=function(){return this.a.getVastMediaHeight()};_.r.Va=function(){return this.a.getVastMediaBitrate()};_.r.Wa=function(){return this.h?2:this.j?1:0};
11
+ _.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Mb=function(){return this.f?this.f.getTimeOffset():0};_.r.zb=function(){return this.f?this.f.getAdPosition():1};_.r.nb=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.ac=function(){return null};
12
+ SS.prototype.getVideoElement=SS.prototype.ac;SS.prototype.getWrapperCreativeIds=SS.prototype.getWrapperCreativeIds;SS.prototype.getWrapperAdSystems=SS.prototype.getWrapperAdSystems;SS.prototype.canSeek=SS.prototype.canSeek;SS.prototype.getWrapperAdIds=SS.prototype.getWrapperAdIds;SS.prototype.getSequenceLength=SS.prototype.nb;SS.prototype.getPositionInSequence=SS.prototype.zb;SS.prototype.getPodTimeOffset=SS.prototype.Mb;SS.prototype.getPodIndex=SS.prototype.getPodIndex;SS.prototype.getPodType=SS.prototype.Wa;
13
+ SS.prototype.getMediaBitrate=SS.prototype.Va;SS.prototype.getMediaHeight=SS.prototype.kb;SS.prototype.getMediaWidth=SS.prototype.lb;SS.prototype.getMediaUrl=SS.prototype.getMediaUrl;SS.prototype.getClickThroughUrl=SS.prototype.xb;SS.prototype.isBumper=SS.prototype.bc;SS.prototype.getSkipTimeOffset=SS.prototype.getSkipTimeOffset;SS.prototype.getPosition=SS.prototype.getPosition;SS.prototype.getDuration=SS.prototype.getDuration;SS.prototype.getTitle=SS.prototype.getTitle;
14
+ SS.prototype.getAdvertiserName=SS.prototype.getAdvertiserName;SS.prototype.getAdSystem=SS.prototype.getAdSystem;SS.prototype.getApiFramework=SS.prototype.getApiFramework;SS.prototype.getSourceId=SS.prototype.Yb;SS.prototype.getCreativeId=SS.prototype.getCreativeId;SS.prototype.getId=SS.prototype.getId;SS.prototype.getTechnology=SS.prototype.Bb;SS.prototype.getAdManagerVersion=SS.prototype.wb;SS.prototype.getAdManagerName=SS.prototype.vb;TS.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}};US.prototype.getCuePoints=function(){return this.a};US.prototype.Ob=function(){return 0<=this.a.indexOf(0)||0===this.a.length};US.prototype.Nb=function(){return 0<=this.a.indexOf(-1)};US.prototype.hasPostroll=US.prototype.Nb;US.prototype.hasPreroll=US.prototype.Ob;US.prototype.getCuePoints=US.prototype.getCuePoints;_.w(VS,_.Tv);_.r=VS.prototype;_.r.onPlayerCreated=function(a){if(WS())return a.onError(new _.N(1,9,1E4));this.f=_.Vi(_.Pd,{"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)};
15
+ _.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.Ql=function(){return this.a};_.r.Ol=function(){return this.h};_.r.nd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",VS);VS.prototype.getAdContainer=VS.prototype.nd;VS.prototype.getAdDisplayContainer=VS.prototype.Ol;VS.prototype.getAdsLoader=VS.prototype.Ql;VS.Id="ima";
16
+ VS.isSdkMissing=WS;XS.prototype.create=function(){return new VS};_.r=YS.prototype;
17
+ _.r.Ym=function(a){var b=this;this.a=a.getAdsManager(this.l,$S(this));this.a.isCustomPlaybackUsed()&&!gT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Dc()):(this.h=new _.vv(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 US(a),this.m.trigger(new _.Q(_.Ac,{adsTimeline:this.w})),ZS(this));this.f.resolve()};
18
+ _.r.Xm=function(a){fT(this,a.getError());this.f.resolve()};_.r.fn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,gT(b)?(b.G=b.m.getPosition(),_.x(c,cT(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.Xi(b.l,{visibility:_.pe}),c.C(3);aT(b,_.fc,a);b.h.start();_.z(c)})};_.r.Om=function(){var a=this;return _.I(function(b){a.a.start();_.z(b)})};_.r.Nk=function(a){a.getAd().isLinear()?aT(this,_.qc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};
19
+ _.r.Qk=function(a){this.o=a.getAd().getDuration();aT(this,_.wc,a);this.m.getSurface().show(this.L)};_.r.Sm=function(a){a=a.getAdData();fT(this,a?a.adError:null);bT(this)};_.r.Ok=function(a){aT(this,_.tc,a)};_.r.Pm=function(a){aT(this,_.hc,a)};_.r.Lk=function(a){aT(this,_.kc,a)};_.r.Tm=function(a){aT(this,_.rc,a)};_.r.Rk=function(a){aT(this,_.yc,a)};_.r.Vm=function(a){aT(this,_.sc,a)};_.r.Wm=function(a){aT(this,_.uc,a)};_.r.Kk=function(a){this.pause();aT(this,_.ic,a)};
20
+ _.r.Pk=function(a){aT(this,_.vc,a);bT(this)};_.r.Mk=function(a){aT(this,_.pc,a)};_.r.Qm=function(a){aT(this,_.jc,a);bT(this)};
21
+ _.r.gn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!gT(a)||null===a.G){if(!a.H)return b["return"](a.m.play());eT(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Po(a.m),3);case 3:if(a.A||!a.G){b.C(2);break}return _.x(b,dT(a),5);case 5:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.A){b.C(7);break}return _.x(b,a.m.play(),7);case 7:aT(a,_.gc),_.z(b)}})};_.r.en=function(){this.A=!0;this.j.contentComplete()};
22
+ _.r.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!==_.gg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(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);
23
+ return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Ob()?_.x(c,iT(b),0):_.x(c,jT(b,a),0):_.x(c,a.play(),0)})};_.r.gd=function(){};_.r.ed=function(){return!0};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
24
+ _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Dc=function(){this.a&&(this.a.destroy(),this.a=null);eT(this);this.F.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};YS.prototype.getPosition=YS.prototype.getPosition;YS.prototype.setVolume=YS.prototype.setVolume;YS.prototype.getVolume=YS.prototype.getVolume;YS.prototype.skip=YS.prototype.skip;YS.prototype.pause=YS.prototype.pause;YS.prototype.resume=YS.prototype.resume;kT.prototype.name=function(){return RS};kT.prototype.a=function(a,b){return a.namespace()===_.qd?!1:WS()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};kT.prototype.create=function(a){return new YS(a)};_.Zh(new kT);_.To(new XS);};
26
25
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
26
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
27
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var $T=function(){this.g=new _.K("clpp.mediatailor.MediaTailorPlugin")},aU=function(a,b,c){var d,e,f,g,h;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;h={Xi:_.vj(f,b),xp:g?_.vj(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.Xi);return l["return"](h)})},bU=function(){};_.w($T,_.Hv);
3
- $T.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,aU(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.M("mt-session-started")),b.url=e.Xi,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.Q,9,7003,"Media Tailor session failed to initialize.");})};$T.prototype.id=function(){return"mediatailor"};
4
- bU.prototype.create=function(){return new $T};_.ru(new bU);};
2
+ var f=function(window){var OS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},PS=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.qb,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;h={hj:_.qn(f,b),Fp:g?_.qn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.hj);return l["return"](h)})},QS=function(){};_.w(OS,_.Tv);
3
+ OS.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,PS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.hj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};OS.prototype.id=function(){return"mediatailor"};
4
+ QS.prototype.create=function(){return new OS};_.To(new QS);};
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));}