@castlabs/prestoplay 6.17.1 → 6.19.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 (64) hide show
  1. package/CHANGELOG.md +55 -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 +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +575 -565
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -74
  10. package/cjs/cl.externs.js +175 -293
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +70 -69
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +315 -314
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +473 -466
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +72 -70
  40. package/cl.externs.js +172 -294
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +276 -273
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +8 -8
  59. package/cl.vr.js +15 -15
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +2 -2
  64. package/typings.d.ts +406 -377
package/cl.htmlcue.js CHANGED
@@ -1,26 +1,26 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var BQ="Unsupported unit",CQ="clpp-text-plain",DQ="clpp-text-ttml",EQ="clpp.htmlcue.HtmlTextDisplayer",FQ="initial",GQ=function(a){return _.Bh(a,{Ze:(b,c)=>b.wc(c)})},HQ=function(a,b){if(0===b.length)return a;let c=a;a=a.findIndex(d=>d.startTime>=b[0].startTime);0<=a&&(c=c.slice(0,a));return c.concat(b)},IQ=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},JQ=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);
2
- b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},LQ=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>KQ[c]);return a},NQ=function(a,b){MQ(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{MQ(a,c)})},MQ=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},OQ=function(a,b){return 0===a?"0":a+b},PQ=function(a,b){return 1>Math.abs(a-b)||a<b},QQ=function(a,b){return a<b&&1<Math.abs(a-b)},RQ=function(a,b){return a>b&&1<Math.abs(a-b)},SQ=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},UQ=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new TQ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},VQ=function(a){return new TQ(a.left,a.f,a.top,a.a,a.height,a.width)},WQ=function(a,b){return b.some(c=>QQ(a.left,c.f)&&RQ(a.f,c.left)&&QQ(a.top,c.a)&&RQ(a.a,c.top))},XQ=function(a,b){return SQ(a.top,b.top)&&PQ(a.a,b.a)&&SQ(a.left,b.left)&&PQ(a.f,b.f)},YQ=function(a,b,c){switch(c){case "+x":return QQ(a.left,b.left);case "-x":return RQ(a.f,b.f);case "+y":return QQ(a.top,b.top);case "-y":return RQ(a.a,b.a);default:throw Error("Unknown axis");}},ZQ=function(a){return a.f.writingMode===_.os},$Q=
5
- function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return ZQ(a)?b:c},aR=function(a){switch(a.f.writingMode){case _.os:return"horizontal-tb";case _.eg:return _.eg;case _.fg:return _.fg;default:throw Error("Unknown writing mode");}},bR=function(a){switch(a.f.positionAlign){case _.he:return _.ee;case "auto":case _.$c:return _.ns;case _.ie:return _.vf}return a.f.textAlign},cR=function(a,b){if(typeof a.f.position===_.t&&typeof a.f.size===
6
- _.t)switch(b){case _.he:return a.f.position;case "auto":case _.$c:return a.f.position-a.f.size/2;case _.ie:return a.f.position-a.f.size}return 0},dR=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ee:case _.ee:return _.he;case _.ns:return _.$c;case _.vf:case _.vf:return _.ie}return a.f.positionAlign},gR=function(a,b,c){return(eR(a)||fR(a))&&_.Ug(c)?OQ(c,_.of):eR(a)&&_.A(c)?OQ(0,_.of):ZQ(a)&&_.Ug(b)?OQ(b,"%"):FQ},hR=function(a,b,c){return ZQ(a)&&_.Ug(c)?OQ(c,_.of):(eR(a)||fR(a))&&_.Ug(b)?
7
- OQ(b,"%"):FQ},fR=function(a){return a.f.writingMode===_.fg},eR=function(a){return a.f.writingMode===_.eg},iR=function(a,b){if(a.j)switch(b.writingMode){case _.os:return["-y"];case _.eg:return["+x"];case _.fg:return["-x"]}a=[];switch(b.writingMode){case _.os:a=["+y","-y"];break;case _.eg:a=["+x","-x"];break;case _.fg:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},jR=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=UQ(a.l.a)},kR=function(a,b){jR(a.g);a.l.unshift(b);
8
- for(const c of a.l)a.g.append(c)},lR=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.vs)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(BQ);},nR=function(a,b,c,d){const e=document.createElement(_.Of),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);mR(a,c,b);a.h.debug(`Created HTML style element #${b}.`);return e.sheet},oR=function(a,b){a=`.${a.j} .clpp-text-container`;
9
- const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,`${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,a)},pR=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);
10
- return c},qR=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},mR=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.h.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});d.observe(b,{subtree:!1,childList:!0});a.l.push(()=>d.disconnect())},rR=function(a){a=_.Ng(a.htmlcue||{});_.A(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.A(a.enableResizeObserver)&&(a.enableResizeObserver=
11
- !0);return a},xR=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Wn)if(a.J=c,c=sR(a,c),b||(b=a.o,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.o=c,tR(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.es(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.rg:g="clpp-text-vtt";
12
- break;case _.Vf:g=DQ;break;case _.ms:g=CQ}g&&!f.classList.contains(g)&&_.so(f,g);f=UQ(c.a.a);if(0===f.width||0===f.height)c.h.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{MQ({fontSize:uR(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.rg;var h=d.payloadType===_.Vf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new vR(d.region,
13
- {}),c.B.set(d.region.id,f),kR(c.a,f)));d=new wR(d,c.L,e);f?kR(f,d):kR(c.a,d)}}}}},yR=function(a){tR(a);a.J=null;a.o=null;a.f=[]},zR=function(a,b){return a.startTime<=b&&a.endTime>b},sR=function(a,b){var c=IQ(a.f,d=>zR(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&zR(a.f[d-1],b);)d--;for(;c+1<a.f.length&&zR(a.f[c+1],b);)c++;return{start:d,end:c}}},tR=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(DQ);
14
- b.classList.remove(CQ);a=a.a;jR(a.g);a.l=[]}},uR=function(a,b){const c=UQ(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.t&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*a)}px`},DR=class{parse(a){a={input:a};const b=_.uo(_.Fd),c=[];let d=b;for(var e;null!==(e=JQ(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
- else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=AR[f];h?(h=_.uo(h),(f=BR[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||CR[g.localName]&&CR[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(LQ(e)));return b}},AR={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},BR={v:"voice",lang:"lang"},CR={rt:"ruby"},KQ={"\x26amp;":"\x26",
16
- "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var TQ=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var ER=class{constructor(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var wR=class extends ER{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.g=!!this.f.backgroundImage;this.C=c}A(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.so(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===_.Vf){var c=_.uo(_.Fd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.rg?b=(new DR).parse(b.payload):(c=_.uo(_.Fd),c.textContent=b.payload,b=c);_.so(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.so(b,d);MQ({writingMode:aR(this)},b);var d=b;this.a.appendChild(d);_.so(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.so(this.a,`clpp-text-wrapper__${e}`);_.A(this.f.line)&&(this.f.lineInterpretation=_.ps,this.f.line=ZQ(this)?-1:0);e=aR(this);MQ({writingMode:e,webkitWritingMode:e,direction:FQ,textAlign:bR(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=cR(this,dR(this));MQ({position:"absolute",left:gR(this,e,null),right:fR(this)&&_.A(null)?OQ(0,_.of):FQ,top:hR(this,e,null),width:ZQ(this)?OQ(this.f.size,"%"):FQ,height:eR(this)||fR(this)?OQ(this.f.size,"%"):FQ},this.a);b=this.f;a=ZQ(this)?a.height:a.width;c=$Q(this);if(b.lineInterpretation===_.ps){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.$c:g-=f/2;break;case _.Td:g-=f}f=Math.round(g/
19
- 100*a)}fR(this)&&(f=a-f-c);a=f;MQ({left:gR(this,e,a),right:fR(this)&&_.A(a)?OQ(0,_.of):FQ,top:hR(this,e,a)},this.a)}NQ(this.C,d)}}o(){return _.uo(_.Fd)}};var FR=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=UQ(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.Zd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=UQ(a.a);var d=iR(this,a.f),e=$Q(a);const g=VQ(c);let h=null,k=0;for(const l of d){for(;YQ(c,this.a,l)||XQ(c,this.a)&&WQ(c,this.g);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||XQ(c,this.a))break a;
20
- d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=VQ(c),k=d);c=VQ(g)}c=h||g}MQ({top:OQ(c.top-this.a.top,_.of),bottom:OQ(this.a.a-c.a,_.of),left:OQ(c.left-this.a.left,_.of),right:OQ(this.a.f-c.f,_.of),height:OQ(c.height,_.of),width:OQ(c.width,_.of)},a.a)}b.style.visibility="visible";this.g.push(UQ(a.a))}};var GR=class extends ER{constructor(a,b,c){super(a,b,c);this.g=null;this.l=[]}init(){this.g=new FR(this);this.j=!0}o(){const a=_.uo(_.Fd);_.so(a,this.w);this.id&&(a.id=this.id);return a}};var vR=class extends GR{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.vs:b=b.width/100*a.width;break a;default:throw Error(BQ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.vs)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(BQ);d=a.height;const e=lR(this,d,a.height);MQ(this.B,this.a);MQ({left:OQ(c,_.of),top:OQ(e,_.of),width:OQ(b,
21
- _.of),height:OQ(d,_.of)},this.a);this.f.writingMode&&MQ({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&MQ({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.so(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.vs:f=f.height/100*a.height;break a;case 2:f=f.height;c=new wR(new _.ss(0,1,"Lorem ipsum",_.ms),{},{});b=c.a;this.a.appendChild(b);c.init(UQ(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(BQ);}a=lR(this,f,a.height);MQ({top:OQ(a,_.of),height:OQ(f,_.of)},this.a);this.g=new FR(this,!0);this.j=!0}getId(){return this.f.id}};var HR=class{constructor(a,b){this.h=new _.R("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.g=b;this.o=[];this.a=nR(this,this.g,this.j);this.f=nR(this,this.g,this.j,!0);this.f.disabled=!0;this.h.debug(`Stylesheet ${this.g} has been created.`)}appendRule(a){if(null!=this.a&&!this.o.some(b=>b===a)){const b=oR(this,a);if(pR(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug(`Added CSS rule ${b}`)}catch(c){this.h.error(`An error occurred when adding a CSS rule: ${b}`)}this.o.push(a)}else this.h.warn(`Stylesheet ${this.g} ignoring the CSS rule `+
23
- `because it's not safe: ${b}`)}}destroy(){const a=this;return _.x(function*(){null!=a.a&&(a.l.forEach(b=>b()),a.l=[],qR(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.h.debug(`Stylesheet ${a.g} has been destroyed.`))})}};var IR=class extends _.ou{constructor(a){super(a);this.h=new _.R(EQ);this.m=a;this.L=rR(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new HR(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new GR(null,"clpp-text-container",{});this.A=new _.fu(a.getSurface(),this.T.bind(this));this.J=null;this.F?(this.F.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
24
- this.G=new _.Qj(()=>{xR(this)});this.B=new Map;this.o=null}append(a,b){if(null!=this.j&&0!==a.length){for(const c of b)this.j.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);this.f=HQ(this.f,GQ(a));this.o=null;xR(this,!1)}}g(){null==this.j||xR(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(yR(a),a.G.stop(),yield a.j.destroy(),a.j=null,a.F.removeChild(a.a.a),a.a=null,a.A.stop(),a.A=null,a.l=!1)})}remove(a,b){if(null==this.j)return!1;
25
- this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;xR(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.hb(.25),this.L.enableResizeObserver&&this.A.start(),xR(this,!0)):(this.G.stop(),this.A.stop(),yR(this)))}Oc(){return this.f}T(){xR(this,!0)}};_.z(EQ,IR);IR.prototype.setTextVisibility=IR.prototype.setTextVisibility;IR.prototype.isTextVisible=IR.prototype.isTextVisible;IR.prototype.remove=IR.prototype.remove;
26
- IR.prototype.destroy=IR.prototype.destroy;IR.prototype.append=IR.prototype.append;var JR=class{isSupported(a){return!!a.enableHtmlCue&&!_.gk()}create(a){return new IR(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Pt{f(){_.An(_.$d,new JR)}a(){_.yn.has(_.$d)&&(_.yn.delete(_.$d),_.zn.info("Removed factory: 'html'"))}id(){return _.Pf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var YQ="Unsupported unit",ZQ="clpp-text-plain",$Q="clpp-text-ttml",aR="clpp.htmlcue.HtmlTextDisplayer",bR="initial",cR=function(a){return _.Gh(a,{bf:(b,c)=>b.Ac(c)})},dR=function(a,b){if(0===b.length)return a;let c=a;a=a.findIndex(d=>d.startTime>=b[0].startTime);0<=a&&(c=c.slice(0,a));return c.concat(b)},eR=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},fR=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);
2
+ b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},hR=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>gR[c]);return a},jR=function(a,b){iR(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{iR(a,c)})},iR=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},kR=function(a,b){return 0===a?"0":a+b},lR=function(a,b){return 1>Math.abs(a-b)||a<b},mR=function(a,b){return a<b&&1<Math.abs(a-b)},nR=function(a,b){return a>b&&1<Math.abs(a-b)},oR=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},qR=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new pR(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},rR=function(a){return new pR(a.left,a.f,a.top,a.a,a.height,a.width)},sR=function(a,b){return b.some(c=>mR(a.left,c.f)&&nR(a.f,c.left)&&mR(a.top,c.a)&&nR(a.a,c.top))},tR=function(a,b){return oR(a.top,b.top)&&lR(a.a,b.a)&&oR(a.left,b.left)&&lR(a.f,b.f)},uR=function(a,b,c){switch(c){case "+x":return mR(a.left,b.left);case "-x":return nR(a.f,b.f);case "+y":return mR(a.top,b.top);case "-y":return nR(a.a,b.a);default:throw Error("Unknown axis");}},vR=function(a){return a.f.writingMode===_.Fs},wR=
5
+ function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return vR(a)?b:c},xR=function(a){switch(a.f.writingMode){case _.Fs:return"horizontal-tb";case _.kg:return _.kg;case _.lg:return _.lg;default:throw Error("Unknown writing mode");}},yR=function(a){switch(a.f.positionAlign){case _.je:return _.ge;case "auto":case _.cd:return _.Es;case _.le:return _.yf}return a.f.textAlign},zR=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
+ _.r)switch(b){case _.je:return a.f.position;case "auto":case _.cd:return a.f.position-a.f.size/2;case _.le:return a.f.position-a.f.size}return 0},AR=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ge:case _.ge:return _.je;case _.Es:return _.cd;case _.yf:case _.yf:return _.le}return a.f.positionAlign},DR=function(a,b,c){return(BR(a)||CR(a))&&_.Yg(c)?kR(c,_.rf):BR(a)&&_.z(c)?kR(0,_.rf):vR(a)&&_.Yg(b)?kR(b,"%"):bR},ER=function(a,b,c){return vR(a)&&_.Yg(c)?kR(c,_.rf):(BR(a)||CR(a))&&_.Yg(b)?
7
+ kR(b,"%"):bR},CR=function(a){return a.f.writingMode===_.lg},BR=function(a){return a.f.writingMode===_.kg},FR=function(a,b){if(a.j)switch(b.writingMode){case _.Fs:return["-y"];case _.kg:return["+x"];case _.lg:return["-x"]}a=[];switch(b.writingMode){case _.Fs:a=["+y","-y"];break;case _.kg:a=["+x","-x"];break;case _.lg:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},GR=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=qR(a.l.a)},HR=function(a,b){GR(a.h);a.l.unshift(b);
8
+ for(const c of a.l)a.h.append(c)},IR=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.Ms)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(YQ);},KR=function(a,b,c,d){const e=document.createElement(_.Rf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);JR(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},LR=function(a,b){a=`.${a.j} .clpp-text-container`;
9
+ const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,`${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,a)},MR=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);
10
+ return c},NR=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},JR=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.g.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});d.observe(b,{subtree:!1,childList:!0});a.l.push(()=>d.disconnect())},OR=function(a){a=_.Rg(a.htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=
11
+ !0);return a},UR=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.bo)if(a.J=c,c=PR(a,c),b||(b=a.o,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.o=c,QR(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.vs(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.vg:g="clpp-text-vtt";
12
+ break;case _.Zf:g=$Q;break;case _.Ds:g=ZQ}g&&!f.classList.contains(g)&&_.xo(f,g);f=qR(c.a.a);if(0===f.width||0===f.height)c.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{iR({fontSize:RR(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.vg;var h=d.payloadType===_.Zf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new SR(d.region,
13
+ {}),c.B.set(d.region.id,f),HR(c.a,f)));d=new TR(d,c.L,e);f?HR(f,d):HR(c.a,d)}}}}},VR=function(a){QR(a);a.J=null;a.o=null;a.f=[]},WR=function(a,b){return a.startTime<=b&&a.endTime>b},PR=function(a,b){var c=eR(a.f,d=>WR(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&WR(a.f[d-1],b);)d--;for(;c+1<a.f.length&&WR(a.f[c+1],b);)c++;return{start:d,end:c}}},QR=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove($Q);
14
+ b.classList.remove(ZQ);a=a.a;GR(a.h);a.l=[]}},RR=function(a,b){const c=qR(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.r&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*a)}px`},aS=class{parse(a){a={input:a};const b=_.zo(_.Fd),c=[];let d=b;for(var e;null!==(e=fR(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
+ else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=YR[f];h?(h=_.zo(h),(f=ZR[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||$R[g.localName]&&$R[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(hR(e)));return b}},YR={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},ZR={v:"voice",lang:"lang"},$R={rt:"ruby"},gR={"\x26amp;":"\x26",
16
+ "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var pR=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var bS=class{constructor(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var TR=class extends bS{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c}A(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.h)_.xo(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===_.Zf){var c=_.zo(_.Fd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.vg?b=(new aS).parse(b.payload):(c=_.zo(_.Fd),c.textContent=b.payload,b=c);_.xo(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.xo(b,d);iR({writingMode:xR(this)},b);var d=b;this.a.appendChild(d);_.xo(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.xo(this.a,`clpp-text-wrapper__${e}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.Gs,this.f.line=vR(this)?-1:0);e=xR(this);iR({writingMode:e,webkitWritingMode:e,direction:bR,textAlign:yR(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=zR(this,AR(this));iR({position:"absolute",left:DR(this,e,null),right:CR(this)&&_.z(null)?kR(0,_.rf):bR,top:ER(this,e,null),width:vR(this)?kR(this.f.size,"%"):bR,height:BR(this)||CR(this)?kR(this.f.size,"%"):bR},this.a);b=this.f;a=vR(this)?a.height:a.width;c=wR(this);if(b.lineInterpretation===_.Gs){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.cd:g-=f/2;break;case _.Td:g-=f}f=Math.round(g/
19
+ 100*a)}CR(this)&&(f=a-f-c);a=f;iR({left:DR(this,e,a),right:CR(this)&&_.z(a)?kR(0,_.rf):bR,top:ER(this,e,a)},this.a)}jR(this.C,d)}}o(){return _.zo(_.Fd)}};var cS=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=qR(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.ae;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=qR(a.a);var d=FR(this,a.f),e=wR(a);const g=rR(c);let h=null,k=0;for(const l of d){for(;uR(c,this.a,l)||tR(c,this.a)&&sR(c,this.h);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||tR(c,this.a))break a;
20
+ d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=rR(c),k=d);c=rR(g)}c=h||g}iR({top:kR(c.top-this.a.top,_.rf),bottom:kR(this.a.a-c.a,_.rf),left:kR(c.left-this.a.left,_.rf),right:kR(this.a.f-c.f,_.rf),height:kR(c.height,_.rf),width:kR(c.width,_.rf)},a.a)}b.style.visibility="visible";this.h.push(qR(a.a))}};var dS=class extends bS{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new cS(this);this.j=!0}o(){const a=_.zo(_.Fd);_.xo(a,this.w);this.id&&(a.id=this.id);return a}};var SR=class extends dS{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ms:b=b.width/100*a.width;break a;default:throw Error(YQ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ms)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(YQ);d=a.height;const e=IR(this,d,a.height);iR(this.B,this.a);iR({left:kR(c,_.rf),top:kR(e,_.rf),width:kR(b,
21
+ _.rf),height:kR(d,_.rf)},this.a);this.f.writingMode&&iR({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&iR({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.xo(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Ms:f=f.height/100*a.height;break a;case 2:f=f.height;c=new TR(new _.Js(0,1,"Lorem ipsum",_.Ds),{},{});b=c.a;this.a.appendChild(b);c.init(qR(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(YQ);}a=IR(this,f,a.height);iR({top:kR(a,_.rf),height:kR(f,_.rf)},this.a);this.h=new cS(this,!0);this.j=!0}getId(){return this.f.id}};var eS=class{constructor(a,b){this.g=new _.R("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=KR(this,this.h,this.j);this.f=KR(this,this.h,this.j,!0);this.f.disabled=!0;this.g.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.o.some(b=>b===a)){const b=LR(this,a);if(MR(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.o.push(a)}else this.g.warn(`Stylesheet ${this.h} ignoring the CSS rule `+
23
+ `because it's not safe: ${b}`)}}destroy(){const a=this;return _.w(function*(){null!=a.a&&(a.l.forEach(b=>b()),a.l=[],NR(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.g.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var fS=class extends _.yu{constructor(a){super(a);this.g=new _.R(aR);this.m=a;this.L=OR(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new eS(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new dS(null,"clpp-text-container",{});this.A=new _.ru(a.getSurface(),this.S.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.");
24
+ this.G=new _.Wj(()=>{UR(this)});this.B=new Map;this.o=null}append(a,b){if(null!=this.j&&0!==a.length){for(const c of b)this.j.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);this.f=dR(this.f,cR(a));this.o=null;UR(this,!1)}}h(){null==this.j||UR(this,!0)}destroy(){const a=this;return _.w(function*(){null!=a.j&&(VR(a),a.G.stop(),yield a.j.destroy(),a.j=null,a.F.removeChild(a.a.a),a.a=null,a.A.stop(),a.A=null,a.l=!1)})}remove(a,b){if(null==this.j)return!1;
25
+ this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;UR(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.vb(.25),this.L.enableResizeObserver&&this.A.start(),UR(this,!0)):(this.G.stop(),this.A.stop(),VR(this)))}S(){UR(this,!0)}};_.x(aR,fS);fS.prototype.setTextVisibility=fS.prototype.setTextVisibility;fS.prototype.isTextVisible=fS.prototype.isTextVisible;fS.prototype.remove=fS.prototype.remove;fS.prototype.destroy=fS.prototype.destroy;
26
+ fS.prototype.append=fS.prototype.append;var gS=class{a(a){return!!a.enableHtmlCue&&!_.mk()}create(a){return new fS(a)}};_.x("clpp.htmlcue.HtmlCueComponent",class extends _.au{f(){_.Gn(_.ce,new gS)}a(){_.En.has(_.ce)&&(_.En.delete(_.ce),_.Fn.info("Removed factory: 'html'"))}id(){return _.Sf}});};f.call(g, window);
package/cl.ima.js CHANGED
@@ -1,17 +1,17 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kQ="clpp.ima.AdsManagerFactory",lQ=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.t&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Nc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.t&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.t&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
- _.Nc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},mQ=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Uj()},nQ=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.da.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Zb.bind(a));c.on(b,d.STARTED,a.Y.bind(a));c.on(b,d.LOG,a.Ja.bind(a));c.on(b,d.AD_PROGRESS,a.Sa.bind(a));c.on(b,d.AD_BUFFERING,a.ja.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ka.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,a.La.bind(a));c.on(b,d.RESUMED,a.ib.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.X.bind(a));c.on(b,d.IMPRESSION,a.T.bind(a));c.on(b,d.COMPLETE,a.Ia.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ac.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},oQ=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},pQ=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.E(b,d))},qQ=function(a){a.B=null;pQ(a,_.qc);a.o&&a.m.getSurface().hide(a.o)},rQ=function(a){_.to(a.A,{visibility:"visible"})},tQ=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||mQ(a)?sQ(a):(pQ(a,_.Lc),a.h.warn(_.ka))})},uQ=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();sQ(a)})},sQ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.a.start();a.H=!0},vQ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c}vb(){return"Google IMA SDK"}wb(){return google.ima.VERSION}Cb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}gc(){return this.f?
6
- this.f.getIsBumper():!1}Mb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Ce&&typeof b[d].clickThroughUrl===_.Mf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}zb(){return this.a.getVastMediaWidth()}yb(){return this.a.getVastMediaHeight()}nb(){return this.a.getVastMediaBitrate()}ab(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Nb(){return this.f?this.f.getTimeOffset():0}Ob(){return this.f?this.f.getAdPosition():
7
- 1}Bb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.Bb;X.prototype.getPositionInSequence=X.prototype.Ob;
8
- X.prototype.getPodTimeOffset=X.prototype.Nb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.ab;X.prototype.getMediaBitrate=X.prototype.nb;X.prototype.getMediaHeight=X.prototype.yb;X.prototype.getMediaWidth=X.prototype.zb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Mb;X.prototype.isBumper=X.prototype.gc;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
9
- X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.Cb;X.prototype.getAdManagerVersion=X.prototype.wb;X.prototype.getAdManagerName=X.prototype.vb;var wQ=class{create(a){const 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}}};var xQ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Pb(){return 0<=this.a.indexOf(0)||0===this.a.length}pb(){return 0<=this.a.indexOf(-1)}};xQ.prototype.hasPostroll=xQ.prototype.pb;xQ.prototype.hasPreroll=xQ.prototype.Pb;xQ.prototype.getCuePoints=xQ.prototype.getCuePoints;var yQ=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Ng(a.ima||{});this.I=a=_.Mg({disableCustomPlayback:!1},a);this.o=this.m.cc("ima").xc();this.N=this.m.cc("ima").g;this.l=this.m.cc("ima").a;this.K=new _.hu;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.an;this.H=!1;this.w=new _.ks;this.ea=new wQ;this.B=null;this.L=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Kb.bind(this));a.on(this.l,b,this.jb.bind(this));a.on(this.m,_.Ud,this.Yb.bind(this))}}Kb(a){this.a=a.getAdsManager(this.A,lQ(this));this.a.isCustomPlaybackUsed()&&!mQ(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.fu(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new xQ(a),this.m.trigger(new _.E(_.tc,
11
- {adsTimeline:this.j})),nQ(this));this.f.resolve()}jb(a){oQ(this,a.getError());this.f.resolve()}Zb(a){const b=this;return _.x(function*(){b.G=!0;if(mQ(b)){b.J=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.to(b.A,{visibility:_.Zd});pQ(b,_.bc,a);b.g.start()})}da(){const a=this;return _.x(function*(){a.a.start()})}W(a){a.getAd().isLinear()?pQ(this,_.ic,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}Y(a){this.B=a.getAd().getDuration();
12
- pQ(this,_.pc,a);this.m.getSurface().show(this.o)}Ja(a){a=a.getAdData();oQ(this,a?a.adError:null);qQ(this)}Sa(a){pQ(this,_.mc,a)}ja(a){pQ(this,_.dc,a)}S(a){pQ(this,_.gc,a)}Ka(a){pQ(this,_.jc,a)}aa(a){pQ(this,_.rc,a)}La(a){pQ(this,_.lc,a)}ib(a){pQ(this,_.nc,a)}R(a){this.pause();pQ(this,_.ec,a)}X(a){pQ(this,_.oc,a);qQ(this)}T(a){pQ(this,_.hc,a)}Ia(a){pQ(this,_.fc,a);qQ(this)}ac(){const a=this;return _.x(function*(){a.F=!0;if(mQ(a)&&null!==a.J){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.qp(a.m);a.C||
13
- (yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();rQ(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());pQ(a,_.cc)})}Wb(){this.L=!0}Yb(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Mf)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=
14
- c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Pb()?yield tQ(b):yield uQ(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.B)return-1;const a=this.a.getRemainingTime();
15
- return 0>a?0:this.B-a}dispose(){return(new Promise(a=>{this.H&&this.j&&this.j.pb()&&!this.L?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.nh(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{rQ(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
- yQ.prototype.getPosition=yQ.prototype.getPosition;yQ.prototype.setVolume=yQ.prototype.setVolume;yQ.prototype.getVolume=yQ.prototype.getVolume;yQ.prototype.skip=yQ.prototype.skip;yQ.prototype.pause=yQ.prototype.pause;yQ.prototype.resume=yQ.prototype.resume;var zQ=class extends _.ru{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(vQ())return a.onError(new _.H(1,9,1E4));this.f=_.ro(_.Fd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.ra);this.a.getSettings().setPlayerVersion(_.fa);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
- (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}xg(){return this.a}vg(){return this.g}xc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",zQ);zQ.prototype.getAdContainer=zQ.prototype.xc;zQ.prototype.getAdDisplayContainer=zQ.prototype.vg;zQ.prototype.getAdsLoader=zQ.prototype.xg;zQ.Id="ima";zQ.isSdkMissing=vQ;_.ap(new class{create(){return new zQ}});var AQ=class{constructor(){this.a=new _.R(kQ)}name(){return kQ}isSupported(a,b){return a.namespace()===_.jd?!1:vQ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new yQ(a)}};AQ.prototype.create=AQ.prototype.create;AQ.prototype.isSupported=AQ.prototype.isSupported;AQ.prototype.name=AQ.prototype.name;_.oo(new AQ);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var IQ="clpp.ima.AdsManagerFactory",JQ=function(a){a=a.L;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Rc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.Rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},KQ=function(a){return!1===a.L.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ak()},LQ=function(a){const b=a.a,c=a.C,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Pa.bind(a));c.on(b,d.LOADED,a.Z.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Dc.bind(a));c.on(b,d.STARTED,a.da.bind(a));c.on(b,d.LOG,a.Ya.bind(a));c.on(b,d.AD_PROGRESS,a.bc.bind(a));c.on(b,d.AD_BUFFERING,a.Qa.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.X.bind(a));c.on(b,d.MIDPOINT,a.wb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ia.bind(a));c.on(b,d.PAUSED,a.Kb.bind(a));c.on(b,d.RESUMED,a.cc.bind(a));c.on(b,d.CLICK,a.V.bind(a));c.on(b,d.SKIPPED,a.ba.bind(a));c.on(b,d.IMPRESSION,a.Y.bind(a));c.on(b,d.COMPLETE,a.Ra.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Fc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.hc.bind(a))},MQ=function(a,b){const c=b?a.Oa.create(b.getErrorCode()):null;a.m.onError(new _.G(1,9,10003,{errorType:c},b))},NQ=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.I,a.H)});a.m.trigger(new _.C(b,d))},OQ=function(a){a.G=null;NQ(a,_.tc);a.B&&a.m.getSurface().hide(a.B)},PQ=function(a){_.yo(a.F,{visibility:"visible"})},RQ=function(a){return _.w(function*(){a.S.initialize();const b=!!a.m.getConfiguration().muted;(yield a.O.canPlay(b))||KQ(a)?QQ(a):(NQ(a,_.Oc),a.g.warn(_.ka))})},SQ=function(a,b){return _.w(function*(){a.S.initialize();yield b.play();QQ(a)})},QQ=function(a){a.a.init(a.F.offsetWidth,a.F.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},TQ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}hb(){return"Google IMA SDK"}ib(){return google.ima.VERSION}ob(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getPosition(){return 0}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Nb(){return this.f?
6
+ this.f.getIsBumper():!1}xb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Fe&&typeof b[d].clickThroughUrl===_.Pf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}lb(){return this.a.getVastMediaWidth()}kb(){return this.a.getVastMediaHeight()}Za(){return this.a.getVastMediaBitrate()}Ua(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Bb(){return this.f?this.f.getTimeOffset():0}Cb(){return this.f?this.f.getAdPosition():
7
+ 1}nb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.nb;X.prototype.getPositionInSequence=X.prototype.Cb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Bb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Ua;X.prototype.getMediaBitrate=X.prototype.Za;X.prototype.getMediaHeight=X.prototype.kb;X.prototype.getMediaWidth=X.prototype.lb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.xb;X.prototype.isBumper=X.prototype.Nb;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getPosition=X.prototype.getPosition;
9
+ X.prototype.getDuration=X.prototype.getDuration;X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.ob;X.prototype.getAdManagerVersion=X.prototype.ib;X.prototype.getAdManagerName=X.prototype.hb;var UQ=class{create(a){const 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}}};var VQ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Eb(){return 0<=this.a.indexOf(0)||0===this.a.length}Db(){return 0<=this.a.indexOf(-1)}};VQ.prototype.hasPostroll=VQ.prototype.Db;VQ.prototype.hasPreroll=VQ.prototype.Eb;VQ.prototype.getCuePoints=VQ.prototype.getCuePoints;var WQ=class{constructor(a){this.m=a;this.F=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Rg(a.ima||{});this.L=a=_.Qg({disableCustomPlayback:!1},a);this.B=this.m.kc("ima").Bc();this.S=this.m.kc("ima").h;this.A=this.m.kc("ima").a;this.O=new _.tu;this.g=new _.R("clpp.ima");this.j=this.a=null;this.f=new _.gn;this.K=!1;this.C=new _.Bs;this.Oa=new UQ;this.G=null;this.R=this.J=this.H=this.I=!1;this.M=this.l=null;{a=this.C;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.A,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.fc.bind(this));a.on(this.A,b,this.ec.bind(this));a.on(this.m,_.Ud,this.jc.bind(this))}}fc(a){this.a=a.getAdsManager(this.F,JQ(this));this.a.isCustomPlaybackUsed()&&!KQ(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.G(1,9,10002)),this.h()):(this.j=new _.ru(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.l=new VQ(a),this.m.trigger(new _.C(_.wc,
11
+ {adsTimeline:this.l})),LQ(this));this.f.resolve()}ec(a){MQ(this,a.getError());this.f.resolve()}Dc(a){const b=this;return _.w(function*(){b.J=!0;if(KQ(b)){b.M=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.yo(b.F,{visibility:_.ae});NQ(b,_.cc,a);b.j.start()})}Pa(){const a=this;return _.w(function*(){a.a.start()})}Z(a){a.getAd().isLinear()?NQ(this,_.mc,a):(this.a.discardAdBreak(),this.I||(this.I=!0,this.m.play()))}da(a){this.G=a.getAd().getDuration();
12
+ NQ(this,_.sc,a);this.m.getSurface().show(this.B)}Ya(a){a=a.getAdData();MQ(this,a?a.adError:null);OQ(this)}bc(a){NQ(this,_.pc,a)}Qa(a){NQ(this,_.ec,a)}X(a){NQ(this,_.hc,a)}wb(a){NQ(this,_.nc,a)}ia(a){NQ(this,_.uc,a)}Kb(a){NQ(this,_.oc,a)}cc(a){NQ(this,_.qc,a)}V(a){this.pause();NQ(this,_.fc,a)}ba(a){NQ(this,_.rc,a);OQ(this)}Y(a){NQ(this,_.lc,a)}Ra(a){NQ(this,_.gc,a);OQ(this)}Fc(){const a=this;return _.w(function*(){a.I=!0;if(KQ(a)&&null!==a.M){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.Iq(a.m);a.H||
13
+ (yield a.m.seek(a.M))}else{if(!a.J)return a.m.play();PQ(a)}a.J=!1;a.j&&a.j.stop();a.H||(yield a.m.play());NQ(a,_.dc)})}hc(){this.R=!0}jc(){this.H=!0;this.A.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.m;const c=a.L;try{if(typeof c.adTagUrl!==_.Pf)throw new _.G(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.O.canPlay(!1);const d=yield a.O.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=
14
+ c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.A.getSettings().setAutoPlayAdBreaks(!1);a.A.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.l&&!b.K?b.l.Eb()?yield RQ(b):yield SQ(b,a):yield a.play()})}w(){}o(){return!0}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.G)return-1;const a=this.a.getRemainingTime();
15
+ return 0>a?0:this.G-a}h(){return(new Promise(a=>{this.K&&this.l&&this.l.Db()&&!this.R?(this.C.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.B&&this.m.getSurface().hide(this.B)}),_.sh(this.C,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.A.contentComplete()})).then(()=>{PQ(this);this.C.release();this.j&&(this.j.stop(),this.j=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
+ WQ.prototype.getPosition=WQ.prototype.getPosition;WQ.prototype.setVolume=WQ.prototype.setVolume;WQ.prototype.getVolume=WQ.prototype.getVolume;WQ.prototype.skip=WQ.prototype.skip;WQ.prototype.pause=WQ.prototype.pause;WQ.prototype.resume=WQ.prototype.resume;var XQ=class extends _.Bu{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(TQ())return a.onError(new _.G(1,9,1E4));this.f=_.wo(_.Fd,{"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(_.ra);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
+ (this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Cg(){return this.a}Ag(){return this.h}Bc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",XQ);XQ.prototype.getAdContainer=XQ.prototype.Bc;XQ.prototype.getAdDisplayContainer=XQ.prototype.Ag;XQ.prototype.getAdsLoader=XQ.prototype.Cg;XQ.Id="ima";XQ.isSdkMissing=TQ;_.rq(new class{create(){return new XQ}});_.uo(new class{constructor(){this.f=new _.R(IQ)}name(){return IQ}a(a,b){return a.namespace()===_.kd?!1:TQ()?(this.f.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new WQ(a)}});};f.call(g, window);