@castlabs/prestoplay 6.17.0 → 6.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +6 -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 +98 -98
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +372 -369
  8. package/cjs/cl.crypto.js +8 -8
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +1 -1
  11. package/cjs/cl.freewheel.js +21 -21
  12. package/cjs/cl.hls.js +67 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +302 -302
  17. package/cjs/cl.muxdata.js +14 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +15 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +64 -64
  26. package/cjs/cl.ttml.js +28 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +9 -9
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +14 -14
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +83 -83
  36. package/cl.conviva.js +26 -26
  37. package/cl.core.js +324 -323
  38. package/cl.crypto.js +8 -8
  39. package/cl.dash.js +69 -69
  40. package/cl.externs.js +1 -1
  41. package/cl.freewheel.js +15 -15
  42. package/cl.hls.js +72 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +15 -15
  46. package/cl.mse.js +267 -268
  47. package/cl.muxdata.js +11 -11
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +10 -10
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +54 -54
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +6 -6
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +11 -11
  61. package/cl.youbora.js +12 -12
  62. package/package.json +1 -1
  63. package/typings.d.ts +3 -2
package/cjs/cl.htmlcue.js CHANGED
@@ -1,33 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ER="CLPP Subtitle Styles",FR="Unsupported unit",GR="clpp-text-plain",HR="clpp-text-ttml",IR="clpp.htmlcue.HtmlTextDisplayer",JR="initial",KR=function(a){return _.ni(a,{Wg:function(b,c){return b.la(c)}})},LR=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)},MR=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},NR=function(){},OR=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},QR=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return PR[c]});return a},SR=function(a,b){RR(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){RR(a,c)})},RR=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},TR=function(a,b){return 0===a?"0":a+b},UR=function(a,b){return 1>Math.abs(a-b)||a<b},VR=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},WR=function(a,b){return a>b&&1<Math.abs(a-b)},YR=function(a,b){return 1>Math.abs(a-b)||a>b},ZR=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},$R=function(a){return new ZR(a.left,a.f,a.top,a.a,a.height,a.width)},aS=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 ZR(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},bS=function(a,b){return b.some(function(c){return VR(a.left,c.f)&&WR(a.f,c.left)&&VR(a.top,c.a)&&WR(a.a,c.top)})},cS=function(a,b){return YR(a.top,b.top)&&UR(a.a,b.a)&&YR(a.left,b.left)&&UR(a.f,b.f)},dS=function(a,b,c){switch(c){case "+x":return VR(a.left,b.left);case "-x":return WR(a.f,b.f);
6
- case "+y":return VR(a.top,b.top);case "-y":return WR(a.a,b.a);default:throw Error("Unknown axis");}},eS=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},fS=function(a,b,c){eS.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},hS=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 gS(a)?b:c},kS=function(a,b,c){return gS(a)&&_.O.ra(c)?TR(c,_.Nf):(iS(a)||
7
- jS(a))&&_.O.ra(b)?TR(b,"%"):JR},iS=function(a){return a.f.writingMode===_.Gg},jS=function(a){return a.f.writingMode===_.Hg},gS=function(a){return a.f.writingMode===_.qi},lS=function(a,b,c){return(iS(a)||jS(a))&&_.O.ra(c)?TR(c,_.Nf):iS(a)&&_.O.R(c)?TR(0,_.Nf):gS(a)&&_.O.ra(b)?TR(b,"%"):JR},mS=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ge:return a.f.position;case "auto":case _.vd:return a.f.position-a.f.size/2;case _.He:return a.f.position-a.f.size}return 0},
8
- nS=function(a){switch(a.f.positionAlign){case _.Ge:return _.De;case "auto":case _.vd:return _.pi;case _.He:return _.Uf}return a.f.textAlign},oS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.De:case _.De:return _.Ge;case _.pi:return _.vd;case _.Uf:case _.Uf:return _.He}return a.f.positionAlign},pS=function(a){switch(a.f.writingMode){case _.qi:return"horizontal-tb";case _.Gg:return _.Gg;case _.Hg:return _.Hg;default:throw Error("Unknown writing mode");}},qS=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=aS(a.a);this.h=[]},rS=function(a,b){if(a.j)switch(b.writingMode){case _.qi:return["-y"];case _.Gg:return["+x"];case _.Hg:return["-x"]}var c=[];switch(b.writingMode){case _.qi:c=["+y","-y"];break;case _.Gg:c=["+x","-x"];break;case _.Hg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},sS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=aS(a.l.a)},tS=function(a,b,c){eS.call(this,a,b,c);this.h=null;this.l=[]},uS=function(a,b){sS(a.h);
10
- a.l.unshift(b);for(var c=_.w(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},vS=function(a,b){tS.call(this,a.id,"clpp-text-cue-region",b);this.f=a},wS=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.vi)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(FR);},yS=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=xS(this,this.h);this.f=xS(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
- zS=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===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},AS=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,
12
- c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},xS=function(a,b,c){var d=document.createElement(_.mg),e=d.dataset;e.name=ER;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);BS(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},BS=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===ER&&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()})},ES=function(a){_.mu.call(this,a);var b=this;this.g=new _.K(IR);this.m=a;this.L=CS(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new yS(a.getSurface().getUniqueCssClass());this.a=new tS(null,"clpp-text-container",{});this.w=new _.zt(a.getSurface(),this.Cj.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
- this.G=new _.Wk(function(){DS(b)});this.A=new Map;this.l=null},CS=function(a){a=_.O.Na(a.htmlcue||{});_.O.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.O.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},FS=function(a,b){return a.startTime<=b&&a.endTime>b},DS=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.zp){a.J=c;var d=GS(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,HS(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.ru(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Og:h="clpp-text-vtt";break;case _.ug:h=HR;break;case _.oi:h=GR}h&&!g.classList.contains(h)&&_.Xp(g,h);g=aS(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{RR({fontSize:IS(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Og;var l=e.payloadType===_.ug;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new vS(e.region,{}),f.A.set(e.region.id,g),uS(f.a,g)));e=new fS(e,f.L,c);g?uS(g,e):uS(f.a,e)}}}}}},GS=function(a,b){var c=MR(a.f,function(e){return FS(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&FS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&FS(a.f[c+1],b);)c++;return{start:d,
17
- end:c}},JS=function(a){HS(a);a.J=null;a.l=null;a.f=[]},HS=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(HR);b.classList.remove(GR);a=a.a;sS(a.h);a.l=[]}},IS=function(a,b){var c=aS(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Nf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Nf;d=a.getFontSizePercent();return Math.round(c*d)+_.Nf},KS=function(){},LS=function(){};
18
- NR.prototype.parse=function(a){a={input:a};for(var b=_.Zp(_.ae),c=[],d=b,e;null!==(e=OR(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=MS[f];h?(h=_.Zp(h),(f=NS[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||OS[g.localName]&&OS[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(QR(e)));return b};var MS={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},NS={v:"voice",lang:"lang"},OS={rt:"ruby"},PR={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};eS.prototype.init=function(){this.j=!0};eS.prototype.A=function(){return!1};_.x(fS,eS);fS.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
20
- fS.prototype.init=function(a){eS.prototype.init.call(this,a);if(this.h)_.Xp(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===_.ug){var c=_.Zp(_.ae);c.innerHTML=b.payload;b=c}else b.payloadType===_.Og?b=(new NR).parse(b.payload):(c=_.Zp(_.ae),c.textContent=b.payload,b=c);_.Xp(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
21
- c.next();!d.done;d=c.next())_.Xp(b,d.value);RR({writingMode:pS(this)},b);this.a.appendChild(b);_.Xp(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Xp(this.a,"clpp-text-wrapper__"+d.value);_.O.R(this.f.line)&&(this.f.lineInterpretation=_.ri,this.f.line=gS(this)?-1:0);c=pS(this);RR({writingMode:c,webkitWritingMode:c,direction:JR,textAlign:nS(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=mS(this,oS(this));d=lS(this,c,null);var e=kS(this,
22
- c,null),f=jS(this)&&_.O.R(null)?TR(0,_.Nf):JR;RR({position:"absolute",left:d,right:f,top:e,width:gS(this)?TR(this.f.size,"%"):JR,height:iS(this)||jS(this)?TR(this.f.size,"%"):JR},this.a);d=this.f;a=gS(this)?a.height:a.width;e=hS(this);if(d.lineInterpretation===_.ri)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 _.vd:g-=f/2;break;case _.qe:g-=f}f=Math.round(g/100*a)}jS(this)&&(f=a-f-e);a=f;d=lS(this,c,a);e=jS(this)&&_.O.R(a)?
23
- TR(0,_.Nf):JR;RR({left:d,right:e,top:kS(this,c,a)},this.a)}SR(this.D,b)}};fS.prototype.o=function(){return _.Zp(_.ae)};qS.prototype.append=function(a){var b=a.a;b.style.visibility=_.xe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=aS(a.a);var d=rS(this,a.f),e=hS(a),f=$R(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;dS(c,this.a,l)||cS(c,this.a)&&bS(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||cS(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
24
- 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=$R(c),h=l);c=$R(f)}c=g||f}RR({top:TR(c.top-this.a.top,_.Nf),bottom:TR(this.a.a-c.a,_.Nf),left:TR(c.left-this.a.left,_.Nf),right:TR(this.a.f-c.f,_.Nf),height:TR(c.height,_.Nf),width:TR(c.width,_.Nf)},a.a)}b.style.visibility="visible";this.h.push(aS(a.a))};_.x(tS,eS);tS.prototype.init=function(){this.h=new qS(this);this.j=!0};tS.prototype.o=function(){var a=_.Zp(_.ae);_.Xp(a,this.w);this.id&&(a.id=this.id);return a};_.x(vS,tS);
25
- vS.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.vi:b=b.width/100*a.width;break a;default:throw Error(FR);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.vi)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(FR);d=a.height;var e=wS(this,d,a.height);RR(this.B,this.a);RR({left:TR(c,_.Nf),top:TR(e,_.Nf),width:TR(b,_.Nf),height:TR(d,_.Nf)},this.a);this.f.writingMode&&RR({display:"flex",
26
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&RR({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Xp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.vi:b=b.height/100*a.height;break a;case 2:b=b.height;d=new fS(new _.ui(0,1,"Lorem ipsum",_.oi),{},{});c=d.a;this.a.appendChild(c);d.init(aS(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(FR);
27
- }a=wS(this,b,a.height);RR({top:TR(a,_.Nf),height:TR(b,_.Nf)},this.a);this.h=new qS(this,!0);this.j=!0};vS.prototype.getId=function(){return this.f.id};yS.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=AS(this,a);if(zS(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)}};
28
- yS.prototype.destroy=function(){var a=this;return _.H(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.x(ES,_.mu);_.t=ES.prototype;_.t.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=LR(this.f,KR(a));this.l=null;DS(this,!1)}};_.t.yb=function(){null==this.h||DS(this,!0)};
29
- _.t.destroy=function(){var a=this;return _.H(function(b){if(1==b.a){if(null==a.h)return b["return"]();JS(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.t.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;DS(this,!0);return!0};_.t.isTextVisible=function(){return this.j};
30
- _.t.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.lb(.25),this.L.enableResizeObserver&&this.w.start(),DS(this,!0)):(this.G.stop(),this.w.stop(),JS(this)))};_.t.Dd=function(){return this.f};_.t.Cj=function(){DS(this,!0)};_.J(IR,ES);ES.prototype.setTextVisibility=ES.prototype.setTextVisibility;ES.prototype.isTextVisible=ES.prototype.isTextVisible;ES.prototype.remove=ES.prototype.remove;ES.prototype.destroy=ES.prototype.destroy;ES.prototype.append=ES.prototype.append;KS.prototype.isSupported=function(a){return!!a.enableHtmlCue&&!_.fl()};KS.prototype.create=function(a){return new ES(a)};_.x(LS,_.Js);LS.prototype.f=function(){_.Zo(_.ye,new KS)};LS.prototype.a=function(){_.Xo.has(_.ye)&&(_.Xo["delete"](_.ye),_.Yo.info("Removed factory: 'html'"))};LS.prototype.id=function(){return _.og};_.J("clpp.htmlcue.HtmlCueComponent",LS);};
2
+ var f=function(window){var GR="CLPP Subtitle Styles",HR="Unsupported unit",IR="clpp-text-plain",JR="clpp-text-ttml",KR="clpp.htmlcue.HtmlTextDisplayer",LR="initial",MR=function(a){return _.ni(a,{Wg:function(b,c){return b.la(c)}})},NR=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)},OR=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},PR=function(){},QR=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},SR=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return RR[c]});return a},UR=function(a,b){TR(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){TR(a,c)})},TR=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},VR=function(a,b){return 0===a?"0":a+b},WR=function(a,b){return 1>Math.abs(a-b)||a<b},YR=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},ZR=function(a,b){return a>b&&1<Math.abs(a-b)},$R=function(a,b){return 1>Math.abs(a-b)||a>b},aS=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},bS=function(a){return new aS(a.left,a.f,a.top,a.a,a.height,a.width)},cS=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 aS(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},dS=function(a,b){return b.some(function(c){return YR(a.left,c.f)&&ZR(a.f,c.left)&&YR(a.top,c.a)&&ZR(a.a,c.top)})},eS=function(a,b){return $R(a.top,b.top)&&WR(a.a,b.a)&&$R(a.left,b.left)&&WR(a.f,b.f)},fS=function(a,b,c){switch(c){case "+x":return YR(a.left,b.left);case "-x":return ZR(a.f,b.f);
6
+ case "+y":return YR(a.top,b.top);case "-y":return ZR(a.a,b.a);default:throw Error("Unknown axis");}},gS=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},hS=function(a,b,c){gS.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},jS=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 iS(a)?b:c},mS=function(a,b,c){return iS(a)&&_.O.ra(c)?VR(c,_.Mf):(kS(a)||
7
+ lS(a))&&_.O.ra(b)?VR(b,"%"):LR},kS=function(a){return a.f.writingMode===_.Gg},lS=function(a){return a.f.writingMode===_.Hg},iS=function(a){return a.f.writingMode===_.qi},nS=function(a,b,c){return(kS(a)||lS(a))&&_.O.ra(c)?VR(c,_.Mf):kS(a)&&_.O.R(c)?VR(0,_.Mf):iS(a)&&_.O.ra(b)?VR(b,"%"):LR},oS=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Fe:return a.f.position;case "auto":case _.ud:return a.f.position-a.f.size/2;case _.Ge:return a.f.position-a.f.size}return 0},
8
+ pS=function(a){switch(a.f.positionAlign){case _.Fe:return _.Ce;case "auto":case _.ud:return _.pi;case _.Ge:return _.Tf}return a.f.textAlign},qS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Ce:case _.Ce:return _.Fe;case _.pi:return _.ud;case _.Tf:case _.Tf:return _.Ge}return a.f.positionAlign},rS=function(a){switch(a.f.writingMode){case _.qi:return"horizontal-tb";case _.Gg:return _.Gg;case _.Hg:return _.Hg;default:throw Error("Unknown writing mode");}},sS=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=cS(a.a);this.h=[]},tS=function(a,b){if(a.j)switch(b.writingMode){case _.qi:return["-y"];case _.Gg:return["+x"];case _.Hg:return["-x"]}var c=[];switch(b.writingMode){case _.qi:c=["+y","-y"];break;case _.Gg:c=["+x","-x"];break;case _.Hg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},uS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=cS(a.l.a)},vS=function(a,b,c){gS.call(this,a,b,c);this.h=null;this.l=[]},wS=function(a,b){uS(a.h);
10
+ a.l.unshift(b);for(var c=_.w(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},xS=function(a,b){vS.call(this,a.id,"clpp-text-cue-region",b);this.f=a},yS=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.vi)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(HR);},AS=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=zS(this,this.h);this.f=zS(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
+ BS=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===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},CS=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,
12
+ c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},zS=function(a,b,c){var d=document.createElement(_.lg),e=d.dataset;e.name=GR;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);DS(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},DS=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===GR&&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()})},GS=function(a){_.pu.call(this,a);var b=this;this.g=new _.K(KR);this.m=a;this.L=ES(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new AS(a.getSurface().getUniqueCssClass());this.a=new vS(null,"clpp-text-container",{});this.w=new _.Ct(a.getSurface(),this.Cj.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.Wk(function(){FS(b)});this.A=new Map;this.l=null},ES=function(a){a=_.O.Na(a.htmlcue||{});_.O.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.O.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},HS=function(a,b){return a.startTime<=b&&a.endTime>b},FS=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.zp){a.J=c;var d=IS(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,JS(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.uu(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Og:h="clpp-text-vtt";break;case _.tg:h=JR;break;case _.oi:h=IR}h&&!g.classList.contains(h)&&_.Xp(g,h);g=cS(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{TR({fontSize:KS(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Og;var l=e.payloadType===_.tg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new xS(e.region,{}),f.A.set(e.region.id,g),wS(f.a,g)));e=new hS(e,f.L,c);g?wS(g,e):wS(f.a,e)}}}}}},IS=function(a,b){var c=OR(a.f,function(e){return HS(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&HS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&HS(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},LS=function(a){JS(a);a.J=null;a.l=null;a.f=[]},JS=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(JR);b.classList.remove(IR);a=a.a;uS(a.h);a.l=[]}},KS=function(a,b){var c=cS(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Mf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Mf;d=a.getFontSizePercent();return Math.round(c*d)+_.Mf},MS=function(){},NS=function(){};
18
+ PR.prototype.parse=function(a){a={input:a};for(var b=_.Zp(_.$d),c=[],d=b,e;null!==(e=QR(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=OS[f];h?(h=_.Zp(h),(f=PS[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||QS[g.localName]&&QS[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(SR(e)));return b};var OS={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},PS={v:"voice",lang:"lang"},QS={rt:"ruby"},RR={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};gS.prototype.init=function(){this.j=!0};gS.prototype.A=function(){return!1};_.x(hS,gS);hS.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
20
+ hS.prototype.init=function(a){gS.prototype.init.call(this,a);if(this.h)_.Xp(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===_.tg){var c=_.Zp(_.$d);c.innerHTML=b.payload;b=c}else b.payloadType===_.Og?b=(new PR).parse(b.payload):(c=_.Zp(_.$d),c.textContent=b.payload,b=c);_.Xp(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.Xp(b,d.value);TR({writingMode:rS(this)},b);this.a.appendChild(b);_.Xp(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Xp(this.a,"clpp-text-wrapper__"+d.value);_.O.R(this.f.line)&&(this.f.lineInterpretation=_.ri,this.f.line=iS(this)?-1:0);c=rS(this);TR({writingMode:c,webkitWritingMode:c,direction:LR,textAlign:pS(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=oS(this,qS(this));d=nS(this,c,null);var e=mS(this,
22
+ c,null),f=lS(this)&&_.O.R(null)?VR(0,_.Mf):LR;TR({position:"absolute",left:d,right:f,top:e,width:iS(this)?VR(this.f.size,"%"):LR,height:kS(this)||lS(this)?VR(this.f.size,"%"):LR},this.a);d=this.f;a=iS(this)?a.height:a.width;e=jS(this);if(d.lineInterpretation===_.ri)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 _.ud:g-=f/2;break;case _.pe:g-=f}f=Math.round(g/100*a)}lS(this)&&(f=a-f-e);a=f;d=nS(this,c,a);e=lS(this)&&_.O.R(a)?
23
+ VR(0,_.Mf):LR;TR({left:d,right:e,top:mS(this,c,a)},this.a)}UR(this.D,b)}};hS.prototype.o=function(){return _.Zp(_.$d)};sS.prototype.append=function(a){var b=a.a;b.style.visibility=_.we;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=cS(a.a);var d=tS(this,a.f),e=jS(a),f=bS(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;fS(c,this.a,l)||eS(c,this.a)&&dS(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||eS(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
24
+ 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=bS(c),h=l);c=bS(f)}c=g||f}TR({top:VR(c.top-this.a.top,_.Mf),bottom:VR(this.a.a-c.a,_.Mf),left:VR(c.left-this.a.left,_.Mf),right:VR(this.a.f-c.f,_.Mf),height:VR(c.height,_.Mf),width:VR(c.width,_.Mf)},a.a)}b.style.visibility="visible";this.h.push(cS(a.a))};_.x(vS,gS);vS.prototype.init=function(){this.h=new sS(this);this.j=!0};vS.prototype.o=function(){var a=_.Zp(_.$d);_.Xp(a,this.w);this.id&&(a.id=this.id);return a};_.x(xS,vS);
25
+ xS.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.vi:b=b.width/100*a.width;break a;default:throw Error(HR);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.vi)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(HR);d=a.height;var e=yS(this,d,a.height);TR(this.B,this.a);TR({left:VR(c,_.Mf),top:VR(e,_.Mf),width:VR(b,_.Mf),height:VR(d,_.Mf)},this.a);this.f.writingMode&&TR({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&TR({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Xp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.vi:b=b.height/100*a.height;break a;case 2:b=b.height;d=new hS(new _.ui(0,1,"Lorem ipsum",_.oi),{},{});c=d.a;this.a.appendChild(c);d.init(cS(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(HR);
27
+ }a=yS(this,b,a.height);TR({top:VR(a,_.Mf),height:VR(b,_.Mf)},this.a);this.h=new sS(this,!0);this.j=!0};xS.prototype.getId=function(){return this.f.id};AS.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=CS(this,a);if(BS(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)}};
28
+ AS.prototype.destroy=function(){var a=this;return _.H(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.x(GS,_.pu);_.t=GS.prototype;_.t.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=NR(this.f,MR(a));this.l=null;FS(this,!1)}};_.t.yb=function(){null==this.h||FS(this,!0)};
29
+ _.t.destroy=function(){var a=this;return _.H(function(b){if(1==b.a){if(null==a.h)return b["return"]();LS(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.t.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;FS(this,!0);return!0};_.t.isTextVisible=function(){return this.j};
30
+ _.t.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.lb(.25),this.L.enableResizeObserver&&this.w.start(),FS(this,!0)):(this.G.stop(),this.w.stop(),LS(this)))};_.t.Dd=function(){return this.f};_.t.Cj=function(){FS(this,!0)};_.J(KR,GS);GS.prototype.setTextVisibility=GS.prototype.setTextVisibility;GS.prototype.isTextVisible=GS.prototype.isTextVisible;GS.prototype.remove=GS.prototype.remove;GS.prototype.destroy=GS.prototype.destroy;GS.prototype.append=GS.prototype.append;MS.prototype.isSupported=function(a){return!!a.enableHtmlCue&&!_.fl()};MS.prototype.create=function(a){return new GS(a)};_.x(NS,_.Ms);NS.prototype.f=function(){_.Zo(_.xe,new MS)};NS.prototype.a=function(){_.Xo.has(_.xe)&&(_.Xo["delete"](_.xe),_.Yo.info("Removed factory: 'html'"))};NS.prototype.id=function(){return _.ng};_.J("clpp.htmlcue.HtmlCueComponent",NS);};
31
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
32
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
33
33
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var lR="clpp.ima.AdsManagerFactory",mR=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},nR=function(){},oR=function(a){this.a=a},pR=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.O.Na(a.ima||{});this.J=_.O.oa({disableCustomPlayback:!1},a);this.o=this.m.pc("ima").Xc();this.S=this.m.pc("ima").h;this.l=this.m.pc("ima").a;this.L=new _.Bt;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Oj;this.I=!1;this.w=new _.Uh;this.V=new nR;this.B=
3
- null;this.N=this.H=this.D=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Sl.bind(this));a.on(this.l,b,this.Rl.bind(this));a.on(this.m,_.re,this.Zl.bind(this))},qR=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Hl.bind(a));c.on(b,d.LOADED,a.Gj.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.$l.bind(a));c.on(b,d.STARTED,a.Ij.bind(a));c.on(b,d.LOG,a.Ll.bind(a));c.on(b,
4
- d.AD_PROGRESS,a.Pl.bind(a));c.on(b,d.AD_BUFFERING,a.Il.bind(a));c.on(b,d.FIRST_QUARTILE,a.Ej.bind(a));c.on(b,d.MIDPOINT,a.Ml.bind(a));c.on(b,d.THIRD_QUARTILE,a.Jj.bind(a));c.on(b,d.PAUSED,a.Ol.bind(a));c.on(b,d.RESUMED,a.Ql.bind(a));c.on(b,d.CLICK,a.Dj.bind(a));c.on(b,d.SKIPPED,a.Hj.bind(a));c.on(b,d.IMPRESSION,a.Fj.bind(a));c.on(b,d.COMPLETE,a.Jl.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.am.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ul.bind(a))},rR=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
- b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.ld?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===_.ld&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
- [];return b},tR=function(a){a.B=null;sR(a,_.Mc);a.o&&a.m.getSurface().hide(a.o)},uR=function(a){_.Yp(a.A,{visibility:"visible"})},sR=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new mR(c,a.G,a.D)});a.m.trigger(new _.L(b,d))},vR=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.P(1,9,10003,{errorType:c},b))},wR=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Vj()},yR=function(a){var b,c;return _.H(function(d){if(1==d.a)return a.S.initialize(),
7
- b=!!a.m.getConfiguration().muted,_.y(d,a.L.canPlay(b),2);c=d.f;if(!c&&!wR(a))return sR(a,_.jd),a.g.warn(_.ma),d["return"]();xR(a);_.A(d)})},zR=function(a,b){return _.H(function(c){if(1==c.a)return a.S.initialize(),_.y(c,b.play(),2);xR(a);_.A(c)})},xR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},AR=function(){this.a=this.h=this.f=null},BR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},CR=function(){},DR=function(){this.cd=
8
- new _.K(lR)};_.t=mR.prototype;_.t.zb=function(){return"Google IMA SDK"};_.t.Ab=function(){return google.ima.VERSION};_.t.Gb=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()};
9
- _.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.tc=function(){return this.f?this.f.getIsBumper():!1};_.t.Tb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ye&&typeof b[d].clickThroughUrl===_.kg});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.Db=function(){return this.a.getVastMediaWidth()};_.t.Cb=function(){return this.a.getVastMediaHeight()};
2
+ var f=function(window){var nR="clpp.ima.AdsManagerFactory",oR=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},pR=function(){},qR=function(a){this.a=a},rR=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.O.Na(a.ima||{});this.J=_.O.oa({disableCustomPlayback:!1},a);this.o=this.m.pc("ima").Xc();this.S=this.m.pc("ima").h;this.l=this.m.pc("ima").a;this.L=new _.Et;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Oj;this.I=!1;this.w=new _.Uh;this.V=new pR;this.B=
3
+ null;this.N=this.H=this.D=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Sl.bind(this));a.on(this.l,b,this.Rl.bind(this));a.on(this.m,_.qe,this.Zl.bind(this))},sR=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Hl.bind(a));c.on(b,d.LOADED,a.Gj.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.$l.bind(a));c.on(b,d.STARTED,a.Ij.bind(a));c.on(b,d.LOG,a.Ll.bind(a));c.on(b,
4
+ d.AD_PROGRESS,a.Pl.bind(a));c.on(b,d.AD_BUFFERING,a.Il.bind(a));c.on(b,d.FIRST_QUARTILE,a.Ej.bind(a));c.on(b,d.MIDPOINT,a.Ml.bind(a));c.on(b,d.THIRD_QUARTILE,a.Jj.bind(a));c.on(b,d.PAUSED,a.Ol.bind(a));c.on(b,d.RESUMED,a.Ql.bind(a));c.on(b,d.CLICK,a.Dj.bind(a));c.on(b,d.SKIPPED,a.Hj.bind(a));c.on(b,d.IMPRESSION,a.Fj.bind(a));c.on(b,d.COMPLETE,a.Jl.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.am.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ul.bind(a))},tR=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
+ b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.kd?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===_.kd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
+ [];return b},vR=function(a){a.B=null;uR(a,_.Lc);a.o&&a.m.getSurface().hide(a.o)},wR=function(a){_.Yp(a.A,{visibility:"visible"})},uR=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new oR(c,a.G,a.D)});a.m.trigger(new _.L(b,d))},xR=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.P(1,9,10003,{errorType:c},b))},yR=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Vj()},AR=function(a){var b,c;return _.H(function(d){if(1==d.a)return a.S.initialize(),
7
+ b=!!a.m.getConfiguration().muted,_.y(d,a.L.canPlay(b),2);c=d.f;if(!c&&!yR(a))return uR(a,_.id),a.g.warn(_.ma),d["return"]();zR(a);_.A(d)})},BR=function(a,b){return _.H(function(c){if(1==c.a)return a.S.initialize(),_.y(c,b.play(),2);zR(a);_.A(c)})},zR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},CR=function(){this.a=this.h=this.f=null},DR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},ER=function(){},FR=function(){this.cd=
8
+ new _.K(nR)};_.t=oR.prototype;_.t.zb=function(){return"Google IMA SDK"};_.t.Ab=function(){return google.ima.VERSION};_.t.Gb=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()};
9
+ _.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.tc=function(){return this.f?this.f.getIsBumper():!1};_.t.Tb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Xe&&typeof b[d].clickThroughUrl===_.jg});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.Db=function(){return this.a.getVastMediaWidth()};_.t.Cb=function(){return this.a.getVastMediaHeight()};
10
10
  _.t.pb=function(){return this.a.getVastMediaBitrate()};_.t.fb=function(){return this.h?2:this.j?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Ub=function(){return this.f?this.f.getTimeOffset():0};_.t.Vb=function(){return this.f?this.f.getAdPosition():1};_.t.Fb=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()};
11
- mR.prototype.getWrapperCreativeIds=mR.prototype.getWrapperCreativeIds;mR.prototype.getWrapperAdSystems=mR.prototype.getWrapperAdSystems;mR.prototype.getWrapperAdIds=mR.prototype.getWrapperAdIds;mR.prototype.getSequenceLength=mR.prototype.Fb;mR.prototype.getPositionInSequence=mR.prototype.Vb;mR.prototype.getPodTimeOffset=mR.prototype.Ub;mR.prototype.getPodIndex=mR.prototype.getPodIndex;mR.prototype.getPodType=mR.prototype.fb;mR.prototype.getMediaBitrate=mR.prototype.pb;
12
- mR.prototype.getMediaHeight=mR.prototype.Cb;mR.prototype.getMediaWidth=mR.prototype.Db;mR.prototype.getMediaUrl=mR.prototype.getMediaUrl;mR.prototype.getClickThroughUrl=mR.prototype.Tb;mR.prototype.isBumper=mR.prototype.tc;mR.prototype.getSkipTimeOffset=mR.prototype.getSkipTimeOffset;mR.prototype.getDuration=mR.prototype.getDuration;mR.prototype.getTitle=mR.prototype.getTitle;mR.prototype.getAdvertiserName=mR.prototype.getAdvertiserName;mR.prototype.getAdSystem=mR.prototype.getAdSystem;
13
- mR.prototype.getApiFramework=mR.prototype.getApiFramework;mR.prototype.getCreativeId=mR.prototype.getCreativeId;mR.prototype.getId=mR.prototype.getId;mR.prototype.getTechnology=mR.prototype.Gb;mR.prototype.getAdManagerVersion=mR.prototype.Ab;mR.prototype.getAdManagerName=mR.prototype.zb;nR.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}};oR.prototype.getCuePoints=function(){return this.a};oR.prototype.Xb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};oR.prototype.rb=function(){return 0<=this.a.indexOf(-1)};oR.prototype.hasPostroll=oR.prototype.rb;oR.prototype.hasPreroll=oR.prototype.Xb;oR.prototype.getCuePoints=oR.prototype.getCuePoints;_.t=pR.prototype;
14
- _.t.Sl=function(a){var b=this;this.a=a.getAdsManager(this.A,rR(this));this.a.isCustomPlaybackUsed()&&!wR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.P(1,9,10002)),this.dispose()):(this.h=new _.zt(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.j=new oR(a),this.m.trigger(new _.L(_.Pc,{adsTimeline:this.j})),qR(this));this.f.resolve()};
15
- _.t.Rl=function(a){vR(this,a.getError());this.f.resolve()};_.t.$l=function(a){var b=this;return _.H(function(c){switch(c.a){case 1:return b.H=!0,wR(b)?(b.K=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.Yp(b.A,{visibility:_.xe});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:sR(b,_.yc,a),b.h.start(),_.A(c)}})};_.t.Hl=function(){var a=this;return _.H(function(b){a.a.start();_.A(b)})};
16
- _.t.Gj=function(a){a.getAd().isLinear()?sR(this,_.Fc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.t.Ij=function(a){this.B=a.getAd().getDuration();sR(this,_.Lc,a);this.m.getSurface().show(this.o)};_.t.Ll=function(a){a=a.getAdData();vR(this,a?a.adError:null);tR(this)};_.t.Pl=function(a){sR(this,_.Ic,a)};_.t.Il=function(a){sR(this,_.Ac,a)};_.t.Ej=function(a){sR(this,_.Dc,a)};_.t.Ml=function(a){sR(this,_.Gc,a)};_.t.Jj=function(a){sR(this,_.Nc,a)};_.t.Ol=function(a){sR(this,_.Hc,a)};
17
- _.t.Ql=function(a){sR(this,_.Jc,a)};_.t.Dj=function(a){this.pause();sR(this,_.Bc,a)};_.t.Hj=function(a){sR(this,_.Kc,a);tR(this)};_.t.Fj=function(a){sR(this,_.Ec,a)};_.t.Jl=function(a){sR(this,_.Cc,a);tR(this)};
18
- _.t.am=function(){var a=this;return _.H(function(b){switch(b.a){case 1:a.G=!0;if(!wR(a)||null===a.K){if(!a.H)return b["return"](a.m.play());uR(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.Uq(a.m),3);case 3:if(a.D){b.F(2);break}return _.y(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.D){b.F(6);break}return _.y(b,a.m.play(),6);case 6:sR(a,_.zc),_.A(b)}})};_.t.Ul=function(){this.N=!0};_.t.Zl=function(){this.D=!0;this.l.contentComplete()};
19
- _.t.load=function(){var a=this,b,c,d,e,f;return _.H(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.kg)throw new _.P(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.L.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.L.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
- return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.H(function(c){return b.a&&b.j&&!b.I?b.j.Xb()?_.y(c,yR(b),0):_.y(c,zR(b,a),0):_.y(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)};
11
+ oR.prototype.getWrapperCreativeIds=oR.prototype.getWrapperCreativeIds;oR.prototype.getWrapperAdSystems=oR.prototype.getWrapperAdSystems;oR.prototype.getWrapperAdIds=oR.prototype.getWrapperAdIds;oR.prototype.getSequenceLength=oR.prototype.Fb;oR.prototype.getPositionInSequence=oR.prototype.Vb;oR.prototype.getPodTimeOffset=oR.prototype.Ub;oR.prototype.getPodIndex=oR.prototype.getPodIndex;oR.prototype.getPodType=oR.prototype.fb;oR.prototype.getMediaBitrate=oR.prototype.pb;
12
+ oR.prototype.getMediaHeight=oR.prototype.Cb;oR.prototype.getMediaWidth=oR.prototype.Db;oR.prototype.getMediaUrl=oR.prototype.getMediaUrl;oR.prototype.getClickThroughUrl=oR.prototype.Tb;oR.prototype.isBumper=oR.prototype.tc;oR.prototype.getSkipTimeOffset=oR.prototype.getSkipTimeOffset;oR.prototype.getDuration=oR.prototype.getDuration;oR.prototype.getTitle=oR.prototype.getTitle;oR.prototype.getAdvertiserName=oR.prototype.getAdvertiserName;oR.prototype.getAdSystem=oR.prototype.getAdSystem;
13
+ oR.prototype.getApiFramework=oR.prototype.getApiFramework;oR.prototype.getCreativeId=oR.prototype.getCreativeId;oR.prototype.getId=oR.prototype.getId;oR.prototype.getTechnology=oR.prototype.Gb;oR.prototype.getAdManagerVersion=oR.prototype.Ab;oR.prototype.getAdManagerName=oR.prototype.zb;pR.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}};qR.prototype.getCuePoints=function(){return this.a};qR.prototype.Xb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};qR.prototype.rb=function(){return 0<=this.a.indexOf(-1)};qR.prototype.hasPostroll=qR.prototype.rb;qR.prototype.hasPreroll=qR.prototype.Xb;qR.prototype.getCuePoints=qR.prototype.getCuePoints;_.t=rR.prototype;
14
+ _.t.Sl=function(a){var b=this;this.a=a.getAdsManager(this.A,tR(this));this.a.isCustomPlaybackUsed()&&!yR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.P(1,9,10002)),this.dispose()):(this.h=new _.Ct(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.j=new qR(a),this.m.trigger(new _.L(_.Oc,{adsTimeline:this.j})),sR(this));this.f.resolve()};
15
+ _.t.Rl=function(a){xR(this,a.getError());this.f.resolve()};_.t.$l=function(a){var b=this;return _.H(function(c){switch(c.a){case 1:return b.H=!0,yR(b)?(b.K=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.Yp(b.A,{visibility:_.we});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:uR(b,_.xc,a),b.h.start(),_.A(c)}})};_.t.Hl=function(){var a=this;return _.H(function(b){a.a.start();_.A(b)})};
16
+ _.t.Gj=function(a){a.getAd().isLinear()?uR(this,_.Ec,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.t.Ij=function(a){this.B=a.getAd().getDuration();uR(this,_.Kc,a);this.m.getSurface().show(this.o)};_.t.Ll=function(a){a=a.getAdData();xR(this,a?a.adError:null);vR(this)};_.t.Pl=function(a){uR(this,_.Hc,a)};_.t.Il=function(a){uR(this,_.zc,a)};_.t.Ej=function(a){uR(this,_.Cc,a)};_.t.Ml=function(a){uR(this,_.Fc,a)};_.t.Jj=function(a){uR(this,_.Mc,a)};_.t.Ol=function(a){uR(this,_.Gc,a)};
17
+ _.t.Ql=function(a){uR(this,_.Ic,a)};_.t.Dj=function(a){this.pause();uR(this,_.Ac,a)};_.t.Hj=function(a){uR(this,_.Jc,a);vR(this)};_.t.Fj=function(a){uR(this,_.Dc,a)};_.t.Jl=function(a){uR(this,_.Bc,a);vR(this)};
18
+ _.t.am=function(){var a=this;return _.H(function(b){switch(b.a){case 1:a.G=!0;if(!yR(a)||null===a.K){if(!a.H)return b["return"](a.m.play());wR(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.Xq(a.m),3);case 3:if(a.D){b.F(2);break}return _.y(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.D){b.F(6);break}return _.y(b,a.m.play(),6);case 6:uR(a,_.yc),_.A(b)}})};_.t.Ul=function(){this.N=!0};_.t.Zl=function(){this.D=!0;this.l.contentComplete()};
19
+ _.t.load=function(){var a=this,b,c,d,e,f;return _.H(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.jg)throw new _.P(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.L.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.L.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
+ return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.H(function(c){return b.a&&b.j&&!b.I?b.j.Xb()?_.y(c,AR(b),0):_.y(c,BR(b,a),0):_.y(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
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.I&&a.j&&a.j.rb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Vh(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.l.contentComplete()})).then(function(){uR(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};pR.prototype.getPosition=pR.prototype.getPosition;
23
- pR.prototype.setVolume=pR.prototype.setVolume;pR.prototype.getVolume=pR.prototype.getVolume;pR.prototype.skip=pR.prototype.skip;pR.prototype.pause=pR.prototype.pause;pR.prototype.resume=pR.prototype.resume;_.x(AR,_.wu);_.t=AR.prototype;_.t.onPlayerCreated=function(a){if(BR())return a.onError(new _.P(1,9,1E4));this.f=_.Wp(_.ae,{"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(_.va);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.Lk=function(){return this.a};_.t.Jk=function(){return this.h};_.t.Xc=function(){return this.f};_.t.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",AR);AR.prototype.getAdContainer=AR.prototype.Xc;AR.prototype.getAdDisplayContainer=AR.prototype.Jk;AR.prototype.getAdsLoader=AR.prototype.Lk;AR.Id="ima";
25
- AR.isSdkMissing=BR;CR.prototype.create=function(){return new AR};_.Xq(new CR);DR.prototype.name=function(){return lR};DR.prototype.isSupported=function(a,b){return a.namespace()===_.Fd?!1:BR()?(this.cd.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};DR.prototype.create=function(a){return new pR(a)};DR.prototype.create=DR.prototype.create;DR.prototype.isSupported=DR.prototype.isSupported;DR.prototype.name=DR.prototype.name;_.Tp(new DR);};
22
+ _.t.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.rb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Vh(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.l.contentComplete()})).then(function(){wR(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};rR.prototype.getPosition=rR.prototype.getPosition;
23
+ rR.prototype.setVolume=rR.prototype.setVolume;rR.prototype.getVolume=rR.prototype.getVolume;rR.prototype.skip=rR.prototype.skip;rR.prototype.pause=rR.prototype.pause;rR.prototype.resume=rR.prototype.resume;_.x(CR,_.zu);_.t=CR.prototype;_.t.onPlayerCreated=function(a){if(DR())return a.onError(new _.P(1,9,1E4));this.f=_.Wp(_.$d,{"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(_.va);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.Lk=function(){return this.a};_.t.Jk=function(){return this.h};_.t.Xc=function(){return this.f};_.t.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",CR);CR.prototype.getAdContainer=CR.prototype.Xc;CR.prototype.getAdDisplayContainer=CR.prototype.Jk;CR.prototype.getAdsLoader=CR.prototype.Lk;CR.Id="ima";
25
+ CR.isSdkMissing=DR;ER.prototype.create=function(){return new CR};_.$q(new ER);FR.prototype.name=function(){return nR};FR.prototype.isSupported=function(a,b){return a.namespace()===_.Ed?!1:DR()?(this.cd.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};FR.prototype.create=function(a){return new rR(a)};FR.prototype.create=FR.prototype.create;FR.prototype.isSupported=FR.prototype.isSupported;FR.prototype.name=FR.prototype.name;_.Tp(new FR);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}