UNPKG

mp3player

Version:

A mp3 player,get data by ajax and play by audiocontext or mediasource.it can download and reprocessing while playing

1 lines 93.4 kB
!function(e){var t={};function i(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)}([function(e,t,i){"use strict";var r={Error:{NONE:0,BUFLEN:1,BUFPTR:2,NOMEM:49,LOSTSYNC:257,BADLAYER:258,BADBITRATE:259,BADSAMPLERATE:260,BADEMPHASIS:261,BADCRC:513,BADBITALLOC:529,BADSCALEFACTOR:545,BADMODE:546,BADFRAMELEN:561,BADBIGVALUES:562,BADBLOCKTYPE:563,BADSCFSI:564,BADDATAPTR:565,BADPART3LEN:566,BADHUFFTABLE:567,BADHUFFDATA:568,BADSTEREO:569},BUFFER_GUARD:8};r.BUFFER_MDLEN=2559+r.BUFFER_GUARD,r.Layer={I:1,II:2,III:3},r.Mode={SINGLE_CHANNEL:0,DUAL_CHANNEL:1,JOINT_STEREO:2,STEREO:3},r.Emphasis={NONE:0,_50_15_US:1,CCITT_J_17:3,RESERVED:2},r.Flag={NPRIVATE_III:7,INCOMPLETE:8,PROTECTION:16,COPYRIGHT:32,ORIGINAL:64,PADDING:128,I_STEREO:256,MS_STEREO:512,FREEFORMAT:1024,LSF_EXT:4096,MC_EXT:8192,MPEG_2_5_EXT:16384},r.Private={HEADER:256,III:31},r.count1table_select=1,r.scalefac_scale=2,r.preflag=4,r.mixed_block_flag=8,r.I_STEREO=1,r.MS_STEREO=2,r.sbsampleIndex=function(e,t,i){return 36*e*32+32*t+i},r.overlapIndex=function(e,t,i){return 32*e*18+18*t+i},r.recoverable=function(e){return 0!=(65280&e)},r.mul=function(e,t){var i=Math.ceil(Math.log(t)/Math.LN2),r=e;do{r+=r}while(0<--i);return r.slice(0,e.length*t)},r.memcpy=function(e,t,i,r,a){return e.slice(0,t)+i.slice(r,r+a)+e.slice(t+a)},r.rshift=function(e,t){return Math.floor(e/Math.pow(2,t))},r.lshiftU32=function(e,t){return r.bitwiseAnd(r.lshift(e,t),4294967295)},r.lshift=function(e,t){return e*Math.pow(2,t)},r.bitwiseOr=function(e,t){var i=2147483648;return(e/i<<0|t/i<<0)*i+(e%i|t%i)},r.bitwiseAnd=function(e,t){var i=2147483648;return(e/i<<0&t/i<<0)*i+(e%i&t%i)},t.a=r},function(e,t,i){"use strict";function r(e){if(e instanceof ArrayBuffer)this._uint8Array=new Uint8Array(e);else{if("number"!=typeof e)throw Error("参数错误");e=new ArrayBuffer(e),this._uint8Array=new Uint8Array(e)}this._bytePos=0,this._bitPos=0,this.buffer=e,this.end=0}var a=r.prototype;a.getBuffer=function(){return this._uint8Array.buffer},a.getBits=function(e){var t=0;if(this._bytePos>=this._uint8Array.length)return!1;for(var i=0;i<e&&this._bytePos<this._uint8Array.length;i++)t=t<<1|this._uint8Array[this._bytePos]>>7-this._bitPos&1,this._bitPos++,this._bitPos%8==0&&(this._bytePos++,this._bitPos=0);return t},a.getBits1=function(e){if(this._bytePos>=this._uint8Array.length)return!1;var t=this._uint8Array[this._bytePos]>>7-this._bitPos&1;return this._bitPos++,this._bitPos%8==0&&(this._bytePos++,this._bitPos=0),t},a.getByte=function(){if(this._bytePos>=this._uint8Array.length)return!1;var e=this._uint8Array[this._bytePos];return this._bytePos++,e},a.getBitsStr=function(e,t){var i=this.getBits(e).toString(2);if(i.legnth<e){for(var r="",a=0;a<e-i.length;a++)r+="0";i=r+i}return i},a.getBytePos=function(e){return this._bytePos},a.getBitPos=function(e){return this._bitPos},a.setBytePos=function(e){e>this._uint8Array.length&&(e=this._uint8Array.length),this._bytePos=e},a.setBitPos=function(e){this._bitPos=e%8},a.setBit=function(e,t,i){var r=i<<t&255;e>=this._uint8Array.length||(this._uint8Array[e]=this._uint8Array[e]&r)},a.setByte=function(e,t){e>=this._uint8Array.length||(this._uint8Array[e]=t)},a.skipBits=function(e){this._bytePos=this._bytePos+((this._bitPos+e)/8>>0),this._bitPos=(this._bitPos+e)%8,this._bytePos>this._uint8Array.length&&(this._bytePos=this._uint8Array.length)},a.skipBytes=function(e){this._bytePos=this._bytePos+e,this._bytePos>this._uint8Array.length&&(this._bytePos=this._uint8Array.length)},a.rewindBits=function(e){this._bitPos=this._bitPos-e,this._bitPos<0&&(this._bitPos=0)},a.rewindBytes=function(e){this._bytePos=this._bytePos-e,this._bytePos<0&&(this._bytePos=0)},a.append=function(e){var t=new ArrayBuffer(this._uint8Array.length+e.length);return this._uint8Array=new Uint8Array(t),this._uint8Array.set(e,this._uint8Array.length-e.length),t},a.unshift=function(e){var t=new ArrayBuffer(this._uint8Array.length+e.length);return this._uint8Array=new Uint8Array(t),this._uint8Array.set(e,0),t},a.isEnd=function(){return this._bytePos>=this._uint8Array.length},a.getSize=function(){return this._uint8Array.length},a.reset=function(){this._bitPos=0,this._bytePos=0},a.slice=function(e,t){return this._uint8Array.slice(e,t)},a.append=function(e){var t=new Uint8Array(this.getSize());this._bytePos>0?(t.set(this._uint8Array.slice(this._bytePos),0),t.set(e,this.end)):t.set(e,0),this.end=this._bytePos+e.length,this._uint8Array=t,this._bytePos=0},t.a=r},function(e,t,i){"use strict";t.a=function(e,t,i,r){var a,n,s,o,f=new XMLHttpRequest;return a=n=s=o=function(){},t=t||0,i=i||"","object"==typeof r&&(r.onsuccess&&(a=r.onsuccess),r.onerror&&(n=r.onerror),r.onabort&&(s=r.onabort),r.ontimeout&&(o=r.ontimeout)),f.open("GET",e,!0),f.responseType="arraybuffer",f.onload=function(){f.response;var e=f.getResponseHeader("Content-Range");e&&e.split("/")[0].substr(6)!=t+"-"+i?(console.log(e.split("/")[0].substr(6),t+"-"+i),console.error("获取头部信息出错"),n("获取头部信息出错")):a(f)},f.onerror=n,f.onabort=s,f.ontimeout=o,f.setRequestHeader("Range","bytes="+t+"-"+i),f.send(),f}},function(e,t,i){"use strict";var r=i(11),a=i(0),n=function(e,t){this.stream="string"==typeof e?new r.a(e):e,this.offset=t,this.cache=0,this.left=8};n.prototype.clone=function(){var e=new n(this.stream,this.offset);return e.cache=this.cache,e.left=this.left,e},n.prototype.length=function(e){return this.left+8*(e.offset-(this.offset+1))+(8-e.left)},n.prototype.nextbyte=function(){return 8==this.left?this.offset:this.offset+1},n.prototype.skip=function(e){this.offset+=e/8>>0,this.left-=e%8,this.left>8&&(this.offset++,this.left+=8),this.left<8&&(this.cache=this.stream.getU8(this.offset))},n.prototype.read=function(e){if(e>16)return this.readBig(e);var t=0;if(8==this.left&&(this.cache=this.stream.getU8(this.offset)),e<this.left)return t=(this.cache&(1<<this.left)-1)>>this.left-e,this.left-=e,t;for(t=this.cache&(1<<this.left)-1,e-=this.left,this.offset++,this.left=8;e>=8;)t=t<<8|this.stream.getU8(this.offset++),e-=8;return e>0&&(this.cache=this.stream.getU8(this.offset),t=t<<e|this.cache>>8-e,this.left-=e),t},n.prototype.readBig=function(e){var t=0;if(8==this.left&&(this.cache=this.stream.getU8(this.offset)),e<this.left)return t=(this.cache&(1<<this.left)-1)>>this.left-e,this.left-=e,t;for(t=this.cache&(1<<this.left)-1,e-=this.left,this.offset++,this.left=8;e>=8;)t=a.a.bitwiseOr(a.a.lshift(t,8),this.stream.getU8(this.offset++)),e-=8;return e>0&&(this.cache=this.stream.getU8(this.offset),t=a.a.bitwiseOr(a.a.lshift(t,e),this.cache>>8-e),this.left-=e),t},t.a=n},function(e,t,i){"use strict";var r=function(e){};r.prototype.available=function(e){return this.absoluteAvailable(this.state.offset+e)},r.prototype.getU8=function(e,t){return this.get(e,1).charCodeAt(0)},r.prototype.getU16=function(e,t){var i=this.get(e,2);return t||(i=i.reverse()),i.charCodeAt(0)<<8|i.charCodeAt(1)},r.prototype.getU24=function(e,t){var i=this.get(e,3);return t||(i=i.reverse()),i.charCodeAt(0)<<16|i.charCodeAt(1)<<8|i.charCodeAt(2)},r.prototype.getU32=function(e,t){var i=this.get(e,4);return t||(i=i.reverse()),i.charCodeAt(0)<<24|i.charCodeAt(1)<<16|i.charCodeAt(2)<<8|i.charCodeAt(3)},r.prototype.getI8=function(e,t){return this.getU8(e,t)-128},r.prototype.getI16=function(e,t){return this.getU16(e,t)-65536},r.prototype.getI32=function(e,t){return this.getU32(e,t)-2147483648},r.prototype.getSyncInteger=function(e){var t=this.get(e,4);return t.charCodeAt(0)<<21|t.charCodeAt(1)<<14|t.charCodeAt(2)<<7|t.charCodeAt(3)},r.prototype.peekU8=function(e){return this.getU8(this.state.offset,e)},r.prototype.peekU16=function(e){return this.getU16(this.state.offset,e)},r.prototype.peekU24=function(e){return this.getU24(this.state.offset,e)},r.prototype.peekU32=function(e){return this.getU32(this.state.offset,e)},r.prototype.peekI8=function(e){return this.getI8(this.state.offset,e)},r.prototype.peekI16=function(e){return this.getI16(this.state.offset,e)},r.prototype.peekI32=function(e){return this.getI32(this.state.offset,e)},r.prototype.peekSyncInteger=function(){return this.getSyncInteger(this.state.offset)},r.prototype.readU8=function(e){var t=this.peekU8(e);return this.seek(1),t},r.prototype.readU16=function(e){var t=this.peekU16(e);return this.seek(2),t},r.prototype.readU24=function(e){var t=this.peekU24(e);return this.seek(3),t},r.prototype.readU32=function(e){var t=this.peekU32(e);return this.seek(4),t},r.prototype.readI8=function(e){var t=this.peekI8(e);return this.seek(1),t},r.prototype.readI16=function(e){var t=this.peekI16(e);return this.seek(2),t},r.prototype.readI32=function(e){var t=this.peekI32(e);return this.seek(4),t},r.prototype.readSyncInteger=function(){var e=this.getSyncInteger(this.state.offset);return this.seek(4),e},t.a=r},function(e,t,i){"use strict";var r={arrayBufferToHexChar:function(e){for(var t="",i=new Uint8Array(e),r=0;r<i.length;r++)i[r]<=15?t+="0"+i[r].toString(16):t+=i[r].toString(16),t+=",";return t.slice(0,t.length-1)},getLengthByFrameSync:function(e,t,i,r,a){var n=0,s=200,o="",f=new Uint8Array(e);if(i=i||0,a=a||1,r){var l=new RegExp(t,"g"),h=null;for(n=f.length-1,s=f.length-200;;){for(;n>s&&n>0;n--)o=f[n]<=15?"0"+f[n].toString(16)+","+o:f[n].toString(16)+","+o;if((h=(o=o.toUpperCase()).match(l))&&h.length>=a)return o.length/3-o.indexOf(t)/3;if(0==n)return 0;s-=200}}else for(;;){for(;n<s&&n<f.length;n++)f[n]<=15?o+="0"+f[n].toString(16):o+=f[n].toString(16),o+=",";if(-1!=(o=o.toUpperCase()).indexOf(t,3*i))return o.indexOf(t,3*i)/3;if(n>=f.length)return 0;s+=200}},formatCountDown:function(e,t){var i=new Date;i.setDate(0),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setSeconds(e);var r={date:Math.floor(e/86400),hours:i.getHours(),minutes:i.getMinutes(),seconds:i.getSeconds()};return t||(r.date=r.date>=10?r.date:"0"+r.date,r.hours=r.hours>=10?r.hours:"0"+r.hours,r.minutes=r.minutes>=10?r.minutes:"0"+r.minutes,r.seconds=r.seconds>=10?r.seconds:"0"+r.seconds),r},ifDebug:function(){return location.href.indexOf("debug")>-1},log:function(){location.search.indexOf("audio-debug")>-1&&console.log.apply(window,arguments)}};t.a=r},function(e,t,i){"use strict";var r=i(2),a=i(1),n=(i(5),i(19)),s=i(20),o={init:function(e,t){var i=this;return this.url=e,this.decrypt=this.onloadedmetadata=function(){},this.indexSize=100,this.audioInfo={},"object"==typeof t&&(t.onbeforedecode&&(this.decrypt=t.onbeforedecode),t.onloadedmetadata&&(this.onloadedmetadata=t.onloadedmetadata),t.indexSize&&(this.indexSize=t.indexSize)),new Promise(function(e,t){i._loadHeaderInfo(e,t)}).then(function(){return i._loadFirstFrame()}).then(function(e){var t=new n.a(new a.a(e));return!!t.parseHeader(!0)&&(i.audioInfo.toc=t.toc,i.audioInfo.totalSize=t.totalBytes,i.audioInfo.sampleRate=t.sampleRate,i.audioInfo.frameSync=t.frameSync,i.audioInfo.duration=t.totalDuration,i.audioInfo.bitRate=t.bitRate,i.audioInfo.toc?(i.onloadedmetadata(i.audioInfo.duration),i.audioInfo):i._getFooterLength())})},_loadHeaderInfo:function(e,t){var i=this;Object(r.a)(i.url,0,511,{onsuccess:function(t){var r=t.response,a=t.getResponseHeader("Content-Range"),n=null;i.decrypt(r),n=new s.a(r),i.audioInfo.audioDataOffset=n.parseId3V2()+n.parseApe(),i.audioInfo.fileSize=parseInt(a.substr(a.indexOf("/")+1)),e()}})},_loadFirstFrame:function(e,t){var i=this;return new Promise(function(e,t){Object(r.a)(i.url,i.audioInfo.audioDataOffset,i.audioInfo.audioDataOffset+1248-1,{onsuccess:function(t){var r=t.response;i.decrypt(r),e(r)}})})},_getFooterLength:function(){var e=this;return new Promise(function(t,i){Object(r.a)(e.url,e.audioInfo.fileSize-160,e.audioInfo.fileSize-1,{onsuccess:function(i){var r=i.response,a=null;e.decrypt(r),a=new s.a(r),e.audioInfo.footerLength=a.parseId3V1()+a.parseApe(),e.audioInfo.totalSize=e.audioInfo.fileSize-e.audioInfo.audioDataOffset-e.audioInfo.footerLength,e.audioInfo.duration=8*e.audioInfo.totalSize/e.audioInfo.bitRate,e.onloadedmetadata(e.audioInfo),t(e.audioInfo)}})})}};t.a=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(8),a=i(21);function n(e,t){return t.usemediasource&&window.MediaSource?new a.a(e,t):new r.a(e,t)}window.Player=n,t.default=n},function(e,t,i){"use strict";var r=i(2),a=i(5),n=i(1),s=i(9),o=i(6),f=100,l="",h=function(){},u=h,c=h,d=h,p=h,m=h,g=h,y=h,b=h,_=h,v=navigator.userAgent.indexOf("iPhone")>-1,S=null;function B(){this.timeoutIds={decodeTimeoutId:null,updateIntervalId:null,playTimoutId:null,reloadTimeoutId:null}}function I(e,t){l=e,this.player=new B,this._init(t)}B.prototype._init=function(e){var t=this;this.audioInfo=e,this.bufferLength=0,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.audioContext.onstatechange=function(){t.audioContext&&("running"!=t.audioContext.state&&(t.isPlaying=!1),a.a.log(t.audioContext.state))},this.decoder=new s.a,this.fileBlocks=new Array(100),this.cacheFrameSize=0,this.indexSize=100,this.seeking=!0,this.totalBuffer=null,this.nowSouceNode=null,this.loadingPromise=null,e.fileSize/f>1048576?this.cacheFrameSize=1:this.cacheFrameSize=Math.ceil(1048576/(e.fileSize/f)),this.audioInfo&&this._decodeAudioData(0,this.cacheFrameSize,!0,this.totalBuffer)},B.prototype._decodeAudioData=function(e,t,i,r){var n=this,s=this.audioInfo;if(!(e>=f))return this._loadFrame(e,t,i).then(function(e){if(r!=n.beginDecodeTime||!e)return!1;if(a.a.log("解码:"+e.beginIndex+","+e.endIndex),a.a.ifDebug())var o=(new Date).getTime();var l=0,h=e.arrayBuffer,u=e.beginIndex,c=e.endIndex;function d(i){if(r==n.beginDecodeTime&&(n.bufferLength||(n.bufferLength=Math.ceil(s.duration*i.sampleRate)),n.numberOfChannels||(n.numberOfChannels=i.numberOfChannels),n.sampleRate||(n.sampleRate=i.sampleRate),n.totalBuffer||(n.totalBuffer=n.audioContext.createBuffer(n.numberOfChannels,n.bufferLength,n.sampleRate)),a.a.log("解码完成:"+e.beginIndex+","+e.endIndex,"duration:",i.duration),a.a.log("解码花费:",(new Date).getTime()-o,"ms"),n.seeking?(n.preBuffer=null,n.seeking=!1,n.totalBuffer.dataOffset=n.totalBuffer.dataBegin=n.totalBuffer.dataEnd=n.totalBuffer.length*e.beginIndex/f>>0,n._copyPCMData(i),n.hasPlayed&&!n.pause&&n._play(n.totalBuffer.dataBegin/n.totalBuffer.length*s.duration)):(n._copyPCMData(i),n.waiting&&(n.waiting=!1,n.pause||(n.audioContext.resume(),g()))),n.totalBuffer.endIndex=e.endIndex,e.endIndex+1<f)){var l=1e3*i.duration/2;l>1e4&&(l=1e4),clearTimeout(n.timeoutIds.decodeTimeoutId),n.timeoutIds.decodeTimeoutId=setTimeout(function(){n.loadingPromise?(n.loadingPromise.stopNextLoad=!0,n.loadingPromise.then(function(){p(e,n.totalBuffer,t,s)})):p(e,n.totalBuffer,t,s)},l)}}function p(e,t,i,a){e.exceed?(t.dataOffset=t.dataEnd,n._decodeAudioData(e.endIndex+1,n.cacheFrameSize,null,r)):n._decodeAudioData(e.beginIndex,e.endIndex-e.beginIndex+1+n.cacheFrameSize,null,r)}return i&&n.decoder.kill(),n.decoder.decode({onsuccess:d,onerror:function e(){if(r!=n.beginDecodeTime)return;if(l>5)return;l++;a.a.log("decode fail...redo",l);h=h.slice(100);h=n._fixFileBlock(h);n.decoder.decode({onsuccess:d,onerror:e,arrayBuffer:h,beginIndex:u,endIndex:c})},arrayBuffer:h,beginIndex:u,endIndex:c}),e})},B.prototype._copyPCMData=function(e){for(var t=this.totalBuffer.dataOffset,i=0;i<e.numberOfChannels;i++){var r=e.getChannelData(i);r.length+t>this.totalBuffer.length&&(r=r.slice(0,r.length+t-this.totalBuffer.length)),this.totalBuffer.getChannelData(i).set(r,t)}this.totalBuffer.dataEnd=t+e.length},B.prototype._play=function(e){var t=this;this.offsetTime=e,this.currentTime=Math.round(this.offsetTime),"suspended"==this.audioContext.state&&this.audioContext.resume(),this.nowSouceNode&&this.nowSouceNode.disconnect();var i=this.audioContext.createBufferSource();i.buffer=this.totalBuffer,i.connect(this.audioContext.destination),i.onended=function(){t._end()},i.start?i.start(0,e):i.noteOn(0,e),this.hasPlayed=!0,this.nowSouceNode=i,this._startUpdateTimeoutId(),this.isPlaying=!0,a.a.log("play")},B.prototype._startUpdateTimeoutId=function(){var e=this;clearInterval(this.timeoutIds.updateIntervalId),this.beginTime=this.audioContext.currentTime,this.timeoutIds.updateIntervalId=setInterval(function(){var t=e.audioContext.currentTime-e.beginTime+e.offsetTime;e.audioInfo.toc&&t>e.audioInfo.duration&&e._end(),Math.round(t)>e.currentTime&&(e.currentTime=Math.round(t),c(e.currentTime)),!e.waiting&&e.totalBuffer.endIndex<f-1&&(t+2)*e.sampleRate>e.totalBuffer.dataEnd&&(e.waiting=!0,e.audioContext.suspend(),m())},1e3)},B.prototype._end=function(){this.nowSouceNode.disconnect(),this.finished=!0,this._clearTimeout(),this.audioContext.suspend(),y()},B.prototype._loadFrame=function(e,t,i){var n,s,o=this,h=!0,c=e,d=t,p=this.audioInfo;(e=e>=f?f-1:e)+t>f&&(t=f-e);for(var m=e;m<e+t;m++)if(!this.fileBlocks[m]){h=!1,t-=(c=m)-e;break}if(h){var g;return(g=this._joinNextCachedFileBlock(e,t,i)).endIndex<f-1&&this._loadFrame(g.endIndex+1,this.cacheFrameSize),Promise.resolve(g)}for(m=(m=c+t-1)>=f?f-1:m;m>c&&this.fileBlocks[m];m--)t--;c+t>f&&(t=f-c),n=this._getRangeBeginByIndex(c),s=this._getRangeBeginByIndex(c+t)-1,a.a.log("loading:",c,c+t-1);var y=new Promise(function(h,m){setTimeout(function(){y.resolve=h,y.reject=m},0),o.request=Object(r.a)(l,n,s,{onsuccess:function(r){var n=r.response,s=0,l=0;u(n);for(var m=c;m<c+t&&m<f;m++)p.toc?(l=m+1>=f||m+1>=c+t?n.byteLength:s+(o._getRangeBeginByIndex(m+1)-o._getRangeBeginByIndex(m))>>0,o.fileBlocks[m]=n.slice(s,l),s=l):(l=m+1>=f||m+1>=c+t?n.byteLength:s+(p.fileSize-p.audioDataOffset)/f,o.fileBlocks[m]=n.slice(s,l),s=l);a.a.log("load完成:",c,c+t-1),o.loadingPromise&&!o.loadingPromise.stopNextLoad&&setTimeout(function(){o._loadFrame(e+d,d)},0),o.loadingPromise=null,h(o._joinNextCachedFileBlock(e,d,i))},ontimeout:function(){clearTimeout(o.timeoutIds.reloadTimeoutId),o.timeoutIds.reloadTimeoutId=setTimeout(function(){o.loadingPromise=o._loadFrame(e,t,i),o.loadingPromise.then(function(){h(o._joinNextCachedFileBlock(e,d,i))})},1e3)},onerror:function(r){clearTimeout(o.timeoutIds.reloadTimeoutId),o.timeoutIds.reloadTimeoutId=setTimeout(function(){o.loadingPromise=o._loadFrame(e,t,i),o.loadingPromise.then(function(){h(o._joinNextCachedFileBlock(e,d,i))})},1e3)},onabort:function(e){m("abort")}})}).catch(function(e){return a.a.log(e),o.loadingPromise=null,!1});return this.loadingPromise=y,y},B.prototype._joinNextCachedFileBlock=function(e,t,i){var r=0,n=null,s=null,o=e,l=this.fileBlocks.length,h=!1;if(a.a.ifDebug()){var u=(new Date).getTime();a.a.log("join",e)}i&&(l=(l=e+t)>f?f:l);for(var c=e;c<l&&this.fileBlocks[c];c++)if(o=c,(r+=this.fileBlocks[c].byteLength)>=104857.6){h=!0;break}for(s=new ArrayBuffer(r),n=new Uint8Array(s),r=0,c=e;c<=o;c++)n.set(new Uint8Array(this.fileBlocks[c]),r),r+=this.fileBlocks[c].byteLength;return i&&(s=this._fixFileBlock(s)),a.a.log("join花费:",(new Date).getTime()-u,"ms"),{exceed:h,arrayBuffer:s,beginIndex:e,endIndex:o}},B.prototype._getRangeBeginByIndex=function(e){var t=0,i=this.audioInfo;return(t=i.toc?e>=f?i.fileSize:(i.toc[e]/256*i.totalSize>>0)+i.audioDataOffset:(i.fileSize-i.audioDataOffset)*e/f+i.audioDataOffset>>0)>i.fileSize&&(t=i.fileSize),t},B.prototype._fixFileBlock=function(e){var t=this.audioInfo.frameSync,i=a.a.getLengthByFrameSync(e,t,0);e=e.slice(i),i=a.a.getLengthByFrameSync(e,t,4);var r=function(e){var i=a.a.getLengthByFrameSync(e,t,4),r=new n.a(e.slice(i));return r.skipBits(32),r.getBits(9)}(e);if(r>=i)return this._fixFileBlock(e.slice(i));for(var s=new Uint8Array(e),o=4;o<i-r;o++)s[o]=0;return e},B.prototype._seek=function(e){var t=this,i=this.audioInfo;if(e>=f&&(e=f-1),this.waiting&&(this.waiting=!1,g()),this.totalBuffer){var r=this.totalBuffer.length*e/f,a=e/f*i.duration;if(r>this.totalBuffer.dataBegin&&r+5*this.sampleRate<this.totalBuffer.dataEnd)return void(this.pause?this.resumeTime=a:(clearInterval(this.timeoutIds.updateIntervalId),clearTimeout(this.timeoutIds.playTimoutId),this._play(a)));this.pause&&(this.resumeTime=-1,this.hasPlayed=!1),this.totalBuffer=this.audioContext.createBuffer(this.numberOfChannels,this.bufferLength,this.sampleRate)}this._clearTimeout(),this.seeking=!0,this.finished=!1,this.beginDecodeTime=(new Date).getTime(),this.nowSouceNode&&this.nowSouceNode.disconnect(),this.loadingPromise?(this.loadingPromise.then(function(){t._decodeAudioData(e,t.cacheFrameSize,!0,t.beginDecodeTime)}),this.request.abort()):this._decodeAudioData(e,this.cacheFrameSize,!0,this.beginDecodeTime)},B.prototype._clearTimeout=function(){clearTimeout(this.timeoutIds.decodeTimeoutId),clearInterval(this.timeoutIds.updateIntervalId),clearTimeout(this.timeoutIds.playTimoutId),clearTimeout(this.timeoutIds.reloadTimeoutId)},I.prototype._init=function(e){var t=this;u=e.onbeforedecode||h,c=e.ontimeupdate||h,d=e.onplay||h,p=e.onpause||h,m=e.onwaiting||h,g=e.onplaying||h,y=e.onended||h,b=e.onloadedmetadata||h,_=e.onerror||h,v&&((S=new Audio).src=e.emptyUrl),o.a.init(l,{onbeforedecode:u,onloadedmetadata:b}).then(function(e){t.player._init(e),e||(_(),t.player.error="parse audioInfo failed")}).catch(function(e){t.player.error="load audioInfo failed",console.log(e),_()})},I.prototype.play=function(){if(this.player.error)_();else{if(this.clickPlayTime){if(!1===this.player.audioInfo||(new Date).getTime()-this.player.clickPlayTime>5e3&&!this.player.audioInfo)return void(this.clickPlayTime=0)}else this.player.waiting=!1,this.clickPlayTime=(new Date).getTime();var e=this,t=(this.player.nowSouceNode,this.player.audioContext),i=this.player.audioInfo;if(clearTimeout(this.player.timeoutIds.playTimoutId),v&&!this.hasClick&&(S.play(),this.hasClick=!0),this.player.hasPlayed)1!=this.player.pause&&!this.player.finished||this.player.waiting||(this.player.finished?this.player._seek(0):(this.player.pause=!1,-1!=this.player.resumeTime?this.player._play(this.player.resumeTime):t.resume()),d());else{if(!this.player.totalBuffer||void 0==typeof this.player.totalBuffer.dataBegin)return this.player.waiting||(this.player.waiting=!0,m()),void(this.player.timeoutIds.playTimoutId=setTimeout(function(){e.play()},500));this.player.waiting&&(this.player.waiting=!1,g()),this.player._play(this.player.totalBuffer.dataBegin/this.player.totalBuffer.length*i.duration),this.player.pause=!1,d()}}},I.prototype.pause=function(){p(),this.player.resumeTime=-1,this.player.pause=!0,this.player.waiting=!1,this.player.audioContext&&this.player.audioContext.suspend(),clearTimeout(this.player.timeoutIds.playTimoutId)},I.prototype.seek=function(e){return e>>=0,!!this.player.audioInfo&&(this.player._seek(e),!0)},I.prototype.destory=function(){this.player._clearTimeout(),this.player.audioContext&&(this.player.audioContext.close(),this.player.audioContext=null)},I.prototype.isPlaying=function(){return this.player.isPlaying},t.a=I},function(e,t,i){"use strict";var r=i(10),a=i(15),n=i(16),s=i(17),o=i(18),f=i(0),l=function(){this.decodeQue=[]};function h(e,t){this.samples=[],this.numberOfChannels=e,this.sampleRate=t;for(var i=0;i<e;i++)this.samples[i]=[]}l.prototype.reset=function(e){if(this.createMpegStream(e),this.onsuccess=e.onsuccess,this.onerror=e.onerror,!this.channelCount){if(this.frame=r.a.decode(this.frame,this.mpeg),null==this.frame)return this.kill(),console.log("error_reset"),this.mpeg.error==f.a.Error.BUFLEN?(this.mpeg=null,this.stream=null,console.log("End of file!")):(this.stream=null,this.mpeg=null,this.onerror&&this.onerror()),!1;this.synth=new a.a,this.channelCount=this.frame.header.nchannels(),this.sampleRate=this.frame.header.samplerate,this.synth.frame(this.frame)}return!0},l.prototype.decode=function(e){var t=null,i=(Date.now(),this);function a(){clearTimeout(i.decodeTimmer),i.decoding=!1,i.decodeQue.length&&i.decode(i.decodeQue.shift())}this.decoding?this.decodeQue.push(e):this.reset(e)&&((t=new h(this.channelCount,this.sampleRate)).length=0,function e(){i.decoding=!0;for(var n=0;n<20;n++){if(i.mpeg.bufend-i.mpeg.next_frame<=4*(i.mpeg.next_frame-i.mpeg.this_frame))return t.duration=t.length/t.sampleRate,i.onsuccess&&i.onsuccess(t),a(),void(t=null);if(i.frame=r.a.decode(i.frame,i.mpeg),!i.frame)return t=null,i.kill(),console.log("error_decode"),void(i.onerror&&i.onerror());i.synth.frame(i.frame);for(var s=0;s<i.channelCount;++s)t.samples[s]=t.samples[s].concat(i.synth.pcm.samples[s]);t.length+=i.synth.pcm.samples[0].length}i.decodeTimmer=setTimeout(function(){e()},0)}())},l.prototype.createMpegStream=function(e){var t=e.beginIndex,i=e.endIndex,a=e.arrayBuffer;if(this.mpeg&&this.endIndex+1==t){var f=this.stream.state.arrayBuffer,l=new ArrayBuffer(f.byteLength+a.byteLength),h=new Uint8Array(l);h.set(new Uint8Array(f),0),h.set(new Uint8Array(a),f.byteLength);var u=new s.a(l);this.stream=u,u=new o.a(u,0,l.byteLength),this.mpeg.bufend=l.byteLength,this.mpeg.stream=u,this.mpeg.anc_ptr.stream=u,this.mpeg.ptr.stream=u}else this.stream=new s.a(a),this.mpeg=new n.a(new o.a(this.stream,0,this.stream.state.amountRead)),this.frame=new r.a,this.channelCount=0;this.endIndex=i},l.prototype.kill=function(){clearTimeout(this.decodeTimmer),this.decoding=!1,this.decodeQue=[]},h.prototype.getChannelData=function(e){return this.samples[e]},t.a=l},function(e,t,i){"use strict";var r=i(0),a=i(3),n=[[0,32e3,64e3,96e3,128e3,16e4,192e3,224e3,256e3,288e3,32e4,352e3,384e3,416e3,448e3],[0,32e3,48e3,56e3,64e3,8e4,96e3,112e3,128e3,16e4,192e3,224e3,256e3,32e4,384e3],[0,32e3,4e4,48e3,56e3,64e3,8e4,96e3,112e3,128e3,16e4,192e3,224e3,256e3,32e4],[0,32e3,48e3,56e3,64e3,8e4,96e3,112e3,128e3,144e3,16e4,176e3,192e3,224e3,256e3],[0,8e3,16e3,24e3,32e3,4e4,48e3,56e3,64e3,8e4,96e3,112e3,128e3,144e3,16e4]],s=[44100,48e3,32e3],o=[function(){console.log("Layer I decoding is not implemented!")},function(){console.log("Layer II decoding is not implemented!")},i(12).a],f=function(){this.layer=0,this.mode=0,this.mode_extension=0,this.emphasis=0,this.bitrate=0,this.samplerate=0,this.crc_check=0,this.crc_target=0,this.flags=0,this.private_bits=0};f.prototype.nchannels=function(){return 0==this.mode?1:2},f.prototype.nbsamples=function(){return this.layer==r.a.Layer.I?12:this.layer==r.a.Layer.III&&this.flags&r.a.Flag.LSF_EXT?18:36},f.actually_decode=function(e){var t=new f;if(t.flags=0,t.private_bits=0,e.ptr.skip(11),0==e.ptr.read(1)&&(t.flags|=r.a.Flag.MPEG_2_5_EXT),0==e.ptr.read(1))t.flags|=r.a.Flag.LSF_EXT;else if(t.flags&r.a.Flag.MPEG_2_5_EXT)return e.error=r.a.Error.LOSTSYNC,null;if(t.layer=4-e.ptr.read(2),4==t.layer)return e.error=r.a.Error.BADLAYER,t;0==e.ptr.read(1)&&(t.flags|=r.a.Flag.PROTECTION,e.ptr.skip(16));var i=e.ptr.read(4);return 15==i?(e.error=r.a.Error.BADBITRATE,t):(t.flags&r.a.Flag.LSF_EXT?t.bitrate=n[3+(t.layer>>1)][i]:t.bitrate=n[t.layer-1][i],3==(i=e.ptr.read(2))?(e.error=r.a.Error.BADSAMPLERATE,t):(t.samplerate=s[i],t.flags&r.a.Flag.LSF_EXT&&(t.samplerate/=2,t.flags&r.a.Flag.MPEG_2_5_EXT&&(t.samplerate/=2)),e.ptr.read(1)&&(t.flags|=r.a.Flag.PADDING),e.ptr.read(1)&&(t.private_bits|=r.a.Private.HEADER),t.mode=3-e.ptr.read(2),t.mode_extension=e.ptr.read(2),e.ptr.read(1)&&(t.flags|=r.a.Flag.COPYRIGHT),e.ptr.read(1)&&(t.flags|=r.a.Flag.ORIGINAL),t.emphasis=e.ptr.read(2),t.flags&r.a.Flag.PROTECTION&&(t.crc_target=e.ptr.read(16)),t))},f.decode=function(e){var t=null,i=e.next_frame,n=e.bufend,s=0,o=0;if(e.skiplen){if(e.sync||(i=e.this_frame),n-i<e.skiplen)return e.skiplen-=n-i,e.next_frame=n,e.error=r.a.Error.BUFLEN,null;i+=e.skiplen,e.skiplen=0,e.sync=1}for(var l=!0;l;){l=!1;try{if(e.sync){if(n-i<r.a.BUFFER_GUARD)return e.next_frame=i,e.error=r.a.Error.BUFLEN,null;if(255!=e.getU8(i)||224!=(224&e.getU8(i+1)))return e.this_frame=i,e.next_frame=i+1,e.error=r.a.Error.LOSTSYNC,null}else{if(e.ptr=new a.a(e.stream,i),-1==e.doSync())return n-e.next_frame>=r.a.BUFFER_GUARD&&(e.next_frame=n-r.a.BUFFER_GUARD),e.error=r.a.Error.BUFLEN,null;i=e.ptr.nextbyte()}}catch(t){return console.log("Synchronization error: "+t),e.error=r.a.Error.BUFLEN,null}if(e.this_frame=i,e.next_frame=i+1,e.ptr=new a.a(e.stream,e.this_frame),null==(t=f.actually_decode(e)))return null;if(0==t.bitrate)return console.log("Uh oh, a free bitrate stream. We're fucked."),e.error=r.a.Error.BADDATAPTR,null;if(s=t.flags&r.a.Flag.PADDING?1:0,t.layer==r.a.Layer.I)o=4*((12*t.bitrate/t.samplerate<<0)+s);else o=((t.layer==r.a.Layer.III&&t.flags&r.a.Flag.LSF_EXT?72:144)*t.bitrate/t.samplerate<<0)+s;if(o+r.a.BUFFER_GUARD>n-e.this_frame)return e.next_frame=e.this_frame,e.error=r.a.Error.BUFLEN,null;if(e.next_frame=e.this_frame+o,!e.sync){if(i=e.next_frame,255!=e.getU8(i)||224!=(224&e.getU8(i+1))){i=e.next_frame=e.this_frame+1,l=!0;continue}e.sync=1}}return t.flags|=r.a.Flag.INCOMPLETE,t};var l=function(){this.header=new f,this.options=0,this.sbsample=[];for(var e=0;e<2;e++){this.sbsample[e]=[];for(var t=0;t<36;t++){this.sbsample[e][t]=[];for(var i=0;i<32;i++)this.sbsample[e][t][i]=0}}this.overlap=[];for(e=0;e<2;e++){this.overlap[e]=[];for(var r=0;r<32;r++){this.overlap[e][r]=[];for(i=0;i<18;i++)this.overlap[e][r][i]=0}}};l.decode=function(e,t){return e.options=t.options,e.header.flags&r.a.Flag.INCOMPLETE||(e.header=f.decode(t),null!=e.header)?(e.header.flags&=~r.a.Flag.INCOMPLETE,-1==o[e.header.layer-1](t,e)?(r.a.recoverable(t.error)||(t.next_frame=t.this_frame),null):e):null},t.a=l},function(e,t,i){"use strict";var r=i(4),a=function(e){this.state={offset:0,buffer:e,amountRead:e.length,length:e.length}};(a.prototype=new r.a).absoluteAvailable=function(e,t){return e<this.state.amountRead},a.prototype.seek=function(e){this.state.offset+=e},a.prototype.read=function(e){var t=this.peek(e);return this.seek(e),t},a.prototype.peek=function(e){if(this.available(e)){var t=this.state.offset;return this.get(t,e)}throw"TODO: THROW PEEK ERROR!"},a.prototype.get=function(e,t){if(this.absoluteAvailable(e+t))return this.state.buffer.slice(e,e+t);throw"TODO: THROW GET ERROR!"},t.a=a},function(e,t,i){"use strict";for(var r=i(13),a=i(14),n=i(0),s=i(3),o=[{l:[4,4,4,4,4,4,6,6,6,8,10,12,16,18,22,28,34,40,46,54,54,192],s:[4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66],m:[4,4,4,4,4,4,6,6,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66]},{l:[4,4,4,4,4,4,6,6,8,8,10,12,16,20,24,28,34,42,50,54,76,158],s:[4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56],m:[4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56]},{l:[4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102,26],s:[4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12],m:[4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12]}],f=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0],l=[.59460355750136,.70710678118655,.84089641525371,1,1.18920711500272,1.4142135623731,1.68179283050743],h=[.857492926,.881741997,.949628649,.983314592,.995517816,.999160558,.999899195,.999993155],u=[-.514495755,-.471731969,-.313377454,-.1819132,-.094574193,-.040965583,-.014198569,-.003699975],c=[.043619387,.130526192,.216439614,.3007058,.382683432,.461748613,.537299608,.608761429,.675590208,.737277337,.79335334,.843391446,.887010833,.923879533,.953716951,.976296007,.991444861,.999048222,.999048222,.991444861,.976296007,.953716951,.923879533,.887010833,.843391446,.79335334,.737277337,.675590208,.608761429,.537299608,.461748613,.382683432,.3007058,.216439614,.130526192,.043619387],d=[.130526192,.382683432,.608761429,.79335334,.923879533,.991444861,.991444861,.923879533,.79335334,.608761429,.382683432,.130526192],p=[0,.211324865,.366025404,.5,.633974596,.788675135,1],m=[[.840896415,.707106781,.594603558,.5,.420448208,.353553391,.297301779,.25,.210224104,.176776695,.148650889,.125,.105112052,.088388348,.074325445],[.707106781,.5,.353553391,.25,.176776695,.125,.088388348,.0625,.044194174,.03125,.022097087,.015625,.011048543,.0078125,.005524272]],g=[{slen1:0,slen2:0},{slen1:0,slen2:1},{slen1:0,slen2:2},{slen1:0,slen2:3},{slen1:3,slen2:0},{slen1:1,slen2:1},{slen1:1,slen2:2},{slen1:1,slen2:3},{slen1:2,slen2:1},{slen1:2,slen2:2},{slen1:2,slen2:3},{slen1:3,slen2:1},{slen1:3,slen2:2},{slen1:3,slen2:3},{slen1:4,slen2:2},{slen1:4,slen2:3}],y=function(){this.ch=[]},b=function(){this.table_select=[],this.scalefac=[],this.subblock_gain=[]},_=function(e,t,i,a,s){var o,f,l,h,u,c=new Int32Array(new ArrayBuffer(156)),d=0,p=0;if((o=i.part2_3_length-s)<0)return n.a.Error.BADPART3LEN;U(i,a,c);var m=e.clone();e.skip(o),f=m.left,f+=24-f+7&-8,u=m.read(f),o-=f;var g,y=0,b=[];h=(l=0)+a[p++],g=i.region0_count+1;var _=r.a[i.table_select[y]],v=_.table,S=_.linbits,B=_.startbits;if(void 0===v)return n.a.Error.BADHUFFTABLE;d=0;for(var I=c[d++],E=0,w=i.big_values;w--&&f+o>0;){var A,T,k;if(l==h){if(h+=a[p++],0==--g&&(g=0==y?i.region1_count+1:0,v=(_=r.a[i.table_select[++y]]).table,S=_.linbits,B=_.startbits,void 0===v))return n.a.Error.BADHUFFTABLE;I!=c[d]&&(I=c[d],E=0),++d}if(f<21){var P=21-f+10&-8;u=u<<P|m.read(P),f+=P,o-=P}for(A=v[u>>f-(T=B)&(1<<T)-1];!A.final;)f-=T,T=A.ptr.bits,A=v[A.ptr.offset+(u>>f-T&(1<<T)-1)];if(f-=A.value.hlen,S){var x=!1;switch(k=A.value.x){case 0:t[l]=0;break;case 15:f<S+2&&(u=u<<16|m.read(16),f+=16,o-=16),k+=u>>f-S&(1<<S)-1,f-=S,F=O(k,I),x=!0;break;default:E&1<<k?F=b[k]:(E|=1<<k,F=b[k]=O(k,I)),x=!0}x&&(t[l]=u&1<<f---1?-F:F);var R=!1;switch(k=A.value.y){case 0:t[l+1]=0;break;case 15:f<S+1&&(u=u<<16|m.read(16),f+=16,o-=16),k+=u>>f-S&(1<<S)-1,f-=S,F=O(k,I),R=!0;break;default:E&1<<k?F=b[k]:(E|=1<<k,b[k]=O(k,I),F=b[k]),R=!0}R&&(t[l+1]=u&1<<f---1?-F:F)}else 0==(k=A.value.x)?t[l]=0:(E&1<<k?F=b[k]:(E|=1<<k,F=b[k]=O(k,I)),t[l]=u&1<<f---1?-F:F),0==(k=A.value.y)?t[l+1]=0:(E&1<<k?F=b[k]:(E|=1<<k,F=b[k]=O(k,I)),t[l+1]=u&1<<f---1?-F:F);l+=2}if(f+o<0)return n.a.Error.BADHUFFDATA;v=r.b[i.flags&n.a.count1table_select];for(var F=O(1,I);f+o>0&&l<=572;){f<10&&(u=u<<16|m.read(16),f+=16,o-=16);var C=v[u>>f-4&15];C.final||(f-=4,C=v[C.ptr.offset+(u>>f-C.ptr.bits&(1<<C.ptr.bits)-1)]),f-=C.value.hlen,l==h&&(h+=a[p++],I!=c[d]&&(I=c[d],F=O(1,I)),++d),t[l]=C.value.v?u&1<<f---1?-F:F:0,t[l+1]=C.value.w?u&1<<f---1?-F:F:0,(l+=2)==h&&(h+=a[p++],I!=c[d]&&(I=c[d],F=O(1,I)),++d),t[l]=C.value.x?u&1<<f---1?-F:F:0,t[l+1]=C.value.y?u&1<<f---1?-F:F:0,l+=2}if(f+o<0&&(l-=4),!(-o<=8*n.a.BUFFER_GUARD))throw new Error("assertion failed: (-bits_left <= Mad.BUFFER_GUARD * CHAR_BIT)");for(;l<576;)t[l]=0,t[l+1]=0,l+=2;return n.a.Error.NONE},v=function(e,t,i,r){var a=e.clone(),s=g[t.scalefac_compress].slen1,o=g[t.scalefac_compress].slen2;if(2==t.block_type){l=0;for(var f=t.flags&n.a.mixed_block_flag?17:18;f--;)t.scalefac[l++]=e.read(s);for(f=18;f--;)t.scalefac[l++]=e.read(o);for(f=3;f--;)t.scalefac[l++]=0}else{if(8&r)for(var l=0;l<6;++l)t.scalefac[l]=i.scalefac[l];else for(l=0;l<6;++l)t.scalefac[l]=e.read(s);if(4&r)for(l=6;l<11;++l)t.scalefac[l]=i.scalefac[l];else for(l=6;l<11;++l)t.scalefac[l]=e.read(s);if(2&r)for(l=11;l<16;++l)t.scalefac[l]=i.scalefac[l];else for(l=11;l<16;++l)t.scalefac[l]=e.read(o);if(1&r)for(l=16;l<21;++l)t.scalefac[l]=i.scalefac[l];else for(l=16;l<21;++l)t.scalefac[l]=e.read(o);t.scalefac[21]=0}return a.length(e)},S=2*Math.cos(1*Math.PI/18),B=2*Math.cos(3*Math.PI/18),I=2*Math.cos(4*Math.PI/18),E=2*Math.cos(5*Math.PI/18),w=2*Math.cos(7*Math.PI/18),A=2*Math.cos(8*Math.PI/18),T=2*Math.cos(16*Math.PI/18),k=function(e,t,i){var r,a,n,s,o,f,l,h,u,c,d,p,m,g,y,b,_,v,k,P,x,R,F,C,D;r=e[3]+e[5],a=e[3]-e[5],n=e[6]+e[2],s=e[6]-e[2],o=e[1]+e[7],f=e[1]-e[7],l=e[8]+e[0],h=e[8]-e[0],u=r+n+l,v=(a+s)*-E,k=(a-h)*-S,P=(s+h)*-w,x=(a-s+h)*-B,R=f*-B,F=(n-l)*-T,C=(r-l)*-A,D=(r-n)*-I,c=e[4]+o,p=(d=2*e[4]-o)+F,m=d-F,g=d+C,y=R+P,b=R-P,_=R+k,t[i+0]=c+u,t[i+2]=v-_,t[i+4]=D-p,t[i+6]=x,t[i+8]=m-C,t[i+10]=b-k,t[i+12]=u-2*c,t[i+14]=y+v,t[i+16]=g+D},P=[],x=0;x<9;++x)P[x]=2*Math.cos(Math.PI*(2*x+1)/36);var R=[];for(x=0;x<18;x++)R[x]=2*Math.cos(Math.PI*(2*x+1)/72);var F=function(e,t){for(var i=[],r=0;r<18;++r)i[r]=e[r]*R[r];!function(e,t){for(var i=[],r=0;r<9;++r)i[r]=e[r]+e[18-r-1];k(i,t,0);for(r=0;r<9;++r)i[r]=(e[r]-e[18-r-1])*P[r];k(i,t,1);for(r=3;r<18;r+=2)t[r]-=t[r-2]}(i,t),t[0]/=2;for(r=1;r<18;++r)t[r]=t[r]/2-t[r-1]},C=function(e,t){for(var i,r=0,n=0,s=[],o=0;o<3;++o){for(var f=a.a,l=0,h=0;h<3;++h)i=e[n+0]*f[l][0]+e[n+1]*f[l][1]+e[n+2]*f[l][2]+e[n+3]*f[l][3]+e[n+4]*f[l][4]+e[n+5]*f[l][5],s[r+h+0]=i,s[r+5-h]=-s[r+h+0],++l,i=e[n+0]*f[l][0]+e[n+1]*f[l][1]+e[n+2]*f[l][2]+e[n+3]*f[l][3]+e[n+4]*f[l][4]+e[n+5]*f[l][5],s[r+h+6]=i,s[r+11-h]=s[r+h+6],++l;r+=12,n+=6}r=0;var u=0;for(h=0;h<6;++h)t[h+0]=0,t[h+6]=s[r+0+0]*d[u+0],i=s[r+0+6]*d[u+6]+s[r+12+0]*d[u+0],t[h+12]=i,i=s[r+12+6]*d[u+6]+s[r+24+0]*d[u+0],t[h+18]=i,t[h+24]=s[r+24+6]*d[u+6],t[h+30]=0,++r,++u};n.a.III_imdct_l=function(e,t,i){switch(function(e,t){var i=[];F(e,i);for(var r=0;r<9;++r)t[r]=i[9+r];for(r=9;r<27;++r)t[r]=-i[36-(9+r)-1];for(r=27;r<36;++r)t[r]=-i[r-27]}(e,t),i){case 0:for(var r=0;r<36;++r)t[r]=t[r]*c[r];break;case 1:for(r=0;r<18;++r)t[r]=t[r]*c[r];for(r=24;r<30;++r)t[r]=t[r]*d[r-18];for(r=30;r<36;++r)t[r]=0;break;case 3:for(r=0;r<6;++r)t[r]=0;for(r=6;r<12;++r)t[r]=t[r]*d[r-6];for(r=18;r<36;++r)t[r]=t[r]*c[r]}};var D=function(e,t){for(var i=1;i<18;i+=2)e[i][t]=-e[i][t]},U=function(e,t,i){var r=e.global_gain-210,a=e.flags&n.a.scalefac_scale?2:1;if(2==e.block_type){var s=0,o=0;if(e.flags&n.a.mixed_block_flag)for(var l=e.flags&n.a.preflag?-1:0;o<36;)i[s]=r-(e.scalefac[s]+(f[s]&l)<<a),o+=t[s++];for(var h=r-8*e.subblock_gain[0],u=r-8*e.subblock_gain[1],c=r-8*e.subblock_gain[2];o<576;)i[s+0]=h-(e.scalefac[s+0]<<a),i[s+1]=u-(e.scalefac[s+1]<<a),i[s+2]=c-(e.scalefac[s+2]<<a),o+=3*t[s],s+=3}else if(e.flags&n.a.preflag)for(s=0;s<22;++s)i[s]=r-(e.scalefac[s]+f[s]<<a);else for(s=0;s<22;++s)i[s]=r-(e.scalefac[s]<<a)},O=function(e,t){var i=t%4>>0;t=t/4>>0;var r=Math.pow(e,4/3);return r*=Math.pow(2,t/4),i&&(r*=Math.pow(2,i/4)),t<0&&(r/=Math.pow(2,.75*-t)),r},L=function(e,t){var i=0;for(i+=18;i<t;i+=18)for(var r=0;r<8;++r){var a=e[i-r-1],n=e[i+r],s=a*h[r]-n*u[r];e[i-r-1]=s,s=n*h[r]+a*u[r],e[i+r]=s}},M=function(e,t,i,r){for(var a=0;a<18;++a)i[a][r]=e[a+0]+t[a],t[a]=e[a+18]},N=function(e,t,i){for(var r=0;r<18;++r)t[r][i]=e[r],e[r]=0},z=function(e,t,i){for(var r=0,a=[],s=0;s<32;s++){a[s]=[];for(var o=0;o<3;o++){a[s][o]=[];for(var f=0;f<6;f++)a[s][o][f]=0}}var l=[],h=[],u=0;if(t.flags&n.a.mixed_block_flag){u=2;for(var c=0;c<36;)c+=i[r++]}for(var d=0;d<3;++d)l[d]=u,h[d]=0;var p=i[r++];for(d=0,c=18*u;c<576;++c)0==p--&&(p=i[r++]-1,d=(d+1)%3),a[l[d]][d][h[d]++]=e[c],6==h[d]&&(h[d]=0,++l[d]);var m=[],g=0;for(s=0;s<32;s++)for(o=0;o<3;o++)for(f=0;f<6;f++)m[g++]=a[s][o][f];var y=576-18*u;for(s=0;s<y;s++)e[18*u+s]=m[u+s]},G=function(e,t,i,r){var a,s,o,f,h,u=[];if(t.ch[0].block_type!=t.ch[1].block_type||(t.ch[0].flags&n.a.mixed_block_flag)!=(t.ch[1].flags&n.a.mixed_block_flag))return n.a.Error.BADSTEREO;for(f=0;f<39;++f)u[f]=i.mode_extension;if(i.mode_extension&n.a.I_STEREO){var c,d,g=t.ch[1],y=e[1];if(i.flags|=n.a.Flag.I_STEREO,2==g.block_type){var b,_,v,S;if(b=_=v=(B=[])[0]=B[1]=B[2]=0,a=s=0,g.flags&n.a.mixed_block_flag){for(;s<36;){for(o=r[a++],f=0;f<o;++f)if(y[f]){b=a;break}y+=o,s+=o}_=a}for(S=0;s<576;){for(o=r[a++],f=0;f<o;++f)if(y[f]){v=B[S]=a;break}y+=o,s+=o,S=(S+1)%3}for(v&&(b=_),f=0;f<b;++f)u[f]=i.mode_extension&~n.a.I_STEREO;for(S=0,f=_;f<v;++f)f<B[S]&&(u[f]=i.mode_extension&~n.a.I_STEREO),S=(S+1)%3}else{var B;for(B=0,a=s=0;s<576;s+=o){for(o=r[a++],f=0;f<o;++f)if(y[f]){B=a;break}y+=o}for(f=0;f<B;++f)u[f]=i.mode_extension&~n.a.I_STEREO}if(i.flags&n.a.Flag.LSF_EXT){for(illegal_pos=t[1].ch[1].scalefac,d=m[1&g.scalefac_compress],a=s=0;s<576;++a,s+=o)if(o=r[a],u[a]&n.a.I_STEREO)if(illegal_pos[a])u[a]&=~n.a.I_STEREO;else for(c=g.scalefac[a],f=0;f<o;++f){var I;if(E=e[0][s+f],0==c)e[1][s+f]=E;else I=E*d[(c-1)/2],1&c?(e[0][s+f]=I,e[1][s+f]=E):e[1][s+f]=I}}else for(a=s=0;s<576;++a,s+=o)if(o=r[a],u[a]&n.a.I_STEREO)if((c=g.scalefac[a])>=7)u[a]&=~n.a.I_STEREO;else for(f=0;f<o;++f){var E;E=e[0][s+f],e[0][s+f]=E*p[c],e[1][s+f]=E*p[6-c]}}if(i.mode_extension&n.a.MS_STEREO)for(i.flags|=n.a.Flag.MS_STEREO,h=l[1],a=s=0;s<576;++a,s+=o)if(o=r[a],u[a]==n.a.MS_STEREO)for(f=0;f<o;++f){var w,A;w=e[0][s+f],A=e[1][s+f],e[0][s+f]=(w+A)*h,e[1][s+f]=(w-A)*h}return n.a.Error.NONE};t.a=function(e,t){var i,r,a,f,l,h,u,c,d=t.header,p=0,m=0;if(i=d.nchannels(),r=d.flags&n.a.Flag.LSF_EXT?1==i?9:17:1==i?17:32,e.next_frame-e.ptr.nextbyte()<r)return e.error=n.a.Error.BADFRAMELEN,e.md_len=0,-1;d.flags&n.a.Flag.PROTECTION&&(d.crc_check=mad_bit_crc(e.ptr,8*r,d.crc_check),d.crc_check==d.crc_target||t.options&n.a.Option.IGNORECRC||(e.error=n.a.Error.BADCRC,m=-1));var g=function(e,t,i){var r=new function(){this.gr=[],this.scfsi=[]},a=n.a.Error.NONE,s=0,o=i?1==t?1:2:1==t?5:3;r.main_data_begin=e.read(i?8:9),r.private_bits=e.read(o);var f=1;if(!i){f=2;for(var l=0;l<t;++l)r.scfsi[l]=e.read(4)}for(var h=0;h<f;++h){var u=new y;for(r.gr[h]=u,l=0;l<t;++l){var c=new b;if(u.ch[l]=c,c.part2_3_length=e.read(12),c.big_values=e.read(9),c.global_gain=e.read(8),c.scalefac_compress=e.read(i?9:4),s+=c.part2_3_length,c.big_values>288&&0==a&&(a=n.a.Error.BADBIGVALUES),c.flags=0,e.read(1)){c.block_type=e.read(2),0==c.block_type&&0==a&&(a=n.a.Error.BADBLOCKTYPE),!i&&2==c.block_type&&r.scfsi[l]&&0==a&&(a=n.a.Error.BADSCFSI),c.region0_count=7,c.region1_count=36,e.read(1)?c.flags|=n.a.mixed_block_flag:2==c.block_type&&(c.region0_count=8);for(var d=0;d<2;++d)c.table_select[d]=e.read(5);for(d=0;d<3;++d)c.subblock_gain[d]=e.read(3)}else{for(c.block_type=0,d=0;d<3;++d)c.table_select[d]=e.read(5);c.region0_count=e.read(4),c.region1_count=e.read(3)}c.flags|=e.read(i?2:3)}}return{ptr:e,si:r,data_bitlen:s,priv_bitlen:o}}(e.ptr,i,d.flags&n.a.Flag.LSF_EXT);e.ptr=g.ptr;var S=g.si,B=g.data_bitlen,I=g.priv_bitlen;u&&0==m&&(e.error=u,m=-1),d.flags|=I,d.private_bits|=S.private_bits;var E=new s.a(e.stream,e.next_frame);if(d=E.read(32),4293001216==n.a.bitwiseAnd(d,4293263360)&&(n.a.bitwiseAnd(d,65536)||E.skip(16),p=E.read(n.a.bitwiseAnd(d,524288)?9:8)),f=e.next_frame-e.ptr.nextbyte(),p>S.main_data_begin+f&&(p=0),a=S.main_data_begin+f-p,l=0,0==S.main_data_begin)c=e.ptr,e.md_len=0,l=a;else if(S.main_data_begin>e.md_len)0==m&&(e.error=n.a.Error.BADDATAPTR,m=-1);else{var w=e.md_len;if(a>S.main_data_begin){if(!(e.md_len+a-S.main_data_begin<=n.a.BUFFER_MDLEN))throw new Error("Assertion failed: (stream.md_len + md_len - si.main_data_begin <= MAD_BUFFER_MDLEN)");l=a-S.main_data_begin,e.main_data=n.a.memcpy(e.main_data,e.md_len,e.ptr.stream,e.ptr.nextbyte(),l),e.md_len+=l}c=new s.a(e.main_data,w-S.main_data_begin)}if(h=f-l,0==m&&((u=function(e,t,i,r){var a,s=t.header,f=s.samplerate;s.flags&n.a.Flag.MPEG_2_5_EXT&&(f*=2),a=(f>>7&15)+(f>>15&1)-8,s.flags&n.a.Flag.MPEG_2_5_EXT&&(a+=3);for(var l=s.flags&n.a.Flag.LSF_EXT?1:2,h=0;h<l;++h){for(var u,c=i.gr[h],d=[],p=0,m=[[],[]],g=0;g<r;++g){var y,b=c.ch[g];if(d[g]=o[a].l,2==b.block_type&&(d[g]=b.flags&n.a.mixed_block_flag?o[a].m:o[a].s),y=s.flags&n.a.Flag.LSF_EXT?n.a.III_scalefactors_lsf(e,b,0==g?0:i.gr[1].ch[1],s.mode_extension):v(e,b,i.gr[0].ch[g],0==h?0:i.scfsi[g]),u=_(e,m[g],b,d[g],y))return u}if(n.a.debug){n.a.debug.huffdecode.write(n.a.debug.iteration+"\t");for(var S=0;S<576;S++)n.a.debug.huffdecode.write(m[0][S].toFixed(8)+"\t");n.a.debug.huffdecode.write("\n")}if(s.mode==n.a.Mode.JOINT_STEREO&&0!=s.mode_extension&&(u=G(m,c,s,d[0])))return u;for(g=0;g<r;++g){b=c.ch[g];var B,I=t.sbsample[g].slice(18*h),E=(p=0,[]);if(2==b.block_type?(z(m[g],b,d[g]),b.flags&n.a.mixed_block_flag&&L(m[g],36)):L(m[g],576),2!=b.block_type||b.flags&n.a.mixed_block_flag){var w=b.block_type;b.flags&n.a.mixed_block_flag&&(w=0);for(var A=0;A<2;++A,p+=18)n.a.III_imdct_l(m[g].slice(p,p+18),E,w),M(E,t.overlap[g][A],I,A)}else for(A=0;A<2;++A,p+=18)C(m[g].slice(p,p+18),E),M(E,t.overlap[g][A],I,A);for(D(I,1),S=576;S>36&&0==m[g][S-1];)--S;if(B=32-((576-S)/18<<0),2!=b.block_type)for(A=2;A<B;++A,p+=18)n.a.III_imdct_l(m[g].slice(p,p+18),E,b.block_type),M(E,t.overlap[g][A],I,A),1&A&&D(I,A);else for(A=2;A<B;++A,p+=18)C(m[g].slice(p,p+18),E),M(E,t.overlap[g][A],I,A),1&A&&D(I,A);for(A=B;A<32;++A)N(t.overlap[g][A],I,A),1&A&&D(I,A);if(n.a.debug){for(S=0;S<18;S++){n.a.debug.sample.write(18*n.a.debug.iteration+S+"\t");for(var T=0;T<32;T++)n.a.debug.sample.write(I[S][T].toFixed(8)+"\t");n.a.debug.sample.write("\n")}n.a.debug.iteration+=1}}}return n.a.Error.NONE}(c,t,S,i))&&(e.error=u,m=-1),e.anc_ptr=c,e.anc_bitlen=8*a-B),h>=p)e.main_data=n.a.memcpy(e.main_data,0,e.stream,e.next_frame-p,p),e.md_len=p;else{if(a<S.main_data_begin){var A=S.main_data_begin-a;A+h>p&&(A=p-h),A<e.md_len&&(e.main_data=n.a.memcpy(e.main_data,0,e.main_data,e.md_len-A,A),e.md_len=A)}else e.md_len=0;e.main_data=n.a.memcpy(e.main_data,e.md_len,e.stream,e.next_frame-h,h),e.md_len+=h}return m}},function(e,t,i){"use strict";var r=function(e,t){return{final:0,ptr:{bits:t,offset:e}}},a=function(e,t,i,r,a){return{final:1,value:{v:e,w:t,x:i,y:r}}},n=[r(16,2),r(20,2),r(24,1),r(26,1),a(0,0,1,0),a(0,0,0,1),a(0,1,0,0),a(1,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(0,0,0,0),a(1,0,1,1),a(1,1,1,1),a(1,1,0,1),a(1,1,1,0),a(0,1,1,1),a(0,1,0,1),a(1,0,0,1),a(1,0,0,1),a(0,1,1,0),a(0,0,1,1),a(1,0,1,0),a(1,1,0,0)],s=[a(1,1,1,1),a(1,1,1,0),a(1,1,0,1),a(1,1,0,0),a(1,0,1,1),a(1,0,1,0),a(1,0,0,1),a(1,0,0,0),a(0,1,1,1),a(0,1,1,0),a(0,1,0,1),a(0,1,0,0),a(0,0,1,1),a(0,0,1,0),a(0,0,0,1),a(0,0,0,0)],o=function(e,t,i){return{final:1,value:{x:e,y:t,hlen:i}}},f=[o(0,0,0)],l=[o(1,1,3),o(0,1,3),o(1,0,2),o(1,0,2),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1)],h=[r(8,3),o(1,1,3),o(0,1,3),o(1,0,3),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(2,2,3),o(0,2,3),o(1,2,2),o(1,2,2),o(2,1,2),o(2,1,2),o(2,0,2),o(2,0,2)],u=[r(8,3),o(1,0,3),o(1,1,2),o(1,1,2),o(0,1,2),o(0,1,2),o(0,0,2),o(0,0,2),o(2,2,3),o(0,2,3),o(1,2,2),o(1,2,2),o(2,1,2),o(2,1,2),o(2,0,2),o(2,0,2)],c=[r(8,4),o(1,1,3),o(0,1,3),o(1,0,3),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),r(24,1),o(3,2,4),o(3,1,3),o(3,1,3),o(1,3,4),o(0,3,4),o(3,0,4),o(2,2,4),o(1,2,3),o(1,2,3),o(2,1,3),o(2,1,3),o(0,2,3),o(0,2,3),o(2,0,3),o(2,0,3),o(3,3,1),o(2,3,1)],d=[r(16,3),r(24,1),r(26,1),o(1,2,4),o(2,1,4),o(2,0,4),o(0,1,3),o(0,1,3),o(1,1,2),o(1,1,2),o(1,1,2),o(1,1,2),o(1,0,3),o(1,0,3),o(0,0,3),o(0,0,3),o(3,3,3),o(0,3,3),o(2,3,2),o(2,3,2),o(3,2,2),o(3,2,2),o(3,0,2),o(3,0,2),o(1,3,1),o(3,1,1),o(2,2,1),o(0,2,1)],p=[r(16,4),r(32,4),r(48,2),o(1,1,4),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),r(52,2),r(56,1),r(58,1),o(1,5,4),o(5,1,4),r(60,1),o(5,0,4),r(62,1),o(2,4,4),o(4,2,4),o(1,4,3),o(1,4,3),o(4,1,3),o(4,1,3),o(4,0,3),o(4,0,3),o(0,4,4),o(2,3,4),o(3,2,4),o(0,3,4),o(1,3,3),o(1,3,3),o(3,1,3),o(3,1,3),o(3,0,3),o(3,0,3),o(2,2,3),o(2,2,3),o(1,2,2),o(1,2,2),o(1,2,2),o(1,2,2),o(2,1,1),o(2,1,1),o(0,2,2),o(2,0,2),o(5,5,2),o(4,5,2),o(5,4,2),o(5,3,2),o(3,5,1),o(4,4,1),o(2,5,1),o(5,2,1),o(0,5,1),o(3,4,1),o(4,3,1),o(3,3,1)],m=[r(16,4),r(32,4),o(1,2,4),o(2,1,4),o(1,1,2),o(1,1,2),o(1,1,2),o(1,1,2),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),o(0,0,2),o(0,0,2),o(0,0,2),o(0,0,2),r(48,3),r(56,2),r(60,1),o(1,5,4),o(5,1,4),r(62,1),r(64,1),o(2,4,4),o(4,2,4),o(1,4,4),o(4,1,3),o(4,1,3),o(0,4,4),o(4,0,4),o(2,3,4),o(3,2,4),o(1,3,4),o(3,1,4),o(0,3,4),o(3,0,4),o(2,2,2),o(2,2,2),o(2,2,2),o(2,2,2),o(0,2,2),o(0,2,2),o(0,2,2),o(0,2,2),o(2,0,2),o(2,0,2),o(2,0,2),o(2,0,2),o(5,5,3),o(5,4,3),o(4,5,2),o(4,5,2),o(5,3,1),o(5,3,1),o(5,3,1),o(5,3,1),o(3,5,2),o(4,4,2),o(2,5,1),o(2,5,1),o(5,2,1),o(0,5,1),o(3,4,1),o(4,3,1),o(5,0,1),o(3,3,1)],g=[r(16,4),r(32,3),r(40,2),r(44,2),r(48,1),o(1,2,4),o(2,1,4),o(2,0,4),o(1,1,3),o(1,1,3),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),o(0,0,3),o(0,0,3),r(50,1),o(3,5,4),o(5,3,4),r(52,1),o(4,4,4),o(2,5,4),o(5,2,4),o(1,5,4),o(5,1,3),o(5,1,3),o(3,4,3),o(3,4,3),o(4,3,3),o(4,3,3),o(5,0,4),o(0,4,4),o(2,4,3),o(4,2,3),o(3,3,3),o(4,0,3),o(1,4,2),o(1,4,2),o(4,1,2),o(4,1,2),o(2,3,2),o(3,2,2),o(1,3,1),o(1,3,1),o(3,1,1),o(3,1,1),o(0,3,2),o(3,0,2),o(2,2,1),o(0,2,1),o(5,5,1),o(4,5,1),o(5,4,1),o(0,5,1)],y=[r(16,4),r(32,4),r(48,2),o(1,1,4),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),o(0,0,1),r(52,3),r(60,2),r(64,3),r(72,1),r(74,2),r(78,2),r(82,2),o(1,7,4),o(7,1,4),r(86,1),r(88,2),r(92,2),o(1,6,4),o(6,1,4),o(6,0,4),r(96,1),r(98,1),r(100,1),o(1,4,4),o(4,1,4),o(4,0,4),o(2,3,4),o(3,2,4),o(0,3,4),o(1,3,3),o(1,3,3),o(3,1,3),o(3,1,3),o(3,0,3),o(3,0,3),o(2,2,3),o(2,2,3),o(1,2,2),o(2,1,2),o(0,2,2),o(2,0,2),o(7,7,3),o(6,7,3),o(7,6,3),o(5,7,3),o(7,5,3),o(6,6,3),o(4,7,2),o(4,7,2),o(7,4,2),o(5,6,2),o(6,5,2),o(3,7,2),o(7,3,2),o(7,3,2),o(4,6,2),o(4,6,2),o(5,5,3),o(5,4,3),o(6,3,2),o(6,3,2),o(2,7,1),o(7,2,1),o(6,4,2),o(0,7,2),o(7,0,1),o(7,0,1),o(6,2,1),o(6,2,1),o(4,5,2),o(3,5,2),o(0,6,1),o(0,6,1),o(5,3,2),o(4,4,2),o(3,6,1),o(2,6,1),o(2,5,2),o(5,2,2),o(1,5,1),o(1,5,1),o(5,1,1),o(5,1,1),o(3,4,2),o(4,3,2),o(0,5,1),o(5,0,1),o(2,4,1),o(4,2,1),o(3,3,1),o(0,4,1)],b=[r(16,4),r(32,4),r(48,4),r(64,3),o(1,2,4),r(72,1),o(1,1,3),o(1,1,3),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),o(0,0,2),o(0,0,2),o(0,0,2),o(0,0,2),r(74,2),r(78,3),r(86,2),r(90,1),r(92,2),o(2,7,4),o(7,2,4),r(96,1),o(7,1,3),o(7,1,3),o(1,7,4),o(7,0,4),o(3,6,4),o(6,3,4),o(6,0,4),r(98,1),r(100,1),o(1,5,4),o(6,2,3),o(6,2,3),o(2,6,4),o(0,6,4),o(1,6,3),o(1,6,3),o(6,1,3),o(6,1,3),o(5,1,4),o(3,4,4),o(5,0,4),r(102,1),o(2,4,4),o(4,2,4),o(1,4,4),o(4,1,4),o(0,4,4),o(4,0,4),o(2,3,3),o(2,3,3),o(3,2,3),o(3,2,3),o(1,3,2),o(1,3,2),o(1,3,2),o(1,3,2),o(3,1,2),o(3,1,2),o(3,1,2),o(3,1,2),o(0,3,3),o(3,0,3),o(2,2,2),o(2,2,2),o(2,1,1),o(2,1,1),o(2,1,1),o(2,1,1),o(0,2,1),o(2,0,1),o(7,7,2),o(6,7,2),o(7,6,2),o(7,5,2),o(6,6,2),o(6,6,2),o(4,7,2),o(4,7,2),o(7,4,2),o(7,4,2),o(5,7,3),o(5,5,3),o(5,6,2),o(6,5,2),o(3,7,1),o(3,7,1),o(7,3,1),o(4,6,1),o(4,5,2),o(5,4,2),o(3,5,2),o(5,3,2),o(6,4,1),o(0,7,1),o(4,4,1),o(2,5,1),o(5,2,1),o(0,5,1),o(4,3,1),o(3,3,1)],_=[r(16,4),r(32,4),r(48,4),r(64,2),r(68,3),r(76,1),o(1,2,4),o(2,1,4),r(78,1),o(0,0,4),o(1,1,3),o(1,1,3),o(0,1,3),o(0,1,3),o(1,0,3),o(1,0,3),r(80,2),r(84,1),r(86,1),r(88,1),o(5,6,4),o(3,7,4),r(90,1),o(2,7,4),o(7,2,4