@castlabs/prestoplay 6.26.0 → 6.28.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 (68) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -113
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +623 -623
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +89 -89
  10. package/cjs/cl.externs.js +112 -72
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +78 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +23 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +353 -345
  18. package/cjs/cl.muxdata.js +14 -15
  19. package/cjs/cl.onboard.js +4 -3
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -17
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +73 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +15 -3
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +6 -5
  37. package/cl.cast.js +93 -90
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +506 -507
  40. package/cl.crypto.js +9 -9
  41. package/cl.dash.js +83 -82
  42. package/cl.externs.js +112 -72
  43. package/cl.freewheel.js +19 -19
  44. package/cl.hls.js +80 -79
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +17 -17
  48. package/cl.mediatailor.js +2 -3
  49. package/cl.mse.js +308 -305
  50. package/cl.muxdata.js +13 -13
  51. package/cl.onboard.js +4 -4
  52. package/cl.persistent.js +11 -11
  53. package/cl.playlist.js +5 -5
  54. package/cl.simid.js +14 -14
  55. package/cl.smooth.js +60 -60
  56. package/cl.thumbnails.js +19 -19
  57. package/cl.tizen.js +57 -57
  58. package/cl.ttml.js +22 -22
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +15 -15
  62. package/cl.vtt.js +12 -12
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +31 -29
  65. package/package.json +1 -1
  66. package/typings.d.ts +115 -63
  67. package/cjs/cl.sessions.js +0 -21
  68. package/cl.sessions.js +0 -10
package/cjs/cl.crypto.js CHANGED
@@ -1,14 +1,14 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var hW=function(){this.B=[0,1,2,4,8,16,32,64,128,27,54];this.F=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.l=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.A=new Uint32Array(256);this.o=new Uint32Array(256);this.w=new Uint32Array(0);this.h=this.a=this.j=this.f=null;var a=this.A,b=this.o,c=this.F,d=c[0],e=c[1],f=c[2];c=c[3];var g=this.l,h=g[0],l=g[1],m=g[2];g=g[3];var n=new Uint32Array(256),p=0,q=0,t;for(t=0;256>
3
- t;t++)n[t]=128>t?t<<1:t<<1^283;for(t=0;256>t;t++){var u=q^q<<1^q<<2^q<<3^q<<4;u=u>>>8^u&255^99;a[p]=u;b[u]=p;var y=n[p],A=n[y],B=n[A],E=257*n[u]^16843008*u;d[p]=E<<24|E>>>8;e[p]=E<<16|E>>>16;f[p]=E<<8|E>>>24;c[p]=E;E=16843009*B^65537*A^257*y^16843008*p;h[u]=E<<24|E>>>8;l[u]=E<<16|E>>>16;m[u]=E<<8|E>>>24;g[u]=E;p?(p=y^n[n[n[B^y]]],q^=n[n[q]]):p=q=1}},iW=function(a){a=_.Vj(a);for(var b=new Uint32Array(4),c=0;4>c;c++)b[c]=a.getUint32(4*c);return b},jW=function(){this.a=null},kW=function(){this.j={};
4
- this.l=!1;this.g=new _.J("clpp.crypto")},mW=function(a,b){return function(c){var d,e,f;return _.H(function(g){if(1==g.a){d=c.request||null;if(!(d&&2===d.type&&d.keyInfo&&c.data))return g.D(2);e=d.uris[0];a.g.debug("Decrypting AES-128-encrypted video segment",e);f=c;return _.x(g,lW(a,b,c.data,d.keyInfo,e),3)}2!=g.a&&(f.data=g.f);return g["return"](c)})}},nW=function(a,b,c){var d,e,f,g,h,l;return _.H(function(m){if(1==m.a){d=_.ik(c);if(e=(new _.ej(c)).bb.endsWith(".drmtoday.com"))f=b.getConfiguration(),
5
- _.Un(d,f);g=c+JSON.stringify(d.headers);if(a.j[g])return m["return"](a.j[g]);_.D(m,2);return _.x(m,b.getNetworkEngine().fetch(d).T,4)}if(2!=m.a)return h=m.f,a.j[g]=h.data,m["return"](h.data);l=_.F(m);e&&1001===l.code&&412===l.data.status&&a.g.warn("Wrong DRMtoday credentials, server responded with 412.");throw l;})},lW=function(a,b,c,d,e){var f,g,h,l,m;return _.H(function(n){switch(n.a){case 1:return f=new ArrayBuffer(0),_.D(n,2),_.x(n,nW(a,b,d.url),4);case 4:f=n.f;_.vh(n,3);break;case 2:return g=
6
- _.F(n),a.g.warn("Could not fetch AES key",g),b.onError(new _.N(1,7,7104,null,g)),n["return"](c);case 3:return _.D(n,5),h=a.l?new jW:new hW,_.x(n,h.importKey(f),7);case 7:return _.x(n,h.decrypt(c,d.iv),8);case 8:return l=n.f,n["return"](l);case 5:return m=_.F(n),a.g.warn("Could not decrypt segment data!",e,m),b.onError(new _.N(1,3,3103,null,m)),n["return"](c)}})};
7
- hW.prototype.importKey=function(a){a=iW(a);for(var b=!0,c=0;c<a.length&&b;)b=a[c]===this.w[c],c++;if(b)return new Promise(function(n){return n()});this.w=a;this.a=a.length;if(4!==this.a&&6!==this.a&&8!==this.a)throw Error("Invalid aes key size\x3d"+this.a);this.h=4*(this.a+7);this.f=new Uint32Array(this.h);this.j=new Uint32Array(this.h);b=this.A;var d=this.B;var e=this.l;c=e[0];var f=e[1],g=e[2],h=e[3],l=0,m=0;for(e=0;e<this.h;e++)e<this.a?l=this.f[e]=a[e]:(m=l,0===e%this.a?(m=m<<8|m>>>24,m=b[m>>>
2
+ var f=function(window){var WU=function(){this.B=[0,1,2,4,8,16,32,64,128,27,54];this.F=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.l=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.A=new Uint32Array(256);this.o=new Uint32Array(256);this.w=new Uint32Array(0);this.h=this.a=this.j=this.f=null;var a=this.A,b=this.o,c=this.F,d=c[0],e=c[1],f=c[2];c=c[3];var g=this.l,h=g[0],l=g[1],m=g[2];g=g[3];var n=new Uint32Array(256),p=0,q=0,t;for(t=0;256>
3
+ t;t++)n[t]=128>t?t<<1:t<<1^283;for(t=0;256>t;t++){var u=q^q<<1^q<<2^q<<3^q<<4;u=u>>>8^u&255^99;a[p]=u;b[u]=p;var y=n[p],B=n[y],A=n[B],C=257*n[u]^16843008*u;d[p]=C<<24|C>>>8;e[p]=C<<16|C>>>16;f[p]=C<<8|C>>>24;c[p]=C;C=16843009*A^65537*B^257*y^16843008*p;h[u]=C<<24|C>>>8;l[u]=C<<16|C>>>16;m[u]=C<<8|C>>>24;g[u]=C;p?(p=y^n[n[n[A^y]]],q^=n[n[q]]):p=q=1}},XU=function(a){a=_.Ti(a);for(var b=new Uint32Array(4),c=0;4>c;c++)b[c]=a.getUint32(4*c);return b},YU=function(){this.a=null},ZU=function(){this.a={};
4
+ this.f=!1;this.g=new _.L("clpp.crypto")},aV=function(a,b){return function(c){var d,e,f;return _.I(function(g){if(1==g.a){d=c.request||null;if(!(d&&2===d.type&&d.keyInfo&&c.data))return g.C(2);e=d.uris[0];a.g.debug("Decrypting AES-128-encrypted video segment",e);f=c;return _.x(g,$U(a,b,c.data,d.keyInfo,e),3)}2!=g.a&&(f.data=g.f);return g["return"](c)})}},bV=function(a,b,c){var d,e,f,g,h,l;return _.I(function(m){if(1==m.a){d=_.Mk(c);if(e=(new _.cm(c)).a.hostname.endsWith(".drmtoday.com"))f=b.getConfiguration(),
5
+ _.Hq(d,f);g=c+JSON.stringify(d.headers);if(a.a[g])return m["return"](a.a[g]);_.F(m,2);return _.x(m,b.getNetworkEngine().fetch(d).T,4)}if(2!=m.a)return h=m.f,a.a[g]=h.data,m["return"](h.data);l=_.H(m);e&&1001===l.code&&412===l.data.status&&a.g.warn("Wrong DRMtoday credentials, server responded with 412.");throw l;})},$U=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return f=new ArrayBuffer(0),_.F(n,2),_.x(n,bV(a,b,d.url),4);case 4:f=n.f;_.G(n,3);break;case 2:return g=
6
+ _.H(n),a.g.warn("Could not fetch AES key",g),b.onError(new _.N(1,7,7104,null,g)),n["return"](c);case 3:return _.F(n,5),h=a.f?new YU:new WU,_.x(n,h.importKey(f),7);case 7:return _.x(n,h.decrypt(c,d.iv),8);case 8:return l=n.f,n["return"](l);case 5:return m=_.H(n),a.g.warn("Could not decrypt segment data!",e,m),b.onError(new _.N(1,3,3103,null,m)),n["return"](c)}})};
7
+ WU.prototype.importKey=function(a){a=XU(a);for(var b=!0,c=0;c<a.length&&b;)b=a[c]===this.w[c],c++;if(b)return new Promise(function(n){return n()});this.w=a;this.a=a.length;if(4!==this.a&&6!==this.a&&8!==this.a)throw Error("Invalid aes key size\x3d"+this.a);this.h=4*(this.a+7);this.f=new Uint32Array(this.h);this.j=new Uint32Array(this.h);b=this.A;var d=this.B;var e=this.l;c=e[0];var f=e[1],g=e[2],h=e[3],l=0,m=0;for(e=0;e<this.h;e++)e<this.a?l=this.f[e]=a[e]:(m=l,0===e%this.a?(m=m<<8|m>>>24,m=b[m>>>
8
8
  24]<<24|b[m>>>16&255]<<16|b[m>>>8&255]<<8|b[m&255],m^=d[e/this.a|0]<<24):6<this.a&&4===e%this.a&&(m=b[m>>>24]<<24|b[m>>>16&255]<<16|b[m>>>8&255]<<8|b[m&255]),l=(this.f[e-this.a]^m)>>>0,this.f[e]=l);for(a=0;a<this.h;a++)e=this.h-a,m=a&3?this.f[e]:this.f[e-4],this.j[a]=4>a||4>=e?m:c[b[m>>>24]]^f[b[m>>>16&255]]^g[b[m>>>8&255]]^h[b[m&255]],this.j[a]>>>=0;return new Promise(function(n){return n()})};
9
- hW.prototype.decrypt=function(a,b){var c=0,d=this.a+6,e=this.j,f=this.o,g=this.l,h=g[0],l=g[1],m=g[2];g=g[3];var n=iW(b),p=n[0],q=n[1],t=n[2];n=n[3];for(var u=_.Uj(a),y=new Int32Array(u.length),A,B,E,C,G,M,R,ka,U,ra,Ba,Ca,Da,Na=this.G.bind(this);c<u.length;){ka=Na(u[c]);U=Na(u[c+1]);ra=Na(u[c+2]);Ba=Na(u[c+3]);G=ka^e[0];M=Ba^e[1];R=ra^e[2];C=U^e[3];Ca=4;for(Da=1;Da<d;Da++)A=h[G>>>24]^l[M>>16&255]^m[R>>8&255]^g[C&255]^e[Ca],B=h[M>>>24]^l[R>>16&255]^m[C>>8&255]^g[G&255]^e[Ca+1],E=h[R>>>24]^l[C>>16&
10
- 255]^m[G>>8&255]^g[M&255]^e[Ca+2],C=h[C>>>24]^l[G>>16&255]^m[M>>8&255]^g[R&255]^e[Ca+3],G=A,M=B,R=E,Ca+=4;A=f[G>>>24]<<24^f[M>>16&255]<<16^f[R>>8&255]<<8^f[C&255]^e[Ca];B=f[M>>>24]<<24^f[R>>16&255]<<16^f[C>>8&255]<<8^f[G&255]^e[Ca+1];E=f[R>>>24]<<24^f[C>>16&255]<<16^f[G>>8&255]<<8^f[M&255]^e[Ca+2];C=f[C>>>24]<<24^f[G>>16&255]<<16^f[M>>8&255]<<8^f[R&255]^e[Ca+3];Ca+=3;y[c]=Na(A^p);y[c+1]=Na(C^q);y[c+2]=Na(E^t);y[c+3]=Na(B^n);p=ka;q=U;t=ra;n=Ba;c+=4}return new Promise(function(zb){var pe=y.buffer;var Df=
11
- pe.byteLength,Ig=Df&&(new DataView(pe)).getUint8(Df-1);pe=Ig?pe.slice(0,Df-Ig):pe;zb(pe)})};hW.prototype.destroy=function(){this.B=this.j=this.f=this.l=this.F=this.o=this.A=this.h=this.a=this.w=null;return new Promise(function(a){return a()})};hW.prototype.G=function(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24};jW.prototype.importKey=function(a){var b=this,c;return _.H(function(d){if(1==d.a)return c=b,_.x(d,crypto.subtle.importKey("raw",a,{name:"AES-CBC"},!1,["decrypt"]),2);c.a=d.f;_.z(d)})};jW.prototype.decrypt=function(a,b){var c=this,d;return _.H(function(e){if(1==e.a)return _.x(e,crypto.subtle.decrypt({name:"AES-CBC",iv:b},c.a,a),2);d=e.f;return e["return"](d)})};jW.prototype.destroy=function(){this.a=null;return new Promise(function(a){return a()})};_.w(kW,_.Fu);kW.prototype.f=function(){if(window.crypto&&crypto.subtle){var a=crypto.subtle.decrypt;a=typeof crypto.subtle.importKey===_.me&&typeof a===_.me}else a=!1;(this.l=a)||this.g.warn("No WebCrypto APIs found. Will fallback to software AES")};kW.prototype.o=function(a){var b=mW(this,a);a.getNetworkEngine().gd(b)};kW.prototype.a=function(){this.j={}};kW.prototype.id=function(){return"crypto"};_.I("clpp.crypto.CryptoComponent",kW);};
9
+ WU.prototype.decrypt=function(a,b){var c=0,d=this.a+6,e=this.j,f=this.o,g=this.l,h=g[0],l=g[1],m=g[2];g=g[3];var n=XU(b),p=n[0],q=n[1],t=n[2];n=n[3];for(var u=_.Si(a),y=new Int32Array(u.length),B,A,C,E,D,J,P,U,V,ra,Da,wa,Ea,Ma=this.G.bind(this);c<u.length;){U=Ma(u[c]);V=Ma(u[c+1]);ra=Ma(u[c+2]);Da=Ma(u[c+3]);D=U^e[0];J=Da^e[1];P=ra^e[2];E=V^e[3];wa=4;for(Ea=1;Ea<d;Ea++)B=h[D>>>24]^l[J>>16&255]^m[P>>8&255]^g[E&255]^e[wa],A=h[J>>>24]^l[P>>16&255]^m[E>>8&255]^g[D&255]^e[wa+1],C=h[P>>>24]^l[E>>16&255]^
10
+ m[D>>8&255]^g[J&255]^e[wa+2],E=h[E>>>24]^l[D>>16&255]^m[J>>8&255]^g[P&255]^e[wa+3],D=B,J=A,P=C,wa+=4;B=f[D>>>24]<<24^f[J>>16&255]<<16^f[P>>8&255]<<8^f[E&255]^e[wa];A=f[J>>>24]<<24^f[P>>16&255]<<16^f[E>>8&255]<<8^f[D&255]^e[wa+1];C=f[P>>>24]<<24^f[E>>16&255]<<16^f[D>>8&255]<<8^f[J&255]^e[wa+2];E=f[E>>>24]<<24^f[D>>16&255]<<16^f[J>>8&255]<<8^f[P&255]^e[wa+3];wa+=3;y[c]=Ma(B^p);y[c+1]=Ma(E^q);y[c+2]=Ma(C^t);y[c+3]=Ma(A^n);p=U;q=V;t=ra;n=Da;c+=4}return new Promise(function(vb){var ee=y.buffer;var tf=
11
+ ee.byteLength,wg=tf&&(new DataView(ee)).getUint8(tf-1);ee=wg?ee.slice(0,tf-wg):ee;vb(ee)})};WU.prototype.destroy=function(){this.B=this.j=this.f=this.l=this.F=this.o=this.A=this.h=this.a=this.w=null;return new Promise(function(a){return a()})};WU.prototype.G=function(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24};YU.prototype.importKey=function(a){var b=this,c;return _.I(function(d){if(1==d.a)return c=b,_.x(d,crypto.subtle.importKey("raw",a,{name:"AES-CBC"},!1,["decrypt"]),2);c.a=d.f;_.z(d)})};YU.prototype.decrypt=function(a,b){var c=this,d;return _.I(function(e){if(1==e.a)return _.x(e,crypto.subtle.decrypt({name:"AES-CBC",iv:b},c.a,a),2);d=e.f;return e["return"](d)})};YU.prototype.destroy=function(){this.a=null;return new Promise(function(a){return a()})};_.w(ZU,_.Tu);_.r=ZU.prototype;_.r.install=function(){if(window.crypto&&crypto.subtle){var a=crypto.subtle.decrypt;a=typeof crypto.subtle.importKey===_.ne&&typeof a===_.ne}else a=!1;(this.f=a)||this.g.warn("No WebCrypto APIs found. Will fallback to software AES")};_.r.playerConstructed=function(a){var b=aV(this,a);a.getNetworkEngine().Gd(b)};_.r.playerDestroyed=function(){};_.r.uninstall=function(){this.a={}};_.r.id=function(){return"crypto"};_.K("clpp.crypto.CryptoComponent",ZU);};
12
12
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
13
13
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
14
14
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.dash.js CHANGED
@@ -1,93 +1,93 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var wP="\x3cms:pro/\x3e lacks content",xP="BaseURL",yP="Channel parsing failure! Ignoring scheme and value",zP="ContentProtection",AP="EssentialProperty",BP="Failed to parse UTCTiming tags.",CP="Location",DP="Missing \x3cms:pro/\x3e node in ContentProtection element",EP="No UTCTiming elements found.",FP="SegmentBase does not contain sufficient segment information:",GP="SegmentList does not contain sufficient segment information:",HP="SegmentTemplate does not contain sufficient segment information:",
3
- IP="SegmentTimeline",JP='The last "S" element cannot have a negative repeat',KP="duration",LP="http://dashif.org/guidelines/trickmode",MP="http://www.w3.org/1999/xlink",NP='ignoring the last "S" element.',OP='ignoring the remaining "S" elements.',PP="parse.xml",QP="presentationTimeOffset",RP="schemeIdUri",SP="static",TP="timescale",UP="urn:microsoft:playready",VP="urn:mpeg:cenc:2013",WP="urn:mpeg:dash:utc:http-head:2014",XP="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",YP="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
4
- ZP=function(a,b,c){try{var d=a(b);if(d&&d.T&&d.abort)return c.resolve(d.T),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){})["catch"](function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}},$P=function(a,b,c){function d(){e.reject(new _.N(_.O,7,7001));return a.abort()}var e=new _.qk;a.T.then(function(f){a.a?e.reject(new _.N(_.O,7,7001)):b?d=ZP(b,f,e):e.resolve(f)},function(f){c?d=ZP(c,f,e):e.reject(f)});return new _.rk(e,
5
- function(){return d()})},aQ=function(a,b){a.H=Math.max(a.H,b);a.g.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+a.H)},bQ=function(a,b){return a.reduce(function(c,d,e){return d["catch"](c.bind(null,e))}.bind(null,b),Promise.reject())},cQ=function(a){return new _.rk(Promise.reject(a),function(){return Promise.resolve()})},dQ=function(a){return new _.rk(Promise.all(a.map(function(b){return b.T})),function(){return Promise.all(a.map(function(b){return b.abort()}))})},eQ=function(a){var b=
6
- void 0===b?1024:b;if(!(a instanceof Uint8Array))return"";if(typeof b!==_.k||0>=b)b=1024;return(a.byteLength>b?a.subarray(0,b):a).toString()},fQ=function(a){return 1>=a?0:Math.floor(Math.random()*a)},gQ=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)},hQ=function(a){if(!a)return null;var b=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return _.Kh("Invalid duration string:",
7
- a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},iQ=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null},jQ=function(a){a=Number(a);return 0===a%1?a:null},kQ=function(a){a=Number(a);return 0===a%1&&0<a?a:null},lQ=function(a){a=Number(a);return 0===a%1&&0<=a?a:
8
- null},mQ=function(a){var b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:a},nQ=function(a){return a?"true"===a.toLowerCase():!1},oQ=function(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(g,h,l,m){if("$$"===g)return"$";var n=f[h];if(null==n)return _.Kh("URL template does not have an available substitution ","for identifier",'"'+h+'":',a),
9
- g;"RepresentationID"===h&&l&&(_.Kh("URL template should not contain a width specifier for identifier",'"RepresentationID":',a),l=void 0);"Time"===h&&(n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":g=n.toString();break;case "o":g=n.toString(8);break;case "x":g=n.toString(16);break;case "X":g=n.toString(16).toUpperCase();break;default:g=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-g.length)+1).join("0")+g})},rQ=function(a,b){var c=pQ(a,b,TP),d=1;c&&(d=kQ(c)||
10
- 1);c=pQ(a,b,KP);(c=kQ(c||""))&&(c/=d);var e=Number(pQ(a,b,QP))||0,f=e/d||0;a.Am&&null!=a.xe&&a.xe!==f&&(_.Kh("The stream is non-compliant with the DASH spec. The value of `presentationTimeOffset` has changed during the transition from dynamic to static manifest, which is not allowed. The last value will be ignored. (Period ID: "+(a.Oa.id+", Representation ID: ")+(a.O.id+")")),e=a.xe*d,f=a.xe);var g=pQ(a,b,"startNumber"),h=lQ(g||"");if(null==g||null==h)h=1;g=pQ(a,b,"endNumber");g=null!==g?lQ(g||""):
11
- null;var l=qQ(a,b,IP),m=null;if(l){m=d;var n=e,p=a.Ga.duration||Infinity,q=_.Wo;l=q.$(l,"S");for(var t=[],u=0,y=0;y<l.length;++y){var A=l[y],B=q.W(A,"t",lQ),E=q.W(A,"d",lQ),C=q.W(A,"r",jQ);null!=B&&(B-=n);if(!E){_.Kh('"S" element must have a duration:',OP,A);break}B=null!=B?B:u;C=C||0;if(0>C)if(y+1<l.length){C=q.W(l[y+1],"t",lQ);if(null==C){_.Kh('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:',OP,A);break}else if(B>=C){_.Kh('An "S" element cannot have a negative repeat if its start ',
12
- 'time exceeds the next "S" element\'s start time:',OP,A);break}C=Math.ceil((C-B)/E)-1}else{if(Infinity===p){_.Kh(JP,"if the Period has an infinite duration:",NP,A);break}else if(B/m>=p){_.Kh(JP,"if its start time exceeds the Period's duration:",NP,A);break}C=Math.ceil((p*m-B)/E)-1}0<t.length&&B!==u&&(Math.abs((B-u)/m)>=_.qw&&_.Kh("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",A),t[t.length-1].end=B/m);for(A=0;A<=C;++A)u=B+E,t.push({start:B/m,end:u/m,Ko:B}),B=
13
- u}m=t}n=pQ(a,b,"availabilityTimeOffset");p=Number(n||"");p=isNaN(p)?null:p;if(null==n||null==p)p=0;return{timescale:d,Pa:c,Sc:h,jg:g,Vb:f,Zg:e,timeline:m,Xf:p}},pQ=function(a,b,c){return[b(a.O),b(a.Aa),b(a.Oa)].filter(_.bj).map(function(d){return d.getAttribute(c)}).reduce(function(d,e){return d||e})},qQ=function(a,b,c){return[b(a.O),b(a.Aa),b(a.Oa)].filter(_.bj).map(function(d){return _.Wo.Ka(d,c)}).reduce(function(d,e){return d||e})},tQ=function(a,b,c,d,e,f){var g=_.Wo,h=g.getAttributeNS(a,MP,"href"),
14
- l=g.getAttributeNS(a,MP,"actuate")||"onRequest";g.Ff(a,MP);if(5<=f)return cQ(new _.N(_.O,4,4028));if("onLoad"!==l)return cQ(new _.N(_.O,4,4027));var m=_.ND([d],[h]);d=_.ik(m,b);d.type=1;return $P(e.fetch(d),function(n){n=_.Q.ea(n.data);n=g.Be(n,a.tagName);if(!n)return cQ(new _.N(_.O,4,4001,{uri:h}));g.Ef(a);g.pf(n,a);g.nf(n,a);return sQ(a,b,c,m[0],e,f+1)})},sQ=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=_.Wo;if(g.getAttributeNS(a,MP,"href"))return g=tQ(a,b,c,d,e,f),c&&(g=$P(g,void 0,function(){return sQ(a,
15
- b,c,d,e,f)})),g;var h=[],l=g.ef(a);l=_.v(l);for(var m=l.next();!m.done;m=l.next())m=m.value,"urn:mpeg:dash:resolve-to-zero:2013"===g.getAttributeNS(m,MP,"href")?g.removeChild(a,m):m.tagName!==IP&&h.push(sQ(m,b,c,d,e,f));return $P(dQ(h),function(){return a})},uQ=function(a,b,c){var d=a.Ga.duration,e=a.Ga.yi;if(!a.ig)return e=new _.TE(b),_.pE(e,d),e;var f=a.Oa;var g=a.O;f=f&&f.id&&g&&g.id?f.id+","+g.id:null;if(!a.Ci||null==c[f])return a=new _.TE(b),e||_.pE(a,d),c[f]=a;c=c[f];e||_.pE(new _.TE(b),d);
16
- c.ua(b);_.VE(c,_.HE(a.presentationTimeline)-a.Ga.start);return c},vQ=function(a,b){var c=a.presentationTimeline,d=_.hh(b.a).concat();c.l||0===d.length||(c.J=Math.floor(Math.max(c.J||0,d[d.length-1].endTime+a.Ga.start)));a.Ci||_.EE(a.presentationTimeline,_.hh(b.a).concat(),a.Ga.start)},wQ=function(a){return""===a.id?a.schemeIdUri+":"+a.startTime+":"+a.endTime:a.id},xQ=function(a,b,c,d,e){var f,g;return _.H(function(h){if(1==h.a)return f=_.uE(a,b,c,e),f.type=2,_.x(h,d.fetch(f),2);g=h.f;return h["return"](g.data)})},
17
- zQ=function(a,b,c,d){var e,f=(new _.sn).aa("sidx",function(h){e=yQ(b,d,c,h)});a&&f.parse(a);if(e)return e;f=b+"-"+(b+a.byteLength-1);var g=c[0];a=_.Oj(a);_.Qh('Invalid box type. Expected "sidx", but received:',a,"from:",g,"byte range:",f);throw new _.N(_.O,3,3004,{url:g,jp:f,size:a.byteLength,Dp:eQ(a)});},yQ=function(a,b,c,d){var e=[];d.reader.skip(4);var f=_.nn(d.reader);if(0===f)throw _.Qh("Invalid timescale."),new _.N(_.O,3,3005);if(0===d.version){var g=_.nn(d.reader);var h=_.nn(d.reader)}else g=
18
- _.pn(d.reader),h=_.pn(d.reader);d.reader.skip(2);var l=_.mn(d.reader);a=a+d.size+h;for(h=0;h<l;h++){var m=_.nn(d.reader),n=(m&2147483648)>>>31;m&=2147483647;var p=_.nn(d.reader);d.reader.skip(4);if(1===n)throw _.Qh("Hierarchical SIDXs are not supported."),new _.N(_.O,3,3006);e.push(new _.Aj(e.length,g/f-b,(g+p)/f-b,function(){return c},a,a+m-1,b));g+=p;a+=m}d.parser.stop();return e},AQ=function(a){this.f=a;this.a=new _.hn(a,!1)},EQ=function(a){var b=BQ(a);if(7<b.length)throw new _.N(_.O,3,3002);for(var c=
19
- 0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=BQ(a);a:{d=_.v(CQ);for(var e=d.next();!e.done;e=d.next())if(_.Tm(c,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)c=a.f.byteLength-a.a.getPosition();else{if(8===c.length&&c[1]&224)throw new _.N(_.O,3,3001);d=c[0]&(1<<8-c.length)-1;for(e=1;e<c.length;e++)d=256*d+c[e];c=d}c=a.a.getPosition()+c<=a.f.byteLength?c:a.f.byteLength-a.a.getPosition();d=new DataView(a.f.buffer,a.f.byteOffset+a.a.getPosition(),c);a.a.skip(c);return new DQ(b,d)},BQ=function(a){var b=
20
- _.ln(a.a),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new _.N(_.O,3,3002);var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=_.ln(a.a);return d},DQ=function(a,b){this.id=a;this.a=b},FQ=function(a){if(8<a.a.byteLength)throw new _.N(_.O,3,3002);if(8===a.a.byteLength&&a.a.getUint8(0)&224)throw new _.N(_.O,3,3001);for(var b=0,c=0;c<a.a.byteLength;c++){var d=a.a.getUint8(c);b=256*b+d}return b},GQ=function(){},IQ=function(a,b,c,d,e,f){function g(){return e}var h=[];a=new AQ(a.a);for(var l=null,m=null;_.jn(a.a);){var n=
21
- EQ(a);if(187===n.id){var p=HQ(n);p&&(n=c*p.Lo,p=b+p.eo,null!=l&&h.push(new _.Aj(h.length,l-f,n-f,g,m,p-1,f)),l=n,m=p)}}null!=l&&h.push(new _.Aj(h.length,l-f,d-f,g,m,null,f));return h},HQ=function(a){var b=new AQ(a.a);a=EQ(b);if(179!==a.id)throw _.Kh("Not a CueTime element."),new _.N(_.O,3,3013);a=FQ(a);b=EQ(b);if(183!==b.id)throw _.Kh("Not a CueTrackPositions element."),new _.N(_.O,3,3012);b=new AQ(b.a);for(var c=0;_.jn(b.a);){var d=EQ(b);if(241===d.id){c=FQ(d);break}}return{Lo:a,eo:c}},JQ=function(a,
22
- b){function c(){return""}var d=qQ(a,b,"Initialization");if(!d)return null;var e=a.O.ma,f=d.getAttribute("sourceURL")||void 0;f&&(e=_.ND(a.O.ma,[f]),c=function(){return f});var g=0,h=null;if(d=_.Wo.W(d,"range",iQ))g=d.start,h=d.end;return new _.PD(function(){return e},g,h,null,null,c,a.O.Ra)},KQ=function(a,b,c,d,e,f,g){var h=a.presentationTimeline,l=!a.ig||!a.Ga.yi,m=a.Ga.start,n=a.Ga.duration,p=null;return{createSegmentIndex:function(q,t){var u,y,A,B,E,C;return _.H(function(G){if(1==G.a)return u=
23
- [xQ(c,d,e,q,t),"webm"===f?xQ(b.La(),b.la,b.ga,q,t):null],_.x(G,Promise.all(u),2);y=G.f;A=y[0];B=y[1]||null;E=null;"mp4"===f?E=zQ(A,d,c,g):(C=new GQ,E=C.parse(A,B,c,g));_.EE(h,E,m);p=new _.TE(E);l&&_.pE(p,n);return G["return"](y)})},findSegmentPosition:function(q){return p.nd(q)},getSegmentReference:function(q){return p.get(q)},adjustSegmentDurations:function(q,t){return p.Pd(q,t)},getDuration:function(){return null!=n?n:p.getDuration()},getLastSegmentEndTime:function(){return n}}},LQ=function(a){return a.Fe},
24
- SQ=function(a,b,c){var d=MQ(a),e=NQ(a);OQ(a,e);var f=null;if(e.re)a.presentationTimeline.B=null,f=PQ(a,d,e);else if(e.Pa)c||(a.presentationTimeline.B=null,aQ(a.presentationTimeline,e.Xf),_.FE(a.presentationTimeline,e.Pa),_.CE(a.presentationTimeline,a.Ga.start)),f=QQ(a,e);else{c=RQ(a,e);var g=uQ(a,c,b);vQ(a,g);f={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:g.nd.bind(g),getSegmentReference:g.get.bind(g),adjustSegmentDurations:g.Pd.bind(g),getDuration:g.getDuration.bind(g),getLastSegmentEndTime:function(){return _.UE(g)}}}return{createSegmentIndex:f.createSegmentIndex,
25
- findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,adjustSegmentDurations:f.adjustSegmentDurations,getDuration:f.getDuration,initSegmentReference:d,getLastSegmentEndTime:f.getLastSegmentEndTime,Ha:e.Vb}},TQ=function(a){return a.wc},NQ=function(a){var b=rQ(a,TQ),c=pQ(a,TQ,"media");a=pQ(a,TQ,"index");return{Pa:b.Pa,timescale:b.timescale,Sc:b.Sc,jg:b.jg,Vb:b.Vb,Zg:b.Zg,timeline:b.timeline,tg:c,re:a,Xf:b.Xf}},OQ=function(a,b){var c=b.re?1:0;c+=b.timeline?1:0;c+=b.Pa?1:
26
- 0;if(0===c)throw _.Qh("SegmentTemplate does not contain any segment information:","the SegmentTemplate must contain either an index URL template","a SegmentTimeline, or a segment duration.",a.O),new _.N(_.O,4,4002);1!==c&&(_.Kh("SegmentTemplate contains multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",a.O),b.re?(_.Oh("Using the index URL template by default."),b.timeline=null):_.Oh("Using the SegmentTimeline by default."),
27
- b.Pa=null);if(!b.re&&!b.tg)throw _.Qh(HP,"the SegmentTemplate's media URL template is missing.",a.O),new _.N(_.O,4,4002);},PQ=function(a,b,c){var d=a.O.mimeType.split("/")[1];if("mp4"!==d&&"webm"!==d)throw _.Qh("SegmentTemplate specifies an unsupported container type.",a.O),new _.N(_.O,4,4006);if("webm"===d&&!b)throw _.Qh(HP,"the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",a.O),new _.N(_.O,4,4005);var e=oQ(c.re,a.O.id,null,a.bandwidth||null,null);
28
- e=_.ND(a.O.ma,[e]);return KQ(a,b,e,0,null,d,c.Vb)},QQ=function(a,b){var c=b.tg,d=a.Ga.duration,e=b.Pa,f=b.Sc,g=b.jg,h=b.timescale,l=a.bandwidth||null,m=a.O.id,n=a.O.ma,p=a.O.Ra;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(q){return 0>q||d&&q>=d?null:Math.floor(q/e)},getSegmentReference:function(q){function t(){return oQ(c,m,u,l,y*h)}var u=q+f;if(null!==g&&u>g)return null;var y=q*e,A=y+e;d&&(A=Math.min(A,d));return 0>A||d&&y>=d?null:new _.Aj(q,y,A,function(){var B=
29
- t();return _.ND(n,[B])},0,null,b.Vb,null,null,null,null,null,null,null,null,t,p)},adjustSegmentDurations:function(){},getDuration:function(){return d},getLastSegmentEndTime:function(){return d}}},RQ=function(a,b){var c=b.tg,d=b.timeline;if(0===d.length)return[];for(var e=[],f=a.O.id,g=a.bandwidth||null,h=a.O.ma,l=a.O.Ra,m={},n=0;n<d.length;m={Ue:m.Ue,Tf:m.Tf,Me:m.Me},n++)m.Ue=n+b.Sc,m.Tf=d[n].Ko+b.Zg,m.Me=function(p){return function(){return oQ(c,f,p.Ue,g,p.Tf)}}(m),e.push(new _.Aj(m.Ue,d[n].start,
30
- d[n].end,function(p){return function(){var q=p.Me();return _.ND(h,[q])}}(m),0,null,b.Vb,null,null,null,null,null,null,null,null,m.Me,l));return e},MQ=function(a){function b(){return oQ(c,d,null,e,null)}var c=pQ(a,TQ,"initialization");if(!c)return null;var d=a.O.id,e=a.bandwidth||null,f=a.O.ma;return new _.PD(function(){var g=b();return _.ND(f,[g])},0,null,null,null,b,a.O.Ra)},YQ=function(a,b){var c=JQ(a,UQ),d=VQ(a);WQ(a,d);var e=XQ(a.Ga.duration,d.Sc,a.O.ma,a.O.Ra,d),f=uQ(a,e,b);vQ(a,f);return{createSegmentIndex:Promise.resolve.bind(Promise),
31
- findSegmentPosition:f.nd.bind(f),getSegmentReference:f.get.bind(f),adjustSegmentDurations:f.Pd.bind(f),getDuration:f.getDuration.bind(f),initSegmentReference:c,getLastSegmentEndTime:function(){return _.UE(f)},Ha:d.Vb}},UQ=function(a){return a.vc},VQ=function(a){var b=ZQ(a);a=rQ(a,UQ);var c=a.Sc;0===c&&(_.Kh("SegmentList@startNumber must be \x3e 0"),c=1);var d=0;a.Pa?d=a.Pa*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{Pa:a.Pa,startTime:d,Sc:c,Vb:a.Vb,timeline:a.timeline,Oc:b}},
32
- WQ=function(a,b){if(!b.Pa&&!b.timeline&&1<b.Oc.length)throw _.Kh(GP,"the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.O),new _.N(_.O,4,4002);if(!b.Pa&&!a.Ga.duration&&!b.timeline&&1===b.Oc.length)throw _.Kh(GP,"the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",a.O),new _.N(_.O,4,4002);if(b.timeline&&0===b.timeline.length)throw _.Kh(GP,"the SegmentList has an empty timeline.",a.O),
33
- new _.N(_.O,4,4002);},XQ=function(a,b,c,d,e){var f=e.Oc.length;e.timeline&&e.timeline.length!==e.Oc.length&&(f=Math.min(e.timeline.length,e.Oc.length),_.Kh("The number of items in the segment timeline and the number of","segment URLs do not match, truncating",e.Oc.length,"to",f));for(var g=[],h=e.startTime,l={},m=0;m<f;l={Pf:l.Pf,bd:l.bd},m++){l.bd=e.Oc[m];l.Pf=_.ND(c,[l.bd.Ei]);var n=void 0;n=null!=e.Pa?h+e.Pa:e.timeline?e.timeline[m].end:h+a;g.push(new _.Aj(m+b,h,n,function(p){return function(){return p.Pf}}(l),
34
- l.bd.start,l.bd.end,e.Vb,null,null,null,null,null,null,null,null,function(p){return function(){return p.bd.Ei}}(l),d));h=n}return g},ZQ=function(a){return[a.O.vc,a.Aa.vc,a.Oa.vc].filter(_.bj).map(function(b){return _.Wo.$(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.og&&(a.og=!0,_.Kh("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));
35
- var c=b.getAttribute("media");b=_.Wo.W(b,"mediaRange",iQ,{start:0,end:null});return{Ei:c,start:b.start,end:b.end}})},$Q=function(a,b){this.g=a;this.f=b;this.a={clockSyncUri:void 0}},bR=function(a,b,c,d){var e,f;return _.H(function(g){switch(g.a){case 1:return e=_.Wo.$(b,"UTCTiming"),_.D(g,2),_.x(g,aR(a,c,e),4);case 4:f=g.f;d.I=f;a.g.info("Clock synchronized. The difference between server and client clock was "+(f+" ms."));_.vh(g,3);break;case 2:_.F(g),a.g.warn("Failed to synchronize clocks. This content may not play on clients with bad clocks!");
36
- case 3:return g["return"](d)}})},aR=function(a,b,c){c=c.map(function(e){return{scheme:e.getAttribute(RP),value:e.getAttribute(_.Eg)}});var d=a.a.clockSyncUri;!c.length&&d&&(a.g.info("No UTCTiming elements found, falling back on clockSyncUri from config to synchronize clocks."),c.push({scheme:WP,value:d}));return 0===c.length?(a.g.warn(EP),Promise.reject(Error(EP))):bQ(c,function(e){var f=e.scheme;e=e.value;switch(f){case WP:case "urn:mpeg:dash:utc:http-head:2012":return cR(a,b,e,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return cR(a,
37
- b,e,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":var g=Date.parse(e);return isNaN(g)?(a.g.warn("Invalid date for scheme "+f+", value: "+e),Promise.reject()):Promise.resolve(g-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return a.g.warn("NTP UTCTiming scheme is not supported"),Promise.reject();default:return a.g.warn("Unrecognized scheme in UTCTiming element",f),Promise.reject()}})["catch"](function(){a.g.warn(BP);
38
- return Promise.reject(Error(BP))})},cR=function(a,b,c,d){var e,f,g,h;return _.H(function(l){if(1==l.a)return e=_.ND(b,[c]),_.x(l,a.f(e,d),2);f=l.f;if("HEAD"===d){if(!f.headers||!f.headers.date)throw a.g.warn("UTC timing response is missing","expected date header"),Error("Date HTTP header missing.");g=f.headers.date}else g=_.Q.ea(f.data);h=Date.parse(g);if(isNaN(h))throw a.g.warn("Unable to parse date from UTC timing response"),Error("Date value invalid.");return l["return"](h-Date.now())})},eR=function(a,
39
- b){return a.find(function(c){return dR.get(c.jc)===b})},gR=function(a){var b=_.Wo,c=b.ac(a.node,UP,"pro");if(!c)return fR.warn(DP,a),null;c=b.sa(c);if(!c)return fR.warn(wP,a),null;a=_.Qm(c);a=_.ap(a);a=_.To(a.a);return{keyId:null,jc:YP,node:b.od(),init:[{initData:_.AD(a),initDataType:_.hd,keyId:null}]}},hR=function(a,b){b=void 0===b?"4.0.0.0":b;var c=_.Wo,d=c.ac(a.node,VP,"pssh");if(!d)return null;d=c.sa(d);if(!d)return null;d=_.Qm(d);d=_.Uo(d);return d?(d=_.BD(b,d.a))?{keyId:null,jc:XP,node:c.od(),
40
- init:[{initData:_.AD(d),initDataType:_.hd,keyId:null}]}:null:(_.Kh("Unable to parse WV PSSH data. Can not create PR data!"),null)},iR=function(a,b){var c=_.Wo,d=c.ac(a.node,UP,"pro");if(!d)return _.Kh(DP,a),null;d=c.sa(d);if(!d)return _.Kh(wP,a),null;d=_.Qm(d);d=_.ap(d);return d.version!==b&&(_.Ph("Parsing from "+d.version+" to "+b+"."),d=_.CD(d,b))?{keyId:null,jc:XP,node:c.od(),init:[{initData:_.AD(d),initDataType:_.hd,keyId:null}]}:null},lR=function(a,b,c,d){var e=jR(a),f=null;a=[];var g=[],h=eR(e,
41
- _.Gd),l=eR(e,_.Ed);if(l&&d){var m=iR(l,d);m&&(e[e.indexOf(l)]=m)}l&&!h&&(m=gR(l))&&e.push(m);h&&!l&&(d=hR(h,d||void 0))&&e.push(d);d=new Set(e.map(function(n){return n.keyId}));d["delete"](null);if(1<d.size)throw new _.N(_.O,4,4010);b||(g=e.filter(function(n){return"urn:mpeg:dash:mp4protection:2011"===n.jc?(f=n.init||f,!1):!0}),g.length&&(a=kR(f,g,c),0===a.length&&(a=[_.OD(_.Re,f,c)])));if(e.length&&(b||!g.length))for(a=[],b=_.v(dR.values()),e=b.next();!e.done;e=b.next())e=e.value,e!==_.af&&a.push(_.OD(e,
42
- f,c));if(c=Array.from(d)[0]||null)for(b=_.v(a),e=b.next();!e.done;e=b.next())for(e=_.v(e.value.initData),g=e.next();!g.done;g=e.next())g.value.keyId=c;return{Zd:c,op:f,drmInfos:a,Xh:!0}},mR=function(a,b,c,d,e){var f=lR(a,c,d,e);if(b.Xh){a=1===b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0===f.drmInfos.length;if(0===b.drmInfos.length||a&&!c)b.drmInfos=f.drmInfos;b.Zd=f.Zd||b.Zd;b.Xh=!1}else if(0<f.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(g){return f.drmInfos.some(function(h){return h.keySystem===
43
- g.keySystem})}),0===b.drmInfos.length))throw new _.N(_.O,4,4008);return f.Zd||b.Zd},nR=function(a){var b=_.Wo;a=b.Fc(a.node,"https://dashif.org/CPS","Laurl").map(function(c){return b.sa(c)}).filter(Boolean);return 0===a.length?null:1===a.length?a[0]:a[fQ(a.length)]},kR=function(a,b,c){var d=[];b=_.v(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value,g=dR.get(f.jc);if(g){e=_.OD(g,f.init||a,c);if(g=oR.get(g))(f=g(f))?(e.licenseServerUri=f.licenseUrl,e.licenseServerUriOrigin=f.origin):e.licenseServerUri=
44
- "";d.push(e)}}return d},jR=function(a){var b=[];a=_.v(a);for(var c=a.next();!c.done;c=a.next())(c=pR(c.value))&&b.push(c);return b},pR=function(a){var b=_.Wo,c=a.getAttribute(RP),d=b.getAttributeNS(a,VP,"default_KID"),e=b.Fc(a,VP,"pssh").map(b.sa),f=b.ac(a,UP,"pro");if(!c)return _.Qh("Missing required schemeIdUri attribute on","ContentProtection element",a),null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new _.N(_.O,4,4009);var g=[];try{if(g=e.map(function(n){return{initDataType:_.hd,
45
- initData:_.Qm(n),keyId:null}}),0===g.length&&f&&b.sa(f))try{var h=b.sa(f),l=_.Qm(h),m=_.ap(l);g.push({initDataType:_.hd,initData:_.AD(m),keyId:null})}catch(n){_.Kh("Unable to parse ms:pro payload",n),g=[]}}catch(n){throw new _.N(_.O,4,4007);}return{node:a,jc:c,keyId:d,init:0<g.length?g:null}},qR=function(){var a=this;this.C=this.a=null;this.o=[];this.f=null;this.H=[];this.h=1;this.I={};this.l=0;this.J=new _.rE(5);this.B=new _.Yh(function(){a.hc()});this.A=new _.tk;this.j=new Map;this.g=new _.J("clpp.dash.DashParser");
46
- this.F=null;this.K=new $Q(this.g,function(b,c){var d=_.ik(b,a.a.attemptParameters);d.type=5;d.method=c;d=a.C.networkingEngine.fetch(d);_.uk(a.A,d);return d.T});this.G=new Map;this.L=!1;this.w=null},sR=function(a){var b,c,d,e,f,g,h,l,m,n,p,q;return _.H(function(t){switch(t.a){case 1:b=a.w?_.HF(a.w,CP):null;var u=[];b&&(u=_.CF(b,""));0===u.length&&(u=a.o);c=u;d=_.ik(c,a.a.attemptParameters);d.type=1;e=a.C.networkingEngine;f=Date.now();g=e.fetch(d);_.uk(a.A,g);return _.x(t,g.T,2);case 2:h=t.f;if(!a.C)return t["return"](0);
47
- b||h.uri&&!a.o.includes(h.uri)&&a.o.unshift(h.uri);l=null!=a.f;return _.x(t,rR(a,h.data,h.uri),3);case 3:m=t.f;if(!m.manifest.contentSteering){t.D(4);break}n=a;return _.x(t,a.C.onContentSteeringInfoFound(m.manifest.contentSteering),5);case 5:n.w=t.f;case 4:if(a.w&&b){0!==h.request.uriIndex&&_.IF(a.w,b.ma[0].serviceLocationId);var y=h.request;u=h.timeMs;var A=h.data.byteLength;u&&A&&(y=_.GF(a.w,b.ma[y.uriIndex].serviceLocationId),_.zF(y.Yf,u,A),y.De=!0)}p=Date.now();q=(p-f)/1E3;_.sE(a.J,1,q);if(l&&
48
- a.C.onUpdate)a.C.onUpdate(m.manifest);if(m.Io){if(a.C.onTurnedStatic)a.C.onTurnedStatic();a.C.onEvent(new _.K(_.Pe))}return t["return"](q)}})},rR=function(a,b,c){var d,e,f,g,h;return _.H(function(l){if(1==l.a){d=_.Q.ea(b);_.cp(PP);e=_.Wo.Be(d,"MPD");_.cp("parse.xml.end");_.ep(PP,PP,"parse.xml.end");if(!e)throw new _.N(_.O,4,4001,c);f=a.a.xlinkFailGracefully;g=sQ(e,a.a.attemptParameters,f,c,a.C.networkingEngine);_.uk(a.A,g);return _.x(l,g.T,2)}h=l.f;return l["return"](tR(a,h,c))})},uR=function(a,b,
49
- c){if(a.length){c=c||"__clpp_baseUriCollection_\n "+b.length;var d=[];a.forEach(function(e){var f=e.getAttribute("serviceLocation");e=_.Wo.sa(e);f&&e&&d.push({serviceLocationId:f,uri:e,params:{}})});if(d.length)return a=new _.BF(c,d),b.push(a),a}return null},tR=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,u,y,A,B,E,C,G,M,R,ka;return _.H(function(U){if(1==U.a){d=_.Wo;e=[];f=[c];g=d.$(b,CP);h=g.map(d.sa).filter(_.bj);0<h.length&&(l=_.ND(f,h),f=a.o=l,uR(g,e,CP));m=d.$(b,xP);n=m.map(d.sa);p=_.ND(f,
50
- n);uR(m,e,xP);q=b.getAttribute("type")||SP;a.l=d.W(b,"minimumUpdatePeriod",hQ,-1);q===SP&&0<=a.l&&(a.g.warn("Invalid manifest - a static manifest should not contain the `minimumUpdatePeriod` attribute. The attribute will be ignored."),a.l=-1,a.B.stop());t=d.W(b,"maxSegmentDuration",hQ);if(u=q===SP&&"dynamic"===a.F)a.g.info("MPD dynamic to static transition."),q="dynamic";y=q===SP;A="dynamic"===q;if(a.f)var ra=a.f.presentationTimeline;else{var Ba=_.Wo;ra=a.a.timeline||{};var Ca=Ba.W(b,"suggestedPresentationDelay",
51
- hQ),Da=Ba.W(b,"minBufferTime",hQ,0);Ca=null!=a.a.suggestedPresentationDelay?a.a.suggestedPresentationDelay:a.a.lowLatencyMode?0:null!=Ca?Ca:3*Da;Ba=Ba.W(b,"availabilityStartTime",gQ);ra=new _.xE(ra,Ba,Ca,y,!!a.a.autoCorrectDrift,!!a.a.lowLatencyMode);ra=y?ra:bR(a.K,b,p,ra)}return _.x(U,ra,2)}B=U.f;ra=_.Wo.W(b,"timeShiftBufferDepth",hQ);E=A&&a.a.availabilityWindowOverride&&!isNaN(a.a.availabilityWindowOverride)?a.a.availabilityWindowOverride:null===ra?Infinity:ra;B.A=E;if(!a.C)throw new _.N(_.O,7,
52
- 7001);C={ig:A,Ci:null!=a.f,presentationTimeline:B,Oa:null,Ga:null,Aa:null,O:null,bandwidth:0,og:!1,Am:u,xc:null,xe:null};G=vR(a,C,p,e,b);M=G.duration;R=G.periods;u&&(wR(R,C),B.F=!0);if(y||!u&&!G.Rh)B.f=M||Infinity;if(2===a.a.timeline.version){ra=M;Ba=R[0].startTime;if(null==ra||Infinity===ra)ra=xR(R);_.wE(B.a,Ba,Ba+ra)}_.FE(B,t||1);B.isLive();if(!a.f){a.f={presentationTimeline:B,periods:R,minBufferTime:0,cues:[]};a:{Ca=_.Wo;if(Da=Ca.Ka(b,"ContentSteering"))if(ra=Da.getAttribute("defaultServiceLocation")||
53
- "",Ba=Ca.sa(Da)){Ca=Ca.W(Da,"queryBeforeStart",nQ,!1);ra={manifestType:_.Ic,contentSteeringServerUri:Ba,defaultServiceLocation:ra,queryBeforeStart:Ca||!1,baseUriCollections:[]};break a}ra=null}if(ka=ra)a.f.contentSteering=ka,a.f.contentSteering.baseUriCollections=e}a.f.cues=G.cues;a.F=q;return U["return"]({manifest:a.f,Io:u})})},xR=function(a){return a.map(function(b){return b.variants[0].video||b.variants[0].audio}).reduce(function(b,c){return c?c.getDuration():0+b},0)},vR=function(a,b,c,d,e){var f=
54
- _.Wo,g=f.W(e,"mediaPresentationDuration",hQ),h=a.f?a.f.periods[a.f.periods.length-1]||null:null,l=[],m=[],n=0;e=f.$(e,"Period");for(var p=0;p<e.length;p++){var q=e[p];n=f.W(q,_.bg,hQ,n);var t=f.W(q,KP,hQ),u=null;if(p!==e.length-1){var y=f.W(e[p+1],_.bg,hQ);null!=y&&(u=y-n)}else null!=g&&(u=g-n);y=_.qw;u&&t&&Math.abs(u-t)>y&&a.g.warn("There is a gap/overlap between Periods",q);null==u&&(u=t);q=yR(a,b,c,d,{start:n,duration:u,node:q,yi:null==u||p===e.length-1});t=q.Oa;m.push(t);l=l.concat(q.cues);a.H.includes(t.id)||
55
- (a.H.push(t.id),a.f&&(a.C.filterNewPeriod(t),a.f.periods.push(t)));if(null==u){p!==e.length-1&&a.g.warn("Skipping Period",p+1,"and any subsequent Periods:","Period",p+1,"does not have a valid start time.",m[p+1]);n=null;break}n+=u}null==a.f&&a.C.filterAllPeriods(m);h&&(b=m.find(function(A){return A.id===h.id}))&&(h.endTime=b.endTime);l=zR(a,l);return null!=g?(n!==g&&a.g.warn("@mediaPresentationDuration does not match the total duration of ","all Periods."),{periods:m,duration:g,Rh:!1,cues:l}):{periods:m,
56
- duration:n,Rh:!0,cues:l}},zR=function(a,b){var c=new Set(b.map(wQ));a.j.forEach(function(d,e){c.has(e)||a.j["delete"](e)});b.forEach(function(d){var e=wQ(d);a.j.has(e)||a.j.set(e,d)});return Array.from(a.j.values())},yR=function(a,b,c,d,e){var f=_.Wo;b.Oa=AR(a,e.node,null,c,d);b.Ga=e;c=b.Oa.id||"__clpp_period_"+e.start;b.Oa.id||(a.g.info("No Period ID given for Period with start time "+e.start+(", Assigning a default: "+c+".")),b.Oa.id=c);d=f.$(e.node,"EventStream").flatMap(function(t){return BR(a,
57
- e.start,e.duration,t)});var g=f.$(e.node,_.la).map(function(t){return CR(a,b,t)}).filter(_.bj);if(b.ig){f=[];for(var h=_.v(g),l=h.next();!l.done;l=h.next()){l=_.v(l.value.jo);for(var m=l.next();!m.done;m=l.next())f.push(m.value)}if(f.length!==(new Set(f)).size)throw new _.N(_.O,4,4018);}f=g.filter(function(t){return!t.Xg});h=g.filter(function(t){return t.Xg});h=_.v(h);for(l=h.next();!l.done;l=h.next()){m=l.value;m.streams.forEach(function(t){t.trickPlay=!0});l=m.streams[0];m=m.Xg;for(var n=_.v(f),
58
- p=n.next();!p.done;p=n.next())if(p=p.value,m.includes(p.id)){p=_.v(p.streams);for(var q=p.next();!q.done;q=p.next())q.value.trickModeVideo=l}}h=DR(g,_.Jg);l=DR(f,_.Pc);if(!h.length&&!l.length)throw new _.N(_.O,4,4004);l.length||(l=[null]);h.length||(h=[null]);g=[];l=_.v(l);for(m=l.next();!m.done;m=l.next())for(m=m.value,n=_.v(h),p=n.next();!p.done;p=n.next())ER(a,m,p.value,g);l=_.hh(DR(f,_.qj)).concat(_.hh(DR(f,_.ig)));h=[];l=_.v(l);for(m=l.next();!m.done;m=l.next())h.push.apply(h,m.value.streams);
59
- m=DR(f,_.te);l=[];m=_.v(m);for(n=m.next();!n.done;n=m.next())l.push.apply(l,n.value.streams);f=FR(e,f);return{Oa:{id:c,configurationId:a.C.configurationId,startTime:e.start,endTime:f,textStreams:h,thumbStreams:l,variants:g},cues:d}},FR=function(a,b){if(null!==a.duration)return a.start+a.duration;if(0<b.length){var c=b.filter(function(d){return 0<d.streams.length}).map(function(d){return d.streams}).flat().filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});
60
- return 0<c.length?a.start+Math.min.apply(Math,_.hh(c)):null}return null},DR=function(a,b){return a.filter(function(c){return c.contentType===b})},ER=function(a,b,c,d){var e;if(b||c)if(b&&c){if(_.iq(b.drmInfos,c.drmInfos)){var f=_.hq(b.drmInfos,c.drmInfos),g=_.v(b.streams);for(e=g.next();!e.done;e=g.next()){var h=e.value,l=_.v(c.streams);for(e=l.next();!e.done;e=l.next()){var m=e.value;e=(m.bandwidth||0)+(h.bandwidth||0);e={id:a.h++,language:b.language,primary:b.ze||c.ze,audio:h,video:m,bandwidth:e,
61
- drmInfos:f,allowedByApplication:!0,allowedByKeySystem:!0};d.push(e)}}}}else for(f=b||c,g=_.v(f.streams),e=g.next();!e.done;e=g.next())h=e.value,e=h.bandwidth||0,e={id:a.h++,language:f.language||_.xg,primary:f.ze,audio:b?h:null,video:c?h:null,bandwidth:e,drmInfos:f.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(e)},CR=function(a,b,c){var d=_.Wo;b.Aa=AR(a,c,b.Oa,null,null);var e=b.Aa.contentType===_.qj,f=GR(c),g=HR(c,e),h=g.kind,l=g.ze,m=g.roles;g=null;try{g=IR(c)}catch(E){return null}var n=
62
- d.$(c,"Accessibility"),p=JR(n),q=d.$(c,zP),t=lR(q,a.a.ignoreDrmInfo,b.Oa.id,a.a.playreadyVersion||null),u=c.getAttribute("lang")||_.xg;q=_.Dj(u);d=d.$(c,_.Cb);c=d.map(function(E){return KR(a,b,t,h,u,f||"",l,m,p,E)}).filter(_.bj);if(0===c.length){if(e)return null;throw new _.N(_.O,4,4003);}if(!b.Aa.contentType||b.Aa.contentType===_.Gc){b.Aa.contentType=LR(c[0].mimeType,c[0].codecs);e=_.v(c);for(var y=e.next();!y.done;y=e.next())y.value.type=b.Aa.contentType}e=_.v(c);for(y=e.next();!y.done;y=e.next()){y=
63
- y.value;for(var A=_.v(t.drmInfos),B=A.next();!B.done;B=A.next())B=B.value,y.keyId&&!B.keyIds.includes(y.keyId)&&B.keyIds.push(y.keyId)}c=MR(c,b.Aa.contentType,n);n=d.map(function(E){return E.getAttribute("id")}).filter(_.bj);return{id:b.Aa.id||"__fake__"+a.h++,contentType:b.Aa.contentType,language:q,originalLanguage:u,ze:l,streams:c,drmInfos:t.drmInfos,Xg:g,jo:n}},IR=function(a){var b=_.Wo.$(a,AP);a=null;b=_.v(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value;c=d.getAttribute(RP)||"";d=d.getAttribute(_.Eg);
64
- if(c!==LP&&!NR.includes(c)||void 0===d)throw new _.$i("Unrecognized essential property");c===LP&&(a=d.split(" "))}return a},HR=function(a,b){var c=!1,d=_.Wo.$(a,"Role"),e=d.map(function(l){return l.getAttribute(_.Eg)}).filter(_.bj),f=void 0;b&&(f=_.ig);d=_.v(d);for(var g=d.next();!g.done;g=d.next()){g=g.value;var h=g.getAttribute(RP);if(null==h||"urn:mpeg:dash:role:2011"===h||"urn:mpeg:dash:role"===h)switch(g=g.getAttribute(_.Eg),g){case _.Ge:c=!0;break;case _.dd:case _.ig:f=g;break;case "forced-subtitle":case "forced_subtitle":case _.ke:f=
65
- _.ke}}return{ze:c,roles:e,kind:f}},GR=function(a){var b=null,c=_.Wo.$(a,"Label").map(_.Wo.sa).filter(_.bj);c&&0<c.length&&(b=c[c.length-1]);null==b&&(b=a.getAttribute("label"));return b},JR=function(a){var b=new Map;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=d.getAttribute(RP);if("urn:scte:dash:cc:cea-608:2015"===c||"urn:scte:dash:cc:cea-708:2015"===c)if(c=1,d=d.getAttribute(_.Eg),null!=d){d=_.v(d.split(";"));for(var e=d.next();!e.done;e=d.next()){var f=e.value;f.includes("\x3d")?
66
- (f=f.split("\x3d"),e=f[0].startsWith("CC")?f[0]:"CC"+f[0],f=f[1].split(",")[0].split(":").pop()):(e="CC"+c,c+=2);b.set(e,_.Dj(f))}}else b.set("CC1",_.xg)}return b},MR=function(a,b,c){var d=b===_.ig?_.qj:b;b=c.map(function(f){return{scheme:f.getAttribute(RP)||"",id:f.getAttribute("id")||void 0,value:f.getAttribute(_.Eg)||"",protocol:"DASH",type:d}});c=_.v(a);for(var e=c.next();!e.done;e=c.next())e.value.accessibility=b;return a},KR=function(a,b,c,d,e,f,g,h,l,m){var n=_.Wo,p=_.Dj(e);b.O=AR(a,m,b.Aa,
67
- null,null);if(!OR(a,b.O))return a.g.warn("Skipping Representation",b.O),null;b.xc=b.Oa.id+" "+b.O.id;b.xe=a.G.get(b.xc);b.bandwidth=n.W(m,"bandwidth",kQ)||0;var q=PR(a,b);if(!q)return null;a.G.set(b.xc,q.Ha);var t=n.$(m,zP);a=mR(t,c,a.a.ignoreDrmInfo,b.Oa.id,a.a.playreadyVersion||null);t=!1;n.$(m,"SupplementalProperty").some(function(u){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===u.getAttribute(RP)&&"JOC"===u.getAttribute(_.Eg)})&&(b.O.mimeType="audio/eac3-joc",t=!0);m=QR(b,m);return{id:_.qL++,
68
- originalId:b.O.id,createSegmentIndex:q.createSegmentIndex,findSegmentPosition:q.findSegmentPosition,getSegmentReference:q.getSegmentReference,initSegmentReference:q.initSegmentReference,adjustSegmentDurations:q.adjustSegmentDurations,getLastSegmentEndTime:q.getLastSegmentEndTime,getDuration:q.getDuration,segmentLookupStrategy:_.kD,mimeType:b.O.mimeType,codecs:b.O.codecs,frameRate:b.O.frameRate,bandwidth:b.bandwidth,width:b.O.width,height:b.O.height,kind:d,encrypted:0<c.drmInfos.length,keyId:a,language:p,
69
- originalLanguage:e,label:f,type:b.Aa.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.O.emsgSchemeIdUris,roles:h,channelsCount:b.O.ug,spatialAudio:t,closedCaptions:l,horizontalTiles:m.horizontalTiles,verticalTiles:m.verticalTiles,durationPerTile:m.durationPerTile}},QR=function(a,b){var c={};if(a.O.contentType===_.te){var d=_.Wo.Ka(b,AP),e=d&&d.getAttribute(RP);if(RR.includes(e||"")&&(d=_.Ij(d.getAttribute(_.Eg)||""))&&(c.horizontalTiles=d.me,c.verticalTiles=d.Je,a.Aa.wc)){e=_.Wo.W(a.Aa.wc,
70
- KP,lQ)||0;var f=_.Wo.W(a.Aa.wc,TP,lQ)||1;if(e/=f)c.durationPerTile=e/d.Eo}}return c},PR=function(a,b){var c=b.O.contentType;c=c===_.qj||c===_.Gc;try{if(b.O.Fe){var d=Number(pQ(b,LQ,QP))||0,e=pQ(b,LQ,TP),f=1;e&&(f=kQ(e)||1);d=d/f||0;var g=JQ(b,LQ),h=b.O.mimeType.split("/")[1];if(b.O.contentType!==_.qj&&"mp4"!==h&&"webm"!==h)throw _.Qh("SegmentBase specifies an unsupported container type.",b.O),new _.N(_.O,4,4006);if("webm"===h&&!g)throw _.Qh(FP,"the SegmentBase uses a WebM container,","but does not contain an Initialization element.",
71
- b.O),new _.N(_.O,4,4005);var l=qQ(b,LQ,"RepresentationIndex"),m=pQ(b,LQ,"indexRange"),n=b.O.ma,p=iQ(m||"");if(l){var q=l.getAttribute("sourceURL");q&&(n=_.ND(b.O.ma,[q]));p=_.Wo.W(l,"range",iQ,p)}if(!p)throw _.Qh(FP,"the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",b.O),new _.N(_.O,4,4002);b.presentationTimeline.B=null;var t=KQ(b,g,n,p.start,p.end,h,d);var u={createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,
72
- adjustSegmentDurations:t.adjustSegmentDurations,getDuration:t.getDuration,initSegmentReference:g,getLastSegmentEndTime:t.getLastSegmentEndTime,Ha:d}}else u=b.O.vc?YQ(b,a.I):b.O.wc?SQ(b,a.I,!!a.f):SR(b);return u}catch(y){if(c&&4002===y.code)return a.g.debug("Ignoring DASH_NO_SEGMENT_INFO error in a text stream",y),null;throw y;}},SR=function(a){function b(){return d}var c=a.O.ma,d=a.Ga.duration||0;return{createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(e){return 0<=
73
- e&&e<d?1:null},getSegmentReference:function(e){return 1!==e?null:new _.Aj(1,0,d,function(){return c},0,null,0,null,null,null,null,null,null,null,null,function(){return""},a.O.Ra)},adjustSegmentDurations:function(){},getDuration:b,getLastSegmentEndTime:b,verticalTiles:void 0,horizontalTiles:void 0,initSegmentReference:null,Ha:0}},TR=function(a,b){0>a.l||a.B.ha(Math.max(3,a.l-b,_.tE(a.J)))},AR=function(a,b,c,d,e){var f=_.Wo;c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,
74
- ug:null,Ra:e?e.find(function(t){return t.id===xP})||null:null};d=d||c.ma;var g=f.$(b,xP),h=g.map(f.sa);e=e?uR(g,e,b.getAttribute("id")||void 0):null;g=b.getAttribute("contentType")||c.contentType;var l=b.getAttribute(_.Le)||c.mimeType,m=b.getAttribute(_.zd)||c.codecs,n=f.W(b,"frameRate",mQ)||c.frameRate,p=UR(f.$(b,"InbandEventStream"),c.emsgSchemeIdUris),q=f.$(b,"AudioChannelConfiguration");a=VR(a,q)||c.ug;g||(g=LR(l,m));return{ma:_.ND(d,h),Ra:e||c.Ra,Fe:f.Ka(b,"SegmentBase")||c.Fe,vc:f.Ka(b,"SegmentList")||
75
- c.vc,wc:f.Ka(b,"SegmentTemplate")||c.wc,width:f.W(b,_.Zg,lQ)||c.width,height:f.W(b,_.ne,lQ)||c.height,contentType:g,mimeType:l,codecs:m,frameRate:n,emsgSchemeIdUris:p,id:b.getAttribute("id")||"",ug:a}},UR=function(a,b){for(var c=b.slice(),d=_.v(a),e=d.next();!e.done;e=d.next())(e=e.value.getAttribute(RP))&&!c.includes(e)&&c.push(e);return c},VR=function(a,b){for(var c=_.v(b),d=c.next();!d.done;d=c.next()){var e=d.value;if(d=e.getAttribute(RP))if(e=e.getAttribute(_.Eg))switch(d){case "urn:mpeg:dash:outputChannelPositionList:2012":return e.trim().split(/ +/).length;
76
- case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":var f=parseInt(e,10);if(!f){a.g.warn(yP,d,e);continue}return f;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":f=parseInt(e,16);if(!f){a.g.warn(yP,d,e);continue}for(c=0;f;)f&1&&++c,f>>=1;return c;default:a.g.warn("Unrecognized audio channel scheme:",d,e)}}return null},OR=function(a,b){var c=b.Fe?1:0;c+=b.vc?1:0;c+=
77
- b.wc?1:0;if(0===c){if(b.contentType===_.qj||b.contentType===_.Gc)return!0;a.g.warn("Representation does not contain a segment information source:","the Representation must contain one of SegmentBase, SegmentList,",'SegmentTemplate, or explicitly indicate that it is "text".',b);return!1}1!==c&&(a.g.warn("Representation contains multiple segment information sources:","the Representation should only contain one of SegmentBase,","SegmentList, or SegmentTemplate.",b),b.Fe?(a.g.info("Using SegmentBase by default."),
78
- b.vc=null):a.g.info("Using SegmentList by default."),b.wc=null);return!0},BR=function(a,b,c,d){var e=_.Wo,f=d.getAttribute(RP)||"",g=d.getAttribute(_.Eg)||"",h=e.W(d,TP,lQ)||1,l=e.W(d,QP,lQ)||0,m=[],n={};d=_.v(e.$(d,"Event"));for(var p=d.next();!p.done;n={Yc:n.Yc},p=d.next()){p=p.value;var q=e.W(p,"presentationTime",lQ)||0,t=e.W(p,KP,lQ)||0;q=b+q/h-l/h;t=q+t/h;null!=c&&(q=Math.min(q,b+c),t=Math.min(t,b+c));var u=_.yg;f.startsWith(_.Ag)?u=_.Di:"urn:mpeg:dash:event:callback:2015"===f&&(u=_.Qe);n.Yc=
79
- {configurationId:a.C.configurationId,schemeIdUri:f,value:g,startTime:q,endTime:t,id:p.getAttribute("id")||"",type:u,eventElement:e.He(p)};n.Yc.type===_.Qe&&(n.Yc.wf=function(y){return function(){var A=y.Yc;A.eventElement&&(A=A.eventElement.getAttribute("messageData")||"")&&A.startsWith("http")&&(A=_.ik(A),A.type=_.hk,a.C.networkingEngine.fetch(A))}}(n));m.push(n.Yc)}return m},LR=function(a,b){return _.WF(_.rl(a,b))?_.qj:a.split("/")[0]},WR=function(a){var b=new Set;a.forEach(function(c){c.variants.forEach(function(d){d.audio&&
80
- b.add(d.audio);d.video&&b.add(d.video)})});return Array.from(b)},wR=function(a,b){var c=WR(a).filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});0<c.length&&(c=Math.min.apply(Math,_.hh(c)),_.DE(b.presentationTimeline,c+b.Ga.start))},YR=function(){};_.Jo.prototype.He=_.wD(20,function(a){return a});
81
- _.cE.prototype.He=_.wD(19,function(a){var b=this,c=Array.from(a.a.entries()).map(function(e){e=_.v(e);var f=e.next().value;return"xmlns:"+e.next().value+'\x3d"'+f+'"'}).join(" "),d=(new DOMParser).parseFromString('\x3c?xml version\x3d"1.0"?\x3e\x3c'+a.tagName+" "+(c+"/\x3e"),_.mg).childNodes[0];Object.keys(a.attributes).forEach(function(e){d.setAttribute(e,a.attributes[e])});a.childNodes.forEach(function(e){e.tagName===_.da?d.textContent+=e.textContent:d.appendChild(b.He(e))});return d});
82
- _.Jo.prototype.Ff=_.wD(18,function(a,b){Array.from(a.attributes).forEach(function(c){c.namespaceURI===b&&a.removeAttributeNS(c.namespaceURI,c.localName)})});_.cE.prototype.Ff=_.wD(17,function(a,b){var c=a.a.get(b);if(c){var d=c+":";Object.keys(a.attributes).forEach(function(e){e.startsWith(d)&&delete a.attributes[e]})}});_.Jo.prototype.nf=_.wD(16,function(a,b){for(var c=_.v(a.attributes),d=c.next();!d.done;d=c.next())d=d.value,b.setAttributeNS(d.namespaceURI,d.nodeName,d.value)});
83
- _.cE.prototype.nf=_.wD(15,function(a,b){Object.keys(a.attributes).forEach(function(c){b.attributes[c]=a.attributes[c]})});_.Jo.prototype.pf=_.wD(14,function(a,b){Array.from(a.childNodes).forEach(function(c){a.removeChild(c);b.appendChild(c)})});_.cE.prototype.pf=_.wD(13,function(a,b){b.childNodes.push.apply(b.childNodes,_.hh(a.childNodes));a.childNodes=[]});_.Jo.prototype.Ef=_.wD(12,function(a){Array.from(a.childNodes).forEach(function(b){a.removeChild(b)})});
84
- _.cE.prototype.Ef=_.wD(11,function(a){a.childNodes=[]});_.Jo.prototype.od=_.wD(10,function(){return document.createElement("null")});_.cE.prototype.od=_.wD(9,function(){return new _.$D("NULL",null,{},[],null,new Map)});_.Jo.prototype.ef=_.wD(8,function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})});_.cE.prototype.ef=_.wD(7,function(a){return a.childNodes});
85
- _.Jo.prototype.W=_.wD(6,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.cE.prototype.W=_.wD(5,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.Jo.prototype.Fc=_.wD(4,function(a,b,c){return Array.from(a.childNodes).filter(function(d){return d instanceof Element&&d.localName===c&&d.namespaceURI===b})});
86
- _.cE.prototype.Fc=_.wD(3,function(a,b,c){b=a.a.get(b);if(!b)return[];var d=b+":"+c;return a.childNodes.filter(function(e){return e.tagName===d})});_.Jo.prototype.ac=_.wD(2,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});_.cE.prototype.ac=_.wD(1,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});var RR=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],NR=["urn:mpeg:mpegB:cicp:ColourPrimaries","urn:mpeg:mpegB:cicp:MatrixCoefficients","urn:mpeg:mpegB:cicp:TransferCharacteristics"];var CQ=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];GQ.prototype.parse=function(a,b,c,d){b=new AQ(new DataView(b));if(440786851!==EQ(b).id)throw _.Qh("Not an EBML element."),new _.N(_.O,3,3008);var e=EQ(b);if(408125543!==e.id)throw _.Qh("Not a Segment element."),new _.N(_.O,3,3009);b=e.a.byteOffset;e=new AQ(e.a);for(var f=null;_.jn(e.a);){var g=EQ(e);if(357149030===g.id){f=g;break}}if(!f)throw _.Qh("Not an Info element."),new _.N(_.O,3,3010);f=new AQ(f.a);g=1E6;for(e=null;_.jn(f.a);){var h=EQ(f);if(2807729===h.id)g=FQ(h);else if(17545===h.id)if(4===
87
- h.a.byteLength)e=h.a.getFloat32(0);else if(8===h.a.byteLength)e=h.a.getFloat64(0);else throw new _.N(_.O,3,3003);}if(null==e)throw new _.N(_.O,3,3011);f=g/1E9;e*=f;a=EQ(new AQ(new DataView(a)));if(475249515!==a.id)throw _.Qh("Not a Cues element."),new _.N(_.O,3,3007);return IQ(a,b,f,e,c,d)};var dR=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",_.af).set(YP,_.Gd).set(XP,_.Ed).set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95",_.Ed).set("urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2",_.Cd).set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb",_.Bd),oR=(new Map).set(_.Gd,function(a){var b=nR(a);if(b)return{licenseUrl:b,origin:_.jD};if(a=_.Wo.ac(a.node,"urn:microsoft","laurl"))if(a=a.getAttribute("licenseUrl"))return{licenseUrl:a,origin:"ms:laurl"};return null}).set(_.Ed,function(a){var b=
88
- _.Wo,c=nR(a);if(c)return{licenseUrl:c,origin:_.jD};a=b.ac(a.node,UP,"pro");if(!a)return null;b=b.sa(a);if(!b)return null;b=_.Qm(b);return(b=_.ap(b).h)?{licenseUrl:b,origin:"mspr:pro"}:null}),fR=new _.J("clpp.dash.ContentProtection");_.r=qR.prototype;_.r.configure=function(a){this.a=a;this.K.a={clockSyncUri:a.clockSyncUri}};_.r.start=function(a,b){var c=this,d;return _.H(function(e){if(1==e.a)return c.o=[a],c.C=b,_.x(e,sR(c),2);d=e.f;c.C&&TR(c,d);if(!c.C)throw new _.N(_.O,7,7001);return e["return"](c.f)})};_.r.requestStop=function(){this.L=!0};_.r.stop=function(){this.a=this.C=null;this.o=[];this.f=null;this.H=[];this.I={};this.F=null;this.l=-1;this.B.stop();this.G.clear();this.j.clear();return this.A.destroy()};
89
- _.r.update=function(){var a=this;sR(this)["catch"](function(b){if(a.C&&b)a.C.onError(b)})};_.r.setCurrentVariant=function(){};_.r.hc=function(){var a=this,b,c,d;return _.H(function(e){switch(e.a){case 1:return a.g.debug(_.bD),b=0,_.D(e,2),_.x(e,sR(a),4);case 4:b=e.f;_.vh(e,3);break;case 2:if(c=_.F(e),a.C&&c.a&&(a.C.onError(c),d=c,d.severity===_.O))return e["return"]();case 3:if(!a.C)return e["return"]();if(!a.L){e.D(5);break}return _.x(e,a.stop(),6);case 6:return e["return"]();case 5:TR(a,b),_.z(e)}})};
90
- _.r.loadVariant=function(a){return _.H(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.H(function(f){(e=c.f.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.$i(_.SC+a);return f["return"](d)})};_.w(YR,_.Fu);YR.prototype.f=function(){_.hv.mpd=qR;_.fv[_.Ic]=qR};YR.prototype.a=function(){_.wF("mpd");_.xF(_.Ic)};YR.prototype.id=function(){return"dash"};_.I("clpp.dash.DashComponent",YR);};
2
+ var f=function(window){var FM="\x3cms:pro/\x3e lacks content",GM="BaseURL",HM="Channel parsing failure! Ignoring scheme and value",IM="ContentProtection",JM="EssentialProperty",KM="Failed to parse UTCTiming tags.",LM="Location",MM="Missing \x3cms:pro/\x3e node in ContentProtection element",NM="No UTCTiming elements found.",OM="SegmentBase does not contain sufficient segment information:",PM="SegmentList does not contain sufficient segment information:",QM="SegmentTemplate does not contain sufficient segment information:",
3
+ RM="SegmentTimeline",SM='The last "S" element cannot have a negative repeat',TM="duration",UM="http://dashif.org/guidelines/trickmode",VM="http://www.w3.org/1999/xlink",WM='ignoring the last "S" element.',XM='ignoring the remaining "S" elements.',YM="parse.xml",ZM="presentationTimeOffset",$M="schemeIdUri",aN="static",bN="timescale",cN="urn:microsoft:playready",dN="urn:mpeg:cenc:2013",eN="urn:mpeg:dash:utc:http-head:2014",fN="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",gN="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
4
+ hN=function(a,b,c){try{var d=a(b);if(d&&d.T&&d.abort)return c.resolve(d.T),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){})["catch"](function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}},iN=function(a,b,c){function d(){e.reject(new _.N(_.O,7,7001));return a.abort()}var e=new _.am;a.T.then(function(f){a.a?e.reject(new _.N(_.O,7,7001)):b?d=hN(b,f,e):e.resolve(f)},function(f){c?d=hN(c,f,e):e.reject(f)});return new _.Jm(e,
5
+ function(){return d()})},jN=function(a,b){a.H=Math.max(a.H,b);a.g.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+a.H)},kN=function(a){return new _.Jm(Promise.reject(a),function(){return Promise.resolve()})},lN=function(a){return new _.Jm(Promise.all(a.map(function(b){return b.T})),function(){return Promise.all(a.map(function(b){return b.abort()}))})},mN=function(a,b){return a.reduce(function(c,d,e){return d["catch"](c.bind(null,e))}.bind(null,b),Promise.reject())},nN=function(a){return a===
6
+ _.Nc||a===_.Mg},oN=function(a){var b=void 0===b?1024:b;if(!(a instanceof Uint8Array))return"";if(typeof b!==_.k||0>=b)b=1024;return(a.byteLength>b?a.subarray(0,b):a).toString()},pN=function(a){return 1>=a?0:Math.floor(Math.random()*a)},qN=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)},rN=function(a){if(!a)return null;var b=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);
7
+ if(!b)return _.Lh("Invalid duration string:",a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},sN=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null},tN=function(a){a=Number(a);return 0===a%1?a:null},uN=function(a){a=Number(a);return 0===a%1&&0<a?a:null},vN=function(a){a=
8
+ Number(a);return 0===a%1&&0<=a?a:null},wN=function(a){var b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:a},xN=function(a){return a?"true"===a.toLowerCase():!1},yN=function(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(g,h,l,m){if("$$"===g)return"$";var n=f[h];if(null==n)return _.Lh("URL template does not have an available substitution ",
9
+ "for identifier",'"'+h+'":',a),g;"RepresentationID"===h&&l&&(_.Lh("URL template should not contain a width specifier for identifier",'"RepresentationID":',a),l=void 0);"Time"===h&&(n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":g=n.toString();break;case "o":g=n.toString(8);break;case "x":g=n.toString(16);break;case "X":g=n.toString(16).toUpperCase();break;default:g=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-g.length)+1).join("0")+g})},BN=function(a,b){var c=
10
+ zN(a,b,bN),d=1;c&&(d=uN(c)||1);c=zN(a,b,TM);(c=uN(c||""))&&(c/=d);var e=Number(zN(a,b,ZM))||0,f=e/d||0;a.ym&&null!=a.se&&a.se!==f&&(_.Lh("The stream is non-compliant with the DASH spec. The value of `presentationTimeOffset` has changed during the transition from dynamic to static manifest, which is not allowed. The last value will be ignored. (Period ID: "+(a.Ma.id+", Representation ID: ")+(a.N.id+")")),e=a.se*d,f=a.se);var g=zN(a,b,"startNumber"),h=vN(g||"");if(null==g||null==h)h=1;g=zN(a,b,"endNumber");
11
+ g=null!==g?vN(g||""):null;var l=AN(a,b,RM),m=null;if(l){m=d;var n=e,p=a.Ea.duration||Infinity,q=_.Cr;l=q.aa(l,"S");for(var t=[],u=0,y=0;y<l.length;++y){var B=l[y],A=q.W(B,"t",vN),C=q.W(B,"d",vN),E=q.W(B,"r",tN);null!=A&&(A-=n);if(!C){_.Lh('"S" element must have a duration:',XM,B);break}A=null!=A?A:u;E=E||0;if(0>E)if(y+1<l.length){E=q.W(l[y+1],"t",vN);if(null==E){_.Lh('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:',XM,B);break}else if(A>=E){_.Lh('An "S" element cannot have a negative repeat if its start ',
12
+ 'time exceeds the next "S" element\'s start time:',XM,B);break}E=Math.ceil((E-A)/C)-1}else{if(Infinity===p){_.Lh(SM,"if the Period has an infinite duration:",WM,B);break}else if(A/m>=p){_.Lh(SM,"if its start time exceeds the Period's duration:",WM,B);break}E=Math.ceil((p*m-A)/C)-1}0<t.length&&A!==u&&(Math.abs((A-u)/m)>=_.bw&&_.Lh("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",B),t[t.length-1].end=A/m);for(B=0;B<=E;++B)u=A+C,t.push({start:A/m,end:u/m,Ko:A}),A=
13
+ u}m=t}n=zN(a,b,"availabilityTimeOffset");p=Number(n||"");p=isNaN(p)?null:p;if(null==n||null==p)p=0;return{timescale:d,Na:c,Rc:h,ig:g,Sb:f,Xg:e,timeline:m,Xf:p}},zN=function(a,b,c){return[b(a.N),b(a.za),b(a.Ma)].filter(_.jn).map(function(d){return d.getAttribute(c)}).reduce(function(d,e){return d||e})},AN=function(a,b,c){return[b(a.N),b(a.za),b(a.Ma)].filter(_.jn).map(function(d){return _.Cr.Ja(d,c)}).reduce(function(d,e){return d||e})},DN=function(a,b,c,d,e,f){var g=_.Cr,h=g.getAttributeNS(a,VM,"href"),
14
+ l=g.getAttributeNS(a,VM,"actuate")||"onRequest";g.Cf(a,VM);if(5<=f)return kN(new _.N(_.O,4,4028));if("onLoad"!==l)return kN(new _.N(_.O,4,4027));var m=_.tC([d],[h]);d=_.Mk(m,b);d.type=1;return iN(e.fetch(d),function(n){n=_.R.ea(n.data);n=g.we(n,a.tagName);if(!n)return kN(new _.N(_.O,4,4001,{uri:h}));g.Bf(a);g.lf(n,a);g.kf(n,a);return CN(a,b,c,m[0],e,f+1)})},CN=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=_.Cr;if(g.getAttributeNS(a,VM,"href"))return g=DN(a,b,c,d,e,f),c&&(g=iN(g,void 0,function(){return CN(a,
15
+ b,c,d,e,f)})),g;var h=[],l=g.bf(a);l=_.v(l);for(var m=l.next();!m.done;m=l.next())m=m.value,"urn:mpeg:dash:resolve-to-zero:2013"===g.getAttributeNS(m,VM,"href")?g.removeChild(a,m):m.tagName!==RM&&h.push(CN(m,b,c,d,e,f));return iN(lN(h),function(){return a})},EN=function(a,b,c){var d=a.Ea.duration,e=a.Ea.zi;if(!a.hg)return e=new _.HD(b),_.YC(e,d),e;var f=a.Ma;var g=a.N;f=f&&f.id&&g&&g.id?f.id+","+g.id:null;if(!a.Di||null==c[f])return a=new _.HD(b),e||_.YC(a,d),c[f]=a;c=c[f];e||_.YC(new _.HD(b),d);
16
+ c.ua(b);_.JD(c,_.uD(a.presentationTimeline)-a.Ea.start);return c},FN=function(a,b){var c=a.presentationTimeline,d=_.jh(b.a).concat();c.l||0===d.length||(c.J=Math.floor(Math.max(c.J||0,d[d.length-1].endTime+a.Ea.start)));a.Di||_.rD(a.presentationTimeline,_.jh(b.a).concat(),a.Ea.start)},GN=function(a){return""===a.id?a.schemeIdUri+":"+a.startTime+":"+a.endTime:a.id},HN=function(a,b,c,d,e){var f,g,h;return _.I(function(l){if(1==l.a)return f=_.cD(a,b,c,e),f.type=2,g=_.Tm(d,f,{objectType:"i"}),_.x(l,g.T,
17
+ 2);h=l.f;return l["return"](h.data)})},JN=function(a,b,c,d){var e,f=(new _.fq).ba("sidx",function(h){e=IN(b,d,c,h)});a&&f.parse(a);if(e)return e;f=b+"-"+(b+a.byteLength-1);var g=c[0];a=_.Mi(a);_.Rh('Invalid box type. Expected "sidx", but received:',a,"from:",g,"byte range:",f);throw new _.N(_.O,3,3004,{url:g,jp:f,size:a.byteLength,Dp:oN(a)});},IN=function(a,b,c,d){var e=[];d.reader.skip(4);var f=_.aq(d.reader);if(0===f)throw _.Rh("Invalid timescale."),new _.N(_.O,3,3005);if(0===d.version){var g=_.aq(d.reader);
18
+ var h=_.aq(d.reader)}else g=_.cq(d.reader),h=_.cq(d.reader);d.reader.skip(2);var l=_.$p(d.reader);a=a+d.size+h;for(h=0;h<l;h++){var m=_.aq(d.reader),n=(m&2147483648)>>>31;m&=2147483647;var p=_.aq(d.reader);d.reader.skip(4);if(1===n)throw _.Rh("Hierarchical SIDXs are not supported."),new _.N(_.O,3,3006);e.push(new _.Jp(e.length,g/f-b,(g+p)/f-b,function(){return c},a,a+m-1,b));g+=p;a+=m}d.parser.stop();return e},KN=function(a){this.f=a;this.a=new _.Wp(a,!1)},ON=function(a){var b=LN(a);if(7<b.length)throw new _.N(_.O,
19
+ 3,3002);for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=LN(a);a:{d=_.v(MN);for(var e=d.next();!e.done;e=d.next())if(_.Fm(c,new Uint8Array(e.value))){d=!0;break a}d=!1}if(d)c=a.f.byteLength-a.a.getPosition();else{if(8===c.length&&c[1]&224)throw new _.N(_.O,3,3001);d=c[0]&(1<<8-c.length)-1;for(e=1;e<c.length;e++)d=256*d+c[e];c=d}c=a.a.getPosition()+c<=a.f.byteLength?c:a.f.byteLength-a.a.getPosition();d=new DataView(a.f.buffer,a.f.byteOffset+a.a.getPosition(),c);a.a.skip(c);return new NN(b,d)},LN=
20
+ function(a){var b=_.Zp(a.a),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new _.N(_.O,3,3002);var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=_.Zp(a.a);return d},NN=function(a,b){this.id=a;this.a=b},PN=function(a){if(8<a.a.byteLength)throw new _.N(_.O,3,3002);if(8===a.a.byteLength&&a.a.getUint8(0)&224)throw new _.N(_.O,3,3001);for(var b=0,c=0;c<a.a.byteLength;c++){var d=a.a.getUint8(c);b=256*b+d}return b},QN=function(){},SN=function(a,b,c,d,e,f){function g(){return e}var h=[];a=new KN(a.a);for(var l=
21
+ null,m=null;_.Xp(a.a);){var n=ON(a);if(187===n.id){var p=RN(n);p&&(n=c*p.Lo,p=b+p.co,null!=l&&h.push(new _.Jp(h.length,l-f,n-f,g,m,p-1,f)),l=n,m=p)}}null!=l&&h.push(new _.Jp(h.length,l-f,d-f,g,m,null,f));return h},RN=function(a){var b=new KN(a.a);a=ON(b);if(179!==a.id)throw _.Lh("Not a CueTime element."),new _.N(_.O,3,3013);a=PN(a);b=ON(b);if(183!==b.id)throw _.Lh("Not a CueTrackPositions element."),new _.N(_.O,3,3012);b=new KN(b.a);for(var c=0;_.Xp(b.a);){var d=ON(b);if(241===d.id){c=PN(d);break}}return{Lo:a,
22
+ co:c}},TN=function(a,b){function c(){return""}var d=AN(a,b,"Initialization");if(!d)return null;var e=a.N.ma,f=d.getAttribute("sourceURL")||void 0;f&&(e=_.tC(a.N.ma,[f]),c=function(){return f});var g=0,h=null;if(d=_.Cr.W(d,"range",sN))g=d.start,h=d.end;return new _.HC(function(){return e},g,h,null,null,c,a.N.Pa)},UN=function(a,b,c,d,e,f,g){var h=a.presentationTimeline,l=!a.hg||!a.Ea.zi,m=a.Ea.start,n=a.Ea.duration,p=null;return{createSegmentIndex:function(q,t){var u,y,B,A,C,E,D;return _.I(function(J){if(1==
23
+ J.a)return u=[HN(c,d,e,q,t),"webm"===f?HN(b.Ka(),b.la,b.ga,q,t):null],_.x(J,Promise.all(u),2);y=J.f;B=y[0];A=y[1]||null;C=null;"mp4"===f?C=JN(B,d,c,g):(E=new QN,C=E.parse(B,A,c,g));(D=nN(a.N.contentType))&&_.rD(h,C,m);p=new _.HD(C);l&&_.YC(p,n);return J["return"](y)})},findSegmentPosition:function(q){return p.hd(q)},getSegmentReference:function(q){return p.get(q)},adjustSegmentDurations:function(q,t){return p.Hd(q,t)},getDuration:function(){return null!=n?n:p.getDuration()},getLastSegmentEndTime:function(){return n}}},
24
+ VN=function(a){return a.ye},bO=function(a,b,c){var d=WN(a),e=XN(a);YN(a,e);var f=nN(a.N.contentType),g=null;if(e.me)f&&(a.presentationTimeline.B=null),g=ZN(a,d,e);else if(e.Na)!c&&f&&(a.presentationTimeline.B=null,jN(a.presentationTimeline,e.Xf),_.sD(a.presentationTimeline,e.Na),_.pD(a.presentationTimeline,a.Ea.start)),g=$N(a,e);else{c=aO(a,e);var h=EN(a,c,b);f&&FN(a,h);g={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:h.hd.bind(h),getSegmentReference:h.get.bind(h),adjustSegmentDurations:h.Hd.bind(h),
25
+ getDuration:h.getDuration.bind(h),getLastSegmentEndTime:function(){return _.ID(h)}}}return{createSegmentIndex:g.createSegmentIndex,findSegmentPosition:g.findSegmentPosition,getSegmentReference:g.getSegmentReference,adjustSegmentDurations:g.adjustSegmentDurations,getDuration:g.getDuration,initSegmentReference:d,getLastSegmentEndTime:g.getLastSegmentEndTime,Fa:e.Sb}},cO=function(a){return a.wc},XN=function(a){var b=BN(a,cO),c=zN(a,cO,"media");a=zN(a,cO,"index");return{Na:b.Na,timescale:b.timescale,
26
+ Rc:b.Rc,ig:b.ig,Sb:b.Sb,Xg:b.Xg,timeline:b.timeline,rg:c,me:a,Xf:b.Xf}},YN=function(a,b){var c=b.me?1:0;c+=b.timeline?1:0;c+=b.Na?1:0;if(0===c)throw _.Rh("SegmentTemplate does not contain any segment information:","the SegmentTemplate must contain either an index URL template","a SegmentTimeline, or a segment duration.",a.N),new _.N(_.O,4,4002);1!==c&&(_.Lh("SegmentTemplate contains multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",
27
+ a.N),b.me?(_.Ph("Using the index URL template by default."),b.timeline=null):_.Ph("Using the SegmentTimeline by default."),b.Na=null);if(!b.me&&!b.rg)throw _.Rh(QM,"the SegmentTemplate's media URL template is missing.",a.N),new _.N(_.O,4,4002);},ZN=function(a,b,c){var d=a.N.mimeType.split("/")[1];if("mp4"!==d&&"webm"!==d)throw _.Rh("SegmentTemplate specifies an unsupported container type.",a.N),new _.N(_.O,4,4006);if("webm"===d&&!b)throw _.Rh(QM,"the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",
28
+ a.N),new _.N(_.O,4,4005);var e=yN(c.me,a.N.id,null,a.bandwidth||null,null);e=_.tC(a.N.ma,[e]);return UN(a,b,e,0,null,d,c.Sb)},$N=function(a,b){var c=b.rg,d=a.Ea.duration,e=b.Na,f=b.Rc,g=b.ig,h=b.timescale,l=a.bandwidth||null,m=a.N.id,n=a.N.ma,p=a.N.Pa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(q){return 0>q||d&&q>=d?null:Math.floor(q/e)},getSegmentReference:function(q){function t(){return yN(c,m,u,l,y*h)}var u=q+f;if(null!==g&&u>g)return null;var y=q*e,B=
29
+ y+e;d&&(B=Math.min(B,d));return 0>B||d&&y>=d?null:new _.Jp(q,y,B,function(){var A=t();return _.tC(n,[A])},0,null,b.Sb,null,null,null,null,null,null,null,null,t,p)},adjustSegmentDurations:function(){},getDuration:function(){return d},getLastSegmentEndTime:function(){return d}}},aO=function(a,b){var c=b.rg,d=b.timeline;if(0===d.length)return[];for(var e=[],f=a.N.id,g=a.bandwidth||null,h=a.N.ma,l=a.N.Pa,m={},n=0;n<d.length;m={Ne:m.Ne,Sf:m.Sf,Fe:m.Fe},n++)m.Ne=n+b.Rc,m.Sf=d[n].Ko+b.Xg,m.Fe=function(p){return function(){return yN(c,
30
+ f,p.Ne,g,p.Sf)}}(m),e.push(new _.Jp(m.Ne,d[n].start,d[n].end,function(p){return function(){var q=p.Fe();return _.tC(h,[q])}}(m),0,null,b.Sb,null,null,null,null,null,null,null,null,m.Fe,l));return e},WN=function(a){function b(){return yN(c,d,null,e,null)}var c=zN(a,cO,"initialization");if(!c)return null;var d=a.N.id,e=a.bandwidth||null,f=a.N.ma;return new _.HC(function(){var g=b();return _.tC(f,[g])},0,null,null,null,b,a.N.Pa)},hO=function(a,b){var c=TN(a,dO),d=eO(a);fO(a,d);var e=gO(a.Ea.duration,
31
+ d.Rc,a.N.ma,a.N.Pa,d),f=EN(a,e,b);nN(a.N.contentType)&&FN(a,f);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:f.hd.bind(f),getSegmentReference:f.get.bind(f),adjustSegmentDurations:f.Hd.bind(f),getDuration:f.getDuration.bind(f),initSegmentReference:c,getLastSegmentEndTime:function(){return _.ID(f)},Fa:d.Sb}},dO=function(a){return a.vc},eO=function(a){var b=iO(a);a=BN(a,dO);var c=a.Rc;0===c&&(_.Lh("SegmentList@startNumber must be \x3e 0"),c=1);var d=0;a.Na?d=a.Na*(c-1):
32
+ a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{Na:a.Na,startTime:d,Rc:c,Sb:a.Sb,timeline:a.timeline,Nc:b}},fO=function(a,b){if(!b.Na&&!b.timeline&&1<b.Nc.length)throw _.Lh(PM,"the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.N),new _.N(_.O,4,4002);if(!b.Na&&!a.Ea.duration&&!b.timeline&&1===b.Nc.length)throw _.Lh(PM,"the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",
33
+ a.N),new _.N(_.O,4,4002);if(b.timeline&&0===b.timeline.length)throw _.Lh(PM,"the SegmentList has an empty timeline.",a.N),new _.N(_.O,4,4002);},gO=function(a,b,c,d,e){var f=e.Nc.length;e.timeline&&e.timeline.length!==e.Nc.length&&(f=Math.min(e.timeline.length,e.Nc.length),_.Lh("The number of items in the segment timeline and the number of","segment URLs do not match, truncating",e.Nc.length,"to",f));for(var g=[],h=e.startTime,l={},m=0;m<f;l={Pf:l.Pf,Zc:l.Zc},m++){l.Zc=e.Nc[m];l.Pf=_.tC(c,[l.Zc.Fi]);
34
+ var n=void 0;n=null!=e.Na?h+e.Na:e.timeline?e.timeline[m].end:h+a;g.push(new _.Jp(m+b,h,n,function(p){return function(){return p.Pf}}(l),l.Zc.start,l.Zc.end,e.Sb,null,null,null,null,null,null,null,null,function(p){return function(){return p.Zc.Fi}}(l),d));h=n}return g},iO=function(a){return[a.N.vc,a.za.vc,a.Ma.vc].filter(_.jn).map(function(b){return _.Cr.aa(b,"SegmentURL")}).reduce(function(b,c){return 0<b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.ng&&(a.ng=!0,_.Lh("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));
35
+ var c=b.getAttribute("media");b=_.Cr.W(b,"mediaRange",sN,{start:0,end:null});return{Fi:c,start:b.start,end:b.end}})},jO=function(a,b){this.g=a;this.f=b;this.a={clockSyncUri:void 0}},lO=function(a,b,c,d){var e,f;return _.I(function(g){switch(g.a){case 1:return e=_.Cr.aa(b,"UTCTiming"),_.F(g,2),_.x(g,kO(a,c,e),4);case 4:f=g.f;d.I=f;a.g.info("Clock synchronized. The difference between server and client clock was "+(f+" ms."));_.G(g,3);break;case 2:_.H(g),a.g.warn("Failed to synchronize clocks. This content may not play on clients with bad clocks!");
36
+ case 3:return g["return"](d)}})},kO=function(a,b,c){c=c.map(function(e){return{scheme:e.getAttribute($M),value:e.getAttribute(_.Ig)}});var d=a.a.clockSyncUri;!c.length&&d&&(a.g.info("No UTCTiming elements found, falling back on clockSyncUri from config to synchronize clocks."),c.push({scheme:eN,value:d}));return 0===c.length?(a.g.warn(NM),Promise.reject(Error(NM))):mN(c,function(e){var f=e.scheme;e=e.value;switch(f){case eN:case "urn:mpeg:dash:utc:http-head:2012":return mO(a,b,e,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return mO(a,
37
+ b,e,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":var g=Date.parse(e);return isNaN(g)?(a.g.warn("Invalid date for scheme "+f+", value: "+e),Promise.reject()):Promise.resolve(g-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return a.g.warn("NTP UTCTiming scheme is not supported"),Promise.reject();default:return a.g.warn("Unrecognized scheme in UTCTiming element",f),Promise.reject()}})["catch"](function(){a.g.warn(KM);
38
+ return Promise.reject(Error(KM))})},mO=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=_.tC(b,[c]),_.x(l,a.f(e,d),2);f=l.f;if("HEAD"===d){if(!f.headers||!f.headers.date)throw a.g.warn("UTC timing response is missing","expected date header"),Error("Date HTTP header missing.");g=f.headers.date}else g=_.R.ea(f.data);h=Date.parse(g);if(isNaN(h))throw a.g.warn("Unable to parse date from UTC timing response"),Error("Date value invalid.");return l["return"](h-Date.now())})},oO=function(a,
39
+ b){return a.find(function(c){return nO.get(c.fc)===b})},qO=function(a){var b=_.Cr,c=b.Xb(a.node,cN,"pro");if(!c)return pO.warn(MM,a),null;c=b.sa(c);if(!c)return pO.warn(FM,a),null;a=_.Cm(c);a=_.Hr(a);a=_.zr(a.a);return{keyId:null,fc:gN,node:b.jd(),init:[{initData:_.hC(a),initDataType:_.fd,keyId:null}]}},rO=function(a,b){b=void 0===b?"4.0.0.0":b;var c=_.Cr,d=c.Xb(a.node,dN,"pssh");if(!d)return null;d=c.sa(d);if(!d)return null;d=_.Cm(d);d=_.Ar(d);return d?(d=_.iC(b,d.a))?{keyId:null,fc:fN,node:c.jd(),
40
+ init:[{initData:_.hC(d),initDataType:_.fd,keyId:null}]}:null:(_.Lh("Unable to parse WV PSSH data. Can not create PR data!"),null)},sO=function(a,b){var c=_.Cr,d=c.Xb(a.node,cN,"pro");if(!d)return _.Lh(MM,a),null;d=c.sa(d);if(!d)return _.Lh(FM,a),null;d=_.Cm(d);d=_.Hr(d);return d.version!==b&&(_.Qh("Parsing from "+d.version+" to "+b+"."),d=_.jC(d,b))?{keyId:null,fc:fN,node:c.jd(),init:[{initData:_.hC(d),initDataType:_.fd,keyId:null}]}:null},vO=function(a,b,c,d){var e=tO(a),f=null;a=[];var g=[],h=oO(e,
41
+ _.Fd),l=oO(e,_.Dd);if(l&&d){var m=sO(l,d);m&&(e[e.indexOf(l)]=m)}l&&!h&&(m=qO(l))&&e.push(m);h&&!l&&(d=rO(h,d||void 0))&&e.push(d);d=new Set(e.map(function(n){return n.keyId}));d["delete"](null);if(1<d.size)throw new _.N(_.O,4,4010);b||(g=e.filter(function(n){return"urn:mpeg:dash:mp4protection:2011"===n.fc?(f=n.init||f,!1):!0}),g.length&&(a=uO(f,g,c),0===a.length&&(a=[_.uC(_.Re,f,c)])));if(e.length&&(b||!g.length))for(a=[],b=_.v(nO.values()),e=b.next();!e.done;e=b.next())e=e.value,e!==_.af&&a.push(_.uC(e,
42
+ f,c));if(c=Array.from(d)[0]||null)for(b=_.v(a),e=b.next();!e.done;e=b.next())for(e=_.v(e.value.initData),g=e.next();!g.done;g=e.next())g.value.keyId=c;return{Td:c,op:f,drmInfos:a,Yh:!0}},wO=function(a,b,c,d,e){var f=vO(a,c,d,e);if(b.Yh){a=1===b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0===f.drmInfos.length;if(0===b.drmInfos.length||a&&!c)b.drmInfos=f.drmInfos;b.Td=f.Td||b.Td;b.Yh=!1}else if(0<f.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(g){return f.drmInfos.some(function(h){return h.keySystem===
43
+ g.keySystem})}),0===b.drmInfos.length))throw new _.N(_.O,4,4008);return f.Td||b.Td},xO=function(a){var b=_.Cr;a=b.Fc(a.node,"https://dashif.org/CPS","Laurl").map(function(c){return b.sa(c)}).filter(Boolean);return 0===a.length?null:1===a.length?a[0]:a[pN(a.length)]},uO=function(a,b,c){var d=[];b=_.v(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value,g=nO.get(f.fc);if(g){e=_.uC(g,f.init||a,c);if(g=yO.get(g))(f=g(f))?(e.licenseServerUri=f.licenseUrl,e.licenseServerUriOrigin=f.origin):e.licenseServerUri=
44
+ "";d.push(e)}}return d},tO=function(a){var b=[];a=_.v(a);for(var c=a.next();!c.done;c=a.next())(c=zO(c.value))&&b.push(c);return b},zO=function(a){var b=_.Cr,c=a.getAttribute($M),d=b.getAttributeNS(a,dN,"default_KID"),e=b.Fc(a,dN,"pssh").map(b.sa),f=b.Xb(a,cN,"pro");if(!c)return _.Rh("Missing required schemeIdUri attribute on","ContentProtection element",a),null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new _.N(_.O,4,4009);var g=[];try{if(g=e.map(function(n){return{initDataType:_.fd,
45
+ initData:_.Cm(n),keyId:null}}),0===g.length&&f&&b.sa(f))try{var h=b.sa(f),l=_.Cm(h),m=_.Hr(l);g.push({initDataType:_.fd,initData:_.hC(m),keyId:null})}catch(n){_.Lh("Unable to parse ms:pro payload",n),g=[]}}catch(n){throw new _.N(_.O,4,4007);}return{node:a,fc:c,keyId:d,init:0<g.length?g:null}},AO=function(){var a=this;this.D=this.a=null;this.o=[];this.f=null;this.H=[];this.h=1;this.I={};this.l=0;this.J=new _.$C(5);this.B=new _.dj(function(){a.dc()});this.A=new _.Yl;this.j=new Map;this.g=new _.L("clpp.dash.DashParser");
46
+ this.F=null;this.K=new jO(this.g,function(b,c){var d=_.Mk(b,a.a.attemptParameters);d.type=5;d.method=c;d=a.D.networkingEngine.fetch(d);_.$l(a.A,d);return d.T});this.G=new Map;this.L=!1;this.w=null},CO=function(a){var b,c,d,e,f,g,h,l,m,n,p,q;return _.I(function(t){switch(t.a){case 1:b=a.w?a.w.getBaseUriCollectionById(LM):null;var u=[];b&&(u=_.oE(b,""));0===u.length&&(u=a.o);c=u;d=_.Mk(c,a.a.attemptParameters);d.type=1;e=a.D.networkingEngine;f=Date.now();g=e.fetch(d);_.$l(a.A,g);return _.x(t,g.T,2);
47
+ case 2:h=t.f;if(!a.D)return t["return"](0);b||h.uri&&!a.o.includes(h.uri)&&a.o.unshift(h.uri);l=null!=a.f;return _.x(t,BO(a,h.data,h.uri),3);case 3:m=t.f;if(!m.manifest.contentSteering){t.C(4);break}n=a;return _.x(t,a.D.onContentSteeringInfoFound(m.manifest.contentSteering),5);case 5:n.w=t.f;case 4:if(a.w&&b){0!==h.request.uriIndex&&a.w.banLocation(b.ma[0].serviceLocationId);u=h.request;var y=h.timeMs,B=h.data.byteLength;y&&B&&a.w.notifyThroughput(b.ma[u.uriIndex].serviceLocationId,y,B)}p=Date.now();
48
+ q=(p-f)/1E3;_.aD(a.J,1,q);if(l&&a.D.onUpdate)a.D.onUpdate(m.manifest);if(m.Io){if(a.D.onTurnedStatic)a.D.onTurnedStatic();a.D.onEvent(new _.Q(_.Pe))}return t["return"](q)}})},BO=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a){d=_.R.ea(b);_.Ym(YM);e=_.Cr.we(d,"MPD");_.Ym("parse.xml.end");_.$m(YM,YM,"parse.xml.end");if(!e)throw new _.N(_.O,4,4001,c);f=a.a.xlinkFailGracefully;g=CN(e,a.a.attemptParameters,f,c,a.D.networkingEngine);_.$l(a.A,g);return _.x(l,g.T,2)}h=l.f;return l["return"](DO(a,
49
+ h,c))})},EO=function(a,b,c){if(a.length){c=c||"__clpp_baseUriCollection_\n "+b.length;var d=[];a.forEach(function(e){var f=e.getAttribute("serviceLocation");e=_.Cr.sa(e);f&&e&&d.push({serviceLocationId:f,uri:e,params:{}})});if(d.length)return a=new _.nE(c,d),b.push(a),a}return null},DO=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C,E,D,J,P,U;return _.I(function(V){if(1==V.a){d=_.Cr;e=[];f=[c];g=d.aa(b,LM);h=g.map(d.sa).filter(_.jn);0<h.length&&(l=_.tC(f,h),f=a.o=l,EO(g,e,LM));m=d.aa(b,
50
+ GM);n=m.map(d.sa);p=_.tC(f,n);EO(m,e,GM);q=b.getAttribute("type")||aN;a.l=d.W(b,"minimumUpdatePeriod",rN,-1);q===aN&&0<=a.l&&(a.g.warn("Invalid manifest - a static manifest should not contain the `minimumUpdatePeriod` attribute. The attribute will be ignored."),a.l=-1,a.B.stop());t=d.W(b,"maxSegmentDuration",rN);if(u=q===aN&&"dynamic"===a.F)a.g.info("MPD dynamic to static transition."),q="dynamic";y=q===aN;B="dynamic"===q;if(a.f)var ra=a.f.presentationTimeline;else{var Da=_.Cr;ra=a.a.timeline||{};
51
+ var wa=Da.W(b,"suggestedPresentationDelay",rN),Ea=Da.W(b,"minBufferTime",rN,0);wa=null!=a.a.suggestedPresentationDelay?a.a.suggestedPresentationDelay:a.a.lowLatencyMode?0:null!=wa?wa:3*Ea;Da=Da.W(b,"availabilityStartTime",qN);ra=new _.kD(ra,Da,wa,y,!!a.a.autoCorrectDrift,!!a.a.lowLatencyMode);ra=y?ra:lO(a.K,b,p,ra)}return _.x(V,ra,2)}A=V.f;ra=_.Cr.W(b,"timeShiftBufferDepth",rN);C=B&&a.a.availabilityWindowOverride&&!isNaN(a.a.availabilityWindowOverride)?a.a.availabilityWindowOverride:null===ra?Infinity:
52
+ ra;A.A=C;if(!a.D)throw new _.N(_.O,7,7001);E={hg:B,Di:null!=a.f,presentationTimeline:A,Ma:null,Ea:null,za:null,N:null,bandwidth:0,ng:!1,ym:u,xc:null,se:null};D=FO(a,E,p,e,b);J=D.duration;P=D.periods;u&&(GO(P,E),A.F=!0);if(y||!u&&!D.Sh)A.f=J||Infinity;if(2===a.a.timeline.version){ra=J;Da=P[0].startTime;if(null==ra||Infinity===ra)ra=HO(P);wa=A.a;_.jD(wa,Da,Da+ra);u&&(wa.f=!0)}_.sD(A,t||1);A.isLive()||Infinity!==A.f&&!A.l||2===A.h.version&&A.a.getDuration();if(!a.f){a.f={presentationTimeline:A,periods:P,
53
+ minBufferTime:0,cues:[]};a:{wa=_.Cr;if(Ea=wa.Ja(b,"ContentSteering"))if(ra=Ea.getAttribute("defaultServiceLocation")||"",Da=wa.sa(Ea)){wa=wa.W(Ea,"queryBeforeStart",xN,!1);ra={manifestType:_.Gc,contentSteeringServerUri:Da,defaultServiceLocation:ra,queryBeforeStart:wa||!1,baseUriCollections:[]};break a}ra=null}if(U=ra)a.f.contentSteering=U,a.f.contentSteering.baseUriCollections=e}a.f.cues=D.cues;a.F=q;return V["return"]({manifest:a.f,Io:u})})},HO=function(a){return a.map(function(b){return b.variants[0].video||
54
+ b.variants[0].audio}).reduce(function(b,c){return c?c.getDuration():0+b},0)},FO=function(a,b,c,d,e){var f=_.Cr,g=f.W(e,"mediaPresentationDuration",rN),h=a.f?a.f.periods[a.f.periods.length-1]||null:null,l=[],m=[],n=0;e=f.aa(e,"Period");for(var p=0;p<e.length;p++){var q=e[p];n=f.W(q,_.cg,rN,n);var t=f.W(q,TM,rN),u=null;if(p!==e.length-1){var y=f.W(e[p+1],_.cg,rN);null!=y&&(u=y-n)}else null!=g&&(u=g-n);y=_.bw;u&&t&&Math.abs(u-t)>y&&a.g.warn("There is a gap/overlap between Periods",q);null==u&&(u=t);
55
+ q=IO(a,b,c,d,{start:n,duration:u,node:q,zi:null==u||p===e.length-1});t=q.Ma;m.push(t);l=l.concat(q.cues);a.H.includes(t.id)||(a.H.push(t.id),a.f&&(a.D.filterNewPeriod(t),a.f.periods.push(t)));if(null==u){p!==e.length-1&&a.g.warn("Skipping Period",p+1,"and any subsequent Periods:","Period",p+1,"does not have a valid start time.",m[p+1]);n=null;break}n+=u}null==a.f&&a.D.filterAllPeriods(m);h&&(b=m.find(function(B){return B.id===h.id}))&&(h.endTime=b.endTime);l=JO(a,l);return null!=g?(n!==g&&a.g.warn("@mediaPresentationDuration does not match the total duration of ",
56
+ "all Periods."),{periods:m,duration:g,Sh:!1,cues:l}):{periods:m,duration:n,Sh:!0,cues:l}},JO=function(a,b){var c=new Set(b.map(GN));a.j.forEach(function(d,e){c.has(e)||a.j["delete"](e)});b.forEach(function(d){var e=GN(d);a.j.has(e)||a.j.set(e,d)});return Array.from(a.j.values())},IO=function(a,b,c,d,e){var f=_.Cr;b.Ma=KO(a,e.node,null,c,d);b.Ea=e;c=b.Ma.id||"__clpp_period_"+e.start;b.Ma.id||(a.g.info("No Period ID given for Period with start time "+e.start+(", Assigning a default: "+c+".")),b.Ma.id=
57
+ c);d=f.aa(e.node,"EventStream").flatMap(function(t){return LO(a,e.start,e.duration,t)});var g=f.aa(e.node,_.ka).map(function(t){return MO(a,b,t)}).filter(_.jn);if(b.hg){f=[];for(var h=_.v(g),l=h.next();!l.done;l=h.next()){l=_.v(l.value.io);for(var m=l.next();!m.done;m=l.next())f.push(m.value)}if(f.length!==(new Set(f)).size)throw new _.N(_.O,4,4018);}f=g.filter(function(t){return!t.Vg});h=g.filter(function(t){return t.Vg});h=_.v(h);for(l=h.next();!l.done;l=h.next()){m=l.value;m.streams.forEach(function(t){t.trickPlay=
58
+ !0});l=m.streams[0];m=m.Vg;for(var n=_.v(f),p=n.next();!p.done;p=n.next())if(p=p.value,m.includes(p.id)){p=_.v(p.streams);for(var q=p.next();!q.done;q=p.next())q.value.trickModeVideo=l}}h=NO(g,_.Mg);l=NO(f,_.Nc);if(!h.length&&!l.length)throw new _.N(_.O,4,4004);l.length||(l=[null]);h.length||(h=[null]);g=[];l=_.v(l);for(m=l.next();!m.done;m=l.next())for(m=m.value,n=_.v(h),p=n.next();!p.done;p=n.next())OO(a,m,p.value,g);l=_.jh(NO(f,_.tn)).concat(_.jh(NO(f,_.jg)));h=[];l=_.v(l);for(m=l.next();!m.done;m=
59
+ l.next())h.push.apply(h,m.value.streams);m=NO(f,_.te);l=[];m=_.v(m);for(n=m.next();!n.done;n=m.next())l.push.apply(l,n.value.streams);f=PO(e,f);return{Ma:{id:c,configurationId:a.D.configurationId,startTime:e.start,endTime:f,textStreams:h,thumbStreams:l,variants:g},cues:d}},PO=function(a,b){if(null!==a.duration)return a.start+a.duration;if(0<b.length){var c=b.filter(function(d){return 0<d.streams.length}).map(function(d){return d.streams}).flat().filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});
60
+ return 0<c.length?a.start+Math.min.apply(Math,_.jh(c)):null}return null},NO=function(a,b){return a.filter(function(c){return c.contentType===b})},OO=function(a,b,c,d){var e;if(b||c)if(b&&c){if(_.Ls(b.drmInfos,c.drmInfos)){var f=_.Ks(b.drmInfos,c.drmInfos),g=_.v(b.streams);for(e=g.next();!e.done;e=g.next()){var h=e.value,l=_.v(c.streams);for(e=l.next();!e.done;e=l.next()){var m=e.value;e=(m.bandwidth||0)+(h.bandwidth||0);e={id:a.h++,language:b.language,primary:b.ue||c.ue,audio:h,video:m,bandwidth:e,
61
+ drmInfos:f,allowedByApplication:!0,allowedByKeySystem:!0};d.push(e)}}}}else for(f=b||c,g=_.v(f.streams),e=g.next();!e.done;e=g.next())h=e.value,e=h.bandwidth||0,e={id:a.h++,language:f.language||_.Bg,primary:f.ue,audio:b?h:null,video:c?h:null,bandwidth:e,drmInfos:f.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(e)},MO=function(a,b,c){var d=_.Cr;b.za=KO(a,c,b.Ma,null,null);var e=b.za.contentType===_.tn,f=QO(c),g=RO(c,e),h=g.kind,l=g.ue,m=g.roles;g=null;try{g=SO(c)}catch(C){return null}var n=
62
+ d.aa(c,"Accessibility"),p=TO(n),q=d.aa(c,IM),t=vO(q,a.a.ignoreDrmInfo,b.Ma.id,a.a.playreadyVersion||null),u=c.getAttribute("lang")||_.Bg;q=_.jo(u);d=d.aa(c,_.Ab);c=d.map(function(C){return UO(a,b,t,h,u,f||"",l,m,p,C)}).filter(_.jn);if(0===c.length){if(e)return null;throw new _.N(_.O,4,4003);}if(!b.za.contentType||b.za.contentType===_.Ec){b.za.contentType=VO(c[0].mimeType,c[0].codecs);e=_.v(c);for(var y=e.next();!y.done;y=e.next())y.value.type=b.za.contentType}e=_.v(c);for(y=e.next();!y.done;y=e.next()){y=
63
+ y.value;for(var B=_.v(t.drmInfos),A=B.next();!A.done;A=B.next())A=A.value,y.keyId&&!A.keyIds.includes(y.keyId)&&A.keyIds.push(y.keyId)}c=WO(c,b.za.contentType,n);n=d.map(function(C){return C.getAttribute("id")}).filter(_.jn);return{id:b.za.id||"__fake__"+a.h++,contentType:b.za.contentType,language:q,originalLanguage:u,ue:l,streams:c,drmInfos:t.drmInfos,Vg:g,io:n}},SO=function(a){var b=_.Cr.aa(a,JM);a=null;b=_.v(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value;c=d.getAttribute($M)||"";d=d.getAttribute(_.Ig);
64
+ if(c!==UM&&!XO.includes(c)||void 0===d)throw new _.pi("Unrecognized essential property");c===UM&&(a=d.split(" "))}return a},RO=function(a,b){var c=!1,d=_.Cr.aa(a,"Role"),e=d.map(function(l){return l.getAttribute(_.Ig)}).filter(_.jn),f=void 0;b&&(f=_.jg);d=_.v(d);for(var g=d.next();!g.done;g=d.next()){g=g.value;var h=g.getAttribute($M);if(null==h||"urn:mpeg:dash:role:2011"===h||"urn:mpeg:dash:role"===h)switch(g=g.getAttribute(_.Ig),g){case _.He:c=!0;break;case _.bd:case _.jg:f=g;break;case "forced-subtitle":case "forced_subtitle":case _.le:f=
65
+ _.le}}return{ue:c,roles:e,kind:f}},QO=function(a){var b=null,c=_.Cr.aa(a,"Label").map(_.Cr.sa).filter(_.jn);c&&0<c.length&&(b=c[c.length-1]);null==b&&(b=a.getAttribute("label"));return b},TO=function(a){var b=new Map;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=d.getAttribute($M);if("urn:scte:dash:cc:cea-608:2015"===c||"urn:scte:dash:cc:cea-708:2015"===c)if(c=1,d=d.getAttribute(_.Ig),null!=d){d=_.v(d.split(";"));for(var e=d.next();!e.done;e=d.next()){var f=e.value;f.includes("\x3d")?
66
+ (f=f.split("\x3d"),e=f[0].startsWith("CC")?f[0]:"CC"+f[0],f=f[1].split(",")[0].split(":").pop()):(e="CC"+c,c+=2);b.set(e,_.jo(f))}}else b.set("CC1",_.Bg)}return b},WO=function(a,b,c){var d=b===_.jg?_.tn:b;b=c.map(function(f){return{scheme:f.getAttribute($M)||"",id:f.getAttribute("id")||void 0,value:f.getAttribute(_.Ig)||"",protocol:"DASH",type:d}});c=_.v(a);for(var e=c.next();!e.done;e=c.next())e.value.accessibility=b;return a},UO=function(a,b,c,d,e,f,g,h,l,m){var n=_.Cr,p=_.jo(e);b.N=KO(a,m,b.za,
67
+ null,null);if(!YO(a,b.N))return a.g.warn("Skipping Representation",b.N),null;b.xc=b.Ma.id+" "+b.N.id;b.se=a.G.get(b.xc);b.bandwidth=n.W(m,"bandwidth",uN)||0;var q=ZO(a,b);if(!q)return null;a.G.set(b.xc,q.Fa);var t=n.aa(m,IM);a=wO(t,c,a.a.ignoreDrmInfo,b.Ma.id,a.a.playreadyVersion||null);t=!1;n.aa(m,"SupplementalProperty").some(function(u){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===u.getAttribute($M)&&"JOC"===u.getAttribute(_.Ig)})&&(b.N.mimeType="audio/eac3-joc",t=!0);m=$O(b,m);return{id:_.$J++,
68
+ originalId:b.N.id,createSegmentIndex:q.createSegmentIndex,findSegmentPosition:q.findSegmentPosition,getSegmentReference:q.getSegmentReference,initSegmentReference:q.initSegmentReference,adjustSegmentDurations:q.adjustSegmentDurations,getLastSegmentEndTime:q.getLastSegmentEndTime,getDuration:q.getDuration,segmentLookupStrategy:_.QB,mimeType:b.N.mimeType,codecs:b.N.codecs,frameRate:b.N.frameRate,bandwidth:b.bandwidth,width:b.N.width,height:b.N.height,kind:d,encrypted:0<c.drmInfos.length,keyId:a,language:p,
69
+ originalLanguage:e,label:f,type:b.za.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.N.emsgSchemeIdUris,roles:h,channelsCount:b.N.sg,spatialAudio:t,closedCaptions:l,horizontalTiles:m.horizontalTiles,verticalTiles:m.verticalTiles,durationPerTile:m.durationPerTile}},$O=function(a,b){var c={};if(a.N.contentType===_.te){var d=_.Cr.Ja(b,JM),e=d&&d.getAttribute($M);if(aP.includes(e||"")&&(d=_.Lp(d.getAttribute(_.Ig)||""))&&(c.horizontalTiles=d.ge,c.verticalTiles=d.Ce,a.za.wc)){e=_.Cr.W(a.za.wc,
70
+ TM,vN)||0;var f=_.Cr.W(a.za.wc,bN,vN)||1;if(e/=f)c.durationPerTile=e/d.Eo}}return c},ZO=function(a,b){var c=b.N.contentType;c=c===_.tn||c===_.Ec;try{if(b.N.ye){var d=Number(zN(b,VN,ZM))||0,e=zN(b,VN,bN),f=1;e&&(f=uN(e)||1);d=d/f||0;var g=TN(b,VN),h=b.N.mimeType.split("/")[1];if(b.N.contentType!==_.tn&&"mp4"!==h&&"webm"!==h)throw _.Rh("SegmentBase specifies an unsupported container type.",b.N),new _.N(_.O,4,4006);if("webm"===h&&!g)throw _.Rh(OM,"the SegmentBase uses a WebM container,","but does not contain an Initialization element.",
71
+ b.N),new _.N(_.O,4,4005);var l=AN(b,VN,"RepresentationIndex"),m=zN(b,VN,"indexRange"),n=b.N.ma,p=sN(m||"");if(l){var q=l.getAttribute("sourceURL");q&&(n=_.tC(b.N.ma,[q]));p=_.Cr.W(l,"range",sN,p)}if(!p)throw _.Rh(OM,"the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",b.N),new _.N(_.O,4,4002);nN(b.N.contentType)&&(b.presentationTimeline.B=null);var t=UN(b,g,n,p.start,p.end,h,d);var u={createSegmentIndex:t.createSegmentIndex,findSegmentPosition:t.findSegmentPosition,getSegmentReference:t.getSegmentReference,
72
+ adjustSegmentDurations:t.adjustSegmentDurations,getDuration:t.getDuration,initSegmentReference:g,getLastSegmentEndTime:t.getLastSegmentEndTime,Fa:d}}else u=b.N.vc?hO(b,a.I):b.N.wc?bO(b,a.I,!!a.f):bP(b);return u}catch(y){if(c&&4002===y.code)return a.g.debug("Ignoring DASH_NO_SEGMENT_INFO error in a text stream",y),null;throw y;}},bP=function(a){function b(){return d}var c=a.N.ma,d=a.Ea.duration||0;return{createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(e){return 0<=
73
+ e&&e<d?1:null},getSegmentReference:function(e){return 1!==e?null:new _.Jp(1,0,d,function(){return c},0,null,0,null,null,null,null,null,null,null,null,function(){return""},a.N.Pa)},adjustSegmentDurations:function(){},getDuration:b,getLastSegmentEndTime:b,verticalTiles:void 0,horizontalTiles:void 0,initSegmentReference:null,Fa:0}},cP=function(a,b){0>a.l||a.B.ha(Math.max(3,a.l-b,_.bD(a.J)))},KO=function(a,b,c,d,e){var f=_.Cr;c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,
74
+ sg:null,Pa:e?e.find(function(t){return t.id===GM})||null:null};d=d||c.ma;var g=f.aa(b,GM),h=g.map(f.sa);e=e?EO(g,e,b.getAttribute("id")||void 0):null;g=b.getAttribute("contentType")||c.contentType;var l=b.getAttribute(_.Me)||c.mimeType,m=b.getAttribute(_.yd)||c.codecs,n=f.W(b,"frameRate",wN)||c.frameRate,p=dP(f.aa(b,"InbandEventStream"),c.emsgSchemeIdUris),q=f.aa(b,"AudioChannelConfiguration");a=eP(a,q)||c.sg;g||(g=VO(l,m));return{ma:_.tC(d,h),Pa:e||c.Pa,ye:f.Ja(b,"SegmentBase")||c.ye,vc:f.Ja(b,"SegmentList")||
75
+ c.vc,wc:f.Ja(b,"SegmentTemplate")||c.wc,width:f.W(b,_.ah,vN)||c.width,height:f.W(b,_.oe,vN)||c.height,contentType:g,mimeType:l,codecs:m,frameRate:n,emsgSchemeIdUris:p,id:b.getAttribute("id")||"",sg:a}},dP=function(a,b){for(var c=b.slice(),d=_.v(a),e=d.next();!e.done;e=d.next())(e=e.value.getAttribute($M))&&!c.includes(e)&&c.push(e);return c},eP=function(a,b){for(var c=_.v(b),d=c.next();!d.done;d=c.next()){var e=d.value;if(d=e.getAttribute($M))if(e=e.getAttribute(_.Ig))switch(d){case "urn:mpeg:dash:outputChannelPositionList:2012":return e.trim().split(/ +/).length;
76
+ case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":var f=parseInt(e,10);if(!f){a.g.warn(HM,d,e);continue}return f;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":f=parseInt(e,16);if(!f){a.g.warn(HM,d,e);continue}for(c=0;f;)f&1&&++c,f>>=1;return c;default:a.g.warn("Unrecognized audio channel scheme:",d,e)}}return null},YO=function(a,b){var c=b.ye?1:0;c+=b.vc?1:0;c+=
77
+ b.wc?1:0;if(0===c){if(b.contentType===_.tn||b.contentType===_.Ec)return!0;a.g.warn("Representation does not contain a segment information source:","the Representation must contain one of SegmentBase, SegmentList,",'SegmentTemplate, or explicitly indicate that it is "text".',b);return!1}1!==c&&(a.g.warn("Representation contains multiple segment information sources:","the Representation should only contain one of SegmentBase,","SegmentList, or SegmentTemplate.",b),b.ye?(a.g.info("Using SegmentBase by default."),
78
+ b.vc=null):a.g.info("Using SegmentList by default."),b.wc=null);return!0},LO=function(a,b,c,d){var e=_.Cr,f=d.getAttribute($M)||"",g=d.getAttribute(_.Ig)||"",h=e.W(d,bN,vN)||1,l=e.W(d,ZM,vN)||0,m=[],n={};d=_.v(e.aa(d,"Event"));for(var p=d.next();!p.done;n={Wc:n.Wc},p=d.next()){p=p.value;var q=e.W(p,"presentationTime",vN)||0,t=e.W(p,TM,vN)||0;q=b+q/h-l/h;t=q+t/h;null!=c&&(q=Math.min(q,b+c),t=Math.min(t,b+c));var u=_.Cg;f.startsWith(_.Eg)?u=_.Uf:"urn:mpeg:dash:event:callback:2015"===f&&(u=_.Qe);n.Wc=
79
+ {configurationId:a.D.configurationId,schemeIdUri:f,value:g,startTime:q,endTime:t,id:p.getAttribute("id")||"",type:u,eventElement:e.Ae(p)};n.Wc.type===_.Qe&&(n.Wc.tf=function(y){return function(){var B=y.Wc;B.eventElement&&(B=B.eventElement.getAttribute("messageData")||"")&&B.startsWith("http")&&(B=_.Mk(B),B.type=_.Lk,a.D.networkingEngine.fetch(B))}}(n));m.push(n.Wc)}return m},VO=function(a,b){return _.hD(_.wn(a,b))?_.tn:a.split("/")[0]},fP=function(a){var b=new Set;a.forEach(function(c){c.variants.forEach(function(d){d.audio&&
80
+ b.add(d.audio);d.video&&b.add(d.video)})});return Array.from(b)},GO=function(a,b){var c=fP(a).filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});0<c.length&&(c=Math.min.apply(Math,_.jh(c)),_.qD(b.presentationTimeline,c+b.Ea.start))},gP=function(){};_.vr.prototype.Ae=_.bC(20,function(a){return a});
81
+ _.LC.prototype.Ae=_.bC(19,function(a){var b=this,c=Array.from(a.a.entries()).map(function(e){e=_.v(e);var f=e.next().value;return"xmlns:"+e.next().value+'\x3d"'+f+'"'}).join(" "),d=(new DOMParser).parseFromString('\x3c?xml version\x3d"1.0"?\x3e\x3c'+a.tagName+" "+(c+"/\x3e"),_.og).childNodes[0];Object.keys(a.attributes).forEach(function(e){d.setAttribute(e,a.attributes[e])});a.childNodes.forEach(function(e){e.tagName===_.da?d.textContent+=e.textContent:d.appendChild(b.Ae(e))});return d});
82
+ _.vr.prototype.Cf=_.bC(18,function(a,b){Array.from(a.attributes).forEach(function(c){c.namespaceURI===b&&a.removeAttributeNS(c.namespaceURI,c.localName)})});_.LC.prototype.Cf=_.bC(17,function(a,b){var c=a.a.get(b);if(c){var d=c+":";Object.keys(a.attributes).forEach(function(e){e.startsWith(d)&&delete a.attributes[e]})}});_.vr.prototype.kf=_.bC(16,function(a,b){for(var c=_.v(a.attributes),d=c.next();!d.done;d=c.next())d=d.value,b.setAttributeNS(d.namespaceURI,d.nodeName,d.value)});
83
+ _.LC.prototype.kf=_.bC(15,function(a,b){Object.keys(a.attributes).forEach(function(c){b.attributes[c]=a.attributes[c]})});_.vr.prototype.lf=_.bC(14,function(a,b){Array.from(a.childNodes).forEach(function(c){a.removeChild(c);b.appendChild(c)})});_.LC.prototype.lf=_.bC(13,function(a,b){b.childNodes.push.apply(b.childNodes,_.jh(a.childNodes));a.childNodes=[]});_.vr.prototype.Bf=_.bC(12,function(a){Array.from(a.childNodes).forEach(function(b){a.removeChild(b)})});
84
+ _.LC.prototype.Bf=_.bC(11,function(a){a.childNodes=[]});_.vr.prototype.jd=_.bC(10,function(){return document.createElement("null")});_.LC.prototype.jd=_.bC(9,function(){return new _.IC("NULL",null,{},[],null,new Map)});_.vr.prototype.bf=_.bC(8,function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})});_.LC.prototype.bf=_.bC(7,function(a){return a.childNodes});
85
+ _.vr.prototype.W=_.bC(6,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.LC.prototype.W=_.bC(5,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.vr.prototype.Fc=_.bC(4,function(a,b,c){return Array.from(a.childNodes).filter(function(d){return d instanceof Element&&d.localName===c&&d.namespaceURI===b})});
86
+ _.LC.prototype.Fc=_.bC(3,function(a,b,c){b=a.a.get(b);if(!b)return[];var d=b+":"+c;return a.childNodes.filter(function(e){return e.tagName===d})});_.vr.prototype.Xb=_.bC(2,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});_.LC.prototype.Xb=_.bC(1,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});var aP=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],XO=["urn:mpeg:mpegB:cicp:ColourPrimaries","urn:mpeg:mpegB:cicp:MatrixCoefficients","urn:mpeg:mpegB:cicp:TransferCharacteristics"];var MN=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];QN.prototype.parse=function(a,b,c,d){b=new KN(new DataView(b));if(440786851!==ON(b).id)throw _.Rh("Not an EBML element."),new _.N(_.O,3,3008);var e=ON(b);if(408125543!==e.id)throw _.Rh("Not a Segment element."),new _.N(_.O,3,3009);b=e.a.byteOffset;e=new KN(e.a);for(var f=null;_.Xp(e.a);){var g=ON(e);if(357149030===g.id){f=g;break}}if(!f)throw _.Rh("Not an Info element."),new _.N(_.O,3,3010);f=new KN(f.a);g=1E6;for(e=null;_.Xp(f.a);){var h=ON(f);if(2807729===h.id)g=PN(h);else if(17545===h.id)if(4===
87
+ h.a.byteLength)e=h.a.getFloat32(0);else if(8===h.a.byteLength)e=h.a.getFloat64(0);else throw new _.N(_.O,3,3003);}if(null==e)throw new _.N(_.O,3,3011);f=g/1E9;e*=f;a=ON(new KN(new DataView(a)));if(475249515!==a.id)throw _.Rh("Not a Cues element."),new _.N(_.O,3,3007);return SN(a,b,f,e,c,d)};var nO=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",_.af).set(gN,_.Fd).set(fN,_.Dd).set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95",_.Dd).set("urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2",_.Bd).set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb",_.Ad),yO=(new Map).set(_.Fd,function(a){var b=xO(a);if(b)return{licenseUrl:b,origin:_.OB};if(a=_.Cr.Xb(a.node,"urn:microsoft","laurl"))if(a=a.getAttribute("licenseUrl"))return{licenseUrl:a,origin:"ms:laurl"};return null}).set(_.Dd,function(a){var b=
88
+ _.Cr,c=xO(a);if(c)return{licenseUrl:c,origin:_.OB};a=b.Xb(a.node,cN,"pro");if(!a)return null;b=b.sa(a);if(!b)return null;b=_.Cm(b);return(b=_.Hr(b).h)?{licenseUrl:b,origin:"mspr:pro"}:null}),pO=new _.L("clpp.dash.ContentProtection");_.r=AO.prototype;_.r.configure=function(a){this.a=a;this.K.a={clockSyncUri:a.clockSyncUri}};_.r.start=function(a,b){var c=this,d;return _.I(function(e){if(1==e.a)return c.o=[a],c.D=b,_.x(e,CO(c),2);d=e.f;c.D&&cP(c,d);if(!c.D)throw new _.N(_.O,7,7001);return e["return"](c.f)})};_.r.requestStop=function(){this.L=!0};_.r.stop=function(){this.a=this.D=null;this.o=[];this.f=null;this.H=[];this.I={};this.F=null;this.l=-1;this.B.stop();this.G.clear();this.j.clear();return this.A.destroy()};
89
+ _.r.update=function(){var a=this;CO(this)["catch"](function(b){if(a.D&&b)a.D.onError(b)})};_.r.setCurrentVariant=function(){};_.r.dc=function(){var a=this,b,c,d;return _.I(function(e){switch(e.a){case 1:return a.g.debug(_.HB),b=0,_.F(e,2),_.x(e,CO(a),4);case 4:b=e.f;_.G(e,3);break;case 2:if(c=_.H(e),a.D&&c.a&&(a.D.onError(c),d=c,d.severity===_.O))return e["return"]();case 3:if(!a.D)return e["return"]();if(!a.L){e.C(5);break}return _.x(e,a.stop(),6);case 6:return e["return"]();case 5:cP(a,b),_.z(e)}})};
90
+ _.r.loadVariant=function(a){return _.I(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.I(function(f){(e=c.f.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.pi(_.xB+a);return f["return"](d)})};_.w(gP,_.Tu);gP.prototype.install=function(){_.Rv.mpd=AO;_.Qv[_.Gc]=AO};gP.prototype.uninstall=function(){_.jE("mpd");_.kE(_.Gc)};gP.prototype.id=function(){return"dash"};_.K("clpp.dash.DashComponent",gP);};
91
91
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
92
92
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
93
93
  else{_=this.clpp._;(f.call(g,this));}