@castlabs/prestoplay 6.14.1 → 6.16.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 (61) hide show
  1. package/CHANGELOG.md +28 -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 +114 -112
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +553 -538
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +74 -73
  10. package/cjs/cl.externs.js +193 -58
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -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 +368 -264
  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.simid.js +15 -15
  22. package/cjs/cl.smooth.js +72 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +71 -71
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +20 -20
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +89 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +455 -443
  37. package/cl.crypto.js +9 -9
  38. package/cl.dash.js +70 -68
  39. package/cl.externs.js +189 -58
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -71
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +318 -236
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/package.json +1 -1
  61. package/typings.d.ts +393 -57
package/cjs/cl.muxdata.js CHANGED
@@ -1,19 +1,19 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Wy=function(a){switch(a.type){case 1:return Ty;case 2:return Uy;case 3:return Vy}},Yy=function(a){var b=Object.keys(a).find(function(c){return Xy.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},Zy=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 _.Eh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.kj.bind(this);this.D=this.em.bind(this)},az=function(a){var b={debug:!0,
3
- data:$y(a)};a.f&&a.f.muxOptionsOverride&&_.O.Uc(a.f.muxOptionsOverride)&&(b=_.O.oa(b,a.f.muxOptionsOverride));b=_.O.oa(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 _.bk(c.url);
4
- f.video_source_url=_.ck(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().ka(),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.ja())&&d.language&&(f.player_language_code=
5
- d.language);return f}});a.g.debug("Mux SDK options",b);return b},$y=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.va,player_software_name:_.va,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},bz=function(a){a.a.on(a.m,_.fg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.fg,b)});a.a.on(a.m,_.jf,function(){return a.emit(_.jf)});
6
- a.a.on(a.m,_.hd,a.hj.bind(a));a.a.on(a.m,_.Vf,a.jj.bind(a));a.a.on(a.m,_.pg,function(){return a.emit(_.Of)});a.a.on(a.m,_.og,function(){return a.emit(_.Nf)});a.a.on(a.m,_.pe,a.ij.bind(a));a.a.on(a.m,_.uc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.vc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Hc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Dc,function(){return a.emit("adpause")});a.a.on(a.m,_.Fc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
- _.Ic,function(){return a.emit("adended")});a.a.on(a.m,_.zc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.Cc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Jc,function(){return a.emit("adthirdquartile")});a.j.jd(a.G);a.j.Xf(a.D);a.a.on(a.m,_.pe,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 _.bk(b.uris[b.uriIndex]);b={request_start:c,request_type:Wy(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 _.bk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:Wy(b),request_hostname:e.a,request_error:""+Wy(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)}})},cz=function(a){_.Hh(a.a);a.j.ye(a.G);a.j.Ih(a.D)},dz=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},ez=function(a){return!_.O.R(a)&&typeof a.init===_.se&&typeof a.emit===_.se},fz=function(){},Ty="manifest",Uy="media",Vy="encryption",Xy=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=Zy.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,az(this))}catch(d){throw this.h=!1,cz(this),new _.P(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=$y(this),this.emit("videochange",a),this.l=!1);bz(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.la):(cz(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Xd);this.A?this.g.debug(_.ka):(this.A=!0,this.emit("destroy"))};
10
- _.r.emit=function(a,b){if(null===this.w)throw new _.P(1,9,9301);this.w.emit(this.B,a,b)};_.r.hj=function(a){this.g.debug(_.We);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Pa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.jj=function(a){this.g.debug(_.$e);switch(a.detail.currentState){case _.gp:this.m.getConfiguration().autoplay&&this.emit(_.jf);break;case _.ip:this.emit(_.tf);break;case _.hp:this.emit(_.ef);break;case _.bp:this.emit(_.oe)}};
11
- _.r.ij=function(a){this.g.debug(_.Xe);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(_.pe,{player_error_code:a.code,player_error_message:b})}};
12
- _.r.kj=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 _.bk(b.uris[b.uriIndex]);a={request_start:e,request_type:Wy(b),request_hostname:g.a,request_id:Yy(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
- request_url:_.ck(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.em=function(a){a.requestStartTimestamp=Date.now()};_.w(dz,_.fu);_.r=dz.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new Zy(a,this.g)};
14
- _.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.O.Na(c.muxdata);try{var d=[];typeof c===_.Ve&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.P(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.O.R(e.muxdata)&&typeof e.muxdata===_.Ve){var f=e.muxdata;d=ez(f.muxLib)?f.muxLib:window.mux;if(!ez(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.P(1,9,9301);this.T(a,g)}}else this.g.warn("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,this.T(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&&this.T(this.m,c),c;}};_.r.T=function(a,b){a.trigger(new _.L(_.pe,{detail:b}))};_.I("clpp.muxdata.MuxDataPlugin",dz);dz.prototype.emit=dz.prototype.emit;
16
- dz.Id="mux";fz.prototype.create=function(){return new dz};_.Dq(new fz);};
2
+ var f=function(window){var Az=function(a){switch(a.type){case 1:return xz;case 2:return yz;case 3:return zz}},Cz=function(a){var b=Object.keys(a).find(function(c){return Bz.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},Dz=function(a,b){this.m=a;this.o=this.f=null;this.C=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.Uh;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.jk.bind(this);this.D=this.cn.bind(this)},Fz=function(a){var b={debug:!0,
3
+ data:Ez(a)};a.f&&a.f.muxOptionsOverride&&_.O.nd(a.f.muxOptionsOverride)&&(b=_.O.ra(b,a.f.muxOptionsOverride));b=_.O.ra(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 _.sk(c.url);
4
+ f.video_source_url=_.tk(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().qa(),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.pa())&&d.language&&(f.player_language_code=
5
+ d.language);return f}});a.g.debug("Mux SDK options",b);return b},Ez=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.wa,player_software_name:_.wa,player_software_version:_.ja,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ja};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Gz=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,_.mf,function(){return a.emit(_.mf)});
6
+ a.a.on(a.m,_.kd,a.gk.bind(a));a.a.on(a.m,_.hg,a.ik.bind(a));a.a.on(a.m,_.Bg,function(){return a.emit(_.$f)});a.a.on(a.m,_.Ag,function(){return a.emit(_.Zf)});a.a.on(a.m,_.se,a.hk.bind(a));a.a.on(a.m,_.yc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.zc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Lc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.Hc,function(){return a.emit("adpause")});a.a.on(a.m,_.Jc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
7
+ _.Mc,function(){return a.emit("adended")});a.a.on(a.m,_.Dc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.Gc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Nc,function(){return a.emit("adthirdquartile")});a.j.Bd(a.G);a.j.Hg(a.D);a.a.on(a.m,_.se,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 _.sk(b.uris[b.uriIndex]);b={request_start:c,request_type:Az(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 _.sk(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:Az(b),request_hostname:e.a,request_error:""+Az(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)}})},Hz=function(a){_.Xh(a.a);a.j.cf(a.G);a.j.Di(a.D)},Iz=function(){this.f=this.m=null;this.a=!1;this.g=new _.K("clpp.muxdata")},Jz=function(a){return!_.O.S(a)&&typeof a.init===_.ve&&typeof a.emit===_.ve},Kz=function(){},xz="manifest",yz="media",zz="encryption",Bz=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.u=Dz.prototype;_.u.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.C,Fz(this))}catch(d){throw this.h=!1,Hz(this),new _.P(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=Ez(this),this.emit("videochange",a),this.l=!1);Gz(this)};_.u.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(Hz(this),this.l=!0,this.o=this.f=null)};_.u.destroy=function(){this.g.debug(_.Zd);this.A?this.g.debug(_.la):(this.A=!0,this.emit("destroy"))};
10
+ _.u.emit=function(a,b){if(null===this.w)throw new _.P(1,9,9301);this.w.emit(this.C,a,b)};_.u.gk=function(a){this.g.debug(_.Ze);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Za())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.u.ik=function(a){this.g.debug(_.cf);switch(a.detail.currentState){case _.zp:this.m.getConfiguration().autoplay&&this.emit(_.mf);break;case _.Bp:this.emit(_.xf);break;case _.Ap:this.emit(_.hf);break;case _.up:this.emit(_.re)}};
11
+ _.u.hk=function(a){this.g.debug(_.$e);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(_.se,{player_error_code:a.code,player_error_message:b})}};
12
+ _.u.jk=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 _.sk(b.uris[b.uriIndex]);a={request_start:e,request_type:Az(b),request_hostname:g.a,request_id:Cz(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
13
+ request_url:_.tk(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.u.cn=function(a){a.requestStartTimestamp=Date.now()};_.x(Iz,_.tu);_.u=Iz.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.f=new Dz(a,this.g)};
14
+ _.u.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.O.Xa(c.muxdata);try{var d=[];typeof c===_.Ye&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.P(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.O.S(e.muxdata)&&typeof e.muxdata===_.Ye){var f=e.muxdata;d=Jz(f.muxLib)?f.muxLib:window.mux;if(!Jz(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.P(1,9,9301);this.V(a,g)}}else this.g.warn("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,this.V(a,l)}};_.u.onContentLoaded=function(){};_.u.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.u.onPlayerWillRelease=function(){this.a&&this.f.release()};_.u.id=function(){return"mux"};_.u.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&this.V(this.m,c),c;}};_.u.V=function(a,b){a.trigger(new _.L(_.se,{detail:b}))};_.J("clpp.muxdata.MuxDataPlugin",Iz);Iz.prototype.emit=Iz.prototype.emit;
16
+ Iz.Id="mux";Kz.prototype.create=function(){return new Iz};_.Zq(new Kz);};
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 Ry=function(){this.g=new _.K("clpp.onboard");this.j=new Set},Sy=function(a,b){function c(l){return l&&(_.R.startsWith(l,"https://")||_.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 _.lm(a);h.Sa(_.Sd,{licenseUrl:e,videoRobustness:[_.Vb,void 0],audioRobustness:[_.Ub,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
- modifiers:{licenseRequest:_.an,licenseResponse:_.fn}});h.Sa(_.Od,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.cn,licenseResponse:_.dn,extractContentId:_.Zm,certificateRequest:_.en}});h.Sa(_.Qd,{licenseUrl:f,modifiers:{licenseRequest:_.an}});_.gm(h)};_.w(Ry,_.fs);Ry.prototype.a=function(){for(var a=_.u(this.j),b=a.next();!b.done;b=a.next())delete _.fm[b.value];this.j.clear()};
4
- Ry.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+"'"),Sy(b,a),this.j.add(b))};Ry.prototype.id=function(){return"onboard"};_.I("clpp.onboard.OnboardComponent",Ry);_.I("clpp.onboard.register",Sy);};
2
+ var f=function(window){var vz=function(){this.g=new _.K("clpp.onboard");this.j=new Set},wz=function(a,b){function c(l){return l&&(_.S.startsWith(l,"https://")||_.S.startsWith(l,"http://")||_.S.startsWith(l,"//"))?l:d+l}var d=b.baseUrl;_.S.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Em(a);h.fb(_.Ud,{licenseUrl:e,videoRobustness:[_.Yb,void 0],audioRobustness:[_.Xb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,
3
+ modifiers:{licenseRequest:_.sn,licenseResponse:_.xn}});h.fb(_.Qd,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.un,licenseResponse:_.vn,extractContentId:_.qn,certificateRequest:_.wn}});h.fb(_.Sd,{licenseUrl:f,modifiers:{licenseRequest:_.sn}});_.zm(h)};_.x(vz,_.Gs);vz.prototype.a=function(){for(var a=_.w(this.j),b=a.next();!b.done;b=a.next())delete _.ym[b.value];this.j.clear()};
4
+ vz.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+"'"),wz(b,a),this.j.add(b))};vz.prototype.id=function(){return"onboard"};_.J("clpp.onboard.OnboardComponent",vz);_.J("clpp.onboard.register",wz);};
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,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var zy="A persistent DRM session already exists for: ",Ay="No DRM configuration.",By="clpp.persistent",Cy="clpp.persistent.SimpleSessionStorage",Dy=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},Ey=function(a){a=a.f.keys();a=Dy(a,function(b){return b.sessionId});return Array.from(a)},Fy=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return _.x(f,_.mo(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.f.get(c))&&a.B&&(e.ub=new _.zj,d.push(e.ub));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},Hy=function(a,b){a.K=Gy;a.L=[];a.G=!0;return _.Tn(a,b)},Jy=function(a,b,c,d,e,f){a.K=Iy;var g=new Map,h=_.ro(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.bf,persistentState:_.Kf,sessionTypes:[_.gf],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
- videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Zn(a,g)},Ky=function(){this.g=new _.K(Cy)},Ly=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}},My=function(a,b){var c=
5
- _.im(a),d=_.Nl({drm:a});d.drm=a;var e=new _.Pn({sb:b,onError:function(){},zf:function(){},yf:function(){},onEvent:function(){},getConfiguration:function(){return d},Qc:function(){return null}});e.h=c;return e},Py=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.E(function(q){switch(q.a){case 1:d=Ny;e=Oy;if(!a)return e.debug(Ay),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(zy,f),q["return"]();h=My(a,c);_.A(q,3,4);return _.x(q,Hy(h,b),
6
- 6);case 6:return _.x(q,_.fo(h),7);case 7:return _.x(q,_.go(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.Ck(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=Ey(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 _.ch(q),_.x(q,h.destroy(),10);case 10:_.dh(q,0);break;case 3:throw p=_.C(q),e.error("Error while persisting DRM session "+
7
- f),new _.P(1,6,6200,null,p);}})},Qy=function(){this.g=new _.K(By)},Gy=1,Iy=2;_.r=Ky.prototype;
8
- _.r.store=function(a,b){var c;return _.E(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 _.E(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](Ly(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 _.E(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.r.clear=function(){return _.E(function(a){window.localStorage.clear();_.y(a)})};_.r.getName=function(){return Cy};_.I("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.O.R(a)||(_.O.rb(a.store)||c.push("store"),_.O.rb(a.get)||c.push("get"),_.O.rb(a["delete"])||c.push("delete"),_.O.rb(a.clear)||c.push("clear"),_.O.rb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Oy.warn("Invalid session storage implementation"),new _.P(1,6,6202,{missingMethods:b});Ny=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,D,G,F,B,H,N,M,S;return _.E(function(ba){switch(ba.a){case 1:f=Ny;g=Oy;h=function(qa,Ta){return new _.P(1,6,6200,qa,Ta)};l=_.mp(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(Ay);m=b.offlineId;if(typeof m!==_.Yf||!m.length)throw h("Missing offline id.");return _.x(ba,f.get(m),2);case 2:if(n=ba.f)return g.debug(zy,m),ba["return"]();p=_.Nl();q=new _.Nj;
11
- t=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())D=z.value,G=new D,_.Rl(G.id())||(G.f(),_.Tl(G),t.push(G));F=null;_.A(ba,3,4);return _.x(ba,_.at(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=ba.f,F.configure(p.manifest),_.x(ba,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:B=ba.f;if(!B.periods.length)throw h(null,new _.P(_.Q,4,4014));H=_.Us(B.periods);
12
- return _.x(ba,Py(b,H,q),4);case 4:for(_.ch(ba);t.length;)N=t.shift(),N.a(),_.Ql["delete"](N.id());M=[];F&&M.push(F.stop());M.push(q.destroy());return _.x(ba,Promise.all(M),9);case 9:_.dh(ba,0);break;case 3:S=_.C(ba);if(S instanceof _.P&&6200===S.code)throw S;throw h(null,S);}})});
13
- _.I("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:b=Ny;c=Oy;if(!_.O.$(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.A(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 _.Nj;d=My(f.drmConfig,e);return _.x(l,Jy(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
- 6);case 6:return _.x(l,_.fo(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.E(function(n){if(1==n.a)return _.x(n,Fy(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 _.ch(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.dh(l,0);break;case 2:throw h=_.C(l),c.error("Failed to remove session"),new _.P(1,6,6201,null,h);}})});var Ny=new Ky,Oy=new _.K(By);_.w(Qy,_.fs);Qy.prototype.id=function(){return _.ff};Qy.prototype.l=function(a,b){var c=this,d,e,f;return _.E(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();_.A(g,2);return _.x(g,Py(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.he,{offlineId:d.offlineId})),_.bh(g,0);f=_.C(g);a.onError(f);_.y(g)})};
15
- Qy.prototype.j=function(a){var b=this,c,d;return _.E(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=Ny,_.A(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"]([])}_.C(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.I("clpp.persistent.PersistentLicenseComponent",Qy);};
2
+ var f=function(window){var dz="A persistent DRM session already exists for: ",ez="No DRM configuration.",fz="clpp.persistent",gz="clpp.persistent.SimpleSessionStorage",hz=function(a,b){for(var c=[],d=_.w(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},iz=function(a){a=a.f.keys();a=hz(a,function(b){return b.sessionId});return Array.from(a)},jz=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,_.Fo(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.f.get(c))&&a.C&&(e.Jb=new _.Qj,d.push(e.Jb));a.g.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},lz=function(a,b){a.L=kz;a.M=[];a.G=!0;return _.go(a,b)},nz=function(a,b,c,d,e,f){a.L=mz;var g=new Map,h=_.Ko(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.ef,persistentState:_.Pf,sessionTypes:[_.kf],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
4
+ videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.mo(a,g)},oz=function(){this.g=new _.K(gz)},pz=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}},qz=function(a,b){var c=
5
+ _.Bm(a),d=_.fm({drm:a});d.drm=a;var e=new _.bo({bb:b,onError:function(){},dg:function(){},bg:function(){},onEvent:function(){},getConfiguration:function(){return d},ld:function(){return null}});e.h=c;return e},tz=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=rz;e=sz;if(!a)return e.debug(ez),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.y(q,d.get(f),2);case 2:if(g=q.f)return e.debug(dz,f),q["return"]();h=qz(a,c);_.D(q,3,4);return _.y(q,lz(h,b),
6
+ 6);case 6:return _.y(q,_.so(h),7);case 7:return _.y(q,_.to(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.Uk(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=iz(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.y(q,d.store(f,g),4);case 4:return _.rh(q),_.y(q,h.destroy(),10);case 10:_.sh(q,0);break;case 3:throw p=_.E(q),e.error("Error while persisting DRM session "+
7
+ f),new _.P(1,6,6200,null,p);}})},uz=function(){this.g=new _.K(fz)},kz=1,mz=2;_.u=oz.prototype;
8
+ _.u.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));_.C(d)})};_.u.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](pz(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.u["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.C(b)})};_.u.clear=function(){return _.I(function(a){window.localStorage.clear();_.C(a)})};_.u.getName=function(){return gz};_.J("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.O.S(a)||(_.O.Hb(a.store)||c.push("store"),_.O.Hb(a.get)||c.push("get"),_.O.Hb(a["delete"])||c.push("delete"),_.O.Hb(a.clear)||c.push("clear"),_.O.Hb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw sz.warn("Invalid session storage implementation"),new _.P(1,6,6202,{missingMethods:b});rz=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,v,z,B,F,G,A,H,M,N,W;return _.I(function(pa){switch(pa.a){case 1:f=rz;g=sz;h=function(Ca,$a){return new _.P(1,6,6200,Ca,$a)};l=_.Fp(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ez);m=b.offlineId;if(typeof m!==_.kg||!m.length)throw h("Missing offline id.");return _.y(pa,f.get(m),2);case 2:if(n=pa.f)return g.debug(dz,m),pa["return"]();p=_.fm();q=new _.ck;
11
+ t=[];v=_.w(d);for(z=v.next();!z.done;z=v.next())B=z.value,F=new B,_.jm(F.id())||(F.f(),_.lm(F),t.push(F));G=null;_.D(pa,3,4);return _.y(pa,_.Ct(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return G=pa.f,G.configure(p.manifest),_.y(pa,G.start(l.url,{configurationId:"",networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:A=pa.f;if(!A.periods.length)throw h(null,new _.P(_.Q,
12
+ 4,4014));H=_.tt(A.periods);return _.y(pa,tz(b,H,q),4);case 4:for(_.rh(pa);t.length;)M=t.shift(),M.a(),_.im["delete"](M.id());N=[];G&&N.push(G.stop());N.push(q.destroy());return _.y(pa,Promise.all(N),9);case 9:_.sh(pa,0);break;case 3:W=_.E(pa);if(W instanceof _.P&&6200===W.code)throw W;throw h(null,W);}})});
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=rz;c=sz;if(!_.O.ga(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.D(l,2,3);return _.y(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 _.ck;d=qz(f.drmConfig,e);return _.y(l,nz(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
14
+ 6);case 6:return _.y(l,_.so(d),7);case 7:return _.y(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.y(n,jz(d,m),2);c.debug("successfully removed session with id",m);_.C(n)})})),8);case 8:return _.y(l,b["delete"](a),3);case 3:return _.rh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:_.sh(l,0);break;case 2:throw h=_.E(l),c.error("Failed to remove session"),new _.P(1,6,6201,null,h);}})});var rz=new oz,sz=new _.K(fz);_.x(uz,_.Gs);uz.prototype.id=function(){return _.jf};uz.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();_.D(g,2);return _.y(g,tz(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.ke,{offlineId:d.offlineId})),_.qh(g,0);f=_.E(g);a.onError(f);_.C(g)})};
15
+ uz.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=rz,_.D(e,2),_.y(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"]([])})};_.J("clpp.persistent.PersistentLicenseComponent",uz);};
16
16
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
17
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
18
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var wy=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Fl.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.rc.bind(this)},xy=function(a){a.trigger(new _.L(_.vf))},yy=function(a,b){return 0<=b&&b<a.a.length};_.w(wy,_.Fl);_.r=wy.prototype;_.r.on=function(a,b,c){return _.Fl.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Fl.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Fl.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
3
- _.r.nk=function(){return this.a};_.r.Cd=function(){return 0<this.a.length&&yy(this,this.f)?this.a[this.f]:null};_.r.qk=function(){var a=this.f+1;return 0<this.a.length&&yy(this,a)?this.a[a]:null};_.r.Ck=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.oe,this.j),this.me(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.oe,this.j)};_.r.rc=function(){this.next()};
4
- _.r.next=function(){var a=this,b;return _.E(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.me(b),0)})};_.r.$l=function(){var a=this,b;return _.E(function(c){b=Math.max(0,a.f-1);return _.x(c,a.me(b),0)})};_.r.me=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.E(function(e){if(1==e.a){if(!(0<c.a.length&&yy(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Cd())?_.x(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.uf,{item:d}));_.y(e)})};
5
- _.r.append=function(a){this.a.push(a);xy(this)};_.r.yk=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Cd();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));xy(this)}};_.r.remove=function(a){if(0<this.a.length&&yy(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);xy(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;xy(this)};_.I("clpp.Playlist",wy);wy.prototype.clear=wy.prototype.clear;wy.prototype.remove=wy.prototype.remove;
6
- wy.prototype.insert=wy.prototype.yk;wy.prototype.append=wy.prototype.append;wy.prototype.goTo=wy.prototype.me;wy.prototype.previous=wy.prototype.$l;wy.prototype.next=wy.prototype.next;wy.prototype.onEnded=wy.prototype.rc;wy.prototype.stop=wy.prototype.stop;wy.prototype.start=wy.prototype.start;wy.prototype.isStarted=wy.prototype.Ck;wy.prototype.getUpcoming=wy.prototype.qk;wy.prototype.getCurrent=wy.prototype.Cd;wy.prototype.getQueue=wy.prototype.nk;wy.prototype.getPosition=wy.prototype.getPosition;
7
- wy.prototype.off=wy.prototype.off;wy.prototype.one=wy.prototype.one;wy.prototype.on=wy.prototype.on;};
2
+ var f=function(window){var az=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Yl.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Fc.bind(this)},bz=function(a){a.trigger(new _.L(_.zf))},cz=function(a,b){return 0<=b&&b<a.a.length};_.x(az,_.Yl);_.u=az.prototype;_.u.on=function(a,b,c){return _.Yl.prototype.on.call(this,a,b,c)};_.u.one=function(a,b,c){return _.Yl.prototype.one.call(this,a,b,c)};_.u.off=function(a,b){return _.Yl.prototype.off.call(this,a,b)};_.u.getPosition=function(){return this.f};
3
+ _.u.pl=function(){return this.a};_.u.Sd=function(){return 0<this.a.length&&cz(this,this.f)?this.a[this.f]:null};_.u.rl=function(){var a=this.f+1;return 0<this.a.length&&cz(this,a)?this.a[a]:null};_.u.Gl=function(){return this.h};_.u.start=function(){this.h||(this.h=!0,this.m.on(_.re,this.j),this.Ne(this.f,!0))};_.u.stop=function(){this.h=!1;this.m.off(_.re,this.j)};_.u.Fc=function(){this.next()};
4
+ _.u.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.Ne(b),0)})};_.u.Ym=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.y(c,a.Ne(b),0)})};_.u.Ne=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&&cz(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Sd())?_.y(e,c.l(d),3):e.F(0)}if(4!=e.a)return _.y(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.yf,{item:d}));_.C(e)})};
5
+ _.u.append=function(a){this.a.push(a);bz(this)};_.u.Cl=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Sd();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));bz(this)}};_.u.remove=function(a){if(0<this.a.length&&cz(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);bz(this)}};_.u.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;bz(this)};_.J("clpp.Playlist",az);az.prototype.clear=az.prototype.clear;az.prototype.remove=az.prototype.remove;
6
+ az.prototype.insert=az.prototype.Cl;az.prototype.append=az.prototype.append;az.prototype.goTo=az.prototype.Ne;az.prototype.previous=az.prototype.Ym;az.prototype.next=az.prototype.next;az.prototype.onEnded=az.prototype.Fc;az.prototype.stop=az.prototype.stop;az.prototype.start=az.prototype.start;az.prototype.isStarted=az.prototype.Gl;az.prototype.getUpcoming=az.prototype.rl;az.prototype.getCurrent=az.prototype.Sd;az.prototype.getQueue=az.prototype.pl;az.prototype.getPosition=az.prototype.getPosition;
7
+ az.prototype.off=az.prototype.off;az.prototype.one=az.prototype.one;az.prototype.on=az.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));}
package/cjs/cl.simid.js CHANGED
@@ -1,20 +1,20 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var ey="No surface found. Can not attach frame!",fy="SIMID:Media:timeupdate",gy="Starting creative",ly=function(a){var b=this;this.f=a;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";this.a.style.border=_.Ue;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.Ue;this.a.style.overflow=_.ue;this.a.classList.add(_.xd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
- (c=(c=c.data)?typeof c===_.Yf?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":hy(b,c);break;case "resolve":c=c.args;var d=b.j.get(c.messageId);d&&d.resolve(c);break;case "reject":c=c.args;(d=b.j.get(c.messageId))&&d.reject(c);break;case "SIMID:Creative:requestResize":d=b.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition=
4
- "":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);var f=iy(d,e.mediaDimensions);d.m.getSurface().getMedia().style.left=f.left;d.m.getSurface().getMedia().style.top=f.top;d.m.getSurface().getMedia().style.width=f.width;d.m.getSurface().getMedia().style.height=f.height}e.creativeDimensions&&(e=iy(d,e.creativeDimensions),d.a.a.style.left=e.left,d.a.a.style.top=e.top,d.a.a.style.width=e.width,d.a.a.style.height=e.height);jy(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
- this.g=new _.K("clpp.simid.SimidPlayer");ky(this.f,this)},oy=function(a){var b=my(a,"SIMID:Player:startCreative",void 0);ny(a,b).then(function(){var c=a.f;c.g.info(gy);c.m.trigger(new _.L(_.Qf));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},hy=function(a,b){var c;_.E(function(d){if(1==d.a){a.h=b.sessionId;jy(a,b);_.A(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,
2
+ var f=function(window){var Jy="No surface found. Can not attach frame!",Ky="SIMID:Media:timeupdate",Ly="Starting creative",Qy=function(a){var b=this;this.f=a;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";this.a.style.border=_.Xe;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=_.Xe;this.a.style.overflow=_.xe;this.a.classList.add(_.zd);this.o=function(c){if(c.source===b.a.contentWindow&&
3
+ (c=(c=c.data)?typeof c===_.kg?JSON.parse(c):c:null))if(c.type)switch(b.g.info("Received message ["+c.messageId+"] '"+c.type+"':",c.args),c.type){case "createSession":My(b,c);break;case "resolve":c=c.args;var d=b.j.get(c.messageId);d&&d.resolve(c);break;case "reject":c=c.args;(d=b.j.get(c.messageId))&&d.reject(c);break;case "SIMID:Creative:requestResize":d=b.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition=
4
+ "":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);var f=Ny(d,e.mediaDimensions);d.m.getSurface().getMedia().style.left=f.left;d.m.getSurface().getMedia().style.top=f.top;d.m.getSurface().getMedia().style.width=f.width;d.m.getSurface().getMedia().style.height=f.height}e.creativeDimensions&&(e=Ny(d,e.creativeDimensions),d.a.a.style.left=e.left,d.a.a.style.top=e.top,d.a.a.style.width=e.width,d.a.a.style.height=e.height);Oy(b,c)}else b.g.warn("WARNING: received message without 'type' property")};
5
+ this.g=new _.K("clpp.simid.SimidPlayer");Py(this.f,this)},Ty=function(a){var b=Ry(a,"SIMID:Player:startCreative",void 0);Sy(a,b).then(function(){var c=a.f;c.g.info(Ly);c.m.trigger(new _.L(_.bg));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},My=function(a,b){var c;_.I(function(d){if(1==d.a){a.h=b.sessionId;Oy(a,b);_.D(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,
6
6
  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",closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",
7
- clickThruUrl:""}};e=my(a,"SIMID:Player:init",e);e=ny(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"),_.bh(d,0);c=_.C(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.y(d)})},my=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},py=function(a,b){a.h?(b.type!==fy&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),
8
- a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},jy=function(a,b){py(a,my(a,"resolve",{messageId:b.messageId,value:void 0}))},ny=function(a,b){return new Promise(function(c,d){new qy(a.j,c,d,b);py(a,b)})},qy=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;this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},ry=function(){this.g=
9
- new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.mj.bind(this);this.f=null;this.o=!1},sy=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=my(d,"SIMID:Player:resize",e);py(d,e)}})},ty=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
- null},iy=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+"%"}},ky=function(a,b){a.g.info("SIMID Session created");a.a=b},uy=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width=
11
- "";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 _.L(_.Rf))},vy=function(){};ly.prototype.load=function(a){window.addEventListener(_.Ne,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)};
12
- ly.prototype.unload=function(){uy(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Ne,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};qy.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};qy.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(ry,_.fu);_.r=ry.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 ty(a)};
13
- _.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length)if(this.l=b.simid.creatives,this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives"),b=this.m.getSurface()){this.g.info("Creating new session");this.a=new ly(this.h);var c=b.getContainer();this.j=sy(this,c,b);this.j.observe(c);a.on(_.fg,this.w)}else this.g.warn(ey)};
14
- _.r.mj=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&&(oy(this.a),this.o=!0,this.g.info(gy)),c&&(c=this.a,py(c,my(c,fy,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(ey),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
15
- b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.fu.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.fg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};ty.prototype.release=function(){this.g.info("Releasing loader")};
16
- ty.prototype.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.P(1,10,10100,"No player container found");return a};ty.prototype.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.P(1,10,10100,"No surface");return a};ty.prototype.url=function(){return this.f?this.f.url:""};vy.prototype.create=function(){return new ry};
17
- _.Dq(new vy);};
7
+ clickThruUrl:""}};e=Ry(a,"SIMID:Player:init",e);e=Sy(a,e);return _.y(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.qh(d,0);c=_.E(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.C(d)})},Ry=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},Uy=function(a,b){a.h?(b.type!==Ky&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),
8
+ a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},Oy=function(a,b){Uy(a,Ry(a,"resolve",{messageId:b.messageId,value:void 0}))},Sy=function(a,b){return new Promise(function(c,d){new Vy(a.j,c,d,b);Uy(a,b)})},Vy=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;this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},Wy=function(){this.g=
9
+ new _.K("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.lk.bind(this);this.f=null;this.o=!1},Xy=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=Ry(d,"SIMID:Player:resize",e);Uy(d,e)}})},Yy=function(a){this.m=a;this.a=null;this.g=new _.K("clpp.simid.Loader");this.h=!1;this.f=
10
+ null},Ny=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+"%"}},Py=function(a,b){a.g.info("SIMID Session created");a.a=b},Zy=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width=
11
+ "";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 _.L(_.cg))},$y=function(){};Qy.prototype.load=function(a){window.addEventListener(_.Pe,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)};
12
+ Qy.prototype.unload=function(){Zy(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Pe,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};Vy.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};Vy.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.x(Wy,_.tu);_.u=Wy.prototype;_.u.id=function(){return"simid"};_.u.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 Yy(a)};
13
+ _.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length)if(this.l=b.simid.creatives,this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives"),b=this.m.getSurface()){this.g.info("Creating new session");this.a=new Qy(this.h);var c=b.getContainer();this.j=Xy(this,c,b);this.j.observe(c);a.on(_.sg,this.w)}else this.g.warn(Jy)};
14
+ _.u.lk=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&&(Ty(this.a),this.o=!0,this.g.info(Ly)),c&&(c=this.a,Uy(c,Ry(c,Ky,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(Jy),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
15
+ b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.u.onPlayerWillRelease=function(a){_.tu.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))};Yy.prototype.release=function(){this.g.info("Releasing loader")};
16
+ Yy.prototype.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.P(1,10,10100,"No player container found");return a};Yy.prototype.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.P(1,10,10100,"No surface");return a};Yy.prototype.url=function(){return this.f?this.f.url:""};$y.prototype.create=function(){return new Wy};
17
+ _.Zq(new $y);};
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));}