@castlabs/prestoplay 6.6.1-beta.2 → 6.7.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 (59) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +403 -403
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +47 -41
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +68 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mse.js +263 -260
  17. package/cjs/cl.muxdata.js +11 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +70 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +13 -13
  28. package/cjs/cl.vtt.js +11 -11
  29. package/cjs/cl.youbora.js +19 -19
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +345 -343
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +47 -41
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +57 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +17 -16
  44. package/cl.mse.js +227 -227
  45. package/cl.muxdata.js +9 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +10 -10
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -15
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +14 -14
  58. package/package.json +1 -1
  59. package/typings.d.ts +118 -12
package/cjs/cl.htmlcue.js CHANGED
@@ -1,35 +1,35 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var XI="CLPP Subtitle Styles",YI="Unsupported unit",ZI="clpp-text-plain",$I="clpp-text-ttml",aJ="clpp.htmlcue.HtmlTextDisplayer",bJ="initial",cJ=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},dJ=function(){},eJ=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},gJ=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
- function(c){return fJ[c]});return a},iJ=function(a,b){hJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){hJ(a,c)})},hJ=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},jJ=function(a,b){return 0===a?"0":a+b},kJ=function(a,b){return 1>Math.abs(a-b)||a<b},lJ=function(a,b){return a<b&&1<Math.abs(a-b)},mJ=function(a,b){return a>b&&1<Math.abs(a-b)},nJ=function(a,b){return 1>Math.abs(a-b)||a>b},oJ=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=
4
- f},pJ=function(a){return new oJ(a.f,a.g,a.h,a.a,a.height,a.width)},qJ=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"))||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 oJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
- d-e)},rJ=function(a,b){return b.some(function(c){return lJ(a.f,c.g)&&mJ(a.g,c.f)&&lJ(a.h,c.a)&&mJ(a.a,c.h)})},sJ=function(a,b){return nJ(a.h,b.h)&&kJ(a.a,b.a)&&nJ(a.f,b.f)&&kJ(a.g,b.g)},tJ=function(a,b,c){switch(c){case "+x":return lJ(a.f,b.f);case "-x":return mJ(a.g,b.g);case "+y":return lJ(a.h,b.h);case "-y":return mJ(a.a,b.a);default:throw Error("Unknown axis");}},uJ=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},vJ=function(a,b,c){uJ.call(this,a.id,"clpp-text-cue",{});
6
- this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},xJ=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 wJ(a)?b:c},AJ=function(a,b,c){return wJ(a)&&_.K.ka(c)?jJ(c,_.de):(yJ(a)||zJ(a))&&_.K.ka(b)?jJ(b,"%"):bJ},yJ=function(a){return a.f.writingMode===_.Pe},zJ=function(a){return a.f.writingMode===_.Qe},wJ=function(a){return a.f.writingMode===_.vg},BJ=function(a,b,c){return(yJ(a)||zJ(a))&&_.K.ka(c)?jJ(c,_.de):
7
- yJ(a)&&_.K.R(c)?jJ(0,_.de):wJ(a)&&_.K.ka(b)?jJ(b,"%"):bJ},CJ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ud:return a.f.position;case "auto":case _.Cc:return a.f.position-a.f.size/2;case _.vd:return a.f.position-a.f.size}return 0},DJ=function(a){switch(a.f.positionAlign){case _.ud:return _.rd;case "auto":case _.Cc:return _.ug;case _.vd:return _.ke}return a.f.textAlign},EJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.rd:case _.rd:return _.ud;
8
- case _.ug:return _.Cc;case _.ke:case _.ke:return _.vd}return a.f.positionAlign},FJ=function(a){switch(a.f.writingMode){case _.vg:return"horizontal-tb";case _.Pe:return _.Pe;case _.Qe:return _.Qe;default:throw Error("Unknown writing mode");}},GJ=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=qJ(a.a);this.g=[]},HJ=function(a,b){if(a.h)switch(b.writingMode){case _.vg:return["-y"];case _.Pe:return["+x"];case _.Qe:return["-x"]}var c=[];switch(b.writingMode){case _.vg:c=["+y","-y"];break;
9
- case _.Pe:c=["+x","-x"];break;case _.Qe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},IJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=qJ(a.j.a)},JJ=function(a,b,c){uJ.call(this,a,b,c);this.g=null;this.j=[]},KJ=function(a,b){IJ(a.g);a.j.unshift(b);for(var c=_.u(a.j),d=c.next();!d.done;d=c.next())a.g.append(d.value)},LJ=function(a,b){JJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},MJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ag)return a.viewportAnchorY/
10
- 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(YI);},OJ=function(a){this.f=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=NJ(this,this.h);this.g=NJ(this,this.h,!0);this.g.disabled=!0;this.f.debug("Stylesheet CLPP Subtitle Styles has been created.")},PJ=function(a,b){var c=!1;try{a.g.insertRule(b,0);var d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
- e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},QJ=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,c)},NJ=function(a,b,c){var d=document.createElement(_.xe),e=d.dataset;e.name=XI;
12
- e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);RJ(a,b);a.f.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},RJ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===XI&&a.f.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
13
- UJ=function(a){_.dq.call(this,a);var b=this;this.M=new _.H(aJ);this.l=a;this.K=SJ(a);this.h=!1;this.f=[];this.B=a.getSurface().getContainer();this.g=new OJ(a);this.a=new JJ(null,"clpp-text-container",{});this.o=new _.Ap(a.getSurface(),this.oh.bind(this));this.I=null;this.B?(this.B.appendChild(this.a.a),this.a.init(null)):this.M.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.D=new _.Ti(function(){TJ(b)});
14
- this.w=new Map;this.j=null},SJ=function(a){a=_.K.La(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},VJ=function(a,b){return a.startTime<=b&&a.endTime>b},TJ=function(a,b){if((b||a.h)&&a.B){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.mn){a.I=c;var d=WJ(a,c);(c=b)||(c=a.j,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.j=d,XJ(a),d)){c={color:a.getFontColor()||
15
- void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.iq(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(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 _.Ye:h="clpp-text-vtt";break;case _.He:h=$I;break;case _.tg:h=ZI}h&&!g.classList.contains(h)&&_.Jn(g,h);g=qJ(f.a.a);if(0===g.width||0===g.height)f.M.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{hJ({fontSize:YJ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ye;var l=e.payloadType===_.He;e.region&&(h||l||e.backgroundImage)&&(f.w.has(e.region.id)?g=f.w.get(e.region.id):(g=new LJ(e.region,{}),f.w.set(e.region.id,g),KJ(f.a,g)));e=new vJ(e,f.K,c);g?KJ(g,e):KJ(f.a,e)}}}}}},WJ=function(a,b){var c=cJ(a.f,function(e){return VJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&VJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&VJ(a.f[c+1],b);)c++;return{start:d,
17
- end:c}},ZJ=function(a){XJ(a);a.I=null;a.j=null;a.f=[]},XJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove($I);b.classList.remove(ZI);a=a.a;IJ(a.g);a.j=[]}},YJ=function(a,b){var c=qJ(a.a.a).height;if(null!==a.H)return a.getFontSize();if(null!==a.A){var d=a.getFontSizePercent();return Math.round(c*d)+_.de}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.de;d=a.getFontSizePercent();return Math.round(c*d)+_.de},$J=function(){},aK=function(){};
18
- dJ.prototype.parse=function(a){a={input:a};for(var b=_.Ln(_.Yc),c=[],d=b,e;null!==(e=eJ(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=bK[f];h?(h=_.Ln(h),(f=cK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||dK[g.localName]&&dK[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
- d=g)}}else d.appendChild(document.createTextNode(gJ(e)));return b};var bK={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},cK={v:"voice",lang:"lang"},dK={rt:"ruby"},fJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};uJ.prototype.init=function(){this.h=!0};uJ.prototype.w=function(){return!1};_.v(vJ,uJ);vJ.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
- vJ.prototype.init=function(a){uJ.prototype.init.call(this,a);if(this.g)_.Jn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.He){var c=_.Ln(_.Yc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ye?b=(new dJ).parse(b.payload):(c=_.Ln(_.Yc),c.textContent=b.payload,b=c);_.Jn(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
- c.next();!d.done;d=c.next())_.Jn(b,d.value);hJ({writingMode:FJ(this)},b);this.a.appendChild(b);_.Jn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Jn(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.wg,this.f.line=wJ(this)?-1:0);c=FJ(this);hJ({writingMode:c,webkitWritingMode:c,direction:bJ,textAlign:DJ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=CJ(this,EJ(this));d=BJ(this,c,null);var e=AJ(this,
22
- c,null),f=zJ(this)&&_.K.R(null)?jJ(0,_.de):bJ;hJ({position:"absolute",left:d,right:f,top:e,width:wJ(this)?jJ(this.f.size,"%"):bJ,height:yJ(this)||zJ(this)?jJ(this.f.size,"%"):bJ},this.a);d=this.f;a=wJ(this)?a.height:a.width;e=xJ(this);if(d.lineInterpretation===_.wg)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 _.Cc:g-=f/2;break;case _.hd:g-=f}f=Math.round(g/100*a)}zJ(this)&&(f=a-f-e);a=f;d=BJ(this,c,a);e=zJ(this)&&_.K.R(a)?
23
- jJ(0,_.de):bJ;hJ({left:d,right:e,top:AJ(this,c,a)},this.a)}iJ(this.B,b)}};vJ.prototype.m=function(){return _.Ln(_.Yc)};GJ.prototype.append=function(a){var b=a.a;b.style.visibility=_.nd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=qJ(a.a);var d=HJ(this,a.f),e=xJ(a),f=pJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;tJ(c,this.a,l)||sJ(c,this.a)&&rJ(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.h+=n;m.a+=n;break;case "-y":m.h-=n,m.a-=n}}if(this.h||sJ(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
- l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>h&&(g=pJ(c),h=l);c=pJ(f)}c=g||f}hJ({top:jJ(c.h-this.a.h,_.de),bottom:jJ(this.a.a-c.a,_.de),left:jJ(c.f-this.a.f,_.de),right:jJ(this.a.g-c.g,_.de),height:jJ(c.height,_.de),width:jJ(c.width,_.de)},a.a)}b.style.visibility="visible";this.g.push(qJ(a.a))};_.v(JJ,uJ);JJ.prototype.init=function(){this.g=new GJ(this);this.h=!0};JJ.prototype.m=function(){var a=_.Ln(_.Yc);_.Jn(a,this.o);this.id&&(a.id=this.id);return a};_.v(LJ,JJ);
25
- LJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ag:b=b.width/100*a.width;break a;default:throw Error(YI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ag)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(YI);d=a.height;var e=MJ(this,d,a.height);hJ(this.A,this.a);hJ({left:jJ(c,_.de),top:jJ(e,_.de),width:jJ(b,_.de),height:jJ(d,_.de)},this.a);this.f.writingMode&&hJ({display:"flex",
26
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&hJ({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Jn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ag:b=b.height/100*a.height;break a;case 2:b=b.height;d=new vJ(new _.zg(0,1,"Lorem ipsum",_.tg),{},{});c=d.a;this.a.appendChild(c);d.init(qJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(YI);
27
- }a=MJ(this,b,a.height);hJ({top:jJ(a,_.de),height:jJ(b,_.de)},this.a);this.g=new GJ(this,!0);this.h=!0};LJ.prototype.getId=function(){return this.f.id};OJ.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=QJ(this,a);if(PJ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug("Added CSS rule "+b)}catch(c){this.f.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.f.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
- OJ.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.f.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.v(UJ,_.dq);_.t=UJ.prototype;
29
- _.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={nd:c.nd},e=d.next())c.nd=e.value,this.f.some(function(f){return function(g){var h=f.nd;return g.payload!==h.payload?!1:
30
- g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.nd);this.j=null;TJ(this,!1)}};_.t.ob=function(){null==this.g||TJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();ZJ(a);a.D.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.B.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
31
- _.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.j=null;TJ(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.D.ab(.25),this.K.enableResizeObserver&&this.o.start(),TJ(this,!0)):(this.D.stop(),this.o.stop(),ZJ(this)))};_.t.oh=function(){TJ(this,!0)};_.C(aJ,UJ);UJ.prototype.setTextVisibility=UJ.prototype.setTextVisibility;
32
- UJ.prototype.isTextVisible=UJ.prototype.isTextVisible;UJ.prototype.remove=UJ.prototype.remove;UJ.prototype.destroy=UJ.prototype.destroy;UJ.prototype.append=UJ.prototype.append;$J.prototype.ba=function(a){return!!a.enableHtmlCue&&!_.bj()};$J.prototype.create=function(a){return new UJ(a)};_.v(aK,_.Ko);aK.prototype.Ga=function(){_.Lm("html",new $J)};aK.prototype.Ba=function(){};aK.prototype.id=function(){return _.ze};_.C("clpp.htmlcue.HtmlCueComponent",aK);};
2
+ var f=function(window){var FJ="CLPP Subtitle Styles",GJ="Unsupported unit",HJ="clpp-text-plain",IJ="clpp-text-ttml",JJ="clpp.htmlcue.HtmlTextDisplayer",KJ="initial",LJ=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},MJ=function(){},NJ=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},PJ=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
+ function(c){return OJ[c]});return a},RJ=function(a,b){QJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){QJ(a,c)})},QJ=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},SJ=function(a,b){return 0===a?"0":a+b},TJ=function(a,b){return 1>Math.abs(a-b)||a<b},UJ=function(a,b){return a<b&&1<Math.abs(a-b)},VJ=function(a,b){return a>b&&1<Math.abs(a-b)},WJ=function(a,b){return 1>Math.abs(a-b)||a>b},XJ=function(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=
4
+ f},YJ=function(a){return new XJ(a.f,a.g,a.j,a.a,a.height,a.width)},ZJ=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"))||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 XJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
+ d-e)},$J=function(a,b){return b.some(function(c){return UJ(a.f,c.g)&&VJ(a.g,c.f)&&UJ(a.j,c.a)&&VJ(a.a,c.j)})},aK=function(a,b){return WJ(a.j,b.j)&&TJ(a.a,b.a)&&WJ(a.f,b.f)&&TJ(a.g,b.g)},bK=function(a,b,c){switch(c){case "+x":return UJ(a.f,b.f);case "-x":return VJ(a.g,b.g);case "+y":return UJ(a.j,b.j);case "-y":return VJ(a.a,b.a);default:throw Error("Unknown axis");}},cK=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},dK=function(a,b,c){cK.call(this,a.id,"clpp-text-cue",{});
6
+ this.m=b;this.f=a;this.g=!!this.f.backgroundImage;this.D=c},fK=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 eK(a)?b:c},iK=function(a,b,c){return eK(a)&&_.K.la(c)?SJ(c,_.de):(gK(a)||hK(a))&&_.K.la(b)?SJ(b,"%"):KJ},gK=function(a){return a.f.writingMode===_.Pe},hK=function(a){return a.f.writingMode===_.Qe},eK=function(a){return a.f.writingMode===_.vg},jK=function(a,b,c){return(gK(a)||hK(a))&&_.K.la(c)?SJ(c,_.de):
7
+ gK(a)&&_.K.R(c)?SJ(0,_.de):eK(a)&&_.K.la(b)?SJ(b,"%"):KJ},kK=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ud:return a.f.position;case "auto":case _.Ec:return a.f.position-a.f.size/2;case _.vd:return a.f.position-a.f.size}return 0},lK=function(a){switch(a.f.positionAlign){case _.ud:return _.rd;case "auto":case _.Ec:return _.ug;case _.vd:return _.ke}return a.f.textAlign},mK=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.rd:case _.rd:return _.ud;
8
+ case _.ug:return _.Ec;case _.ke:case _.ke:return _.vd}return a.f.positionAlign},nK=function(a){switch(a.f.writingMode){case _.vg:return"horizontal-tb";case _.Pe:return _.Pe;case _.Qe:return _.Qe;default:throw Error("Unknown writing mode");}},oK=function(a,b){this.m=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=ZJ(a.a);this.g=[]},pK=function(a,b){if(a.j)switch(b.writingMode){case _.vg:return["-y"];case _.Pe:return["+x"];case _.Qe:return["-x"]}var c=[];switch(b.writingMode){case _.vg:c=["+y","-y"];break;
9
+ case _.Pe:c=["+x","-x"];break;case _.Qe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},qK=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=ZJ(a.m.a)},rK=function(a,b,c){cK.call(this,a,b,c);this.g=null;this.m=[]},sK=function(a,b){qK(a.g);a.m.unshift(b);for(var c=_.u(a.m),d=c.next();!d.done;d=c.next())a.g.append(d.value)},tK=function(a,b){rK.call(this,a.id,"clpp-text-cue-region",b);this.f=a},uK=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ag)return a.viewportAnchorY/
10
+ 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(GJ);},wK=function(a){this.h=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.g=a.getSurface().getUniqueCssClass();this.j=[];this.a=vK(this,this.g);this.f=vK(this,this.g,!0);this.f.disabled=!0;this.h.debug("Stylesheet CLPP Subtitle Styles has been created.")},xK=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
+ e.trim().indexOf("."+a.g+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},yK=function(a,b){var c="."+a.g+" .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,c)},vK=function(a,b,c){var d=document.createElement(_.xe),e=d.dataset;e.name=FJ;
12
+ e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);zK(a,b);a.h.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},zK=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===FJ&&a.h.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
13
+ CK=function(a){_.dq.call(this,a);var b=this;this.h=new _.H(JJ);this.l=a;this.M=AK(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.g=new wK(a);this.a=new rK(null,"clpp-text-container",{});this.w=new _.Ap(a.getSurface(),this.Yh.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=new _.aj(function(){BK(b)});
14
+ this.A=new Map;this.m=null},AK=function(a){a=_.K.Qa(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},DK=function(a,b){return a.startTime<=b&&a.endTime>b},BK=function(a,b){if((b||a.j)&&a.D){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.mn){a.J=c;var d=EK(a,c);(c=b)||(c=a.m,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.m=d,FK(a),d)){c={color:a.getFontColor()||
15
+ void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.iq(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(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 _.Ye:h="clpp-text-vtt";break;case _.He:h=IJ;break;case _.tg:h=HJ}h&&!g.classList.contains(h)&&_.Jn(g,h);g=ZJ(f.a.a);if(0===g.width||0===g.height)f.h.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{QJ({fontSize:GK(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ye;var l=e.payloadType===_.He;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new tK(e.region,{}),f.A.set(e.region.id,g),sK(f.a,g)));e=new dK(e,f.M,c);g?sK(g,e):sK(f.a,e)}}}}}},EK=function(a,b){var c=LJ(a.f,function(e){return DK(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&DK(a.f[d-1],b);)d--;for(;c+1<a.f.length&&DK(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},HK=function(a){FK(a);a.J=null;a.m=null;a.f=[]},FK=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(IJ);b.classList.remove(HJ);a=a.a;qK(a.g);a.m=[]}},GK=function(a,b){var c=ZJ(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.de}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.de;d=a.getFontSizePercent();return Math.round(c*d)+_.de},IK=function(){},JK=function(){};
18
+ MJ.prototype.parse=function(a){a={input:a};for(var b=_.Ln(_.$c),c=[],d=b,e;null!==(e=NJ(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=KK[f];h?(h=_.Ln(h),(f=LK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||MK[g.localName]&&MK[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
+ d=g)}}else d.appendChild(document.createTextNode(PJ(e)));return b};var KK={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},LK={v:"voice",lang:"lang"},MK={rt:"ruby"},OJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};cK.prototype.init=function(){this.j=!0};cK.prototype.A=function(){return!1};_.w(dK,cK);dK.prototype.A=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
+ dK.prototype.init=function(a){cK.prototype.init.call(this,a);if(this.g)_.Jn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.m.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.He){var c=_.Ln(_.$c);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ye?b=(new MJ).parse(b.payload):(c=_.Ln(_.$c),c.textContent=b.payload,b=c);_.Jn(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.Jn(b,d.value);QJ({writingMode:nK(this)},b);this.a.appendChild(b);_.Jn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Jn(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.wg,this.f.line=eK(this)?-1:0);c=nK(this);QJ({writingMode:c,webkitWritingMode:c,direction:KJ,textAlign:lK(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=kK(this,mK(this));d=jK(this,c,null);var e=iK(this,
22
+ c,null),f=hK(this)&&_.K.R(null)?SJ(0,_.de):KJ;QJ({position:"absolute",left:d,right:f,top:e,width:eK(this)?SJ(this.f.size,"%"):KJ,height:gK(this)||hK(this)?SJ(this.f.size,"%"):KJ},this.a);d=this.f;a=eK(this)?a.height:a.width;e=fK(this);if(d.lineInterpretation===_.wg)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 _.Ec:g-=f/2;break;case _.hd:g-=f}f=Math.round(g/100*a)}hK(this)&&(f=a-f-e);a=f;d=jK(this,c,a);e=hK(this)&&_.K.R(a)?
23
+ SJ(0,_.de):KJ;QJ({left:d,right:e,top:iK(this,c,a)},this.a)}RJ(this.D,b)}};dK.prototype.o=function(){return _.Ln(_.$c)};oK.prototype.append=function(a){var b=a.a;b.style.visibility=_.nd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=ZJ(a.a);var d=pK(this,a.f),e=fK(a),f=YJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;bK(c,this.a,l)||aK(c,this.a)&&$J(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.j+=n;m.a+=n;break;case "-y":m.j-=n,m.a-=n}}if(this.j||aK(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
+ l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.j,l.j))/(c.height*c.width);l>h&&(g=YJ(c),h=l);c=YJ(f)}c=g||f}QJ({top:SJ(c.j-this.a.j,_.de),bottom:SJ(this.a.a-c.a,_.de),left:SJ(c.f-this.a.f,_.de),right:SJ(this.a.g-c.g,_.de),height:SJ(c.height,_.de),width:SJ(c.width,_.de)},a.a)}b.style.visibility="visible";this.g.push(ZJ(a.a))};_.w(rK,cK);rK.prototype.init=function(){this.g=new oK(this);this.j=!0};rK.prototype.o=function(){var a=_.Ln(_.$c);_.Jn(a,this.w);this.id&&(a.id=this.id);return a};_.w(tK,rK);
25
+ tK.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ag:b=b.width/100*a.width;break a;default:throw Error(GJ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ag)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(GJ);d=a.height;var e=uK(this,d,a.height);QJ(this.B,this.a);QJ({left:SJ(c,_.de),top:SJ(e,_.de),width:SJ(b,_.de),height:SJ(d,_.de)},this.a);this.f.writingMode&&QJ({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&QJ({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Jn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ag:b=b.height/100*a.height;break a;case 2:b=b.height;d=new dK(new _.zg(0,1,"Lorem ipsum",_.tg),{},{});c=d.a;this.a.appendChild(c);d.init(ZJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(GJ);
27
+ }a=uK(this,b,a.height);QJ({top:SJ(a,_.de),height:SJ(b,_.de)},this.a);this.g=new oK(this,!0);this.j=!0};tK.prototype.getId=function(){return this.f.id};wK.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=yK(this,a);if(xK(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug("Added CSS rule "+b)}catch(c){this.h.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.h.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ wK.prototype.destroy=function(){var a=this;return _.B(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.h.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.w(CK,_.dq);_.t=CK.prototype;
29
+ _.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={wd:c.wd},e=d.next())c.wd=e.value,this.f.some(function(f){return function(g){var h=f.wd;return g.payload!==h.payload?!1:
30
+ g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.wd);this.m=null;BK(this,!1)}};_.t.rb=function(){null==this.g||BK(this,!0)};_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a){if(null==a.g)return b["return"]();HK(a);a.F.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(b)})};
31
+ _.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.m=null;BK(this,!0);return!0};_.t.isTextVisible=function(){return this.j};_.t.setTextVisibility=function(a){null!=this.g&&this.j!==a&&((this.j=a)?(this.F.eb(.25),this.M.enableResizeObserver&&this.w.start(),BK(this,!0)):(this.F.stop(),this.w.stop(),HK(this)))};_.t.Yh=function(){BK(this,!0)};_.C(JJ,CK);CK.prototype.setTextVisibility=CK.prototype.setTextVisibility;
32
+ CK.prototype.isTextVisible=CK.prototype.isTextVisible;CK.prototype.remove=CK.prototype.remove;CK.prototype.destroy=CK.prototype.destroy;CK.prototype.append=CK.prototype.append;IK.prototype.$=function(a){return!!a.enableHtmlCue&&!_.jj()};IK.prototype.create=function(a){return new CK(a)};_.w(JK,_.Ko);JK.prototype.Ma=function(){_.Lm("html",new IK)};JK.prototype.Fa=function(){};JK.prototype.id=function(){return _.ze};_.C("clpp.htmlcue.HtmlCueComponent",JK);};
33
33
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
34
34
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
35
35
  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 FI="clpp.ima.AdsManagerFactory",GI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},HI=function(){},II=function(a){this.a=a},JI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.K.La(a.ima||{});this.m=this.l.$b("ima").Dc();this.J=this.l.$b("ima").g;this.o=this.l.$b("ima").a;this.H=new _.Cp;this.P=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Th;this.F=!1;this.w=new _.eg;this.S=new HI;this.A=null;this.I=this.D=this.M=this.B=!1;this.g=
3
- null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Oi.bind(this));a.on(this.o,b,this.Ni.bind(this));a.one(this.j,_.id,this.Vi.bind(this))},KI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.sh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Wi.bind(a));c.on(b,d.STARTED,a.uh.bind(a));c.on(b,d.LOG,a.Hi.bind(a));c.on(b,d.AD_PROGRESS,a.Li.bind(a));c.on(b,d.AD_BUFFERING,a.Ei.bind(a));c.on(b,d.FIRST_QUARTILE,
4
- a.qh.bind(a));c.on(b,d.MIDPOINT,a.Ii.bind(a));c.on(b,d.THIRD_QUARTILE,a.vh.bind(a));c.on(b,d.PAUSED,a.Ki.bind(a));c.on(b,d.RESUMED,a.Mi.bind(a));c.on(b,d.CLICK,a.ph.bind(a));c.on(b,d.SKIPPED,a.th.bind(a));c.on(b,d.IMPRESSION,a.rh.bind(a));c.on(b,d.COMPLETE,a.Fi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Xi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Qi.bind(a))},LI=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=
5
- a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.tc?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===_.tc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},NI=function(a){a.A=null;MI(a,_.Ub);a.m&&a.l.getSurface().hide(a.m)},OI=
6
- function(a){_.Kn(a.j,{visibility:"visible"})},MI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new GI(c,a.B,a.M)});a.l.trigger(new _.I(b,d))},PI=function(a,b){var c=b?a.S.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},RI=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.x(d,a.H.canPlay(b),2);c=d.f;if(!c)return MI(a,_.rc),a.P.warn(_.la),d["return"]();QI(a);_.z(d)})},SI=function(a,b){return _.A(function(c){if(1==
7
- c.a)return a.J.initialize(),_.x(c,b.play(),2);QI(a);_.z(c)})},QI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},TI=function(){this.a=this.g=this.f=null},UI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},VI=function(){},WI=function(){this.a=new _.H(FI)};_.t=GI.prototype;_.t.rb=function(){return"Google IMA SDK"};_.t.sb=function(){return google.ima.VERSION};_.t.xb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};
8
- _.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.dc=function(){return this.f?this.f.getIsBumper():!1};
9
- _.t.Jb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ld&&typeof b[d].clickThroughUrl===_.ve});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.ub=function(){return this.a.getVastMediaWidth()};_.t.tb=function(){return this.a.getVastMediaHeight()};_.t.gb=function(){return this.a.getVastMediaBitrate()};_.t.Ua=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
10
- _.t.Kb=function(){return this.f?this.f.getTimeOffset():0};_.t.Lb=function(){return this.f?this.f.getAdPosition():1};_.t.wb=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};GI.prototype.getWrapperCreativeIds=GI.prototype.getWrapperCreativeIds;GI.prototype.getWrapperAdSystems=GI.prototype.getWrapperAdSystems;
11
- GI.prototype.getWrapperAdIds=GI.prototype.getWrapperAdIds;GI.prototype.getSequenceLength=GI.prototype.wb;GI.prototype.getPositionInSequence=GI.prototype.Lb;GI.prototype.getPodTimeOffset=GI.prototype.Kb;GI.prototype.getPodIndex=GI.prototype.getPodIndex;GI.prototype.getPodType=GI.prototype.Ua;GI.prototype.getMediaBitrate=GI.prototype.gb;GI.prototype.getMediaHeight=GI.prototype.tb;GI.prototype.getMediaWidth=GI.prototype.ub;GI.prototype.getMediaUrl=GI.prototype.getMediaUrl;
12
- GI.prototype.getClickThroughUrl=GI.prototype.Jb;GI.prototype.isBumper=GI.prototype.dc;GI.prototype.getSkipTimeOffset=GI.prototype.getSkipTimeOffset;GI.prototype.getDuration=GI.prototype.getDuration;GI.prototype.getTitle=GI.prototype.getTitle;GI.prototype.getAdvertiserName=GI.prototype.getAdvertiserName;GI.prototype.getAdSystem=GI.prototype.getAdSystem;GI.prototype.getApiFramework=GI.prototype.getApiFramework;GI.prototype.getCreativeId=GI.prototype.getCreativeId;GI.prototype.getId=GI.prototype.getId;
13
- GI.prototype.getTechnology=GI.prototype.xb;GI.prototype.getAdManagerVersion=GI.prototype.sb;GI.prototype.getAdManagerName=GI.prototype.rb;HI.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}};II.prototype.getCuePoints=function(){return this.a};II.prototype.Mb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};II.prototype.hb=function(){return 0<=this.a.indexOf(-1)};II.prototype.hasPostroll=II.prototype.hb;II.prototype.hasPreroll=II.prototype.Mb;II.prototype.getCuePoints=II.prototype.getCuePoints;_.t=JI.prototype;
14
- _.t.Oi=function(a){var b=this;this.a=a.getAdsManager(this.j,LI(this));this.a.isCustomPlaybackUsed()?(this.P.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.h=new _.Ap(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new II(a),this.l.trigger(new _.I(_.Xb,{adsTimeline:this.g})),KI(this));this.f.resolve()};
15
- _.t.Ni=function(a){PI(this,a.getError());this.f.resolve()};_.t.Wi=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.D=!0,_.x(c,b.l.pause(),2);_.Kn(b.j,{visibility:_.nd});MI(b,_.Gb,a);b.h.start();_.z(c)})};_.t.sh=function(a){a.getAd().isLinear()?MI(this,_.Nb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.uh=function(a){this.A=a.getAd().getDuration();MI(this,_.Tb,a);this.l.getSurface().show(this.m)};_.t.Hi=function(a){a=a.getAdData();PI(this,a?a.adError:null);NI(this)};
16
- _.t.Li=function(a){MI(this,_.Qb,a)};_.t.Ei=function(a){MI(this,_.Ib,a)};_.t.qh=function(a){MI(this,_.Lb,a)};_.t.Ii=function(a){MI(this,_.Ob,a)};_.t.vh=function(a){MI(this,_.Vb,a)};_.t.Ki=function(a){MI(this,_.Pb,a)};_.t.Mi=function(a){MI(this,_.Rb,a)};_.t.ph=function(a){this.pause();MI(this,_.Jb,a)};_.t.th=function(a){MI(this,_.Sb,a);NI(this)};_.t.rh=function(a){MI(this,_.Mb,a)};_.t.Fi=function(a){MI(this,_.Kb,a);NI(this)};
17
- _.t.Xi=function(){this.B=!0;if(!this.D)return this.l.play();this.D=!1;this.h.stop();this.l.isEnded()||this.l.play();MI(this,_.Hb);OI(this)};_.t.Qi=function(){this.I=!0};_.t.Vi=function(){this.M=!0;this.o.contentComplete()};
18
- _.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.ve)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.H.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.H.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
19
- _.t.start=function(a){var b=this;return _.A(function(c){return b.a&&b.g&&!b.F?b.g.Mb()?_.x(c,RI(b),0):_.x(c,SI(b,a),0):_.x(c,a.play(),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)};
20
- _.t.getPosition=function(){if(!this.a||null===this.A)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.A-a};
21
- _.t.dispose=function(){var a=this;return(new Promise(function(b){a.F&&a.g&&a.g.hb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.fg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.o.contentComplete()})).then(function(){OI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};JI.prototype.getPosition=JI.prototype.getPosition;
22
- JI.prototype.setVolume=JI.prototype.setVolume;JI.prototype.getVolume=JI.prototype.getVolume;JI.prototype.skip=JI.prototype.skip;JI.prototype.pause=JI.prototype.pause;JI.prototype.resume=JI.prototype.resume;_.v(TI,_.nq);_.t=TI.prototype;_.t.onPlayerCreated=function(a){if(UI())return a.onError(new _.L(1,9,1E4));this.f=_.In(_.Yc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.sa);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
23
- _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.gi=function(){return this.a};_.t.ei=function(){return this.g};_.t.Dc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",TI);TI.prototype.getAdContainer=TI.prototype.Dc;TI.prototype.getAdDisplayContainer=TI.prototype.ei;TI.prototype.getAdsLoader=TI.prototype.gi;TI.Id="ima";
24
- TI.isSdkMissing=UI;VI.prototype.create=function(){return new TI};_.Fo(new VI);WI.prototype.name=function(){return FI};WI.prototype.ba=function(a,b){return a.namespace()===_.Ic?!1:UI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};WI.prototype.create=function(a){return new JI(a)};WI.prototype.create=WI.prototype.create;WI.prototype.isSupported=WI.prototype.ba;WI.prototype.name=WI.prototype.name;_.Fn(new WI);};
2
+ var f=function(window){var mJ="clpp.ima.AdsManagerFactory",nJ=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c},oJ=function(){},pJ=function(a){this.a=a},qJ=function(a){this.l=a;this.A=a.getSurface().getMedia();a=this.l.getConfiguration();this.I=_.K.Qa(a.ima||{});this.o=this.l.cc("ima").Jc();this.P=this.l.cc("ima").g;this.m=this.l.cc("ima").a;this.K=new _.Cp;this.h=new _.H("clpp.ima");this.g=this.a=null;this.f=new _.di;this.H=!1;this.w=new _.eg;this.V=new oJ;this.B=null;this.M=this.F=this.T=this.D=!1;this.J=
3
+ this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Tj.bind(this));a.on(this.m,b,this.Sj.bind(this));a.on(this.l,_.se,this.fi.bind(this))},rJ=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Ij.bind(a));c.on(b,d.LOADED,a.bi.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.$j.bind(a));c.on(b,d.STARTED,a.di.bind(a));c.on(b,d.LOG,a.Mj.bind(a));c.on(b,d.AD_PROGRESS,a.Qj.bind(a));c.on(b,d.AD_BUFFERING,
4
+ a.Jj.bind(a));c.on(b,d.FIRST_QUARTILE,a.$h.bind(a));c.on(b,d.MIDPOINT,a.Nj.bind(a));c.on(b,d.THIRD_QUARTILE,a.ei.bind(a));c.on(b,d.PAUSED,a.Pj.bind(a));c.on(b,d.RESUMED,a.Rj.bind(a));c.on(b,d.CLICK,a.Zh.bind(a));c.on(b,d.SKIPPED,a.ci.bind(a));c.on(b,d.IMPRESSION,a.ai.bind(a));c.on(b,d.COMPLETE,a.Kj.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ak.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Vj.bind(a))},sJ=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=
5
+ !1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.vc?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===_.vc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},uJ=function(a){a.B=null;tJ(a,_.Wb);
6
+ a.o&&a.l.getSurface().hide(a.o)},vJ=function(a){_.Kn(a.A,{visibility:"visible"})},tJ=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new nJ(c,a.D,a.T)});a.l.trigger(new _.I(b,d))},wJ=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},xJ=function(a){return a.a.isCustomPlaybackUsed()&&!1===a.I.disableCustomPlayback&&(_.ki()||_.li())},zJ=function(a){var b,c;return _.B(function(d){if(1==d.a)return a.P.initialize(),b=!!a.l.getConfiguration().muted,
7
+ _.x(d,a.K.canPlay(b),2);c=d.f;if(!c&&!xJ(a))return tJ(a,_.tc),a.h.warn(_.ka),d["return"]();yJ(a);_.z(d)})},AJ=function(a,b){return _.B(function(c){if(1==c.a)return a.P.initialize(),_.x(c,b.play(),2);yJ(a);_.z(c)})},yJ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.H=!0},BJ=function(){this.a=this.g=this.f=null},CJ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},DJ=function(){},EJ=function(){this.a=new _.H(mJ)};_.t=nJ.prototype;_.t.ub=function(){return"Google IMA SDK"};
8
+ _.t.vb=function(){return google.ima.VERSION};_.t.Ab=function(){return 0};_.t.getId=function(){return this.a.getAdId()};_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};
9
+ _.t.gc=function(){return this.f?this.f.getIsBumper():!1};_.t.Nb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ld&&typeof b[d].clickThroughUrl===_.ve});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.xb=function(){return this.a.getVastMediaWidth()};_.t.wb=function(){return this.a.getVastMediaHeight()};_.t.jb=function(){return this.a.getVastMediaBitrate()};_.t.Ya=function(){return this.g?2:this.j?1:0};
10
+ _.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Ob=function(){return this.f?this.f.getTimeOffset():0};_.t.Pb=function(){return this.f?this.f.getAdPosition():1};_.t.zb=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};nJ.prototype.getWrapperCreativeIds=nJ.prototype.getWrapperCreativeIds;
11
+ nJ.prototype.getWrapperAdSystems=nJ.prototype.getWrapperAdSystems;nJ.prototype.getWrapperAdIds=nJ.prototype.getWrapperAdIds;nJ.prototype.getSequenceLength=nJ.prototype.zb;nJ.prototype.getPositionInSequence=nJ.prototype.Pb;nJ.prototype.getPodTimeOffset=nJ.prototype.Ob;nJ.prototype.getPodIndex=nJ.prototype.getPodIndex;nJ.prototype.getPodType=nJ.prototype.Ya;nJ.prototype.getMediaBitrate=nJ.prototype.jb;nJ.prototype.getMediaHeight=nJ.prototype.wb;nJ.prototype.getMediaWidth=nJ.prototype.xb;
12
+ nJ.prototype.getMediaUrl=nJ.prototype.getMediaUrl;nJ.prototype.getClickThroughUrl=nJ.prototype.Nb;nJ.prototype.isBumper=nJ.prototype.gc;nJ.prototype.getSkipTimeOffset=nJ.prototype.getSkipTimeOffset;nJ.prototype.getDuration=nJ.prototype.getDuration;nJ.prototype.getTitle=nJ.prototype.getTitle;nJ.prototype.getAdvertiserName=nJ.prototype.getAdvertiserName;nJ.prototype.getAdSystem=nJ.prototype.getAdSystem;nJ.prototype.getApiFramework=nJ.prototype.getApiFramework;nJ.prototype.getCreativeId=nJ.prototype.getCreativeId;
13
+ nJ.prototype.getId=nJ.prototype.getId;nJ.prototype.getTechnology=nJ.prototype.Ab;nJ.prototype.getAdManagerVersion=nJ.prototype.vb;nJ.prototype.getAdManagerName=nJ.prototype.ub;oJ.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}};pJ.prototype.getCuePoints=function(){return this.a};pJ.prototype.Qb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};pJ.prototype.kb=function(){return 0<=this.a.indexOf(-1)};pJ.prototype.hasPostroll=pJ.prototype.kb;pJ.prototype.hasPreroll=pJ.prototype.Qb;pJ.prototype.getCuePoints=pJ.prototype.getCuePoints;_.t=qJ.prototype;_.t.fi=function(a){if(a=a.detail)switch(a.currentState){case _.en:this.T=!0,this.m.contentComplete()}};
14
+ _.t.Tj=function(a){var b=this;this.a=a.getAdsManager(this.A,sJ(this));this.a.isCustomPlaybackUsed()&&!xJ(this)?(this.h.warn("IMA plugin is disabled for platforms with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.g=new _.Ap(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new pJ(a),this.l.trigger(new _.I(_.Zb,{adsTimeline:this.j})),rJ(this));this.f.resolve()};
15
+ _.t.Sj=function(a){wJ(this,a.getError());this.f.resolve()};_.t.$j=function(a){var b=this;return _.B(function(c){if(1==c.a)return b.F=!0,xJ(b)?c.G(2):_.x(c,b.l.pause(),3);2!=c.a&&_.Kn(b.A,{visibility:_.nd});tJ(b,_.Ib,a);b.g.start();_.z(c)})};_.t.Ij=function(){var a=this;return _.B(function(b){if(1==b.a){if(!xJ(a))return b.G(2);a.J=a.l.getPosition();return _.x(b,a.l.detach(),2)}a.a.start();_.z(b)})};
16
+ _.t.bi=function(a){a.getAd().isLinear()?tJ(this,_.Pb,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.l.play()))};_.t.di=function(a){this.B=a.getAd().getDuration();tJ(this,_.Vb,a);this.l.getSurface().show(this.o)};_.t.Mj=function(a){a=a.getAdData();wJ(this,a?a.adError:null);uJ(this)};_.t.Qj=function(a){tJ(this,_.Sb,a)};_.t.Jj=function(a){tJ(this,_.Kb,a)};_.t.$h=function(a){tJ(this,_.Nb,a)};_.t.Nj=function(a){tJ(this,_.Qb,a)};_.t.ei=function(a){tJ(this,_.Xb,a)};_.t.Pj=function(a){tJ(this,_.Rb,a)};
17
+ _.t.Rj=function(a){tJ(this,_.Tb,a)};_.t.Zh=function(a){this.pause();tJ(this,_.Lb,a)};_.t.ci=function(a){tJ(this,_.Ub,a);uJ(this)};_.t.ai=function(a){tJ(this,_.Ob,a)};_.t.Kj=function(a){tJ(this,_.Mb,a);uJ(this)};
18
+ _.t.ak=function(){var a=this;return _.B(function(b){switch(b.a){case 1:a.D=!0;if(!xJ(a)||null===a.J){if(!a.F)return b["return"](a.l.play());vJ(a);b.G(2);break}return _.x(b,_.Co(a.l),3);case 3:return _.x(b,a.l.seek(a.J),2);case 2:a.F=!1;a.g&&a.g.stop();if(a.l.isEnded()){b.G(5);break}return _.x(b,a.l.play(),5);case 5:tJ(a,_.Jb),_.z(b)}})};_.t.Vj=function(){this.M=!0};
19
+ _.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){b=a.l;c=a.I;try{if(typeof c.adTagUrl!==_.ve)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.K.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.K.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.m.getSettings().setAutoPlayAdBreaks(!1);a.m.requestAds(f);
20
+ return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.B(function(c){return b.a&&b.j&&!b.H?b.j.Qb()?_.x(c,zJ(b),0):_.x(c,AJ(b,a),0):_.x(c,a.play(),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)};
21
+ _.t.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
+ _.t.dispose=function(){var a=this;return(new Promise(function(b){a.H&&a.j&&a.j.kb()&&!a.M?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.l.getSurface().hide(a.o)}),_.fg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.m.contentComplete()})).then(function(){vJ(a);a.w.release();a.g&&(a.g.stop(),a.g=null);a.a&&(a.a.destroy(),a.a=null)})};qJ.prototype.getPosition=qJ.prototype.getPosition;
23
+ qJ.prototype.setVolume=qJ.prototype.setVolume;qJ.prototype.getVolume=qJ.prototype.getVolume;qJ.prototype.skip=qJ.prototype.skip;qJ.prototype.pause=qJ.prototype.pause;qJ.prototype.resume=qJ.prototype.resume;_.w(BJ,_.nq);_.t=BJ.prototype;_.t.onPlayerCreated=function(a){if(CJ())return a.onError(new _.L(1,9,1E4));this.f=_.In(_.$c,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.ra);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.Zi=function(){return this.a};_.t.Xi=function(){return this.g};_.t.Jc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",BJ);BJ.prototype.getAdContainer=BJ.prototype.Jc;BJ.prototype.getAdDisplayContainer=BJ.prototype.Xi;BJ.prototype.getAdsLoader=BJ.prototype.Zi;BJ.Id="ima";
25
+ BJ.isSdkMissing=CJ;DJ.prototype.create=function(){return new BJ};_.Fo(new DJ);EJ.prototype.name=function(){return mJ};EJ.prototype.$=function(a,b){return a.namespace()===_.Kc?!1:CJ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};EJ.prototype.create=function(a){return new qJ(a)};EJ.prototype.create=EJ.prototype.create;EJ.prototype.isSupported=EJ.prototype.$;EJ.prototype.name=EJ.prototype.name;_.Fn(new EJ);};
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));}