@castlabs/prestoplay 6.4.0 → 6.4.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 (58) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +103 -103
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +414 -398
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +53 -132
  11. package/cjs/cl.freewheel.js +21 -21
  12. package/cjs/cl.hls.js +46 -48
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +21 -21
  16. package/cjs/cl.mse.js +250 -250
  17. package/cjs/cl.muxdata.js +12 -12
  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.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +69 -69
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +18 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +15 -15
  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 +85 -85
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +360 -351
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +48 -131
  39. package/cl.freewheel.js +17 -17
  40. package/cl.hls.js +39 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +15 -15
  44. package/cl.mse.js +228 -228
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +14 -14
  58. package/package.json +3 -1
package/cjs/cl.htmlcue.js CHANGED
@@ -1,36 +1,35 @@
1
1
  (function(){var g={}; var _ = _ || {}
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);};
2
+ var f=function(window){var II="CLPP Subtitle Styles",JI="Unsupported unit",KI="clpp-text-plain",LI="clpp-text-ttml",MI="clpp.htmlcue.HtmlTextDisplayer",NI="initial",OI=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},PI=function(){},QI=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},SI=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
+ function(c){return RI[c]});return a},UI=function(a,b){TI(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){TI(a,c)})},TI=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},VI=function(a,b){return 0===a?"0":a+b},WI=function(a,b){return 1>Math.abs(a-b)||a<b},XI=function(a,b){return a<b&&1<Math.abs(a-b)},YI=function(a,b){return a>b&&1<Math.abs(a-b)},ZI=function(a,b){return 1>Math.abs(a-b)||a>b},$I=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=
4
+ f},aJ=function(a){return new $I(a.f,a.g,a.h,a.a,a.height,a.width)},bJ=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new $I(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
+ d-e)},cJ=function(a,b){return b.some(function(c){return XI(a.f,c.g)&&YI(a.g,c.f)&&XI(a.h,c.a)&&YI(a.a,c.h)})},dJ=function(a,b){return ZI(a.h,b.h)&&WI(a.a,b.a)&&ZI(a.f,b.f)&&WI(a.g,b.g)},eJ=function(a,b,c){switch(c){case "+x":return XI(a.f,b.f);case "-x":return YI(a.g,b.g);case "+y":return XI(a.h,b.h);case "-y":return YI(a.a,b.a);default:throw Error("Unknown axis");}},fJ=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},gJ=function(a,b,c){fJ.call(this,a.id,"clpp-text-cue",{});
6
+ this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},iJ=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 hJ(a)?b:c},lJ=function(a,b,c){return hJ(a)&&_.J.pa(c)?VI(c,_.ae):(jJ(a)||kJ(a))&&_.J.pa(b)?VI(b,"%"):NI},jJ=function(a){return a.f.writingMode===_.Ne},kJ=function(a){return a.f.writingMode===_.Oe},hJ=function(a){return a.f.writingMode===_.tg},mJ=function(a,b,c){return(jJ(a)||kJ(a))&&_.J.pa(c)?VI(c,_.ae):
7
+ jJ(a)&&_.J.R(c)?VI(0,_.ae):hJ(a)&&_.J.pa(b)?VI(b,"%"):NI},nJ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.rd:return a.f.position;case "auto":case _.Ac:return a.f.position-a.f.size/2;case _.sd:return a.f.position-a.f.size}return 0},oJ=function(a){switch(a.f.positionAlign){case _.rd:return _.od;case "auto":case _.Ac:return _.sg;case _.sd:return _.he}return a.f.textAlign},pJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.od:case _.od:return _.rd;
8
+ case _.sg:return _.Ac;case _.he:case _.he:return _.sd}return a.f.positionAlign},qJ=function(a){switch(a.f.writingMode){case _.tg:return"horizontal-tb";case _.Ne:return _.Ne;case _.Oe:return _.Oe;default:throw Error("Unknown writing mode");}},rJ=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=bJ(a.a);this.g=[]},sJ=function(a,b){if(a.h)switch(b.writingMode){case _.tg:return["-y"];case _.Ne:return["+x"];case _.Oe:return["-x"]}var c=[];switch(b.writingMode){case _.tg:c=["+y","-y"];break;
9
+ case _.Ne:c=["+x","-x"];break;case _.Oe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},tJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=bJ(a.j.a)},uJ=function(a,b,c){fJ.call(this,a,b,c);this.g=null;this.j=[]},vJ=function(a,b){tJ(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)},wJ=function(a,b){uJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},xJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.yg)return a.viewportAnchorY/
10
+ 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(JI);},zJ=function(a){this.f=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=yJ(this,this.h);this.g=yJ(this,this.h,!0);this.g.disabled=!0;this.f.debug("Stylesheet CLPP Subtitle Styles has been created.")},AJ=function(a,b){var c=!1;try{a.g.insertRule(b,0);var d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
+ e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},BJ=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},yJ=function(a,b,c){var d=document.createElement(_.ve),e=d.dataset;e.name=II;
12
+ e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);CJ(a,b);a.f.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},CJ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===II&&a.f.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
13
+ FJ=function(a){_.Tp.call(this,a);var b=this;this.L=new _.H(MI);this.l=a;this.K=DJ(a);this.h=!1;this.f=[];this.B=a.getSurface().getContainer();this.g=new zJ(a);this.a=new uJ(null,"clpp-text-container",{});this.o=new _.pp(a.getSurface(),this.lh.bind(this));this.I=null;this.B?(this.B.appendChild(this.a.a),this.a.init(null)):this.L.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.C=new _.Li(function(){EJ(b)});
14
+ this.w=new Map;this.j=null},DJ=function(a){a=_.J.Ma(a.getConfiguration().htmlcue||{});_.J.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.J.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},GJ=function(a,b){return a.startTime<=b&&a.endTime>b},EJ=function(a,b){if((b||a.h)&&a.B){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.bn){a.I=c;var d=HJ(a,c);(c=b)||(c=a.j,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.j=d,IJ(a),d)){c={color:a.getFontColor()||
15
+ void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Yp(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.We:h="clpp-text-vtt";break;case _.Fe:h=LI;break;case _.rg:h=KI}h&&!g.classList.contains(h)&&_.yn(g,h);g=bJ(f.a.a);if(0===g.width||0===g.height)f.L.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{TI({fontSize:JJ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.We;var l=e.payloadType===_.Fe;e.region&&(h||l||e.backgroundImage)&&(f.w.has(e.region.id)?g=f.w.get(e.region.id):(g=new wJ(e.region,{}),f.w.set(e.region.id,g),vJ(f.a,g)));e=new gJ(e,f.K,c);g?vJ(g,e):vJ(f.a,e)}}}}}},HJ=function(a,b){var c=OI(a.f,function(e){return GJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&GJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&GJ(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},KJ=function(a){IJ(a);a.I=null;a.j=null;a.f=[]},IJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(LI);b.classList.remove(KI);a=a.a;tJ(a.g);a.j=[]}},JJ=function(a,b){var c=bJ(a.a.a).height;if(null!==a.G)return a.getFontSize();if(null!==a.A){var d=a.getFontSizePercent();return Math.round(c*d)+_.ae}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.ae;d=a.getFontSizePercent();return Math.round(c*d)+_.ae},LJ=function(){},MJ=function(){};
18
+ PI.prototype.parse=function(a){a={input:a};for(var b=_.An(_.Vc),c=[],d=b,e;null!==(e=QI(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=NJ[f];h?(h=_.An(h),(f=OJ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||PJ[g.localName]&&PJ[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(SI(e)));return b};var NJ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},OJ={v:"voice",lang:"lang"},PJ={rt:"ruby"},RI={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};fJ.prototype.init=function(){this.h=!0};fJ.prototype.w=function(){return!1};_.v(gJ,fJ);gJ.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
+ gJ.prototype.init=function(a){fJ.prototype.init.call(this,a);if(this.g)_.yn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Fe){var c=_.An(_.Vc);c.innerHTML=b.payload;b=c}else b.payloadType===_.We?b=(new PI).parse(b.payload):(c=_.An(_.Vc),c.textContent=b.payload,b=c);_.yn(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.yn(b,d.value);TI({writingMode:qJ(this)},b);this.a.appendChild(b);_.yn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.yn(this.a,"clpp-text-wrapper__"+d.value);_.J.R(this.f.line)&&(this.f.lineInterpretation=_.ug,this.f.line=hJ(this)?-1:0);c=qJ(this);TI({writingMode:c,webkitWritingMode:c,direction:NI,textAlign:oJ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=nJ(this,pJ(this));d=mJ(this,c,null);var e=lJ(this,
22
+ c,null),f=kJ(this)&&_.J.R(null)?VI(0,_.ae):NI;TI({position:"absolute",left:d,right:f,top:e,width:hJ(this)?VI(this.f.size,"%"):NI,height:jJ(this)||kJ(this)?VI(this.f.size,"%"):NI},this.a);d=this.f;a=hJ(this)?a.height:a.width;e=iJ(this);if(d.lineInterpretation===_.ug)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 _.Ac:g-=f/2;break;case _.dd:g-=f}f=Math.round(g/100*a)}kJ(this)&&(f=a-f-e);a=f;d=mJ(this,c,a);e=kJ(this)&&_.J.R(a)?
23
+ VI(0,_.ae):NI;TI({left:d,right:e,top:lJ(this,c,a)},this.a)}UI(this.B,b)}};gJ.prototype.m=function(){return _.An(_.Vc)};rJ.prototype.append=function(a){var b=a.a;b.style.visibility=_.jd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=bJ(a.a);var d=sJ(this,a.f),e=iJ(a),f=aJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;eJ(c,this.a,l)||dJ(c,this.a)&&cJ(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||dJ(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
+ l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>h&&(g=aJ(c),h=l);c=aJ(f)}c=g||f}TI({top:VI(c.h-this.a.h,_.ae),bottom:VI(this.a.a-c.a,_.ae),left:VI(c.f-this.a.f,_.ae),right:VI(this.a.g-c.g,_.ae),height:VI(c.height,_.ae),width:VI(c.width,_.ae)},a.a)}b.style.visibility="visible";this.g.push(bJ(a.a))};_.v(uJ,fJ);uJ.prototype.init=function(){this.g=new rJ(this);this.h=!0};uJ.prototype.m=function(){var a=_.An(_.Vc);_.yn(a,this.o);this.id&&(a.id=this.id);return a};_.v(wJ,uJ);
25
+ wJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.yg:b=b.width/100*a.width;break a;default:throw Error(JI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.yg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(JI);d=a.height;var e=xJ(this,d,a.height);TI(this.A,this.a);TI({left:VI(c,_.ae),top:VI(e,_.ae),width:VI(b,_.ae),height:VI(d,_.ae)},this.a);this.f.writingMode&&TI({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&TI({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.yn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.yg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new gJ(new _.xg(0,1,"Lorem ipsum",_.rg),{},{});c=d.a;this.a.appendChild(c);d.init(bJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(JI);
27
+ }a=xJ(this,b,a.height);TI({top:VI(a,_.ae),height:VI(b,_.ae)},this.a);this.g=new rJ(this,!0);this.h=!0};wJ.prototype.getId=function(){return this.f.id};zJ.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=BJ(this,a);if(AJ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug("Added CSS rule "+b)}catch(c){this.f.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.f.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ zJ.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.f.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.v(FJ,_.Tp);_.t=FJ.prototype;
29
+ _.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={md:c.md},e=d.next())c.md=e.value,this.f.some(function(f){return function(g){var h=f.md;return g.payload!==h.payload?!1:
30
+ g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.md);this.j=null;EJ(this,!1)}};_.t.ob=function(){null==this.g||EJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();KJ(a);a.C.stop();return _.y(b,a.g.destroy(),2)}a.g=null;a.B.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
31
+ _.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.j=null;EJ(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.C.ab(.25),this.K.enableResizeObserver&&this.o.start(),EJ(this,!0)):(this.C.stop(),this.o.stop(),KJ(this)))};_.t.lh=function(){EJ(this,!0)};_.B(MI,FJ);FJ.prototype.setTextVisibility=FJ.prototype.setTextVisibility;
32
+ FJ.prototype.isTextVisible=FJ.prototype.isTextVisible;FJ.prototype.remove=FJ.prototype.remove;FJ.prototype.destroy=FJ.prototype.destroy;FJ.prototype.append=FJ.prototype.append;LJ.prototype.aa=function(a){return!!a.enableHtmlCue&&!_.Vi()};LJ.prototype.create=function(a){return new FJ(a)};_.v(MJ,_.zo);MJ.prototype.Ja=function(){_.wm("html",new LJ)};MJ.prototype.Ca=function(){};MJ.prototype.id=function(){return _.xe};_.B("clpp.htmlcue.HtmlCueComponent",MJ);};
34
33
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
35
34
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
36
35
  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 $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()};
2
+ var f=function(window){var qI="clpp.ima.AdsManagerFactory",rI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},sI=function(){},tI=function(a){this.a=a},uI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.J.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 _.rp;this.O=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Mh;this.D=!1;this.w=new _.cg;this.S=new sI;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.Oi.bind(this));a.on(this.o,b,this.Ni.bind(this));a.one(this.j,_.ed,this.Vi.bind(this))},vI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.ph.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Wi.bind(a));c.on(b,d.STARTED,a.rh.bind(a));c.on(b,d.LOG,a.Hi.bind(a));c.on(b,d.AD_PROGRESS,a.Li.bind(a));c.on(b,d.AD_BUFFERING,a.Ei.bind(a));c.on(b,d.FIRST_QUARTILE,
4
+ a.nh.bind(a));c.on(b,d.MIDPOINT,a.Ii.bind(a));c.on(b,d.THIRD_QUARTILE,a.sh.bind(a));c.on(b,d.PAUSED,a.Ki.bind(a));c.on(b,d.RESUMED,a.Mi.bind(a));c.on(b,d.CLICK,a.mh.bind(a));c.on(b,d.SKIPPED,a.qh.bind(a));c.on(b,d.IMPRESSION,a.oh.bind(a));c.on(b,d.COMPLETE,a.Fi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Xi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Qi.bind(a))},wI=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===_.rc?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===_.rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},yI=function(a){a.A=null;xI(a,_.Tb);a.m&&a.l.getSurface().hide(a.m)},zI=
6
+ function(a){_.zn(a.j,{visibility:"visible"})},xI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new rI(c,a.B,a.L)});a.l.trigger(new _.I(b,d))},AI=function(a,b){var c=b?a.S.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},CI=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 xI(a,_.pc),a.O.warn(_.ma),d["return"]();BI(a);_.z(d)})},DI=function(a,b){return _.A(function(c){if(1==
7
+ c.a)return a.J.initialize(),_.y(c,b.play(),2);BI(a);_.z(c)})},BI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},EI=function(){this.a=this.g=this.f=null},FI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},GI=function(){},HI=function(){this.a=new _.H(qI)};_.t=rI.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
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)};
9
+ _.t.Ib=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Id&&typeof b[d].clickThroughUrl===_.te});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()};rI.prototype.getWrapperCreativeIds=rI.prototype.getWrapperCreativeIds;rI.prototype.getWrapperAdSystems=rI.prototype.getWrapperAdSystems;
11
+ rI.prototype.getWrapperAdIds=rI.prototype.getWrapperAdIds;rI.prototype.getSequenceLength=rI.prototype.xb;rI.prototype.getPositionInSequence=rI.prototype.Kb;rI.prototype.getPodTimeOffset=rI.prototype.Jb;rI.prototype.getPodIndex=rI.prototype.getPodIndex;rI.prototype.getPodType=rI.prototype.Ua;rI.prototype.getMediaBitrate=rI.prototype.gb;rI.prototype.getMediaHeight=rI.prototype.ub;rI.prototype.getMediaWidth=rI.prototype.vb;rI.prototype.getMediaUrl=rI.prototype.getMediaUrl;
12
+ rI.prototype.getClickThroughUrl=rI.prototype.Ib;rI.prototype.isBumper=rI.prototype.dc;rI.prototype.getSkipTimeOffset=rI.prototype.getSkipTimeOffset;rI.prototype.getDuration=rI.prototype.getDuration;rI.prototype.getTitle=rI.prototype.getTitle;rI.prototype.getAdvertiserName=rI.prototype.getAdvertiserName;rI.prototype.getAdSystem=rI.prototype.getAdSystem;rI.prototype.getApiFramework=rI.prototype.getApiFramework;rI.prototype.getCreativeId=rI.prototype.getCreativeId;rI.prototype.getId=rI.prototype.getId;
13
+ rI.prototype.getTechnology=rI.prototype.yb;rI.prototype.getAdManagerVersion=rI.prototype.tb;rI.prototype.getAdManagerName=rI.prototype.sb;sI.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}};tI.prototype.getCuePoints=function(){return this.a};tI.prototype.Lb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};tI.prototype.hb=function(){return 0<=this.a.indexOf(-1)};tI.prototype.hasPostroll=tI.prototype.hb;tI.prototype.hasPreroll=tI.prototype.Lb;tI.prototype.getCuePoints=tI.prototype.getCuePoints;_.t=uI.prototype;
14
+ _.t.Oi=function(a){var b=this;this.a=a.getAdsManager(this.j,wI(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 _.pp(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 tI(a),this.l.trigger(new _.I(_.Wb,{adsTimeline:this.g})),vI(this));this.f.resolve()};
15
+ _.t.Ni=function(a){AI(this,a.getError());this.f.resolve()};_.t.Wi=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.y(c,b.l.pause(),2);_.zn(b.j,{visibility:_.jd});xI(b,_.Fb,a);b.h.start();_.z(c)})};_.t.ph=function(a){a.getAd().isLinear()?xI(this,_.Mb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.rh=function(a){this.A=a.getAd().getDuration();xI(this,_.Sb,a);this.l.getSurface().show(this.m)};_.t.Hi=function(a){a=a.getAdData();AI(this,a?a.adError:null);yI(this)};
16
+ _.t.Li=function(a){xI(this,_.Pb,a)};_.t.Ei=function(a){xI(this,_.Hb,a)};_.t.nh=function(a){xI(this,_.Kb,a)};_.t.Ii=function(a){xI(this,_.Nb,a)};_.t.sh=function(a){xI(this,_.Ub,a)};_.t.Ki=function(a){xI(this,_.Ob,a)};_.t.Mi=function(a){xI(this,_.Qb,a)};_.t.mh=function(a){this.pause();xI(this,_.Ib,a)};_.t.qh=function(a){xI(this,_.Rb,a);yI(this)};_.t.oh=function(a){xI(this,_.Lb,a)};_.t.Fi=function(a){xI(this,_.Jb,a);yI(this)};
17
+ _.t.Xi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();xI(this,_.Gb);zI(this)};_.t.Qi=function(){this.I=!0};_.t.Vi=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!==_.te)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,CI(b),0):_.y(c,DI(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.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);};
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)}),_.dg(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(){zI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};uI.prototype.getPosition=uI.prototype.getPosition;
22
+ uI.prototype.setVolume=uI.prototype.setVolume;uI.prototype.getVolume=uI.prototype.getVolume;uI.prototype.skip=uI.prototype.skip;uI.prototype.pause=uI.prototype.pause;uI.prototype.resume=uI.prototype.resume;_.v(EI,_.cq);_.t=EI.prototype;_.t.onPlayerCreated=function(a){if(FI())return a.onError(new _.L(1,9,1E4));this.f=_.xn(_.Vc,{"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(_.ta);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.ei=function(){return this.a};_.t.ci=function(){return this.g};_.t.Dc=function(){return this.f};_.t.id=function(){return"ima"};_.B("clpp.ima.ImaPlugin",EI);EI.prototype.getAdContainer=EI.prototype.Dc;EI.prototype.getAdDisplayContainer=EI.prototype.ci;EI.prototype.getAdsLoader=EI.prototype.ei;EI.Id="ima";
24
+ EI.isSdkMissing=FI;GI.prototype.create=function(){return new EI};_.uo(new GI);HI.prototype.name=function(){return qI};HI.prototype.aa=function(a,b){return a.namespace()===_.Fc?!1:FI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};HI.prototype.create=function(a){return new uI(a)};HI.prototype.create=HI.prototype.create;HI.prototype.isSupported=HI.prototype.aa;HI.prototype.name=HI.prototype.name;_.un(new HI);};
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));}