@castlabs/prestoplay 6.25.2 → 6.27.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 (69) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +5 -5
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +7 -7
  6. package/cjs/cl.cast.js +115 -114
  7. package/cjs/cl.conviva.js +32 -32
  8. package/cjs/cl.core.js +620 -620
  9. package/cjs/cl.crypto.js +9 -9
  10. package/cjs/cl.dash.js +89 -88
  11. package/cjs/cl.externs.js +89 -51
  12. package/cjs/cl.freewheel.js +25 -25
  13. package/cjs/cl.hls.js +79 -77
  14. package/cjs/cl.hlssmpte.js +6 -6
  15. package/cjs/cl.htmlcue.js +30 -30
  16. package/cjs/cl.ima.js +24 -24
  17. package/cjs/cl.mediatailor.js +3 -3
  18. package/cjs/cl.mse.js +351 -336
  19. package/cjs/cl.muxdata.js +15 -15
  20. package/cjs/cl.onboard.js +3 -3
  21. package/cjs/cl.persistent.js +15 -15
  22. package/cjs/cl.playlist.js +6 -6
  23. package/cjs/cl.sessions.js +16 -16
  24. package/cjs/cl.simid.js +17 -17
  25. package/cjs/cl.smooth.js +72 -72
  26. package/cjs/cl.thumbnails.js +26 -26
  27. package/cjs/cl.tizen.js +73 -72
  28. package/cjs/cl.ttml.js +29 -29
  29. package/cjs/cl.verimatrix.js +5 -5
  30. package/cjs/cl.vimond.js +12 -12
  31. package/cjs/cl.vr.js +19 -19
  32. package/cjs/cl.vtt.js +14 -14
  33. package/cjs/cl.yospace.js +4 -4
  34. package/cjs/cl.youbora.js +39 -37
  35. package/cjs/polyfill.min.js +15 -3
  36. package/cl.adobe.js +3 -3
  37. package/cl.airplay.js +3 -3
  38. package/cl.broadpeak.js +5 -5
  39. package/cl.cast.js +92 -90
  40. package/cl.conviva.js +27 -27
  41. package/cl.core.js +496 -500
  42. package/cl.crypto.js +9 -9
  43. package/cl.dash.js +82 -82
  44. package/cl.externs.js +89 -51
  45. package/cl.freewheel.js +19 -19
  46. package/cl.hls.js +80 -80
  47. package/cl.hlssmpte.js +5 -5
  48. package/cl.htmlcue.js +26 -26
  49. package/cl.ima.js +17 -17
  50. package/cl.mediatailor.js +3 -3
  51. package/cl.mse.js +305 -294
  52. package/cl.muxdata.js +13 -13
  53. package/cl.onboard.js +4 -4
  54. package/cl.persistent.js +11 -11
  55. package/cl.playlist.js +5 -5
  56. package/cl.sessions.js +10 -10
  57. package/cl.simid.js +14 -14
  58. package/cl.smooth.js +60 -60
  59. package/cl.thumbnails.js +19 -19
  60. package/cl.tizen.js +57 -57
  61. package/cl.ttml.js +22 -22
  62. package/cl.verimatrix.js +4 -4
  63. package/cl.vimond.js +8 -8
  64. package/cl.vr.js +15 -15
  65. package/cl.vtt.js +12 -12
  66. package/cl.yospace.js +3 -3
  67. package/cl.youbora.js +29 -28
  68. package/package.json +3 -3
  69. package/typings.d.ts +124 -3
package/cjs/cl.muxdata.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var uC=function(a){switch(a.type){case 1:return rC;case 2:return sC;case 3:return tC}},wC=function(a){var b=Object.keys(a).find(function(c){return vC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},xC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.gi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Qk.bind(this);this.C=this.Pk.bind(this)},zC=function(a){var b={debug:!0,
3
- data:yC(a)};a.f&&a.f.muxOptionsOverride&&_.L.xd(a.f.muxOptionsOverride)&&(b=_.L.ta(b,a.f.muxOptionsOverride));b=_.L.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.Mk(c.url);
4
- f.video_source_url=_.Nk(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().ma(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.qa())&&d.language&&(f.player_language_code=
5
- d.language);return f}});a.g.debug("Mux SDK options",b);return b},yC=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.xa,player_software_name:_.xa,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},AC=function(a){a.a.on(a.m,_.rg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.rg,b)});a.a.on(a.m,_.ff,function(){return a.emit(_.ff)});
6
- a.a.on(a.m,_.Yc,a.Mk.bind(a));a.a.on(a.m,_.bg,a.Ok.bind(a));a.a.on(a.m,_.Cg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.Bg,function(){return a.emit(_.Tf)});a.a.on(a.m,_.ie,a.Nk.bind(a));a.a.on(a.m,_.hc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.ic,function(){return a.emit("adbreakend")});a.a.on(a.m,_.xc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.tc,function(){return a.emit("adpause")});a.a.on(a.m,_.vc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
- _.zc,function(){return a.emit("adended")});a.a.on(a.m,_.mc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.sc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Ac,function(){return a.emit("adthirdquartile")});a.j.fd(a.G);a.j.Qe(a.C);a.a.on(a.m,_.ie,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.Mk(b.uris[b.uriIndex]);b={request_start:c,request_type:uC(b),
8
- request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.Mk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:uC(b),request_hostname:e.a,request_error:""+uC(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
9
- b)}})},BC=function(a){_.ki(a.a);a.j.ye(a.G);a.j.Bf(a.C)},CC=function(){this.f=this.m=null;this.a=!1;this.g=new _.J("clpp.muxdata")},DC=function(a){return!_.L.R(a)&&typeof a.init===_.oe&&typeof a.emit===_.oe},EC=function(a,b){a.trigger(new _.K(_.ie,{detail:b}))},FC=function(){},rC="manifest",sC="media",tC="encryption",vC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=xC.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,zC(this))}catch(d){throw this.h=!1,BC(this),new _.N(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=yC(this),this.emit("videochange",a),this.l=!1);AC(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.na):(BC(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Nd);this.A?this.g.debug(_.ma):(this.A=!0,this.emit("destroy"))};
10
- _.r.emit=function(a,b){if(null===this.w)throw new _.N(1,9,9301);this.w.emit(this.B,a,b)};_.r.Mk=function(a){this.g.debug(_.Se);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Sa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.Ok=function(a){this.g.debug(_.Xe);switch(a.detail.currentState){case _.Fq:this.m.getConfiguration().autoplay&&this.emit(_.ff);break;case _.Hq:this.emit(_.rf);break;case _.Gq:this.emit(_.bf);break;case _.Aq:this.emit(_.he)}};
11
- _.r.Nk=function(a){this.g.debug(_.Ue);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.O){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);this.emit(_.ie,{player_error_code:a.code,player_error_message:b})}};
12
- _.r.Qk=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.Mk(b.uris[b.uriIndex]);a={request_start:e,request_type:uC(b),request_hostname:g.a,request_id:wC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.Nk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.Pk=function(a){a.requestStartTimestamp=Date.now()};_.w(CC,_.bw);_.r=CC.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new xC(a,this.g)};
14
- _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.L.kb(c.muxdata);try{var d=[];typeof c===_.Re&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.N(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.L.R(e.muxdata)&&typeof e.muxdata===_.Re){var f=e.muxdata;d=DC(f.muxLib)?f.muxLib:window.mux;if(!DC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.N(1,9,9301);EC(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
- var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,EC(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&EC(this.m,c),c;}};_.I("clpp.muxdata.MuxDataPlugin",CC);CC.prototype.emit=CC.prototype.emit;CC.Id="mux";FC.prototype.create=function(){return new CC};
16
- _.Yt(new FC);};
2
+ var f=function(window){var mC=function(a){switch(a.type){case 1:return jC;case 2:return kC;case 3:return lC}},oC=function(a){var b=Object.keys(a).find(function(c){return nC.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},pC=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.gi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.Lk.bind(this);this.F=this.Kk.bind(this)},rC=function(a){var b={debug:!0,
3
+ data:qC(a)};a.f&&a.f.muxOptionsOverride&&_.N.qd(a.f.muxOptionsOverride)&&(b=_.N.ua(b,a.f.muxOptionsOverride));b=_.N.ua(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.rj(c.url);
4
+ f.video_source_url=_.sj(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().pa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.na())&&d.language&&(f.player_language_code=
5
+ d.language);return f}});a.g.debug("Mux SDK options",b);return b},qC=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.xa,player_software_name:_.xa,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},sC=function(a){a.a.on(a.m,_.sg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.sg,b)});a.a.on(a.m,_.ff,function(){return a.emit(_.ff)});
6
+ a.a.on(a.m,_.Xc,a.Hk.bind(a));a.a.on(a.m,_.bg,a.Jk.bind(a));a.a.on(a.m,_.Dg,function(){return a.emit(_.Uf)});a.a.on(a.m,_.Cg,function(){return a.emit(_.Tf)});a.a.on(a.m,_.he,a.Ik.bind(a));a.a.on(a.m,_.gc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.hc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.wc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.sc,function(){return a.emit("adpause")});a.a.on(a.m,_.uc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
+ _.yc,function(){return a.emit("adended")});a.a.on(a.m,_.lc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.rc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.zc,function(){return a.emit("adthirdquartile")});a.j.bd(a.G);a.j.Of(a.F);a.a.on(a.m,_.he,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.rj(b.uris[b.uriIndex]);b={request_start:c,request_type:mC(b),
8
+ request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.rj(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:mC(b),request_hostname:e.a,request_error:""+mC(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
9
+ b)}})},tC=function(a){_.ji(a.a);a.j.ue(a.G);a.j.Bg(a.F)},uC=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},vC=function(a){return!_.N.R(a)&&typeof a.init===_.le&&typeof a.emit===_.le},wC=function(a,b){a.trigger(new _.M(_.he,{detail:b}))},xC=function(){},jC="manifest",kC="media",lC="encryption",nC=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=pC.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,rC(this))}catch(d){throw this.h=!1,tC(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=qC(this),this.emit("videochange",a),this.l=!1);sC(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(tC(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Md);this.A?this.g.debug(_.la):(this.A=!0,this.emit("destroy"))};
10
+ _.r.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.r.Hk=function(a){this.g.debug(_.Se);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Sa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.Jk=function(a){this.g.debug(_.Xe);switch(a.detail.currentState){case _.Xq:this.m.getConfiguration().autoplay&&this.emit(_.ff);break;case _.Zq:this.emit(_.rf);break;case _.Yq:this.emit(_.bf);break;case _.Sq:this.emit(_.ge)}};
11
+ _.r.Ik=function(a){this.g.debug(_.Ue);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.Q){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);this.emit(_.he,{player_error_code:a.code,player_error_message:b})}};
12
+ _.r.Lk=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.rj(b.uris[b.uriIndex]);a={request_start:e,request_type:mC(b),request_hostname:g.a,request_id:oC(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.sj(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.Kk=function(a){a.requestStartTimestamp=Date.now()};_.w(uC,_.Hv);_.r=uC.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new pC(a,this.g)};
14
+ _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.N.hb(c.muxdata);try{var d=[];typeof c===_.Re&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.O(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.N.R(e.muxdata)&&typeof e.muxdata===_.Re){var f=e.muxdata;d=vC(f.muxLib)?f.muxLib:window.mux;if(!vC(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);wC(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
15
+ var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,wC(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&wC(this.m,c),c;}};_.J("clpp.muxdata.MuxDataPlugin",uC);uC.prototype.emit=uC.prototype.emit;uC.Id="mux";xC.prototype.create=function(){return new uC};
16
+ _.ru(new xC);};
17
17
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
18
18
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
19
19
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.onboard.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var pC=function(){this.g=new _.J("clpp.onboard");this.j=new Set},qC=function(a,b){function c(l){return l&&(_.Q.startsWith(l,"https://")||_.Q.startsWith(l,"http://")||_.Q.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.Q.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.an(a);h.fb(_.Gd,{licenseUrl:e,videoRobustness:[_.Fb,void 0],audioRobustness:[_.Eb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
- modifiers:{licenseRequest:_.Sn,licenseResponse:_.Xn}});h.fb(_.Cd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Un,licenseResponse:_.Vn,extractContentId:_.Qn,certificateRequest:_.Wn}});h.fb(_.Ed,{licenseUrl:f,modifiers:{licenseRequest:_.Sn}});_.Wm(h)};_.w(pC,_.Bu);pC.prototype.a=function(){for(var a=_.u(this.j),b=a.next();!b.done;b=a.next())delete _.Vm[b.value];this.j.clear()};
4
- pC.prototype.h=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),qC(b,a),this.j.add(b))};pC.prototype.id=function(){return"onboard"};_.I("clpp.onboard.OnboardComponent",pC);_.I("clpp.onboard.register",qC);};
2
+ var f=function(window){var hC=function(){this.g=new _.K("clpp.onboard");this.j=new Set},iC=function(a,b){function c(l){return l&&(_.R.startsWith(l,_.re)||_.R.startsWith(l,"http://")||_.R.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.tn(a);h.bb(_.Fd,{licenseUrl:e,videoRobustness:[_.Eb,void 0],audioRobustness:[_.Db,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
+ modifiers:{licenseRequest:_.ko,licenseResponse:_.po}});h.bb(_.Bd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.mo,licenseResponse:_.no,extractContentId:_.io,certificateRequest:_.oo}});h.bb(_.Dd,{licenseUrl:f,modifiers:{licenseRequest:_.ko}});_.on(h)};_.w(hC,_.Wu);hC.prototype.a=function(){for(var a=_.v(this.j),b=a.next();!b.done;b=a.next())delete _.nn[b.value];this.j.clear()};
4
+ hC.prototype.h=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),iC(b,a),this.j.add(b))};hC.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",hC);_.J("clpp.onboard.register",iC);};
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));}
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var YB="A persistent DRM session already exists for: ",ZB="No DRM configuration.",$B="clpp.persistent",aC="clpp.persistent.SimpleSessionStorage",bC=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},cC=function(a){a=a.h.keys();a=bC(a,function(b){return b.sessionId});return Array.from(a)},dC=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return _.x(f,_.Ip(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();
3
- d=[];(e=a.h.get(c))&&a.C&&(e.yc=new _.kk,d.push(e.yc));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},fC=function(a,b){a.L=eC;a.N=[];a.H=!0;return _.kp(a,b)},hC=function(a,b,c,d,e,f){a.L=gC;var g=new Map,h=_.Np(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Ze,persistentState:_.Mf,sessionTypes:[_.df],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
- videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.up(a,g)},iC=function(){this.g=new _.J(aC)},jC=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=a.audioCapabilities||[],d=a.videoCapabilities||[],e=a.serverCertificate||[],f=a.drmConfig||{};return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri||""),serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},kC=function(a,b){var c=
5
- _.Ym(a),d=_.vm({drm:a});d.drm=a;var e=new _.gp({Db:b,onError:function(){},xg:function(){},wg:function(){},onEvent:function(){},getConfiguration:function(){return d},ud:function(){return null}});e.f=c;return e},nC=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.H(function(q){switch(q.a){case 1:d=lC;e=mC;if(!a)return e.debug(ZB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(YB,f),q["return"]();h=kC(a,c);_.C(q,3,4);return _.x(q,fC(h,b),
6
- 6);case 6:return _.x(q,_.Bp(h),7);case 7:return _.x(q,_.Cp(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.ol(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=cC(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.vh(q),_.x(q,h.destroy(),10);case 10:_.wh(q);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
- f),new _.N(1,6,6200,null,p);}})},oC=function(){this.g=new _.J($B)},eC=1,gC=2;_.r=iC.prototype;
8
- _.r.store=function(a,b){var c;return _.H(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
- btoa(c));_.y(d)})};_.r.get=function(a){var b=this,c;return _.H(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](jC(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.H(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.r.clear=function(){return _.H(function(a){window.localStorage.clear();_.y(a)})};_.r.getName=function(){return aC};_.I("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.L.R(a)||(_.L.Ub(a.store)||c.push("store"),_.L.Ub(a.get)||c.push("get"),_.L.Ub(a["delete"])||c.push("delete"),_.L.Ub(a.clear)||c.push("clear"),_.L.Ub(a.getName)||c.push("getName"),b=c);if(0<b.length)throw mC.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});lC=a});
10
- _.I("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,v,z,A,D,G,B,F,M,R,ka;return _.H(function(U){switch(U.a){case 1:f=lC;g=mC;h=function(qa,Ba){return new _.N(1,6,6200,qa,Ba)};l=_.Lq(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ZB);m=b.offlineId;if(typeof m!==_.eg||!m.length)throw h("Missing offline id.");return _.x(U,f.get(m),2);case 2:if(n=U.f)return g.debug(YB,m),U["return"]();p=_.vm();q=new _.vk;
11
- t=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,D=new A,_.zm(D.id())||(D.f(),_.Bm(D),t.push(D));G=null;_.C(U,3,4);return _.x(U,_.av(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=U.f,G.configure(p.manifest),_.x(U,G.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=U.f;if(!B.periods.length)throw h(null,
12
- new _.N(_.O,4,4014));F=_.Su(B.periods);return _.x(U,nC(b,F,q),4);case 4:for(_.vh(U);t.length;)M=t.shift(),M.a(),_.ym["delete"](M.id());R=[];G&&R.push(G.stop());R.push(q.destroy());return _.x(U,Promise.all(R),9);case 9:_.wh(U);break;case 3:ka=_.E(U);if(ka instanceof _.N&&6200===ka.code)throw ka;throw h(null,ka);}})});
13
- _.I("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.H(function(l){switch(l.a){case 1:b=lC;c=mC;if(!_.L.ia(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.C(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.vk;d=kC(f.drmConfig,e);return _.x(l,hC(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.Bp(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.H(function(n){if(1==n.a)return _.x(n,dC(d,m),2);c.debug("successfully removed session with id",m);_.y(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.vh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.wh(l);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});
15
- _.I("clpp.persistent.getSessionStorage",function(){return lC});var lC=new iC,mC=new _.J($B);_.w(oC,_.Bu);oC.prototype.id=function(){return _.cf};oC.prototype.l=function(a,b){var c=this,d,e,f;return _.H(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.C(g,2);return _.x(g,nC(d,b,e),4)}if(2!=g.a)return a.trigger(new _.K(_.ae,{offlineId:d.offlineId})),_.uh(g,0);f=_.E(g);a.onError(f);_.y(g)})};
16
- oC.prototype.j=function(a){var b=this,c,d;return _.H(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=lC,_.C(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.E(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.I("clpp.persistent.PersistentLicenseComponent",oC);};
2
+ var f=function(window){var QB="A persistent DRM session already exists for: ",RB="No DRM configuration.",SB="clpp.persistent",TB="clpp.persistent.SimpleSessionStorage",UB=function(a,b){for(var c=[],d=_.v(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},VB=function(a){a=a.h.keys();a=UB(a,function(b){return b.sessionId});return Array.from(a)},WB=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.$p(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();
3
+ d=[];(e=a.h.get(c))&&a.F&&(e.uc=new _.gk,d.push(e.uc));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},YB=function(a,b){a.L=XB;a.N=[];a.H=!0;return _.Cp(a,b)},$B=function(a,b,c,d,e,f){a.L=ZB;var g=new Map,h=_.eq(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Ze,persistentState:_.Mf,sessionTypes:[_.df],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
+ videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Mp(a,g)},aC=function(){this.g=new _.K(TB)},bC=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=a.audioCapabilities||[],d=a.videoCapabilities||[],e=a.serverCertificate||[],f=a.drmConfig||{};return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri||""),serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},cC=function(a,b){var c=
5
+ _.qn(a),d=_.Vm({drm:a});d.drm=a;var e=new _.yp({Bb:b,onError:function(){},qg:function(){},pg:function(){},onEvent:function(){},getConfiguration:function(){return d},nd:function(){return null}});e.f=c;return e},fC=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=dC;e=eC;if(!a)return e.debug(RB),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(QB,f),q["return"]();h=cC(a,c);_.F(q,3,4);return _.x(q,YB(h,b),
6
+ 6);case 6:return _.x(q,_.Tp(h),7);case 7:return _.x(q,_.Up(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.lm(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=VB(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.vh(q),_.x(q,h.destroy(),10);case 10:_.wh(q);break;case 3:throw p=_.H(q),e.error("Error while persisting DRM session "+
7
+ f),new _.O(1,6,6200,null,p);}})},gC=function(){this.g=new _.K(SB)},XB=1,ZB=2;_.r=aC.prototype;
8
+ _.r.store=function(a,b){var c;return _.I(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
9
+ btoa(c));_.z(d)})};_.r.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](bC(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.r.clear=function(){return _.I(function(a){window.localStorage.clear();_.z(a)})};_.r.getName=function(){return TB};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.N.R(a)||(_.N.Qb(a.store)||c.push("store"),_.N.Qb(a.get)||c.push("get"),_.N.Qb(a["delete"])||c.push("delete"),_.N.Qb(a.clear)||c.push("clear"),_.N.Qb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw eC.warn("Invalid session storage implementation"),new _.O(1,6,6202,{missingMethods:b});dC=a});
10
+ _.J("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,u,y,A,B,C,E,D,L,P,U;return _.I(function(V){switch(V.a){case 1:f=dC;g=eC;h=function(ra,Da){return new _.O(1,6,6200,ra,Da)};l=_.cr(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(RB);m=b.offlineId;if(typeof m!==_.eg||!m.length)throw h("Missing offline id.");return _.x(V,f.get(m),2);case 2:if(n=V.f)return g.debug(QB,m),V["return"]();p=_.Vm();q=new _.Cl;t=
11
+ [];u=_.v(d);for(y=u.next();!y.done;y=u.next())A=y.value,B=new A,_.Zm(B.id())||(B.f(),_.an(B),t.push(B));C=null;_.F(V,3,4);return _.x(V,_.ov(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return C=V.f,C.configure(p.manifest),_.x(V,C.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=V.f;if(!E.periods.length)throw h(null,
12
+ new _.O(_.Q,4,4014));D=_.hv(E.periods);return _.x(V,fC(b,D,q),4);case 4:for(_.vh(V);t.length;)L=t.shift(),L.a(),_.Ym["delete"](L.id());P=[];C&&P.push(C.stop());P.push(q.destroy());return _.x(V,Promise.all(P),9);case 9:_.wh(V);break;case 3:U=_.H(V);if(U instanceof _.O&&6200===U.code)throw U;throw h(null,U);}})});
13
+ _.J("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:b=dC;c=eC;if(!_.N.ia(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.F(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.Cl;d=cC(f.drmConfig,e);return _.x(l,$B(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.x(l,_.Tp(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,WB(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.vh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.wh(l);break;case 2:throw h=_.H(l),c.error("Failed to remove session"),new _.O(1,6,6201,null,h);}})});
15
+ _.J("clpp.persistent.getSessionStorage",function(){return dC});var dC=new aC,eC=new _.K(SB);_.w(gC,_.Wu);gC.prototype.id=function(){return _.cf};gC.prototype.l=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.F(g,2);return _.x(g,fC(d,b,e),4)}if(2!=g.a)return a.trigger(new _.M(_.$d,{offlineId:d.offlineId})),_.G(g,0);f=_.H(g);a.onError(f);_.z(g)})};
16
+ gC.prototype.j=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=dC,_.F(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.H(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.J("clpp.persistent.PersistentLicenseComponent",gC);};
17
17
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
18
18
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
19
19
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var VB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.mm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Fa.bind(this)},WB=function(a){a.trigger(new _.K(_.tf))},XB=function(a,b){return 0<=b&&b<a.a.length};_.w(VB,_.mm);_.r=VB.prototype;_.r.on=function(a,b,c){return _.mm.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.mm.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.mm.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
- _.r.am=function(){return this.a};_.r.ge=function(){return 0<this.a.length&&XB(this,this.f)?this.a[this.f]:null};_.r.cm=function(){var a=this.f+1;return 0<this.a.length&&XB(this,a)?this.a[a]:null};_.r.vm=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.he,this.j),this.cf(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.he,this.j)};_.r.Fa=function(){this.next()};
4
- _.r.next=function(){var a=this,b;return _.H(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.cf(b),0)})};_.r.Zn=function(){var a=this,b;return _.H(function(c){b=Math.max(0,a.f-1);return _.x(c,a.cf(b),0)})};_.r.cf=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.H(function(e){if(1==e.a){if(!(0<c.a.length&&XB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ge())?_.x(e,c.l(d),3):e.D(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.K(_.sf,{item:d}));_.y(e)})};
5
- _.r.append=function(a){this.a.push(a);WB(this)};_.r.pm=function(a,b){if(0<=b&&b<=this.a.length){var c=this.ge();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));WB(this)}};_.r.remove=function(a){if(0<this.a.length&&XB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);WB(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;WB(this)};_.I("clpp.Playlist",VB);VB.prototype.clear=VB.prototype.clear;VB.prototype.remove=VB.prototype.remove;
6
- VB.prototype.insert=VB.prototype.pm;VB.prototype.append=VB.prototype.append;VB.prototype.goTo=VB.prototype.cf;VB.prototype.previous=VB.prototype.Zn;VB.prototype.next=VB.prototype.next;VB.prototype.onEnded=VB.prototype.Fa;VB.prototype.stop=VB.prototype.stop;VB.prototype.start=VB.prototype.start;VB.prototype.isStarted=VB.prototype.vm;VB.prototype.getUpcoming=VB.prototype.cm;VB.prototype.getCurrent=VB.prototype.ge;VB.prototype.getQueue=VB.prototype.am;VB.prototype.getPosition=VB.prototype.getPosition;
7
- VB.prototype.off=VB.prototype.off;VB.prototype.one=VB.prototype.one;VB.prototype.on=VB.prototype.on;};
2
+ var f=function(window){var NB=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Mm.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Da.bind(this)},OB=function(a){a.trigger(new _.M(_.tf))},PB=function(a,b){return 0<=b&&b<a.a.length};_.w(NB,_.Mm);_.r=NB.prototype;_.r.on=function(a,b,c){return _.Mm.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Mm.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Mm.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
+ _.r.Vl=function(){return this.a};_.r.ae=function(){return 0<this.a.length&&PB(this,this.f)?this.a[this.f]:null};_.r.Xl=function(){var a=this.f+1;return 0<this.a.length&&PB(this,a)?this.a[a]:null};_.r.nm=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.ge,this.j),this.af(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.ge,this.j)};_.r.Da=function(){this.next()};
4
+ _.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.af(b),0)})};_.r.Rn=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.x(c,a.af(b),0)})};_.r.af=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&PB(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ae())?_.x(e,c.l(d),3):e.C(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.M(_.sf,{item:d}));_.z(e)})};
5
+ _.r.append=function(a){this.a.push(a);OB(this)};_.r.hm=function(a,b){if(0<=b&&b<=this.a.length){var c=this.ae();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));OB(this)}};_.r.remove=function(a){if(0<this.a.length&&PB(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);OB(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;OB(this)};_.J("clpp.Playlist",NB);NB.prototype.clear=NB.prototype.clear;NB.prototype.remove=NB.prototype.remove;
6
+ NB.prototype.insert=NB.prototype.hm;NB.prototype.append=NB.prototype.append;NB.prototype.goTo=NB.prototype.af;NB.prototype.previous=NB.prototype.Rn;NB.prototype.next=NB.prototype.next;NB.prototype.onEnded=NB.prototype.Da;NB.prototype.stop=NB.prototype.stop;NB.prototype.start=NB.prototype.start;NB.prototype.isStarted=NB.prototype.nm;NB.prototype.getUpcoming=NB.prototype.Xl;NB.prototype.getCurrent=NB.prototype.ae;NB.prototype.getQueue=NB.prototype.Vl;NB.prototype.getPosition=NB.prototype.getPosition;
7
+ NB.prototype.off=NB.prototype.off;NB.prototype.one=NB.prototype.one;NB.prototype.on=NB.prototype.on;};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,20 +1,20 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var OA="apiUrl config is missing",PA="prestoplay-web",QA=function(a,b){a.j=a.j.filter(function(c){return c!==b})},RA=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));return[c,a]},SA=function(){this.a=[]},VA=function(a,b,c){TA(a,b,c,function(d,e){UA(d,e)})},UA=function(a,b){if(0<=b)WA(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},YA=function(a,b,c){TA(a,b,c,function(d,
3
- e){if(0<=e){var f=_.u(RA(e)),g=f.next().value;f=f.next().value;XA(d,g,f)}else f=_.u(RA(e)),g=f.next().value,f=f.next().value,XA(d,g,f)})},$A=function(a,b,c){ZA(a,b,c,function(d,e){for(var f=0;f<e.length;f++){var g=e.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<e.length){var h=e.charCodeAt(f+1);56320<=h&&57343>=h&&(g=1024*(g-55296)+h-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|128),d.a.push(g&
4
- 63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},bB=function(a,b,c){ZA(a,b,c,function(d,e){aB(d,e.a())})},cB=function(a,b,c){ZA(a,b,c,function(d,e){aB(d,e)})},aB=function(a,b){a.a.push.apply(a.a,b)},TA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.eg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){WA(a,b<<3|2);b=new SA;for(var e=0;e<c.length;e++)d(b,c[e]);UA(a,b.length());aB(a,b.end())}else WA(a,b<<3|0),d(a,c)},
5
- ZA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.eg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){WA(a,b<<3|2);var f=new SA;d(f,c[e]);UA(a,f.length());aB(a,f.end())}else WA(a,b<<3|2),b=new SA,d(b,c),UA(a,b.length()),aB(a,b.end())},WA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},XA=function(a,b,c){for(;0<c||127<b;)a.a.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.a.push(b)},dB=function(a,b,c,d){this.downloadId=
6
- a;this.h=b;this.duration=c;this.j=d;this.f=[]},eB=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},fB=function(a,b){this.h=a;this.f=b},gB=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},hB=function(a,b){this.key=a;this.value=b},iB=function(){this.cause=this.severity=this.code=null},jB=function(){this.data=null},kB=function(){this.data=null;var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&
7
- 63|128;this.data=a},lB=function(){this.headers=[]},mB=function(){},nB=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},oB=function(){this.f=null;this.events=[]},pB=function(){this.f=this.h=null},qB=function(){this.f=this.h=null},rB=function(a){var b=new qB;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},uB=function(a,b,c,d,e){var f=new Uint8Array([]),g=this;var h=void 0===h?2500:h;this.o=f;this.l=e;this.w=new kB;this.A=new kB;this.a=[];this.h=setInterval(function(){return sB(g)},h);
8
- this.f=null;this.j=!1;tB(this,a,b,c,d)},vB=function(a){return _.H(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.D(2);break}return _.x(b,a.f,2);case 2:if(!(0<a.a.length)){b.D(4);break}return _.x(b,sB(a),5);case 5:a.a=[];case 4:a.j=!0,_.y(b)}})},tB=function(a,b,c,d,e){var f=new lB;f.headers=[new hB("CL-BROWSER-NAME",b),new hB("CL-BROWSER-VERSION",c),new hB("CL-OS-FAMILY",d),new hB("CL-OS-VERSION",e),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-NAME",PA),new hB("CL-SDK-VERSION",
9
- _.ia)];wB(a,f)},sB=function(a){var b,c,d,e;return _.H(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&wB(a,new mB);b=function(){};a.f=new Promise(function(g){b=g});_.th(f);c=new oB;c.f=a.o;c.events.push.apply(c.events,_.gh(a.a));d=_.gh(a.a).concat();return _.x(f,fetch(a.l,{method:_.sb,headers:{"Content-Type":"application/proto"},body:new Uint8Array(c.a())}),4)}if(2!=f.a)if(e=f.f,e.ok)a.a=a.a.filter(function(g){return!d.includes(g)});else throw Error("An error occurred while sending telemetry events to the API, status\x3d'"+
10
- (e.status+"' statusText\x3d'"+e.statusText+"'"));_.vh(f);b();a.f=null;return _.wh(f)})},wB=function(a,b){if(!a.j){var c=new nB(a.w);c.sessionId=a.A;var d=Date.now(),e=new pB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},xB=function(){this.reason=this.currentState=this.previousState=null},yB=function(){this.m=null;this.f=this.l=!1;this.a=new _.gi;this.h=null;this.g=new _.J("clpp.sessions.SessionsPlugin");this.o=this.hn.bind(this);this.j=this.gn.bind(this)},
11
- GB=function(a){switch(a){case _.tq:return zB;case _.Fq:return AB;case _.yq:return BB;case _.Hq:return CB;case _.Gq:return DB;case _.Aq:return EB;case _.Eq:return FB;default:return null}},OB=function(a,b){switch(a){case 1:return HB;case 2:return b===_.Jg?IB:b===_.Pc?JB:b===_.pj?KB:b===_.se?LB:MB;case 3:return NB;default:return MB}},PB=function(a){var b;_.H(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.ki(a.a),a.f=!1,b=a.m.getNetworkEngine(),b.Bf(a.o),b.ye(a.j),
12
- QA(b,a.j),a.h?_.x(c,vB(a.h),3):c.D(0);a.h=null;_.y(c)})},QB=function(a,b){a.g.debug("Sending event",b);wB(a.h,b)},RB=function(){};SA.prototype.length=function(){return this.a.length};SA.prototype.end=function(){var a=this.a;this.a=[];return a};dB.prototype.a=function(){var a=new SA;bB(a,1,this.downloadId);VA(a,2,this.h);bB(a,3,this.duration);VA(a,4,this.j);bB(a,5,this.f);return a.end()};dB.prototype.getId=function(){return 4};eB.prototype.a=function(){var a=new SA;VA(a,1,this.f);bB(a,2,this.downloadId);$A(a,3,this.url);bB(a,4,this.headers);$A(a,5,null);bB(a,6,null);bB(a,7,this.duration);YA(a,8,this.size);return a.end()};eB.prototype.getId=function(){return 2};fB.prototype.a=function(){var a=new SA;VA(a,1,this.h);cB(a,2,this.f);return a.end()};gB.prototype.a=function(){var a=new SA;VA(a,1,this.errorCode);VA(a,2,this.severity);$A(a,3,this.message);$A(a,4,this.f);bB(a,5,this.cause);return a.end()};gB.prototype.getId=function(){return 7};hB.prototype.a=function(){var a=new SA;$A(a,1,this.key);$A(a,2,this.value);return a.end()};iB.prototype.a=function(){var a=new SA;VA(a,1,this.code);VA(a,2,this.severity);bB(a,3,this.cause);return a.end()};iB.prototype.getId=function(){return 12};jB.prototype.a=function(){var a=new SA;cB(a,1,this.data);return a.end()};_.w(kB,jB);kB.prototype.toString=function(){for(var a=[],b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]};lB.prototype.a=function(){var a=new SA;bB(a,1,this.headers);return a.end()};lB.prototype.getId=function(){return 1};mB.prototype.a=function(){return(new SA).end()};mB.prototype.getId=function(){return 6};nB.prototype.a=function(){var a=new SA;bB(a,1,this.j);bB(a,2,this.sessionId);bB(a,3,this.time);YA(a,4,null);$A(a,5,null);VA(a,6,this.h);cB(a,7,this.f);return a.end()};oB.prototype.a=function(){var a=new SA;cB(a,1,this.f);bB(a,2,this.events);return a.end()};pB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};qB.prototype.a=function(){var a=new SA;YA(a,1,this.h);VA(a,2,this.f);return a.end()};xB.prototype.a=function(){var a=new SA;VA(a,1,this.previousState);VA(a,2,this.currentState);VA(a,3,this.reason);bB(a,4,null);bB(a,5,null);bB(a,6,null);return a.end()};xB.prototype.getId=function(){return 5};_.w(yB,_.bw);_.r=yB.prototype;_.r.onPlayerCreated=function(a){this.m=a};
13
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Re))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.sk(),this.h=new uB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.a.on(this.m,_.bg,this.Vk.bind(this)),this.a.on(this.m,_.Uf,this.Uk.bind(this)),this.a.on(this.m,_.Tf,
14
- this.Tk.bind(this)),this.a.on(this.m,_.ie,this.Sk.bind(this)),a=this.m.getNetworkEngine(),a.Qe(this.o),a.fd(this.j),a.j.push(this.j)):(this.g.warn(OA),a.onError(new _.N(1,9,15E3,OA)))};_.r.onPlayerWillRelease=function(){PB(this)};_.r.id=function(){return"sessions"};_.r.Vk=function(a){if(!this.f){a=a.detail;var b=a.currentState,c=new xB;c.previousState=GB(a.previousState);c.currentState=GB(b);QB(this,c)}};
15
- _.r.Uk=function(){if(!this.f){var a=new xB;a.previousState=GB(this.m.getState());a.currentState=SB;QB(this,a);this.f=!0}};_.r.Tk=function(){if(this.f){var a=new xB;a.previousState=SB;a.currentState=GB(this.m.getState());QB(this,a);this.f=!1}};_.r.Sk=function(a){a=a.detail;var b=new iB;b=new gB(new fB(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.O?TB:UB;QB(this,b)};
16
- _.r.hn=function(a){var b=new kB;a.downloadId=b;var c=new eB(OB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new hB(d,a.headers[d])});QB(this,c)};_.r.gn=function(a){var b=a.request.downloadId;b?(b=new dB(b,a.data.byteLength,rB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new hB(c,a.headers[c])}),QB(this,b)):this.g.warn("Download ID is missing on download completed event.")};RB.prototype.create=function(){return new yB};
17
- _.Yt(new RB);var UB=1,TB=2;var zB=0,AB=2,FB=3,SB=5,BB=6,CB=8,DB=10,EB=11;var HB=0,IB=1,JB=2,KB=3,LB=4,NB=5,MB=9;};
2
+ var f=function(window){var GA="apiUrl config is missing",HA="prestoplay-web",IA=function(a,b){a.l=a.l.filter(function(c){return c!==b})},JA=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));return[c,a]},KA=function(){this.a=[]},NA=function(a,b,c){LA(a,b,c,function(d,e){MA(d,e)})},MA=function(a,b){if(0<=b)OA(a,b);else{for(var c=b,d=0;9>d;d++)a.a.push(c&127|128),c>>=7;a.a.push(1)}},QA=function(a,b,c){LA(a,b,c,function(d,
3
+ e){if(0<=e){var f=_.v(JA(e)),g=f.next().value;f=f.next().value;PA(d,g,f)}else f=_.v(JA(e)),g=f.next().value,f=f.next().value,PA(d,g,f)})},SA=function(a,b,c){RA(a,b,c,function(d,e){for(var f=0;f<e.length;f++){var g=e.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<e.length){var h=e.charCodeAt(f+1);56320<=h&&57343>=h&&(g=1024*(g-55296)+h-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|128),d.a.push(g&
4
+ 63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},UA=function(a,b,c){RA(a,b,c,function(d,e){TA(d,e.a())})},VA=function(a,b,c){RA(a,b,c,function(d,e){TA(d,e)})},TA=function(a,b){a.a.push.apply(a.a,b)},LA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.eg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){OA(a,b<<3|2);b=new KA;for(var e=0;e<c.length;e++)d(b,c[e]);MA(a,b.length());TA(a,b.end())}else OA(a,b<<3|0),d(a,c)},
5
+ RA=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.k&&0===c||typeof c===_.eg&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(var e=0;e<c.length;e++){OA(a,b<<3|2);var f=new KA;d(f,c[e]);MA(a,f.length());TA(a,f.end())}else OA(a,b<<3|2),b=new KA,d(b,c),MA(a,b.length()),TA(a,b.end())},OA=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},PA=function(a,b,c){for(;0<c||127<b;)a.a.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.a.push(b)},WA=function(a,b,c,d){this.downloadId=
6
+ a;this.h=b;this.duration=c;this.j=d;this.f=[]},XA=function(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null},YA=function(a,b){this.h=a;this.f=b},ZA=function(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null},$A=function(a,b){this.key=a;this.value=b},aB=function(){this.cause=this.severity=this.code=null},bB=function(){this.data=null},cB=function(){this.data=null;var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&
7
+ 63|128;this.data=a},dB=function(){this.headers=[]},eB=function(){},fB=function(a){this.j=a;this.f=this.h=this.time=this.sessionId=null},gB=function(){this.f=null;this.events=[]},hB=function(){this.f=this.h=null},iB=function(){this.f=this.h=null},jB=function(a){var b=new iB;b.h=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},mB=function(a,b,c,d,e){var f=new Uint8Array([]),g=this;var h=void 0===h?2500:h;this.o=f;this.l=e;this.w=new cB;this.A=new cB;this.a=[];this.h=setInterval(function(){return kB(g)},h);
8
+ this.f=null;this.j=!1;lB(this,a,b,c,d)},nB=function(a){return _.I(function(b){switch(b.a){case 1:a.h&&(clearInterval(a.h),a.h=null);if(!a.f){b.C(2);break}return _.x(b,a.f,2);case 2:if(!(0<a.a.length)){b.C(4);break}return _.x(b,kB(a),5);case 5:a.a=[];case 4:a.j=!0,_.z(b)}})},lB=function(a,b,c,d,e){var f=new dB;f.headers=[new $A("CL-BROWSER-NAME",b),new $A("CL-BROWSER-VERSION",c),new $A("CL-OS-FAMILY",d),new $A("CL-OS-VERSION",e),new $A("CL-SDK-NAME",HA),new $A("CL-SDK-NAME",HA),new $A("CL-SDK-VERSION",
9
+ _.ia)];oB(a,f)},kB=function(a){var b,c,d,e;return _.I(function(f){if(1==f.a){if(a.j||a.f)return f["return"]();0===a.a.length&&oB(a,new eB);b=function(){};a.f=new Promise(function(g){b=g});_.uh(f);c=new gB;c.f=a.o;c.events.push.apply(c.events,_.hh(a.a));d=_.hh(a.a).concat();return _.x(f,fetch(a.l,{method:_.rb,headers:{"Content-Type":"application/proto"},body:new Uint8Array(c.a())}),4)}if(2!=f.a)if(e=f.f,e.ok)a.a=a.a.filter(function(g){return!d.includes(g)});else throw Error("An error occurred while sending telemetry events to the API, status\x3d'"+
10
+ (e.status+"' statusText\x3d'"+e.statusText+"'"));_.vh(f);b();a.f=null;return _.wh(f)})},oB=function(a,b){if(!a.j){var c=new fB(a.w);c.sessionId=a.A;var d=Date.now(),e=new hB;e.h=Math.floor(d/1E3);e.f=d%1E3*1E6;c.time=e;c.h=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},pB=function(){this.reason=this.currentState=this.previousState=null},qB=function(){this.m=null;this.f=this.l=!1;this.a=new _.gi;this.h=null;this.g=new _.K("clpp.sessions.SessionsPlugin");this.o=this.an.bind(this);this.j=this.$m.bind(this)},
11
+ yB=function(a){switch(a){case _.Lq:return rB;case _.Xq:return sB;case _.Qq:return tB;case _.Zq:return uB;case _.Yq:return vB;case _.Sq:return wB;case _.Wq:return xB;default:return null}},GB=function(a,b){switch(a){case 1:return zB;case 2:return b===_.Jg?AB:b===_.Oc?BB:b===_.yj?CB:b===_.se?DB:EB;case 3:return FB;default:return EB}},HB=function(a){var b;_.I(function(c){if(1==c.a)return a.g.info("Destroy the session and stop sending events."),_.ji(a.a),a.f=!1,b=a.m.getNetworkEngine(),b.Bg(a.o),b.ue(a.j),
12
+ IA(b,a.j),a.h?_.x(c,nB(a.h),3):c.C(0);a.h=null;_.z(c)})},IB=function(a,b){a.g.debug("Sending event",b);oB(a.h,b)},JB=function(){};KA.prototype.length=function(){return this.a.length};KA.prototype.end=function(){var a=this.a;this.a=[];return a};WA.prototype.a=function(){var a=new KA;UA(a,1,this.downloadId);NA(a,2,this.h);UA(a,3,this.duration);NA(a,4,this.j);UA(a,5,this.f);return a.end()};WA.prototype.getId=function(){return 4};XA.prototype.a=function(){var a=new KA;NA(a,1,this.f);UA(a,2,this.downloadId);SA(a,3,this.url);UA(a,4,this.headers);SA(a,5,null);UA(a,6,null);UA(a,7,this.duration);QA(a,8,this.size);return a.end()};XA.prototype.getId=function(){return 2};YA.prototype.a=function(){var a=new KA;NA(a,1,this.h);VA(a,2,this.f);return a.end()};ZA.prototype.a=function(){var a=new KA;NA(a,1,this.errorCode);NA(a,2,this.severity);SA(a,3,this.message);SA(a,4,this.f);UA(a,5,this.cause);return a.end()};ZA.prototype.getId=function(){return 7};$A.prototype.a=function(){var a=new KA;SA(a,1,this.key);SA(a,2,this.value);return a.end()};aB.prototype.a=function(){var a=new KA;NA(a,1,this.code);NA(a,2,this.severity);UA(a,3,this.cause);return a.end()};aB.prototype.getId=function(){return 12};bB.prototype.a=function(){var a=new KA;VA(a,1,this.data);return a.end()};_.w(cB,bB);cB.prototype.toString=function(){for(var a=[],b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]};dB.prototype.a=function(){var a=new KA;UA(a,1,this.headers);return a.end()};dB.prototype.getId=function(){return 1};eB.prototype.a=function(){return(new KA).end()};eB.prototype.getId=function(){return 6};fB.prototype.a=function(){var a=new KA;UA(a,1,this.j);UA(a,2,this.sessionId);UA(a,3,this.time);QA(a,4,null);SA(a,5,null);NA(a,6,this.h);VA(a,7,this.f);return a.end()};gB.prototype.a=function(){var a=new KA;VA(a,1,this.f);UA(a,2,this.events);return a.end()};hB.prototype.a=function(){var a=new KA;QA(a,1,this.h);NA(a,2,this.f);return a.end()};iB.prototype.a=function(){var a=new KA;QA(a,1,this.h);NA(a,2,this.f);return a.end()};pB.prototype.a=function(){var a=new KA;NA(a,1,this.previousState);NA(a,2,this.currentState);NA(a,3,this.reason);UA(a,4,null);UA(a,5,null);UA(a,6,null);return a.end()};pB.prototype.getId=function(){return 5};_.w(qB,_.Hv);_.r=qB.prototype;_.r.onPlayerCreated=function(a){this.m=a};
13
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Re))||this.g.debug("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.g.debug(_.ya),this.g.info("Create a session and start sending events."),a=_.gl(),this.h=new mB(a.browser,a.browserVersion.name,a.os,a.osVersion.name,b.apiUrl),this.a.on(this.m,_.bg,this.Qk.bind(this)),this.a.on(this.m,_.Uf,this.Pk.bind(this)),this.a.on(this.m,_.Tf,
14
+ this.Ok.bind(this)),this.a.on(this.m,_.he,this.Nk.bind(this)),a=this.m.getNetworkEngine(),a.Of(this.o),a.bd(this.j),a.l.push(this.j)):(this.g.warn(GA),a.onError(new _.O(1,9,15E3,GA)))};_.r.onPlayerWillRelease=function(){HB(this)};_.r.id=function(){return"sessions"};_.r.Qk=function(a){if(!this.f){a=a.detail;var b=a.currentState,c=new pB;c.previousState=yB(a.previousState);c.currentState=yB(b);IB(this,c)}};
15
+ _.r.Pk=function(){if(!this.f){var a=new pB;a.previousState=yB(this.m.getState());a.currentState=KB;IB(this,a);this.f=!0}};_.r.Ok=function(){if(this.f){var a=new pB;a.previousState=KB;a.currentState=yB(this.m.getState());IB(this,a);this.f=!1}};_.r.Nk=function(a){a=a.detail;var b=new aB;b=new ZA(new YA(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.Q?LB:MB;IB(this,b)};
16
+ _.r.an=function(a){var b=new cB;a.downloadId=b;var c=new XA(GB(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(function(d){return new $A(d,a.headers[d])});IB(this,c)};_.r.$m=function(a){var b=a.request.downloadId;b?(b=new WA(b,a.data.byteLength,jB(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(function(c){return new $A(c,a.headers[c])}),IB(this,b)):this.g.warn("Download ID is missing on download completed event.")};JB.prototype.create=function(){return new qB};
17
+ _.ru(new JB);var MB=1,LB=2;var rB=0,sB=2,xB=3,KB=5,tB=6,uB=8,vB=10,wB=11;var zB=0,AB=1,BB=2,CB=3,DB=4,FB=5,EB=9;};
18
18
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
19
19
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
20
20
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.simid.js CHANGED
@@ -1,21 +1,21 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var wA="No surface found. Can not attach frame!",xA="SIMID:Media:timeupdate",yA="Starting creative",DA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d.className?this.a.classList.add(d.className):(this.a.style.border=_.Qe,this.a.style.backgroundColor="transparent",this.a.style.transition="opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Qe,this.a.style.overflow=
3
- _.qe);this.a.classList.add(_.md);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.eg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":zA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
4
- f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var h=AA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=h.left;f.m.getSurface().getMedia().style.top=h.top;f.m.getSurface().getMedia().style.width=h.width;f.m.getSurface().getMedia().style.height=h.height}g.creativeDimensions&&(g=AA(f,g.creativeDimensions),f.a.a.style.left=
5
- g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);BA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.J("clpp.simid.SimidPlayer");CA(this.f,this)},GA=function(a){var b=EA(a,"SIMID:Player:startCreative",void 0);FA(a,b).then(function(){var c=a.f;c.g.info(yA);c.m.trigger(new _.K(_.Wf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},zA=function(a,b){var c;_.H(function(d){if(1==
6
- d.a){a.h=b.sessionId;BA(a,b);_.C(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
7
- closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=EA(a,"SIMID:Player:init",e);e=FA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.uh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.y(d)})},EA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
8
- args:c}},HA=function(a,b){a.h?(b.type!==xA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},BA=function(a,b){HA(a,EA(a,"resolve",{messageId:b.messageId,value:void 0}))},FA=function(a,b){return new Promise(function(c,d){new IA(a.j,c,d,b);HA(a,b)})},IA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
9
- this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},JA=function(){this.g=new _.J("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Wk.bind(this);this.f=null;this.o=!1},KA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=EA(d,"SIMID:Player:resize",
10
- e);HA(d,e)}})},LA=function(a){this.m=a;this.a=null;this.g=new _.J("clpp.simid.Loader");this.h=!1;this.f=null},AA=function(a,b){var c=a.getContainer(),d=c.clientWidth;c=c.clientHeight;return{top:b.y/c*100+"%",left:b.x/d*100+"%",width:b.width/d*100+"%",height:b.height/c*100+"%"}},CA=function(a,b){a.g.info("SIMID Session created");a.a=b},MA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
11
- 500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.K(_.Xf))},NA=function(){};
12
- DA.prototype.load=function(a){window.addEventListener(_.Ie,this.o);this.h="";this.l=0;var b=this.f.url();this.g.info('Loading "'+b+'" as src of iFrame');this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)};DA.prototype.unload=function(){MA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ie,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
13
- IA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};IA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(JA,_.bw);_.r=JA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new LA(a)};
14
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new DA(this.h,b.simid),b=c.getContainer(),this.j=KA(this,b,c),this.j.observe(b),a.on(_.rg,this.w)):this.g.warn(wA)}};
15
- _.r.Wk=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(GA(this.a),this.o=!0,this.g.info(yA)),c&&(c=this.a,HA(c,EA(c,xA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(wA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
16
- b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.bw.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.rg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=LA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
17
- _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.N(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.N(1,10,10100,"No surface");return a};_.r.ii=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};NA.prototype.create=function(){return new JA};
18
- _.Yt(new NA);};
2
+ var f=function(window){var oA="No surface found. Can not attach frame!",pA="SIMID:Media:timeupdate",qA="Starting creative",vA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d.className?this.a.classList.add(d.className):(this.a.style.border=_.Qe,this.a.style.backgroundColor="transparent",this.a.style.transition="opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Qe,this.a.style.overflow=
3
+ _.ne);this.a.classList.add(_.ld);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.eg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":rA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
4
+ f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var h=sA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=h.left;f.m.getSurface().getMedia().style.top=h.top;f.m.getSurface().getMedia().style.width=h.width;f.m.getSurface().getMedia().style.height=h.height}g.creativeDimensions&&(g=sA(f,g.creativeDimensions),f.a.a.style.left=
5
+ g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);tA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.K("clpp.simid.SimidPlayer");uA(this.f,this)},yA=function(a){var b=wA(a,"SIMID:Player:startCreative",void 0);xA(a,b).then(function(){var c=a.f;c.g.info(qA);c.m.trigger(new _.M(_.Wf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},rA=function(a,b){var c;_.I(function(d){if(1==
6
+ d.a){a.h=b.sessionId;tA(a,b);_.F(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
7
+ closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=wA(a,"SIMID:Player:init",e);e=xA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.z(d)})},wA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
8
+ args:c}},zA=function(a,b){a.h?(b.type!==pA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},tA=function(a,b){zA(a,wA(a,"resolve",{messageId:b.messageId,value:void 0}))},xA=function(a,b){return new Promise(function(c,d){new AA(a.j,c,d,b);zA(a,b)})},AA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
9
+ this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},BA=function(){this.g=new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.Rk.bind(this);this.f=null;this.o=!1},CA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=wA(d,"SIMID:Player:resize",
10
+ e);zA(d,e)}})},DA=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=null},sA=function(a,b){var c=a.getContainer(),d=c.clientWidth;c=c.clientHeight;return{top:b.y/c*100+"%",left:b.x/d*100+"%",width:b.width/d*100+"%",height:b.height/c*100+"%"}},uA=function(a,b){a.g.info("SIMID Session created");a.a=b},EA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
11
+ 500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.M(_.Xf))},FA=function(){};
12
+ vA.prototype.load=function(a){window.addEventListener(_.Ie,this.o);this.h="";this.l=0;var b=this.f.url();this.g.info('Loading "'+b+'" as src of iFrame');this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)};vA.prototype.unload=function(){EA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ie,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
13
+ AA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};AA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(BA,_.Hv);_.r=BA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new DA(a)};
14
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new vA(this.h,b.simid),b=c.getContainer(),this.j=CA(this,b,c),this.j.observe(b),a.on(_.sg,this.w)):this.g.warn(oA)}};
15
+ _.r.Rk=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(yA(this.a),this.o=!0,this.g.info(qA)),c&&(c=this.a,zA(c,wA(c,pA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(oA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
16
+ b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.Hv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.sg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=DA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
17
+ _.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.r.ci=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};FA.prototype.create=function(){return new BA};
18
+ _.ru(new FA);};
19
19
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
20
20
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
21
21
  else{_=this.clpp._;(f.call(g,this));}