UNPKG

audio-feeder

Version:

Abstraction for streaming raw PCM audio in browser via Web Audio API.

1 lines 18.8 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AudioFeeder=e():t.AudioFeeder=e()}(window,function(){return i={},n.m=r=[function(t,e){function r(t,e){if(t<1||t!==Math.round(t))throw"Invalid channel count for BufferQueue";this.channels=t,this.bufferSize=e,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(t){for(var e=[],r=0;r<this.channels;r++)e[r]=new Float32Array(t);return e},r.prototype.validate=function(t){if(t.length!==this.channels)return!1;for(var e,r=0;r<t.length;r++){var i=t[r];if(!(i instanceof Float32Array))return!1;if(0==r)e=i.length;else if(i.length!==e)return!1}return!0},r.prototype.appendBuffer=function(t){if(!this.validate(t))throw"Invalid audio buffer passed to BufferQueue.appendBuffer";for(var e=t[0].length,r=this.channels,i=this._pendingPos,n=this._pendingBuffer,o=this.bufferSize,a=0;a<e;a++){for(var f=0;f<r;f++)n[f][i]=t[f][a];++i==o&&(this._buffers.push(n),i=this._pendingPos=0,n=this._pendingBuffer=this.createBuffer(o))}this._pendingPos=i},r.prototype.prependBuffer=function(t){if(!this.validate(t))throw"Invalid audio buffer passed to BufferQueue.prependBuffer";var e=this._buffers.slice(0);e.push(this.trimBuffer(this._pendingBuffer,0,this._pendingPos)),this.flush(),this.appendBuffer(t);for(var r=0;r<e.length;r++)this.appendBuffer(e[r])},r.prototype.nextBuffer=function(){if(this._buffers.length)return this._buffers.shift();var t=this.trimBuffer(this._pendingBuffer,0,this._pendingPos);return this._pendingBuffer=this.createBuffer(this.bufferSize),this._pendingPos=0,t},r.prototype.trimBuffer=function(t,e,r){var i=t[0].length,n=e+Math.min(r,i);if(0==e&&i<=n)return t;for(var o=[],a=0;a<this.channels;a++)o[a]=t[a].subarray(e,n);return o},t.exports=r},function(e,t,n){!function(){n(0);var r=n(2),i=n(4);function t(t){this._options=t||{},this._backend=null,this._resampleFractional=0,this._resampleLastSampleData=void 0,this._tempoChanger=null}t.prototype.rate=0,t.prototype.targetRate=0,t.prototype.channels=0,t.prototype.bufferSize=0,Object.defineProperty(t.prototype,"bufferDuration",{get:function(){return this.targetRate?this.bufferSize/this.targetRate:0}}),Object.defineProperty(t.prototype,"bufferThreshold",{get:function(){return this._backend?this._backend.bufferThreshold/this.targetRate:0},set:function(t){if(!this._backend)throw"Invalid state: AudioFeeder cannot set bufferThreshold before init";this._backend.bufferThreshold=Math.round(t*this.targetRate)}}),Object.defineProperty(t.prototype,"playbackPosition",{get:function(){return this._backend?this.getPlaybackState().playbackPosition:0}}),Object.defineProperty(t.prototype,"outputPlaybackPosition",{get:function(){return this._backend?this.getPlaybackState().outputPlaybackPosition:0}}),Object.defineProperty(t.prototype,"durationBuffered",{get:function(){return this._backend?this.getPlaybackState().samplesQueued/this.targetRate:0}}),Object.defineProperty(t.prototype,"muted",{get:function(){if(this._backend)return this._backend.muted;throw"Invalid state: cannot get mute before init"},set:function(t){if(!this._backend)throw"Invalid state: cannot set mute before init";this._backend.muted=t}}),t.prototype.mute=function(){this.muted=!0},t.prototype.unmute=function(){this.muted=!1},Object.defineProperty(t.prototype,"volume",{get:function(){if(this._backend)return this._backend.volume;throw"Invalid state: cannot get volume before init"},set:function(t){if(!this._backend)throw"Invalid state: cannot set volume before init";this._backend.volume=t}}),Object.defineProperty(t.prototype,"tempo",{get:function(){if(this._tempoChanger)return this._tempoChanger.getTempo();throw"Invalid state: cannot get tempo before init"},set:function(t){if(!this._tempoChanger)throw"Invalid state: cannot set tempo before init";this._tempoChanger.setTempo(t)}}),t.prototype.init=function(t,e){if(this.channels=t,this.rate=e,this._options.backendFactory)this._backend=this._options.backendFactory(t,e,this._options);else{if(!r.isSupported())throw"No supported backend";this._backend=new r(t,e,this._options)}this.targetRate=this._backend.rate,this.bufferSize=this._backend.bufferSize,this._tempoChanger=i({sampleRate:this.targetRate,numChannels:t,tempo:1}),this._backend.onstarved=function(){this.onstarved&&this.onstarved()}.bind(this),this._backend.onbufferlow=function(){this.onbufferlow&&this.onbufferlow()}.bind(this)},t.prototype._resample=function(t){var s=this.rate,e=this.channels,h=this._backend.rate,r=this._backend.channels;if(s==h&&e==r)return t;var i=[],n=t[0].length,p=this._resampleFractional,n=n*h/s+p,o=Math.floor(n),n=n-o,a=s<h?function(e,t,r,i){function n(t){return t<0?r&&0<r.length+t?r[r.length+t]:e[0]:e[t]}for(var o=0;o<t.length;o++){var a=(o+1-p)*s/h-1,f=Math.floor(a),u=Math.ceil(a),f=f==u?n(f):n(f)*(u-a)+n(u)*(a-f);t[o]=i*f}}:function(t,e,r,i){for(var n=0;n<e.length;n++)e[n]=i*t[n*t.length/e.length|0]},f=1;e<r&&(f=Math.SQRT1_2);for(var u=0;u<r;u++){var l=u,c=t[l=e<=u?0:l],d=new Float32Array(o);a(c,d,this._resampleLastSampleData?this._resampleLastSampleData[l]:void 0,f),i.push(d)}return this._resampleFractional=n,this._resampleLastSampleData=t,i},t.prototype.bufferData=function(t){if(!this._backend)throw"Invalid state: AudioFeeder cannot bufferData before init";t=this._resample(t),t=this._tempoChanger.process(t);this._backend.appendBuffer(t)},t.prototype.getPlaybackState=function(){if(this._backend){var t=this._backend.getPlaybackState();return t.outputPlaybackPosition=t.playbackPosition,t.playbackPosition=this._tempoChanger.mapOutputToInputTime(t.outputPlaybackPosition),t}throw"Invalid state: AudioFeeder cannot getPlaybackState before init"},t.prototype.waitUntilReady=function(t){if(!this._backend)throw"Invalid state: AudioFeeder cannot waitUntilReady before init";this._backend.waitUntilReady(t)},t.prototype.start=function(){if(!this._backend)throw"Invalid state: AudioFeeder cannot start before init";this._backend.start()},t.prototype.stop=function(){if(!this._backend)throw"Invalid state: AudioFeeder cannot stop before init";this._backend.stop()},t.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()},t.prototype.close=function(){this._backend&&(this._backend.close(),this._backend=null)},t.prototype.onstarved=null,t.prototype.onbufferlow=null,t.isSupported=function(){return!!Float32Array&&r.isSupported()},t.initSharedAudioContext=function(){return r.isSupported()?r.initSharedAudioContext():null},e.exports=t}()},function(t,e,r){function n(t,e,r){var i=r.audioContext||n.initSharedAudioContext();if(this._context=i,this.output=r.output||i.destination,this.rate=i.sampleRate,this.channels=2,r.bufferSize&&(this.bufferSize=0|r.bufferSize),this.bufferThreshold=2*this.bufferSize,this._bufferQueue=new o(this.channels,this.bufferSize),this._playbackTimeAtBufferTail=i.currentTime,this._queuedTime=0,this._delayedTime=0,this._dropped=0,this._liveBuffer=this._bufferQueue.createBuffer(this.bufferSize),i.createScriptProcessor)this._node=i.createScriptProcessor(this.bufferSize,0,this.channels);else{if(!i.createJavaScriptNode)throw new Error("Bad version of web audio API?");this._node=i.createJavaScriptNode(this.bufferSize,0,this.channels)}}var i,o,s;i=window.AudioContext||window.webkitAudioContext,o=r(0),s=r(3),n.prototype.bufferSize=4096,n.prototype.bufferThreshold=8192,n.prototype._volume=1,Object.defineProperty(n.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=+t}}),n.prototype._muted=!1,Object.defineProperty(n.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=!!t}}),n.prototype._audioProcess=function(t){var e,r,i,n,o="number"==typeof t.playbackTime?t.playbackTime:this._context.currentTime+this.bufferSize/this.rate,a=this._playbackTimeAtBufferTail;if(a<o&&(this._delayedTime+=o-a),this._bufferQueue.sampleCount()<this.bufferSize&&this.onstarved&&this.onstarved(),this._bufferQueue.sampleCount()<this.bufferSize){for(e=0;e<this.channels;e++)for(i=t.outputBuffer.getChannelData(e),n=0;n<this.bufferSize;n++)i[n]=0;this._dropped++}else{var f=this.muted?0:this.volume,u=this._bufferQueue.nextBuffer();if(u[0].length<this.bufferSize)throw"Audio buffer not expected length.";for(e=0;e<this.channels;e++)for(r=u[e],this._liveBuffer[e].set(u[e]),i=t.outputBuffer.getChannelData(e),n=0;n<r.length;n++)i[n]=r[n]*f;this._queuedTime+=this.bufferSize/this.rate,this._playbackTimeAtBufferTail=o+this.bufferSize/this.rate,this._bufferQueue.sampleCount()<Math.max(this.bufferSize,this.bufferThreshold)&&this.onbufferlow&&s(this.onbufferlow.bind(this))}},n.prototype._samplesQueued=function(){return this._bufferQueue.sampleCount()+Math.floor(this._timeAwaitingPlayback()*this.rate)},n.prototype._timeAwaitingPlayback=function(){return Math.max(0,this._playbackTimeAtBufferTail-this._context.currentTime)},n.prototype.getPlaybackState=function(){return{playbackPosition:this._queuedTime-this._timeAwaitingPlayback(),samplesQueued:this._samplesQueued(),dropped:this._dropped,delayed:this._delayedTime}},n.prototype.waitUntilReady=function(t){t()},n.prototype.appendBuffer=function(t){this._bufferQueue.appendBuffer(t)},n.prototype.start=function(){this._node.onaudioprocess=this._audioProcess.bind(this),this._node.connect(this.output),this._playbackTimeAtBufferTail=this._context.currentTime},n.prototype.stop=function(){var t,e,r;this._node&&(0<(t=this._timeAwaitingPlayback())&&(e=Math.round(t*this.rate),(r=this._liveBuffer?this._liveBuffer[0].length:0)<e?(this._bufferQueue.prependBuffer(this._liveBuffer),this._bufferQueue.prependBuffer(this._bufferQueue.createBuffer(e-r))):this._bufferQueue.prependBuffer(this._bufferQueue.trimBuffer(this._liveBuffer,r-e,e)),this._playbackTimeAtBufferTail-=t),this._node.onaudioprocess=null,this._node.disconnect())},n.prototype.flush=function(){this._bufferQueue.flush()},n.prototype.close=function(){this.stop(),this._context=null},n.prototype.onstarved=null,n.prototype.onbufferlow=null,n.isSupported=function(){return!!i},n.sharedAudioContext=null,n.initSharedAudioContext=function(){if(!n.sharedAudioContext&&n.isSupported()){var t,e=new i;if(e.createScriptProcessor)t=e.createScriptProcessor(1024,0,2);else{if(!e.createJavaScriptNode)throw new Error("Bad version of web audio API?");t=e.createJavaScriptNode(1024,0,2)}t.connect(e.destination),t.disconnect(),n.sharedAudioContext=e}return n.sharedAudioContext},t.exports=n},function(t,e){t.exports=function(){if(void 0!==window.setImmediate)return window.setImmediate;if(window&&window.postMessage){var e=[];return window.addEventListener("message",function(t){t.source===window&&("object"!=typeof(t=t.data)||!t.nextTickBrowserPingMessage||(t=e.pop())&&t())}),function(t){e.push(t),window.postMessage({nextTickBrowserPingMessage:!0},document.location.toString())}}return function(t){setTimeout(t,0)}}()},function(t,e,r){var i;window,i=function(){return i={},n.m=r=[function(t,e){var r={float_array:function(t){return new Float32Array(t)},blit:function(t,e,r,i,n){r.set(t.subarray(e,e+n),i)}};t.exports=r},function(t,e,r){var tt=r(0),a=r(2);t.exports=function(t){var y=(t=t||{}).sampleRate||44100,e=t.wsizeLog||11,v=t.tempo||1,C=(t.numChannels,Math.pow(2,50/1200)-1),j=1<<e,g=a(e),r=1<<e-2;r-=r%100;for(var w=tt.float_array(j+r+5),k=tt.float_array(j+r+5),O=r,S=r,P=tt.float_array(j),i=0;i<j;i++)P[i]=.5*(1-Math.cos(2*Math.PI*i/j));for(var B=1+(j>>1),M=tt.float_array(B),T=tt.float_array(B),x=tt.float_array(B),A=tt.float_array(B),I=tt.float_array(B),z=tt.float_array(B),n=1+(B>>1),Q=[0,0],F=[],R=[],N=[],D=[],i=0;i<2;i++)F.push(tt.float_array(n)),R.push(tt.float_array(n)),N.push(tt.float_array(n)),D.push(tt.float_array(B));var L=tt.float_array(n),E=tt.float_array(n),J=0,U=0,o=[{in_time:0,out_time:0,tempo:v}],q=0,G=0,H=1,K=0,V=0,W=0,X=0,Y={mapOutputToInputTime:function(t){for(var e=o.length-1;t<o[e].out_time&&0<e;)e--;var r=o[e];return r.in_time+r.tempo*(t-r.out_time)},flush:function(t){Q=[K=0,0];for(var e=W=X=G=0;e<2;e++)for(var r=0;r<B;r++)D[e][r]=0;for(e=0;e<w.length;e++)w[e]=0;for(e=0;e<k.length;e++)k[e]=0;if(t){U=Math.max(0,U-t),J=Y.mapOutputToInputTime(U);for(var i=o.length-1;U<=o[i].out_time&&0<=i;)o.pop(),i--;o.push({in_time:J,out_time:U,tempo:v})}},getTempo:function(){return v},setTempo:function(t){O=S=r,1<=t?S=Math.round(O/t):O=Math.round(S*t),V=(1/t-+S/O)*O,H=function(t,e){for(var r=t.length/e|0,i=0,n=0;n<r;n++)i+=t[n*e];return.9/i}(P,S),v=t;var e=o[o.length-1];e.out_time==U?e.tempo=t:o.push({in_time:J,out_time:U,tempo:t})}};Y.flush(0),Y.setTempo(v);function Z(t,e,r){var i=Math.floor(r),r=i%2==1?-1:1;return Math.atan2(r*(e[i]-e[i+1]),r*(t[i]-t[i+1]))}function $(t,e,r,i,n,o){for(var a=t%2,f=1-a,u=D[f],s=Q[f],h=F[f],p=R[f],l=N[f],c=D[a],d=1;d<c.length;d++)c[d]=e[d]*e[d]+r[d]*r[d];var _=F[a],b=Q[a]=function(t,e){for(var r=0,i=0;i<t.length;i++)t[i]>r&&(r=t[i]);var n=1e-8*r,o=1,a=1;for(e[0]=1,i=2;i<t.length;i++){var f,u=i*C;t[i]>n&&t[i]>t[i-1]&&t[i]>=t[i+1]&&((f=i+(t[i-1]-t[i+1])/(2*(t[i-1]-2*t[i]+t[i+1])))-e[o-1]>u?(e[o++]=f,a=i):t[i]>t[a]&&(e[o-1]=f,a=i))}return o}(c,_),m=R[a],y=N[a];if(0!=t&&0!=b){for(var v=0,g=0;g<b;g++){for(I=_[g];_[g]>h[v]&&v!=s;)++v;var w=v;0<v&&I-h[v-1]<h[v]-I&&(w=v-1);var k,S=I*C;Math.abs(h[w]-I)<S&&u[Math.round(h[w])]>.1*c[Math.round(I)]?(k=Z(e,r,I),S=p[w]+l[w]+function(t,e,r,i,n){e=2*Math.PI/j*.5*(i+e)*O;return((r=t-r-e)-2*Math.PI*Math.round(r/(2*Math.PI))+e)*n}(k,I,p[w],h[w],o)-k,m[g]=k,y[g]=S,L[g]=Math.cos(S),E[g]=Math.sin(S)):(m[g]=Z(e,r,I),y[g]=0,L[g]=1,E[g]=0)}_[b]=2*j;for(var P=_[w=0],B=_[w+1],M=L[w],T=E[w],d=1;d<e.length-1;d++){P<=d&&B-d<d-P&&(P=_[++w],B=_[w+1],M=L[w],T=E[w]);var x=e[d]*M-r[d]*T,A=e[d]*T+r[d]*M;e[d]=x,r[d]=A}}else for(var g=0;g<b;g++){var I=_[g];p[g]=l[g]=Z(e,r,I)}}return Y.process=function(t){var e=t[0].length,r=t[0];if(1<t.length){r=tt.float_array(t[0].length);for(var i=1/t.length,n=0;n<t.length;n++)for(var o=0;o<e;o++)r[o]+=i*t[n][o]}if(1==v){if(0<X+W){for(var a=X+W+e,f=[],n=0;n<t.length;n++){var u=tt.float_array(a);tt.blit(k,0,u,0,X),tt.blit(w,0,u,X,W),tt.blit(t[n],0,u,X+W,e),f.push(u)}Y.flush(0),e=a,t=f}return J+=e/y,U+=e/y,t}var s=W+e-(j-O),s=2*Math.floor(Math.max(0,s)/(2*O)),h=X+S*s+Math.floor(K+V*s);h<X&&(h=X);var p=tt.float_array(h);tt.blit(k,0,p,0,X);for(var l=0,c=X,d=0,_=0;;){var b=j+O-W;if(e<l+b){tt.blit(r,l,w,W,e-l),W+=e-l,l=e;break}b<=0?W-=2*O:(tt.blit(r,l,w,W,b),l+=b,W=j-O),_=function(){var t=0|(K+=2*V);K-=t;for(var e=0;e<j;e++)g.m_re[e]=P[e]*w[e],g.m_im[e]=P[e]*w[O+e];tt.blit(w,2*O,w,0,j-O),g.inplace(!1),g.unpack(M,T,x,A),$(q,M,T,0,0,+S/O),$(q+1,x,A,0,0,+(S+t)/O),tt.blit(x,0,I,0,B),tt.blit(A,0,z,0,B),g.repack(M,T,x,A),g.inplace(!0);var r=k.length;for(tt.blit(k,G,k,0,r-G),e=r-G;e<r;e++)k[e]=0;for(var i=0,n=H,e=0;e<S;e++)Math.abs(2*g.m_re[e])>i&&(i=Math.abs(2*g.m_re[e]));for(e=0;e<j-S;e++)Math.abs(g.m_re[e+S+t]+g.m_im[e])>i&&(i=Math.abs(g.m_re[e+S+t]+g.m_im[e]));for(e=j-S;e<j;e++)Math.abs(2*g.m_im[e])>i&&(i=Math.abs(2*g.m_im[e]));var o=1/Math.floor(j/(2*S));for(o<n*i&&(n=o/i),e=0;e<j;e++)k[e]+=n*g.m_re[e],k[e+S+t]+=n*g.m_im[e];return q+=2,G=2*S+t}(),J+=2*O/y,U+=_/y,(d=c+_-h)<0&&(d=0),tt.blit(k,0,p,c,_-d),c+=_}tt.blit(k,_-d,k,0,d),X=d;var m=[];for(n=0;n<t.length;n++)m.push(p);return m},Y}},function(t,e,r){"use strict";var h=r(0);t.exports=function(t){for(var o=1<<t,T={m_logN:t,m_N:o,m_invN:1/o,m_re:h.float_array(o),m_im:h.float_array(o),m_revTgt:new Array(o)},e=0;e<o;e++){for(var r=e,i=0,n=0;n<t;n++)i<<=1,i|=1&r,r>>=1;T.m_revTgt[e]=i}T.twiddleRe=h.float_array(T.m_logN),T.twiddleIm=h.float_array(T.m_logN);for(var a=1,f=0;f<T.m_logN;f++){var u=2*a*Math.PI*T.m_invN;T.twiddleRe[f]=Math.cos(u),T.twiddleIm[f]=Math.sin(u),a<<=1}T.inplace=function(t){var e=T.m_re,r=T.m_im,i=T.m_N,n=T.m_logN,o=i>>1,a=i>>1,f=i;if(t)for(var u=1/i,s=0;s<i;s++)e[s]*=u,r[s]*=u;for(var h=0;h<n;h++){var p=T.twiddleRe[h],l=T.twiddleIm[h];t||(l*=-1);for(var c=0;c<i;){for(var d=c,_=c+a,b=1,m=0,y=0;y<o;y++){var v=e[d],g=r[d],w=e[_],k=r[_];e[d]=v+w,r[d]=g+k,w=v-w,k=g-k,e[_]=w*b-k*m,r[_]=w*m+k*b,d++,_++;k=b,b=b*p-m*l,m=k*l+m*p}c+=f}o>>=1,a>>=1,f>>=1}for(var S,P,B=T.m_revTgt,M=0;M<i;M++)B[M]>M&&(P=e[S=B[M]],e[S]=e[M],e[M]=P,P=r[S],r[S]=r[M],r[M]=P)};var s=o>>1;return T.unpack=function(t,e,r,i){t[0]=T.m_re[0],r[0]=T.m_im[0],e[0]=i[0]=0,t[s]=T.m_re[s],r[s]=T.m_im[s],e[s]=i[s]=0;for(var n=1;n<s;n++)t[n]=(T.m_re[n]+T.m_re[o-n])/2,e[n]=(T.m_im[n]-T.m_im[o-n])/2,r[n]=(T.m_im[n]+T.m_im[o-n])/2,i[n]=(-T.m_re[n]+T.m_re[o-n])/2},T.repack=function(t,e,r,i){T.m_re[0]=t[0],T.m_im[0]=r[0],T.m_re[s]=t[s],T.m_im[s]=r[s];for(var n=1;n<s;n++)T.m_re[n]=t[n]-i[n],T.m_im[n]=e[n]+r[n],T.m_re[o-n]=t[n]+i[n],T.m_im[o-n]=-e[n]+r[n]},T}}],n.c=i,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1);function n(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var r,i},t.exports=i()}],n.c=i,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1);function n(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var r,i});