@castlabs/prestoplay 6.28.0 → 6.29.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 (65) hide show
  1. package/CHANGELOG.md +15 -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 +123 -113
  6. package/cjs/cl.conviva.js +28 -28
  7. package/cjs/cl.core.js +616 -609
  8. package/cjs/cl.crypto.js +7 -7
  9. package/cjs/cl.dash.js +89 -89
  10. package/cjs/cl.externs.js +127 -34
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +79 -78
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +24 -24
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +350 -350
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +70 -70
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +37 -37
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +6 -6
  36. package/cl.cast.js +98 -91
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +492 -488
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +82 -82
  41. package/cl.externs.js +123 -34
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +82 -80
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +16 -15
  47. package/cl.mediatailor.js +2 -2
  48. package/cl.mse.js +303 -304
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +4 -4
  51. package/cl.persistent.js +10 -10
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +60 -60
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +56 -56
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +31 -31
  64. package/package.json +1 -1
  65. package/typings.d.ts +187 -87
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var lT="CLPP Subtitle Styles",mT="Unsupported unit",nT="clpp-text-plain",oT="clpp-text-ttml",pT="clpp.htmlcue.HtmlTextDisplayer",qT="initial",rT=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},sT=function(a){return _.Hi(a,{Lh:function(b,c){return b.ra(c)}})},tT=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)},uT=function(){},vT=function(a){if(!a.input)return null;
2
+ var f=function(window){var lT="CLPP Subtitle Styles",mT="Unsupported unit",nT="clpp-text-plain",oT="clpp-text-ttml",pT="clpp.htmlcue.HtmlTextDisplayer",qT="initial",rT=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},sT=function(a){return _.Ii(a,{Qh:function(b,c){return b.ta(c)}})},tT=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)},uT=function(){},vT=function(a){if(!a.input)return null;
3
3
  var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},xT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return wT[c]});return a},zT=function(a,b){yT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){yT(a,c)})},yT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},AT=function(a,b){return 0===a?"0":a+b},BT=function(a,b){return 1>Math.abs(a-b)||a<b},CT=function(a,b){return a<b&&
4
4
  1<Math.abs(a-b)},DT=function(a,b){return a>b&&1<Math.abs(a-b)},ET=function(a,b){return 1>Math.abs(a-b)||a>b},FT=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},GT=function(a){return new FT(a.left,a.f,a.top,a.a,a.height,a.width)},HT=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
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 FT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},IT=function(a,b){return b.some(function(c){return CT(a.left,c.f)&&DT(a.f,c.left)&&CT(a.top,c.a)&&DT(a.a,c.top)})},JT=function(a,b){return ET(a.top,b.top)&&BT(a.a,b.a)&&ET(a.left,b.left)&&BT(a.f,b.f)},KT=function(a,b,c){switch(c){case "+x":return CT(a.left,b.left);case "-x":return DT(a.f,b.f);
6
- case "+y":return CT(a.top,b.top);case "-y":return DT(a.a,b.a);default:throw Error("Unknown axis");}},LT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},MT=function(a,b,c){LT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.F=c},OT=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 NT(a)?b:c},RT=function(a,b,c){return NT(a)&&_.M.xa(c)?AT(c,_.If):(PT(a)||
7
- QT(a))&&_.M.xa(b)?AT(b,"%"):qT},PT=function(a){return a.f.writingMode===_.Kg},QT=function(a){return a.f.writingMode===_.Lg},NT=function(a){return a.f.writingMode===_.sp},ST=function(a,b,c){return(PT(a)||QT(a))&&_.M.xa(c)?AT(c,_.If):PT(a)&&_.M.R(c)?AT(0,_.If):NT(a)&&_.M.xa(b)?AT(b,"%"):qT},TT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ze:return a.f.position;case "auto":case _.gd:return a.f.position-a.f.size/2;case _.Ae:return a.f.position-a.f.size}return 0},
8
- UT=function(a){switch(a.f.positionAlign){case _.ze:return _.we;case "auto":case _.gd:return _.rp;case _.Ae:return _.Pf}return a.f.textAlign},VT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.cg:case _.we:return _.ze;case _.rp:return _.gd;case _.he:case _.Pf:return _.Ae}return a.f.positionAlign},WT=function(a){switch(a.f.writingMode){case _.sp:return"horizontal-tb";case _.Kg:return _.Kg;case _.Lg:return _.Lg;default:throw Error("Unknown writing mode");}},XT=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=HT(a.a);this.h=[]},YT=function(a,b){if(a.j)switch(b.writingMode){case _.sp:return["-y"];case _.Kg:return["+x"];case _.Lg:return["-x"]}var c=[];switch(b.writingMode){case _.sp:c=["+y","-y"];break;case _.Kg:c=["+x","-x"];break;case _.Lg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},ZT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=HT(a.l.a)},$T=function(a,b,c){LT.call(this,a,b,c);this.h=null;this.l=[]},aU=function(a,b){$T.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},bU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.xp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mT);},dU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=cU(this,this.h);this.f=cU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},eU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
6
+ case "+y":return CT(a.top,b.top);case "-y":return DT(a.a,b.a);default:throw Error("Unknown axis");}},LT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},MT=function(a,b,c){LT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},OT=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 NT(a)?b:c},RT=function(a,b,c){return NT(a)&&_.M.ya(c)?AT(c,_.Jf):(PT(a)||
7
+ QT(a))&&_.M.ya(b)?AT(b,"%"):qT},PT=function(a){return a.f.writingMode===_.Lg},QT=function(a){return a.f.writingMode===_.Mg},NT=function(a){return a.f.writingMode===_.Dp},ST=function(a,b,c){return(PT(a)||QT(a))&&_.M.ya(c)?AT(c,_.Jf):PT(a)&&_.M.P(c)?AT(0,_.Jf):NT(a)&&_.M.ya(b)?AT(b,"%"):qT},TT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ae:return a.f.position;case "auto":case _.hd:return a.f.position-a.f.size/2;case _.Be:return a.f.position-a.f.size}return 0},
8
+ UT=function(a){switch(a.f.positionAlign){case _.Ae:return _.xe;case "auto":case _.hd:return _.Cp;case _.Be:return _.Qf}return a.f.textAlign},VT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.dg:case _.xe:return _.Ae;case _.Cp:return _.hd;case _.ie:case _.Qf:return _.Be}return a.f.positionAlign},WT=function(a){switch(a.f.writingMode){case _.Dp:return"horizontal-tb";case _.Lg:return _.Lg;case _.Mg:return _.Mg;default:throw Error("Unknown writing mode");}},XT=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=HT(a.a);this.h=[]},YT=function(a,b){if(a.j)switch(b.writingMode){case _.Dp:return["-y"];case _.Lg:return["+x"];case _.Mg:return["-x"]}var c=[];switch(b.writingMode){case _.Dp:c=["+y","-y"];break;case _.Lg:c=["+x","-x"];break;case _.Mg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},ZT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=HT(a.l.a)},$T=function(a,b,c){LT.call(this,a,b,c);this.h=null;this.l=[]},aU=function(a,b){$T.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},bU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ip)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mT);},dU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=cU(this,this.h);this.f=cU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},eU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
11
  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},fU=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,
12
- c)},cU=function(a,b,c){var d=document.createElement(_.ig),e=d.dataset;e.name=lT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);gU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},gU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===lT&&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()})},jU=function(a){_.Cv.call(this,a);var b=this;this.g=new _.L(pT);this.m=a;this.L=hU(a.getConfiguration());this.j=!1;this.f=[];this.F=a.getSurface().getContainer();this.h=new dU(a.getSurface().getUniqueCssClass());this.a=new $T(null,"clpp-text-container",{});this.w=new _.vv(a.getSurface(),this.Jk.bind(this));this.J=null;this.F?(this.F.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 _.dj(function(){iU(b)});this.A=new Map;this.l=null},hU=function(a){a=_.M.ib(a.htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},kU=function(a,b){return a.startTime<=b&&a.endTime>b},iU=function(a,b){if((b||a.j)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=lU(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,mU(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Hv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(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 _.Tg:h="clpp-text-vtt";break;case _.yg:h=oT;break;case _.qp:h=nT}h&&!g.classList.contains(h)&&_.Wi(g,h);g=HT(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{yT({fontSize:nU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Tg;var l=e.payloadType===_.yg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new aU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new MT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},lU=function(a,b){var c=rT(a.f,function(e){return kU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&kU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- kU(a.f[c+1],b);)c++;return{start:d,end:c}},oU=function(a){mU(a);a.J=null;a.l=null;a.f=[]},mU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oT);b.classList.remove(nT);a=a.a;ZT(a.h);a.l=[]}},nU=function(a,b){var c=HT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.If}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.If;d=a.getFontSizePercent();return Math.round(c*d)+_.If},pU=function(){},
12
+ c)},cU=function(a,b,c){var d=document.createElement(_.jg),e=d.dataset;e.name=lT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);gU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},gU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===lT&&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()})},jU=function(a){_.Ov.call(this,a);var b=this;this.g=new _.L(pT);this.m=a;this.L=hU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new dU(a.getSurface().getUniqueCssClass());this.a=new $T(null,"clpp-text-container",{});this.w=new _.Hv(a.getSurface(),this.Vk.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 _.ej(function(){iU(b)});this.A=new Map;this.l=null},hU=function(a){a=_.M.ib(a.htmlcue||{});_.M.P(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.P(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},kU=function(a,b){return a.startTime<=b&&a.endTime>b},iU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=lU(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,mU(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Tv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(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 _.Ug:h="clpp-text-vtt";break;case _.zg:h=oT;break;case _.Bp:h=nT}h&&!g.classList.contains(h)&&_.Xi(g,h);g=HT(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{yT({fontSize:nU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ug;var l=e.payloadType===_.zg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new aU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new MT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},lU=function(a,b){var c=rT(a.f,function(e){return kU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&kU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ kU(a.f[c+1],b);)c++;return{start:d,end:c}},oU=function(a){mU(a);a.J=null;a.l=null;a.f=[]},mU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oT);b.classList.remove(nT);a=a.a;ZT(a.h);a.l=[]}},nU=function(a,b){var c=HT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Jf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Jf;d=a.getFontSizePercent();return Math.round(c*d)+_.Jf},pU=function(){},
18
18
  qU=function(){};
19
- uT.prototype.parse=function(a){a={input:a};for(var b=_.Yi(_.Pd),c=[],d=b,e;null!==(e=vT(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=rU[f];h?(h=_.Yi(h),(f=sU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||tU[g.localName]&&tU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
+ uT.prototype.parse=function(a){a={input:a};for(var b=_.Zi(_.Qd),c=[],d=b,e;null!==(e=vT(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=rU[f];h?(h=_.Zi(h),(f=sU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||tU[g.localName]&&tU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
20
  d=g)}}else d.appendChild(document.createTextNode(xT(e)));return b};var rU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},sU={v:"voice",lang:"lang"},tU={rt:"ruby"},wT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};LT.prototype.init=function(){this.j=!0};LT.prototype.A=function(){return!1};_.w(MT,LT);MT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- MT.prototype.init=function(a){LT.prototype.init.call(this,a);if(this.h)_.Wi(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===_.yg){var c=_.Yi(_.Pd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new uT).parse(b.payload):(c=_.Yi(_.Pd),c.textContent=b.payload,b=c);_.Wi(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.Wi(b,d.value);yT({writingMode:WT(this)},b);this.a.appendChild(b);_.Wi(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Wi(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.tp,this.f.line=NT(this)?-1:0);c=WT(this);yT({writingMode:c,webkitWritingMode:c,direction:qT,textAlign:UT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=TT(this,VT(this));d=ST(this,c,null);var e=RT(this,
23
- c,null),f=QT(this)&&_.M.R(null)?AT(0,_.If):qT;yT({position:"absolute",left:d,right:f,top:e,width:NT(this)?AT(this.f.size,"%"):qT,height:PT(this)||QT(this)?AT(this.f.size,"%"):qT},this.a);d=this.f;a=NT(this)?a.height:a.width;e=OT(this);if(d.lineInterpretation===_.tp)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 _.gd:g-=f/2;break;case _.he:g-=f}f=Math.round(g/100*a)}QT(this)&&(f=a-f-e);a=f;d=ST(this,c,a);e=QT(this)&&_.M.R(a)?
24
- AT(0,_.If):qT;yT({left:d,right:e,top:RT(this,c,a)},this.a)}zT(this.F,b)}};MT.prototype.o=function(){return _.Yi(_.Pd)};XT.prototype.append=function(a){var b=a.a;b.style.visibility=_.pe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=HT(a.a);var d=YT(this,a.f),e=OT(a),f=GT(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;KT(c,this.a,l)||JT(c,this.a)&&IT(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||JT(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=GT(c),h=l);c=GT(f)}c=g||f}yT({top:AT(c.top-this.a.top,_.If),bottom:AT(this.a.a-c.a,_.If),left:AT(c.left-this.a.left,_.If),right:AT(this.a.f-c.f,_.If),height:AT(c.height,_.If),width:AT(c.width,_.If)},a.a)}b.style.visibility="visible";this.h.push(HT(a.a))};_.w($T,LT);$T.prototype.init=function(){this.h=new XT(this);this.j=!0};$T.prototype.o=function(){var a=_.Yi(_.Pd);_.Wi(a,this.w);this.id&&(a.id=this.id);return a};$T.prototype.appendChild=function(a){ZT(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(aU,$T);
26
- aU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.xp:b=b.width/100*a.width;break a;default:throw Error(mT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.xp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mT);d=a.height;var e=bU(this,d,a.height);yT(this.B,this.a);yT({left:AT(c,_.If),top:AT(e,_.If),width:AT(b,_.If),height:AT(d,_.If)},this.a);this.f.writingMode&&yT({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&yT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Wi(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.xp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new MT(new _.wp(0,1,"Lorem ipsum",_.qp),{},{});c=d.a;this.a.appendChild(c);d.init(HT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(mT);
28
- }a=bU(this,b,a.height);yT({top:AT(a,_.If),height:AT(b,_.If)},this.a);this.h=new XT(this,!0);this.j=!0};aU.prototype.getId=function(){return this.f.id};dU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=fU(this,a);if(eU(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)}};
29
- dU.prototype.destroy=function(){var a=this;return _.I(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.");_.z(b)})};_.w(jU,_.Cv);_.r=jU.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(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=tT(this.f,sT(a));this.l=null;iU(this,!1)}};_.r.Tb=function(){null==this.h||iU(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();oU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.F.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(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;iU(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.Hb(.25),this.L.enableResizeObserver&&this.w.start(),iU(this,!0)):(this.G.stop(),this.w.stop(),oU(this)))};_.r.Jk=function(){iU(this,!0)};_.K(pT,jU);jU.prototype.setTextVisibility=jU.prototype.setTextVisibility;jU.prototype.isTextVisible=jU.prototype.isTextVisible;jU.prototype.remove=jU.prototype.remove;jU.prototype.destroy=jU.prototype.destroy;jU.prototype.append=jU.prototype.append;pU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.pj()};pU.prototype.create=function(a){return new jU(a)};_.w(qU,_.Tu);qU.prototype.install=function(){_.Mt(_.re,new pU)};qU.prototype.uninstall=function(){_.Kt.has(_.re)&&(_.Kt["delete"](_.re),_.Lt.info("Removed factory: 'html'"))};qU.prototype.id=function(){return _.kg};_.K("clpp.htmlcue.HtmlCueComponent",qU);};
21
+ MT.prototype.init=function(a){LT.prototype.init.call(this,a);if(this.h)_.Xi(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===_.zg){var c=_.Zi(_.Qd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ug?b=(new uT).parse(b.payload):(c=_.Zi(_.Qd),c.textContent=b.payload,b=c);_.Xi(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
+ c.next();!d.done;d=c.next())_.Xi(b,d.value);yT({writingMode:WT(this)},b);this.a.appendChild(b);_.Xi(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Xi(this.a,"clpp-text-wrapper__"+d.value);_.M.P(this.f.line)&&(this.f.lineInterpretation=_.Ep,this.f.line=NT(this)?-1:0);c=WT(this);yT({writingMode:c,webkitWritingMode:c,direction:qT,textAlign:UT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=TT(this,VT(this));d=ST(this,c,null);var e=RT(this,
23
+ c,null),f=QT(this)&&_.M.P(null)?AT(0,_.Jf):qT;yT({position:"absolute",left:d,right:f,top:e,width:NT(this)?AT(this.f.size,"%"):qT,height:PT(this)||QT(this)?AT(this.f.size,"%"):qT},this.a);d=this.f;a=NT(this)?a.height:a.width;e=OT(this);if(d.lineInterpretation===_.Ep)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 _.hd:g-=f/2;break;case _.ie:g-=f}f=Math.round(g/100*a)}QT(this)&&(f=a-f-e);a=f;d=ST(this,c,a);e=QT(this)&&_.M.P(a)?
24
+ AT(0,_.Jf):qT;yT({left:d,right:e,top:RT(this,c,a)},this.a)}zT(this.D,b)}};MT.prototype.o=function(){return _.Zi(_.Qd)};XT.prototype.append=function(a){var b=a.a;b.style.visibility=_.qe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=HT(a.a);var d=YT(this,a.f),e=OT(a),f=GT(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;KT(c,this.a,l)||JT(c,this.a)&&IT(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||JT(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=GT(c),h=l);c=GT(f)}c=g||f}yT({top:AT(c.top-this.a.top,_.Jf),bottom:AT(this.a.a-c.a,_.Jf),left:AT(c.left-this.a.left,_.Jf),right:AT(this.a.f-c.f,_.Jf),height:AT(c.height,_.Jf),width:AT(c.width,_.Jf)},a.a)}b.style.visibility="visible";this.h.push(HT(a.a))};_.w($T,LT);$T.prototype.init=function(){this.h=new XT(this);this.j=!0};$T.prototype.o=function(){var a=_.Zi(_.Qd);_.Xi(a,this.w);this.id&&(a.id=this.id);return a};$T.prototype.appendChild=function(a){ZT(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(aU,$T);
26
+ aU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ip:b=b.width/100*a.width;break a;default:throw Error(mT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ip)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mT);d=a.height;var e=bU(this,d,a.height);yT(this.B,this.a);yT({left:AT(c,_.Jf),top:AT(e,_.Jf),width:AT(b,_.Jf),height:AT(d,_.Jf)},this.a);this.f.writingMode&&yT({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&yT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Xi(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ip:b=b.height/100*a.height;break a;case 2:b=b.height;d=new MT(new _.Hp(0,1,"Lorem ipsum",_.Bp),{},{});c=d.a;this.a.appendChild(c);d.init(HT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(mT);
28
+ }a=bU(this,b,a.height);yT({top:AT(a,_.Jf),height:AT(b,_.Jf)},this.a);this.h=new XT(this,!0);this.j=!0};aU.prototype.getId=function(){return this.f.id};dU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=fU(this,a);if(eU(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)}};
29
+ dU.prototype.destroy=function(){var a=this;return _.I(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.");_.z(b)})};_.w(jU,_.Ov);_.r=jU.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(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=tT(this.f,sT(a));this.l=null;iU(this,!1)}};_.r.Vb=function(){null==this.h||iU(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();oU(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;_.z(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;iU(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.Hb(.25),this.L.enableResizeObserver&&this.w.start(),iU(this,!0)):(this.G.stop(),this.w.stop(),oU(this)))};_.r.Vk=function(){iU(this,!0)};_.K(pT,jU);jU.prototype.setTextVisibility=jU.prototype.setTextVisibility;jU.prototype.isTextVisible=jU.prototype.isTextVisible;jU.prototype.remove=jU.prototype.remove;jU.prototype.destroy=jU.prototype.destroy;jU.prototype.append=jU.prototype.append;pU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.qj()};pU.prototype.create=function(a){return new jU(a)};_.w(qU,_.ev);qU.prototype.install=function(){_.Xt(_.se,new pU)};qU.prototype.uninstall=function(){_.Vt.has(_.se)&&(_.Vt["delete"](_.se),_.Wt.info("Removed factory: 'html'"))};qU.prototype.id=function(){return _.lg};_.K("clpp.htmlcue.HtmlCueComponent",qU);};
32
32
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
33
33
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
34
34
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,27 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var RS="clpp.ima.AdsManagerFactory",SS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},TS=function(){},US=function(a){this.a=a},VS=function(){this.a=this.h=this.f=null},WS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},XS=function(){},YS=function(a){var b=a.de("ima");if(!b)throw Error("IMA plugin not created.");var c=b.nd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
- this.m=a;this.l=e;a=this.m.getConfiguration();a=_.M.ib(a.ima||{});this.I=_.M.ua({disableCustomPlayback:!1},a);this.L=c;this.O=d;this.j=b;this.J=new _.xv;this.g=new _.L("clpp.ima");this.h=this.a=null;this.f=new _.am;this.K=!1;this.F=new _.ti;this.P=new TS;this.o=null;this.H=this.A=this.B=!1;this.G=this.w=null;c=this.F;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ym.bind(this));c.on(this.j,d,this.Xm.bind(this));c.on(this.m,_.ie,this.en.bind(this))},
4
- ZS=function(a){var b=a.a,c=a.F,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Om.bind(a));c.on(b,d.LOADED,a.Nk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.fn.bind(a));c.on(b,d.STARTED,a.Qk.bind(a));c.on(b,d.LOG,a.Sm.bind(a));c.on(b,d.AD_PROGRESS,a.Ok.bind(a));c.on(b,d.AD_BUFFERING,a.Pm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Lk.bind(a));c.on(b,d.MIDPOINT,a.Tm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Rk.bind(a));c.on(b,d.PAUSED,a.Vm.bind(a));c.on(b,d.RESUMED,a.Wm.bind(a));c.on(b,d.CLICK,a.Kk.bind(a));c.on(b,
5
- d.SKIPPED,a.Pk.bind(a));c.on(b,d.IMPRESSION,a.Mk.bind(a));c.on(b,d.COMPLETE,a.Qm.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.gn.bind(a))},$S=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Xc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
- _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.Xc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},bT=function(a){a.o=null;aT(a,_.xc);a.m.getSurface().hide(a.L)},cT=function(a){return _.I(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},dT=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.F.on(a.m,_.dg,function(){4===a.m.getState()&&
7
- c()})}))})},eT=function(a){_.Xi(a.l,{visibility:"visible"})},aT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new SS(c,a.B,a.A)});a.m.trigger(new _.Q(b,d))},fT=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},gT=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ij()||_.jj()},iT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.O.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),
8
- 2);if(3!=d.a)return c=d.f,c||gT(a)?gT(a)?_.x(d,cT(a),3):d.C(3):(aT(a,_.Vc),a.g.warn(_.na),d["return"]());hT(a);_.z(d)})},jT=function(a,b){return _.I(function(c){if(1==c.a)return a.O.initialize(),_.x(c,b.play(),2);hT(a);_.z(c)})},hT=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},kT=function(){this.Ca=new _.L(RS)};_.r=SS.prototype;_.r.vb=function(){return"Google IMA SDK"};_.r.wb=function(){return google.ima.VERSION};_.r.Bb=function(){return 0};
9
- _.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Yb=function(){return""};_.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()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};
10
- _.r.bc=function(){return this.f?this.f.getIsBumper():!1};_.r.xb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Se&&typeof b[d].clickThroughUrl===_.gg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.lb=function(){return this.a.getVastMediaWidth()};_.r.kb=function(){return this.a.getVastMediaHeight()};_.r.Va=function(){return this.a.getVastMediaBitrate()};_.r.Wa=function(){return this.h?2:this.j?1:0};
11
- _.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Mb=function(){return this.f?this.f.getTimeOffset():0};_.r.zb=function(){return this.f?this.f.getAdPosition():1};_.r.nb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.ac=function(){return null};
12
- SS.prototype.getVideoElement=SS.prototype.ac;SS.prototype.getWrapperCreativeIds=SS.prototype.getWrapperCreativeIds;SS.prototype.getWrapperAdSystems=SS.prototype.getWrapperAdSystems;SS.prototype.canSeek=SS.prototype.canSeek;SS.prototype.getWrapperAdIds=SS.prototype.getWrapperAdIds;SS.prototype.getSequenceLength=SS.prototype.nb;SS.prototype.getPositionInSequence=SS.prototype.zb;SS.prototype.getPodTimeOffset=SS.prototype.Mb;SS.prototype.getPodIndex=SS.prototype.getPodIndex;SS.prototype.getPodType=SS.prototype.Wa;
13
- SS.prototype.getMediaBitrate=SS.prototype.Va;SS.prototype.getMediaHeight=SS.prototype.kb;SS.prototype.getMediaWidth=SS.prototype.lb;SS.prototype.getMediaUrl=SS.prototype.getMediaUrl;SS.prototype.getClickThroughUrl=SS.prototype.xb;SS.prototype.isBumper=SS.prototype.bc;SS.prototype.getSkipTimeOffset=SS.prototype.getSkipTimeOffset;SS.prototype.getPosition=SS.prototype.getPosition;SS.prototype.getDuration=SS.prototype.getDuration;SS.prototype.getTitle=SS.prototype.getTitle;
14
- SS.prototype.getAdvertiserName=SS.prototype.getAdvertiserName;SS.prototype.getAdSystem=SS.prototype.getAdSystem;SS.prototype.getApiFramework=SS.prototype.getApiFramework;SS.prototype.getSourceId=SS.prototype.Yb;SS.prototype.getCreativeId=SS.prototype.getCreativeId;SS.prototype.getId=SS.prototype.getId;SS.prototype.getTechnology=SS.prototype.Bb;SS.prototype.getAdManagerVersion=SS.prototype.wb;SS.prototype.getAdManagerName=SS.prototype.vb;TS.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}};US.prototype.getCuePoints=function(){return this.a};US.prototype.Ob=function(){return 0<=this.a.indexOf(0)||0===this.a.length};US.prototype.Nb=function(){return 0<=this.a.indexOf(-1)};US.prototype.hasPostroll=US.prototype.Nb;US.prototype.hasPreroll=US.prototype.Ob;US.prototype.getCuePoints=US.prototype.getCuePoints;_.w(VS,_.Tv);_.r=VS.prototype;_.r.onPlayerCreated=function(a){if(WS())return a.onError(new _.N(1,9,1E4));this.f=_.Vi(_.Pd,{"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(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
15
- _.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.Ql=function(){return this.a};_.r.Ol=function(){return this.h};_.r.nd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",VS);VS.prototype.getAdContainer=VS.prototype.nd;VS.prototype.getAdDisplayContainer=VS.prototype.Ol;VS.prototype.getAdsLoader=VS.prototype.Ql;VS.Id="ima";
16
- VS.isSdkMissing=WS;XS.prototype.create=function(){return new VS};_.r=YS.prototype;
17
- _.r.Ym=function(a){var b=this;this.a=a.getAdsManager(this.l,$S(this));this.a.isCustomPlaybackUsed()&&!gT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Dc()):(this.h=new _.vv(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.w=new US(a),this.m.trigger(new _.Q(_.Ac,{adsTimeline:this.w})),ZS(this));this.f.resolve()};
18
- _.r.Xm=function(a){fT(this,a.getError());this.f.resolve()};_.r.fn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,gT(b)?(b.G=b.m.getPosition(),_.x(c,cT(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.Xi(b.l,{visibility:_.pe}),c.C(3);aT(b,_.fc,a);b.h.start();_.z(c)})};_.r.Om=function(){var a=this;return _.I(function(b){a.a.start();_.z(b)})};_.r.Nk=function(a){a.getAd().isLinear()?aT(this,_.qc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};
19
- _.r.Qk=function(a){this.o=a.getAd().getDuration();aT(this,_.wc,a);this.m.getSurface().show(this.L)};_.r.Sm=function(a){a=a.getAdData();fT(this,a?a.adError:null);bT(this)};_.r.Ok=function(a){aT(this,_.tc,a)};_.r.Pm=function(a){aT(this,_.hc,a)};_.r.Lk=function(a){aT(this,_.kc,a)};_.r.Tm=function(a){aT(this,_.rc,a)};_.r.Rk=function(a){aT(this,_.yc,a)};_.r.Vm=function(a){aT(this,_.sc,a)};_.r.Wm=function(a){aT(this,_.uc,a)};_.r.Kk=function(a){this.pause();aT(this,_.ic,a)};
20
- _.r.Pk=function(a){aT(this,_.vc,a);bT(this)};_.r.Mk=function(a){aT(this,_.pc,a)};_.r.Qm=function(a){aT(this,_.jc,a);bT(this)};
21
- _.r.gn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!gT(a)||null===a.G){if(!a.H)return b["return"](a.m.play());eT(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Po(a.m),3);case 3:if(a.A||!a.G){b.C(2);break}return _.x(b,dT(a),5);case 5:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.A){b.C(7);break}return _.x(b,a.m.play(),7);case 7:aT(a,_.gc),_.z(b)}})};_.r.en=function(){this.A=!0;this.j.contentComplete()};
22
- _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.gg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
23
- return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Ob()?_.x(c,iT(b),0):_.x(c,jT(b,a),0):_.x(c,a.play(),0)})};_.r.gd=function(){};_.r.ed=function(){return!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)};
24
- _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Dc=function(){this.a&&(this.a.destroy(),this.a=null);eT(this);this.F.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};YS.prototype.getPosition=YS.prototype.getPosition;YS.prototype.setVolume=YS.prototype.setVolume;YS.prototype.getVolume=YS.prototype.getVolume;YS.prototype.skip=YS.prototype.skip;YS.prototype.pause=YS.prototype.pause;YS.prototype.resume=YS.prototype.resume;kT.prototype.name=function(){return RS};kT.prototype.a=function(a,b){return a.namespace()===_.qd?!1:WS()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};kT.prototype.create=function(a){return new YS(a)};_.Zh(new kT);_.To(new XS);};
2
+ var f=function(window){var QS="clpp.ima.AdsManagerFactory",RS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},SS=function(){},TS=function(a){this.a=a},US=function(){this.a=this.h=this.f=null},VS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WS=function(){},XS=function(a){var b=a.je("ima");if(!b)throw Error("IMA plugin not created.");var c=b.sd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
+ this.m=a;this.l=e;a=this.m.getConfiguration();a=_.M.ib(a.ima||{});this.H=_.M.ra({disableCustomPlayback:!1},a);this.L=c;this.O=d;this.j=b;this.J=new _.Jv;this.g=new _.L("clpp.ima");this.h=this.a=null;this.f=new _.lm;this.K=!1;this.I=new _.si;this.R=new SS;this.o=null;this.G=this.A=this.B=!1;this.D=this.w=null;c=this.I;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.kn.bind(this));c.on(this.j,d,this.jn.bind(this));c.on(this.m,_.je,this.tn.bind(this))},
4
+ YS=function(a){var b=a.a,c=a.I,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.$m.bind(a));c.on(b,d.LOADED,a.Zk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.un.bind(a));c.on(b,d.STARTED,a.cl.bind(a));c.on(b,d.LOG,a.dn.bind(a));c.on(b,d.AD_PROGRESS,a.$k.bind(a));c.on(b,d.AD_BUFFERING,a.an.bind(a));c.on(b,d.FIRST_QUARTILE,a.Xk.bind(a));c.on(b,d.MIDPOINT,a.en.bind(a));c.on(b,d.THIRD_QUARTILE,a.el.bind(a));c.on(b,d.PAUSED,a.gn.bind(a));c.on(b,d.RESUMED,a.hn.bind(a));c.on(b,d.CLICK,a.Wk.bind(a));c.on(b,
5
+ d.SKIPPED,a.al.bind(a));c.on(b,d.IMPRESSION,a.Yk.bind(a));c.on(b,d.COMPLETE,a.bn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.vn.bind(a))},ZS=function(a){a=a.H;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Yc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
+ _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.Yc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},bT=function(a){_.I(function(b){switch(b.a){case 1:return a.D=a.m.getPosition(),_.x(b,$S(a,3),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,aT(a),4);case 4:a.a.start(),_.z(b)}})},dT=function(a){a.o=null;cT(a,_.yc);a.m.getSurface().hide(a.L)},aT=function(a){return _.I(function(b){if(1==b.a)return _.x(b,
7
+ a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},$S=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){a.m.getState()>=b&&(clearInterval(g),clearTimeout(f),d())},200)}))})},eT=function(a){_.Yi(a.l,{visibility:"visible"})},cT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new RS(c,a.B,a.A)});a.m.trigger(new _.Q(b,d))},fT=
8
+ function(a,b){var c=b?a.R.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},gT=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.jj()||_.kj()},iT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.O.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),2);c=d.f;if(!c&&!gT(a))return cT(a,_.Wc),a.g.warn(_.na),d["return"]();hT(a);_.z(d)})},jT=function(a,b){return _.I(function(c){if(1==c.a)return a.O.initialize(),_.x(c,
9
+ b.play(),2);hT(a);_.z(c)})},hT=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);gT(a)||a.a.start();a.K=!0},kT=function(){this.Da=new _.L(QS)};_.r=RS.prototype;_.r.vb=function(){return"Google IMA SDK"};_.r.wb=function(){return google.ima.VERSION};_.r.Bb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.$b=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
10
+ _.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()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.ec=function(){return this.f?this.f.getIsBumper():!1};
11
+ _.r.xb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Te&&typeof b[d].clickThroughUrl===_.hg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.lb=function(){return this.a.getVastMediaWidth()};_.r.kb=function(){return this.a.getVastMediaHeight()};_.r.Wa=function(){return this.a.getVastMediaBitrate()};_.r.Xa=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
12
+ _.r.Ob=function(){return this.f?this.f.getTimeOffset():0};_.r.zb=function(){return this.f?this.f.getAdPosition():1};_.r.nb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.cc=function(){return null};RS.prototype.getVideoElement=RS.prototype.cc;
13
+ RS.prototype.getWrapperCreativeIds=RS.prototype.getWrapperCreativeIds;RS.prototype.getWrapperAdSystems=RS.prototype.getWrapperAdSystems;RS.prototype.canSeek=RS.prototype.canSeek;RS.prototype.getWrapperAdIds=RS.prototype.getWrapperAdIds;RS.prototype.getSequenceLength=RS.prototype.nb;RS.prototype.getPositionInSequence=RS.prototype.zb;RS.prototype.getPodTimeOffset=RS.prototype.Ob;RS.prototype.getPodIndex=RS.prototype.getPodIndex;RS.prototype.getPodType=RS.prototype.Xa;RS.prototype.getMediaBitrate=RS.prototype.Wa;
14
+ RS.prototype.getMediaHeight=RS.prototype.kb;RS.prototype.getMediaWidth=RS.prototype.lb;RS.prototype.getMediaUrl=RS.prototype.getMediaUrl;RS.prototype.getClickThroughUrl=RS.prototype.xb;RS.prototype.isBumper=RS.prototype.ec;RS.prototype.getSkipTimeOffset=RS.prototype.getSkipTimeOffset;RS.prototype.getPosition=RS.prototype.getPosition;RS.prototype.getDuration=RS.prototype.getDuration;RS.prototype.getTitle=RS.prototype.getTitle;RS.prototype.getAdvertiserName=RS.prototype.getAdvertiserName;
15
+ RS.prototype.getAdSystem=RS.prototype.getAdSystem;RS.prototype.getApiFramework=RS.prototype.getApiFramework;RS.prototype.getSourceId=RS.prototype.$b;RS.prototype.getCreativeId=RS.prototype.getCreativeId;RS.prototype.getId=RS.prototype.getId;RS.prototype.getTechnology=RS.prototype.Bb;RS.prototype.getAdManagerVersion=RS.prototype.wb;RS.prototype.getAdManagerName=RS.prototype.vb;SS.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}};TS.prototype.getCuePoints=function(){return this.a};TS.prototype.Rb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};TS.prototype.Qb=function(){return 0<=this.a.indexOf(-1)};TS.prototype.hasPostroll=TS.prototype.Qb;TS.prototype.hasPreroll=TS.prototype.Rb;TS.prototype.getCuePoints=TS.prototype.getCuePoints;_.w(US,_.ew);_.r=US.prototype;_.r.onPlayerCreated=function(a){if(VS())return a.onError(new _.N(1,9,1E4));this.f=_.Wi(_.Qd,{"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(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
16
+ _.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.bm=function(){return this.a};_.r.$l=function(){return this.h};_.r.sd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",US);US.prototype.getAdContainer=US.prototype.sd;US.prototype.getAdDisplayContainer=US.prototype.$l;US.prototype.getAdsLoader=US.prototype.bm;US.Id="ima";
17
+ US.isSdkMissing=VS;WS.prototype.create=function(){return new US};_.r=XS.prototype;
18
+ _.r.kn=function(a){var b=this;this.a=a.getAdsManager(this.l,ZS(this));this.a.isCustomPlaybackUsed()&&!gT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Gc()):(this.h=new _.Hv(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.w=new TS(a),this.m.trigger(new _.Q(_.Bc,{adsTimeline:this.w})),YS(this));this.f.resolve()};
19
+ _.r.jn=function(a){fT(this,a.getError());this.f.resolve()};_.r.un=function(a){this.G=!0;gT(this)||(this.m.pause(),_.Yi(this.l,{visibility:_.qe}));cT(this,_.gc,a);this.h.start()};_.r.$m=function(){gT(this)?bT(this):this.a.start()};_.r.Zk=function(a){a.getAd().isLinear()?cT(this,_.rc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};_.r.cl=function(a){this.o=a.getAd().getDuration();cT(this,_.xc,a);this.m.getSurface().show(this.L)};
20
+ _.r.dn=function(a){a=a.getAdData();fT(this,a?a.adError:null);dT(this)};_.r.$k=function(a){cT(this,_.uc,a)};_.r.an=function(a){cT(this,_.ic,a)};_.r.Xk=function(a){cT(this,_.lc,a)};_.r.en=function(a){cT(this,_.sc,a)};_.r.el=function(a){cT(this,_.zc,a)};_.r.gn=function(a){cT(this,_.tc,a)};_.r.hn=function(a){cT(this,_.vc,a)};_.r.Wk=function(a){this.pause();cT(this,_.jc,a)};_.r.al=function(a){cT(this,_.wc,a);dT(this)};_.r.Yk=function(a){cT(this,_.qc,a)};_.r.bn=function(a){cT(this,_.kc,a);dT(this)};
21
+ _.r.vn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!gT(a)||null===a.D){if(!a.G)return b["return"](a.m.play());eT(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.$o(a.m),3);case 3:if(a.A||!a.D){b.C(2);break}return _.x(b,$S(a,2),5);case 5:return _.x(b,a.m.play(),6);case 6:return _.x(b,a.m.pause(),7);case 7:return _.x(b,$S(a,4),8);case 8:return _.x(b,a.m.seek(a.D),2);case 2:a.G=!1;a.h&&a.h.stop();if(a.A){b.C(10);break}return _.x(b,a.m.play(),10);case 10:cT(a,
22
+ _.hc),_.z(b)}})};_.r.tn=function(){this.A=!0;this.j.contentComplete()};
23
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.H;try{if(typeof c.adTagUrl!==_.hg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
24
+ return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Rb()?_.x(c,iT(b),0):_.x(c,jT(b,a),0):_.x(c,a.play(),0)})};_.r.ld=function(){};_.r.hd=function(){return!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)};
25
+ _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Gc=function(){this.a&&(this.a.destroy(),this.a=null);eT(this);this.I.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};XS.prototype.getPosition=XS.prototype.getPosition;XS.prototype.setVolume=XS.prototype.setVolume;XS.prototype.getVolume=XS.prototype.getVolume;XS.prototype.skip=XS.prototype.skip;XS.prototype.pause=XS.prototype.pause;XS.prototype.resume=XS.prototype.resume;kT.prototype.name=function(){return QS};kT.prototype.a=function(a,b){return a.namespace()===_.rd?!1:VS()?(this.Da.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};kT.prototype.create=function(a){return new XS(a)};_.ai(new kT);_.dp(new WS);};
25
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
28
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var OS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},PS=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.qb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;h={hj:_.qn(f,b),Fp:g?_.qn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.hj);return l["return"](h)})},QS=function(){};_.w(OS,_.Tv);
3
- OS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,PS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.hj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};OS.prototype.id=function(){return"mediatailor"};
4
- QS.prototype.create=function(){return new OS};_.To(new QS);};
2
+ var f=function(window){var NS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},OS=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.qb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;h={pj:_.Cn(f,b),Qp:g?_.Cn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.pj);return l["return"](h)})},PS=function(){};_.w(NS,_.ew);
3
+ NS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,OS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.pj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};NS.prototype.id=function(){return"mediatailor"};
4
+ PS.prototype.create=function(){return new NS};_.dp(new PS);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}