@castlabs/prestoplay 6.3.0 → 6.4.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 (58) hide show
  1. package/CHANGELOG.md +48 -1
  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 +108 -107
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +410 -398
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +72 -69
  10. package/cjs/cl.externs.js +55 -52
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +49 -44
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +32 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +259 -254
  17. package/cjs/cl.muxdata.js +12 -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 +69 -69
  22. package/cjs/cl.thumbnails.js +24 -23
  23. package/cjs/cl.tizen.js +69 -69
  24. package/cjs/cl.ttml.js +27 -26
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +18 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -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 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +353 -345
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -63
  38. package/cl.externs.js +55 -52
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -37
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +232 -221
  45. package/cl.muxdata.js +8 -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 -21
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -14
  58. package/package.json +2 -2
package/cjs/cl.htmlcue.js CHANGED
@@ -1,36 +1,36 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var xH="Stylesheet ",yH="Unsupported unit",zH="clpp-text-plain",AH="clpp-text-ttml",BH="clpp.htmlcue.HtmlTextDisplayer",CH="initial",DH=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},EH=function(){},FH=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},HH=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return GH[c]});
3
- return a},IH=function(a,b){for(var c in a)b.style[c]=a[c]},JH=function(a,b){return 0===a?"0":a+b},KH=function(a,b){return 1>Math.abs(a-b)||a<b},LH=function(a,b){return a<b&&1<Math.abs(a-b)},MH=function(a,b){return a>b&&1<Math.abs(a-b)},NH=function(a,b){return 1>Math.abs(a-b)||a>b},OH=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f},PH=function(a){return new OH(a.f,a.g,a.h,a.a,a.height,a.width)},QH=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,
4
- 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 OH(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},RH=function(a,b){return b.some(function(c){return LH(a.f,c.g)&&MH(a.g,c.f)&&LH(a.h,c.a)&&MH(a.a,c.h)})},SH=function(a,
5
- b){return NH(a.h,b.h)&&KH(a.a,b.a)&&NH(a.f,b.f)&&KH(a.g,b.g)},TH=function(a,b,c){switch(c){case "+x":return LH(a.f,b.f);case "-x":return MH(a.g,b.g);case "+y":return LH(a.h,b.h);case "-y":return MH(a.a,b.a);default:throw Error("Unknown axis");}},UH=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},VH=function(a,b,c){UH.call(this,a.id,"clpp-text-cue",c);this.j=b;this.f=a;this.g=!!this.f.backgroundImage},XH=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();
6
- b=c.height/d.length;c=c.width/d.length;return WH(a)?b:c},$H=function(a,b,c){return WH(a)&&_.J.la(c)?JH(c,_.Ud):(YH(a)||ZH(a))&&_.J.la(b)?JH(b,"%"):CH},YH=function(a){return a.f.writingMode===_.Ge},ZH=function(a){return a.f.writingMode===_.He},WH=function(a){return a.f.writingMode===_.og},aI=function(a,b,c){return(YH(a)||ZH(a))&&_.J.la(c)?JH(c,_.Ud):YH(a)&&_.J.R(c)?JH(0,_.Ud):WH(a)&&_.J.la(b)?JH(b,"%"):CH},bI=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.jd:return a.f.position;
7
- case "auto":case _.sc:return a.f.position-a.f.size/2;case _.kd:return a.f.position-a.f.size}return 0},cI=function(a){switch(a.f.positionAlign){case _.jd:return _.gd;case "auto":case _.sc:return _.ng;case _.kd:return _.ae}return a.f.textAlign},dI=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.gd:case _.gd:return _.jd;case _.ng:return _.sc;case _.ae:case _.ae:return _.kd}return a.f.positionAlign},eI=function(a){switch(a.f.writingMode){case _.og:return"horizontal-tb";case _.Ge:return _.Ge;
8
- case _.He:return _.He;default:throw Error("Unknown writing mode");}},fI=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=QH(a.a);this.g=[]},gI=function(a,b){if(a.h)switch(b.writingMode){case _.og:return["-y"];case _.Ge:return["+x"];case _.He:return["-x"]}var c=[];switch(b.writingMode){case _.og:c=["+y","-y"];break;case _.Ge:c=["+x","-x"];break;case _.He:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},hI=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);
9
- a.a=QH(a.j.a)},iI=function(a,b,c){UH.call(this,a,b,c);this.g=null;this.j=[]},jI=function(a,b){hI(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)},kI=function(a,b){iI.call(this,a.id,"clpp-text-cue-region",b);this.f=a},lI=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.tg)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(yH);},oI=function(a,b){this.f=new _.G("clpp.htmlcue.StyleManager");
10
- this.w=[];this.m=a.getSurface().getContainer();this.j="clpp-video-"+mI++;this.h=b;this.o=[];this.a=nI(this,this.h);this.g=nI(this,this.h+"-sandbox");this.g.disabled=!0;this.m&&_.Lm(this.m,this.j);this.f.debug(xH+this.h+" has been created.")},pI=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},qI=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===e.trim().indexOf("."+
11
- a.j+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},rI=function(a,b){var c="."+a.j+" .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)},nI=function(a,b){var c=document.createElement(_.oe);c.title=b;var d=document.head;d.appendChild(c);
12
- sI(a,d,b);a.f.debug('Created HTML style element style[title\x3d"'+b+'"]');return c.sheet},sI=function(a,b,c){var d=new MutationObserver(function(e){e.forEach(function(f){f.removedNodes.forEach(function(g){g.title===c&&a.f.error('PRESTOplay HTML style element style[title\x3d"'+c+'"] has been unexpectedly removed! Some styles will not work!')})})});d.observe(b,{subtree:!1,childList:!0});a.w.push(function(){return d.disconnect()})},vI=function(a){_.hp.call(this,a);var b=this;this.N=new _.G(BH);this.l=
13
- a;this.L=tI(a);this.h=!1;this.f=[];this.w=a.getSurface().getContainer();this.g=new oI(a,"CLPP Subtitle Styles");this.j=new oI(a,"CLPP Custom Subtitle Styles");this.a=new iI(null,"clpp-text-container",{});this.o=new _.Do(a.getSurface(),this.$g.bind(this));this.J=null;this.w?(this.w.appendChild(this.a.a),this.a.init(null)):this.N.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.D=new _.qh(function(){uI(b)});
14
- this.A=new Map;this.m=null},tI=function(a){a=_.J.Ha(a.getConfiguration().htmlcue||{});_.J.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.J.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},wI=function(a,b){return a.startTime<=b&&a.endTime>b},uI=function(a,b){if((b||a.h)&&a.w){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.km){a.J=c;c=xI(a,c);var d;(d=b)||(d=a.m,d=!(null===d&&null===c||null!==d&&null!==c&&d.start===c.start&&d.end===c.end));if(d&&(a.m=c,yI(a),a.j&&(d="::cue {",
15
- a.getFontColor()&&(d+="color: "+a.getFontColor()+";"),a.getBackgroundColor()&&(d+="background-color: "+a.getBackgroundColor()+";"),a.getFontFamily()&&(d+="font-family: "+a.getFontFamily()+";"),a.getEdgeType()!==_.gp&&(d+="text-shadow: "+_.mp(a)+";"),d+="}",pI(a.j),a.j.appendRule(d)),null!==c)){c=a.f.slice(c.start,c.end+1);c=_.u(c);for(var e=c.next();!e.done;e=c.next()){d=a;e=e.value;var f=d.a.a,g=null;switch(e.payloadType){case _.Pe:g="clpp-text-vtt";break;case _.ye:g=AH;break;case _.mg:g=zH}g&&!f.classList.contains(g)&&
16
- _.Lm(f,g);f=QH(d.a.a);if(0===f.width||0===f.height)d.N.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.");else{IH({fontSize:zI(d,e.containerRows)},d.a.a);f=null;g=e.payloadType===_.Pe;var k=e.payloadType===_.ye;e.region&&(g||k||e.backgroundImage)&&(d.A.has(e.region.id)?f=d.A.get(e.region.id):(f=new kI(e.region,{}),d.A.set(e.region.id,f),jI(d.a,f)));e=new VH(e,d.L,{});f?jI(f,e):jI(d.a,
17
- e)}}}}}},xI=function(a,b){var c=DH(a.f,function(e){return wI(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&wI(a.f[d-1],b);)d--;for(;c+1<a.f.length&&wI(a.f[c+1],b);)c++;return{start:d,end:c}},AI=function(a){yI(a);a.J=null;a.m=null;a.f=[]},yI=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(AH);b.classList.remove(zH);a=a.a;hI(a.g);a.j=[]}},zI=function(a,b){var c=QH(a.a.a).height;if(null!==a.I)return a.getFontSize();
18
- if(null!==a.C){var d=a.getFontSizePercent();return Math.round(c*d)+_.Ud}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Ud;d=a.getFontSizePercent();return Math.round(c*d)+_.Ud},BI=function(){},CI=function(){};
19
- EH.prototype.parse=function(a){a={input:a};for(var b=_.Nm(_.Oc),c=[],d=b,e;null!==(e=FH(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=DI[f];k?(k=_.Nm(k),(f=EI[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||FI[g.localName]&&FI[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
- d=g)}}else d.appendChild(document.createTextNode(HH(e)));return b};var DI={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},EI={v:"voice",lang:"lang"},FI={rt:"ruby"},GH={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};UH.prototype.init=function(){this.h=!0};UH.prototype.w=function(){return!1};_.v(VH,UH);VH.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
21
- VH.prototype.init=function(a){UH.prototype.init.call(this,a);if(this.g)_.Lm(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else{var b=this.f;if(b.payloadType===_.ye){var c=_.Nm(_.Oc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Pe?b=(new EH).parse(b.payload):(c=_.Nm(_.Oc),c.textContent=b.payload,b=c);_.Lm(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=c.next();!d.done;d=
22
- c.next())_.Lm(b,d.value);IH({writingMode:eI(this)},b);this.a.appendChild(b);_.Lm(this.a,"clpp-text-wrapper");b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Lm(this.a,"clpp-text-wrapper__"+c.value);_.J.R(this.f.line)&&(this.f.lineInterpretation=_.pg,this.f.line=WH(this)?-1:0);b=eI(this);IH({writingMode:b,webkitWritingMode:b,direction:CH,textAlign:cI(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){b=bI(this,dI(this));c=aI(this,b,null);d=$H(this,b,null);var e=ZH(this)&&
23
- _.J.R(null)?JH(0,_.Ud):CH;IH({position:"absolute",left:c,right:e,top:d,width:WH(this)?JH(this.f.size,"%"):CH,height:YH(this)||ZH(this)?JH(this.f.size,"%"):CH},this.a);c=this.f;a=WH(this)?a.height:a.width;d=XH(this);if(c.lineInterpretation===_.pg)e=d*Math.round(c.line),Math.abs(e)>a&&(e=d*(0>c.line?0:-1)),0>e&&(e+=a);else{e=d/a*100;var f=c.line;switch(c.lineAlign){case _.sc:f-=e/2;break;case _.Xc:f-=e}e=Math.round(f/100*a)}ZH(this)&&(e=a-e-d);a=e;c=aI(this,b,a);d=ZH(this)&&_.J.R(a)?JH(0,_.Ud):CH;IH({left:c,
24
- right:d,top:$H(this,b,a)},this.a)}}};VH.prototype.m=function(){return _.Nm(_.Oc)};fI.prototype.append=function(a){var b=a.a;b.style.visibility=_.cd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=QH(a.a);var d=gI(this,a.f),e=XH(a),f=PH(c),g=null,k=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;TH(c,this.a,l)||SH(c,this.a)&&RH(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||SH(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
25
- l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>k&&(g=PH(c),k=l);c=PH(f)}c=g||f}IH({top:JH(c.h-this.a.h,_.Ud),bottom:JH(this.a.a-c.a,_.Ud),left:JH(c.f-this.a.f,_.Ud),right:JH(this.a.g-c.g,_.Ud),height:JH(c.height,_.Ud),width:JH(c.width,_.Ud)},a.a)}b.style.visibility="visible";this.g.push(QH(a.a))};_.v(iI,UH);iI.prototype.init=function(){this.g=new fI(this);this.h=!0};iI.prototype.m=function(){var a=_.Nm(_.Oc);_.Lm(a,this.o);this.id&&(a.id=this.id);return a};_.v(kI,iI);
26
- kI.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.tg:b=b.width/100*a.width;break a;default:throw Error(yH);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.tg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(yH);d=a.height;var e=lI(this,d,a.height);IH(this.A,this.a);IH({left:JH(c,_.Ud),top:JH(e,_.Ud),width:JH(b,_.Ud),height:JH(d,_.Ud)},this.a);this.f.writingMode&&IH({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&IH({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Lm(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.tg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new VH(new _.sg(0,1,"Lorem ipsum",_.mg),{},{});c=d.a;this.a.appendChild(c);d.init(QH(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(yH);
28
- }a=lI(this,b,a.height);IH({top:JH(a,_.Ud),height:JH(b,_.Ud)},this.a);this.g=new fI(this,!0);this.h=!0};kI.prototype.ba=function(){return this.f.id};oI.prototype.appendRule=function(a){if(null!=this.a&&!this.o.some(function(c){return c===a})){var b=rI(this,a);if(qI(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.o.push(a)}else this.f.warn(xH+this.h+" ignoring the CSS rule because it's not safe: "+b)}};
29
- oI.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.w.forEach(function(c){return c()});a.w=[];pI(a);document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.m&&a.m.classList.remove(a.j);a.f.debug(xH+a.h+" has been destroyed.");_.z(b)})};var mI=0;_.v(vI,_.hp);_.t=vI.prototype;
30
- _.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={ed:c.ed},e=d.next())c.ed=e.value,this.f.some(function(f){return function(g){var k=f.ed;return g.payload!==k.payload?!1:
31
- g.startTime!==k.startTime?!1:g.endTime!==k.endTime?!1:!0}}(c))||this.f.push(c.ed);this.m=null;uI(this,!1)}};_.t.lb=function(){null==this.g||uI(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();AI(a);a.D.stop();return _.w(b,a.g.destroy(),2)}if(3!=b.a)return a.g=null,_.w(b,a.j.destroy(),3);a.j=null;a.w.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
32
- _.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;uI(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.Ya(.25),this.L.enableResizeObserver&&this.o.start(),uI(this,!0)):(this.D.stop(),this.o.stop(),AI(this)))};_.t.$g=function(){uI(this,!0)};_.B(BH,vI);vI.prototype.setTextVisibility=vI.prototype.setTextVisibility;
33
- vI.prototype.isTextVisible=vI.prototype.isTextVisible;vI.prototype.remove=vI.prototype.remove;vI.prototype.destroy=vI.prototype.destroy;vI.prototype.append=vI.prototype.append;BI.prototype.W=function(a){return!!a.enableHtmlCue&&!_.yi()};BI.prototype.create=function(a){return new vI(a)};BI.prototype.create=BI.prototype.create;BI.prototype.isSupported=BI.prototype.W;_.v(CI,_.Kn);CI.prototype.Da=function(){_.Jl("html",new BI)};CI.prototype.va=function(){};CI.prototype.id=function(){return _.qe};_.B("clpp.htmlcue.HtmlCueComponent",CI);};
2
+ var f=function(window){var rI="Stylesheet ",sI="Unsupported unit",tI="clpp-text-plain",uI="clpp-text-ttml",vI="clpp.htmlcue.HtmlTextDisplayer",wI="initial",xI=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},yI=function(){},zI=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},BI=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return AI[c]});
3
+ return a},CI=function(a,b){for(var c in a)b.style[c]=a[c]},DI=function(a,b){return 0===a?"0":a+b},EI=function(a,b){return 1>Math.abs(a-b)||a<b},FI=function(a,b){return a<b&&1<Math.abs(a-b)},GI=function(a,b){return a>b&&1<Math.abs(a-b)},HI=function(a,b){return 1>Math.abs(a-b)||a>b},II=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f},JI=function(a){return new II(a.f,a.g,a.h,a.a,a.height,a.width)},KI=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,
4
+ 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 II(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},LI=function(a,b){return b.some(function(c){return FI(a.f,c.g)&&GI(a.g,c.f)&&FI(a.h,c.a)&&GI(a.a,c.h)})},MI=function(a,
5
+ b){return HI(a.h,b.h)&&EI(a.a,b.a)&&HI(a.f,b.f)&&EI(a.g,b.g)},NI=function(a,b,c){switch(c){case "+x":return FI(a.f,b.f);case "-x":return GI(a.g,b.g);case "+y":return FI(a.h,b.h);case "-y":return GI(a.a,b.a);default:throw Error("Unknown axis");}},OI=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},PI=function(a,b,c){OI.call(this,a.id,"clpp-text-cue",c);this.j=b;this.f=a;this.g=!!this.f.backgroundImage},RI=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();
6
+ b=c.height/d.length;c=c.width/d.length;return QI(a)?b:c},UI=function(a,b,c){return QI(a)&&_.K.oa(c)?DI(c,_.Zd):(SI(a)||TI(a))&&_.K.oa(b)?DI(b,"%"):wI},SI=function(a){return a.f.writingMode===_.Me},TI=function(a){return a.f.writingMode===_.Ne},QI=function(a){return a.f.writingMode===_.sg},VI=function(a,b,c){return(SI(a)||TI(a))&&_.K.oa(c)?DI(c,_.Zd):SI(a)&&_.K.R(c)?DI(0,_.Zd):QI(a)&&_.K.oa(b)?DI(b,"%"):wI},WI=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.od:return a.f.position;
7
+ case "auto":case _.yc:return a.f.position-a.f.size/2;case _.pd:return a.f.position-a.f.size}return 0},XI=function(a){switch(a.f.positionAlign){case _.od:return _.ld;case "auto":case _.yc:return _.rg;case _.pd:return _.fe}return a.f.textAlign},YI=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ld:case _.ld:return _.od;case _.rg:return _.yc;case _.fe:case _.fe:return _.pd}return a.f.positionAlign},ZI=function(a){switch(a.f.writingMode){case _.sg:return"horizontal-tb";case _.Me:return _.Me;
8
+ case _.Ne:return _.Ne;default:throw Error("Unknown writing mode");}},$I=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=KI(a.a);this.g=[]},aJ=function(a,b){if(a.h)switch(b.writingMode){case _.sg:return["-y"];case _.Me:return["+x"];case _.Ne:return["-x"]}var c=[];switch(b.writingMode){case _.sg:c=["+y","-y"];break;case _.Me:c=["+x","-x"];break;case _.Ne:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},bJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);
9
+ a.a=KI(a.j.a)},cJ=function(a,b,c){OI.call(this,a,b,c);this.g=null;this.j=[]},dJ=function(a,b){bJ(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)},eJ=function(a,b){cJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},fJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.xg)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(sI);},hJ=function(a,b){this.f=new _.H("clpp.htmlcue.StyleManager");
10
+ this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=gJ(this,this.h,this.j);this.g=gJ(this,this.h,this.j,!0);this.g.disabled=!0;this.f.debug(rI+this.h+" has been created.")},iJ=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},jJ=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===e.trim().indexOf("."+a.j+" ")}))}catch(e){}0<a.g.cssRules.length&&
11
+ a.g.deleteRule(0);return c},kJ=function(a,b){var c="."+a.j+" .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)},gJ=function(a,b,c,d){var e=document.createElement(_.ue),f=e.dataset;f.name=b;f["for"]=c;d&&(f.name=b+" (sandbox)",f.sandbox=!0);c=document.head;
12
+ c.appendChild(e);lJ(a,c,b);a.f.debug("Created HTML style element #"+b+".");return e.sheet},lJ=function(a,b,c){var d=new MutationObserver(function(e){e.forEach(function(f){f.removedNodes.forEach(function(g){g.id===c&&a.f.error("PRESTOplay HTML style element #"+c+" has been unexpectedly removed! Some styles will not work!")})})});d.observe(b,{subtree:!1,childList:!0});a.o.push(function(){return d.disconnect()})},oJ=function(a){_.wp.call(this,a);var b=this;this.O=new _.H(vI);this.l=a;this.L=mJ(a);this.h=
13
+ !1;this.f=[];this.C=a.getSurface().getContainer();this.g=new hJ(a,"CLPP Subtitle Styles");this.j=new hJ(a,"CLPP Custom Subtitle Styles");this.a=new cJ(null,"clpp-text-container",{});this.o=new _.So(a.getSurface(),this.jh.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.O.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.D=new _.Ch(function(){nJ(b)});this.w=new Map;this.m=
14
+ null},mJ=function(a){a=_.K.Ma(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},pJ=function(a,b){return a.startTime<=b&&a.endTime>b},nJ=function(a,b){if((b||a.h)&&a.C){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.xm){a.J=c;c=qJ(a,c);var d;(d=b)||(d=a.m,d=!(null===d&&null===c||null!==d&&null!==c&&d.start===c.start&&d.end===c.end));if(d&&(a.m=c,rJ(a),a.j&&(d="::cue {",a.getFontColor()&&
15
+ (d+="color: "+a.getFontColor()+";"),a.getBackgroundColor()&&(d+="background-color: "+a.getBackgroundColor()+";"),a.getFontFamily()&&(d+="font-family: "+a.getFontFamily()+";"),a.getEdgeType()!==_.vp&&(d+="text-shadow: "+_.Bp(a)+";"),d+="}",iJ(a.j),a.j.appendRule(d)),null!==c)){c=a.f.slice(c.start,c.end+1);c=_.u(c);for(var e=c.next();!e.done;e=c.next()){d=a;e=e.value;var f=d.a.a,g=null;switch(e.payloadType){case _.Ve:g="clpp-text-vtt";break;case _.Ee:g=uI;break;case _.qg:g=tI}g&&!f.classList.contains(g)&&
16
+ _.Ym(f,g);f=KI(d.a.a);if(0===f.width||0===f.height)d.O.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.");else{CI({fontSize:sJ(d,e.containerRows)},d.a.a);f=null;g=e.payloadType===_.Ve;var h=e.payloadType===_.Ee;e.region&&(g||h||e.backgroundImage)&&(d.w.has(e.region.id)?f=d.w.get(e.region.id):(f=new eJ(e.region,{}),d.w.set(e.region.id,f),dJ(d.a,f)));e=new PI(e,d.L,{});f?dJ(f,e):dJ(d.a,
17
+ e)}}}}}},qJ=function(a,b){var c=xI(a.f,function(e){return pJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&pJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&pJ(a.f[c+1],b);)c++;return{start:d,end:c}},tJ=function(a){rJ(a);a.J=null;a.m=null;a.f=[]},rJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(uI);b.classList.remove(tI);a=a.a;bJ(a.g);a.j=[]}},sJ=function(a,b){var c=KI(a.a.a).height;if(null!==a.I)return a.getFontSize();
18
+ if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Zd}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Zd;d=a.getFontSizePercent();return Math.round(c*d)+_.Zd},uJ=function(){},vJ=function(){};
19
+ yI.prototype.parse=function(a){a={input:a};for(var b=_.$m(_.Tc),c=[],d=b,e;null!==(e=zI(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=wJ[f];h?(h=_.$m(h),(f=xJ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||yJ[g.localName]&&yJ[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
+ d=g)}}else d.appendChild(document.createTextNode(BI(e)));return b};var wJ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},xJ={v:"voice",lang:"lang"},yJ={rt:"ruby"},AI={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};OI.prototype.init=function(){this.h=!0};OI.prototype.w=function(){return!1};_.v(PI,OI);PI.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
21
+ PI.prototype.init=function(a){OI.prototype.init.call(this,a);if(this.g)_.Ym(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else{var b=this.f;if(b.payloadType===_.Ee){var c=_.$m(_.Tc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ve?b=(new yI).parse(b.payload):(c=_.$m(_.Tc),c.textContent=b.payload,b=c);_.Ym(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=c.next();!d.done;d=
22
+ c.next())_.Ym(b,d.value);CI({writingMode:ZI(this)},b);this.a.appendChild(b);_.Ym(this.a,"clpp-text-wrapper");b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Ym(this.a,"clpp-text-wrapper__"+c.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.tg,this.f.line=QI(this)?-1:0);b=ZI(this);CI({writingMode:b,webkitWritingMode:b,direction:wI,textAlign:XI(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){b=WI(this,YI(this));c=VI(this,b,null);d=UI(this,b,null);var e=TI(this)&&
23
+ _.K.R(null)?DI(0,_.Zd):wI;CI({position:"absolute",left:c,right:e,top:d,width:QI(this)?DI(this.f.size,"%"):wI,height:SI(this)||TI(this)?DI(this.f.size,"%"):wI},this.a);c=this.f;a=QI(this)?a.height:a.width;d=RI(this);if(c.lineInterpretation===_.tg)e=d*Math.round(c.line),Math.abs(e)>a&&(e=d*(0>c.line?0:-1)),0>e&&(e+=a);else{e=d/a*100;var f=c.line;switch(c.lineAlign){case _.yc:f-=e/2;break;case _.bd:f-=e}e=Math.round(f/100*a)}TI(this)&&(e=a-e-d);a=e;c=VI(this,b,a);d=TI(this)&&_.K.R(a)?DI(0,_.Zd):wI;CI({left:c,
24
+ right:d,top:UI(this,b,a)},this.a)}}};PI.prototype.m=function(){return _.$m(_.Tc)};$I.prototype.append=function(a){var b=a.a;b.style.visibility=_.hd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=KI(a.a);var d=aJ(this,a.f),e=RI(a),f=JI(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;NI(c,this.a,l)||MI(c,this.a)&&LI(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||MI(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
25
+ l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>h&&(g=JI(c),h=l);c=JI(f)}c=g||f}CI({top:DI(c.h-this.a.h,_.Zd),bottom:DI(this.a.a-c.a,_.Zd),left:DI(c.f-this.a.f,_.Zd),right:DI(this.a.g-c.g,_.Zd),height:DI(c.height,_.Zd),width:DI(c.width,_.Zd)},a.a)}b.style.visibility="visible";this.g.push(KI(a.a))};_.v(cJ,OI);cJ.prototype.init=function(){this.g=new $I(this);this.h=!0};cJ.prototype.m=function(){var a=_.$m(_.Tc);_.Ym(a,this.o);this.id&&(a.id=this.id);return a};_.v(eJ,cJ);
26
+ eJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.xg:b=b.width/100*a.width;break a;default:throw Error(sI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.xg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(sI);d=a.height;var e=fJ(this,d,a.height);CI(this.A,this.a);CI({left:DI(c,_.Zd),top:DI(e,_.Zd),width:DI(b,_.Zd),height:DI(d,_.Zd)},this.a);this.f.writingMode&&CI({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&CI({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Ym(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.xg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new PI(new _.wg(0,1,"Lorem ipsum",_.qg),{},{});c=d.a;this.a.appendChild(c);d.init(KI(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(sI);
28
+ }a=fJ(this,b,a.height);CI({top:DI(a,_.Zd),height:DI(b,_.Zd)},this.a);this.g=new $I(this,!0);this.h=!0};eJ.prototype.getId=function(){return this.f.id};hJ.prototype.appendRule=function(a){if(null!=this.a&&!this.m.some(function(c){return c===a})){var b=kJ(this,a);if(jJ(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.m.push(a)}else this.f.warn(rI+this.h+" ignoring the CSS rule because it's not safe: "+b)}};
29
+ hJ.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.o.forEach(function(c){return c()});a.o=[];iJ(a);document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.f.debug(rI+a.h+" has been destroyed.");_.z(b)})};_.v(oJ,_.wp);_.t=oJ.prototype;
30
+ _.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={kd:c.kd},e=d.next())c.kd=e.value,this.f.some(function(f){return function(g){var h=f.kd;return g.payload!==h.payload?!1:
31
+ g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.kd);this.m=null;nJ(this,!1)}};_.t.ob=function(){null==this.g||nJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();tJ(a);a.D.stop();return _.y(b,a.g.destroy(),2)}if(3!=b.a)return a.g=null,_.y(b,a.j.destroy(),3);a.j=null;a.C.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
32
+ _.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;nJ(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.L.enableResizeObserver&&this.o.start(),nJ(this,!0)):(this.D.stop(),this.o.stop(),tJ(this)))};_.t.jh=function(){nJ(this,!0)};_.C(vI,oJ);oJ.prototype.setTextVisibility=oJ.prototype.setTextVisibility;
33
+ oJ.prototype.isTextVisible=oJ.prototype.isTextVisible;oJ.prototype.remove=oJ.prototype.remove;oJ.prototype.destroy=oJ.prototype.destroy;oJ.prototype.append=oJ.prototype.append;uJ.prototype.W=function(a){return!!a.enableHtmlCue&&!_.Ki()};uJ.prototype.create=function(a){return new oJ(a)};uJ.prototype.create=uJ.prototype.create;uJ.prototype.isSupported=uJ.prototype.W;_.v(vJ,_.Zn);vJ.prototype.Ja=function(){_.Wl("html",new uJ)};vJ.prototype.Ca=function(){};vJ.prototype.id=function(){return _.we};_.C("clpp.htmlcue.HtmlCueComponent",vJ);};
34
34
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
35
35
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
36
36
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,27 +1,27 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var fH="clpp.ima.AdsManagerFactory",gH=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},hH=function(){},iH=function(a){this.a=a},jH=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.J.Ha(a.ima||{});this.m=this.l.Yb("ima").Bc();this.J=this.l.Yb("ima").g;this.o=this.l.Yb("ima").a;this.G=new _.Fo;this.N=new _.G("clpp.ima");this.h=this.a=null;this.f=new _.Qh;this.D=!1;this.w=new _.Wf;this.T=new hH;this.A=null;this.I=this.C=this.L=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.wi.bind(this));a.on(this.o,b,this.vi.bind(this));a.one(this.j,_.Yc,this.Di.bind(this))},kH=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.eh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Ei.bind(a));c.on(b,d.STARTED,a.gh.bind(a));c.on(b,d.LOG,a.mi.bind(a));c.on(b,d.AD_PROGRESS,a.ri.bind(a));c.on(b,d.AD_BUFFERING,a.ji.bind(a));c.on(b,d.FIRST_QUARTILE,
4
- a.bh.bind(a));c.on(b,d.MIDPOINT,a.ni.bind(a));c.on(b,d.THIRD_QUARTILE,a.hh.bind(a));c.on(b,d.PAUSED,a.pi.bind(a));c.on(b,d.RESUMED,a.si.bind(a));c.on(b,d.CLICK,a.ah.bind(a));c.on(b,d.SKIPPED,a.fh.bind(a));c.on(b,d.IMPRESSION,a.dh.bind(a));c.on(b,d.COMPLETE,a.ki.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Fi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.yi.bind(a))},lH=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=
5
- a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.jc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.jc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},nH=function(a){a.A=null;mH(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},oH=
6
- function(a){_.Mm(a.j,{visibility:"visible"})},mH=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new gH(c,a.B,a.L)});a.l.trigger(new _.I(b,d))},pH=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.l.onError(new _.K(1,9,10003,{errorType:c},b))},rH=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.w(d,a.G.canPlay(b),2);c=d.f;if(!c)return mH(a,_.gc),a.N.warn(_.ka),d["return"]();qH(a);_.z(d)})},sH=function(a,b){return _.A(function(c){if(1==
7
- c.a)return a.J.initialize(),_.w(c,b.play(),2);qH(a);_.z(c)})},qH=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},tH=function(){this.a=this.g=this.f=null},uH=function(){return!window.google||!google.ima||!google.ima.AdsLoader},vH=function(){},wH=function(){this.a=new _.G(fH)};_.t=gH.prototype;_.t.ob=function(){return"Google IMA SDK"};_.t.pb=function(){return google.ima.VERSION};_.t.ub=function(){return 0};_.t.ba=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.bc=function(){return this.f?this.f.getIsBumper():!1};
9
- _.t.Hb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.rb=function(){return this.a.getVastMediaWidth()};_.t.qb=function(){return this.a.getVastMediaHeight()};_.t.bb=function(){return this.a.getVastMediaBitrate()};_.t.Ra=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
10
- _.t.Ib=function(){return this.f?this.f.getTimeOffset():0};_.t.Jb=function(){return this.f?this.f.getAdPosition():1};_.t.tb=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()};gH.prototype.getWrapperCreativeIds=gH.prototype.getWrapperCreativeIds;gH.prototype.getWrapperAdSystems=gH.prototype.getWrapperAdSystems;
11
- gH.prototype.getWrapperAdIds=gH.prototype.getWrapperAdIds;gH.prototype.getSequenceLength=gH.prototype.tb;gH.prototype.getPositionInSequence=gH.prototype.Jb;gH.prototype.getPodTimeOffset=gH.prototype.Ib;gH.prototype.getPodIndex=gH.prototype.getPodIndex;gH.prototype.getPodType=gH.prototype.Ra;gH.prototype.getMediaBitrate=gH.prototype.bb;gH.prototype.getMediaHeight=gH.prototype.qb;gH.prototype.getMediaWidth=gH.prototype.rb;gH.prototype.getMediaUrl=gH.prototype.getMediaUrl;
12
- gH.prototype.getClickThroughUrl=gH.prototype.Hb;gH.prototype.isBumper=gH.prototype.bc;gH.prototype.getSkipTimeOffset=gH.prototype.getSkipTimeOffset;gH.prototype.getDuration=gH.prototype.getDuration;gH.prototype.getTitle=gH.prototype.getTitle;gH.prototype.getAdvertiserName=gH.prototype.getAdvertiserName;gH.prototype.getAdSystem=gH.prototype.getAdSystem;gH.prototype.getApiFramework=gH.prototype.getApiFramework;gH.prototype.getCreativeId=gH.prototype.getCreativeId;gH.prototype.getId=gH.prototype.ba;
13
- gH.prototype.getTechnology=gH.prototype.ub;gH.prototype.getAdManagerVersion=gH.prototype.pb;gH.prototype.getAdManagerName=gH.prototype.ob;hH.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}};iH.prototype.getCuePoints=function(){return this.a};iH.prototype.Kb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};iH.prototype.cb=function(){return 0<=this.a.indexOf(-1)};iH.prototype.hasPostroll=iH.prototype.cb;iH.prototype.hasPreroll=iH.prototype.Kb;iH.prototype.getCuePoints=iH.prototype.getCuePoints;_.t=jH.prototype;
14
- _.t.wi=function(a){var b=this;this.a=a.getAdsManager(this.j,lH(this));this.a.isCustomPlaybackUsed()?(this.N.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.K(1,9,10002)),this.dispose()):(this.h=new _.Do(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 iH(a),this.l.trigger(new _.I(_.Nb,{adsTimeline:this.g})),kH(this));this.f.resolve()};
15
- _.t.vi=function(a){pH(this,a.getError());this.f.resolve()};_.t.Ei=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.w(c,b.l.pause(),2);_.Mm(b.j,{visibility:_.cd});mH(b,_.wb,a);b.h.start();_.z(c)})};_.t.eh=function(a){a.getAd().isLinear()?mH(this,_.Db,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.gh=function(a){this.A=a.getAd().getDuration();mH(this,_.Jb,a);this.l.getSurface().show(this.m)};_.t.mi=function(a){a=a.getAdData();pH(this,a?a.adError:null);nH(this)};
16
- _.t.ri=function(a){mH(this,_.Gb,a)};_.t.ji=function(a){mH(this,_.yb,a)};_.t.bh=function(a){mH(this,_.Bb,a)};_.t.ni=function(a){mH(this,_.Eb,a)};_.t.hh=function(a){mH(this,_.Lb,a)};_.t.pi=function(a){mH(this,_.Fb,a)};_.t.si=function(a){mH(this,_.Hb,a)};_.t.ah=function(a){this.pause();mH(this,_.zb,a)};_.t.fh=function(a){mH(this,_.Ib,a);nH(this)};_.t.dh=function(a){mH(this,_.Cb,a)};_.t.ki=function(a){mH(this,_.Ab,a);nH(this)};
17
- _.t.Fi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();mH(this,_.xb);oH(this)};_.t.yi=function(){this.I=!0};_.t.Di=function(){this.L=!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!==_.me)throw new _.K(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.w(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.w(g,a.G.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.D?b.g.Kb()?_.w(c,rH(b),0):_.w(c,sH(b,a),0):_.w(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)};
2
+ var f=function(window){var $H="clpp.ima.AdsManagerFactory",aI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},bI=function(){},cI=function(a){this.a=a},dI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.K.Ma(a.ima||{});this.m=this.l.$b("ima").Dc();this.J=this.l.$b("ima").g;this.o=this.l.$b("ima").a;this.G=new _.Uo;this.O=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.ai;this.D=!1;this.w=new _.bg;this.T=new bI;this.A=null;this.I=this.C=this.L=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.Mi.bind(this));a.on(this.o,b,this.Li.bind(this));a.one(this.j,_.cd,this.Ti.bind(this))},eI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.nh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Ui.bind(a));c.on(b,d.STARTED,a.ph.bind(a));c.on(b,d.LOG,a.Fi.bind(a));c.on(b,d.AD_PROGRESS,a.Ji.bind(a));c.on(b,d.AD_BUFFERING,a.Ci.bind(a));c.on(b,d.FIRST_QUARTILE,
4
+ a.lh.bind(a));c.on(b,d.MIDPOINT,a.Gi.bind(a));c.on(b,d.THIRD_QUARTILE,a.qh.bind(a));c.on(b,d.PAUSED,a.Ii.bind(a));c.on(b,d.RESUMED,a.Ki.bind(a));c.on(b,d.CLICK,a.kh.bind(a));c.on(b,d.SKIPPED,a.oh.bind(a));c.on(b,d.IMPRESSION,a.mh.bind(a));c.on(b,d.COMPLETE,a.Di.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Vi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Oi.bind(a))},fI=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===_.pc?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===_.pc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},hI=function(a){a.A=null;gI(a,_.Qb);a.m&&a.l.getSurface().hide(a.m)},iI=
6
+ function(a){_.Zm(a.j,{visibility:"visible"})},gI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new aI(c,a.B,a.L)});a.l.trigger(new _.J(b,d))},jI=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},lI=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.y(d,a.G.canPlay(b),2);c=d.f;if(!c)return gI(a,_.nc),a.O.warn(_.ma),d["return"]();kI(a);_.z(d)})},mI=function(a,b){return _.A(function(c){if(1==
7
+ c.a)return a.J.initialize(),_.y(c,b.play(),2);kI(a);_.z(c)})},kI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},nI=function(){this.a=this.g=this.f=null},oI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},pI=function(){},qI=function(){this.a=new _.H($H)};_.t=aI.prototype;_.t.sb=function(){return"Google IMA SDK"};_.t.tb=function(){return google.ima.VERSION};_.t.yb=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.Ib=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Gd&&typeof b[d].clickThroughUrl===_.se});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.vb=function(){return this.a.getVastMediaWidth()};_.t.ub=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.Jb=function(){return this.f?this.f.getTimeOffset():0};_.t.Kb=function(){return this.f?this.f.getAdPosition():1};_.t.xb=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()};aI.prototype.getWrapperCreativeIds=aI.prototype.getWrapperCreativeIds;aI.prototype.getWrapperAdSystems=aI.prototype.getWrapperAdSystems;
11
+ aI.prototype.getWrapperAdIds=aI.prototype.getWrapperAdIds;aI.prototype.getSequenceLength=aI.prototype.xb;aI.prototype.getPositionInSequence=aI.prototype.Kb;aI.prototype.getPodTimeOffset=aI.prototype.Jb;aI.prototype.getPodIndex=aI.prototype.getPodIndex;aI.prototype.getPodType=aI.prototype.Ua;aI.prototype.getMediaBitrate=aI.prototype.gb;aI.prototype.getMediaHeight=aI.prototype.ub;aI.prototype.getMediaWidth=aI.prototype.vb;aI.prototype.getMediaUrl=aI.prototype.getMediaUrl;
12
+ aI.prototype.getClickThroughUrl=aI.prototype.Ib;aI.prototype.isBumper=aI.prototype.dc;aI.prototype.getSkipTimeOffset=aI.prototype.getSkipTimeOffset;aI.prototype.getDuration=aI.prototype.getDuration;aI.prototype.getTitle=aI.prototype.getTitle;aI.prototype.getAdvertiserName=aI.prototype.getAdvertiserName;aI.prototype.getAdSystem=aI.prototype.getAdSystem;aI.prototype.getApiFramework=aI.prototype.getApiFramework;aI.prototype.getCreativeId=aI.prototype.getCreativeId;aI.prototype.getId=aI.prototype.getId;
13
+ aI.prototype.getTechnology=aI.prototype.yb;aI.prototype.getAdManagerVersion=aI.prototype.tb;aI.prototype.getAdManagerName=aI.prototype.sb;bI.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}};cI.prototype.getCuePoints=function(){return this.a};cI.prototype.Lb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};cI.prototype.hb=function(){return 0<=this.a.indexOf(-1)};cI.prototype.hasPostroll=cI.prototype.hb;cI.prototype.hasPreroll=cI.prototype.Lb;cI.prototype.getCuePoints=cI.prototype.getCuePoints;_.t=dI.prototype;
14
+ _.t.Mi=function(a){var b=this;this.a=a.getAdsManager(this.j,fI(this));this.a.isCustomPlaybackUsed()?(this.O.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 _.So(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 cI(a),this.l.trigger(new _.J(_.Tb,{adsTimeline:this.g})),eI(this));this.f.resolve()};
15
+ _.t.Li=function(a){jI(this,a.getError());this.f.resolve()};_.t.Ui=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.y(c,b.l.pause(),2);_.Zm(b.j,{visibility:_.hd});gI(b,_.Bb,a);b.h.start();_.z(c)})};_.t.nh=function(a){a.getAd().isLinear()?gI(this,_.Jb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.ph=function(a){this.A=a.getAd().getDuration();gI(this,_.Pb,a);this.l.getSurface().show(this.m)};_.t.Fi=function(a){a=a.getAdData();jI(this,a?a.adError:null);hI(this)};
16
+ _.t.Ji=function(a){gI(this,_.Mb,a)};_.t.Ci=function(a){gI(this,_.Eb,a)};_.t.lh=function(a){gI(this,_.Hb,a)};_.t.Gi=function(a){gI(this,_.Kb,a)};_.t.qh=function(a){gI(this,_.Rb,a)};_.t.Ii=function(a){gI(this,_.Lb,a)};_.t.Ki=function(a){gI(this,_.Nb,a)};_.t.kh=function(a){this.pause();gI(this,_.Fb,a)};_.t.oh=function(a){gI(this,_.Ob,a);hI(this)};_.t.mh=function(a){gI(this,_.Ib,a)};_.t.Di=function(a){gI(this,_.Gb,a);hI(this)};
17
+ _.t.Vi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();gI(this,_.Cb);iI(this)};_.t.Oi=function(){this.I=!0};_.t.Ti=function(){this.L=!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!==_.se)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.G.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.D?b.g.Lb()?_.y(c,lI(b),0):_.y(c,mI(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)};
20
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.D&&a.g&&a.g.cb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.Xf(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(){oH(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};jH.prototype.getPosition=jH.prototype.getPosition;
22
- jH.prototype.setVolume=jH.prototype.setVolume;jH.prototype.getVolume=jH.prototype.getVolume;jH.prototype.skip=jH.prototype.skip;jH.prototype.pause=jH.prototype.pause;jH.prototype.resume=jH.prototype.resume;_.v(tH,_.rp);_.t=tH.prototype;_.t.onPlayerCreated=function(a){if(uH())return a.onError(new _.K(1,9,1E4));this.f=_.Km(_.Oc,{"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(_.oa);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.Th=function(){return this.a};_.t.Rh=function(){return this.g};_.t.Bc=function(){return this.f};_.t.id=function(){return"ima"};_.B("clpp.ima.ImaPlugin",tH);tH.prototype.getAdContainer=tH.prototype.Bc;tH.prototype.getAdDisplayContainer=tH.prototype.Rh;tH.prototype.getAdsLoader=tH.prototype.Th;tH.Id="ima";
24
- tH.isSdkMissing=uH;vH.prototype.create=function(){return new tH};_.Fn(new vH);wH.prototype.name=function(){return fH};wH.prototype.W=function(a,b){return a.namespace()===_.yc?!1:uH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};wH.prototype.create=function(a){return new jH(a)};wH.prototype.create=wH.prototype.create;wH.prototype.isSupported=wH.prototype.W;wH.prototype.name=wH.prototype.name;_.Hm(new wH);};
21
+ _.t.dispose=function(){var a=this;return(new Promise(function(b){a.D&&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)}),_.cg(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(){iI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};dI.prototype.getPosition=dI.prototype.getPosition;
22
+ dI.prototype.setVolume=dI.prototype.setVolume;dI.prototype.getVolume=dI.prototype.getVolume;dI.prototype.skip=dI.prototype.skip;dI.prototype.pause=dI.prototype.pause;dI.prototype.resume=dI.prototype.resume;_.v(nI,_.Gp);_.t=nI.prototype;_.t.onPlayerCreated=function(a){if(oI())return a.onError(new _.L(1,9,1E4));this.f=_.Xm(_.Tc,{"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(_.ia);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.ci=function(){return this.a};_.t.ai=function(){return this.g};_.t.Dc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",nI);nI.prototype.getAdContainer=nI.prototype.Dc;nI.prototype.getAdDisplayContainer=nI.prototype.ai;nI.prototype.getAdsLoader=nI.prototype.ci;nI.Id="ima";
24
+ nI.isSdkMissing=oI;pI.prototype.create=function(){return new nI};_.Un(new pI);qI.prototype.name=function(){return $H};qI.prototype.W=function(a,b){return a.namespace()===_.Dc?!1:oI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};qI.prototype.create=function(a){return new dI(a)};qI.prototype.create=qI.prototype.create;qI.prototype.isSupported=qI.prototype.W;qI.prototype.name=qI.prototype.name;_.Um(new qI);};
25
25
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
26
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
27
  else{_=this.clpp._;(f.call(g,this));}