Module 108110

117,826 characters · in 68925.4de164704c201108.js
Dependencies
Required by (1)
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e){e.exports=function(){var e={506:e=>{e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},913:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},525:(e,t,r)=>{var n=r(331);function i(){return"u">typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,r){var i=n(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},754:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},205:(e,t,r)=>{var n=r(489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},585:(e,t,r)=>{var n=r(8).default,i=r(506);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},489:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},331:(e,t,r)=>{var n=r(754);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},8:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},848:e=>{window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){function r(e,t){if(e<1||e!==Math.round(e))throw"Invalid channel count for BufferQueue";this.channels=e,this.bufferSize=t,this.flush()}r.prototype.flush=function(){this._buffers=[],this._pendingBuffer=this.createBuffer(this.bufferSize),this._pendingPos=0},r.prototype.sampleCount=function(){var e=0;return this._buffers.forEach(function(t){e+=t[0].length}),e},r.prototype.createBuffer=function(e){for(var t=[],r=0;r<this.channels;r++)t[r]=new Float32Array(e);return t},r.prototype.validate=function(e){if(e.length!==this.channels)return!1;for(var t,r=0;r<e.length;r++){var n=e[r];if(!(n instanceof Float32Array))return!1;if(0==r)t=n.length;else if(n.length!==t)return!1}return!0},r.prototype.appendBuffer=function(e){if(!this.validate(e))throw"Invalid audio buffer passed to BufferQueue.appendBuffer";for(var t=e[0].length,r=this.channels,n=this._pendingPos,i=this._pendingBuffer,o=this.bufferSize,a=0;a<t;a++){for(var s=0;s<r;s++)i[s][n]=e[s][a];++n==o&&(this._buffers.push(i),n=this._pendingPos=0,i=this._pendingBuffer=this.createBuffer(o))}this._pendingPos=n},r.prototype.prependBuffer=function(e){if(!this.validate(e))throw"Invalid audio buffer passed to BufferQueue.prependBuffer";var t=this._buffers.slice(0);t.push(this.trimBuffer(this._pendingBuffer,0,this._pendingPos)),this.flush(),this.appendBuffer(e);for(var r=0;r<t.length;r++)this.appendBuffer(t[r])},r.prototype.nextBuffer=function(){if(this._buffers.length)return this._buffers.shift();var e=this.trimBuffer(this._pendingBuffer,0,this._pendingPos);return this._pendingBuffer=this.createBuffer(this.bufferSize),this._pendingPos=0,e},r.prototype.trimBuffer=function(e,t,r){var n=e[0].length,i=t+Math.min(r,n);if(0==t&&i>=n)return e;for(var o=[],a=0;a<this.channels;a++)o[a]=e[a].subarray(t,i);return o},e.exports=r},function(e,t,r){r(0);var n=r(2),i=r(4);function o(e){this._options=e||{},this._backend=null,this._resampleFractional=0,this._resampleLastSampleData=void 0,this._tempoChanger=null}o.prototype.rate=0,o.prototype.targetRate=0,o.prototype.channels=0,o.prototype.bufferSize=0,Object.defineProperty(o.prototype,"bufferDuration",{get:function(){return this.targetRate?this.bufferSize/this.targetRate:0}}),Object.defineProperty(o.prototype,"bufferThreshold",{get:function(){return this._backend?this._backend.bufferThreshold/this.targetRate:0},set:function(e){if(!this._backend)throw"Invalid state: AudioFeeder cannot set bufferThreshold before init";this._backend.bufferThreshold=Math.round(e*this.targetRate)}}),Object.defineProperty(o.prototype,"playbackPosition",{get:function(){return this._backend?this.getPlaybackState().playbackPosition:0}}),Object.defineProperty(o.prototype,"outputPlaybackPosition",{get:function(){return this._backend?this.getPlaybackState().outputPlaybackPosition:0}}),Object.defineProperty(o.prototype,"durationBuffered",{get:function(){return this._backend?this.getPlaybackState().samplesQueued/this.targetRate:0}}),Object.defineProperty(o.prototype,"muted",{get:function(){if(this._backend)return this._backend.muted;throw"Invalid state: cannot get mute before init"},set:function(e){if(!this._backend)throw"Invalid state: cannot set mute before init";this._backend.muted=e}}),o.prototype.mute=function(){this.muted=!0},o.prototype.unmute=function(){this.muted=!1},Object.defineProperty(o.prototype,"volume",{get:function(){if(this._backend)return this._backend.volume;throw"Invalid state: cannot get volume before init"},set:function(e){if(!this._backend)throw"Invalid state: cannot set volume before init";this._backend.volume=e}}),Object.defineProperty(o.prototype,"tempo",{get:function(){if(this._tempoChanger)return this._tempoChanger.getTempo();throw"Invalid state: cannot get tempo before init"},set:function(e){if(!this._tempoChanger)throw"Invalid state: cannot set tempo before init";this._tempoChanger.setTempo(e)}}),o.prototype.init=function(e,t){if(this.channels=e,this.rate=t,this._options.backendFactory)this._backend=this._options.backendFactory(e,t,this._options);else{if(!n.isSupported())throw"No supported backend";this._backend=new n(e,t,this._options)}this.targetRate=this._backend.rate,this.bufferSize=this._backend.bufferSize,this._tempoChanger=i({sampleRate:this.targetRate,numChannels:e,tempo:1}),this._backend.onstarved=(function(){this.onstarved&&this.onstarved()}).bind(this),this._backend.onbufferlow=(function(){this.onbufferlow&&this.onbufferlow()}).bind(this)},o.prototype._resample=function(e){var t=this.rate,r=this.channels,n=this._backend.rate,i=this._backend.channels;if(t==n&&r==i)return e;var o,a=[],s=e[0].length,l=this._resampleFractional,u=s*n/t+l,c=Math.floor(u),f=u-c;o=t<n?function(e,r,i,o){for(var a=function(t){return t<0?i&&i.length+t>0?i[i.length+t]:e[0]:e[t]},s=0;s<r.length;s++){var u,c=(s+1-l)*t/n-1,f=Math.floor(c),d=Math.ceil(c);u=f==d?a(f):a(f)*(d-c)+a(d)*(c-f),r[s]=o*u}}:function(e,t,r,n){for(var i=0;i<t.length;i++)t[i]=n*e[i*e.length/t.length|0]};var d=1;i>r&&(d=Math.SQRT1_2);for(var p=0;p<i;p++){var h=p;p>=r&&(h=0);var m=e[h],g=new Float32Array(c);o(m,g,this._resampleLastSampleData?this._resampleLastSampleData[h]:void 0,d),a.push(g)}return this._resampleFractional=f,this._resampleLastSampleData=e,a},o.prototype.bufferData=function(e){if(!this._backend)throw"Invalid state: AudioFeeder cannot bufferData before init";var t=this._resample(e);t=this._tempoChanger.process(t),this._backend.appendBuffer(t)},o.prototype.getPlaybackState=function(){if(this._backend){var e=this._backend.getPlaybackState();return e.outputPlaybackPosition=e.playbackPosition,e.playbackPosition=this._tempoChanger.mapOutputToInputTime(e.outputPlaybackPosition),e}throw"Invalid state: AudioFeeder cannot getPlaybackState before init"},o.prototype.waitUntilReady=function(e){if(!this._backend)throw"Invalid state: AudioFeeder cannot waitUntilReady before init";this._backend.waitUntilReady(e)},o.prototype.start=function(){if(!this._backend)throw"Invalid state: AudioFeeder cannot start before init";this._backend.start()},o.prototype.stop=function(){if(!this._backend)throw"Invalid state: AudioFeeder cannot stop before init";this._backend.stop()},o.prototype.flush=function(){if(this._resampleFractional=0,this._resampleLastSampleData=void 0,!this._backend)throw"Invalid state: AudioFeeder cannot flush before init";this._tempoChanger.flush(this.durationBuffered),this._backend.flush()},o.prototype.close=function(){this._backend&&(this._backend.close(),this._backend=null)},o.prototype.onstarved=null,o.prototype.onbufferlow=null,o.isSupported=function(){return!!Float32Array&&n.isSupported()},o.initSharedAudioContext=function(){return n.isSupported()?n.initSharedAudioContext():null},e.exports=o},function(e,t,r){var n=window.AudioContext||window.webkitAudioContext,i=r(0),o=r(3);function a(e,t,r){var n=r.audioContext||a.initSharedAudioContext();if(this._context=n,this.output=r.output||n.destination,this.rate=n.sampleRate,this.channels=2,r.bufferSize&&(this.bufferSize=0|r.bufferSize),this.bufferThreshold=2*this.bufferSize,this._bufferQueue=new i(this.channels,this.bufferSize),this._playbackTimeAtBufferTail=n.currentTime,this._queuedTime=0,this._delayedTime=0,this._dropped=0,this._liveBuffer=this._bufferQueue.createBuffer(this.bufferSize),n.createScriptProcessor)this._node=n.createScriptProcessor(this.bufferSize,0,this.channels);else{if(!n.createJavaScriptNode)throw Error("Bad version of web audio API?");this._node=n.createJavaScriptNode(this.bufferSize,0,this.channels)}}a.prototype.bufferSize=4096,a.prototype.bufferThreshold=8192,a.prototype._volume=1,Object.defineProperty(a.prototype,"volume",{get:function(){return this._volume},set:function(e){this._volume=+e}}),a.prototype._muted=!1,Object.defineProperty(a.prototype,"muted",{get:function(){return this._muted},set:function(e){this._muted=!!e}}),a.prototype._audioProcess=function(e){var t,r,n,i,a="number"==typeof e.playbackTime?e.playbackTime:this._context.currentTime+this.bufferSize/this.rate,s=this._playbackTimeAtBufferTail;if(s<a&&(this._delayedTime+=a-s),this._bufferQueue.sampleCount()<this.bufferSize&&this.onstarved&&this.onstarved(),this._bufferQueue.sampleCount()<this.bufferSize){for(t=0;t<this.channels;t++)for(n=e.outputBuffer.getChannelData(t),i=0;i<this.bufferSize;i++)n[i]=0;this._dropped++}else{var l=this.muted?0:this.volume,u=this._bufferQueue.nextBuffer();if(u[0].length<this.bufferSize)throw"Audio buffer not expected length.";for(t=0;t<this.channels;t++)for(r=u[t],this._liveBuffer[t].set(u[t]),n=e.outputBuffer.getChannelData(t),i=0;i<r.length;i++)n[i]=r[i]*l;this._queuedTime+=this.bufferSize/this.rate,this._playbackTimeAtBufferTail=a+this.bufferSize/this.rate,this._bufferQueue.sampleCount()<Math.max(this.bufferSize,this.bufferThreshold)&&this.onbufferlow&&o(this.onbufferlow.bind(this))}},a.prototype._samplesQueued=function(){return this._bufferQueue.sampleCount()+Math.floor(this._timeAwaitingPlayback()*this.rate)},a.prototype._timeAwaitingPlayback=function(){return Math.max(0,this._playbackTimeAtBufferTail-this._context.currentTime)},a.prototype.getPlaybackState=function(){return{playbackPosition:this._queuedTime-this._timeAwaitingPlayback(),samplesQueued:this._samplesQueued(),dropped:this._dropped,delayed:this._delayedTime}},a.prototype.waitUntilReady=function(e){e()},a.prototype.appendBuffer=function(e){this._bufferQueue.appendBuffer(e)},a.prototype.start=function(){this._node.onaudioprocess=this._audioProcess.bind(this),this._node.connect(this.output),this._playbackTimeAtBufferTail=this._context.currentTime},a.prototype.stop=function(){if(this._node){var e=this._timeAwaitingPlayback();if(e>0){var t=Math.round(e*this.rate),r=this._liveBuffer?this._liveBuffer[0].length:0;t>r?(this._bufferQueue.prependBuffer(this._liveBuffer),this._bufferQueue.prependBuffer(this._bufferQueue.createBuffer(t-r))):this._bufferQueue.prependBuffer(this._bufferQueue.trimBuffer(this._liveBuffer,r-t,t)),this._playbackTimeAtBufferTail-=e}this._node.onaudioprocess=null,this._node.disconnect()}},a.prototype.flush=function(){this._bufferQueue.flush()},a.prototype.close=function(){this.stop(),this._context=null},a.prototype.onstarved=null,a.prototype.onbufferlow=null,a.isSupported=function(){return!!n},a.sharedAudioContext=null,a.initSharedAudioContext=function(){if(!a.sharedAudioContext&&a.isSupported()){var e,t=new n;if(t.createScriptProcessor)e=t.createScriptProcessor(1024,0,2);else{if(!t.createJavaScriptNode)throw Error("Bad version of web audio API?");e=t.createJavaScriptNode(1024,0,2)}e.connect(t.destination),e.disconnect(),a.sharedAudioContext=t}return a.sharedAudioContext},e.exports=a},function(e,t){e.exports=function(){if(void 0!==window.setImmediate)return window.setImmediate;if(window&&window.postMessage){var e=[];return window.addEventListener("message",function(t){if(t.source===window){var r=t.data;if("object"==typeof r&&r.nextTickBrowserPingMessage){var n=e.pop();n&&n()}}}),function(t){e.push(t),window.postMessage({nextTickBrowserPingMessage:!0},document.location.toString())}}return function(e){setTimeout(e,0)}}()},function(e,t,r){window,e.exports=function(){var e=[function(e,t){e.exports={float_array:function(e){return new Float32Array(e)},blit:function(e,t,r,n,i){r.set(e.subarray(t,t+i),n)}}},function(e,t,r){var n,i;n=r(0),i=r(2),e.exports=function(e){var t=(e=e||{}).sampleRate||44100,r=e.wsizeLog||11,o=e.tempo||1,a=(e.numChannels,Math.pow(2,50/1200)-1),s=1<<r,l=i(r),u=1<<r-2;u-=u%100;for(var c=n.float_array(s+u+5),f=n.float_array(s+u+5),d=u,p=u,h=n.float_array(s),m=0;m<s;m++)h[m]=.5*(1-Math.cos(2*Math.PI*m/s));var g=1+(s>>1),v=n.float_array(g),y=n.float_array(g),b=n.float_array(g),w=n.float_array(g),_=n.float_array(g),x=n.float_array(g),E=1+(g>>1),S=[0,0],k=[],T=[],C=[],P=[];for(m=0;m<2;m++)k.push(n.float_array(E)),T.push(n.float_array(E)),C.push(n.float_array(E)),P.push(n.float_array(g));var A=n.float_array(E),O=n.float_array(E),M=0,I=0,R=[{in_time:0,out_time:0,tempo:o}],D=0,L=0,F=1,N=0,j=0,V=0,B=0,U={mapOutputToInputTime:function(e){for(var t=R.length-1;e<R[t].out_time&&t>0;)t--;var r=R[t];return r.in_time+r.tempo*(e-r.out_time)},flush:function(e){N=0,S=[0,0],L=0,B=0,V=0;for(var t=0;t<2;t++)for(var r=0;r<g;r++)P[t][r]=0;for(t=0;t<c.length;t++)c[t]=0;for(t=0;t<f.length;t++)f[t]=0;if(e){I=Math.max(0,I-e),M=U.mapOutputToInputTime(I);for(var n=R.length-1;I<=R[n].out_time&&n>=0;)R.pop(),n--;R.push({in_time:M,out_time:I,tempo:o})}},getTempo:function(){return o},setTempo:function(e){d=p=u,e>=1?p=Math.round(d/e):d=Math.round(p*e),j=(1/e-p/d)*d,F=function(e,t){for(var r=e.length/t|0,n=0,i=0;i<r;i++)n+=e[i*t];return .9/n}(h,p),o=e;var t=R[R.length-1];t.out_time==I?t.tempo=e:R.push({in_time:M,out_time:I,tempo:e})}};U.flush(0),U.setTempo(o);var K=function(e,t,r){var n=Math.floor(r),i=n%2==1?-1:1;return Math.atan2(i*(t[n]-t[n+1]),i*(e[n]-e[n+1]))},$=function(e,t,r,n,i){var o,a=2*Math.PI/s*.5*(n+t)*d;return((o=e-r-a)-2*Math.PI*Math.round(o/(2*Math.PI))+a)*i},z=function(e,t,r,n,i,o){for(var l=e%2,u=1-l,c=P[u],f=S[u],d=k[u],p=T[u],h=C[u],m=P[l],g=1;g<m.length;g++)m[g]=t[g]*t[g]+r[g]*r[g];var v=k[l],y=S[l]=function(e,t){for(var r=0,n=0;n<e.length;n++)e[n]>r&&(r=e[n]);var i=1e-8*r,o=1,s=1;for(t[0]=1,n=2;n<e.length;n++){var l=n*a;if(e[n]>i&&e[n]>e[n-1]&&e[n]>=e[n+1]){var u=n+(e[n-1]-e[n+1])/(2*(e[n-1]-2*e[n]+e[n+1]));u-t[o-1]>l?(t[o++]=u,s=n):e[n]>e[s]&&(t[o-1]=u,s=n)}}return o}(m,v),b=T[l],w=C[l];if(0!=e&&0!=y){var _=0;for(V=0;V<y;V++){for(B=v[V];v[V]>d[_]&&_!=f;)++_;var x=_;_>0&&B-d[_-1]<d[_]-B&&(x=_-1);var E=B*a;if(Math.abs(d[x]-B)<E&&c[Math.round(d[x])]>.1*m[Math.round(B)]){var M=K(t,r,B),I=p[x]+h[x]+$(M,B,p[x],d[x],o)-M;b[V]=M,w[V]=I,A[V]=Math.cos(I),O[V]=Math.sin(I)}else b[V]=K(t,r,B),w[V]=0,A[V]=1,O[V]=0}v[y]=2*s;var R=v[x=0],D=v[x+1],L=A[x],F=O[x];for(g=1;g<t.length-1;g++){g>=R&&g-R>D-g&&(R=v[++x],D=v[x+1],L=A[x],F=O[x]);var N=t[g]*L-r[g]*F,j=t[g]*F+r[g]*L;t[g]=N,r[g]=j}}else for(var V=0;V<y;V++){var B=v[V];p[V]=h[V]=K(t,r,B)}},W=function(){var e=0|(N+=2*j);N-=e;for(var t=0;t<s;t++)l.m_re[t]=h[t]*c[t],l.m_im[t]=h[t]*c[d+t];n.blit(c,2*d,c,0,s-d),l.inplace(!1),l.unpack(v,y,b,w),z(D,v,y,0,0,p/d),z(D+1,b,w,0,0,(p+e)/d),n.blit(b,0,_,0,g),n.blit(w,0,x,0,g),l.repack(v,y,b,w),l.inplace(!0);var r=f.length;for(n.blit(f,L,f,0,r-L),t=r-L;t<r;t++)f[t]=0;var i=0,o=F;for(t=0;t<p;t++)Math.abs(2*l.m_re[t])>i&&(i=Math.abs(2*l.m_re[t]));for(t=0;t<s-p;t++)Math.abs(l.m_re[t+p+e]+l.m_im[t])>i&&(i=Math.abs(l.m_re[t+p+e]+l.m_im[t]));for(t=s-p;t<s;t++)Math.abs(2*l.m_im[t])>i&&(i=Math.abs(2*l.m_im[t]));var a=1/Math.floor(s/(2*p));for(o*i>a&&(o=a/i),t=0;t<s;t++)f[t]+=o*l.m_re[t],f[t+p+e]+=o*l.m_im[t];return D+=2,L=2*p+e};return U.process=function(e){var r=e[0].length,i=e[0];if(e.length>1){i=n.float_array(e[0].length);for(var a=1/e.length,l=0;l<e.length;l++)for(var u=0;u<r;u++)i[u]+=a*e[l][u]}if(1==o){if(B+V>0){var h=B+V+r,m=[];for(l=0;l<e.length;l++){var g=n.float_array(h);n.blit(f,0,g,0,B),n.blit(c,0,g,B,V),n.blit(e[l],0,g,B+V,r),m.push(g)}U.flush(0),r=h,e=m}return M+=r/t,I+=r/t,e}var v=2*Math.floor(Math.max(0,V+r-(s-d))/(2*d)),y=B+p*v+Math.floor(N+j*v);B>y&&(y=B);var b=n.float_array(y);n.blit(f,0,b,0,B);for(var w=0,_=B,x=0,E=0;;){var S=s+d-V;if(w+S>r){n.blit(i,w,c,V,r-w),V+=r-w,w=r;break}S<=0?V-=2*d:(n.blit(i,w,c,V,S),w+=S,V=s-d),E=W(),M+=2*d/t,I+=E/t,(x=_+E-y)<0&&(x=0),n.blit(f,0,b,_,E-x),_+=E}n.blit(f,E-x,f,0,x),B=x;var k=[];for(l=0;l<e.length;l++)k.push(b);return k},U}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e){for(var t=1<<e,r={m_logN:e,m_N:t,m_invN:1/t,m_re:n.float_array(t),m_im:n.float_array(t),m_revTgt:Array(t)},i=0;i<t;i++){for(var o=i,a=0,s=0;s<e;s++)a<<=1,a|=1&o,o>>=1;r.m_revTgt[i]=a}r.twiddleRe=n.float_array(r.m_logN),r.twiddleIm=n.float_array(r.m_logN);for(var l=1,u=0;u<r.m_logN;u++){var c=2*l*Math.PI*r.m_invN;r.twiddleRe[u]=Math.cos(c),r.twiddleIm[u]=Math.sin(c),l<<=1}r.inplace=function(e){var t=r.m_re,n=r.m_im,i=r.m_N,o=r.m_logN,a=i>>1,s=i>>1,l=i;if(e)for(var u=1/i,c=0;c<i;c++)t[c]*=u,n[c]*=u;for(var f=0;f<o;f++){var d=r.twiddleRe[f],p=r.twiddleIm[f];e||(p*=-1);for(var h=0;h<i;){for(var m=h,g=h+s,v=1,y=0,b=0;b<a;b++){var w=t[m],_=n[m],x=t[g],E=n[g];t[m]=w+x,n[m]=_+E,x=w-x,E=_-E,t[g]=x*v-E*y,n[g]=x*y+E*v,m++,g++;var S=v;v=v*d-y*p,y=S*p+y*d}h+=l}a>>=1,s>>=1,l>>=1}for(var k,T,C=r.m_revTgt,P=0;P<i;P++)C[P]>P&&(T=t[k=C[P]],t[k]=t[P],t[P]=T,T=n[k],n[k]=n[P],n[P]=T)};var f=t>>1;return r.unpack=function(e,n,i,o){e[0]=r.m_re[0],i[0]=r.m_im[0],n[0]=o[0]=0,e[f]=r.m_re[f],i[f]=r.m_im[f],n[f]=o[f]=0;for(var a=1;a<f;a++)e[a]=(r.m_re[a]+r.m_re[t-a])/2,n[a]=(r.m_im[a]-r.m_im[t-a])/2,i[a]=(r.m_im[a]+r.m_im[t-a])/2,o[a]=(-r.m_re[a]+r.m_re[t-a])/2},r.repack=function(e,n,i,o){r.m_re[0]=e[0],r.m_im[0]=i[0],r.m_re[f]=e[f],r.m_im[f]=i[f];for(var a=1;a<f;a++)r.m_re[a]=e[a]-o[a],r.m_im[a]=n[a]+i[a],r.m_re[t-a]=e[a]+o[a],r.m_im[t-a]=-n[a]+i[a]},r}}],t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}()}])},893:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913));t.default=function(){function e(t){(0,i.default)(this,e),this.lower=t.start,this.upper=t.end,this.onprocess=t.process,this.position=0,this.n=0}return(0,o.default)(e,[{key:"iterate",value:function(){return this.n++,this.position=Math.floor((this.lower+this.upper)/2),this.onprocess(this.lower,this.upper,this.position)}},{key:"start",value:function(){return this.iterate(),this}},{key:"left",value:function(){return this.upper=this.position,this.iterate()}},{key:"right",value:function(){return this.lower=this.position,this.iterate()}}]),e}()},523:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913));t.default=new(function(){function e(){(0,i.default)(this,e)}return(0,o.default)(e,[{key:"hasTypedArrays",value:function(){return!!window.Uint32Array}},{key:"hasWebAssembly",value:function(){return!!window.WebAssembly}},{key:"hasWebAudio",value:function(){return!(!window.AudioContext&&!window.webkitAudioContext)}},{key:"hasFlash",value:function(){return!1}},{key:"hasAudio",value:function(){return this.hasWebAudio()}},{key:"isBlacklisted",value:function(e){return!1}},{key:"isSlow",value:function(){return!1}},{key:"isTooSlow",value:function(){return!1}},{key:"supported",value:function(e){return"OGVDecoder"===e?this.hasWebAssembly():"OGVPlayer"===e&&this.supported("OGVDecoder")&&this.hasAudio()}}]),e}())},408:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913)),a=n(r(205)),s=n(r(585)),l=n(r(754));t.default=function(e){(0,a.default)(n,e);var t,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,l.default)(n);return e=t?Reflect.construct(r,arguments,(0,l.default)(this).constructor):r.apply(this,arguments),(0,s.default)(this,e)});function n(){return(0,i.default)(this,n),r.apply(this,arguments)}return(0,o.default)(n,[{key:"init",value:function(e){this.proxy("init",[],e)}},{key:"processHeader",value:function(e,t){this.proxy("processHeader",[e],t,[e])}},{key:"processAudio",value:function(e,t){this.proxy("processAudio",[e],t,[e])}},{key:"close",value:function(){this.terminate()}}]),n}((0,n(r(580)).default)({loadedMetadata:!1,audioFormat:null,audioBuffer:null,cpuTime:0}))},319:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913)),a=n(r(205)),s=n(r(585)),l=n(r(754));t.default=function(e){(0,a.default)(n,e);var t,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,l.default)(n);return e=t?Reflect.construct(r,arguments,(0,l.default)(this).constructor):r.apply(this,arguments),(0,s.default)(this,e)});function n(){return(0,i.default)(this,n),r.apply(this,arguments)}return(0,o.default)(n,[{key:"init",value:function(e){this.proxy("init",[],e)}},{key:"processHeader",value:function(e,t){this.proxy("processHeader",[e],t,[e])}},{key:"processFrame",value:function(e,t){this.proxy("processFrame",[e],t,[e])}},{key:"close",value:function(){this.terminate()}},{key:"sync",value:function(){this.proxy("sync",[],function(){})}},{key:"recycleFrame",value:function(e){this.proxy("recycleFrame",[e],function(){},[e.y.bytes.buffer,e.u.bytes.buffer,e.v.bytes.buffer])}}]),n}((0,n(r(580)).default)({loadedMetadata:!1,videoFormat:null,frameBuffer:null,cpuTime:0}))},445:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913)),a=n(r(539)),s="1.8.9-20220406232920-cb5f7ff",l={OGVDemuxerOggW:"ogv-demuxer-ogg-wasm.js",OGVDemuxerWebMW:"ogv-demuxer-webm-wasm.js",OGVDecoderAudioOpusW:"ogv-decoder-audio-opus-wasm.js",OGVDecoderAudioVorbisW:"ogv-decoder-audio-vorbis-wasm.js",OGVDecoderVideoTheoraW:"ogv-decoder-video-theora-wasm.js",OGVDecoderVideoVP8W:"ogv-decoder-video-vp8-wasm.js",OGVDecoderVideoVP8MTW:"ogv-decoder-video-vp8-mt-wasm.js",OGVDecoderVideoVP9W:"ogv-decoder-video-vp9-wasm.js",OGVDecoderVideoVP9SIMDW:"ogv-decoder-video-vp9-simd-wasm.js",OGVDecoderVideoVP9MTW:"ogv-decoder-video-vp9-mt-wasm.js",OGVDecoderVideoVP9SIMDMTW:"ogv-decoder-video-vp9-simd-mt-wasm.js",OGVDecoderVideoAV1W:"ogv-decoder-video-av1-wasm.js",OGVDecoderVideoAV1SIMDW:"ogv-decoder-video-av1-simd-wasm.js",OGVDecoderVideoAV1MTW:"ogv-decoder-video-av1-mt-wasm.js",OGVDecoderVideoAV1SIMDMTW:"ogv-decoder-video-av1-simd-mt-wasm.js"};t.default=function(){function e(){(0,i.default)(this,e),this.base=this.defaultBase()}return(0,o.default)(e,[{key:"defaultBase",value:function(){}},{key:"wasmSupported",value:function(){return a.default.wasmSupported()}},{key:"scriptForClass",value:function(e){return l[e]}},{key:"urlForClass",value:function(e){var t=this.scriptForClass(e);if(t)return this.urlForScript(t);throw Error("asked for URL for unknown class "+e)}},{key:"urlForScript",value:function(e){if(e){var t=this.base;return void 0===t?t="":t+="/",t+e+"?version="+encodeURIComponent(s)}throw Error("asked for URL for unknown script "+e)}},{key:"loadClass",value:function(e,t,r){var n=this;r=r||{};var i=this.getGlobal(),o=this.urlForClass(e),a=function(t){return(t=t||{}).locateFile=function(e){return"data:"===e.slice(0,5)?e:n.urlForScript(e)},t.mainScriptUrlOrBlob=n.scriptForClass(e)+"?version="+encodeURIComponent(s),i[e](t)};"function"==typeof i[e]?t(a):this.loadScript(o,function(){t(a)})}}]),e}()},964:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913)),a=n(r(525)),s=n(r(205)),l=n(r(585)),u=n(r(754)),c=n(r(408)),f=n(r(319)),d=n(r(445)),p={audio:{proxy:c.default,worker:"ogv-worker-audio.js"},video:{proxy:f.default,worker:"ogv-worker-video.js"}},h={OGVDecoderAudioOpusW:"audio",OGVDecoderAudioVorbisW:"audio",OGVDecoderVideoTheoraW:"video",OGVDecoderVideoVP8W:"video",OGVDecoderVideoVP9W:"video",OGVDecoderVideoVP9SIMDW:"video",OGVDecoderVideoAV1W:"video",OGVDecoderVideoAV1SIMDW:"video"},m=new(function(e){(0,s.default)(n,e);var t,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,u.default)(n);return e=t?Reflect.construct(r,arguments,(0,u.default)(this).constructor):r.apply(this,arguments),(0,l.default)(this,e)});function n(){var e;return(0,i.default)(this,n),(e=r.call(this)).scriptStatus={},e.scriptCallbacks={},e}return(0,o.default)(n,[{key:"getGlobal",value:function(){return window}},{key:"defaultBase",value:function(){for(var e,t,r=document.querySelectorAll("script"),n=/^(?:|(.*)\/)ogv(?:-support|-es2017)?\.js(?:\?|#|$)/,i=0;i<r.length;i++)if((e=r[i].getAttribute("src"))&&(t=e.match(n)))return t[1]}},{key:"loadClass",value:function(e,t,r){(r=r||{}).worker?this.workerProxy(e,t):(0,a.default)((0,u.default)(n.prototype),"loadClass",this).call(this,e,t,r)}},{key:"loadScript",value:function(e,t){var r=this;if("done"==this.scriptStatus[e])t();else if("loading"==this.scriptStatus[e])this.scriptCallbacks[e].push(t);else{this.scriptStatus[e]="loading",this.scriptCallbacks[e]=[t];var n=document.createElement("script"),i=function(t){var n=r.scriptCallbacks[e];delete r.scriptCallbacks[e],r.scriptStatus[e]="done",n.forEach(function(e){e()})};n.addEventListener("load",i),n.addEventListener("error",i),n.src=e,document.querySelector("head").appendChild(n)}}},{key:"workerProxy",value:function(e,t){var r=p[h[e]];if(!r)throw Error("Requested worker for class with no proxy: "+e);var n,i=r.proxy,o=r.worker,a=this.urlForScript(this.scriptForClass(e)),s=this.urlForScript(o),l=function(t){return new i(n,e,t)};if(s.match(/^https?:|\/\//i)){var u,c,f,d,g,v=function(){if(1==y&&1==b){var e=f+" "+d+"\nOGVLoader.base = "+JSON.stringify(m.base);try{g=new Blob([e],{type:"application/javascript"})}catch(t){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,(g=new BlobBuilder).append(e),g=g.getBlob()}n=new Worker(URL.createObjectURL(g)),t(function(e){return Promise.resolve(new l(e))})}},y=!1,b=!1;(u=new XMLHttpRequest).open("GET",a,!0),u.onreadystatechange=function(){4==u.readyState&&200==u.status&&(f=u.responseText,y=!0,v())},u.send(),(c=new XMLHttpRequest).open("GET",s,!0),c.onreadystatechange=function(){4==c.readyState&&200==c.status&&(d=c.responseText,b=!0,v())},c.send()}else n=new Worker(s),t(function(e){return Promise.resolve(new l(e))})}}]),n}(d.default));t.default=m},759:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(913)),o=n(r(575)),a=n(r(309)),s={MEDIA_ERR_ABORTED:1,MEDIA_ERR_NETWORK:2,MEDIA_ERR_DECODE:3,MEDIA_ERR_SRC_NOT_SUPPORTED:4},l=(0,i.default)(function e(t,r){(0,o.default)(this,e),this.code=t,this.message=r});(0,a.default)(l,s),(0,a.default)(l.prototype,s),t.default=l},278:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(913)),o=n(r(575));function a(e,t,r){var n=e.split(t,r).map(function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")});if("number"==typeof r)for(;n.length<r;)n.push(null);return n}t.default=(0,i.default)(function e(t){(0,o.default)(this,e),t=String(t),this.major=null,this.minor=null,this.codecs=null;var r=a(t,";");if(r.length){var n=r.shift();if(n){var i=a(n,"/",2);this.major=i[0],this.minor=i[1]}for(var s in r){var l=r[s].match(/^codecs\s*=\s*"(.*?)"$/);if(l){this.codecs=a(l[1],",");break}}}})},869:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=n(r(575)),a=n(r(913)),s=n(r(506)),l=n(r(205)),u=n(r(585)),c=n(r(754)),f=n(r(8)),d=n(r(731)),p=n(r(936)),h=n(r(848)),m=n(r(964)),g=n(r(893)),v=n(r(309)),y=n(r(759)),b=n(r(278)),w=n(r(168)),_=n(r(625)),x=n(r(302)),E=function(){if("function"==typeof setImmediate)return setImmediate;var e=new MessageChannel,t=[];return e.port1.onmessage=function(e){t.shift()()},function(r){t.push(r),e.port2.postMessage({})}}(),S={NETWORK_EMPTY:0,NETWORK_IDLE:1,NETWORK_LOADING:2,NETWORK_NO_SOURCE:3,HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},k="INITIAL",T="SEEKING_END",C="LOADED",P="PRELOAD",A="READY",O="PLAYING",M="SEEKING",I="ERROR",R="NOT_SEEKING",D="BISECT_TO_TARGET",L="BISECT_TO_KEYPOINT",F="LINEAR_TO_TARGET",N="fast";function j(){var e=document.createElement("ogvjs");return Object.setPrototypeOf?Object.setPrototypeOf(e,Object.getPrototypeOf(this)):e.__proto__=this.__proto__,e}i="u"<typeof performance||void 0===(0,f.default)(performance.now)?Date.now:performance.now.bind(performance),j.prototype=Object.create(HTMLElement.prototype,{});var V=function(e){(0,l.default)(n,e);var t,r=(t=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,r=(0,c.default)(n);return e=t?Reflect.construct(r,arguments,(0,c.default)(this).constructor):r.apply(this,arguments),(0,u.default)(this,e)});function n(e){var t;if((0,o.default)(this,n),t=r.call(this),(e=e||{}).base=e.base||m.default.base,t._options=e,t._instanceId="ogvjs"+ ++n.instanceCount,void 0!==e.worker?t._enableWorker=!!e.worker:t._enableWorker=!!window.Worker,!m.default.wasmSupported())throw Error("WebAssembly not supported");return t._enableThreading=!!e.threading,t._enableSIMD=!!e.simd,t._state=k,t._seekState=R,t._detectedType=null,t._canvas=document.createElement("canvas"),t._frameSink=null,t.className=t._instanceId,(0,v.default)((0,s.default)(t),S),t._view=t._canvas,t._view.style.position="absolute",t._view.style.top="0",t._view.style.left="0",t._view.style.width="100%",t._view.style.height="100%",t._view.style.objectFit="contain",t.appendChild(t._view),t._startTime=i(),t._codec=null,t._audioInfo=null,t._videoInfo=null,t._actionQueue=[],t._audioFeeder=null,t._muted=!1,t._initialPlaybackPosition=0,t._initialPlaybackOffset=0,t._prebufferingAudio=!1,t._initialSeekTime=0,t._currentSrc="",t._crossOrigin=null,t._streamEnded=!1,t._mediaError=null,t._dataEnded=!1,t._byteLength=0,t._duration=null,t._lastSeenTimestamp=null,t._nextProcessingTimer,t._nextFrameTimer=null,t._loading=!1,t._started=!1,t._paused=!0,t._ended=!1,t._startedPlaybackInDocument=!1,t._stream=void 0,t._framesProcessed=0,t._targetPerFrameTime=1e3/60,t._actualPerFrameTime=0,t._totalFrameTime=0,t._totalFrameCount=0,t._playTime=0,t._bufferTime=0,t._drawingTime=0,t._proxyTime=0,t._totalJitter=0,t._droppedAudio=0,t._delayedAudio=0,t._lateFrames=0,t._poster="",t._thumbnail=null,t._frameEndTimestamp=0,t._audioEndTimestamp=0,t._decodedFrames=[],t._pendingFrames=[],t._lastFrameDecodeTime=0,t._lastFrameVideoCpuTime=0,t._lastFrameAudioCpuTime=0,t._lastFrameDemuxerCpuTime=0,t._lastFrameDrawingTime=0,t._lastFrameBufferTime=0,t._lastFrameProxyTime=0,t._lastVideoCpuTime=0,t._lastAudioCpuTime=0,t._lastDemuxerCpuTime=0,t._lastBufferTime=0,t._lastProxyTime=0,t._lastDrawingTime=0,t._lastFrameTimestamp=0,t._currentVideoCpuTime=0,t._lastTimeUpdate=0,t._timeUpdateInterval=250,t._seekTargetTime=0,t._bisectTargetTime=0,t._seekMode=null,t._lastSeekPosition=null,t._seekBisector=null,t._didSeek=null,t._depth=0,t._needProcessing=!1,t._pendingFrame=0,t._pendingAudio=0,t._framePipelineDepth=8,t._frameParallelism=t._enableThreading?Math.min(16,navigator.hardwareConcurrency)||1:0,t._audioPipelineDepth=12,t._videoInfo=null,t._audioInfo=null,t._width=0,t._height=0,t._volume=1,t._playbackRate=1,Object.defineProperties((0,s.default)(t),{src:{get:function(){return this.getAttribute("src")||""},set:function(e){this.setAttribute("src",e),this._loading=!1,this._prepForLoad("interactive")}},buffered:{get:function(){var e,t=this;return e=this._stream&&this._byteLength&&this._duration?this._stream.getBufferedRanges().map(function(e){return e.map(function(e){return e/t._stream.length*t._duration})}):[[0,0]],new w.default(e)}},seekable:{get:function(){return new w.default(this.duration<1/0&&this._stream&&this._stream.seekable&&this._codec&&this._codec.seekable?[[0,this._duration]]:[])}},currentTime:{get:function(){return this._state==M?this._seekTargetTime:this._codec?this._state!=O||this._paused?this._initialPlaybackOffset:this._getPlaybackTime():this._initialSeekTime},set:function(e){this._seek(e,"exact")}},duration:{get:function(){return this._codec&&this._codec.loadedMetadata?null!==this._duration?this._duration:1/0:NaN}},paused:{get:function(){return this._paused}},ended:{get:function(){return this._ended}},seeking:{get:function(){return this._state==M}},muted:{get:function(){return this._muted},set:function(e){this._muted=e,this._audioFeeder?this._audioFeeder.muted=this._muted:this._started&&!this._muted&&this._codec&&this._codec.hasAudio&&(this._log("unmuting: switching from timer to audio clock"),this._initAudioFeeder(),this._startPlayback(this._audioEndTimestamp)),this._fireEventAsync("volumechange")}},poster:{get:function(){return this._poster},set:function(e){var t=this;if(this._poster=e,!this._started){this._thumbnail&&this.removeChild(this._thumbnail);var r=new Image;r.crossOrigin=this.crossOrigin,r.src=this._poster,r.className="ogvjs-poster",r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.objectFit="contain",r.style.visibility="hidden",r.addEventListener("load",function(){t._thumbnail===r&&(n.styleManager.appendRule("."+t._instanceId,{width:r.naturalWidth+"px",height:r.naturalHeight+"px"}),r.style.visibility="visible")}),this._thumbnail=r,this.appendChild(r)}}},videoWidth:{get:function(){return this._videoInfo?this._videoInfo.displayWidth:0}},videoHeight:{get:function(){return this._videoInfo?this._videoInfo.displayHeight:0}},ogvjsVideoFrameRate:{get:function(){return this._videoInfo?0==this._videoInfo.fps?this._totalFrameCount/(this._totalFrameTime/1e3):this._videoInfo.fps:0}},ogvjsAudioChannels:{get:function(){return this._audioInfo?this._audioInfo.channels:0}},ogvjsAudioSampleRate:{get:function(){return this._audioInfo?this._audioInfo.rate:0}},width:{get:function(){return this._width},set:function(e){this._width=parseInt(e,10),this.style.width=this._width+"px"}},height:{get:function(){return this._height},set:function(e){this._height=parseInt(e,10),this.style.height=this._height+"px"}},autoplay:{get:function(){return!1},set:function(e){}},controls:{get:function(){return!1},set:function(e){}},loop:{get:function(){return!1},set:function(e){}},crossOrigin:{get:function(){return this._crossOrigin},set:function(e){switch(e){case null:this._crossOrigin=e,this.removeAttribute("crossorigin");break;default:e="anonymous";case"":case"anonymous":case"use-credentials":this._crossOrigin=e,this.setAttribute("crossorigin",e)}this._thumbnail&&(this._thumbnail.crossOrigin=e)}},currentSrc:{get:function(){return this._currentSrc}},defaultMuted:{get:function(){return!1}},defaultPlaybackRate:{get:function(){return 1}},error:{get:function(){return this._state===I?this._mediaError?this._mediaError:new y.default("unknown error occurred in media procesing"):null}},preload:{get:function(){return this.getAttribute("preload")||""},set:function(e){this.setAttribute("preload",e)}},readyState:{get:function(){return this._stream&&this._codec&&this._codec.loadedMetadata?n.HAVE_ENOUGH_DATA:n.HAVE_NOTHING}},networkState:{get:function(){return this._stream?this._stream.waiting?n.NETWORK_LOADING:n.NETWORK_IDLE:this.readyState==n.HAVE_NOTHING?n.NETWORK_EMPTY:n.NETWORK_NO_SOURCE}},playbackRate:{get:function(){return this._playbackRate},set:function(e){var t=Number(e)||1;this._audioFeeder?this._audioFeeder.tempo=t:this._paused||(this._initialPlaybackOffset=this._getPlaybackTime(),this._initialPlaybackPosition=t*i()/1e3),this._playbackRate=t,this._fireEventAsync("ratechange")}},played:{get:function(){return new w.default([[0,this.currentTime]])}},volume:{get:function(){return this._volume},set:function(e){this._volume=+e,this._audioFeeder&&(this._audioFeeder.volume=this._volume),this._fireEventAsync("volumechange")}}}),t.onframecallback=null,t.onloadstate=null,t.onprogress=null,t.onsuspend=null,t.onabort=null,t.onemptied=null,t.onstalled=null,t.onloadedmetadata=null,t.onloadeddata=null,t.oncanplay=null,t.oncanplaythrough=null,t.onplaying=null,t.onwaiting=null,t.onseeking=null,t.onseeked=null,t.onended=null,t.ondurationchange=null,t.ontimeupdate=null,t.onplay=null,t.onpause=null,t.onratechange=null,t.onresize=null,t.onvolumechange=null,t.onaudiofeedercreated=null,t}return(0,a.default)(n,[{key:"_time",value:function(e){var t=i();e();var r=i()-t;return this._lastFrameDecodeTime+=r,r}},{key:"_log",value:function(e){var t=this._options;if(t.debug){var r=i()-this._startTime;t.debugFilter&&!e.match(t.debugFilter)||console.log("["+Math.round(10*r)/10+"ms] "+e)}}},{key:"_fireEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._log("fireEvent "+e);var r,n="function"==typeof Event;for(var i in n?r=new CustomEvent(e):(r=document.createEvent("Event")).initEvent(e,!1,!1),t)t.hasOwnProperty(i)&&(r[i]=t[i]);var o=this.dispatchEvent(r);!n&&"resize"===e&&this.onresize&&o&&this.onresize.call(this,r)}},{key:"_fireEventAsync",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._log("fireEventAsync "+e),E(function(){t._fireEvent(e,r)})}},{key:"_initAudioFeeder",value:function(){var e=this,t=this._options,r={bufferSize:8192};t.audioContext&&(r.audioContext=t.audioContext),t.audioDestination&&(r.output=t.audioDestination),t.audioBackendFactory&&(r.backendFactory=t.audioBackendFactory);var n=this._audioFeeder=new h.default(r);n.init(this._audioInfo.channels,this._audioInfo.rate),this.onaudiofeedercreated&&this.onaudiofeedercreated(this._audioFeeder),n.bufferThreshold=1,n.volume=this.volume,n.muted=this.muted,n.tempo=this.playbackRate,n.onbufferlow=function(){e._log("onbufferlow"),e._stream&&(e._stream.buffering||e._stream.seeking)||e._pendingAudio||e._pingProcessing()},n.onstarved=function(){e._dataEnded?e._log("onstarved: appear to have reached end of audio"):(e._log("onstarved: halting audio due to starvation"),e._stopPlayback(),e._prebufferingAudio=!0),e._isProcessing()||e._pingProcessing(0)}}},{key:"_startPlayback",value:function(e){if(this._audioFeeder){this._audioFeeder.start();var t=this._audioFeeder.getPlaybackState();this._initialPlaybackPosition=t.playbackPosition}else this._initialPlaybackPosition=this._playbackRate*i()/1e3;void 0!==e&&(this._initialPlaybackOffset=e),this._prebufferingAudio=!1,this._log("continuing at "+this._initialPlaybackPosition+", "+this._initialPlaybackOffset)}},{key:"_stopPlayback",value:function(){this._initialPlaybackOffset=this._getPlaybackTime(),this._log("pausing at "+this._initialPlaybackOffset),this._audioFeeder&&this._audioFeeder.stop()}},{key:"_getPlaybackTime",value:function(e){return this._prebufferingAudio||this._paused?this._initialPlaybackOffset:(this._audioFeeder?(e=e||this._audioFeeder.getPlaybackState()).playbackPosition:this._playbackRate*i()/1e3)-this._initialPlaybackPosition+this._initialPlaybackOffset}},{key:"_stopVideo",value:function(){this._log("STOPPING"),this._state=k,this._seekState=R,this._started=!1,this._ended=!1,this._frameEndTimestamp=0,this._audioEndTimestamp=0,this._lastFrameDecodeTime=0,this._prebufferingAudio=!1,this._actionQueue.splice(0,this._actionQueue.length),this._stream&&(this._stream.abort(),this._stream=null,this._streamEnded=!1),this._codec&&(this._codec.close(),this._codec=null,this._pendingFrame=0,this._pendingAudio=0,this._dataEnded=!1),this._videoInfo=null,this._audioInfo=null,this._audioFeeder&&(this._audioFeeder.close(),this._audioFeeder=null),this._nextProcessingTimer&&(clearTimeout(this._nextProcessingTimer),this._nextProcessingTimer=null),this._nextFrameTimer&&(clearTimeout(this._nextFrameTimer),this._nextFrameTimer=null),this._frameSink&&(this._frameSink.clear(),this._frameSink=null),this._decodedFrames&&(this._decodedFrames=[]),this._pendingFrames&&(this._pendingFrames=[]),this._initialSeekTime=0,this._initialPlaybackPosition=0,this._initialPlaybackOffset=0,this._duration=null}},{key:"_doFrameComplete",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._startedPlaybackInDocument&&!document.body.contains(this)&&E(function(){e.stop()});var r=i(),n=r-this._lastFrameTimestamp,o=this._actualPerFrameTime-this._targetPerFrameTime;this._totalJitter+=Math.abs(o),this._playTime+=n;var a={cpuTime:this._lastFrameDecodeTime,drawingTime:this._drawingTime-this._lastFrameDrawingTime,bufferTime:this._bufferTime-this._lastFrameBufferTime,proxyTime:this._proxyTime-this._lastFrameProxyTime,demuxerTime:0,videoTime:0,audioTime:0,clockTime:this._actualPerFrameTime,late:t.dropped,dropped:t.dropped};function s(e){return Math.round(10*e)/10}this._codec&&(a.demuxerTime=this._codec.demuxerCpuTime-this._lastFrameDemuxerCpuTime,a.videoTime+=this._currentVideoCpuTime-this._lastFrameVideoCpuTime,a.audioTime+=this._codec.audioCpuTime-this._lastFrameAudioCpuTime),a.cpuTime+=a.demuxerTime,this._lastFrameDecodeTime=0,this._lastFrameTimestamp=r,this._codec?(this._lastFrameVideoCpuTime=this._currentVideoCpuTime,this._lastFrameAudioCpuTime=this._codec.audioCpuTime,this._lastFrameDemuxerCpuTime=this._codec.demuxerCpuTime):(this._lastFrameVideoCpuTime=0,this._lastFrameAudioCpuTime=0,this._lastFrameDemuxerCpuTime=0),this._lastFrameDrawingTime=this._drawingTime,this._lastFrameBufferTime=this._bufferTime,this._lastFrameProxyTime=this._proxyTime,this._log("drew frame "+t.frameEndTimestamp+": clock time "+s(n)+" (jitter "+s(o)+") cpu: "+s(a.cpuTime)+" (mux: "+s(a.demuxerTime)+" buf: "+s(a.bufferTime)+" draw: "+s(a.drawingTime)+" proxy: "+s(a.proxyTime)+") vid: "+s(a.videoTime)+" aud: "+s(a.audioTime)),this._fireEventAsync("framecallback",a),(!this._lastTimeUpdate||r-this._lastTimeUpdate>=this._timeUpdateInterval)&&(this._lastTimeUpdate=r,this._fireEventAsync("timeupdate")),this._codec&&t.yCbCrBuffer&&this._codec.recycleFrame(t.yCbCrBuffer)}},{key:"_seekStream",value:function(e){var t=this;this._stream.seeking&&this._stream.abort(),this._stream.buffering&&this._stream.abort(),this._streamEnded=!1,this._dataEnded=!1,this._ended=!1,this._stream.seek(e).then(function(){t._readBytesAndWait()}).catch(function(e){t._onStreamError(e)})}},{key:"_onStreamError",value:function(e){"AbortError"===e.name?this._log("i/o promise canceled; ignoring"):(this._log("i/o error: "+e),this._mediaError=new y.default(y.default.MEDIA_ERR_NETWORK,String(e)),this._state=I,this._stopPlayback())}},{key:"_seek",value:function(e,t){var r=this;if(this._log("requested seek to "+e+", mode "+t),this.readyState==this.HAVE_NOTHING)return this._log("not yet loaded; saving seek position for later"),void(this._initialSeekTime=e);if(this._stream&&!this._stream.seekable)throw Error("Cannot seek a non-seekable stream");if(this._codec&&!this._codec.seekable)throw Error("Cannot seek in a non-seekable file");var n=function(n){r._stream&&r._stream.buffering&&r._stream.abort(),r._stream&&r._stream.seeking&&r._stream.abort(),r._actionQueue.splice(0,r._actionQueue.length),r._stopPlayback(),r._prebufferingAudio=!1,r._audioFeeder&&r._audioFeeder.flush(),r._state=M,r._seekTargetTime=e,r._seekMode=t,r._codec?r._codec.flush(n):n()};n(function(){r._isProcessing()||r._pingProcessing(0)}),this._actionQueue.push(function(){n(function(){r._doSeek(e)})})}},{key:"_doSeek",value:function(e){var t=this;this._streamEnded=!1,this._dataEnded=!1,this._ended=!1,this._state=M,this._seekTargetTime=e,this._lastSeekPosition=-1,this._decodedFrames=[],this._pendingFrames=[],this._pendingFrame=0,this._pendingAudio=0,this._didSeek=!1,this._codec.seekToKeypoint(e,function(r){r?(t._seekState=F,t._fireEventAsync("seeking"),t._didSeek||t._pingProcessing()):t._codec.getKeypointOffset(e,function(e){e>0?(t._seekState=F,t._seekStream(e)):(t._seekState=D,t._startBisection(t._seekTargetTime)),t._fireEventAsync("seeking")})})}},{key:"_startBisection",value:function(e){var t=this,r=Math.max(0,this._stream.length-65536);this._bisectTargetTime=e,this._seekBisector=new g.default({start:0,end:r,process:function(e,r,n){return n!=t._lastSeekPosition&&(t._lastSeekPosition=n,t._codec.flush(function(){t._seekStream(n)}),!0)}}),this._seekBisector.start()}},{key:"_continueSeekedPlayback",value:function(){var e=this;this._seekState=R,this._state=A,this._frameEndTimestamp=this._codec.frameTimestamp,this._audioEndTimestamp=this._codec.audioTimestamp,this._codec.hasAudio?this._seekTargetTime=this._codec.audioTimestamp:this._seekTargetTime=this._codec.frameTimestamp,this._initialPlaybackOffset=this._seekTargetTime;var t=function(){e._lastTimeUpdate=e._seekTargetTime,e._fireEventAsync("timeupdate"),e._fireEventAsync("seeked"),e._isProcessing()||e._pingProcessing()};if(this._codec.hasVideo&&this._decodedFrames.length){var r=this._decodedFrames.shift();this._drawFrame(r.yCbCrBuffer),t()}else{if(this._codec.hasVideo&&this._codec.frameReady)return this._codec.decodeFrame(function(r){r&&e._drawFrame(e._codec.frameBuffer),t()}),void this._codec.sync();t()}}},{key:"_drawFrame",value:function(e){this._thumbnail&&(this.removeChild(this._thumbnail),this._thumbnail=null),this._frameSink.drawFrame(e)}},{key:"_doProcessLinearSeeking",value:function(){var e,t=this;if(e=this._codec.hasVideo?this._targetPerFrameTime/1e3:1/256,this._codec.hasVideo){if(this._pendingFrame)return;if(!this._codec.frameReady)return void this._codec.process(function(e){e?t._pingProcessing():t._streamEnded?(t._log("stream ended during linear seeking on video"),t._dataEnded=!0,t._continueSeekedPlayback()):t._readBytesAndWait()});if(this._seekMode===N&&this._codec.keyframeTimestamp==this._codec.frameTimestamp)return void this._continueSeekedPlayback();if(this._codec.frameTimestamp<=this._seekTargetTime){var r=this._codec.frameTimestamp;return this._pendingFrame++,this._pendingFrames.push({frameEndTimestamp:r}),this._decodedFrames.splice(0,this._decodedFrames.length),this._codec.decodeFrame(function(e){t._pendingFrame--,t._pendingFrames.shift(),t._decodedFrames.push({yCbCrBuffer:t._codec.frameBuffer,videoCpuTime:t._codec.videoCpuTime,frameEndTimestamp:r}),t._pingProcessing()}),void this._codec.sync()}if(!this._codec.hasAudio)return void this._continueSeekedPlayback()}if(this._codec.hasAudio){if(this._pendingAudio)return;return this._codec.audioReady?this._codec.audioTimestamp+e<this._seekTargetTime?void this._codec.decodeAudio(function(){t._pingProcessing()}):void this._continueSeekedPlayback():void this._codec.process(function(e){e?t._pingProcessing():t._streamEnded?(t._log("stream ended during linear seeking on audio"),t._dataEnded=!0,t._continueSeekedPlayback()):t._readBytesAndWait()})}}},{key:"_doProcessBisectionSeek",value:function(){var e,t,r=this;if(this._codec.hasVideo)t=this._codec.frameTimestamp,e=this._targetPerFrameTime/1e3;else{if(!this._codec.hasAudio)throw Error("Invalid seek state; no audio or video track available");t=this._codec.audioTimestamp,e=1/256}t<0?this._codec.process(function(e){if(e)r._pingProcessing();else if(r._streamEnded){if(r._log("stream ended during bisection seek"),!r._seekBisector.right())throw r._log("failed going back"),Error("not sure what to do")}else r._readBytesAndWait()}):t-e/2>this._bisectTargetTime?this._seekBisector.left()||(this._log("close enough (left)"),this._seekTargetTime=t,this._continueSeekedPlayback()):t+e/2<this._bisectTargetTime?this._seekBisector.right()||(this._log("close enough (right)"),this._seekState=F,this._pingProcessing()):this._seekState==D&&this._codec.hasVideo&&this._codec.keyframeTimestamp<this._codec.frameTimestamp?(this._log("finding the keypoint now"),this._seekState=L,this._startBisection(this._codec.keyframeTimestamp)):(this._log("straight seeking now"),this._seekState=F,this._pingProcessing())}},{key:"_setupVideo",value:function(){this._videoInfo.fps>0?this._targetPerFrameTime=1e3/this._videoInfo.fps:this._targetPerFrameTime=16.667,this._canvas.width=this._videoInfo.displayWidth,this._canvas.height=this._videoInfo.displayHeight,n.styleManager.appendRule("."+this._instanceId,{width:this._videoInfo.displayWidth+"px",height:this._videoInfo.displayHeight+"px"});var e={};void 0!==this._options.webGL&&(e.webGL=this._options.webGL),this._options.forceWebGL&&(e.webGL="required"),this._frameSink=d.default.attach(this._canvas,e)}},{key:"_doProcessing",value:function(){if(this._didSeek&&(this._didSeek=!1),this._nextProcessingTimer=null,this._isProcessing(),this._depth>0)throw Error("REENTRANCY FAIL: doProcessing recursing unexpectedly");var e=0;do{if(this._needProcessing=!1,this._depth++,this._doProcessingLoop(),this._depth--,this._needProcessing&&this._isProcessing())throw Error("REENTRANCY FAIL: waiting on input or codec but asked to keep processing");++e>500&&(this._log("stuck in processing loop; breaking with timer"),this._needProcessing=0,this._pingProcessing(0))}while(this._needProcessing)}},{key:"_doProcessingLoop",value:function(){if(this._actionQueue.length)this._actionQueue.shift()();else if(this._state==k)this._doProcessInitial();else if(this._state==T)this._doProcessSeekingEnd();else if(this._state==C)this._doProcessLoaded();else if(this._state==P)this._doProcessPreload();else if(this._state==A)this._doProcessReady();else if(this._state==M)this._doProcessSeeking();else if(this._state==O)this._doProcessPlay();else{if(this._state!=I)throw Error("Unexpected OGVPlayer state "+this._state);this._doProcessError()}}},{key:"_doProcessInitial",value:function(){var e=this;if(this._codec.loadedMetadata){if(!this._codec.hasVideo&&!this._codec.hasAudio)throw Error("No audio or video found, something is wrong");this._codec.hasAudio&&(this._audioInfo=this._codec.audioFormat),this._codec.hasVideo&&(this._videoInfo=this._codec.videoFormat,this._setupVideo()),isNaN(this._codec.duration)||(this._duration=this._codec.duration),null===this._duration&&this._stream.seekable&&"video/ogg"==this._detectedType?(this._state=T,this._lastSeenTimestamp=-1,this._codec.flush(function(){e._seekStream(Math.max(0,e._stream.length-131072))})):(this._state=C,this._pingProcessing())}else this._codec.process(function(t){if(t)e._pingProcessing();else{if(e._streamEnded)throw Error("end of file before headers found");e._log("reading more cause we are out of data"),e._readBytesAndWait()}})}},{key:"_doProcessSeekingEnd",value:function(){var e=this;this._codec.frameReady?(this._log("saw frame with "+this._codec.frameTimestamp),this._lastSeenTimestamp=Math.max(this._lastSeenTimestamp,this._codec.frameTimestamp),this._codec.discardFrame(function(){e._pingProcessing()})):this._codec.audioReady?(this._log("saw audio with "+this._codec.audioTimestamp),this._lastSeenTimestamp=Math.max(this._lastSeenTimestamp,this._codec.audioTimestamp),this._codec.discardAudio(function(){e._pingProcessing()})):this._codec.process(function(t){t?e._pingProcessing():e._stream.eof?(e._log("seek-duration: we are at the end: "+e._lastSeenTimestamp),e._lastSeenTimestamp>0&&(e._duration=e._lastSeenTimestamp),e._state=C,e._codec.flush(function(){e._streamEnded=!1,e._dataEnded=!1,e._seekStream(0)})):e._readBytesAndWait()})}},{key:"_doProcessLoaded",value:function(){this._state=P,this._fireEventAsync("loadedmetadata"),this._fireEventAsync("durationchange"),this._codec.hasVideo&&this._fireEventAsync("resize"),this._pingProcessing(0)}},{key:"_doProcessPreload",value:function(){var e=this;!this._codec.frameReady&&this._codec.hasVideo||!this._codec.audioReady&&this._codec.hasAudio?this._codec.process(function(t){t?e._pingProcessing():e._streamEnded?e._ended=!0:e._readBytesAndWait()}):(this._state=A,this._fireEventAsync("loadeddata"),this._pingProcessing())}},{key:"_doProcessReady",value:function(){var e=this;if(this._log("initial seek to "+this._initialSeekTime),this._initialSeekTime>0){var t=this._initialSeekTime;this._initialSeekTime=0,this._log("initial seek to "+t),this._doSeek(t)}else if(this._paused)this._log("paused while in ready");else{var r=function(){e._log("finishStartPlaying"),e._state=O,e._lastFrameTimestamp=i(),e._codec.hasAudio&&e._audioFeeder?e._prebufferingAudio=!0:e._startPlayback(),e._pingProcessing(0),e._fireEventAsync("play"),e._fireEventAsync("playing")};!this._codec.hasAudio||this._audioFeeder||this._muted?r():(this._initAudioFeeder(),this._audioFeeder.waitUntilReady(r))}}},{key:"_doProcessSeeking",value:function(){if(this._seekState==R)throw Error("seeking in invalid state (not seeking?)");if(this._seekState==D)this._doProcessBisectionSeek();else if(this._seekState==L)this._doProcessBisectionSeek();else{if(this._seekState!=F)throw Error("Invalid seek state "+this._seekState);this._doProcessLinearSeeking()}}},{key:"_doProcessPlay",value:function(){var e=this,t=this._codec;if(this._paused)this._log("paused during playback; stopping loop");else if((!t.hasAudio||t.audioReady||this._pendingAudio||this._dataEnded)&&(!t.hasVideo||t.frameReady||this._pendingFrame||this._decodedFrames.length||this._dataEnded)){var r,n,i,o=null,a=0,s=!1,l=0;if(t.hasAudio&&this._audioFeeder?(o=this._audioFeeder.getPlaybackState(),a=this._getPlaybackTime(o),s=this._dataEnded&&0==this._audioFeeder.durationBuffered,this._prebufferingAudio&&(this._audioFeeder.durationBuffered>=2*this._audioFeeder.bufferThreshold&&(!t.hasVideo||this._decodedFrames.length>=this._framePipelineDepth)||this._dataEnded)&&(this._log("prebuffering audio done; buffered to "+this._audioFeeder.durationBuffered),this._startPlayback(a),this._prebufferingAudio=!1),o.dropped!=this._droppedAudio&&this._log("dropped "+(o.dropped-this._droppedAudio)),o.delayed!=this._delayedAudio&&this._log("delayed "+(o.delayed-this._delayedAudio)),this._droppedAudio=o.dropped,this._delayedAudio=o.delayed,(r=this._audioFeeder.durationBuffered<=2*this._audioFeeder.bufferThreshold)&&(this._codec.audioReady?this._pendingAudio>=this._audioPipelineDepth&&(this._log("audio decode disabled: "+this._pendingAudio+" packets in flight"),r=!1):r=!1)):(a=this._getPlaybackTime(),r=this._codec.audioReady&&this._audioEndTimestamp<a),this._codec.hasVideo){n=this._decodedFrames.length>0,i=this._pendingFrame+this._decodedFrames.length<this._framePipelineDepth+this._frameParallelism&&this._codec.frameReady,n&&(l=1e3*(this._decodedFrames[0].frameEndTimestamp-a),this._actualPerFrameTime=this._targetPerFrameTime-l);var u=this._targetPerFrameTime;if(this._prebufferingAudio)i&&this._log("decoding a frame during prebuffering"),n=!1;else if(n&&this._dataEnded&&s)this._log("audio timeline ended? ready to draw frame");else if(n&&-l>=u){for(var c=-1,f=0;f<this._decodedFrames.length-1;f++)this._decodedFrames[f].frameEndTimestamp<a&&(c=f-1);if(c>=0)for(;c-- >=0;){this._lateFrames++;var d=this._decodedFrames.shift();this._log("skipping already-decoded late frame at "+d.frameEndTimestamp),l=1e3*(d.frameEndTimestamp-a),this._frameEndTimestamp=d.frameEndTimestamp,this._actualPerFrameTime=this._targetPerFrameTime-l,this._framesProcessed++,d.dropped=!0,this._doFrameComplete(d)}var p=this._codec.nextKeyframeTimestamp,h=p-this._targetPerFrameTime/1e3*(this._framePipelineDepth+this._pendingFrame);if(p>=0&&p!=this._codec.frameTimestamp&&a>=h){this._log("skipping late frame at "+this._decodedFrames[0].frameEndTimestamp+" vs "+a+", expect to see keyframe at "+p);for(var m=0;m<this._decodedFrames.length;m++){var g=this._decodedFrames[m];this._lateFrames++,this._framesProcessed++,this._frameEndTimestamp=g.frameEndTimestamp,l=1e3*(g.frameEndTimestamp-a),this._actualPerFrameTime=this._targetPerFrameTime-l,g.dropped=!0,this._doFrameComplete(g)}this._decodedFrames=[];for(var v=0;v<this._pendingFrames.length;v++){var y=this._pendingFrames[v];this._lateFrames++,this._framesProcessed++,this._frameEndTimestamp=y.frameEndTimestamp,l=1e3*(y.frameEndTimestamp-a),this._actualPerFrameTime=this._targetPerFrameTime-l,y.dropped=!0,this._doFrameComplete(y)}for(this._pendingFrames=[],this._pendingFrame=0;this._codec.frameReady&&this._codec.frameTimestamp<p;){var b={frameEndTimestamp:this._codec.frameTimestamp,dropped:!0};l=1e3*(b.frameEndTimestamp-a),this._actualPerFrameTime=this._targetPerFrameTime-l,this._lateFrames++,this._codec.discardFrame(function(){}),this._framesProcessed++,this._doFrameComplete(b)}return void(this._isProcessing()||this._pingProcessing())}}else n&&l<=4||(n=!1)}if(i){this._log("play loop: ready to decode frame; thread depth: "+this._pendingFrame+", have buffered: "+this._decodedFrames.length),0==this._videoInfo.fps&&this._codec.frameTimestamp-this._frameEndTimestamp>0&&(this._targetPerFrameTime=1e3*(this._codec.frameTimestamp-this._frameEndTimestamp)),this._totalFrameTime+=this._targetPerFrameTime,this._totalFrameCount++;var w=this._frameEndTimestamp=this._codec.frameTimestamp;this._pendingFrame++,this._pendingFrames.push({frameEndTimestamp:w});var _=this._pendingFrames,x=!1,E=this._time(function(){e._codec.decodeFrame(function(t){_===e._pendingFrames?(e._log("play loop callback: decoded frame"),e._pendingFrame--,e._pendingFrames.shift(),t?e._decodedFrames.push({yCbCrBuffer:e._codec.frameBuffer,videoCpuTime:e._codec.videoCpuTime,frameEndTimestamp:w}):e._log("Bad video packet or something"),e._codec.process(function(){e._isProcessing()||e._pingProcessing(x?void 0:0)})):e._log("play loop callback after flush, discarding")})});this._pendingFrame&&(x=!0,this._proxyTime+=E,this._pingProcessing(),this._dataEnded&&this._codec.sync())}else if(r){this._log("play loop: ready for audio; depth: "+this._pendingAudio),this._pendingAudio++;var S=this._codec.audioTimestamp,k=this._time(function(){e._codec.decodeAudio(function(t){if(e._pendingAudio--,e._log("play loop callback: decoded audio"),e._audioEndTimestamp=S,t){var r=e._codec.audioBuffer;if(r&&(e._bufferTime+=e._time(function(){e._audioFeeder&&e._audioFeeder.bufferData(r)}),!e._codec.hasVideo)){e._framesProcessed++;var n={frameEndTimestamp:e._audioEndTimestamp};e._doFrameComplete(n)}}e._isProcessing()||e._pingProcessing()})});this._pendingAudio&&(this._proxyTime+=k,this._codec.audioReady?this._pingProcessing():this._doProcessPlayDemux())}else if(n){this._log("play loop: ready to draw frame"),this._nextFrameTimer&&(clearTimeout(this._nextFrameTimer),this._nextFrameTimer=null),this._thumbnail&&(this.removeChild(this._thumbnail),this._thumbnail=null);var T=this._decodedFrames.shift();this._currentVideoCpuTime=T.videoCpuTime,this._drawingTime+=this._time(function(){e._drawFrame(T.yCbCrBuffer)}),this._framesProcessed++,this._doFrameComplete(T),this._pingProcessing()}else if(!this._decodedFrames.length||this._nextFrameTimer||this._prebufferingAudio)if(this._dataEnded&&!(this._pendingAudio||this._pendingFrame||this._decodedFrames.length)){this._log("play loop: playback reached end of data "+[this._pendingAudio,this._pendingFrame,this._decodedFrames.length]);var C=0;this._codec.hasAudio&&this._audioFeeder&&(C=1e3*this._audioFeeder.durationBuffered),C>0?(this._log("play loop: ending pending "+C+" ms"),this._pingProcessing(Math.max(0,C))):(this._log("play loop: ENDING NOW: playback time "+this._getPlaybackTime()+"; frameEndTimestamp: "+this._frameEndTimestamp),this._stopPlayback(),this._prebufferingAudio=!1,this._initialPlaybackOffset=Math.max(this._audioEndTimestamp,this._frameEndTimestamp),this._ended=!0,this._paused=!0,this._fireEventAsync("pause"),this._fireEventAsync("ended"))}else this._prebufferingAudio&&(t.hasVideo&&!t.frameReady||t.hasAudio&&!t.audioReady)?(this._log("play loop: prebuffering demuxing"),this._doProcessPlayDemux()):this._log("play loop: waiting on async/timers");else{var P=l;this._log("play loop: setting a timer for drawing "+P),this._nextFrameTimer=setTimeout(function(){e._nextFrameTimer=null,e._pingProcessing()},P)}}else this._log("play loop: demuxing"),this._doProcessPlayDemux()}},{key:"_doProcessPlayDemux",value:function(){var e=this,t=this._codec.frameReady,r=this._codec.audioReady;this._codec.process(function(n){e._codec.frameReady&&!t||e._codec.audioReady&&!r?(e._log("demuxer has packets"),e._pingProcessing()):n?(e._log("demuxer processing to find more packets"),e._pingProcessing()):(e._log("demuxer ran out of data"),e._streamEnded?(e._log("demuxer reached end of data stream"),e._dataEnded=!0,e._pingProcessing()):(e._log("demuxer loading more data"),e._readBytesAndWait()))})}},{key:"_doProcessError",value:function(){}},{key:"_isProcessing",value:function(){return this._stream&&(this._stream.buffering||this._stream.seeking)||this._codec&&this._codec.processing}},{key:"_readBytesAndWait",value:function(){var e=this;this._stream.buffering||this._stream.seeking?this._log("readBytesAndWait during i/o"):this._stream.read(32768).then(function(t){e._log("got input "+[t.byteLength]),t.byteLength&&e._actionQueue.push(function(){e._codec.receiveInput(t,function(){e._pingProcessing()})}),e._stream.eof&&(e._log("stream is at end!"),e._streamEnded=!0),e._isProcessing()||e._pingProcessing()}).catch(function(t){e._onStreamError(t)})}},{key:"_pingProcessing",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._stream&&this._stream.waiting?this._log("waiting on input"):(this._nextProcessingTimer&&(this._log("canceling old processing timer"),clearTimeout(this._nextProcessingTimer),this._nextProcessingTimer=null),t>-1/256?this._nextProcessingTimer=setTimeout(function(){e._pingProcessing()},t):this._depth?this._needProcessing=!0:this._doProcessing())}},{key:"_startProcessingVideo",value:function(e){var t=this;if(!this._started&&!this._codec){this._framesProcessed=0,this._bufferTime=0,this._drawingTime=0,this._proxyTime=0,this._started=!0,this._ended=!1;var r={base:this._options.base,worker:this._enableWorker,threading:this._enableThreading,simd:this._enableSIMD};this._detectedType&&(r.type=this._detectedType),this._codec=new _.default(r),this._lastVideoCpuTime=0,this._lastAudioCpuTime=0,this._lastDemuxerCpuTime=0,this._lastBufferTime=0,this._lastDrawingTime=0,this._lastProxyTime=0,this._lastFrameVideoCpuTime=0,this._lastFrameAudioCpuTime=0,this._lastFrameDemuxerCpuTime=0,this._lastFrameBufferTime=0,this._lastFrameProxyTime=0,this._lastFrameDrawingTime=0,this._currentVideoCpuTime=0,this._codec.onseek=function(e){t._didSeek=!0,t._stream&&t._seekStream(e)},this._codec.init(function(){t._codec.receiveInput(e,function(){t._readBytesAndWait()})})}}},{key:"_loadCodec",value:function(e){var t=this;this._stream.read(1024).then(function(r){var n=new Uint8Array(r);n.length>4&&79==n[0]&&103==n[1]&&103==n[2]&&83==n[3]?t._detectedType="video/ogg":n.length>4&&26==n[0]&&69==n[1]&&223==n[2]&&163==n[3]?t._detectedType="video/webm":t._detectedType="video/ogg",e(r)})}},{key:"_prepForLoad",value:function(e){var t=this;this._stopVideo(),this._currentSrc="",this._loading=!0,this._actionQueue.push(function(){e&&"none"===t.preload?t._loading=!1:(t._options.stream?t._stream=t._options.stream:t._stream=new p.default({url:t.src,cacheSize:0x1000000,progressive:!1}),t._stream.load().then(function(){t._loading=!1,t._currentSrc=t.src,t._byteLength=t._stream.seekable?t._stream.length:0;var e=t._stream.headers["x-content-duration"];"string"==typeof e&&(t._duration=parseFloat(e)),t._loadCodec(function(e){t._startProcessingVideo(e)})}).catch(function(e){t._onStreamError(e)}))}),this._pingProcessing(0)}},{key:"load",value:function(){this._prepForLoad()}},{key:"canPlayType",value:function(e){var t=new b.default(e);function r(e){if(t.codecs){var r=0,n=0;return t.codecs.forEach(function(t){e.indexOf(t)>=0?r++:n++}),0===r||n>0?"":"probably"}return"maybe"}return"ogg"!==t.minor||"audio"!==t.major&&"video"!==t.major&&"application"!==t.major?"webm"!==t.minor||"audio"!==t.major&&"video"!==t.major?"":r(["vorbis","opus","vp8","vp9"]):r(["vorbis","opus","theora"])}},{key:"play",value:function(){this._muted||this._options.audioContext||n.initSharedAudioContext(),this._paused&&(this._startedPlaybackInDocument=document.body.contains(this),this._paused=!1,this._state==M||(this._started&&this._codec&&this._codec.loadedMetadata?(this._ended&&this._stream&&this._byteLength?(this._log(".play() starting over after end"),this._seek(0)):this._log(".play() while already started"),this._state=A,this._isProcessing()||this._pingProcessing()):this._loading?this._log(".play() while loading"):(this._log(".play() before started"),this._stream||this.load())))}},{key:"getPlaybackStats",value:function(){return{targetPerFrameTime:this._targetPerFrameTime,framesProcessed:this._framesProcessed,videoBytes:this._codec?this._codec.videoBytes:0,audioBytes:this._codec?this._codec.audioBytes:0,playTime:this._playTime,demuxingTime:this._codec?this._codec.demuxerCpuTime-this._lastDemuxerCpuTime:0,videoDecodingTime:this._codec?this._codec.videoCpuTime-this._lastVideoCpuTime:0,audioDecodingTime:this._codec?this._codec.audioCpuTime-this._lastAudioCpuTime:0,bufferTime:this._bufferTime-this._lastBufferTime,drawingTime:this._drawingTime-this._lastDrawingTime,proxyTime:this._proxyTime-this._lastProxyTime,droppedAudio:this._droppedAudio,delayedAudio:this._delayedAudio,jitter:this._totalJitter/this._framesProcessed,lateFrames:this._lateFrames}}},{key:"resetPlaybackStats",value:function(){this._framesProcessed=0,this._playTime=0,this._codec&&(this._lastDemuxerCpuTime=this._codec.demuxerCpuTime,this._lastVideoCpuTime=this._codec.videoCpuTime,this._lastAudioCpuTime=this._codec.audioCpuTime,this._codec.videoBytes=0,this._codec.audioBytes=0),this._lastBufferTime=this._bufferTime,this._lastDrawingTime=this._drawingTime,this._lastProxyTime=this._proxyTime,this._totalJitter=0,this._totalFrameTime=0,this._totalFrameCount=0}},{key:"getVideoFrameSink",value:function(){return this._frameSink}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getVideo",value:function(){return null}},{key:"pause",value:function(){this._paused||(this._nextProcessingTimer&&(clearTimeout(this._nextProcessingTimer),this._nextProcessingTimer=null),this._stopPlayback(),this._prebufferingAudio=!1,this._paused=!0,this._fireEvent("pause"))}},{key:"stop",value:function(){this._stopVideo(),this._paused=!0}},{key:"fastSeek",value:function(e){this._seek(+e,N)}}],[{key:"initSharedAudioContext",value:function(){var e=document.createElement("audio");e.src=x.default,e.play(),h.default.initSharedAudioContext()}}]),n}(j);(0,v.default)(V,S),V.instanceCount=0,V.styleManager=new function(){var e=document.createElement("style");e.type="text/css",e.textContent="ogvjs { display: inline-block; position: relative; -webkit-user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); ",document.head.appendChild(e);var t=e.sheet;this.appendRule=function(e,r){var n=[];for(var i in r)r.hasOwnProperty(i)&&n.push(i+":"+r[i]);var o=e+"{"+n.join(";")+"}";t.insertRule(o,t.cssRules.length-1)}},t.default=V},580:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913));t.default=function(e){function t(r,n,o){var a=this;for(var s in(0,i.default)(this,t),o=o||{},this.worker=r,this.transferables=function(){var e=new ArrayBuffer(1024),t=new Uint8Array(e);try{return r.postMessage({action:"transferTest",bytes:t},[e]),!e.byteLength}catch(e){return!1}}(),e)e.hasOwnProperty(s)&&(this[s]=e[s]);this.processingQueue=0,Object.defineProperty(this,"processing",{get:function(){return this.processingQueue>0}}),this.messageCount=0,this.pendingCallbacks={},this.worker.addEventListener("message",function(e){a.handleMessage(e)}),this.proxy("construct",[n,o],function(){})}return(0,o.default)(t,[{key:"proxy",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!this.worker)throw'Tried to call "'+e+'" method on closed proxy object';var i="callback-"+ ++this.messageCount+"-"+e;r&&(this.pendingCallbacks[i]=r);var o={action:e,callbackId:i,args:t||[]};this.processingQueue++,this.transferables?this.worker.postMessage(o,n):this.worker.postMessage(o)}},{key:"terminate",value:function(){this.worker&&(this.worker.terminate(),this.worker=null,this.processingQueue=0,this.pendingCallbacks={})}},{key:"handleMessage",value:function(e){if(this.processingQueue--,"callback"===e.data.action){var t=e.data,r=t.callbackId,n=t.args,i=this.pendingCallbacks[r];if(t.props)for(var o in t.props)t.props.hasOwnProperty(o)&&(this[o]=t.props[o]);i&&(delete this.pendingCallbacks[r],i.apply(this,n))}}}]),t}},168:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913));t.default=function(){function e(t){(0,i.default)(this,e),this._ranges=t,this.length=t.length}return(0,o.default)(e,[{key:"start",value:function(e){if(e<0||e>this.length||e!==(0|e))throw RangeError("Invalid index");return this._ranges[e][0]}},{key:"end",value:function(e){if(e<0||e>this.length||e!==(0|e))throw RangeError("Invalid index");return this._ranges[e][1]}}]),e}()},625:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(575)),o=n(r(913)),a=n(r(964));function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}t.default=function(){function e(t){return(0,i.default)(this,e),this.options=t||{},this.demuxer=null,this.videoDecoder=null,this.audioDecoder=null,this.flushIter=0,this.loadedMetadata=!1,this.processing=!1,Object.defineProperties(this,{duration:{get:function(){return this.loadedMetadata?this.demuxer.duration:NaN}},hasAudio:{get:function(){return this.loadedMetadata&&!!this.audioDecoder}},audioReady:{get:function(){return this.hasAudio&&this.demuxer.audioReady}},audioTimestamp:{get:function(){return this.demuxer.audioTimestamp}},audioFormat:{get:function(){return this.hasAudio?this.audioDecoder.audioFormat:null}},audioBuffer:{get:function(){return this.hasAudio?this.audioDecoder.audioBuffer:null}},hasVideo:{get:function(){return this.loadedMetadata&&!!this.videoDecoder}},frameReady:{get:function(){return this.hasVideo&&this.demuxer.frameReady}},frameTimestamp:{get:function(){return this.demuxer.frameTimestamp}},keyframeTimestamp:{get:function(){return this.demuxer.keyframeTimestamp}},nextKeyframeTimestamp:{get:function(){return this.demuxer.nextKeyframeTimestamp}},videoFormat:{get:function(){return this.hasVideo?this.videoDecoder.videoFormat:null}},frameBuffer:{get:function(){return this.hasVideo?this.videoDecoder.frameBuffer:null}},seekable:{get:function(){return this.demuxer.seekable}},demuxerCpuTime:{get:function(){return this.demuxer?this.demuxer.cpuTime:0}},audioCpuTime:{get:function(){return this.audioDecoder?this.audioDecoder.cpuTime:0}},videoCpuTime:{get:function(){return this.videoDecoder?this.videoDecoder.cpuTime:0}}}),this.loadedDemuxerMetadata=!1,this.loadedAudioMetadata=!1,this.loadedVideoMetadata=!1,this.loadedAllMetadata=!1,this.onseek=null,this.videoBytes=0,this.audioBytes=0,this}return(0,o.default)(e,[{key:"flushSafe",value:function(e){var t=this,r=this.flushIter;return function(n){t.flushIter<=r&&e(n)}}},{key:"init",value:function(e){var t,r=this;this.processing=!0,t="video/webm"===this.options.type||"audio/webm"===this.options.type?"OGVDemuxerWebMW":"OGVDemuxerOggW",a.default.loadClass(t,function(t){t().then(function(t){r.demuxer=t,t.onseek=function(e){r.onseek&&r.onseek(e)},t.init(function(){r.processing=!1,e()})})})}},{key:"close",value:function(){this.demuxer&&(this.demuxer.close(),this.demuxer=null),this.videoDecoder&&(this.videoDecoder.close(),this.videoDecoder=null),this.audioDecoder&&(this.audioDecoder.close(),this.audioDecoder=null)}},{key:"receiveInput",value:function(e,t){this.demuxer.receiveInput(e,t)}},{key:"process",value:function(e){var t=this;if(this.processing)throw Error("reentrancy fail on OGVWrapperCodec.process");this.processing=!0;var r=function(r){t.processing=!1,e(r)},n=function(){t.demuxer.process(r)};this.demuxer.loadedMetadata&&!this.loadedDemuxerMetadata?this.loadAudioCodec(function(){t.loadVideoCodec(function(){t.loadedDemuxerMetadata=!0,t.loadedAudioMetadata=!t.audioDecoder,t.loadedVideoMetadata=!t.videoDecoder,t.loadedAllMetadata=t.loadedAudioMetadata&&t.loadedVideoMetadata,r(!0)})}):this.loadedDemuxerMetadata&&!this.loadedAudioMetadata?this.audioDecoder.loadedMetadata?(this.loadedAudioMetadata=!0,this.loadedAllMetadata=this.loadedAudioMetadata&&this.loadedVideoMetadata,r(!0)):this.demuxer.audioReady?this.demuxer.dequeueAudioPacket(function(e,n){t.audioBytes+=e.byteLength,t.audioDecoder.processHeader(e,function(e){r(!0)})}):n():this.loadedAudioMetadata&&!this.loadedVideoMetadata?this.videoDecoder.loadedMetadata?(this.loadedVideoMetadata=!0,this.loadedAllMetadata=this.loadedAudioMetadata&&this.loadedVideoMetadata,r(!0)):this.demuxer.frameReady?(this.processing=!0,this.demuxer.dequeueVideoPacket(function(e){t.videoBytes+=e.byteLength,t.videoDecoder.processHeader(e,function(){r(!0)})})):n():this.loadedVideoMetadata&&!this.loadedMetadata&&this.loadedAllMetadata?(this.loadedMetadata=!0,r(!0)):this.loadedMetadata&&(!this.hasAudio||this.demuxer.audioReady)&&(!this.hasVideo||this.demuxer.frameReady)?r(!0):n()}},{key:"decodeFrame",value:function(e){var t=this,r=this.flushSafe(e),n=this.frameTimestamp,i=this.keyframeTimestamp;this.demuxer.dequeueVideoPacket(function(e){t.videoBytes+=e.byteLength,t.videoDecoder.processFrame(e,function(e){var o=t.videoDecoder.frameBuffer;o&&(o.timestamp=n,o.keyframeTimestamp=i),r(e)})})}},{key:"decodeAudio",value:function(e){var t=this,r=this.flushSafe(e);this.demuxer.dequeueAudioPacket(function(e,n){t.audioBytes+=e.byteLength,t.audioDecoder.processAudio(e,function(e){if(n){var i,o=[],a=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return s(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,void 0)}}(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(t.audioDecoder.audioBuffer);try{for(a.s();!(i=a.n()).done;){var l=i.value,u=Math.round(n*t.audioFormat.rate/1e9);u>0?o.push(l.subarray(0,l.length-Math.min(u,l.length))):o.push(l.subarray(Math.min(Math.abs(u),l.length),l.length))}}catch(e){a.e(e)}finally{a.f()}t.audioDecoder.audioBuffer=o}return r(e)})})}},{key:"discardFrame",value:function(e){var t=this;this.demuxer.dequeueVideoPacket(function(r){t.videoBytes+=r.byteLength,e()})}},{key:"discardAudio",value:function(e){var t=this;this.demuxer.dequeueAudioPacket(function(r,n){t.audioBytes+=r.byteLength,e()})}},{key:"flush",value:function(e){this.flushIter++,this.demuxer.flush(e)}},{key:"sync",value:function(){this.videoDecoder&&this.videoDecoder.sync()}},{key:"recycleFrame",value:function(e){this.videoDecoder&&this.videoDecoder.recycleFrame(e)}},{key:"getKeypointOffset",value:function(e,t){this.demuxer.getKeypointOffset(e,t)}},{key:"seekToKeypoint",value:function(e,t){this.demuxer.seekToKeypoint(e,this.flushSafe(t))}},{key:"loadAudioCodec",value:function(e){var t=this;if(this.demuxer.audioCodec){var r={vorbis:"OGVDecoderAudioVorbisW",opus:"OGVDecoderAudioOpusW"}[this.demuxer.audioCodec];this.processing=!0,a.default.loadClass(r,function(r){var n={};t.demuxer.audioFormat&&(n.audioFormat=t.demuxer.audioFormat),r(n).then(function(r){t.audioDecoder=r,r.init(function(){t.loadedAudioMetadata=r.loadedMetadata,t.processing=!1,e()})})},{worker:this.options.worker})}else e()}},{key:"loadVideoCodec",value:function(e){var t=this;if(this.demuxer.videoCodec){var r=!!this.options.simd,n=!!this.options.threading,i={theora:"OGVDecoderVideoTheoraW",vp8:n?"OGVDecoderVideoVP8MTW":"OGVDecoderVideoVP8W",vp9:n?r?"OGVDecoderVideoVP9SIMDMTW":"OGVDecoderVideoVP9MTW":r?"OGVDecoderVideoVP9SIMDW":"OGVDecoderVideoVP9W",av1:n?r?"OGVDecoderVideoAV1SIMDMTW":"OGVDecoderVideoAV1MTW":r?"OGVDecoderVideoAV1SIMDW":"OGVDecoderVideoAV1W"}[this.demuxer.videoCodec];this.processing=!0,a.default.loadClass(i,function(r){var i={};t.demuxer.videoFormat&&(i.videoFormat=t.demuxer.videoFormat),n&&delete window.ENVIRONMENT_IS_PTHREAD,r(i).then(function(r){t.videoDecoder=r,r.init(function(){t.loadedVideoMetadata=r.loadedMetadata,t.processing=!1,e()})})},{worker:this.options.worker&&!this.options.threading})}else e()}}]),e}()},539:(e,t,r)=>{"use strict";var n=r(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(8)),o=n(r(575)),a=n(r(913));t.default=new(function(){function e(){(0,o.default)(this,e),this.tested=!1,this.testResult=void 0}return(0,a.default)(e,[{key:"wasmSupported",value:function(){if(!this.tested){try{var e,t;"object"===("u"<typeof WebAssembly?"undefined":(0,i.default)(WebAssembly))?this.testResult=(e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e),0!==new WebAssembly.Instance(t,{}).exports.test(4)):this.testResult=!1}catch(e){console.log("Exception while testing WebAssembly",e),this.testResult=!1}this.tested=!0}return this.testResult}}]),e}())},309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}},431:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},o=r(828),a="arraybuffer",s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initXHR",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initXHR",this).call(this),this.xhr.responseType=a}},{key:"onXHRProgress",value:function(){}},{key:"onXHRLoad",value:function(){var e=this.xhr.response;this.bytesRead+=e.byteLength,this.emit("buffer",e),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onXHRLoad",this).call(this)}}]),t}(o);s.supported=function(){try{var e=new XMLHttpRequest;return e.responseType=a,e.responseType===a}catch(e){return!1}},e.exports=s},306:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){var t=e.getResponseHeader("Content-Range");return t&&t.match(/^bytes (\d+)-(\d+)\/(\d+)/)}e.exports=function(e){function t(e){var r=e.url,n=e.offset,i=e.length,o=e.cachever;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var a=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.url=r,a.offset=n,a.length=i,a.cachever=void 0===o?0:o,a.loaded=!1,a.seekable=!1,a.headers={},a.eof=!1,a.bytesRead=0,a.xhr=new XMLHttpRequest,a}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"load",value:function(){var e=this;return new Promise(function(t,r){var n=null;e._onAbort=function(e){n(),r(e)};var o=function(){if(2==e.xhr.readyState){if(206==e.xhr.status){var o,a,s,l=(s=i(e.xhr))?parseInt(s[1],10):0;if(e.offset!=l)return console.log("Expected start at "+e.offset+" but got "+l+"; working around Safari range caching bug: https://bugs.webkit.org/show_bug.cgi?id=82672"),e.cachever++,e.emit("cachever"),e.abort(),n(),void e.load().then(t).catch(r);e.seekable=!0}e.xhr.status>=200&&e.xhr.status<300?(e.length=function(e){if(206==e.status){var t;return(t=i(e))?parseInt(t[3],10):-1}var r=e.getResponseHeader("Content-Length");return null===r||""===r?-1:parseInt(r,10)}(e.xhr),o=e.xhr,a={},o.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.split(/:\s*/,2);t.length>1&&(a[t[0].toLowerCase()]=t[1])}),e.headers=a,e.onXHRStart()):(n(),r(Error("HTTP error "+e.xhr.status)))}},a=function(){n(),r(Error("network error"))},s=function(){n(),t()};n=function(){e.xhr.removeEventListener("readystatechange",o),e.xhr.removeEventListener("error",a),e.off("open",s),e._onAbort=null},e.initXHR(),e.xhr.addEventListener("readystatechange",o),e.xhr.addEventListener("error",a),e.on("open",s),e.xhr.send()})}},{key:"bufferToOffset",value:function(e){return Promise.reject(Error("abstract"))}},{key:"abort",value:function(){if(this.xhr.abort(),this._onAbort){var e=this._onAbort;this._onAbort=null;var t=Error("Aborted");t.name="AbortError",e(t)}}},{key:"initXHR",value:function(){var e=this.url;this.cachever&&(e+="?buggy_cachever="+this.cachever),this.xhr.open("GET",e);var t=null;(this.offset||this.length)&&(t="bytes="+this.offset+"-"),this.length&&(t+=this.offset+this.length-1),null!==t&&this.xhr.setRequestHeader("Range",t)}},{key:"onXHRStart",value:function(){throw Error("abstract")}}]),t}(r(566))},810:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initXHR",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initXHR",this).call(this),this.xhr.responseType="text",this.xhr.overrideMimeType("text/plain; charset=x-user-defined")}},{key:"onXHRProgress",value:function(){var e=this.xhr.responseText.slice(this.bytesRead);e.length>0&&(this.bytesRead+=e.length,this.emit("buffer",e))}},{key:"onXHRLoad",value:function(){this.onXHRProgress(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onXHRLoad",this).call(this)}}]),t}(r(828));o.supported=function(){try{return!!(new XMLHttpRequest).overrideMimeType}catch(e){return!1}},e.exports=o},828:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0};e.exports=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"bufferToOffset",value:function(e){var t=this;return new Promise(function(r,n){if(t.eof||t.offset>=e)r();else{var i=null;t._onAbort=function(e){i(),n(e)};var o=function(){t.offset>=e&&!t.eof&&(i(),r())},a=function(){i(),r()},s=function(){i(),n(Error("error streaming"))};i=function(){t.buffering=!1,t.off("buffer",o),t.off("done",a),t.off("error",s),t._onAbort=null},t.buffering=!0,t.on("buffer",o),t.on("done",a),t.on("error",s)}})}},{key:"initXHR",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initXHR",this).call(this)}},{key:"onXHRStart",value:function(){var e=this;this.xhr.addEventListener("progress",function(){return e.onXHRProgress()}),this.xhr.addEventListener("error",function(){return e.onXHRError()}),this.xhr.addEventListener("load",function(){return e.onXHRLoad()}),this.emit("open")}},{key:"onXHRProgress",value:function(){throw Error("abstract")}},{key:"onXHRError",value:function(){this.emit("error")}},{key:"onXHRLoad",value:function(){this.eof=!0,this.emit("done")}}]),t}(r(306))},761:(e,t,r)=>{"use strict";var n=r(855),i=r(810),o=r(431),a=null;e.exports=function(e){if(!1===e.progressive)return new o(e);if(a||(a=n.supported()?n:i.supported()?i:null),!a)throw Error("No supported backend class");return new a(e)}},855:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},o=r(828),a="moz-chunked-arraybuffer",s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initXHR",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"initXHR",this).call(this),this.xhr.responseType=a}},{key:"onXHRProgress",value:function(){var e=this.xhr.response;this.bytesRead+=e.byteLength,this.emit("buffer",e)}}]),t}(o);s.supported=function(){try{var e=new XMLHttpRequest;return e.responseType=a,e.responseType===a}catch(e){return!1}},e.exports=s},503:e=>{"use strict";var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.buffer,n=void 0===r?void 0:r,i=t.string,o=void 0===i?void 0:i,a=t.start,s=void 0===a?0:a,l=t.end,u=void 0===l?s+(n?n.byteLength:o?o.length:0):l,c=t.prev,f=t.next,d=t.eof,p=t.empty,h=void 0===p?!(n||o):p,m=t.timestamp,g=void 0===m?Date.now():m;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.start=s,this.end=u,this.prev=void 0===c?null:c,this.next=void 0===f?null:f,this.eof=void 0!==d&&d,this.empty=h,this.timestamp=g,this.buffer=n,this.string=o,Object.defineProperty(this,"length",{get:function(){return this.end-this.start}})}return t(e,[{key:"contains",value:function(e){return e>=this.start&&(e<this.end||this.eof)}},{key:"readBytes",value:function(e,t,r){var n=t-this.start,i=r-t;if(this.buffer){var o=new Uint8Array(this.buffer,n,i);e.set(o)}else{if(!this.string)throw Error("invalid state");for(var a=this.string,s=0;s<i;s++)e[s]=a.charCodeAt(n+s)}this.timestamp=Date.now()}},{key:"split",value:function(t){if(!this.empty||!this.contains(t))throw Error("invalid split");var r=new e({start:this.start,end:t}),n=new e({start:t,end:this.eof?t:this.end,eof:this.eof});return r.next=n,n.prev=r,[r,n]}},{key:"first",value:function(e){for(var t=this;t;t=t.next)if(e(t))return t;return null}},{key:"last",value:function(e){for(var t=null,r=this;r&&e(r);r=r.next)t=r;return t}}]),e}()},91:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(503);e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.cacheSize;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var n=new i({eof:!0});this.head=n,this.tail=n,this.readOffset=0,this.readCursor=n,this.writeOffset=0,this.writeCursor=n,this.cacheSize=void 0===r?0:r}return n(e,[{key:"bytesReadable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,t=this.readOffset,r=this.readCursor.last(function(r){return!r.empty&&r.start<=t+e});return r?Math.min(e,r.end-t):0}},{key:"bytesWritable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,t=this.writeOffset,r=this.writeCursor;if(r.eof)return e;var n=r.last(function(r){return r.empty&&r.start<=t+e});return n?Math.min(e,n.end-t):0}},{key:"seekRead",value:function(e){var t=this.head.first(function(t){return t.contains(e)});if(!t)throw Error("read seek out of range");this.readOffset=e,this.readCursor=t}},{key:"seekWrite",value:function(e){var t=this.head.first(function(t){return t.contains(e)});if(!t)throw Error("write seek out of range");this.writeOffset=e,this.writeCursor=t}},{key:"readBytes",value:function(e){for(var t=e.byteLength,r=this.bytesReadable(t),n=this.readOffset,i=n+r,o=n,a=this.readCursor;a&&!a.empty&&!(a.start>=i);a=a.next){var s=Math.min(i,a.end),l=e.subarray(o-n,s-n);a.readBytes(l,o,s),o=s}return this.readOffset=o,this.readCursor=this.readCursor.first(function(e){return e.contains(o)}),r}},{key:"write",value:function(e){var t=this.bufferItem(e),r=this.writeCursor;if(!r.empty)throw Error("write cursor not empty");if(!r.contains(t.end)&&r.end!==t.end)throw Error("write cursor too small");r.start<t.start&&(this.split(r,t.start),r=this.writeCursor),(t.end<r.end||r.eof)&&(this.split(r,t.end),r=this.writeCursor),this.splice(r,r,t,t),this.writeOffset=t.end,this.writeCursor=t.next,this.gc()}},{key:"bufferItem",value:function(e){if(e instanceof ArrayBuffer)return new i({start:this.writeOffset,end:this.writeOffset+e.byteLength,buffer:e});if("string"==typeof e)return new i({start:this.writeOffset,end:this.writeOffset+e.length,string:e});throw Error("invalid input to write")}},{key:"split",value:function(e,t){var r=e.split(t);this.splice(e,e,r[0],r[1])}},{key:"ranges",value:function(){for(var e=[],t=this.head;t;t=t.next)if(!t.empty){var r=t;t=t.last(function(e){return!e.empty}),e.push([r.start,t.end])}return e}},{key:"gc",value:function(){for(var e=0,t=[],r=this.head;r;r=r.next)r.empty||(e+=r.length,(r.end<this.readOffset||r.start>this.readOffset+this.chunkSize)&&t.push(r));if(e>this.cacheSize){t.sort(function(e,t){return e.timestamp-t.timestamp});for(var n=0;n<t.length;n++){var i=t[n];if(e<=this.cacheSize)break;this.remove(i),e-=i.length}}}},{key:"remove",value:function(e){var t=new i({start:e.start,end:e.end});this.splice(e,e,t,t),(e=t).prev&&e.prev.empty&&(e=this.consolidate(e.prev)),e.next&&e.next.empty&&!e.next.eof&&(e=this.consolidate(e)),0===e.start&&(this.head=e)}},{key:"consolidate",value:function(e){var t=e.last(function(e){return e.empty&&!e.eof}),r=new i({start:e.start,end:t.end});return this.splice(e,t,r,r),r}},{key:"splice",value:function(e,t,r,n){var i=this;if(e.start!==r.start)throw Error("invalid splice head");if(!(t.end===n.end||t.eof&&n.eof))throw Error("invalid splice tail");var o=e.prev,a=t.next;e.prev=null,t.next=null,o&&(o.next=r,r.prev=o),a&&(a.prev=n,n.next=a),e===this.head&&(this.head=r),t===this.tail&&(this.tail=n),this.readCursor=this.head.first(function(e){return e.contains(i.readOffset)}),this.writeCursor=this.head.first(function(e){return e.contains(i.writeOffset)})}},{key:"eof",get:function(){return this.readCursor.eof}}]),e}()},814:(e,t,r)=>{"use strict";e.exports=r(91)},566:e=>{"use strict";var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this._e={}}return t(e,[{key:"on",value:function(e,t){(this._e[e]||(this._e[e]=[])).push(t)}},{key:"off",value:function(e,t){var r=this._e[e]||[],n=r.indexOf(t);t>=0&&r.splice(n,1)}},{key:"emit",value:function(e,t){(this._e[e]||[]).slice().forEach(function(e){return e(t)})}}]),e}()},936:(e,t,r)=>{"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();r(566);var i=r(814),o=r(761);e.exports=function(){function e(t){var r=t.url,n=t.chunkSize,o=t.cacheSize,a=t.progressive;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this.length=-1,this.loaded=!1,this.loading=!1,this.seekable=!1,this.buffering=!1,this.seeking=!1,this.progressive=void 0===a||a,Object.defineProperties(this,{offset:{get:function(){return this._cache.readOffset}},eof:{get:function(){return this.length===this._cache.readOffset}}}),this.url=void 0===r?"":r,this.headers={},this._cache=new i({cacheSize:void 0===o?0:o}),this._backend=null,this._cachever=0,this._chunkSize=void 0===n?1048576:n}return n(e,[{key:"load",value:function(){var e=this;return new Promise(function(t,r){if(e.loading)throw Error("cannot load when loading");if(e.loaded)throw Error("cannot load when loaded");e.loading=!0,e._openBackend().then(function(r){e.seekable=r.seekable,e.headers=r.headers,e.length=r.length,e.loaded=!0,e.loading=!1,t()}).catch(function(t){"AbortError"!==t.name&&(e.loading=!1),r(t)})})}},{key:"_openBackend",value:function(){var e=this;return new Promise(function(t,r){if(e._backend)t(e._backend);else if(e.eof)r(Error("cannot open at end of file"));else{var n=e._cache,i=e._chunkSize,a=n.bytesReadable(i),s=n.readOffset+a;if(n.seekWrite(s),e.length>=0&&s>=e.length)return void t(null);var l=e._clampToLength(n.writeOffset+n.bytesWritable(i))-n.writeOffset;if(0===l)t(null);else{var u=e._backend=new o({url:e.url,offset:e._cache.writeOffset,length:l,cachever:e._cachever,progressive:e.progressive}),c=null,f=function(){u!==e._backend?(c(),r(Error("invalid state"))):(u.on("buffer",function(t){u===e._backend&&e._cache.write(t)}),u.on("done",function(){u===e._backend&&(-1===e.length&&(e.length=e._backend.offset+e._backend.bytesRead),e._backend=null)}),t(u))},d=function(t){u!==e._backend?r(Error("invalid state")):(e._backend=null,r(t))};c=function(){u.off("open",f),u.off("error",d)},u.on("open",f),u.on("error",d),u.on("cachever",function(){e._cachever++}),u.load()}}})}},{key:"_readAhead",value:function(){var e=this;return new Promise(function(t,r){e._backend||e.eof?t():e._openBackend().then(function(){t()}).catch(function(e){r(e)})})}},{key:"seek",value:function(e){var t=this;return new Promise(function(r,n){if(!t.loaded||t.buffering||t.seeking)throw Error("invalid state");if(e!==(0|e)||e<0)throw Error("invalid input");if(t.length>=0&&e>t.length)throw Error("seek past end of file");if(!t.seekable)throw Error("seek on non-seekable stream");t._backend&&t.abort(),t._cache.seekRead(e),t._cache.seekWrite(e),t._readAhead().then(r).catch(n)})}},{key:"read",value:function(e){var t=this;return this.buffer(e).then(function(e){return t.readSync(e)})}},{key:"readSync",value:function(e){var t=this.bytesAvailable(e),r=new Uint8Array(t);if(this.readBytes(r)!==t)throw Error("failed to read expected data");return r.buffer}},{key:"readBytes",value:function(e){if(!this.loaded||this.buffering||this.seeking)throw Error("invalid state");if(!(e instanceof Uint8Array))throw Error("invalid input");var t=this._cache.readBytes(e);return this._readAhead(),t}},{key:"buffer",value:function(e){var t=this;return new Promise(function(r,n){if(!t.loaded||t.buffering||t.seeking)throw Error("invalid state");if(e!==(0|e)||e<0)throw Error("invalid input");var i=t._clampToLength(t.offset+e),o=i-t.offset,a=t.bytesAvailable(o);a>=o?r(a):(t.buffering=!0,t._openBackend().then(function(r){return r?r.bufferToOffset(i).then(function(){return t.buffering=!1,t.buffer(e)}):Promise.resolve(a)}).then(function(e){t.buffering=!1,r(e)}).catch(function(e){"AbortError"!==e.name&&(t.buffering=!1),n(e)}))})}},{key:"bytesAvailable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0;return this._cache.bytesReadable(e)}},{key:"abort",value:function(){this.loading&&(this.loading=!1),this.buffering&&(this.buffering=!1),this.seeking&&(this.seeking=!1),this._backend&&(this._backend.abort(),this._backend=null)}},{key:"getBufferedRanges",value:function(){return this._cache.ranges()}},{key:"_clampToLength",value:function(e){return this.length<0?e:Math.min(this.length,e)}}]),e}()},302:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU5LjE2LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAACAAAEEwCZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ//////////////////////////////////////////////////////////////////8AAAAATGF2YzU5LjE4AAAAAAAAAAAAAAAAJAZAAAAAAAAABBMIw3vfAAAAAAAAAAAAAAAAAAAAAP/7kGQAD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABExBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7kmRAj/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU="},826:e=>{e.exports={vertex:"precision mediump float;\n\nattribute vec2 aPosition;\nattribute vec2 aLumaPosition;\nattribute vec2 aChromaPosition;\nvarying vec2 vLumaPosition;\nvarying vec2 vChromaPosition;\nvoid main() {\n    gl_Position = vec4(aPosition, 0, 1);\n    vLumaPosition = aLumaPosition;\n    vChromaPosition = aChromaPosition;\n}\n",fragment:"// inspired by https://github.com/mbebenita/Broadway/blob/master/Player/canvas.js\n\nprecision mediump float;\n\nuniform sampler2D uTextureY;\nuniform sampler2D uTextureCb;\nuniform sampler2D uTextureCr;\nvarying vec2 vLumaPosition;\nvarying vec2 vChromaPosition;\nvoid main() {\n   // Y, Cb, and Cr planes are uploaded as ALPHA textures.\n   float fY = texture2D(uTextureY, vLumaPosition).w;\n   float fCb = texture2D(uTextureCb, vChromaPosition).w;\n   float fCr = texture2D(uTextureCr, vChromaPosition).w;\n\n   // Premultipy the Y...\n   float fYmul = fY * 1.1643828125;\n\n   // And convert that to RGB!\n   gl_FragColor = vec4(\n     fYmul + 1.59602734375 * fCr - 0.87078515625,\n     fYmul - 0.39176171875 * fCb - 0.81296875 * fCr + 0.52959375,\n     fYmul + 2.017234375   * fCb - 1.081390625,\n     1\n   );\n}\n",vertexStripe:"precision mediump float;\n\nattribute vec2 aPosition;\nattribute vec2 aTexturePosition;\nvarying vec2 vTexturePosition;\n\nvoid main() {\n    gl_Position = vec4(aPosition, 0, 1);\n    vTexturePosition = aTexturePosition;\n}\n",fragmentStripe:"// extra 'stripe' texture fiddling to work around IE 11's poor performance on gl.LUMINANCE and gl.ALPHA textures\n\nprecision mediump float;\n\nuniform sampler2D uStripe;\nuniform sampler2D uTexture;\nvarying vec2 vTexturePosition;\nvoid main() {\n   // Y, Cb, and Cr planes are mapped into a pseudo-RGBA texture\n   // so we can upload them without expanding the bytes on IE 11\n   // which doesn't allow LUMINANCE or ALPHA textures\n   // The stripe textures mark which channel to keep for each pixel.\n   // Each texture extraction will contain the relevant value in one\n   // channel only.\n\n   float fLuminance = dot(\n      texture2D(uStripe, vTexturePosition),\n      texture2D(uTexture, vTexturePosition)\n   );\n\n   gl_FragColor = vec4(0, 0, 0, fLuminance);\n}\n"}},487:e=>{!function(){"use strict";function t(e,t){throw Error("abstract")}t.prototype.drawFrame=function(e){throw Error("abstract")},t.prototype.clear=function(){throw Error("abstract")},e.exports=t}()},926:(e,t,r)=>{!function(){"use strict";var t=r(487),n=r(627);function i(e){var t=e.getContext("2d"),r=null,i=null,o=null;return this.drawFrame=function(a){var s,l,u=a.format;e.width===u.displayWidth&&e.height===u.displayHeight||(e.width=u.displayWidth,e.height=u.displayHeight),null!==r&&r.width==u.width&&r.height==u.height||function(e,n){for(var i=(r=t.createImageData(e,n)).data,o=e*n*4,a=0;a<o;a+=4)i[a+3]=255}(u.width,u.height),n.convertYCbCr(a,r.data);var c,f=u.cropWidth!=u.displayWidth||u.cropHeight!=u.displayHeight;f?(i||(s=u.cropWidth,l=u.cropHeight,(i=document.createElement("canvas")).width=s,i.height=l,o=i.getContext("2d")),c=o):c=t,c.putImageData(r,-u.cropLeft,-u.cropTop,u.cropLeft,u.cropTop,u.cropWidth,u.cropHeight),f&&t.drawImage(i,0,0,u.displayWidth,u.displayHeight)},this.clear=function(){t.clearRect(0,0,e.width,e.height)},this}i.prototype=Object.create(t.prototype),e.exports=i}()},895:(e,t,r)=>{!function(){"use strict";var t=r(487),n=r(826);function i(e){var t,r,o=this,a=i.contextForCanvas(e);if(null===a)throw Error("WebGL unavailable");function s(e,t){var r=a.createShader(e);if(a.shaderSource(r,t),a.compileShader(r),!a.getShaderParameter(r,a.COMPILE_STATUS)){var n=a.getShaderInfoLog(r);throw a.deleteShader(r),Error("GL shader compilation for "+e+" failed: "+n)}return r}var l,u,c,f,d,p,h,m,g,v,y=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),b={},w={},_={};function x(e,t){return b[e]&&!t||(b[e]=a.createTexture()),b[e]}function E(e,t,r,n,o){var s=!b[e]||t,l=x(e,t);if(a.activeTexture(a.TEXTURE0),i.stripe){var u=!b[e+"_temp"]||t,c=x(e+"_temp",t);a.bindTexture(a.TEXTURE_2D,c),u?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,r/4,n,0,a.RGBA,a.UNSIGNED_BYTE,o)):a.texSubImage2D(a.TEXTURE_2D,0,0,0,r/4,n,a.RGBA,a.UNSIGNED_BYTE,o);var f=b[e+"_stripe"],d=!f||t;d&&(f=x(e+"_stripe",t)),a.bindTexture(a.TEXTURE_2D,f),d&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,r,1,0,a.RGBA,a.UNSIGNED_BYTE,function(e){if(_[e])return _[e];for(var t=new Uint32Array(e),r=0;r<e;r+=4)t[r]=255,t[r+1]=65280,t[r+2]=0xff0000,t[r+3]=0xff000000;return _[e]=new Uint8Array(t.buffer)}(r)))}else a.bindTexture(a.TEXTURE_2D,l),s?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,r,n,0,a.ALPHA,a.UNSIGNED_BYTE,o)):a.texSubImage2D(a.TEXTURE_2D,0,0,0,r,n,a.ALPHA,a.UNSIGNED_BYTE,o)}function S(e,t,n,i){var o=b[e];a.useProgram(r);var s=w[e];s&&!t||(a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,n,i,0,a.RGBA,a.UNSIGNED_BYTE,null),s=w[e]=a.createFramebuffer()),a.bindFramebuffer(a.FRAMEBUFFER,s),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o,0);var h=b[e+"_temp"];a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,h),a.uniform1i(p,1);var m=b[e+"_stripe"];a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,m),a.uniform1i(d,2),a.bindBuffer(a.ARRAY_BUFFER,l),a.enableVertexAttribArray(u),a.vertexAttribPointer(u,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,c),a.enableVertexAttribArray(f),a.vertexAttribPointer(f,2,a.FLOAT,!1,0,0),a.viewport(0,0,n,i),a.drawArrays(a.TRIANGLES,0,y.length/2),a.bindFramebuffer(a.FRAMEBUFFER,null)}function k(e,r,n){a.activeTexture(r),a.bindTexture(a.TEXTURE_2D,b[e]),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.uniform1i(a.getUniformLocation(t,e),n)}function T(e,t){var r=s(a.VERTEX_SHADER,e),n=s(a.FRAGMENT_SHADER,t),i=a.createProgram();if(a.attachShader(i,r),a.attachShader(i,n),a.linkProgram(i),!a.getProgramParameter(i,a.LINK_STATUS)){var o=a.getProgramInfoLog(i);throw a.deleteProgram(i),Error("GL program linking failed: "+o)}return i}return o.drawFrame=function(s){var b=s.format,w=!t||e.width!==b.displayWidth||e.height!==b.displayHeight;if(w&&(e.width=b.displayWidth,e.height=b.displayHeight,o.clear()),t||function(){if(i.stripe){r=T(n.vertexStripe,n.fragmentStripe),a.getAttribLocation(r,"aPosition"),c=a.createBuffer();var e=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);a.bindBuffer(a.ARRAY_BUFFER,c),a.bufferData(a.ARRAY_BUFFER,e,a.STATIC_DRAW),f=a.getAttribLocation(r,"aTexturePosition"),d=a.getUniformLocation(r,"uStripe"),p=a.getUniformLocation(r,"uTexture")}t=T(n.vertex,n.fragment),l=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,l),a.bufferData(a.ARRAY_BUFFER,y,a.STATIC_DRAW),u=a.getAttribLocation(t,"aPosition"),h=a.createBuffer(),m=a.getAttribLocation(t,"aLumaPosition"),g=a.createBuffer(),v=a.getAttribLocation(t,"aChromaPosition")}(),w){var _=function(e,t,r){var n=b.cropLeft/r,i=(b.cropLeft+b.cropWidth)/r,o=(b.cropTop+b.cropHeight)/b.height,s=b.cropTop/b.height,l=new Float32Array([n,o,i,o,n,s,n,s,i,o,i,s]);a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,l,a.STATIC_DRAW)};_(h,0,s.y.stride),_(g,0,s.u.stride*b.width/b.chromaWidth)}E("uTextureY",w,s.y.stride,b.height,s.y.bytes),E("uTextureCb",w,s.u.stride,b.chromaHeight,s.u.bytes),E("uTextureCr",w,s.v.stride,b.chromaHeight,s.v.bytes),i.stripe&&(S("uTextureY",w,s.y.stride,b.height),S("uTextureCb",w,s.u.stride,b.chromaHeight),S("uTextureCr",w,s.v.stride,b.chromaHeight)),a.useProgram(t),a.viewport(0,0,e.width,e.height),k("uTextureY",a.TEXTURE0,0),k("uTextureCb",a.TEXTURE1,1),k("uTextureCr",a.TEXTURE2,2),a.bindBuffer(a.ARRAY_BUFFER,l),a.enableVertexAttribArray(u),a.vertexAttribPointer(u,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,h),a.enableVertexAttribArray(m),a.vertexAttribPointer(m,2,a.FLOAT,!1,0,0),a.bindBuffer(a.ARRAY_BUFFER,g),a.enableVertexAttribArray(v),a.vertexAttribPointer(v,2,a.FLOAT,!1,0,0),a.drawArrays(a.TRIANGLES,0,y.length/2)},o.clear=function(){a.viewport(0,0,e.width,e.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT)},o.clear(),o}i.stripe=!1,i.contextForCanvas=function(e){var t={preferLowPowerToHighPerformance:!0,powerPreference:"low-power",failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!0};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)},i.isAvailable=function(){var e,t=document.createElement("canvas");t.width=1,t.height=1;try{e=i.contextForCanvas(t)}catch(e){return!1}if(e){var r=e.TEXTURE0,n=e.createTexture(),o=new Uint8Array(16),a=i.stripe?1:4,s=i.stripe?e.RGBA:e.ALPHA,l=i.stripe?e.NEAREST:e.LINEAR;return e.activeTexture(r),e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,l),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,l),e.texImage2D(e.TEXTURE_2D,0,s,a,4,0,s,e.UNSIGNED_BYTE,o),!e.getError()}return!1},i.prototype=Object.create(t.prototype),e.exports=i}()},627:(e,t,r)=>{!function(){"use strict";var t=r(877);e.exports={convertYCbCr:function(e,r){var n=0|e.format.width,i=0|e.format.height,o=0|t(e.format.width/e.format.chromaWidth),a=0|t(e.format.height/e.format.chromaHeight),s=e.y.bytes,l=e.u.bytes,u=e.v.bytes,c=0|e.y.stride,f=0|e.u.stride,d=0|e.v.stride,p=n<<2,h=0,m=0,g=0,v=0,y=0,b=0,w=0,_=0,x=0,E=0,S=0,k=0,T=0,C=0,P=0,A=0,O=0,M=0;if(1==o&&1==a)for(w=0,_=p,M=0,A=0;A<i;A+=2){for(g=(m=A*c|0)+c|0,v=M*f|0,y=M*d|0,P=0;P<n;P+=2)x=0|l[v++],k=(409*(E=0|u[y++])|0)-57088|0,T=(100*x|0)+(208*E|0)-34816|0,C=(516*x|0)-70912|0,S=298*s[m++]|0,r[w]=S+k>>8,r[w+1]=S-T>>8,r[w+2]=S+C>>8,w+=4,S=298*s[m++]|0,r[w]=S+k>>8,r[w+1]=S-T>>8,r[w+2]=S+C>>8,w+=4,S=298*s[g++]|0,r[_]=S+k>>8,r[_+1]=S-T>>8,r[_+2]=S+C>>8,_+=4,S=298*s[g++]|0,r[_]=S+k>>8,r[_+1]=S-T>>8,r[_+2]=S+C>>8,_+=4;w+=p,_+=p,M++}else for(b=0,A=0;A<i;A++)for(O=0,h=A*c|0,v=(M=A>>a)*f|0,y=M*d|0,P=0;P<n;P++)x=0|l[v+(O=P>>o)],k=(409*(E=0|u[y+O])|0)-57088|0,T=(100*x|0)+(208*E|0)-34816|0,C=(516*x|0)-70912|0,S=298*s[h++]|0,r[b]=S+k>>8,r[b+1]=S-T>>8,r[b+2]=S+C>>8,b+=4}}}()},877:e=>{!function(){"use strict";e.exports=function(e){for(var t=0,r=e>>1;0!=r;)r>>=1,t++;if(e!==1<<t)throw"chroma plane dimensions must be power of 2 ratio to luma plane dimensions; got "+e;return t}}()},731:(e,t,r)=>{!function(){"use strict";var t=r(487),n=r(926),i=r(895);e.exports={FrameSink:t,SoftwareFrameSink:n,WebGLFrameSink:i,attach:function(e,t){return("webGL"in(t=t||{})?t.webGL:i.isAvailable())?new i(e,t):new n(e,t)}}}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var e=r(318);Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"OGVCompat",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"OGVLoader",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"OGVMediaError",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"OGVMediaType",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"OGVPlayer",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"OGVTimeRanges",{enumerable:!0,get:function(){return u.default}}),n.OGVVersion=void 0;var t=e(r(8)),i=e(r(523)),o=e(r(964)),a=e(r(759)),s=e(r(278)),l=e(r(869)),u=e(r(168)),c="1.8.9-20220406232920-cb5f7ff";n.OGVVersion=c,"object"===("u"<typeof window?"undefined":(0,t.default)(window))&&(window.OGVCompat=i.default,window.OGVLoader=o.default,window.OGVMediaError=a.default,window.OGVMediaType=s.default,window.OGVTimeRanges=u.default,window.OGVPlayer=l.default,window.OGVVersion=c)})(),n}()}