@castlabs/prestoplay 6.14.0 → 6.15.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 (62) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +113 -111
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +550 -529
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +74 -73
  10. package/cjs/cl.externs.js +191 -64
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -68
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +290 -275
  17. package/cjs/cl.muxdata.js +15 -15
  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.simid.js +15 -15
  22. package/cjs/cl.smooth.js +72 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +70 -70
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +20 -20
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +89 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +457 -438
  37. package/cl.crypto.js +9 -9
  38. package/cl.dash.js +70 -68
  39. package/cl.externs.js +187 -64
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +255 -240
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/clpp.styles.css +2 -0
  61. package/package.json +1 -1
  62. package/typings.d.ts +387 -90
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var LN="CLPP Subtitle Styles",MN="Unsupported unit",NN="clpp-text-plain",ON="clpp-text-ttml",PN="clpp.htmlcue.HtmlTextDisplayer",QN="initial",RN=function(a){return _.Xh(a,{ug:function(b,c){return b.ta(c)}})},SN=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},TN=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},UN=function(){},VN=function(a){if(!a.input)return null;
3
- var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},XN=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return WN[c]});return a},ZN=function(a,b){YN(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){YN(a,c)})},YN=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},$N=function(a,b){return 0===a?"0":a+b},aO=function(a,b){return 1>Math.abs(a-b)||a<b},bO=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},cO=function(a,b){return a>b&&1<Math.abs(a-b)},dO=function(a,b){return 1>Math.abs(a-b)||a>b},eO=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},fO=function(a){return new eO(a.left,a.f,a.top,a.a,a.height,a.width)},gO=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
- 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new eO(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},hO=function(a,b){return b.some(function(c){return bO(a.left,c.f)&&cO(a.f,c.left)&&bO(a.top,c.a)&&cO(a.a,c.top)})},iO=function(a,b){return dO(a.top,b.top)&&aO(a.a,b.a)&&dO(a.left,b.left)&&aO(a.f,b.f)},jO=function(a,b,c){switch(c){case "+x":return bO(a.left,b.left);case "-x":return cO(a.f,b.f);
6
- case "+y":return bO(a.top,b.top);case "-y":return cO(a.a,b.a);default:throw Error("Unknown axis");}},kO=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},lO=function(a,b,c){kO.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},nO=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 mO(a)?b:c},qO=function(a,b,c){return mO(a)&&_.N.na(c)?$N(c,_.Df):(oO(a)||
7
- pO(a))&&_.N.na(b)?$N(b,"%"):QN},oO=function(a){return a.f.writingMode===_.qg},pO=function(a){return a.f.writingMode===_.rg},mO=function(a){return a.f.writingMode===_.$h},rO=function(a,b,c){return(oO(a)||pO(a))&&_.N.na(c)?$N(c,_.Df):oO(a)&&_.N.R(c)?$N(0,_.Df):mO(a)&&_.N.na(b)?$N(b,"%"):QN},sO=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ce:return a.f.position;case "auto":case _.sd:return a.f.position-a.f.size/2;case _.De:return a.f.position-a.f.size}return 0},
8
- tO=function(a){switch(a.f.positionAlign){case _.Ce:return _.ye;case "auto":case _.sd:return _.Zh;case _.De:return _.Kf}return a.f.textAlign},uO=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ye:case _.ye:return _.Ce;case _.Zh:return _.sd;case _.Kf:case _.Kf:return _.De}return a.f.positionAlign},vO=function(a){switch(a.f.writingMode){case _.$h:return"horizontal-tb";case _.qg:return _.qg;case _.rg:return _.rg;default:throw Error("Unknown writing mode");}},wO=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=gO(a.a);this.h=[]},xO=function(a,b){if(a.j)switch(b.writingMode){case _.$h:return["-y"];case _.qg:return["+x"];case _.rg:return["-x"]}var c=[];switch(b.writingMode){case _.$h:c=["+y","-y"];break;case _.qg:c=["+x","-x"];break;case _.rg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},yO=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=gO(a.l.a)},zO=function(a,b,c){kO.call(this,a,b,c);this.h=null;this.l=[]},AO=function(a,b){yO(a.h);
10
- a.l.unshift(b);for(var c=_.u(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},BO=function(a,b){zO.call(this,a.id,"clpp-text-cue-region",b);this.f=a},CO=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.ei)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(MN);},EO=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.l=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=DO(this,this.h);this.f=DO(this,
11
- this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},FO=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},GO=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,
12
- 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)},DO=function(a,b,c){var d=document.createElement(_.Yf),e=d.dataset;e.name=LN;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);HO(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},HO=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===
13
- LN&&a.g.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.l.push(function(){return c.disconnect()})},KO=function(a){_.ht.call(this,a);var b=this;this.g=new _.K(PN);this.m=a;this.M=IO(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new EO(a);this.a=new zO(null,"clpp-text-container",{});this.w=new _.ys(a.getSurface(),this.Vi.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),
14
- this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.G=new _.uk(function(){JO(b)});this.A=new Map;this.l=null},IO=function(a){a=_.N.Oa(a.getConfiguration().htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},LO=function(a,b){return a.startTime<=b&&a.endTime>b},JO=function(a,b){if((b||a.j)&&a.C){var c=
15
- a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Vo){a.J=c;var d=MO(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,NO(a),d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.mt(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 _.zg:h="clpp-text-vtt";
16
- break;case _.gg:h=ON;break;case _.Yh:h=NN}h&&!g.classList.contains(h)&&_.rp(g,h);g=gO(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");else{YN({fontSize:OO(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.zg;var l=e.payloadType===_.gg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new BO(e.region,
17
- {}),f.A.set(e.region.id,g),AO(f.a,g)));e=new lO(e,f.M,c);g?AO(g,e):AO(f.a,e)}}}}}},MO=function(a,b){var c=TN(a.f,function(e){return LO(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&LO(a.f[d-1],b);)d--;for(;c+1<a.f.length&&LO(a.f[c+1],b);)c++;return{start:d,end:c}},PO=function(a){NO(a);a.J=null;a.l=null;a.f=[]},NO=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(ON);b.classList.remove(NN);a=a.a;yO(a.h);
18
- a.l=[]}},OO=function(a,b){var c=gO(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Df}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Df;d=a.getFontSizePercent();return Math.round(c*d)+_.Df},QO=function(){},RO=function(){};
19
- UN.prototype.parse=function(a){a={input:a};for(var b=_.tp(_.Yd),c=[],d=b,e;null!==(e=VN(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=SO[f];h?(h=_.tp(h),(f=TO[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||UO[g.localName]&&UO[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(XN(e)));return b};var SO={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},TO={v:"voice",lang:"lang"},UO={rt:"ruby"},WN={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};kO.prototype.init=function(){this.j=!0};kO.prototype.A=function(){return!1};_.w(lO,kO);lO.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- lO.prototype.init=function(a){kO.prototype.init.call(this,a);if(this.h)_.rp(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.gg){var c=_.tp(_.Yd);c.innerHTML=b.payload;b=c}else b.payloadType===_.zg?b=(new UN).parse(b.payload):(c=_.tp(_.Yd),c.textContent=b.payload,b=c);_.rp(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.rp(b,d.value);YN({writingMode:vO(this)},b);this.a.appendChild(b);_.rp(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.rp(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.ai,this.f.line=mO(this)?-1:0);c=vO(this);YN({writingMode:c,webkitWritingMode:c,direction:QN,textAlign:tO(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=sO(this,uO(this));d=rO(this,c,null);var e=qO(this,
23
- c,null),f=pO(this)&&_.N.R(null)?$N(0,_.Df):QN;YN({position:"absolute",left:d,right:f,top:e,width:mO(this)?$N(this.f.size,"%"):QN,height:oO(this)||pO(this)?$N(this.f.size,"%"):QN},this.a);d=this.f;a=mO(this)?a.height:a.width;e=nO(this);if(d.lineInterpretation===_.ai)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 _.sd:g-=f/2;break;case _.le:g-=f}f=Math.round(g/100*a)}pO(this)&&(f=a-f-e);a=f;d=rO(this,c,a);e=pO(this)&&_.N.R(a)?
24
- $N(0,_.Df):QN;YN({left:d,right:e,top:qO(this,c,a)},this.a)}ZN(this.C,b)}};lO.prototype.o=function(){return _.tp(_.Yd)};wO.prototype.append=function(a){var b=a.a;b.style.visibility=_.se;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=gO(a.a);var d=xO(this,a.f),e=nO(a),f=fO(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;jO(c,this.a,l)||iO(c,this.a)&&hO(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||iO(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
- l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=fO(c),h=l);c=fO(f)}c=g||f}YN({top:$N(c.top-this.a.top,_.Df),bottom:$N(this.a.a-c.a,_.Df),left:$N(c.left-this.a.left,_.Df),right:$N(this.a.f-c.f,_.Df),height:$N(c.height,_.Df),width:$N(c.width,_.Df)},a.a)}b.style.visibility="visible";this.h.push(gO(a.a))};_.w(zO,kO);zO.prototype.init=function(){this.h=new wO(this);this.j=!0};zO.prototype.o=function(){var a=_.tp(_.Yd);_.rp(a,this.w);this.id&&(a.id=this.id);return a};_.w(BO,zO);
26
- BO.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.ei:b=b.width/100*a.width;break a;default:throw Error(MN);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.ei)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(MN);d=a.height;var e=CO(this,d,a.height);YN(this.B,this.a);YN({left:$N(c,_.Df),top:$N(e,_.Df),width:$N(b,_.Df),height:$N(d,_.Df)},this.a);this.f.writingMode&&YN({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&YN({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.rp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.ei:b=b.height/100*a.height;break a;case 2:b=b.height;d=new lO(new _.di(0,1,"Lorem ipsum",_.Yh),{},{});c=d.a;this.a.appendChild(c);d.init(gO(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(MN);
28
- }a=CO(this,b,a.height);YN({top:$N(a,_.Df),height:$N(b,_.Df)},this.a);this.h=new wO(this,!0);this.j=!0};BO.prototype.getId=function(){return this.f.id};EO.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=GO(this,a);if(FO(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
- EO.prototype.destroy=function(){var a=this;return _.E(function(b){if(null==a.a)return b["return"]();a.l.forEach(function(c){return c()});a.l=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(KO,_.ht);_.r=KO.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=SN(this.f,RN(a));this.l=null;JO(this,!1)}};_.r.ub=function(){null==this.h||JO(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a){if(null==a.h)return b["return"]();PO(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;JO(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
- _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.jb(.25),this.M.enableResizeObserver&&this.w.start(),JO(this,!0)):(this.G.stop(),this.w.stop(),PO(this)))};_.r.zd=function(){return this.f};_.r.Vi=function(){JO(this,!0)};_.H(PN,KO);KO.prototype.setTextVisibility=KO.prototype.setTextVisibility;KO.prototype.isTextVisible=KO.prototype.isTextVisible;KO.prototype.remove=KO.prototype.remove;KO.prototype.destroy=KO.prototype.destroy;KO.prototype.append=KO.prototype.append;QO.prototype.ba=function(a){return!!a.enableHtmlCue&&!_.Dk()};QO.prototype.create=function(a){return new KO(a)};_.w(RO,_.Ir);RO.prototype.f=function(){_.uo(_.te,new QO)};RO.prototype.a=function(){_.so.has(_.te)&&(_.so["delete"](_.te),_.to.info("Removed factory: 'html'"))};RO.prototype.id=function(){return _.$f};_.H("clpp.htmlcue.HtmlCueComponent",RO);};
2
+ var f=function(window){var wP="CLPP Subtitle Styles",xP="Unsupported unit",yP="clpp-text-plain",zP="clpp-text-ttml",AP="clpp.htmlcue.HtmlTextDisplayer",BP="initial",CP=function(a){return _.ki(a,{Jg:function(b,c){return b.ka(c)}})},DP=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},EP=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},FP=function(){},GP=function(a){if(!a.input)return null;
3
+ var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},IP=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return HP[c]});return a},KP=function(a,b){JP(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){JP(a,c)})},JP=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},LP=function(a,b){return 0===a?"0":a+b},MP=function(a,b){return 1>Math.abs(a-b)||a<b},NP=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},OP=function(a,b){return a>b&&1<Math.abs(a-b)},PP=function(a,b){return 1>Math.abs(a-b)||a>b},QP=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},RP=function(a){return new QP(a.left,a.f,a.top,a.a,a.height,a.width)},SP=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
+ 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new QP(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},TP=function(a,b){return b.some(function(c){return NP(a.left,c.f)&&OP(a.f,c.left)&&NP(a.top,c.a)&&OP(a.a,c.top)})},UP=function(a,b){return PP(a.top,b.top)&&MP(a.a,b.a)&&PP(a.left,b.left)&&MP(a.f,b.f)},VP=function(a,b,c){switch(c){case "+x":return NP(a.left,b.left);case "-x":return OP(a.f,b.f);
6
+ case "+y":return NP(a.top,b.top);case "-y":return OP(a.a,b.a);default:throw Error("Unknown axis");}},WP=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},XP=function(a,b,c){WP.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},ZP=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 YP(a)?b:c},bQ=function(a,b,c){return YP(a)&&_.O.qa(c)?LP(c,_.Lf):($P(a)||
7
+ aQ(a))&&_.O.qa(b)?LP(b,"%"):BP},$P=function(a){return a.f.writingMode===_.Dg},aQ=function(a){return a.f.writingMode===_.Eg},YP=function(a){return a.f.writingMode===_.ni},cQ=function(a,b,c){return($P(a)||aQ(a))&&_.O.qa(c)?LP(c,_.Lf):$P(a)&&_.O.R(c)?LP(0,_.Lf):YP(a)&&_.O.qa(b)?LP(b,"%"):BP},dQ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ge:return a.f.position;case "auto":case _.ud:return a.f.position-a.f.size/2;case _.He:return a.f.position-a.f.size}return 0},
8
+ eQ=function(a){switch(a.f.positionAlign){case _.Ge:return _.Ce;case "auto":case _.ud:return _.mi;case _.He:return _.Sf}return a.f.textAlign},fQ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Ce:case _.Ce:return _.Ge;case _.mi:return _.ud;case _.Sf:case _.Sf:return _.He}return a.f.positionAlign},gQ=function(a){switch(a.f.writingMode){case _.ni:return"horizontal-tb";case _.Dg:return _.Dg;case _.Eg:return _.Eg;default:throw Error("Unknown writing mode");}},hQ=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=SP(a.a);this.h=[]},iQ=function(a,b){if(a.j)switch(b.writingMode){case _.ni:return["-y"];case _.Dg:return["+x"];case _.Eg:return["-x"]}var c=[];switch(b.writingMode){case _.ni:c=["+y","-y"];break;case _.Dg:c=["+x","-x"];break;case _.Eg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},jQ=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=SP(a.l.a)},kQ=function(a,b,c){WP.call(this,a,b,c);this.h=null;this.l=[]},lQ=function(a,b){jQ(a.h);
10
+ a.l.unshift(b);for(var c=_.t(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},mQ=function(a,b){kQ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},nQ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.si)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(xP);},pQ=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=oQ(this,this.h);this.f=oQ(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
+ qQ=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},rQ=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,
12
+ c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},oQ=function(a,b,c){var d=document.createElement(_.jg),e=d.dataset;e.name=wP;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);sQ(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},sQ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===wP&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
+ c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},vQ=function(a){_.uu.call(this,a);var b=this;this.g=new _.K(AP);this.m=a;this.L=tQ(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new pQ(a.getSurface().getUniqueCssClass());this.a=new kQ(null,"clpp-text-container",{});this.w=new _.tt(a.getSurface(),this.oj.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.Vk(function(){uQ(b)});this.A=new Map;this.l=null},tQ=function(a){a=_.O.Ma(a.htmlcue||{});_.O.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.O.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},wQ=function(a,b){return a.startTime<=b&&a.endTime>b},uQ=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.xp){a.J=c;var d=xQ(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,yQ(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.zu(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.t(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 _.Mg:h="clpp-text-vtt";break;case _.ug:h=zP;break;case _.li:h=yP}h&&!g.classList.contains(h)&&_.Vp(g,h);g=SP(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
+ else{JP({fontSize:zQ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Mg;var l=e.payloadType===_.ug;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new mQ(e.region,{}),f.A.set(e.region.id,g),lQ(f.a,g)));e=new XP(e,f.L,c);g?lQ(g,e):lQ(f.a,e)}}}}}},xQ=function(a,b){var c=EP(a.f,function(e){return wQ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&wQ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&wQ(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},AQ=function(a){yQ(a);a.J=null;a.l=null;a.f=[]},yQ=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(zP);b.classList.remove(yP);a=a.a;jQ(a.h);a.l=[]}},zQ=function(a,b){var c=SP(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Lf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Lf;d=a.getFontSizePercent();return Math.round(c*d)+_.Lf},BQ=function(){},CQ=function(){};
18
+ FP.prototype.parse=function(a){a={input:a};for(var b=_.Xp(_.ae),c=[],d=b,e;null!==(e=GP(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=DQ[f];h?(h=_.Xp(h),(f=EQ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||FQ[g.localName]&&FQ[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(IP(e)));return b};var DQ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},EQ={v:"voice",lang:"lang"},FQ={rt:"ruby"},HP={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};WP.prototype.init=function(){this.j=!0};WP.prototype.A=function(){return!1};_.w(XP,WP);XP.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
20
+ XP.prototype.init=function(a){WP.prototype.init.call(this,a);if(this.h)_.Vp(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.ug){var c=_.Xp(_.ae);c.innerHTML=b.payload;b=c}else b.payloadType===_.Mg?b=(new FP).parse(b.payload):(c=_.Xp(_.ae),c.textContent=b.payload,b=c);_.Vp(b,this.w);this.id&&(b.id=this.id);c=_.t(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.Vp(b,d.value);JP({writingMode:gQ(this)},b);this.a.appendChild(b);_.Vp(this.a,"clpp-text-wrapper");c=_.t(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Vp(this.a,"clpp-text-wrapper__"+d.value);_.O.R(this.f.line)&&(this.f.lineInterpretation=_.oi,this.f.line=YP(this)?-1:0);c=gQ(this);JP({writingMode:c,webkitWritingMode:c,direction:BP,textAlign:eQ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=dQ(this,fQ(this));d=cQ(this,c,null);var e=bQ(this,
22
+ c,null),f=aQ(this)&&_.O.R(null)?LP(0,_.Lf):BP;JP({position:"absolute",left:d,right:f,top:e,width:YP(this)?LP(this.f.size,"%"):BP,height:$P(this)||aQ(this)?LP(this.f.size,"%"):BP},this.a);d=this.f;a=YP(this)?a.height:a.width;e=ZP(this);if(d.lineInterpretation===_.oi)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.ud:g-=f/2;break;case _.pe:g-=f}f=Math.round(g/100*a)}aQ(this)&&(f=a-f-e);a=f;d=cQ(this,c,a);e=aQ(this)&&_.O.R(a)?
23
+ LP(0,_.Lf):BP;JP({left:d,right:e,top:bQ(this,c,a)},this.a)}KP(this.D,b)}};XP.prototype.o=function(){return _.Xp(_.ae)};hQ.prototype.append=function(a){var b=a.a;b.style.visibility=_.we;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=SP(a.a);var d=iQ(this,a.f),e=ZP(a),f=RP(c),g=null,h=0;d=_.t(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;VP(c,this.a,l)||UP(c,this.a)&&TP(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||UP(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
24
+ l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=RP(c),h=l);c=RP(f)}c=g||f}JP({top:LP(c.top-this.a.top,_.Lf),bottom:LP(this.a.a-c.a,_.Lf),left:LP(c.left-this.a.left,_.Lf),right:LP(this.a.f-c.f,_.Lf),height:LP(c.height,_.Lf),width:LP(c.width,_.Lf)},a.a)}b.style.visibility="visible";this.h.push(SP(a.a))};_.w(kQ,WP);kQ.prototype.init=function(){this.h=new hQ(this);this.j=!0};kQ.prototype.o=function(){var a=_.Xp(_.ae);_.Vp(a,this.w);this.id&&(a.id=this.id);return a};_.w(mQ,kQ);
25
+ mQ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.si:b=b.width/100*a.width;break a;default:throw Error(xP);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.si)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(xP);d=a.height;var e=nQ(this,d,a.height);JP(this.B,this.a);JP({left:LP(c,_.Lf),top:LP(e,_.Lf),width:LP(b,_.Lf),height:LP(d,_.Lf)},this.a);this.f.writingMode&&JP({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&JP({"justify-content":this.f.displayAlign},this.a);b=_.t(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Vp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.si:b=b.height/100*a.height;break a;case 2:b=b.height;d=new XP(new _.ri(0,1,"Lorem ipsum",_.li),{},{});c=d.a;this.a.appendChild(c);d.init(SP(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(xP);
27
+ }a=nQ(this,b,a.height);JP({top:LP(a,_.Lf),height:LP(b,_.Lf)},this.a);this.h=new hQ(this,!0);this.j=!0};mQ.prototype.getId=function(){return this.f.id};pQ.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=rQ(this,a);if(qQ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ pQ.prototype.destroy=function(){var a=this;return _.E(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(vQ,_.uu);_.r=vQ.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.t(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=DP(this.f,CP(a));this.l=null;uQ(this,!1)}};_.r.wb=function(){null==this.h||uQ(this,!0)};
29
+ _.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a){if(null==a.h)return b["return"]();AQ(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;uQ(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
30
+ _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.kb(.25),this.L.enableResizeObserver&&this.w.start(),uQ(this,!0)):(this.G.stop(),this.w.stop(),AQ(this)))};_.r.Cd=function(){return this.f};_.r.oj=function(){uQ(this,!0)};_.H(AP,vQ);vQ.prototype.setTextVisibility=vQ.prototype.setTextVisibility;vQ.prototype.isTextVisible=vQ.prototype.isTextVisible;vQ.prototype.remove=vQ.prototype.remove;vQ.prototype.destroy=vQ.prototype.destroy;vQ.prototype.append=vQ.prototype.append;BQ.prototype.isSupported=function(a){return!!a.enableHtmlCue&&!_.el()};BQ.prototype.create=function(a){return new vQ(a)};_.w(CQ,_.Cs);CQ.prototype.f=function(){_.Xo(_.xe,new BQ)};CQ.prototype.a=function(){_.Vo.has(_.xe)&&(_.Vo["delete"](_.xe),_.Wo.info("Removed factory: 'html'"))};CQ.prototype.id=function(){return _.lg};_.H("clpp.htmlcue.HtmlCueComponent",CQ);};
32
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
33
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
34
33
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var sN="clpp.ima.AdsManagerFactory",tN=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},uN=function(){},vN=function(a){this.a=a},wN=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.N.Oa(a.ima||{});this.J=_.N.oa({disableCustomPlayback:!1},a);this.o=this.m.nc("ima").Rc();this.T=this.m.nc("ima").h;this.l=this.m.nc("ima").a;this.M=new _.As;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.wj;this.I=!1;this.w=new _.Eh;this.V=new uN;this.B=
3
- null;this.P=this.H=this.C=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.al.bind(this));a.on(this.l,b,this.$k.bind(this));a.on(this.m,_.me,this.hl.bind(this))},xN=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Qk.bind(a));c.on(b,d.LOADED,a.Zi.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.il.bind(a));c.on(b,d.STARTED,a.aj.bind(a));c.on(b,d.LOG,a.Uk.bind(a));c.on(b,
4
- d.AD_PROGRESS,a.Yk.bind(a));c.on(b,d.AD_BUFFERING,a.Rk.bind(a));c.on(b,d.FIRST_QUARTILE,a.Xi.bind(a));c.on(b,d.MIDPOINT,a.Vk.bind(a));c.on(b,d.THIRD_QUARTILE,a.bj.bind(a));c.on(b,d.PAUSED,a.Xk.bind(a));c.on(b,d.RESUMED,a.Zk.bind(a));c.on(b,d.CLICK,a.Wi.bind(a));c.on(b,d.SKIPPED,a.$i.bind(a));c.on(b,d.IMPRESSION,a.Yi.bind(a));c.on(b,d.COMPLETE,a.Sk.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.jl.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.cl.bind(a))},yN=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
- b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.hd?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===_.hd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
- [];return b},AN=function(a){a.B=null;zN(a,_.Ic);a.o&&a.m.getSurface().hide(a.o)},BN=function(a){_.sp(a.A,{visibility:"visible"})},zN=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new tN(c,a.G,a.C)});a.m.trigger(new _.L(b,d))},CN=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.P(1,9,10003,{errorType:c},b))},DN=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Dj()},FN=function(a){var b,c;return _.E(function(d){if(1==d.a)return a.T.initialize(),
7
- b=!!a.m.getConfiguration().muted,_.x(d,a.M.canPlay(b),2);c=d.f;if(!c&&!DN(a))return zN(a,_.fd),a.g.warn(_.oa),d["return"]();EN(a);_.y(d)})},GN=function(a,b){return _.E(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);EN(a);_.y(c)})},EN=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.I=!0},HN=function(){this.a=this.h=this.f=null},IN=function(){return!window.google||!google.ima||!google.ima.AdsLoader},JN=function(){},KN=function(){this.Xc=new _.K(sN)};
8
- _.r=tN.prototype;_.r.xb=function(){return"Google IMA SDK"};_.r.yb=function(){return google.ima.VERSION};_.r.Eb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};
9
- _.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.rc=function(){return this.f?this.f.getIsBumper():!1};_.r.Rb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Te&&typeof b[d].clickThroughUrl===_.Wf});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.Bb=function(){return this.a.getVastMediaWidth()};_.r.Ab=function(){return this.a.getVastMediaHeight()};_.r.ob=function(){return this.a.getVastMediaBitrate()};
10
- _.r.cb=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Sb=function(){return this.f?this.f.getTimeOffset():0};_.r.Tb=function(){return this.f?this.f.getAdPosition():1};_.r.Db=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
11
- tN.prototype.getWrapperCreativeIds=tN.prototype.getWrapperCreativeIds;tN.prototype.getWrapperAdSystems=tN.prototype.getWrapperAdSystems;tN.prototype.getWrapperAdIds=tN.prototype.getWrapperAdIds;tN.prototype.getSequenceLength=tN.prototype.Db;tN.prototype.getPositionInSequence=tN.prototype.Tb;tN.prototype.getPodTimeOffset=tN.prototype.Sb;tN.prototype.getPodIndex=tN.prototype.getPodIndex;tN.prototype.getPodType=tN.prototype.cb;tN.prototype.getMediaBitrate=tN.prototype.ob;
12
- tN.prototype.getMediaHeight=tN.prototype.Ab;tN.prototype.getMediaWidth=tN.prototype.Bb;tN.prototype.getMediaUrl=tN.prototype.getMediaUrl;tN.prototype.getClickThroughUrl=tN.prototype.Rb;tN.prototype.isBumper=tN.prototype.rc;tN.prototype.getSkipTimeOffset=tN.prototype.getSkipTimeOffset;tN.prototype.getDuration=tN.prototype.getDuration;tN.prototype.getTitle=tN.prototype.getTitle;tN.prototype.getAdvertiserName=tN.prototype.getAdvertiserName;tN.prototype.getAdSystem=tN.prototype.getAdSystem;
13
- tN.prototype.getApiFramework=tN.prototype.getApiFramework;tN.prototype.getCreativeId=tN.prototype.getCreativeId;tN.prototype.getId=tN.prototype.getId;tN.prototype.getTechnology=tN.prototype.Eb;tN.prototype.getAdManagerVersion=tN.prototype.yb;tN.prototype.getAdManagerName=tN.prototype.xb;uN.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}};vN.prototype.getCuePoints=function(){return this.a};vN.prototype.Vb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};vN.prototype.pb=function(){return 0<=this.a.indexOf(-1)};vN.prototype.hasPostroll=vN.prototype.pb;vN.prototype.hasPreroll=vN.prototype.Vb;vN.prototype.getCuePoints=vN.prototype.getCuePoints;_.r=wN.prototype;
14
- _.r.al=function(a){var b=this;this.a=a.getAdsManager(this.A,yN(this));this.a.isCustomPlaybackUsed()&&!DN(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.P(1,9,10002)),this.dispose()):(this.h=new _.ys(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new vN(a),this.m.trigger(new _.L(_.Nc,{adsTimeline:this.j})),xN(this));this.f.resolve()};
15
- _.r.$k=function(a){CN(this,a.getError());this.f.resolve()};_.r.il=function(a){var b=this;return _.E(function(c){if(1==c.a)return b.H=!0,DN(b)?c.F(2):_.x(c,b.m.pause(),3);2!=c.a&&_.sp(b.A,{visibility:_.se});zN(b,_.uc,a);b.h.start();_.y(c)})};_.r.Qk=function(){var a=this;return _.E(function(b){if(1==b.a){if(!DN(a))return b.F(2);a.K=a.m.getPosition();return _.x(b,a.m.detach(),3)}if(2!=b.a){var c=a.m;c.a&&c.a.removeDelegate(c)}a.a.start();_.y(b)})};
16
- _.r.Zi=function(a){a.getAd().isLinear()?zN(this,_.Bc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.r.aj=function(a){this.B=a.getAd().getDuration();zN(this,_.Hc,a);this.m.getSurface().show(this.o)};_.r.Uk=function(a){a=a.getAdData();CN(this,a?a.adError:null);AN(this)};_.r.Yk=function(a){zN(this,_.Ec,a)};_.r.Rk=function(a){zN(this,_.wc,a)};_.r.Xi=function(a){zN(this,_.zc,a)};_.r.Vk=function(a){zN(this,_.Cc,a)};_.r.bj=function(a){zN(this,_.Jc,a)};_.r.Xk=function(a){zN(this,_.Dc,a)};
17
- _.r.Zk=function(a){zN(this,_.Fc,a)};_.r.Wi=function(a){this.pause();zN(this,_.xc,a)};_.r.$i=function(a){zN(this,_.Gc,a);AN(this)};_.r.Yi=function(a){zN(this,_.Ac,a)};_.r.Sk=function(a){zN(this,_.yc,a);AN(this)};
18
- _.r.jl=function(){var a=this;return _.E(function(b){switch(b.a){case 1:a.G=!0;if(!DN(a)||null===a.K){if(!a.H)return b["return"](a.m.play());BN(a);b.F(2);break}var c=a.m;c.a&&c.a.addDelegate(c);return _.x(b,_.lq(a.m),3);case 3:if(a.C){b.F(2);break}return _.x(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.C){b.F(6);break}return _.x(b,a.m.play(),6);case 6:zN(a,_.vc),_.y(b)}})};_.r.cl=function(){this.P=!0};_.r.hl=function(){this.C=!0;this.l.contentComplete()};
19
- _.r.load=function(){var a=this,b,c,d,e,f;return _.E(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.Wf)throw new _.P(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
- return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.E(function(c){return b.a&&b.j&&!b.I?b.j.Vb()?_.x(c,FN(b),0):_.x(c,GN(b,a),0):_.x(c,a.play(),0)})};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
2
+ var f=function(window){var dP="clpp.ima.AdsManagerFactory",eP=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},fP=function(){},gP=function(a){this.a=a},hP=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.O.Ma(a.ima||{});this.J=_.O.na({disableCustomPlayback:!1},a);this.o=this.m.mc("ima").Uc();this.T=this.m.mc("ima").h;this.l=this.m.mc("ima").a;this.L=new _.vt;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Oj;this.I=!1;this.w=new _.Sh;this.V=new fP;this.B=
3
+ null;this.N=this.H=this.D=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.yl.bind(this));a.on(this.l,b,this.xl.bind(this));a.on(this.m,_.qe,this.Fl.bind(this))},iP=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.nl.bind(a));c.on(b,d.LOADED,a.sj.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Gl.bind(a));c.on(b,d.STARTED,a.uj.bind(a));c.on(b,d.LOG,a.rl.bind(a));c.on(b,
4
+ d.AD_PROGRESS,a.vl.bind(a));c.on(b,d.AD_BUFFERING,a.ol.bind(a));c.on(b,d.FIRST_QUARTILE,a.qj.bind(a));c.on(b,d.MIDPOINT,a.sl.bind(a));c.on(b,d.THIRD_QUARTILE,a.vj.bind(a));c.on(b,d.PAUSED,a.ul.bind(a));c.on(b,d.RESUMED,a.wl.bind(a));c.on(b,d.CLICK,a.pj.bind(a));c.on(b,d.SKIPPED,a.tj.bind(a));c.on(b,d.IMPRESSION,a.rj.bind(a));c.on(b,d.COMPLETE,a.pl.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Hl.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Al.bind(a))},jP=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
+ b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.kd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.kd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
+ [];return b},lP=function(a){a.B=null;kP(a,_.Lc);a.o&&a.m.getSurface().hide(a.o)},mP=function(a){_.Wp(a.A,{visibility:"visible"})},kP=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new eP(c,a.G,a.D)});a.m.trigger(new _.L(b,d))},nP=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.P(1,9,10003,{errorType:c},b))},oP=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Vj()},qP=function(a){var b,c;return _.E(function(d){if(1==d.a)return a.T.initialize(),
7
+ b=!!a.m.getConfiguration().muted,_.x(d,a.L.canPlay(b),2);c=d.f;if(!c&&!oP(a))return kP(a,_.id),a.g.warn(_.ma),d["return"]();pP(a);_.y(d)})},rP=function(a,b){return _.E(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);pP(a);_.y(c)})},pP=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},sP=function(){this.a=this.h=this.f=null},tP=function(){return!window.google||!google.ima||!google.ima.AdsLoader},uP=function(){},vP=function(){this.Zc=
8
+ new _.K(dP)};_.r=eP.prototype;_.r.yb=function(){return"Google IMA SDK"};_.r.zb=function(){return google.ima.VERSION};_.r.Fb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};
9
+ _.r.getDuration=function(){return this.a.getDuration()};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.rc=function(){return this.f?this.f.getIsBumper():!1};_.r.Sb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Xe&&typeof b[d].clickThroughUrl===_.hg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.Cb=function(){return this.a.getVastMediaWidth()};_.r.Bb=function(){return this.a.getVastMediaHeight()};
10
+ _.r.ob=function(){return this.a.getVastMediaBitrate()};_.r.eb=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Tb=function(){return this.f?this.f.getTimeOffset():0};_.r.Ub=function(){return this.f?this.f.getAdPosition():1};_.r.Eb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
11
+ eP.prototype.getWrapperCreativeIds=eP.prototype.getWrapperCreativeIds;eP.prototype.getWrapperAdSystems=eP.prototype.getWrapperAdSystems;eP.prototype.getWrapperAdIds=eP.prototype.getWrapperAdIds;eP.prototype.getSequenceLength=eP.prototype.Eb;eP.prototype.getPositionInSequence=eP.prototype.Ub;eP.prototype.getPodTimeOffset=eP.prototype.Tb;eP.prototype.getPodIndex=eP.prototype.getPodIndex;eP.prototype.getPodType=eP.prototype.eb;eP.prototype.getMediaBitrate=eP.prototype.ob;
12
+ eP.prototype.getMediaHeight=eP.prototype.Bb;eP.prototype.getMediaWidth=eP.prototype.Cb;eP.prototype.getMediaUrl=eP.prototype.getMediaUrl;eP.prototype.getClickThroughUrl=eP.prototype.Sb;eP.prototype.isBumper=eP.prototype.rc;eP.prototype.getSkipTimeOffset=eP.prototype.getSkipTimeOffset;eP.prototype.getDuration=eP.prototype.getDuration;eP.prototype.getTitle=eP.prototype.getTitle;eP.prototype.getAdvertiserName=eP.prototype.getAdvertiserName;eP.prototype.getAdSystem=eP.prototype.getAdSystem;
13
+ eP.prototype.getApiFramework=eP.prototype.getApiFramework;eP.prototype.getCreativeId=eP.prototype.getCreativeId;eP.prototype.getId=eP.prototype.getId;eP.prototype.getTechnology=eP.prototype.Fb;eP.prototype.getAdManagerVersion=eP.prototype.zb;eP.prototype.getAdManagerName=eP.prototype.yb;fP.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}};gP.prototype.getCuePoints=function(){return this.a};gP.prototype.Wb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};gP.prototype.qb=function(){return 0<=this.a.indexOf(-1)};gP.prototype.hasPostroll=gP.prototype.qb;gP.prototype.hasPreroll=gP.prototype.Wb;gP.prototype.getCuePoints=gP.prototype.getCuePoints;_.r=hP.prototype;
14
+ _.r.yl=function(a){var b=this;this.a=a.getAdsManager(this.A,jP(this));this.a.isCustomPlaybackUsed()&&!oP(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.P(1,9,10002)),this.dispose()):(this.h=new _.tt(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new gP(a),this.m.trigger(new _.L(_.Oc,{adsTimeline:this.j})),iP(this));this.f.resolve()};
15
+ _.r.xl=function(a){nP(this,a.getError());this.f.resolve()};_.r.Gl=function(a){var b=this;return _.E(function(c){switch(c.a){case 1:return b.H=!0,oP(b)?(b.K=b.m.getPosition(),_.x(c,b.m.detach(),5)):_.x(c,b.m.pause(),4);case 4:_.Wp(b.A,{visibility:_.we});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:kP(b,_.xc,a),b.h.start(),_.y(c)}})};_.r.nl=function(){var a=this;return _.E(function(b){a.a.start();_.y(b)})};
16
+ _.r.sj=function(a){a.getAd().isLinear()?kP(this,_.Ec,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.r.uj=function(a){this.B=a.getAd().getDuration();kP(this,_.Kc,a);this.m.getSurface().show(this.o)};_.r.rl=function(a){a=a.getAdData();nP(this,a?a.adError:null);lP(this)};_.r.vl=function(a){kP(this,_.Hc,a)};_.r.ol=function(a){kP(this,_.zc,a)};_.r.qj=function(a){kP(this,_.Cc,a)};_.r.sl=function(a){kP(this,_.Fc,a)};_.r.vj=function(a){kP(this,_.Mc,a)};_.r.ul=function(a){kP(this,_.Gc,a)};
17
+ _.r.wl=function(a){kP(this,_.Ic,a)};_.r.pj=function(a){this.pause();kP(this,_.Ac,a)};_.r.tj=function(a){kP(this,_.Jc,a);lP(this)};_.r.rj=function(a){kP(this,_.Dc,a)};_.r.pl=function(a){kP(this,_.Bc,a);lP(this)};
18
+ _.r.Hl=function(){var a=this;return _.E(function(b){switch(b.a){case 1:a.G=!0;if(!oP(a)||null===a.K){if(!a.H)return b["return"](a.m.play());mP(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Sq(a.m),3);case 3:if(a.D){b.F(2);break}return _.x(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.D){b.F(6);break}return _.x(b,a.m.play(),6);case 6:kP(a,_.yc),_.y(b)}})};_.r.Al=function(){this.N=!0};_.r.Fl=function(){this.D=!0;this.l.contentComplete()};
19
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.E(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.hg)throw new _.P(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.L.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.L.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
+ return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.E(function(c){return b.a&&b.j&&!b.I?b.j.Wb()?_.x(c,qP(b),0):_.x(c,rP(b,a),0):_.x(c,a.play(),0)})};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
21
21
  _.r.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
- _.r.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.pb()&&!a.P?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Fh(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.l.contentComplete()})).then(function(){BN(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};wN.prototype.getPosition=wN.prototype.getPosition;
23
- wN.prototype.setVolume=wN.prototype.setVolume;wN.prototype.getVolume=wN.prototype.getVolume;wN.prototype.skip=wN.prototype.skip;wN.prototype.pause=wN.prototype.pause;wN.prototype.resume=wN.prototype.resume;_.w(HN,_.rt);_.r=HN.prototype;_.r.onPlayerCreated=function(a){if(IN())return a.onError(new _.P(1,9,1E4));this.f=_.qp(_.Yd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.wa);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.Zj=function(){return this.a};_.r.Xj=function(){return this.h};_.r.Rc=function(){return this.f};_.r.id=function(){return"ima"};_.H("clpp.ima.ImaPlugin",HN);HN.prototype.getAdContainer=HN.prototype.Rc;HN.prototype.getAdDisplayContainer=HN.prototype.Xj;HN.prototype.getAdsLoader=HN.prototype.Zj;HN.Id="ima";
25
- HN.isSdkMissing=IN;JN.prototype.create=function(){return new HN};_.nq(new JN);KN.prototype.name=function(){return sN};KN.prototype.ba=function(a,b){return a.namespace()===_.Cd?!1:IN()?(this.Xc.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};KN.prototype.create=function(a){return new wN(a)};KN.prototype.create=KN.prototype.create;KN.prototype.isSupported=KN.prototype.ba;KN.prototype.name=KN.prototype.name;_.np(new KN);};
22
+ _.r.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.qb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Th(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.l.contentComplete()})).then(function(){mP(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};hP.prototype.getPosition=hP.prototype.getPosition;
23
+ hP.prototype.setVolume=hP.prototype.setVolume;hP.prototype.getVolume=hP.prototype.getVolume;hP.prototype.skip=hP.prototype.skip;hP.prototype.pause=hP.prototype.pause;hP.prototype.resume=hP.prototype.resume;_.w(sP,_.Eu);_.r=sP.prototype;_.r.onPlayerCreated=function(a){if(tP())return a.onError(new _.P(1,9,1E4));this.f=_.Up(_.ae,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.va);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.sk=function(){return this.a};_.r.qk=function(){return this.h};_.r.Uc=function(){return this.f};_.r.id=function(){return"ima"};_.H("clpp.ima.ImaPlugin",sP);sP.prototype.getAdContainer=sP.prototype.Uc;sP.prototype.getAdDisplayContainer=sP.prototype.qk;sP.prototype.getAdsLoader=sP.prototype.sk;sP.Id="ima";
25
+ sP.isSdkMissing=tP;uP.prototype.create=function(){return new sP};_.Vq(new uP);vP.prototype.name=function(){return dP};vP.prototype.isSupported=function(a,b){return a.namespace()===_.Fd?!1:tP()?(this.Zc.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};vP.prototype.create=function(a){return new hP(a)};vP.prototype.create=vP.prototype.create;vP.prototype.isSupported=vP.prototype.isSupported;vP.prototype.name=vP.prototype.name;_.Rp(new vP);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}