Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-07-08 05:03:20 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-07-08 05:03:20 +0300
commit7330639f355c615c09b3c7b4951be4af4e4168cc (patch)
tree1eb2ca43316e7430ef7bf709e93c90402cebaa4c /webtorrent.min.js
parent17a3380c312fede259ee0d35d6293d7745144eea (diff)
build
Diffstat (limited to 'webtorrent.min.js')
-rw-r--r--webtorrent.min.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/webtorrent.min.js b/webtorrent.min.js
index fb67ea2..bc72fb8 100644
--- a/webtorrent.min.js
+++ b/webtorrent.min.js
@@ -1,11 +1,13 @@
-(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(o,s){if(!t[o]){if(!e[o]){var f=typeof require=="function"&&require;if(!s&&f)return f(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=t[o]={exports:{}};e[o][0].call(l.exports,function(t){var r=e[o][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[o].exports}var a=typeof require=="function"&&require;for(var o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,r){t.exports=f;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("path");var o=e("stream");var s=e("./media-stream");i(f,o.Readable);function f(e,t){var r=this;if(!(r instanceof f))return new f(e,t);o.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var s=t.pieceLength;r.startPiece=i/s|0;r.endPiece=(t.end+e.offset)/s|0;r._extname=a.extname(e.name).toLowerCase();r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/s|0,2);r._offset=i-r.startPiece*s}f.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};f.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;n("before read %s",t);e._storage.read(e._piece++,function(r,i){n("after read %s (length %s) (err %s)",t,i.length,r&&r.message);e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing<i.length){i=i.slice(0,e._missing)}e._missing-=i.length;n("pushing buffer of length %s",i.length);e._reading=false;e.push(i);if(e._missing===0)e.push(null)})};f.prototype.pipe=function(e){var t=this;var r=o.Readable.prototype.pipe;if(e&&(e.nodeName==="VIDEO"||e.nodeName==="AUDIO")){var n={".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[t._extname];return r.call(t,new s(e,{type:n}))}else{return r.call(t,e)}};f.prototype.destroy=function(){var e=this;if(e.destroyed)return;e.destroyed=true;e._storage.emit("deselect",e.startPiece,e.endPiece,true)}},{"./media-stream":2,debug:137,inherits:146,path:76,stream:93}],2:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:media-stream");var i=e("inherits");var a=e("stream");var o=typeof window!=="undefined"&&window.MediaSource;i(s,a.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Writable.call(r,t);if(!o)throw new Error("web browser lacks MediaSource support");if(!t)t={};n("new mediastream %s %s",e,JSON.stringify(t));r.media=e;r._mediaSource=new o;r._sourceBuffer=null;r._cb=null;r.media.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(o.isTypeSupported(t.type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(t.type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){n("finish");r._mediaSource.endOfStream()});window.vs=r}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);n("appendBuffer %s",e.length);i._cb=r};s.prototype._flow=function(){var e=this;n("flow");if(e._cb){e._cb(null)}}},{debug:137,inherits:146,stream:93}],3:[function(e,t,r){t.exports={".aac":"audio/aac",".css":"text/css",".html":"text/html",".js":"application/javascript",".m4a":"audio/mp4",".md":"text/x-markdown",".mp3":"audio/mpeg",".mp4":"video/mp4",".oga":"audio/ogg",".ogg":"audio/ogg",".pdf":"application/pdf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm"}},{}],4:[function(e,t,r){t.exports=n;function n(e,t){var r=this;r.swarm=e;r.numPieces=t;function n(e){e.on("have",function(e){r.pieces[e]++});e.on("bitfield",r.recalculate.bind(r));e.on("close",function(){for(var t=0;t<r.numPieces;++t){r.pieces[t]-=e.peerPieces.get(t)}})}r.swarm.wires.forEach(n);r.swarm.on("wire",function(e){r.recalculate();n(e)});r.recalculate()}n.prototype.recalculate=function(){var e=this;e.pieces=[];for(var t=0;t<e.numPieces;++t){e.pieces[t]=0}e.swarm.wires.forEach(function(t){for(var r=0;r<e.numPieces;++r){e.pieces[r]+=t.peerPieces.get(r)}})};n.prototype.getRarestPiece=function(e){var t=this;var r=[];var n=Infinity;e=e||function(){return true};for(var i=0;i<t.numPieces;++i){if(!e(i))continue;var a=t.pieces[i];if(a===n){r.push(i)}else if(a<n){r=[i];n=a}}if(r.length>0){return r[Math.random()*r.length|0]}else{return-1}}},{}],5:[function(e,t,r){var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var o=e("pump");var s=e("range-parser");var f=e("url");t.exports=function c(e,t){var r=i.createServer(t);r.on("connection",function(e){e.setTimeout(36e6)});r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)c();else e.once("ready",c);function c(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'<li><a href="/'+t+'">'+e.name+"</a></li>"}).join("<br>");return r.end("<h1>WebTorrent</h1><ol>"+f+"</ol>")}var c=Number(i.slice(1));if(Number.isNaN(c)||c>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[c];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var u;if(t.headers.range){r.statusCode=206;u=s(l.length,t.headers.range)[0];n("range %s",JSON.stringify(u));r.setHeader("Content-Range","bytes "+u.start+"-"+u.end+"/"+l.length);r.setHeader("Content-Length",u.end-u.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();o(l.createReadStream(u),r)}});return r}},{debug:137,http:70,mime:147,pump:171,"range-parser":172,url:95}],6:[function(e,t,r){(function(r,n){t.exports=E;var i=e("bitfield");var a=e("block-stream2");var o=e("debug")("webtorrent:storage");var s=e("dezalgo");var f=e("end-of-stream");var c=e("events").EventEmitter;var l=e("./file-stream");var u=e("inherits");var d=e("./mime.json");var p=e("multistream");var h=e("once");var v=e("path");var m=e("simple-sha1");var g=16*1024;var _=0;var w=1;var b=2;function y(){}u(x,c);function x(e,t,r,n){var i=this;c.call(i);if(!o.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}x.prototype.readBlock=function(e,t,r){var n=this;r=s(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};x.prototype.writeBlock=function(e,t,r){var n=this;r=s(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/g;if(n.blocks[i]===b){return r(null)}t.copy(n.buffer,e);n.blocks[i]=b;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};x.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n<r;n++){if(t.blocks[n]&&!e||t.blocks[n]===b){continue}t.blocks[n]=w;return{offset:n*g,length:n===r-1?t.length-n*g:g}}return null};x.prototype.cancelBlock=function(e){var t=this;if(!t._verifyOffset(e)){return false}var r=e/g;if(t.blocks[r]===w){t.blocks[r]=_}return true};x.prototype._reset=function(){var e=this;e.verified=false;e.blocks=new n(Math.ceil(e.length/g));e.blocks.fill(0);e.blocksWritten=0};x.prototype.verify=function(e){var t=this;e=e||t.buffer;if(t.verified||!e){return}if(t.noVerify){t.verified=true;r();return}m(e,function(e){t.verified=e===t.hash;r()});function r(){if(t.verified){t.emit("done")}else{t.emit("warning",new Error("piece "+t.index+" failed verification"));t._reset()}}};x.prototype._verifyOffset=function(e){var t=this;if(e%g===0){return true}else{t.emit("warning",new Error("invalid block offset "+e+", not multiple of "+g));return false}};x.prototype._verifyBlock=function(e,t){var r=this;if(t.length===g){return true}else if(t.length===r.length-e&&r.length-e<g){return true}else{r.emit("warning",new Error("invalid block size "+t.length));return false}};x.prototype._lazyAllocBuffer=function(){var e=this;if(!e.buffer){e.buffer=new n(e.length)}};u(k,c);function k(e,t,r,n){var i=this;c.call(i);if(!o.enabled)i.setMaxListeners(0);i.storage=e;i.name=t.name;i.path=t.path;i.length=t.length;i.offset=t.offset;i.pieces=r;i.pieceLength=n;i.done=false;i.pieces.forEach(function(e){e.on("done",function(){i._checkDone()})});i._checkDone()}k.prototype.select=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};k.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};k.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new l(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));f(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};k.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");t.getBuffer(function(r,n){if(r)return e(r);var i=d[v.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);var o=window.URL.createObjectURL(a);e(null,o)})};k.prototype.getBuffer=function(e){var t=this;e=s(h(e));var r;if(t.storage.buffer){var i=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)i();else t.once("done",i)}else{r=new n(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};k.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){r.nextTick(function(){e.emit("done")})}};u(E,c);function E(e,t){var r=this;c.call(r);if(!o.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new i(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new n(e.length)}var a=r.pieceLength=e.pieceLength;var s=e.lastPieceLength;var f=e.pieces.length;r.pieces=e.pieces.map(function(e,n){var i=n*a;var o=i+(n===f-1?s:a);var c=r.buffer?r.buffer.slice(i,o):o-i;var l=new x(n,e,c,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var n=t+e.length-1;var i=t/a|0;var o=n/a|0;var s=r.pieces.slice(i,o+1);var f=new k(r,e,s,a);f.on("done",r._onFileDone.bind(r,f));return f})}E.BLOCK_LENGTH=g;E.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=h(t||function(){});var n=0;var i=new p(e);var o=new a(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",c);i.pipe(o).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var o=new a(g,{zeroPadding:false});o.on("data",s);o.on("end",f);function s(e){var n=i*g;i+=1;r.writeBlock(t,n,e)}function f(){c()}function c(){o.removeListener("data",s);o.removeListener("end",f)}o.end(e)}function f(e){l();t(e)}function c(){l();t(null)}function l(){i.removeListener("error",f);o.removeListener("data",s);o.removeListener("error",f);r.removeListener("done",c)}};Object.defineProperty(E.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*g)},0)}});Object.defineProperty(E.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;r<n;r++){t-=e.bitfield.get(r)}return t}});E.prototype.readBlock=function(e,t,r,n){var i=this;n=s(n);var a=i.pieces[e];if(!a)return n(new Error("invalid piece index "+e));a.readBlock(t,r,n)};E.prototype.writeBlock=function(e,t,r,n){var i=this;if(!n)n=y;n=s(n);if(i.readonly)return n(new Error("cannot write to readonly storage"));var a=i.pieces[e];if(!a)return n(new Error("invalid piece index "+e));a.writeBlock(t,r,n)};E.prototype.read=function(e,t,r,i){var a=this;if(typeof t==="function"){i=r;r=t;t=null}r=s(r);var o=a.pieces[e];if(!o){return r(new Error("invalid piece index "+e))}if(!o.verified&&!i){return r(new Error("Storage.read called on incomplete piece "+e))}var f=0;var c=o.length;if(t){f=t.offset||0;c=t.length||c}if(o.buffer){return r(null,o.buffer.slice(f,f+c))}var l=[];function u(){if(c<=0)return r(null,n.concat(l));var t=f;var i=Math.min(g,c);f+=i;c-=i;a.readBlock(e,t,i,function(e,t){if(e)return r(e);l.push(t);u()})}u()};E.prototype.reserveBlock=function(e,t){var r=this;var n=r.pieces[e];if(!n)return null;return n.reserveBlock(t)};E.prototype.cancelBlock=function(e,t){var r=this;var n=r.pieces[e];if(!n)return false;return n.cancelBlock(t)};E.prototype.remove=function(e){if(e)s(e)(null)};E.prototype.close=function(e){var t=this;t.closed=true;if(e)s(e)(null)};E.prototype._onPieceDone=function(e){var t=this;t.bitfield.set(e.index);o("piece done "+e.index+" ("+t.numMissing+" still missing)");t.emit("piece",e)};E.prototype._onFileDone=function(e){var t=this;o("file done "+e.name);t.emit("file",e);t._checkDone()};E.prototype._checkDone=function(){var e=this;if(!e.done&&e.files.every(function(e){return e.done})){e.done=true;e.emit("done")}}}).call(this,e("_process"),e("buffer").Buffer)},{"./file-stream":1,"./mime.json":3,_process:77,bitfield:9,"block-stream2":38,buffer:65,debug:137,dezalgo:140,"end-of-stream":144,events:69,inherits:146,multistream:149,once:152,path:76,"simple-sha1":178}],7:[function(e,t,r){(function(r,n){t.exports=L;var i=e("addr-to-ip-port");var a=e("create-torrent");var o=e("debug")("webtorrent:torrent");var s=e("torrent-discovery");var f=e("events").EventEmitter;var c=e("inherits");var l=e("run-parallel");var u=e("parse-torrent");var d=e("re-emitter");var p=e("bittorrent-swarm");var h=e("uniq");var v=e("ut_metadata");var m=e("ut_pex");var g=e("./rarity-map");var _=e("./server");var w=e("./storage");var b=128*1024;var y=3e4;var x=5e3;var k=3*w.BLOCK_LENGTH;var E=.5;var S=1;var A=1e4;var T=2;function I(){}c(L,f);function L(e,t){var r=this;f.call(r);if(!o.enabled)r.setMaxListeners(0);o("new torrent");r.opts=t;r.client=t.client;r.hotswapEnabled="hotswap"in t?t.hotswap:true;r.verify=t.verify;r.chokeTimeout=t.chokeTimeout||x;r.pieceTimeout=t.pieceTimeout||y;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.files=[];r.metadata=null;r.parsedTorrent=null;r.storage=null;r.numBlockedPeers=0;r._amInterested=false;r._selections=[];r._critical=[];r._storageImpl=t.storage||w;this._torrentFileURL=null;if(e)r._onTorrentId(e)}Object.defineProperty(L.prototype,"length",{get:function(){return this.parsedTorrent&&this.parsedTorrent.length||0}});Object.defineProperty(L.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(L.prototype,"progress",{get:function(){return this.parsedTorrent&&this.downloaded/this.parsedTorrent.length||0}});Object.defineProperty(L.prototype,"downloaded",{get:function(){return this.storage&&this.storage.downloaded||0}});Object.defineProperty(L.prototype,"uploaded",{get:function(){return this.swarm.uploaded}});Object.defineProperty(L.prototype,"ratio",{get:function(){return this.uploaded&&this.downloaded/this.uploaded||0}});Object.defineProperty(L.prototype,"magnetURI",{get:function(){return u.toMagnetURI(this.parsedTorrent)}});Object.defineProperty(L.prototype,"torrentFile",{get:function(){return u.toTorrentFile(this.parsedTorrent)}});Object.defineProperty(L.prototype,"torrentFileURL",{get:function(){if(typeof window==="undefined")throw new Error("browser-only property");if(this._torrentFileURL)return this._torrentFileURL;this._torrentFileURL=window.URL.createObjectURL(new window.Blob([this.torrentFile],{type:"application/x-bittorrent"}));return this._torrentFileURL}});L.prototype._onTorrentId=function(e){var t=this;if(t.destroyed)return;var r=e&&e.parsedTorrent;if(r){t._onParsedTorrent(r)}else{u.remote(e,function(e,r){if(t.destroyed)return;if(e)return t._onError(e);t._onParsedTorrent(r)})}};L.prototype._onParsedTorrent=function(e){var t=this;if(t.destroyed)return;t.parsedTorrent=e;t.infoHash=e.infoHash;if(!t.infoHash){return t._onError(new Error("Malformed torrent data: Missing info hash."))}if(t.parsedTorrent.name)t.name=t.parsedTorrent.name;if(t.opts.announce){t.parsedTorrent.announce=t.parsedTorrent.announce.concat(t.opts.announce)}if(n.WEBTORRENT_ANNOUNCE){t.parsedTorrent.announce=t.parsedTorrent.announce.concat(n.WEBTORRENT_ANNOUNCE)}if(t.parsedTorrent.announce.length===0){t.parsedTorrent.announce=a.announceList.map(function(e){return e[0]})}h(t.parsedTorrent.announce);t.swarm=new p(t.infoHash,t.client.peerId,{handshake:{dht:!!t.client.dht}});t.swarm.on("error",t._onError.bind(t));d(t.swarm,t,["warning"]);t.swarm.on("wire",t._onWire.bind(t));t.swarm.on("download",t.client.downloadSpeed.bind(t.client));t.swarm.on("upload",t.client.uploadSpeed.bind(t.client));t.swarm.listen(t.client.torrentPort,t._onSwarmListening.bind(t));if(t.parsedTorrent.urlList){t.parsedTorrent.urlList.forEach(t.addWebSeed.bind(t))}r.nextTick(function(){if(t.destroyed)return;t.emit("infoHash",t.infoHash)})};L.prototype._onSwarmListening=function(){var e=this;if(e.destroyed)return;if(e.swarm.server)e.client.torrentPort=e.swarm.address().port;e.discovery=new s({announce:e.parsedTorrent.announce,dht:e.client.dht,tracker:e.client.tracker,peerId:e.client.peerId,port:e.client.torrentPort,rtcConfig:e.client._rtcConfig,wrtc:e.client._wrtc});e.discovery.on("error",e._onError.bind(e));e.discovery.setTorrent(e.infoHash);e.discovery.on("peer",e.addPeer.bind(e));d(e.discovery,e,["dhtAnnounce","warning"]);if(e.parsedTorrent.info)e._onMetadata(e.parsedTorrent);e.emit("listening",e.client.torrentPort)};L.prototype._onMetadata=function(e){var t=this;if(t.metadata||t.destroyed)return;o("got metadata");if(e&&e.infoHash){t.metadata=u.toTorrentFile(e);t.parsedTorrent=e}else{t.metadata=e;var n=t.parsedTorrent.announce;try{t.parsedTorrent=u(t.metadata)}catch(i){return t._onError(i)}t.parsedTorrent.announce=n}t.name=t.parsedTorrent.name;t.discovery.setTorrent(t.parsedTorrent);t.rarityMap=new g(t.swarm,t.parsedTorrent.pieces.length);t.storage=new t._storageImpl(t.parsedTorrent,t.opts);t.storage.on("piece",t._onStoragePiece.bind(t));t.storage.on("file",function(e){t.emit("file",e)});t._reservations=t.storage.pieces.map(function(){return[]});t.storage.on("done",function(){if(t.discovery.tracker)t.discovery.tracker.complete();o("torrent "+t.infoHash+" done");t.emit("done")});t.storage.on("select",t.select.bind(t));t.storage.on("deselect",t.deselect.bind(t));t.storage.on("critical",t.critical.bind(t));t.storage.files.forEach(function(e){t.files.push(e)});t.swarm.wires.forEach(function(e){if(e.ut_metadata)e.ut_metadata.setMetadata(t.metadata);t._onWireWithMetadata(e)});if(t.verify){r.nextTick(function(){o("verifying existing torrent data");var e=0;var r=0;l(t.storage.pieces.map(function(n){return function(i){t.storage.read(n.index,function(a,s){e+=1;t.emit("verifying",{percentDone:100*e/t.storage.pieces.length,percentVerified:100*r/t.storage.pieces.length});if(!a&&s){n.verify(s);r+=n.verified;o("piece "+(n.verified?"verified":"invalid")+" "+n.index)}i()},true)}}),t._onStorage.bind(t))})}else{r.nextTick(t._onStorage.bind(t))}r.nextTick(function(){t.emit("metadata")})};L.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;o("destroy");if(t._rechokeIntervalId){clearInterval(t._rechokeIntervalId);t._rechokeIntervalId=null}if(t._torrentFileURL)window.URL.revokeObjectURL(t._torrentFileURL);var r=[];if(t.swarm)r.push(function(e){t.swarm.destroy(e)});if(t.discovery)r.push(function(e){t.discovery.stop(e)});if(t.storage)r.push(function(e){t.storage.close(e)});l(r,e)};L.prototype.addPeer=function(e){var t=this;function r(){t.emit("peer",e);t.swarm.addPeer(e)}if(typeof e==="string"&&t.client.blocked&&t.client.blocked.contains(i(e)[0])){t.numBlockedPeers+=1;t.emit("blockedPeer",e);return false}else{if(t.swarm)r();else t.on("listening",r);return true}};L.prototype.addWebSeed=function(e){var t=this;t.swarm.addWebSeed(e,t.parsedTorrent)};L.prototype.select=function(e,t,r,n){var i=this;if(e>t||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;o("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;o("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i<n._selections.length;++i){var a=n._selections[i];if(a.from===e&&a.to===t&&a.priority===r){n._selections.splice(i--,1);break}}n._updateSelections()};L.prototype.critical=function(e,t){var r=this;o("critical %s-%s",e,t);for(var n=e;n<=t;++n){r._critical[n]=true}r._updateSelections()};L.prototype._onWire=function(e,t){var r=this;o("got wire (%s)",t||"Unknown");if(t){var n=i(t);e.remoteAddress=n[0];e.remotePort=n[1]}if(e.peerExtensions.dht&&r.client.dht&&r.client.dht.listening){e.on("port",function(t){if(!e.remoteAddress){o("ignoring port from peer with no address");return}o("port: %s (from %s)",t,e.remoteAddress+":"+e.remotePort);r.client.dht.addNode(e.remoteAddress+":"+t)});e.port(r.client.dht.address().port)}e.on("timeout",function(){o("wire timeout (%s)",t);e.destroy()});e.setTimeout(r.pieceTimeout,true);e.setKeepAlive(true);e.use(v(r.metadata));if(!r.metadata){e.ut_metadata.on("metadata",function(e){o("got metadata via ut_metadata");r._onMetadata(e)});e.ut_metadata.fetch()}if(typeof m==="function"){e.use(m());e.ut_pex.on("peer",function(e){o("ut_pex: got peer: %s (from %s)",e,t);r.addPeer(e)});e.ut_pex.on("dropped",function(e){o("ut_pex: dropped peer: %s (from %s)",e,t);var n=r.swarm._peers[e];if(!n||!n.conn)r.swarm.removePeer(e)})}r.emit("wire",e);if(r.metadata){r._onWireWithMetadata(e)}};L.prototype._onWireWithMetadata=function(e){var t=this;var r=null;var n=t.chokeTimeout;function i(){if(t.destroyed||e.destroyed)return;if(t.swarm.numQueued>2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function s(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;a<t.storage.pieces.length;++a){if(!e.peerPieces.get(a))return}e.isSeeder=true;e.choke()}e.on("bitfield",function(){s();t._update()});e.on("have",function(){s();t._update()});e.once("interested",function(){e.unchoke()});e.on("close",function(){clearTimeout(r)});e.on("choke",function(){clearTimeout(r);r=setTimeout(i,n);if(r.unref)r.unref()});e.on("unchoke",function(){clearTimeout(r);t._update()});e.on("request",function(r,n,i,a){if(i>b){o("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;s()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;o("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),A);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;o("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t<e._selections.length;t++){var r=e._selections[t];var n=r.offset;while(e.storage.bitfield.get(r.from+r.offset)&&r.from+r.offset<r.to){r.offset++}if(n!==r.offset)r.notify();if(r.to!==r.from+r.offset)continue;if(!e.storage.bitfield.get(r.from+r.offset))continue;e._selections.splice(t--,1);r.notify();e._updateInterest()}if(!e._selections.length)e.emit("idle")};L.prototype._updateInterest=function(){var e=this;var t=e._amInterested;e._amInterested=!!e._selections.length;e.swarm.wires.forEach(function(t){if(e._amInterested)t.interested();else t.uninterested()});if(t===e._amInterested)return;if(e._amInterested)e.emit("interested");else e.emit("uninterested")};L.prototype._update=function(){var e=this;if(e.destroyed)return;B(e.swarm.wires,e._updateWire.bind(e))};L.prototype._updateWire=function(e){var t=this;if(e.peerChoking)return;if(!e.downloaded)return a();var r=C(e,E);if(e.requests.length>=r)return;var n=C(e,S);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var o=n.from+n.offset;var s=n.to;var f=s-o+1;var c={};var l=0;var u=i(o,s,c);while(l<f){a=t.rarityMap.getRarestPiece(u);if(a<0)break;if(t._request(e,a,false))return;c[a]=true;l+=1}}else{for(a=n.to;a>=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function o(){var r=e.downloadSpeed()||1;if(r>k)return function(){return true};var n=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var o=t.storage.pieces[e];var s=o.blocks.length-o.blocksWritten;for(;a<t.swarm.wires.length;a++){var f=t.swarm.wires[a];var c=f.downloadSpeed();if(c<k)continue;if(c<=r)continue;if(!f.peerPieces.get(e))continue;if((s-=c*n)>0)continue;i--;return false}return true}}function s(e){var r=e;for(var n=e;n<t._selections.length&&t._selections[n].priority;n++){r=n}var i=t._selections[e];t._selections[e]=t._selections[r];t._selections[r]=i}function f(r){if(e.requests.length>=n)return true;var a=o();for(var f=0;f<t._selections.length;f++){var c=t._selections[f];var l;if(t.strategy==="rarest"){var u=c.from+c.offset;var d=c.to;var p=d-u+1;var h={};var v=0;var m=i(u,d,h,a);while(v<p){l=t.rarityMap.getRarestPiece(m);if(l<0)break;while(t._request(e,l,t._critical[l]||r)){}if(e.requests.length<n){h[l]=true;v++;continue}if(c.priority)s(f);return true}}else{for(l=c.from+c.offset;l<=c.to;l++){if(!e.peerPieces.get(l)||!a(l))continue;while(t._request(e,l,t._critical[l]||r)){}if(e.requests.length<n)continue;if(c.priority)s(f);return true}}}return false}};L.prototype._rechoke=function(){var e=this;if(e._rechokeOptimisticTime>0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(o);var r=0;var n=0;for(;n<t.length&&r<e._rechokeNumSlots;++n){t[n].isChoked=false;if(t[n].wire.peerInterested)r+=1}if(!e._rechokeOptimisticWire&&n<t.length&&e._rechokeNumSlots){var i=t.slice(n).filter(function(e){return e.wire.peerInterested});var a=i[R(i.length)];if(a){a.isChoked=false;e._rechokeOptimisticWire=a.wire;e._rechokeOptimisticTime=T}}t.forEach(function(e){if(e.wire.amChoking!==e.isChoked){if(e.isChoked)e.wire.choke();else e.wire.unchoke()}});function o(e,t){if(e.downloadSpeed!==t.downloadSpeed){return t.downloadSpeed-e.downloadSpeed}if(e.uploadSpeed!==t.uploadSpeed){return t.uploadSpeed-e.uploadSpeed}if(e.wire.amChoking!==t.wire.amChoking){return e.wire.amChoking?1:-1}return e.salt-t.salt}};L.prototype._hotswap=function(e,t){var r=this;if(!r.hotswapEnabled)return false;var n=e.downloadSpeed();if(n<w.BLOCK_LENGTH)return false;if(!r._reservations[t])return false;var i=r._reservations[t];if(!i){return false}var a=Infinity;var o;var s;for(s=0;s<i.length;s++){var f=i[s];if(!f||f===e)continue;var c=f.downloadSpeed();if(c>=k)continue;if(2*c>n||c>a)continue;o=f;a=c}if(!o)return false;for(s=0;s<i.length;s++){if(i[s]===o)i[s]=null}for(s=0;s<o.requests.length;s++){var l=o.requests[s];if(l.piece!==t)continue;r.storage.cancelBlock(t,l.offset)}r.emit("hotswap",o,e,t);return true};L.prototype._request=function(e,t,n){var i=this;var a=e.requests.length;if(i.storage.bitfield.get(t))return false;var s=C(e,S);if(a>=s)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var c=i.storage.reserveBlock(t,f);if(!c&&!f&&n&&i._hotswap(e,t)){c=i.storage.reserveBlock(t,false)}if(!c)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var u=l.indexOf(null);if(u===-1)u=l.length;l[u]=e;function d(n,a){if(!i.ready){i.once("ready",function(){d(n,a)});return}if(l[u]===e)l[u]=null;if(n){o("error getting piece %s (offset: %s length: %s) from %s: %s",t,c.offset,c.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,c.offset);r.nextTick(i._update.bind(i));return false}else{o("got piece %s (offset: %s length: %s) from %s",t,c.offset,c.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,c.offset,a,function(e){if(e){o("error writing block");i.storage.cancelBlock(t,c.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,c.offset,c.length,d);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){return new _(t,e)}};L.prototype._onError=function(e){var t=this;o("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function C(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function R(e){return Math.random()*e|0}function B(e,t){var r=e.map(function(e,t){return t});for(var n=r.length-1;n>0;--n){var i=R(n+1);var a=r[n];r[n]=r[i];r[i]=a}r.forEach(function(r){t(e[r],r,e)})}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":4,"./server":5,"./storage":6,_process:77,"addr-to-ip-port":8,"bittorrent-swarm":10,"create-torrent":98,debug:137,events:69,inherits:146,"parse-torrent":153,"re-emitter":173,"run-parallel":174,"torrent-discovery":181,uniq:202,ut_metadata:203,ut_pex:51}],8:[function(e,t,r){var n=/^\[?([^\]]+)\]?:(\d+)$/;var i={};var a=0;t.exports=function o(e){if(a===1e5)i={};if(!i[e]){var t=n.exec(e);if(!t)throw new Error("invalid addr: "+e);i[e]=[t[1],Number(t[2])];a+=1}return i[e]};t.exports.reset=function s(){i={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r<e;r++)t[r]=0};function n(e,t){if(!(this instanceof n)){return new n(e,t)}if(arguments.length===0){e=0}this.grow=t&&(isFinite(t.grow)&&i(t.grow)||t.grow)||0;
-if(typeof e==="number"||e===undefined){e=new r(i(e));if(e.fill)e.fill(0)}this.buffer=e}function i(e){var t=e>>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t<this.buffer.length&&!!(this.buffer[t]&128>>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length<r+1)this._grow(Math.max(r+1,Math.min(2*this.buffer.length,this.grow)));this.buffer[r]|=128>>e%8}else if(r<this.buffer.length){this.buffer[r]&=~(128>>e%8)}};n.prototype._grow=function(e){if(this.buffer.length<e&&e<=this.grow){var t=new r(e);if(t.fill)t.fill(0);if(this.buffer.copy)this.buffer.copy(t,0);else{for(var n=0;n<this.buffer.length;n++){t[n]=this.buffer[n]}}this.buffer=t}};if(typeof t!=="undefined")t.exports=n}).call(this,e("buffer").Buffer)},{buffer:65}],10:[function(e,t,r){(function(r,n){t.exports=v;var i=e("addr-to-ip-port");var a=e("debug")("bittorrent-swarm");var o=e("dezalgo");var s=e("events").EventEmitter;var f=e("inherits");var c=e("net");var l=e("./lib/peer");var u=e("speedometer");var d=e("./lib/tcp-pool");var p=55;var h=[1e3,5e3,15e3];f(v,s);function v(e,t,r){var i=this;if(!(i instanceof v))return new v(e,t,r);s.call(i);i.infoHash=typeof e==="string"?new n(e,"hex"):e;i.infoHashHex=i.infoHash.toString("hex");i.peerId=typeof t==="string"?new n(t,"hex"):t;i.peerIdHex=i.peerId.toString("hex");if(!r)r={};a("new swarm (i %s p %s)",i.infoHashHex,i.peerIdHex);i.handshakeOpts=r.handshake;i.maxConns=r.maxConns!==undefined?r.maxConns:p;i.destroyed=false;i.listening=false;i.paused=false;i.server=null;i.wires=[];i._queue=[];i._peers={};i._peersLength=0;i._port=0;i.downloaded=0;i.uploaded=0;i.downloadSpeed=u();i.uploadSpeed=u()}Object.defineProperty(v.prototype,"ratio",{get:function(){var e=this;return e.uploaded/e.downloaded||0}});Object.defineProperty(v.prototype,"numQueued",{get:function(){var e=this;return e._queue.length+(e._peersLength-e.numConns)}});Object.defineProperty(v.prototype,"numConns",{get:function(){var e=this;var t=0;for(var r in e._peers){var n=e._peers[r];if(n&&n.conn)t+=1}return t}});Object.defineProperty(v.prototype,"numPeers",{get:function(){var e=this;return e.wires.length}});v.prototype.addPeer=function(e){var t=this;if(t.destroyed){if(e&&e.destroy)e.destroy(new Error("swarm already destroyed"));return}if(typeof e==="string"&&!t._validAddr(e)){a("ignoring invalid peer %s (from swarm.addPeer)",e);return}var r=e&&e.id||e;if(t._peers[r])return;a("addPeer %s",r);var n;if(typeof e==="string"){n=l.createOutgoingTCPPeer(e,t);t._queue.push(n);t._drain()}else{n=l.createWebRTCPeer(e,t)}t._peers[n.id]=n;t._peersLength+=1};v.prototype.addWebSeed=function(e,t){var r=this;if(r.destroyed)return;if(!/^https?:\/\/.+/.test(e)){a("ignoring invalid web seed %s (from swarm.addWebSeed)",e);return}if(r._peers[e])return;a("addWebSeed %s",e);r._peers[e]=l.createWebPeer(e,t,r);r._peersLength+=1};v.prototype._addIncomingPeer=function(e){var t=this;if(t.destroyed)return e.destroy(new Error("swarm already destroyed"));if(t.paused)return e.destroy(new Error("swarm paused"));if(!t._validAddr(e.addr)){return e.destroy(new Error("invalid addr "+e.addr+" (from incoming)"))}a("_addIncomingPeer %s",e.id);t._peers[e.id]=e;t._peersLength+=1};v.prototype.removePeer=function(e){var t=this;var r=t._peers[e];if(!r)return;a("removePeer %s",e);t._peers[e]=null;t._peersLength-=1;r.destroy()};v.prototype.pause=function(){var e=this;if(e.destroyed)return;a("pause");e.paused=true};v.prototype.resume=function(){var e=this;if(e.destroyed)return;a("resume");e.paused=false;e._drain()};v.prototype.listen=function(e,t,n){var i=this;if(typeof t==="function"){n=t;t=undefined}if(n)n=o(n);if(i.listening)throw new Error("swarm already listening");if(r.browser){n()}else{i._port=e||d.getDefaultListenPort(i.infoHashHex);i._hostname=t;if(n)i.once("listening",n);a("listen %s",e);var s=d.addSwarm(i);i.server=s.server}};v.prototype._onListening=function(e){var t=this;t._port=e;t.listening=true;t.emit("listening")};v.prototype.address=function(){var e=this;return e.server.address()};v.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.listening=false;t.paused=false;if(e)t.once("close",e);a("destroy");for(var r in t._peers){t.removePeer(r)}d.removeSwarm(t,function(){t.emit("close")})};v.prototype._drain=function(){var e=this;a("_drain numConns %s maxConns %s",e.numConns,e.maxConns);if(typeof c.connect!=="function"||e.destroyed||e.paused||e.numConns>=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n=r[0];var o=r[1];var s=t.conn=c.connect({host:n,port:o,localAddress:e._hostname});s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}function r(){var r=l.createOutgoingTCPPeer(t.addr,e);r.retries=t.retries+1;e._queue.push(r);e._drain()}var n=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,n,t.retries+1);var i=setTimeout(r,n);if(i.unref)i.unref()})};v.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};v.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:77,"addr-to-ip-port":51,buffer:65,debug:27,dezalgo:30,events:69,inherits:33,net:51,speedometer:37}],11:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var o=25e3;var s=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var o=r.addr;if(!o&&r.conn.remoteAddress){o=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,o)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},o);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},s);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;n("destroy Peer %s (error: %s)",t.id,e&&(e.message||e));if(t.swarm)t.swarm.wires.splice(t.swarm.wires.indexOf(t.wire),1);if(t.conn)t.conn.destroy();if(t.wire)t.wire.destroy();if(t.swarm){t.swarm.removePeer(t.id);t.swarm._drain()}clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);t.conn=null;t.swarm=null;t.wire=null}},{"./webconn":13,"bittorrent-protocol":15,debug:27}],12:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var o=e("./peer");var s={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=s[e._port];if(!t)t=s[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=s[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var o=n.swarms[a];if(o)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in s){var r=s[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});s[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){s[e.port]=null;e.port=r;s[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=o.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var o=i.toString("hex");r();e.removeListener("close",r);var s=t.swarms[o];if(s){n.swarm=s;s._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+o+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:77,debug:27,dezalgo:30,net:51}],13:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var o=e("inherits");var s=e("bittorrent-protocol");o(f,s);function f(e,t){var a=this;s.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var o=a.parsedTorrent.pieces.length;var s=new n(o);for(var f=0;f<=o;f++){s.set(f,true)}a.bitfield(s)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var o=this;var s=e*o.parsedTorrent.pieceLength;var f=s+t;var c=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,c);var l={url:o.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+c}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:14,"bittorrent-protocol":15,buffer:65,debug:27,inherits:33,"simple-get":34}],14:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{buffer:65,dup:9}],15:[function(e,t,r){(function(r){t.exports=b;var n=e("bitfield");var i=e("bencode");var a=e("debug")("bittorrent-protocol");var o=e("xtend");var s=e("inherits");var f=e("speedometer");var c=e("stream");var l=4e5;var u=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var p=new r([0,0,0,1,0]);var h=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var m=new r([0,0,0,1,3]);var g=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function w(e,t,r,n){this.piece=e;this.offset=t;this.length=r;this.callback=n}s(b,c.Duplex);function b(){if(!(this instanceof b))return new b;c.Duplex.call(this);a("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:l});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};this._ext={};this._nextExt=1;this.uploaded=0;this.downloaded=0;this.uploadSpeed=f();this.downloadSpeed=f();this._keepAlive=null;this._timeout=null;this._timeoutMs=0;this.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}b.prototype.setKeepAlive=function(e){clearInterval(this._keepAlive);if(e===false)return;this._keepAlive=setInterval(this._push.bind(this,d),6e4)};b.prototype.setTimeout=function(e,t){this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};b.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;a("destroy");this.end()};b.prototype.end=function(){this._onUninterested();this._onChoke();c.Duplex.prototype.end.apply(this,arguments)};b.prototype.use=function(e){var t=e.prototype.name;if(!t){throw new Error("Extension API requires a named function, e.g. function name() {}")}var r=this._nextExt;var n=new e(this);function i(){}if(typeof n.onHandshake!=="function"){n.onHandshake=i}if(typeof n.onExtendedHandshake!=="function"){n.onExtendedHandshake=i}if(typeof n.onMessage!=="function"){n.onMessage=i}this.extendedMapping[r]=t;this._ext[t]=n;this[t]=n;this._nextExt+=1};b.prototype.handshake=function(e,t,n){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}var i=new r(g);i[5]|=16;if(n&&n.dht)i[7]|=1;this._push(r.concat([u,i,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};b.prototype._sendExtendedHandshake=function(){var e=o(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};b.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this.peerRequests.splice(0,this.peerRequests.length);this._push(p)};b.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._push(h)};b.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._push(v)};b.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._push(m)};b.prototype.have=function(e){this._message(4,[e],null)};b.prototype.bitfield=function(e){if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};b.prototype.request=function(e,t,r,n){if(!n)n=function(){};if(this._finished)return n(new Error("wire is closed"));if(this.peerChoking)return n(new Error("peer is choking"));this.requests.push(new w(e,t,r,n));this._updateTimeout();this._message(6,[e,t,r],null)};b.prototype.piece=function(e,t,r){this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};b.prototype.cancel=function(e,t,r){this._callback(y(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};b.prototype.port=function(e){var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};b.prototype.extended=function(e,t){if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};b.prototype._onKeepAlive=function(){this.emit("keep-alive")};b.prototype._onHandshake=function(e,t,r){this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var n;for(n in this._ext){this._ext[n].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};b.prototype._onChoke=function(){this.peerChoking=true;this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};b.prototype._onUnchoke=function(){this.peerChoking=false;this.emit("unchoke")};b.prototype._onInterested=function(){this.peerInterested=true;this.emit("interested")};b.prototype._onUninterested=function(){this.peerInterested=false;this.emit("uninterested")};b.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this.peerPieces.set(e,true);this.emit("have",e)};b.prototype._onBitField=function(e){this.peerPieces=new n(e);this.emit("bitfield",this.peerPieces)};b.prototype._onRequest=function(e,t,r){if(this.amChoking)return;var n=function(n,a){if(i!==y(this.peerRequests,e,t,r))return;if(n)return;this.piece(e,t,a)}.bind(this);var i=new w(e,t,r,n);this.peerRequests.push(i);this.emit("request",e,t,r,n)};b.prototype._onPiece=function(e,t,r){this._callback(y(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};b.prototype._onCancel=function(e,t,r){y(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};b.prototype._onPort=function(e){this.emit("port",e)};b.prototype._onExtended=function(e,t){var r,n;if(e===0&&(r=x(t))){this.peerExtendedHandshake=r;if(typeof r.m==="object"){for(n in r.m){this.peerExtendedMapping[n]=Number(r.m[n].toString())}}for(n in this._ext){if(this.peerExtendedMapping[n]){this._ext[n].onExtendedHandshake(this.peerExtendedHandshake)}}this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this.emit("extended",e,t)}};b.prototype._onTimeout=function(){this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};b.prototype._push=function(e){if(this._finished)return;return this.push(e)};b.prototype._write=function(e,t,n){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};b.prototype._read=function(){};b.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};b.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};b.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};b.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};b.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var o=0;o<t.length;o++){a.writeUInt32BE(t[o],5+4*o)}this._push(a);if(n)this._push(n)};b.prototype._onmessagelength=function(e){var t=e.readUInt32BE(0);if(t>0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};b.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:return this.emit("unknownmessage",e)}};b.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){a("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};b.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAlive);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};function y(e,t,r,n){for(var i=0;i<e.length;i++){var a=e[i];if(a.piece!==t||a.offset!==r||a.length!==n)continue;if(i===0)e.shift();else e.splice(i,1);return a}return null}function x(e){try{return i.decode(e)}catch(t){console.warn(t)}}}).call(this,e("buffer").Buffer)},{bencode:16,bitfield:20,buffer:65,debug:21,inherits:24,speedometer:25,stream:93,xtend:26}],16:[function(e,t,r){t.exports={encode:e("./lib/encode"),decode:e("./lib/decode")}},{"./lib/decode":17,"./lib/encode":19}],17:[function(e,t,r){(function(r){var n=e("./dict");function i(e,t){i.position=0;i.encoding=t||null;i.data=!r.isBuffer(e)?new r(e):e;return i.next()}i.position=0;i.data=null;i.encoding=null;i.next=function(){switch(i.data[i.position]){case 100:return i.dictionary();break;case 108:return i.list();break;case 105:return i.integer();break;default:return i.bytes();break}};i.find=function(e){var t=i.position;var r=i.data.length;var n=i.data;while(t<r){if(n[t]===e)return t;t++}throw new Error('Invalid data: Missing delimiter "'+String.fromCharCode(e)+'" [0x'+e.toString(16)+"]")};i.dictionary=function(){i.position++;var e=new n;while(i.data[i.position]!==101){e.binarySet(i.bytes(),i.next())}i.position++;return e};i.list=function(){i.position++;var e=[];while(i.data[i.position]!==101){e.push(i.next())}i.position++;return e};i.integer=function(){var e=i.find(101);var t=i.data.toString("ascii",i.position+1,e);i.position+=e+1-i.position;return parseInt(t,10)};i.bytes=function(){var e=i.find(58);var t=parseInt(i.data.toString("ascii",i.position,e),10);var r=++e+t;i.position=r;return i.encoding?i.data.toString(i.encoding,e,r):i.data.slice(e,r)};t.exports=i}).call(this,e("buffer").Buffer)},{"./dict":18,buffer:65}],18:[function(e,t,r){var n=t.exports=function i(){Object.defineProperty(this,"_keys",{enumerable:false,value:[]})};n.prototype.binaryKeys=function a(){return this._keys.slice()};n.prototype.binarySet=function o(e,t){this._keys.push(e);this[e]=t}},{}],19:[function(e,t,r){(function(e){function r(t){var n=[];r._encode(n,t);return e.concat(n)}r._floatConversionDetected=false;r._encode=function(t,n){if(e.isBuffer(n)){t.push(new e(n.length+":"));t.push(n);return}switch(typeof n){case"string":r.bytes(t,n);break;case"number":r.number(t,n);break;case"object":n.constructor===Array?r.list(t,n):r.dict(t,n);break}};var n=new e("e"),i=new e("d"),a=new e("l");r.bytes=function(t,r){t.push(new e(e.byteLength(r)+":"+r))};r.number=function(t,n){var i=2147483648;var a=n/i<<0;var o=n%i<<0;var s=a*i+o;t.push(new e("i"+s+"e"));if(s!==n&&!r._floatConversionDetected){r._floatConversionDetected=true;console.warn('WARNING: Possible data corruption detected with value "'+n+'":','Bencoding only defines support for integers, value was converted to "'+s+'"');console.trace()}};r.dict=function(e,t){e.push(i);var a=0;var o;var s=Object.keys(t).sort();var f=s.length;for(;a<f;a++){o=s[a];r.bytes(e,o);r._encode(e,t[o])}e.push(n)};r.list=function(e,t){var i=0,o=1;var s=t.length;e.push(a);for(;i<s;i++){r._encode(e,t[i])}e.push(n)};t.exports=r}).call(this,e("buffer").Buffer)},{buffer:65}],20:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{buffer:65,dup:9}],21:[function(e,t,r){r=t.exports=e("./debug");r.log=o;r.formatArgs=a;r.save=s;r.load=f;r.useColors=i;var n;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")n=chrome.storage.local;else n=c();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function a(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function o(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){n.removeItem("debug")}else{n.debug=e}}catch(t){}}function f(){var e;try{e=n.debug}catch(t){}return e}r.enable(f());function c(){try{return window.localStorage}catch(e){}}},{"./debug":22}],22:[function(e,t,r){r=t.exports=o;r.coerce=l;r.disable=f;r.enable=s;r.enabled=c;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function o(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var o=t-(i||t);e.diff=o;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var s=Array.prototype.slice.call(arguments);s[0]=r.coerce(s[0]);if("string"!==typeof s[0]){s=["%o"].concat(s)}var f=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=s[f];t=i.call(e,a);s.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){s=r.formatArgs.apply(e,s)}var c=n.log||r.log||console.log.bind(console);c.apply(e,s)}n.enabled=true;var o=r.enabled(e)?n:t;o.namespace=e;return o}function s(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i<n;i++){if(!t[i])continue;e=t[i].replace(/\*/g,".*?");if(e[0]==="-"){r.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{r.names.push(new RegExp("^"+e+"$"))}}}function f(){r.enable("")}function c(e){var t,n;for(t=0,n=r.skips.length;t<n;t++){if(r.skips[t].test(e)){return false}}for(t=0,n=r.names.length;t<n;t++){if(r.names[t].test(e)){return true}}return false}function l(e){if(e instanceof Error)return e.stack||e.message;return e}},{ms:23}],23:[function(e,t,r){var n=1e3;var i=n*60;var a=i*60;var o=a*24;var s=o*365.25;t.exports=function(e,t){t=t||{};if("string"==typeof e)return f(e);return t.long?l(e):c(e)};function f(e){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*s;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function c(e){if(e>=o)return Math.round(e/o)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return u(e,o,"day")||u(e,a,"hour")||u(e,i,"minute")||u(e,n,"second")||e+" ms"}function u(e,t,r){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+r;return Math.ceil(e/t)+" "+r+"s"}},{}],24:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],25:[function(e,t,r){var n=1;var i=65535;var a=4;var o=function(){n=n+1&i};var s=setInterval(o,1e3/a|0);if(s.unref)s.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var o=1;var s=n-1&i;return function(e){var f=n-s&i;if(f>t)f=t;s=n;while(f--){if(o===t)o=0;r[o]=r[o===0?t-1:o-1];o++}if(e)r[o-1]+=e;var c=r[o-1];var l=r.length<t?0:r[o===t?0:o];return r.length<a?c:(c-l)*a/r.length}}},{}],26:[function(e,t,r){t.exports=n;function n(){var e={};for(var t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(r.hasOwnProperty(n)){e[n]=r[n]}}}return e}},{}],27:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{"./debug":28,dup:21}],28:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22,ms:29}],29:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],30:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:31,wrappy:32}],31:[function(e,t,r){(function(e){var r={task:void 0,next:null};var n=r;var i=false;var a=void 0;var o=false;function s(){while(r.next){r=r.next;var e=r.task;r.task=void 0;var t=r.domain;if(t){r.domain=void 0;t.enter()}try{e()}catch(n){if(o){if(t){t.exit()}setTimeout(s,0);if(t){t.enter()}throw n}else{setTimeout(function(){throw n},0)}}if(t){t.exit()}}i=false}if(typeof e!=="undefined"&&e.nextTick){o=true;a=function(){e.nextTick(s)}}else if(typeof setImmediate==="function"){if(typeof window!=="undefined"){a=setImmediate.bind(window,s)}else{a=function(){setImmediate(s)}}}else if(typeof MessageChannel!=="undefined"){var f=new MessageChannel;f.port1.onmessage=s;a=function(){f.port2.postMessage(0)}}else{a=function(){setTimeout(s,0)}}function c(t){n=n.next={task:t,domain:o&&e.domain,next:null};if(!i){i=true;a()}}t.exports=c}).call(this,e("_process"))},{_process:77}],32:[function(e,t,r){t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var n=e.apply(this,t);var i=t[t.length-1];if(typeof n==="function"&&n!==i){Object.keys(i).forEach(function(e){n[e]=i[e]})}return n}}},{}],33:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],34:[function(e,t,r){(function(r){t.exports=f;var n=e("http");var i=e("https");
-var a=e("once");var o=e("url");var s=e("zlib");function f(e,t){if(typeof e==="string")e={url:e};t=a(t);if(e.maxRedirects===0){t(new Error("too many redirects"));return}if(!e.maxRedirects)e.maxRedirects=10;if(e.url)c(e);if(!e.headers)e.headers={};var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var o=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!o)e.headers["accept-encoding"]="gzip, deflate";var l=e.protocol==="https:"?i:n;var u=l.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;c(e);r.resume();e.maxRedirects-=1;return f(e,t)}if(["gzip","deflate"].indexOf(r.headers["content-encoding"])!==-1){var n=s.createUnzip();r.pipe(n);r.on("close",function(){n.emit("close")});n.httpVersion=r.httpVersion;n.headers=r.headers;n.trailers=r.trailers;n.setTimeout=r.setTimeout.bind(r);n.method=r.method;n.url=r.url;n.statusCode=r.statusCode;n.socket=r.socket;t(null,n)}else{t(null,r)}});u.on("error",t);u.end(r);return u}t.exports.concat=function(e,t){return f(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return f(t,r)}});function c(e){var t=o.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:65,http:70,https:74,once:36,url:95,zlib:64}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){var n=e("wrappy");t.exports=n(i);i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:true})});function i(e){var t=function(){if(t.called)return t.value;t.called=true;return t.value=e.apply(this,arguments)};t.called=false;return t}},{wrappy:35}],37:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],38:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=o;n(o,i);function o(e,t){if(!(this instanceof o))return new o(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}o.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};o.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:65,defined:39,inherits:146,"readable-stream":48}],39:[function(e,t,r){t.exports=function(){for(var e=0;e<arguments.length;e++){if(arguments[e]!==undefined)return arguments[e]}}},{}],40:[function(e,t,r){(function(r){t.exports=s;var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};var i=e("core-util-is");i.inherits=e("inherits");var a=e("./_stream_readable");var o=e("./_stream_writable");i.inherits(s,a);c(n(o.prototype),function(e){if(!s.prototype[e])s.prototype[e]=o.prototype[e]});function s(e){if(!(this instanceof s))return new s(e);a.call(this,e);o.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",f)}function f(){if(this.allowHalfOpen||this._writableState.ended)return;r.nextTick(this.end.bind(this))}function c(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}}).call(this,e("_process"))},{"./_stream_readable":42,"./_stream_writable":44,_process:77,"core-util-is":45,inherits:146}],41:[function(e,t,r){t.exports=a;var n=e("./_stream_transform");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(a,n);function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}a.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":43,"core-util-is":45,inherits:146}],42:[function(e,t,r){(function(r){t.exports=u;var n=e("isarray");var i=e("buffer").Buffer;u.ReadableState=l;var a=e("events").EventEmitter;if(!a.listenerCount)a.listenerCount=function(e,t){return e.listeners(t).length};var o=e("stream");var s=e("core-util-is");s.inherits=e("inherits");var f;var c=e("util");if(c&&c.debuglog){c=c.debuglog("stream")}else{c=function(){}}s.inherits(u,o);function l(t,r){var n=e("./_stream_duplex");t=t||{};var i=t.highWaterMark;var a=t.objectMode?16:16*1024;this.highWaterMark=i||i===0?i:a;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!t.objectMode;if(r instanceof n)this.objectMode=this.objectMode||!!t.readableObjectMode;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!f)f=e("string_decoder/").StringDecoder;this.decoder=new f(t.encoding);this.encoding=t.encoding}}function u(t){var r=e("./_stream_duplex");if(!(this instanceof u))return new u(t);this._readableState=new l(t,this);this.readable=true;o.call(this)}u.prototype.push=function(e,t){var r=this._readableState;if(s.isString(e)&&!r.objectMode){t=t||r.defaultEncoding;if(t!==r.encoding){e=new i(e,t);t=""}}return d(this,r,e,t,false)};u.prototype.unshift=function(e){var t=this._readableState;return d(this,t,e,"",true)};function d(e,t,r,n,i){var a=g(t,r);if(a){e.emit("error",a)}else if(s.isNullOrUndefined(r)){t.reading=false;if(!t.ended)_(e,t)}else if(t.objectMode||r&&r.length>0){if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)w(e)}y(e,t)}}else if(!i){t.reading=false}return p(t)}function p(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}u.prototype.setEncoding=function(t){if(!f)f=e("string_decoder/").StringDecoder;this._readableState.decoder=new f(t);this._readableState.encoding=t;return this};var h=8388608;function v(e){if(e>=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function m(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||s.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}u.prototype.read=function(e){c("read",e);var t=this._readableState;var r=e;if(!s.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){c("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else w(this);return null}e=m(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var n=t.needReadable;c("need readable",n);if(t.length===0||t.length-e<t.highWaterMark){n=true;c("length less than watermark",n)}if(t.ended||t.reading){n=false;c("reading or ended",n)}if(n){c("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false}if(n&&!t.reading)e=m(r,t);var i;if(e>0)i=T(e,t);else i=null;if(s.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!s.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!s.isBuffer(t)&&!s.isString(t)&&!s.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;w(e)}function w(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){c("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){c("emit readable");e.emit("readable");A(e)}function y(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){c("maybeReadMore read 0");e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}u.prototype._read=function(e){this.emit("error",new Error("not implemented"))};u.prototype.pipe=function(e,t){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1;c("pipe count=%d opts=%j",o.pipesCount,t);var s=(!t||t.end!==false)&&e!==r.stdout&&e!==r.stderr;var f=s?u:p;if(o.endEmitted)r.nextTick(f);else i.once("end",f);e.on("unpipe",l);function l(e){c("onunpipe");if(e===i){p()}}function u(){c("onend");e.end()}var d=k(i);e.on("drain",d);function p(){c("cleanup");e.removeListener("close",m);e.removeListener("finish",g);e.removeListener("drain",d);e.removeListener("error",v);e.removeListener("unpipe",l);i.removeListener("end",u);i.removeListener("end",p);i.removeListener("data",h);if(o.awaitDrain&&(!e._writableState||e._writableState.needDrain))d()}i.on("data",h);function h(t){c("ondata");var r=e.write(t);if(false===r){c("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;i.pause()}}function v(t){c("onerror",t);_();e.removeListener("error",v);if(a.listenerCount(e,"error")===0)e.emit("error",t)}if(!e._events||!e._events.error)e.on("error",v);else if(n(e._events.error))e._events.error.unshift(v);else e._events.error=[v,e._events.error];function m(){e.removeListener("finish",g);_()}e.once("close",m);function g(){c("onfinish");e.removeListener("close",m);_()}e.once("finish",g);function _(){c("unpipe");i.unpipe(e)}e.emit("pipe",i);if(!o.flowing){c("pipe resume");i.resume()}return e};function k(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a.listenerCount(e,"data")){t.flowing=true;A(e)}}}u.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var r=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var i=C(t.pipes,e);if(i===-1)return this;t.pipes.splice(i,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this);return this};u.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t);if(e==="data"&&false!==this._readableState.flowing){this.resume()}if(e==="readable"&&this.readable){var i=this._readableState;if(!i.readableListening){i.readableListening=true;i.emittedReadable=false;i.needReadable=true;if(!i.reading){var a=this;r.nextTick(function(){c("readable nexttick read 0");a.read(0)})}else if(i.length){w(this,i)}}}return n};u.prototype.addListener=u.prototype.on;u.prototype.resume=function(){var e=this._readableState;if(!e.flowing){c("resume");e.flowing=true;if(!e.reading){c("resume read 0");this.read(0)}E(this,e)}return this};function E(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;r.nextTick(function(){S(e,t)})}}function S(e,t){t.resumeScheduled=false;e.emit("resume");A(e);if(t.flowing&&!t.reading)e.read(0)}u.prototype.pause=function(){c("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){c("pause");this._readableState.flowing=false;this.emit("pause")}return this};function A(e){var t=e._readableState;c("flow",t.flowing);if(t.flowing){do{var r=e.read()}while(null!==r&&t.flowing)}}u.prototype.wrap=function(e){var t=this._readableState;var r=false;var n=this;e.on("end",function(){c("wrapped end");if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)n.push(e)}n.push(null)});e.on("data",function(i){c("wrapped data");if(t.decoder)i=t.decoder.write(i);if(!i||!t.objectMode&&!i.length)return;var a=n.push(i);if(!a){r=true;e.pause()}});for(var i in e){if(s.isFunction(e[i])&&s.isUndefined(this[i])){this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)}}var a=["error","close","destroy","pause","resume"];L(a,function(t){e.on(t,n.emit.bind(n,t))});n._read=function(t){c("wrapped _read",t);if(r){r=false;e.resume()}};return n};u._fromList=T;function T(e,t){var r=t.buffer;var n=t.length;var a=!!t.decoder;var o=!!t.objectMode;var s;if(r.length===0)return null;if(n===0)s=null;else if(o)s=r.shift();else if(!e||e>=n){if(a)s=r.join("");else s=i.concat(r,n);r.length=0}else{if(e<r[0].length){var f=r[0];s=f.slice(0,e);r[0]=f.slice(e)}else if(e===r[0].length){s=r.shift()}else{if(a)s="";else s=new i(e);var c=0;for(var l=0,u=r.length;l<u&&c<e;l++){var f=r[0];var d=Math.min(e-c,f.length);if(a)s+=f.slice(0,d);else f.copy(s,c,0,d);if(d<f.length)r[0]=f.slice(d);else r.shift();c+=d}}}return s}function I(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function L(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}function C(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}}).call(this,e("_process"))},{"./_stream_duplex":40,_process:77,buffer:65,"core-util-is":45,events:69,inherits:146,isarray:46,stream:93,"string_decoder/":47,util:51}],43:[function(e,t,r){t.exports=s;var n=e("./_stream_duplex");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(s,n);function a(e,t){this.afterTransform=function(e,r){return o(t,e,r)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function o(e,t,r){var n=e._transformState;n.transforming=false;var a=n.writecb;if(!a)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null;n.writecb=null;if(!i.isNullOrUndefined(r))e.push(r);if(a)a(t);var o=e._readableState;o.reading=false;if(o.needReadable||o.length<o.highWaterMark){e._read(o.highWaterMark)}}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e);this._transformState=new a(e,this);var t=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("prefinish",function(){if(i.isFunction(this._flush))this._flush(function(e){f(t,e)});else f(t)})}s.prototype.push=function(e,t){this._transformState.needTransform=false;return n.prototype.push.call(this,e,t)};s.prototype._transform=function(e,t,r){throw new Error("not implemented")};s.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r;n.writechunk=e;n.writeencoding=t;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};s.prototype._read=function(e){var t=this._transformState;if(!i.isNull(t.writechunk)&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};function f(e,t){if(t)return e.emit("error",t);var r=e._writableState;var n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":40,"core-util-is":45,inherits:146}],44:[function(e,t,r){(function(r){t.exports=f;var n=e("buffer").Buffer;f.WritableState=s;var i=e("core-util-is");i.inherits=e("inherits");var a=e("stream");i.inherits(f,a);function o(e,t,r){this.chunk=e;this.encoding=t;this.callback=r}function s(t,r){var n=e("./_stream_duplex");t=t||{};var i=t.highWaterMark;var a=t.objectMode?16:16*1024;this.highWaterMark=i||i===0?i:a;this.objectMode=!!t.objectMode;if(r instanceof n)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var o=t.decodeStrings===false;this.decodeStrings=!o;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){m(r,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.pendingcb=0;this.prefinished=false;this.errorEmitted=false}function f(t){var r=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof r))return new f(t);this._writableState=new s(t,this);this.writable=true;a.call(this)}f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function c(e,t,n){var i=new Error("write after end");e.emit("error",i);r.nextTick(function(){n(i)})}function l(e,t,n,a){var o=true;if(!i.isBuffer(n)&&!i.isString(n)&&!i.isNullOrUndefined(n)&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s);r.nextTick(function(){a(s)});o=false}return o}f.prototype.write=function(e,t,r){var n=this._writableState;var a=false;if(i.isFunction(t)){r=t;t=null}if(i.isBuffer(e))t="buffer";else if(!t)t=n.defaultEncoding;if(!i.isFunction(r))r=function(){};if(n.ended)c(this,n,r);else if(l(this,n,e,r)){n.pendingcb++;a=d(this,n,e,t,r)}return a};f.prototype.cork=function(){var e=this._writableState;e.corked++};f.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.buffer.length)w(this,e)}};function u(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&i.isString(t)){t=new n(t,r)}return t}function d(e,t,r,n,a){r=u(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing||t.corked)t.buffer.push(new o(r,n,a));else p(e,t,false,s,r,n,a);return f}function p(e,t,r,n,i,a,o){t.writelen=n;t.writecb=o;t.writing=true;t.sync=true;if(r)e._writev(i,t.onwrite);else e._write(i,a,t.onwrite);t.sync=false}function h(e,t,n,i,a){if(n)r.nextTick(function(){t.pendingcb--;a(i)});else{t.pendingcb--;a(i)}e._writableState.errorEmitted=true;e.emit("error",i)}function v(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function m(e,t){var n=e._writableState;var i=n.sync;var a=n.writecb;v(n);if(t)h(e,n,i,t,a);else{var o=b(e,n);if(!o&&!n.corked&&!n.bufferProcessing&&n.buffer.length){w(e,n)}if(i){r.nextTick(function(){g(e,n,o,a)})}else{g(e,n,o,a)}}}function g(e,t,r,n){if(!r)_(e,t);t.pendingcb--;n();x(e,t)}function _(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function w(e,t){t.bufferProcessing=true;if(e._writev&&t.buffer.length>1){var r=[];for(var n=0;n<t.buffer.length;n++)r.push(t.buffer[n].callback);t.pendingcb++;p(e,t,true,t.length,t.buffer,"",function(e){for(var n=0;n<r.length;n++){t.pendingcb--;r[n](e)}});t.buffer=[]}else{for(var n=0;n<t.buffer.length;n++){var i=t.buffer[n];var a=i.chunk;var o=i.encoding;var s=i.callback;var f=t.objectMode?1:a.length;p(e,t,false,f,a,o,s);if(t.writing){n++;break}}if(n<t.buffer.length)t.buffer=t.buffer.slice(n);else t.buffer.length=0}t.bufferProcessing=false}f.prototype._write=function(e,t,r){r(new Error("not implemented"))};f.prototype._writev=null;f.prototype.end=function(e,t,r){var n=this._writableState;if(i.isFunction(e)){r=e;e=null;t=null}else if(i.isFunction(t)){r=t;t=null}if(!i.isNullOrUndefined(e))this.write(e,t);if(n.corked){n.corked=1;this.uncork()}if(!n.ending&&!n.finished)k(this,n,r)};function b(e,t){return t.ending&&t.length===0&&!t.finished&&!t.writing}function y(e,t){if(!t.prefinished){t.prefinished=true;e.emit("prefinish")}}function x(e,t){var r=b(e,t);if(r){if(t.pendingcb===0){y(e,t);t.finished=true;e.emit("finish")}else y(e,t)}return r}function k(e,t,n){t.ending=true;x(e,t);if(n){if(t.finished)r.nextTick(n);else e.once("finish",n)}t.ended=true}}).call(this,e("_process"))},{"./_stream_duplex":40,_process:77,buffer:65,"core-util-is":45,inherits:146,stream:93}],45:[function(e,t,r){(function(e){function t(e){return Array.isArray(e)}r.isArray=t;function n(e){return typeof e==="boolean"}r.isBoolean=n;function i(e){return e===null}r.isNull=i;function a(e){return e==null}r.isNullOrUndefined=a;function o(e){return typeof e==="number"}r.isNumber=o;function s(e){return typeof e==="string"}r.isString=s;function f(e){return typeof e==="symbol"}r.isSymbol=f;function c(e){return e===void 0}r.isUndefined=c;function l(e){return u(e)&&g(e)==="[object RegExp]"}r.isRegExp=l;function u(e){return typeof e==="object"&&e!==null}r.isObject=u;function d(e){return u(e)&&g(e)==="[object Date]"}r.isDate=d;function p(e){return u(e)&&(g(e)==="[object Error]"||e instanceof Error)}r.isError=p;function h(e){return typeof e==="function"}r.isFunction=h;function v(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=v;function m(t){return e.isBuffer(t)}r.isBuffer=m;function g(e){return Object.prototype.toString.call(e)}}).call(this,e("buffer").Buffer)},{buffer:65}],46:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,r){var n=e("buffer").Buffer;var i=n.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!i(e)){throw new Error("Unknown encoding: "+e)}}var o=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=c;break;default:this.write=s;return}this.charBuffer=new n(6);this.charReceived=0;this.charLength=0};o.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived<this.charLength){return""}e=e.slice(r,e.length);t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};o.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};o.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function s(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:65}],48:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":40,"./lib/_stream_passthrough.js":41,"./lib/_stream_readable.js":42,"./lib/_stream_transform.js":43,"./lib/_stream_writable.js":44,stream:93}],49:[function(e,t,r){},{}],50:[function(e,t,r){var n=e("util/");var i=Array.prototype.slice;var a=Object.prototype.hasOwnProperty;var o=t.exports=u;o.AssertionError=function _(e){this.name="AssertionError";this.actual=e.actual;this.expected=e.expected;this.operator=e.operator;if(e.message){this.message=e.message;this.generatedMessage=false}else{this.message=c(this);this.generatedMessage=true}var t=e.stackStartFunction||l;if(Error.captureStackTrace){Error.captureStackTrace(this,t)}else{var r=new Error;if(r.stack){var n=r.stack;var i=t.name;var a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}};n.inherits(o.AssertionError,Error);function s(e,t){if(n.isUndefined(t)){return""+t}if(n.isNumber(t)&&!isFinite(t)){return t.toString()}if(n.isFunction(t)||n.isRegExp(t)){return t.toString()}return t}function f(e,t){if(n.isString(e)){return e.length<t?e:e.slice(0,t)}else{return e}}function c(e){return f(JSON.stringify(e.actual,s),128)+" "+e.operator+" "+f(JSON.stringify(e.expected,s),128)}function l(e,t,r,n,i){throw new o.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}o.fail=l;function u(e,t){if(!e)l(e,true,t,"==",o.ok)}o.ok=u;o.equal=function w(e,t,r){if(e!=t)l(e,t,r,"==",o.equal)};o.notEqual=function b(e,t,r){if(e==t){l(e,t,r,"!=",o.notEqual)}};o.deepEqual=function y(e,t,r){if(!d(e,t)){l(e,t,r,"deepEqual",o.deepEqual)}};function d(e,t){if(e===t){return true}else if(n.isBuffer(e)&&n.isBuffer(t)){if(e.length!=t.length)return false;for(var r=0;r<e.length;r++){if(e[r]!==t[r])return false}return true}else if(n.isDate(e)&&n.isDate(t)){return e.getTime()===t.getTime()}else if(n.isRegExp(e)&&n.isRegExp(t)){return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase}else if(!n.isObject(e)&&!n.isObject(t)){return e==t}else{return h(e,t)}}function p(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function h(e,t){if(n.isNullOrUndefined(e)||n.isNullOrUndefined(t))return false;if(e.prototype!==t.prototype)return false;if(n.isPrimitive(e)||n.isPrimitive(t)){return e===t}var r=p(e),a=p(t);if(r&&!a||!r&&a)return false;if(r){e=i.call(e);t=i.call(t);return d(e,t)}var o=g(e),s=g(t),f,c;if(o.length!=s.length)return false;o.sort();s.sort();for(c=o.length-1;c>=0;c--){if(o[c]!=s[c])return false}for(c=o.length-1;c>=0;c--){f=o[c];if(!d(e[f],t[f]))return false}return true}o.notDeepEqual=function x(e,t,r){if(d(e,t)){l(e,t,r,"notDeepEqual",o.notDeepEqual)}};o.strictEqual=function k(e,t,r){if(e!==t){l(e,t,r,"===",o.strictEqual)}};o.notStrictEqual=function E(e,t,r){if(e===t){l(e,t,r,"!==",o.notStrictEqual)}};function v(e,t){if(!e||!t){return false}if(Object.prototype.toString.call(t)=="[object RegExp]"){return t.test(e)}else if(e instanceof t){return true}else if(t.call({},e)===true){return true}return false}function m(e,t,r,i){var a;if(n.isString(r)){i=r;r=null}try{t()}catch(o){a=o}i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:".");if(e&&!a){l(a,r,"Missing expected exception"+i)}if(!e&&v(a,r)){l(a,r,"Got unwanted exception"+i)}if(e&&a&&r&&!v(a,r)||!e&&a){throw a}}o.throws=function(e,t,r){m.apply(this,[true].concat(i.call(arguments)))};o.doesNotThrow=function(e,t){m.apply(this,[false].concat(i.call(arguments)))};o.ifError=function(e){if(e){throw e}};var g=Object.keys||function(e){var t=[];for(var r in e){if(a.call(e,r))t.push(r)}return t}},{"util/":97}],51:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],52:[function(e,t,r){"use strict";var n=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";r.assign=function(e){var t=Array.prototype.slice.call(arguments,1);while(t.length){var r=t.shift();if(!r){continue}if(typeof r!=="object"){throw new TypeError(r+"must be non-object")}for(var n in r){if(r.hasOwnProperty(n)){e[n]=r[n]}}}return e};r.shrinkBuf=function(e,t){if(e.length===t){return e}if(e.subarray){return e.subarray(0,t)}e.length=t;return e};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var a=0;a<n;a++){e[i+a]=t[r+a]}},flattenChunks:function(e){var t,r,n,i,a,o;n=0;for(t=0,r=e.length;t<r;t++){n+=e[t].length}o=new Uint8Array(n);i=0;for(t=0,r=e.length;t<r;t++){a=e[t];o.set(a,i);i+=a.length}return o}};var a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++){e[i+a]=t[r+a]}},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){if(e){r.Buf8=Uint8Array;r.Buf16=Uint16Array;r.Buf32=Int32Array;r.assign(r,i)}else{r.Buf8=Array;r.Buf16=Array;r.Buf32=Array;r.assign(r,a)}};r.setTyped(n)},{}],53:[function(e,t,r){"use strict";function n(e,t,r,n){var i=e&65535|0,a=e>>>16&65535|0,o=0;while(r!==0){o=r>2e3?2e3:r;r-=o;do{i=i+t[n++]|0;a=a+i|0}while(--o);i%=65521;a%=65521}return i|a<<16|0}t.exports=n},{}],54:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],55:[function(e,t,r){"use strict";function n(){var e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++){e=e&1?3988292384^e>>>1:e>>>1}t[r]=e}return t}var i=n();function a(e,t,r,n){var a=i,o=n+r;e=e^-1;for(var s=n;s<o;s++){e=e>>>8^a[(e^t[s])&255]}return e^-1}t.exports=a},{}],56:[function(e,t,r){"use strict";var n=e("../utils/common");var i=e("./trees");var a=e("./adler32");var o=e("./crc32");var s=e("./messages");var f=0;var c=1;var l=3;var u=4;var d=5;var p=0;var h=1;var v=-2;var m=-3;var g=-5;var _=-1;var w=1;var b=2;var y=3;var x=4;var k=0;var E=2;var S=8;var A=9;var T=15;var I=8;var L=29;var C=256;var R=C+1+L;var B=30;var j=19;var z=2*R+1;var M=15;var O=3;var U=258;var P=U+O+1;var N=32;var D=42;var H=69;var q=73;var F=91;var W=103;var Z=113;var Y=666;var G=1;var V=2;var K=3;var $=4;var X=3;function J(e,t){e.msg=s[t];return t}function Q(e){return(e<<1)-(e>4?9:0)}function ee(e){var t=e.length;while(--t>=0){e[t]=0}}function te(e){var t=e.state;var r=t.pending;if(r>e.avail_out){r=e.avail_out}if(r===0){return}n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out);e.next_out+=r;t.pending_out+=r;e.total_out+=r;e.avail_out-=r;t.pending-=r;if(t.pending===0){t.pending_out=0}}function re(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t);e.block_start=e.strstart;te(e.strm)}function ne(e,t){e.pending_buf[e.pending++]=t}function ie(e,t){e.pending_buf[e.pending++]=t>>>8&255;e.pending_buf[e.pending++]=t&255}function ae(e,t,r,i){var s=e.avail_in;if(s>i){s=i}if(s===0){return 0}e.avail_in-=s;n.arraySet(t,e.input,e.next_in,s,r);if(e.state.wrap===1){e.adler=a(e.adler,t,s,r)}else if(e.state.wrap===2){e.adler=o(e.adler,t,s,r)}e.next_in+=s;e.total_in+=s;return s}function oe(e,t){var r=e.max_chain_length;var n=e.strstart;var i;var a;var o=e.prev_length;var s=e.nice_match;var f=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0;var c=e.window;var l=e.w_mask;var u=e.prev;var d=e.strstart+U;var p=c[n+o-1];var h=c[n+o];if(e.prev_length>=e.good_match){r>>=2}if(s>e.lookahead){s=e.lookahead}do{i=t;if(c[i+o]!==h||c[i+o-1]!==p||c[i]!==c[n]||c[++i]!==c[n+1]){continue}n+=2;i++;do{}while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<d);
-a=U-(d-n);n=d-U;if(a>o){e.match_start=t;o=a;if(a>=s){break}p=c[n+o-1];h=c[n+o]}}while((t=u[t&l])>f&&--r!==0);if(o<=e.lookahead){return o}return e.lookahead}function se(e){var t=e.w_size;var r,i,a,o,s;do{o=e.window_size-e.lookahead-e.strstart;if(e.strstart>=t+(t-P)){n.arraySet(e.window,e.window,t,t,0);e.match_start-=t;e.strstart-=t;e.block_start-=t;i=e.hash_size;r=i;do{a=e.head[--r];e.head[r]=a>=t?a-t:0}while(--i);i=t;r=i;do{a=e.prev[--r];e.prev[r]=a>=t?a-t:0}while(--i);o+=t}if(e.strm.avail_in===0){break}i=ae(e.strm,e.window,e.strstart+e.lookahead,o);e.lookahead+=i;if(e.lookahead+e.insert>=O){s=e.strstart-e.insert;e.ins_h=e.window[s];e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;while(e.insert){e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+O-1])&e.hash_mask;e.prev[s&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=s;s++;e.insert--;if(e.lookahead+e.insert<O){break}}}}while(e.lookahead<P&&e.strm.avail_in!==0)}function fe(e,t){var r=65535;if(r>e.pending_buf_size-5){r=e.pending_buf_size-5}for(;;){if(e.lookahead<=1){se(e);if(e.lookahead===0&&t===f){return G}if(e.lookahead===0){break}}e.strstart+=e.lookahead;e.lookahead=0;var n=e.block_start+r;if(e.strstart===0||e.strstart>=n){e.lookahead=e.strstart-n;e.strstart=n;re(e,false);if(e.strm.avail_out===0){return G}}if(e.strstart-e.block_start>=e.w_size-P){re(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===u){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.strstart>e.block_start){re(e,false);if(e.strm.avail_out===0){return G}}return G}function ce(e,t){var r;var n;for(;;){if(e.lookahead<P){se(e);if(e.lookahead<P&&t===f){return G}if(e.lookahead===0){break}}r=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}if(r!==0&&e.strstart-r<=e.w_size-P){e.match_length=oe(e,r)}if(e.match_length>=O){n=i._tr_tally(e,e.strstart-e.match_start,e.match_length-O);e.lookahead-=e.match_length;if(e.match_length<=e.max_lazy_match&&e.lookahead>=O){e.match_length--;do{e.strstart++;e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}while(--e.match_length!==0);e.strstart++}else{e.strstart+=e.match_length;e.match_length=0;e.ins_h=e.window[e.strstart];e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}}else{n=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(n){re(e,false);if(e.strm.avail_out===0){return G}}}e.insert=e.strstart<O-1?e.strstart:O-1;if(t===u){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return G}}return V}function le(e,t){var r;var n;var a;for(;;){if(e.lookahead<P){se(e);if(e.lookahead<P&&t===f){return G}if(e.lookahead===0){break}}r=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}e.prev_length=e.match_length;e.prev_match=e.match_start;e.match_length=O-1;if(r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-P){e.match_length=oe(e,r);if(e.match_length<=5&&(e.strategy===w||e.match_length===O&&e.strstart-e.match_start>4096)){e.match_length=O-1}}if(e.prev_length>=O&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-O;n=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-O);e.lookahead-=e.prev_length-1;e.prev_length-=2;do{if(++e.strstart<=a){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}}while(--e.prev_length!==0);e.match_available=0;e.match_length=O-1;e.strstart++;if(n){re(e,false);if(e.strm.avail_out===0){return G}}}else if(e.match_available){n=i._tr_tally(e,0,e.window[e.strstart-1]);if(n){re(e,false)}e.strstart++;e.lookahead--;if(e.strm.avail_out===0){return G}}else{e.match_available=1;e.strstart++;e.lookahead--}}if(e.match_available){n=i._tr_tally(e,0,e.window[e.strstart-1]);e.match_available=0}e.insert=e.strstart<O-1?e.strstart:O-1;if(t===u){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return G}}return V}function ue(e,t){var r;var n;var a,o;var s=e.window;for(;;){if(e.lookahead<=U){se(e);if(e.lookahead<=U&&t===f){return G}if(e.lookahead===0){break}}e.match_length=0;if(e.lookahead>=O&&e.strstart>0){a=e.strstart-1;n=s[a];if(n===s[++a]&&n===s[++a]&&n===s[++a]){o=e.strstart+U;do{}while(n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&a<o);e.match_length=U-(o-a);if(e.match_length>e.lookahead){e.match_length=e.lookahead}}}if(e.match_length>=O){r=i._tr_tally(e,1,e.match_length-O);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{r=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(r){re(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===u){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return G}}return V}function de(e,t){var r;for(;;){if(e.lookahead===0){se(e);if(e.lookahead===0){if(t===f){return G}break}}e.match_length=0;r=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(r){re(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===u){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return G}}return V}var pe=function(e,t,r,n,i){this.good_length=e;this.max_lazy=t;this.nice_length=r;this.max_chain=n;this.func=i};var he;he=[new pe(0,0,0,0,fe),new pe(4,4,8,4,ce),new pe(4,5,16,8,ce),new pe(4,6,32,32,ce),new pe(4,4,16,16,le),new pe(8,16,32,32,le),new pe(8,16,128,128,le),new pe(8,32,128,256,le),new pe(32,128,258,1024,le),new pe(32,258,258,4096,le)];function ve(e){e.window_size=2*e.w_size;ee(e.head);e.max_lazy_match=he[e.level].max_lazy;e.good_match=he[e.level].good_length;e.nice_match=he[e.level].nice_length;e.max_chain_length=he[e.level].max_chain;e.strstart=0;e.block_start=0;e.lookahead=0;e.insert=0;e.match_length=e.prev_length=O-1;e.match_available=0;e.ins_h=0}function me(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=S;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new n.Buf16(z*2);this.dyn_dtree=new n.Buf16((2*B+1)*2);this.bl_tree=new n.Buf16((2*j+1)*2);ee(this.dyn_ltree);ee(this.dyn_dtree);ee(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new n.Buf16(M+1);this.heap=new n.Buf16(2*R+1);ee(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new n.Buf16(2*R+1);ee(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function ge(e){var t;if(!e||!e.state){return J(e,v)}e.total_in=e.total_out=0;e.data_type=E;t=e.state;t.pending=0;t.pending_out=0;if(t.wrap<0){t.wrap=-t.wrap}t.status=t.wrap?D:Z;e.adler=t.wrap===2?0:1;t.last_flush=f;i._tr_init(t);return p}function _e(e){var t=ge(e);if(t===p){ve(e.state)}return t}function we(e,t){if(!e||!e.state){return v}if(e.state.wrap!==2){return v}e.state.gzhead=t;return p}function be(e,t,r,i,a,o){if(!e){return v}var s=1;if(t===_){t=6}if(i<0){s=0;i=-i}else if(i>15){s=2;i-=16}if(a<1||a>A||r!==S||i<8||i>15||t<0||t>9||o<0||o>x){return J(e,v)}if(i===8){i=9}var f=new me;e.state=f;f.strm=e;f.wrap=s;f.gzhead=null;f.w_bits=i;f.w_size=1<<f.w_bits;f.w_mask=f.w_size-1;f.hash_bits=a+7;f.hash_size=1<<f.hash_bits;f.hash_mask=f.hash_size-1;f.hash_shift=~~((f.hash_bits+O-1)/O);f.window=new n.Buf8(f.w_size*2);f.head=new n.Buf16(f.hash_size);f.prev=new n.Buf16(f.w_size);f.lit_bufsize=1<<a+6;f.pending_buf_size=f.lit_bufsize*4;f.pending_buf=new n.Buf8(f.pending_buf_size);f.d_buf=f.lit_bufsize>>1;f.l_buf=(1+2)*f.lit_bufsize;f.level=t;f.strategy=o;f.method=r;return _e(e)}function ye(e,t){return be(e,t,S,T,I,k)}function xe(e,t){var r,n;var a,s;if(!e||!e.state||t>d||t<0){return e?J(e,v):v}n=e.state;if(!e.output||!e.input&&e.avail_in!==0||n.status===Y&&t!==u){return J(e,e.avail_out===0?g:v)}n.strm=e;r=n.last_flush;n.last_flush=t;if(n.status===D){if(n.wrap===2){e.adler=0;ne(n,31);ne(n,139);ne(n,8);if(!n.gzhead){ne(n,0);ne(n,0);ne(n,0);ne(n,0);ne(n,0);ne(n,n.level===9?2:n.strategy>=b||n.level<2?4:0);ne(n,X);n.status=Z}else{ne(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(!n.gzhead.extra?0:4)+(!n.gzhead.name?0:8)+(!n.gzhead.comment?0:16));ne(n,n.gzhead.time&255);ne(n,n.gzhead.time>>8&255);ne(n,n.gzhead.time>>16&255);ne(n,n.gzhead.time>>24&255);ne(n,n.level===9?2:n.strategy>=b||n.level<2?4:0);ne(n,n.gzhead.os&255);if(n.gzhead.extra&&n.gzhead.extra.length){ne(n,n.gzhead.extra.length&255);ne(n,n.gzhead.extra.length>>8&255)}if(n.gzhead.hcrc){e.adler=o(e.adler,n.pending_buf,n.pending,0)}n.gzindex=0;n.status=H}}else{var m=S+(n.w_bits-8<<4)<<8;var _=-1;if(n.strategy>=b||n.level<2){_=0}else if(n.level<6){_=1}else if(n.level===6){_=2}else{_=3}m|=_<<6;if(n.strstart!==0){m|=N}m+=31-m%31;n.status=Z;ie(n,m);if(n.strstart!==0){ie(n,e.adler>>>16);ie(n,e.adler&65535)}e.adler=1}}if(n.status===H){if(n.gzhead.extra){a=n.pending;while(n.gzindex<(n.gzhead.extra.length&65535)){if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}te(e);a=n.pending;if(n.pending===n.pending_buf_size){break}}ne(n,n.gzhead.extra[n.gzindex]&255);n.gzindex++}if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}if(n.gzindex===n.gzhead.extra.length){n.gzindex=0;n.status=q}}else{n.status=q}}if(n.status===q){if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}te(e);a=n.pending;if(n.pending===n.pending_buf_size){s=1;break}}if(n.gzindex<n.gzhead.name.length){s=n.gzhead.name.charCodeAt(n.gzindex++)&255}else{s=0}ne(n,s)}while(s!==0);if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}if(s===0){n.gzindex=0;n.status=F}}else{n.status=F}}if(n.status===F){if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}te(e);a=n.pending;if(n.pending===n.pending_buf_size){s=1;break}}if(n.gzindex<n.gzhead.comment.length){s=n.gzhead.comment.charCodeAt(n.gzindex++)&255}else{s=0}ne(n,s)}while(s!==0);if(n.gzhead.hcrc&&n.pending>a){e.adler=o(e.adler,n.pending_buf,n.pending-a,a)}if(s===0){n.status=W}}else{n.status=W}}if(n.status===W){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size){te(e)}if(n.pending+2<=n.pending_buf_size){ne(n,e.adler&255);ne(n,e.adler>>8&255);e.adler=0;n.status=Z}}else{n.status=Z}}if(n.pending!==0){te(e);if(e.avail_out===0){n.last_flush=-1;return p}}else if(e.avail_in===0&&Q(t)<=Q(r)&&t!==u){return J(e,g)}if(n.status===Y&&e.avail_in!==0){return J(e,g)}if(e.avail_in!==0||n.lookahead!==0||t!==f&&n.status!==Y){var w=n.strategy===b?de(n,t):n.strategy===y?ue(n,t):he[n.level].func(n,t);if(w===K||w===$){n.status=Y}if(w===G||w===K){if(e.avail_out===0){n.last_flush=-1}return p}if(w===V){if(t===c){i._tr_align(n)}else if(t!==d){i._tr_stored_block(n,0,0,false);if(t===l){ee(n.head);if(n.lookahead===0){n.strstart=0;n.block_start=0;n.insert=0}}}te(e);if(e.avail_out===0){n.last_flush=-1;return p}}}if(t!==u){return p}if(n.wrap<=0){return h}if(n.wrap===2){ne(n,e.adler&255);ne(n,e.adler>>8&255);ne(n,e.adler>>16&255);ne(n,e.adler>>24&255);ne(n,e.total_in&255);ne(n,e.total_in>>8&255);ne(n,e.total_in>>16&255);ne(n,e.total_in>>24&255)}else{ie(n,e.adler>>>16);ie(n,e.adler&65535)}te(e);if(n.wrap>0){n.wrap=-n.wrap}return n.pending!==0?p:h}function ke(e){var t;if(!e||!e.state){return v}t=e.state.status;if(t!==D&&t!==H&&t!==q&&t!==F&&t!==W&&t!==Z&&t!==Y){return J(e,v)}e.state=null;return t===Z?J(e,m):p}r.deflateInit=ye;r.deflateInit2=be;r.deflateReset=_e;r.deflateResetKeep=ge;r.deflateSetHeader=we;r.deflate=xe;r.deflateEnd=ke;r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":52,"./adler32":53,"./crc32":55,"./messages":60,"./trees":61}],57:[function(e,t,r){"use strict";var n=30;var i=12;t.exports=function a(e,t){var r;var a;var o;var s;var f;var c;var l;var u;var d;var p;var h;var v;var m;var g;var _;var w;var b;var y;var x;var k;var E;var S;var A;var T,I;r=e.state;a=e.next_in;T=e.input;o=a+(e.avail_in-5);s=e.next_out;I=e.output;f=s-(t-e.avail_out);c=s+(e.avail_out-257);l=r.dmax;u=r.wsize;d=r.whave;p=r.wnext;h=r.window;v=r.hold;m=r.bits;g=r.lencode;_=r.distcode;w=(1<<r.lenbits)-1;b=(1<<r.distbits)-1;e:do{if(m<15){v+=T[a++]<<m;m+=8;v+=T[a++]<<m;m+=8}y=g[v&w];t:for(;;){x=y>>>24;v>>>=x;m-=x;x=y>>>16&255;if(x===0){I[s++]=y&65535}else if(x&16){k=y&65535;x&=15;if(x){if(m<x){v+=T[a++]<<m;m+=8}k+=v&(1<<x)-1;v>>>=x;m-=x}if(m<15){v+=T[a++]<<m;m+=8;v+=T[a++]<<m;m+=8}y=_[v&b];r:for(;;){x=y>>>24;v>>>=x;m-=x;x=y>>>16&255;if(x&16){E=y&65535;x&=15;if(m<x){v+=T[a++]<<m;m+=8;if(m<x){v+=T[a++]<<m;m+=8}}E+=v&(1<<x)-1;if(E>l){e.msg="invalid distance too far back";r.mode=n;break e}v>>>=x;m-=x;x=s-f;if(E>x){x=E-x;if(x>d){if(r.sane){e.msg="invalid distance too far back";r.mode=n;break e}}S=0;A=h;if(p===0){S+=u-x;if(x<k){k-=x;do{I[s++]=h[S++]}while(--x);S=s-E;A=I}}else if(p<x){S+=u+p-x;x-=p;if(x<k){k-=x;do{I[s++]=h[S++]}while(--x);S=0;if(p<k){x=p;k-=x;do{I[s++]=h[S++]}while(--x);S=s-E;A=I}}}else{S+=p-x;if(x<k){k-=x;do{I[s++]=h[S++]}while(--x);S=s-E;A=I}}while(k>2){I[s++]=A[S++];I[s++]=A[S++];I[s++]=A[S++];k-=3}if(k){I[s++]=A[S++];if(k>1){I[s++]=A[S++]}}}else{S=s-E;do{I[s++]=I[S++];I[s++]=I[S++];I[s++]=I[S++];k-=3}while(k>2);if(k){I[s++]=I[S++];if(k>1){I[s++]=I[S++]}}}}else if((x&64)===0){y=_[(y&65535)+(v&(1<<x)-1)];continue r}else{e.msg="invalid distance code";r.mode=n;break e}break}}else if((x&64)===0){y=g[(y&65535)+(v&(1<<x)-1)];continue t}else if(x&32){r.mode=i;break e}else{e.msg="invalid literal/length code";r.mode=n;break e}break}}while(a<o&&s<c);k=m>>3;a-=k;m-=k<<3;v&=(1<<m)-1;e.next_in=a;e.next_out=s;e.avail_in=a<o?5+(o-a):5-(a-o);e.avail_out=s<c?257+(c-s):257-(s-c);r.hold=v;r.bits=m;return}},{}],58:[function(e,t,r){"use strict";var n=e("../utils/common");var i=e("./adler32");var a=e("./crc32");var o=e("./inffast");var s=e("./inftrees");var f=0;var c=1;var l=2;var u=4;var d=5;var p=6;var h=0;var v=1;var m=2;var g=-2;var _=-3;var w=-4;var b=-5;var y=8;var x=1;var k=2;var E=3;var S=4;var A=5;var T=6;var I=7;var L=8;var C=9;var R=10;var B=11;var j=12;var z=13;var M=14;var O=15;var U=16;var P=17;var N=18;var D=19;var H=20;var q=21;var F=22;var W=23;var Z=24;var Y=25;var G=26;var V=27;var K=28;var $=29;var X=30;var J=31;var Q=32;var ee=852;var te=592;var re=15;var ne=re;function ie(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function ae(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new n.Buf16(320);this.work=new n.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function oe(e){var t;if(!e||!e.state){return g}t=e.state;e.total_in=e.total_out=t.total=0;e.msg="";if(t.wrap){e.adler=t.wrap&1}t.mode=x;t.last=0;t.havedict=0;t.dmax=32768;t.head=null;t.hold=0;t.bits=0;t.lencode=t.lendyn=new n.Buf32(ee);t.distcode=t.distdyn=new n.Buf32(te);t.sane=1;t.back=-1;return h}function se(e){var t;if(!e||!e.state){return g}t=e.state;t.wsize=0;t.whave=0;t.wnext=0;return oe(e)}function fe(e,t){var r;var n;if(!e||!e.state){return g}n=e.state;if(t<0){r=0;t=-t}else{r=(t>>4)+1;if(t<48){t&=15}}if(t&&(t<8||t>15)){return g}if(n.window!==null&&n.wbits!==t){n.window=null}n.wrap=r;n.wbits=t;return se(e)}function ce(e,t){var r;var n;if(!e){return g}n=new ae;e.state=n;n.window=null;r=fe(e,t);if(r!==h){e.state=null}return r}function le(e){return ce(e,ne)}var ue=true;var de,pe;function he(e){if(ue){var t;de=new n.Buf32(512);pe=new n.Buf32(32);t=0;while(t<144){e.lens[t++]=8}while(t<256){e.lens[t++]=9}while(t<280){e.lens[t++]=7}while(t<288){e.lens[t++]=8}s(c,e.lens,0,288,de,0,e.work,{bits:9});t=0;while(t<32){e.lens[t++]=5}s(l,e.lens,0,32,pe,0,e.work,{bits:5});ue=false}e.lencode=de;e.lenbits=9;e.distcode=pe;e.distbits=5}function ve(e,t,r,i){var a;var o=e.state;if(o.window===null){o.wsize=1<<o.wbits;o.wnext=0;o.whave=0;o.window=new n.Buf8(o.wsize)}if(i>=o.wsize){n.arraySet(o.window,t,r-o.wsize,o.wsize,0);o.wnext=0;o.whave=o.wsize}else{a=o.wsize-o.wnext;if(a>i){a=i}n.arraySet(o.window,t,r-i,a,o.wnext);i-=a;if(i){n.arraySet(o.window,t,r-i,i,0);o.wnext=i;o.whave=o.wsize}else{o.wnext+=a;if(o.wnext===o.wsize){o.wnext=0}if(o.whave<o.wsize){o.whave+=a}}}return 0}function me(e,t){var r;var ee,te;var re;var ne;var ae,oe;var se;var fe;var ce,le;var ue;var de;var pe;var me=0;var ge,_e,we;var be,ye,xe;var ke;var Ee;var Se=new n.Buf8(4);var Ae;var Te;var Ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0){return g}r=e.state;if(r.mode===j){r.mode=z}ne=e.next_out;te=e.output;oe=e.avail_out;re=e.next_in;ee=e.input;ae=e.avail_in;se=r.hold;fe=r.bits;ce=ae;le=oe;Ee=h;e:for(;;){switch(r.mode){case x:if(r.wrap===0){r.mode=z;break}while(fe<16){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(r.wrap&2&&se===35615){r.check=0;Se[0]=se&255;Se[1]=se>>>8&255;r.check=a(r.check,Se,2,0);se=0;fe=0;r.mode=k;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((se&255)<<8)+(se>>8))%31){e.msg="incorrect header check";r.mode=X;break}if((se&15)!==y){e.msg="unknown compression method";r.mode=X;break}se>>>=4;fe-=4;ke=(se&15)+8;if(r.wbits===0){r.wbits=ke}else if(ke>r.wbits){e.msg="invalid window size";r.mode=X;break}r.dmax=1<<ke;e.adler=r.check=1;r.mode=se&512?R:j;se=0;fe=0;break;case k:while(fe<16){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.flags=se;if((r.flags&255)!==y){e.msg="unknown compression method";r.mode=X;break}if(r.flags&57344){e.msg="unknown header flags set";r.mode=X;break}if(r.head){r.head.text=se>>8&1}if(r.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;r.check=a(r.check,Se,2,0)}se=0;fe=0;r.mode=E;case E:while(fe<32){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(r.head){r.head.time=se}if(r.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;Se[2]=se>>>16&255;Se[3]=se>>>24&255;r.check=a(r.check,Se,4,0)}se=0;fe=0;r.mode=S;case S:while(fe<16){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(r.head){r.head.xflags=se&255;r.head.os=se>>8}if(r.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;r.check=a(r.check,Se,2,0)}se=0;fe=0;r.mode=A;case A:if(r.flags&1024){while(fe<16){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.length=se;if(r.head){r.head.extra_len=se}if(r.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;r.check=a(r.check,Se,2,0)}se=0;fe=0}else if(r.head){r.head.extra=null}r.mode=T;case T:if(r.flags&1024){ue=r.length;if(ue>ae){ue=ae}if(ue){if(r.head){ke=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}n.arraySet(r.head.extra,ee,re,ue,ke)}if(r.flags&512){r.check=a(r.check,ee,ue,re)}ae-=ue;re+=ue;r.length-=ue}if(r.length){break e}}r.length=0;r.mode=I;case I:if(r.flags&2048){if(ae===0){break e}ue=0;do{ke=ee[re+ue++];if(r.head&&ke&&r.length<65536){r.head.name+=String.fromCharCode(ke)}}while(ke&&ue<ae);if(r.flags&512){r.check=a(r.check,ee,ue,re)}ae-=ue;re+=ue;if(ke){break e}}else if(r.head){r.head.name=null}r.length=0;r.mode=L;case L:if(r.flags&4096){if(ae===0){break e}ue=0;do{ke=ee[re+ue++];if(r.head&&ke&&r.length<65536){r.head.comment+=String.fromCharCode(ke)}}while(ke&&ue<ae);if(r.flags&512){r.check=a(r.check,ee,ue,re)}ae-=ue;re+=ue;if(ke){break e}}else if(r.head){r.head.comment=null}r.mode=C;case C:if(r.flags&512){while(fe<16){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(se!==(r.check&65535)){e.msg="header crc mismatch";r.mode=X;break}se=0;fe=0}if(r.head){r.head.hcrc=r.flags>>9&1;r.head.done=true}e.adler=r.check=0;r.mode=j;break;case R:while(fe<32){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}e.adler=r.check=ie(se);se=0;fe=0;r.mode=B;case B:if(r.havedict===0){e.next_out=ne;e.avail_out=oe;e.next_in=re;e.avail_in=ae;r.hold=se;r.bits=fe;return m}e.adler=r.check=1;r.mode=j;case j:if(t===d||t===p){break e}case z:if(r.last){se>>>=fe&7;fe-=fe&7;r.mode=V;break}while(fe<3){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.last=se&1;se>>>=1;fe-=1;switch(se&3){case 0:r.mode=M;break;case 1:he(r);r.mode=H;if(t===p){se>>>=2;fe-=2;break e}break;case 2:r.mode=P;break;case 3:e.msg="invalid block type";r.mode=X}se>>>=2;fe-=2;break;case M:se>>>=fe&7;fe-=fe&7;while(fe<32){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if((se&65535)!==(se>>>16^65535)){e.msg="invalid stored block lengths";r.mode=X;break}r.length=se&65535;se=0;fe=0;r.mode=O;if(t===p){break e}case O:r.mode=U;case U:ue=r.length;if(ue){if(ue>ae){ue=ae}if(ue>oe){ue=oe}if(ue===0){break e}n.arraySet(te,ee,re,ue,ne);ae-=ue;re+=ue;oe-=ue;ne+=ue;r.length-=ue;break}r.mode=j;break;case P:while(fe<14){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.nlen=(se&31)+257;se>>>=5;fe-=5;r.ndist=(se&31)+1;se>>>=5;fe-=5;r.ncode=(se&15)+4;se>>>=4;fe-=4;if(r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols";r.mode=X;break}r.have=0;r.mode=N;case N:while(r.have<r.ncode){while(fe<3){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.lens[Ie[r.have++]]=se&7;se>>>=3;fe-=3}while(r.have<19){r.lens[Ie[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;Ae={bits:r.lenbits};Ee=s(f,r.lens,0,19,r.lencode,0,r.work,Ae);r.lenbits=Ae.bits;if(Ee){e.msg="invalid code lengths set";r.mode=X;break}r.have=0;r.mode=D;case D:while(r.have<r.nlen+r.ndist){for(;;){me=r.lencode[se&(1<<r.lenbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(we<16){se>>>=ge;fe-=ge;r.lens[r.have++]=we}else{if(we===16){Te=ge+2;while(fe<Te){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}se>>>=ge;fe-=ge;if(r.have===0){e.msg="invalid bit length repeat";r.mode=X;break}ke=r.lens[r.have-1];ue=3+(se&3);se>>>=2;fe-=2}else if(we===17){Te=ge+3;while(fe<Te){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}se>>>=ge;fe-=ge;ke=0;ue=3+(se&7);se>>>=3;fe-=3}else{Te=ge+7;while(fe<Te){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}se>>>=ge;fe-=ge;ke=0;ue=11+(se&127);se>>>=7;fe-=7}if(r.have+ue>r.nlen+r.ndist){e.msg="invalid bit length repeat";r.mode=X;break}while(ue--){r.lens[r.have++]=ke}}}if(r.mode===X){break}if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block";r.mode=X;break}r.lenbits=9;Ae={bits:r.lenbits};Ee=s(c,r.lens,0,r.nlen,r.lencode,0,r.work,Ae);r.lenbits=Ae.bits;if(Ee){e.msg="invalid literal/lengths set";r.mode=X;break}r.distbits=6;r.distcode=r.distdyn;Ae={bits:r.distbits};Ee=s(l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ae);r.distbits=Ae.bits;if(Ee){e.msg="invalid distances set";r.mode=X;break}r.mode=H;if(t===p){break e}case H:r.mode=q;case q:if(ae>=6&&oe>=258){e.next_out=ne;e.avail_out=oe;e.next_in=re;e.avail_in=ae;r.hold=se;r.bits=fe;o(e,le);ne=e.next_out;te=e.output;oe=e.avail_out;re=e.next_in;ee=e.input;ae=e.avail_in;se=r.hold;fe=r.bits;if(r.mode===j){r.back=-1}break}r.back=0;for(;;){me=r.lencode[se&(1<<r.lenbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(_e&&(_e&240)===0){be=ge;ye=_e;xe=we;for(;;){me=r.lencode[xe+((se&(1<<be+ye)-1)>>be)];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(be+ge<=fe){break}if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}se>>>=be;fe-=be;r.back+=be}se>>>=ge;fe-=ge;r.back+=ge;r.length=we;if(_e===0){r.mode=G;break}if(_e&32){r.back=-1;r.mode=j;break}if(_e&64){e.msg="invalid literal/length code";r.mode=X;break}r.extra=_e&15;r.mode=F;case F:if(r.extra){Te=r.extra;while(fe<Te){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.length+=se&(1<<r.extra)-1;se>>>=r.extra;fe-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=W;case W:for(;;){me=r.distcode[se&(1<<r.distbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if((_e&240)===0){be=ge;ye=_e;xe=we;for(;;){me=r.distcode[xe+((se&(1<<be+ye)-1)>>be)];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(be+ge<=fe){break}if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}se>>>=be;fe-=be;r.back+=be}se>>>=ge;fe-=ge;r.back+=ge;if(_e&64){e.msg="invalid distance code";r.mode=X;break}r.offset=we;r.extra=_e&15;r.mode=Z;case Z:if(r.extra){Te=r.extra;while(fe<Te){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}r.offset+=se&(1<<r.extra)-1;se>>>=r.extra;fe-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back";r.mode=X;break}r.mode=Y;case Y:if(oe===0){break e}ue=le-oe;if(r.offset>ue){ue=r.offset-ue;if(ue>r.whave){if(r.sane){e.msg="invalid distance too far back";r.mode=X;break}}if(ue>r.wnext){ue-=r.wnext;de=r.wsize-ue}else{de=r.wnext-ue}if(ue>r.length){ue=r.length}pe=r.window}else{pe=te;de=ne-r.offset;ue=r.length}if(ue>oe){ue=oe}oe-=ue;r.length-=ue;do{te[ne++]=pe[de++]}while(--ue);if(r.length===0){r.mode=q}break;case G:if(oe===0){break e}te[ne++]=r.length;oe--;r.mode=q;break;case V:if(r.wrap){while(fe<32){if(ae===0){break e}ae--;se|=ee[re++]<<fe;fe+=8}le-=oe;e.total_out+=le;r.total+=le;if(le){e.adler=r.check=r.flags?a(r.check,te,le,ne-le):i(r.check,te,le,ne-le)}le=oe;if((r.flags?se:ie(se))!==r.check){e.msg="incorrect data check";r.mode=X;break}se=0;fe=0}r.mode=K;case K:if(r.wrap&&r.flags){while(fe<32){if(ae===0){break e}ae--;se+=ee[re++]<<fe;fe+=8}if(se!==(r.total&4294967295)){e.msg="incorrect length check";r.mode=X;break}se=0;fe=0}r.mode=$;case $:Ee=v;break e;case X:Ee=_;break e;case J:return w;case Q:default:return g}}e.next_out=ne;e.avail_out=oe;e.next_in=re;e.avail_in=ae;r.hold=se;r.bits=fe;if(r.wsize||le!==e.avail_out&&r.mode<X&&(r.mode<V||t!==u)){if(ve(e,e.output,e.next_out,le-e.avail_out)){r.mode=J;return w}}ce-=e.avail_in;le-=e.avail_out;e.total_in+=ce;e.total_out+=le;r.total+=le;if(r.wrap&&le){e.adler=r.check=r.flags?a(r.check,te,le,e.next_out-le):i(r.check,te,le,e.next_out-le)}e.data_type=r.bits+(r.last?64:0)+(r.mode===j?128:0)+(r.mode===H||r.mode===O?256:0);if((ce===0&&le===0||t===u)&&Ee===h){Ee=b}return Ee}function ge(e){if(!e||!e.state){return g}var t=e.state;if(t.window){t.window=null}e.state=null;return h}function _e(e,t){var r;if(!e||!e.state){return g}r=e.state;if((r.wrap&2)===0){return g}r.head=t;t.done=false;return h}r.inflateReset=se;r.inflateReset2=fe;r.inflateResetKeep=oe;r.inflateInit=le;r.inflateInit2=ce;r.inflate=me;r.inflateEnd=ge;r.inflateGetHeader=_e;r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":52,"./adler32":53,"./crc32":55,"./inffast":57,"./inftrees":59}],59:[function(e,t,r){"use strict";var n=e("../utils/common");var i=15;var a=852;var o=592;var s=0;var f=1;var c=2;var l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var p=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function h(e,t,r,v,m,g,_,w){var b=w.bits;var y=0;var x=0;var k=0,E=0;var S=0;var A=0;var T=0;var I=0;var L=0;var C=0;var R;var B;var j;var z;var M;var O=null;var U=0;var P;var N=new n.Buf16(i+1);var D=new n.Buf16(i+1);var H=null;var q=0;var F,W,Z;for(y=0;y<=i;y++){N[y]=0}for(x=0;x<v;x++){N[t[r+x]]++}S=b;for(E=i;E>=1;E--){if(N[E]!==0){break}}if(S>E){S=E}if(E===0){m[g++]=1<<24|64<<16|0;m[g++]=1<<24|64<<16|0;w.bits=1;return 0}for(k=1;k<E;k++){if(N[k]!==0){break}}if(S<k){S=k}I=1;for(y=1;y<=i;y++){I<<=1;I-=N[y];if(I<0){return-1}}if(I>0&&(e===s||E!==1)){return-1}D[1]=0;for(y=1;y<i;y++){D[y+1]=D[y]+N[y]}for(x=0;x<v;x++){if(t[r+x]!==0){_[D[t[r+x]]++]=x}}if(e===s){O=H=_;P=19}else if(e===f){O=l;U-=257;H=u;q-=257;P=256}else{O=d;H=p;P=-1}C=0;x=0;y=k;M=g;A=S;T=0;j=-1;L=1<<S;z=L-1;if(e===f&&L>a||e===c&&L>o){return 1}var Y=0;for(;;){Y++;F=y-T;if(_[x]<P){W=0;Z=_[x]}else if(_[x]>P){W=H[q+_[x]];Z=O[U+_[x]]}else{W=32+64;Z=0}R=1<<y-T;B=1<<A;k=B;do{B-=R;m[M+(C>>T)+B]=F<<24|W<<16|Z|0}while(B!==0);R=1<<y-1;while(C&R){R>>=1}if(R!==0){C&=R-1;C+=R}else{C=0}x++;if(--N[y]===0){if(y===E){break}y=t[r+_[x]]}if(y>S&&(C&z)!==j){if(T===0){T=S}M+=k;A=y-T;I=1<<A;while(A+T<E){I-=N[A+T];if(I<=0){break}A++;I<<=1}L+=1<<A;if(e===f&&L>a||e===c&&L>o){return 1}j=C&z;m[j]=S<<24|A<<16|M-g|0}}if(C!==0){m[M+C]=y-T<<24|64<<16|0}w.bits=S;return 0}},{"../utils/common":52}],60:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],61:[function(e,t,r){"use strict";var n=e("../utils/common");var i=4;var a=0;var o=1;var s=2;function f(e){var t=e.length;while(--t>=0){e[t]=0}}var c=0;var l=1;var u=2;var d=3;var p=258;var h=29;var v=256;var m=v+1+h;var g=30;var _=19;var w=2*m+1;var b=15;var y=16;var x=7;var k=256;var E=16;var S=17;var A=18;var T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var L=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var R=512;var B=new Array((m+2)*2);f(B);var j=new Array(g*2);f(j);var z=new Array(R);f(z);var M=new Array(p-d+1);f(M);var O=new Array(h);f(O);var U=new Array(g);f(U);var P=function(e,t,r,n,i){this.static_tree=e;this.extra_bits=t;this.extra_base=r;this.elems=n;this.max_length=i;this.has_stree=e&&e.length};var N;var D;var H;var q=function(e,t){this.dyn_tree=e;this.max_code=0;this.stat_desc=t};function F(e){return e<256?z[e]:z[256+(e>>>7)]}function W(e,t){e.pending_buf[e.pending++]=t&255;e.pending_buf[e.pending++]=t>>>8&255}function Z(e,t,r){if(e.bi_valid>y-r){e.bi_buf|=t<<e.bi_valid&65535;W(e,e.bi_buf);e.bi_buf=t>>y-e.bi_valid;e.bi_valid+=r-y}else{e.bi_buf|=t<<e.bi_valid&65535;e.bi_valid+=r}}function Y(e,t,r){Z(e,r[t*2],r[t*2+1])}function G(e,t){var r=0;do{r|=e&1;e>>>=1;r<<=1}while(--t>0);return r>>>1}function V(e){if(e.bi_valid===16){W(e,e.bi_buf);e.bi_buf=0;e.bi_valid=0}else if(e.bi_valid>=8){e.pending_buf[e.pending++]=e.bi_buf&255;e.bi_buf>>=8;e.bi_valid-=8}}function K(e,t){var r=t.dyn_tree;var n=t.max_code;var i=t.stat_desc.static_tree;var a=t.stat_desc.has_stree;var o=t.stat_desc.extra_bits;var s=t.stat_desc.extra_base;var f=t.stat_desc.max_length;var c;var l,u;var d;var p;var h;var v=0;for(d=0;d<=b;d++){e.bl_count[d]=0}r[e.heap[e.heap_max]*2+1]=0;for(c=e.heap_max+1;c<w;c++){l=e.heap[c];d=r[r[l*2+1]*2+1]+1;if(d>f){d=f;v++}r[l*2+1]=d;if(l>n){continue}e.bl_count[d]++;p=0;if(l>=s){p=o[l-s]}h=r[l*2];e.opt_len+=h*(d+p);if(a){e.static_len+=h*(i[l*2+1]+p)}}if(v===0){return}do{d=f-1;while(e.bl_count[d]===0){d--}e.bl_count[d]--;e.bl_count[d+1]+=2;e.bl_count[f]--;v-=2}while(v>0);for(d=f;d!==0;d--){l=e.bl_count[d];while(l!==0){u=e.heap[--c];if(u>n){continue}if(r[u*2+1]!==d){e.opt_len+=(d-r[u*2+1])*r[u*2];r[u*2+1]=d}l--}}}function $(e,t,r){var n=new Array(b+1);var i=0;var a;var o;for(a=1;a<=b;a++){n[a]=i=i+r[a-1]<<1}for(o=0;o<=t;o++){var s=e[o*2+1];if(s===0){continue}e[o*2]=G(n[s]++,s)}}function X(){var e;var t;var r;var n;var i;var a=new Array(b+1);r=0;for(n=0;n<h-1;n++){O[n]=r;for(e=0;e<1<<T[n];e++){M[r++]=n}}M[r-1]=n;i=0;for(n=0;n<16;n++){U[n]=i;for(e=0;e<1<<I[n];e++){z[i++]=n}}i>>=7;for(;n<g;n++){U[n]=i<<7;for(e=0;e<1<<I[n]-7;e++){z[256+i++]=n}}for(t=0;t<=b;t++){a[t]=0;
-}e=0;while(e<=143){B[e*2+1]=8;e++;a[8]++}while(e<=255){B[e*2+1]=9;e++;a[9]++}while(e<=279){B[e*2+1]=7;e++;a[7]++}while(e<=287){B[e*2+1]=8;e++;a[8]++}$(B,m+1,a);for(e=0;e<g;e++){j[e*2+1]=5;j[e*2]=G(e,5)}N=new P(B,T,v+1,m,b);D=new P(j,I,0,g,b);H=new P(new Array(0),L,0,_,x)}function J(e){var t;for(t=0;t<m;t++){e.dyn_ltree[t*2]=0}for(t=0;t<g;t++){e.dyn_dtree[t*2]=0}for(t=0;t<_;t++){e.bl_tree[t*2]=0}e.dyn_ltree[k*2]=1;e.opt_len=e.static_len=0;e.last_lit=e.matches=0}function Q(e){if(e.bi_valid>8){W(e,e.bi_buf)}else if(e.bi_valid>0){e.pending_buf[e.pending++]=e.bi_buf}e.bi_buf=0;e.bi_valid=0}function ee(e,t,r,i){Q(e);if(i){W(e,r);W(e,~r)}n.arraySet(e.pending_buf,e.window,t,r,e.pending);e.pending+=r}function te(e,t,r,n){var i=t*2;var a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function re(e,t,r){var n=e.heap[r];var i=r<<1;while(i<=e.heap_len){if(i<e.heap_len&&te(t,e.heap[i+1],e.heap[i],e.depth)){i++}if(te(t,n,e.heap[i],e.depth)){break}e.heap[r]=e.heap[i];r=i;i<<=1}e.heap[r]=n}function ne(e,t,r){var n;var i;var a=0;var o;var s;if(e.last_lit!==0){do{n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1];i=e.pending_buf[e.l_buf+a];a++;if(n===0){Y(e,i,t)}else{o=M[i];Y(e,o+v+1,t);s=T[o];if(s!==0){i-=O[o];Z(e,i,s)}n--;o=F(n);Y(e,o,r);s=I[o];if(s!==0){n-=U[o];Z(e,n,s)}}}while(a<e.last_lit)}Y(e,k,t)}function ie(e,t){var r=t.dyn_tree;var n=t.stat_desc.static_tree;var i=t.stat_desc.has_stree;var a=t.stat_desc.elems;var o,s;var f=-1;var c;e.heap_len=0;e.heap_max=w;for(o=0;o<a;o++){if(r[o*2]!==0){e.heap[++e.heap_len]=f=o;e.depth[o]=0}else{r[o*2+1]=0}}while(e.heap_len<2){c=e.heap[++e.heap_len]=f<2?++f:0;r[c*2]=1;e.depth[c]=0;e.opt_len--;if(i){e.static_len-=n[c*2+1]}}t.max_code=f;for(o=e.heap_len>>1;o>=1;o--){re(e,r,o)}c=a;do{o=e.heap[1];e.heap[1]=e.heap[e.heap_len--];re(e,r,1);s=e.heap[1];e.heap[--e.heap_max]=o;e.heap[--e.heap_max]=s;r[c*2]=r[o*2]+r[s*2];e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1;r[o*2+1]=r[s*2+1]=c;e.heap[1]=c++;re(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];K(e,t);$(r,f,e.bl_count)}function ae(e,t,r){var n;var i=-1;var a;var o=t[0*2+1];var s=0;var f=7;var c=4;if(o===0){f=138;c=3}t[(r+1)*2+1]=65535;for(n=0;n<=r;n++){a=o;o=t[(n+1)*2+1];if(++s<f&&a===o){continue}else if(s<c){e.bl_tree[a*2]+=s}else if(a!==0){if(a!==i){e.bl_tree[a*2]++}e.bl_tree[E*2]++}else if(s<=10){e.bl_tree[S*2]++}else{e.bl_tree[A*2]++}s=0;i=a;if(o===0){f=138;c=3}else if(a===o){f=6;c=3}else{f=7;c=4}}}function oe(e,t,r){var n;var i=-1;var a;var o=t[0*2+1];var s=0;var f=7;var c=4;if(o===0){f=138;c=3}for(n=0;n<=r;n++){a=o;o=t[(n+1)*2+1];if(++s<f&&a===o){continue}else if(s<c){do{Y(e,a,e.bl_tree)}while(--s!==0)}else if(a!==0){if(a!==i){Y(e,a,e.bl_tree);s--}Y(e,E,e.bl_tree);Z(e,s-3,2)}else if(s<=10){Y(e,S,e.bl_tree);Z(e,s-3,3)}else{Y(e,A,e.bl_tree);Z(e,s-11,7)}s=0;i=a;if(o===0){f=138;c=3}else if(a===o){f=6;c=3}else{f=7;c=4}}}function se(e){var t;ae(e,e.dyn_ltree,e.l_desc.max_code);ae(e,e.dyn_dtree,e.d_desc.max_code);ie(e,e.bl_desc);for(t=_-1;t>=3;t--){if(e.bl_tree[C[t]*2+1]!==0){break}}e.opt_len+=3*(t+1)+5+5+4;return t}function fe(e,t,r,n){var i;Z(e,t-257,5);Z(e,r-1,5);Z(e,n-4,4);for(i=0;i<n;i++){Z(e,e.bl_tree[C[i]*2+1],3)}oe(e,e.dyn_ltree,t-1);oe(e,e.dyn_dtree,r-1)}function ce(e){var t=4093624447;var r;for(r=0;r<=31;r++,t>>>=1){if(t&1&&e.dyn_ltree[r*2]!==0){return a}}if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0){return o}for(r=32;r<v;r++){if(e.dyn_ltree[r*2]!==0){return o}}return a}var le=false;function ue(e){if(!le){X();le=true}e.l_desc=new q(e.dyn_ltree,N);e.d_desc=new q(e.dyn_dtree,D);e.bl_desc=new q(e.bl_tree,H);e.bi_buf=0;e.bi_valid=0;J(e)}function de(e,t,r,n){Z(e,(c<<1)+(n?1:0),3);ee(e,t,r,true)}function pe(e){Z(e,l<<1,3);Y(e,k,B);V(e)}function he(e,t,r,n){var a,o;var f=0;if(e.level>0){if(e.strm.data_type===s){e.strm.data_type=ce(e)}ie(e,e.l_desc);ie(e,e.d_desc);f=se(e);a=e.opt_len+3+7>>>3;o=e.static_len+3+7>>>3;if(o<=a){a=o}}else{a=o=r+5}if(r+4<=a&&t!==-1){de(e,t,r,n)}else if(e.strategy===i||o===a){Z(e,(l<<1)+(n?1:0),3);ne(e,B,j)}else{Z(e,(u<<1)+(n?1:0),3);fe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1);ne(e,e.dyn_ltree,e.dyn_dtree)}J(e);if(n){Q(e)}}function ve(e,t,r){e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255;e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255;e.pending_buf[e.l_buf+e.last_lit]=r&255;e.last_lit++;if(t===0){e.dyn_ltree[r*2]++}else{e.matches++;t--;e.dyn_ltree[(M[r]+v+1)*2]++;e.dyn_dtree[F(t)*2]++}return e.last_lit===e.lit_bufsize-1}r._tr_init=ue;r._tr_stored_block=de;r._tr_flush_block=he;r._tr_tally=ve;r._tr_align=pe},{"../utils/common":52}],62:[function(e,t,r){"use strict";function n(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}t.exports=n},{}],63:[function(e,t,r){(function(t,n){var i=e("pako/lib/zlib/messages");var a=e("pako/lib/zlib/zstream");var o=e("pako/lib/zlib/deflate.js");var s=e("pako/lib/zlib/inflate.js");var f=e("pako/lib/zlib/constants");for(var c in f){r[c]=f[c]}r.NONE=0;r.DEFLATE=1;r.INFLATE=2;r.GZIP=3;r.GUNZIP=4;r.DEFLATERAW=5;r.INFLATERAW=6;r.UNZIP=7;function l(e){if(e<r.DEFLATE||e>r.UNZIP)throw new TypeError("Bad argument");this.mode=e;this.init_done=false;this.write_in_progress=false;this.pending_close=false;this.windowBits=0;this.level=0;this.memLevel=0;this.strategy=0;this.dictionary=null}l.prototype.init=function(e,t,n,i,f){this.windowBits=e;this.level=t;this.memLevel=n;this.strategy=i;if(this.mode===r.GZIP||this.mode===r.GUNZIP)this.windowBits+=16;if(this.mode===r.UNZIP)this.windowBits+=32;if(this.mode===r.DEFLATERAW||this.mode===r.INFLATERAW)this.windowBits=-this.windowBits;this.strm=new a;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:var c=o.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:var c=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(c!==r.Z_OK){this._error(c);return}this.write_in_progress=false;this.init_done=true};l.prototype.params=function(){throw new Error("deflateParams Not supported")};l.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===r.NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")};l.prototype.write=function(e,r,n,i,a,o,s){this._writeCheck();this.write_in_progress=true;var f=this;t.nextTick(function(){f.write_in_progress=false;var t=f._write(e,r,n,i,a,o,s);f.callback(t[0],t[1]);if(f.pending_close)f.close()});return this};function u(e,t){for(var r=0;r<e.length;r++){this[t+r]=e[r]}}l.prototype.writeSync=function(e,t,r,n,i,a,o){this._writeCheck();return this._write(e,t,r,n,i,a,o)};l.prototype._write=function(e,t,i,a,f,c,l){this.write_in_progress=true;if(e!==r.Z_NO_FLUSH&&e!==r.Z_PARTIAL_FLUSH&&e!==r.Z_SYNC_FLUSH&&e!==r.Z_FULL_FLUSH&&e!==r.Z_FINISH&&e!==r.Z_BLOCK){throw new Error("Invalid flush value")}if(t==null){t=new n(0);a=0;i=0}if(f._set)f.set=f._set;else f.set=u;var d=this.strm;d.avail_in=a;d.input=t;d.next_in=i;d.avail_out=l;d.output=f;d.next_out=c;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:var p=o.deflate(d,e);break;case r.UNZIP:case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:var p=s.inflate(d,e);break;default:throw new Error("Unknown mode "+this.mode)}if(p!==r.Z_STREAM_END&&p!==r.Z_OK){this._error(p)}this.write_in_progress=false;return[d.avail_in,d.avail_out]};l.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;if(this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW){o.deflateEnd(this.strm)}else{s.inflateEnd(this.strm)}this.mode=r.NONE};l.prototype.reset=function(){switch(this.mode){case r.DEFLATE:case r.DEFLATERAW:var e=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:var e=s.inflateReset(this.strm);break}if(e!==r.Z_OK){this._error(e)}};l.prototype._error=function(e){this.onerror(i[e]+": "+this.strm.msg,e);this.write_in_progress=false;if(this.pending_close)this.close()};r.Zlib=l}).call(this,e("_process"),e("buffer").Buffer)},{_process:77,buffer:65,"pako/lib/zlib/constants":54,"pako/lib/zlib/deflate.js":56,"pako/lib/zlib/inflate.js":58,"pako/lib/zlib/messages":60,"pako/lib/zlib/zstream":62}],64:[function(e,t,r){(function(t,n){var i=e("_stream_transform");var a=e("./binding");var o=e("util");var s=e("assert").ok;a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;Object.keys(a).forEach(function(e){if(e.match(/^Z/))r[e]=a[e]});r.codes={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR};Object.keys(r.codes).forEach(function(e){r.codes[r.codes[e]]=e});r.Deflate=l;r.Inflate=u;r.Gzip=d;r.Gunzip=p;r.DeflateRaw=h;r.InflateRaw=v;r.Unzip=m;r.createDeflate=function(e){return new l(e)};r.createInflate=function(e){return new u(e)};r.createDeflateRaw=function(e){return new h(e)};r.createInflateRaw=function(e){return new v(e)};r.createGzip=function(e){return new d(e)};r.createGunzip=function(e){return new p(e)};r.createUnzip=function(e){return new m(e)};r.deflate=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new l(t),e,r)};r.deflateSync=function(e,t){return c(new l(t),e)};r.gzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new d(t),e,r)};r.gzipSync=function(e,t){return c(new d(t),e)};r.deflateRaw=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new h(t),e,r)};r.deflateRawSync=function(e,t){return c(new h(t),e)};r.unzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new m(t),e,r)};r.unzipSync=function(e,t){return c(new m(t),e)};r.inflate=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new u(t),e,r)};r.inflateSync=function(e,t){return c(new u(t),e)};r.gunzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new p(t),e,r)};r.gunzipSync=function(e,t){return c(new p(t),e)};r.inflateRaw=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new v(t),e,r)};r.inflateRawSync=function(e,t){return c(new v(t),e)};function f(e,t,r){var i=[];var a=0;e.on("error",s);e.on("end",f);e.end(t);o();function o(){var t;while(null!==(t=e.read())){i.push(t);a+=t.length}e.once("readable",o)}function s(t){e.removeListener("end",f);e.removeListener("readable",o);r(t)}function f(){var t=n.concat(i,a);i=[];r(null,t);e.close()}}function c(e,t){if(typeof t==="string")t=new n(t);if(!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=a.Z_FINISH;return e._processChunk(t,r)}function l(e){if(!(this instanceof l))return new l(e);g.call(this,e,a.DEFLATE)}function u(e){if(!(this instanceof u))return new u(e);g.call(this,e,a.INFLATE)}function d(e){if(!(this instanceof d))return new d(e);g.call(this,e,a.GZIP)}function p(e){if(!(this instanceof p))return new p(e);g.call(this,e,a.GUNZIP)}function h(e){if(!(this instanceof h))return new h(e);g.call(this,e,a.DEFLATERAW)}function v(e){if(!(this instanceof v))return new v(e);g.call(this,e,a.INFLATERAW)}function m(e){if(!(this instanceof m))return new m(e);g.call(this,e,a.UNZIP)}function g(e,t){this._opts=e=e||{};this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK;i.call(this,e);if(e.flush){if(e.flush!==a.Z_NO_FLUSH&&e.flush!==a.Z_PARTIAL_FLUSH&&e.flush!==a.Z_SYNC_FLUSH&&e.flush!==a.Z_FULL_FLUSH&&e.flush!==a.Z_FINISH&&e.flush!==a.Z_BLOCK){throw new Error("Invalid flush flag: "+e.flush)}}this._flushFlag=e.flush||a.Z_NO_FLUSH;if(e.chunkSize){if(e.chunkSize<r.Z_MIN_CHUNK||e.chunkSize>r.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+e.chunkSize)}}if(e.windowBits){if(e.windowBits<r.Z_MIN_WINDOWBITS||e.windowBits>r.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+e.windowBits)}}if(e.level){if(e.level<r.Z_MIN_LEVEL||e.level>r.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+e.level)}}if(e.memLevel){if(e.memLevel<r.Z_MIN_MEMLEVEL||e.memLevel>r.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+e.memLevel)}}if(e.strategy){if(e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+e.strategy)}}if(e.dictionary){if(!n.isBuffer(e.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._binding=new a.Zlib(t);var o=this;this._hadError=false;this._binding.onerror=function(e,t){o._binding=null;o._hadError=true;var n=new Error(e);n.errno=t;n.code=r.codes[t];o.emit("error",n)};var s=r.Z_DEFAULT_COMPRESSION;if(typeof e.level==="number")s=e.level;var f=r.Z_DEFAULT_STRATEGY;if(typeof e.strategy==="number")f=e.strategy;this._binding.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,s,e.memLevel||r.Z_DEFAULT_MEMLEVEL,f,e.dictionary);this._buffer=new n(this._chunkSize);this._offset=0;this._closed=false;this._level=s;this._strategy=f;this.once("end",this.close)}o.inherits(g,i);g.prototype.params=function(e,n,i){if(e<r.Z_MIN_LEVEL||e>r.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+e)}if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+n)}if(this._level!==e||this._strategy!==n){var o=this;this.flush(a.Z_SYNC_FLUSH,function(){o._binding.params(e,n);if(!o._hadError){o._level=e;o._strategy=n;if(i)i()}})}else{t.nextTick(i)}};g.prototype.reset=function(){return this._binding.reset()};g.prototype._flush=function(e){this._transform(new n(0),"",e)};g.prototype.flush=function(e,r){var i=this._writableState;if(typeof e==="function"||e===void 0&&!r){r=e;e=a.Z_FULL_FLUSH}if(i.ended){if(r)t.nextTick(r)}else if(i.ending){if(r)this.once("end",r)}else if(i.needDrain){var o=this;this.once("drain",function(){o.flush(r)})}else{this._flushFlag=e;this.write(new n(0),"",r)}};g.prototype.close=function(e){if(e)t.nextTick(e);if(this._closed)return;this._closed=true;this._binding.close();var r=this;t.nextTick(function(){r.emit("close")})};g.prototype._transform=function(e,t,r){var i;var o=this._writableState;var s=o.ending||o.ended;var f=s&&(!e||o.length===e.length);if(!e===null&&!n.isBuffer(e))return r(new Error("invalid input"));if(f)i=a.Z_FINISH;else{i=this._flushFlag;if(e.length>=o.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}var c=this;this._processChunk(e,i,r)};g.prototype._processChunk=function(e,t,r){var i=e&&e.length;var a=this._chunkSize-this._offset;var o=0;var f=this;var c=typeof r==="function";if(!c){var l=[];var u=0;var d;this.on("error",function(e){d=e});do{var p=this._binding.writeSync(t,e,o,i,this._buffer,this._offset,a)}while(!this._hadError&&m(p[0],p[1]));if(this._hadError){throw d}var h=n.concat(l,u);this.close();return h}var v=this._binding.write(t,e,o,i,this._buffer,this._offset,a);v.buffer=e;v.callback=m;function m(d,p){if(f._hadError)return;var h=a-p;s(h>=0,"have should not go down");if(h>0){var v=f._buffer.slice(f._offset,f._offset+h);f._offset+=h;if(c){f.push(v)}else{l.push(v);u+=v.length}}if(p===0||f._offset>=f._chunkSize){a=f._chunkSize;f._offset=0;f._buffer=new n(f._chunkSize)}if(p===0){o+=i-d;i=d;if(!c)return true;var g=f._binding.write(t,e,o,i,f._buffer,f._offset,f._chunkSize);g.callback=m;g.buffer=e;return}if(!c)return false;r()}};o.inherits(l,g);o.inherits(u,g);o.inherits(d,g);o.inherits(p,g);o.inherits(h,g);o.inherits(v,g);o.inherits(m,g)}).call(this,e("_process"),e("buffer").Buffer)},{"./binding":63,_process:77,_stream_transform:91,assert:50,buffer:65,util:97}],65:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=w;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var o=1073741823;var s={};f.TYPED_ARRAY_SUPPORT=function(){try{var e=new ArrayBuffer(0);var t=new Uint8Array(e);t.foo=function(){return 42};return t.foo()===42&&typeof t.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(r){return false}}();function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return c(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return u(this,e)}function c(e,t){e=g(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;r++){e[r]=0}}return e}function l(e,t,r){if(typeof r!=="string"||r==="")r="utf8";var n=b(t,r)|0;e=g(e,n);e.write(t,r);return e}function u(e,t){if(f.isBuffer(t))return d(e,t);if(a(t))return p(e,t);if(t==null){throw new TypeError("must start with number, buffer, array or string")}if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer){return h(e,t)}if(t.length)return v(e,t);return m(e,t)}function d(e,t){var r=_(t.length)|0;e=g(e,r);t.copy(e,0,0,r);return e}function p(e,t){var r=_(t.length)|0;e=g(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function h(e,t){var r=_(t.length)|0;e=g(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function v(e,t){var r=_(t.length)|0;e=g(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function m(e,t){var r;var n=0;if(t.type==="Buffer"&&a(t.data)){r=t.data;n=_(r.length)|0}e=g(e,n);for(var i=0;i<n;i+=1){e[i]=r[i]&255}return e}function g(e,t){if(f.TYPED_ARRAY_SUPPORT){e=f._augment(new Uint8Array(t))}else{e.length=t;e._isBuffer=true}var r=t!==0&&t<=f.poolSize>>>1;if(r)e.parent=s;return e}function _(e){if(e>=o){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o.toString(16)+" bytes")}return e|0}function w(e,t){if(!(this instanceof w))return new w(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function X(e){return!!(e!=null&&e._isBuffer)};f.compare=function J(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i<a){if(e[i]!==t[i])break;++i}if(i!==a){r=e[i];n=t[i]}if(r<n)return-1;if(n<r)return 1;return 0};f.isEncoding=function Q(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};f.concat=function ee(e,t){if(!a(e))throw new TypeError("list argument must be an Array of Buffers.");if(e.length===0){return new f(0)}else if(e.length===1){return e[0]}var r;if(t===undefined){t=0;for(r=0;r<e.length;r++){t+=e[r].length}}var n=new f(t);var i=0;for(r=0;r<e.length;r++){var o=e[r];o.copy(n,i);i+=o.length}return n};function b(e,t){if(typeof e!=="string")e=String(e);if(e.length===0)return 0;switch(t||"utf8"){case"ascii":case"binary":case"raw":return e.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e.length*2;case"hex":return e.length>>>1;case"utf8":case"utf-8":return Z(e).length;case"base64":return V(e).length;default:return e.length}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;f.prototype.toString=function te(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return C(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}};f.prototype.equals=function re(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ne(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return"<Buffer "+e+">"};f.prototype.compare=function ie(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function ae(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+i<e.length;i++){if(e[r+i]===t[n===-1?0:i-n]){if(n===-1)n=i;if(i-n+1===t.length)return r+n}else{n=-1}}return-1}throw new TypeError("val must be string, number or Buffer")};f.prototype.get=function oe(e){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(e)};f.prototype.set=function se(e,t){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(e,t)};function y(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var o=0;o<n;o++){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[r+o]=s}return o}function x(e,t,r,n){return K(Z(t,e.length-r),e,r,n)}function k(e,t,r,n){return K(Y(t),e,r,n)}function E(e,t,r,n){return k(e,t,r,n)}function S(e,t,r,n){return K(V(t),e,r,n)}function A(e,t,r,n){return K(G(t,e.length-r),e,r,n)}f.prototype.write=function fe(e,t,r,n){if(t===undefined){n="utf8";r=this.length;t=0}else if(r===undefined&&typeof t==="string"){n=t;r=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(r)){r=r|0;if(n===undefined)n="utf8"}else{n=r;r=undefined}}else{var i=n;n=t;t=r|0;r=i}var a=this.length-t;if(r===undefined||r>a)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return k(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};f.prototype.toJSON=function ce(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;a<r;a++){if(e[a]<=127){n+=$(i)+String.fromCharCode(e[a]);i=""}else{i+="%"+e[a].toString(16)}}return n+$(i)}function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;i++){n+=String.fromCharCode(e[i]&127)}return n}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;i++){n+=String.fromCharCode(e[i])}return n}function R(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var a=t;a<r;a++){i+=W(e[a])}return i}function B(e,t,r){var n=e.slice(t,r);var i="";for(var a=0;a<n.length;a+=2){i+=String.fromCharCode(n[a]+n[a+1]*256)}return i}f.prototype.slice=function le(e,t){var r=this.length;e=~~e;t=t===undefined?r:~~t;if(e<0){e+=r;if(e<0)e=0}else if(e>r){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(t<e)t=e;var n;if(f.TYPED_ARRAY_SUPPORT){n=f._augment(this.subarray(e,t))}else{var i=t-e;n=new f(i,undefined);for(var a=0;a<i;a++){n[a]=this[a+e]}}if(n.length)n.parent=this.parent||this;return n};function j(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function ue(e,t,r){e=e|0;t=t|0;if(!r)j(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){n+=this[e+a]*i}return n};f.prototype.readUIntBE=function de(e,t,r){e=e|0;t=t|0;if(!r){j(e,t,this.length)}var n=this[e+--t];var i=1;while(t>0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function pe(e,t){if(!t)j(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function he(e,t){if(!t)j(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)j(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function me(e,t){if(!t)j(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ge(e,t){if(!t)j(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)j(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){n+=this[e+a]*i}i*=128;if(n>=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function we(e,t,r){e=e|0;t=t|0;if(!r)j(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function be(e,t){if(!t)j(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function ye(e,t){if(!t)j(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function xe(e,t){if(!t)j(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function ke(e,t){if(!t)j(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)j(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Se(e,t){if(!t)j(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ae(e,t){if(!t)j(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)j(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)j(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||t<a)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a<r&&(i*=256)){this[t+a]=e/i&255}return t+r};f.prototype.writeUIntBE=function Ce(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=r-1;var a=1;this[t+i]=e&255;while(--i>=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function M(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i<a;i++){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Be(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{M(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{M(this,e,t,false)}return t+2};function O(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i<a;i++){e[r+i]=t>>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{O(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{O(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Oe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var o=1;var s=e<0?1:0;this[t]=e&255;while(++a<r&&(o*=256)){this[t+a]=(e/o>>0)-s&255}return t+r};f.prototype.writeIntBE=function Ue(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var o=1;var s=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(o*=256)){this[t+a]=(e/o>>0)-s&255}return t+r};f.prototype.writeInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{M(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{M(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{O(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{O(this,e,t,false)}return t+4};function U(e,t,r,n,i,a){if(t>i||t<a)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function P(e,t,r,n,a){if(!a){U(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Fe(e,t,r){return P(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return P(this,e,t,false,r)};function N(e,t,r,n,a){if(!a){U(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ze(e,t,r){return N(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return N(this,e,t,false,r)};f.prototype.copy=function Ge(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n<r)n=r;if(n===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t<n-r){n=e.length-t+r}var i=n-r;if(i<1e3||!f.TYPED_ARRAY_SUPPORT){for(var a=0;a<i;a++){e[a+t]=this[a+r]}}else{e._set(this.subarray(r,r+i),t)}return i};f.prototype.fill=function Ve(e,t,r){if(!e)e=0;if(!t)t=0;if(!r)r=this.length;if(r<t)throw new RangeError("end < start");if(r===t)return;if(this.length===0)return;if(t<0||t>=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n<r;n++){this[n]=e}}else{var i=Z(e.toString());var a=i.length;for(n=t;n<r;n++){this[n]=i[n%a]}}return this};f.prototype.toArrayBuffer=function Ke(){if(typeof Uint8Array!=="undefined"){if(f.TYPED_ARRAY_SUPPORT){return new f(this).buffer}else{var e=new Uint8Array(this.length);for(var t=0,r=e.length;t<r;t+=1){e[t]=this[t]}return e.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var D=f.prototype;f._augment=function $e(e){e.constructor=f;e._isBuffer=true;e._set=e.set;e.get=D.get;e.set=D.set;e.write=D.write;e.toString=D.toString;e.toLocaleString=D.toString;e.toJSON=D.toJSON;e.equals=D.equals;e.compare=D.compare;e.indexOf=D.indexOf;e.copy=D.copy;e.slice=D.slice;e.readUIntLE=D.readUIntLE;e.readUIntBE=D.readUIntBE;e.readUInt8=D.readUInt8;e.readUInt16LE=D.readUInt16LE;e.readUInt16BE=D.readUInt16BE;e.readUInt32LE=D.readUInt32LE;e.readUInt32BE=D.readUInt32BE;e.readIntLE=D.readIntLE;e.readIntBE=D.readIntBE;e.readInt8=D.readInt8;e.readInt16LE=D.readInt16LE;e.readInt16BE=D.readInt16BE;e.readInt32LE=D.readInt32LE;e.readInt32BE=D.readInt32BE;
-e.readFloatLE=D.readFloatLE;e.readFloatBE=D.readFloatBE;e.readDoubleLE=D.readDoubleLE;e.readDoubleBE=D.readDoubleBE;e.writeUInt8=D.writeUInt8;e.writeUIntLE=D.writeUIntLE;e.writeUIntBE=D.writeUIntBE;e.writeUInt16LE=D.writeUInt16LE;e.writeUInt16BE=D.writeUInt16BE;e.writeUInt32LE=D.writeUInt32LE;e.writeUInt32BE=D.writeUInt32BE;e.writeIntLE=D.writeIntLE;e.writeIntBE=D.writeIntBE;e.writeInt8=D.writeInt8;e.writeInt16LE=D.writeInt16LE;e.writeInt16BE=D.writeInt16BE;e.writeInt32LE=D.writeInt32LE;e.writeInt32BE=D.writeInt32BE;e.writeFloatLE=D.writeFloatLE;e.writeFloatBE=D.writeFloatBE;e.writeDoubleLE=D.writeDoubleLE;e.writeDoubleBE=D.writeDoubleBE;e.fill=D.fill;e.inspect=D.inspect;e.toArrayBuffer=D.toArrayBuffer;return e};var H=/[^+\/0-9A-z\-]/g;function q(e){e=F(e).replace(H,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function F(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function W(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function Z(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var a=[];var o=0;for(;o<n;o++){r=e.charCodeAt(o);if(r>55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(o+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r<e.length;r++){t.push(e.charCodeAt(r)&255)}return t}function G(e,t){var r,n,i;var a=[];for(var o=0;o<e.length;o++){if((t-=2)<0)break;r=e.charCodeAt(o);n=r>>8;i=r%256;a.push(i);a.push(n)}return a}function V(e){return n.toByteArray(q(e))}function K(e,t,r,n){for(var i=0;i<n;i++){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function $(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":66,ieee754:67,"is-array":68}],66:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var o="a".charCodeAt(0);var s="A".charCodeAt(0);var f="-".charCodeAt(0);var c="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===c)return 63;if(t<a)return-1;if(t<a+10)return t-a+26+26;if(t<s+26)return t-s;if(t<o+26)return t-o+26}function u(e){var r,n,i,a,o,s;if(e.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;o="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;s=new t(e.length*3/4-o);i=o>0?e.length-4:e.length;var c=0;function u(e){s[c++]=e}for(r=0,n=0;r<i;r+=4,n+=3){a=l(e.charAt(r))<<18|l(e.charAt(r+1))<<12|l(e.charAt(r+2))<<6|l(e.charAt(r+3));u((a&16711680)>>16);u((a&65280)>>8);u(a&255)}if(o===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;u(a&255)}else if(o===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;u(a>>8&255);u(a&255)}return s}function d(e){var t,r=e.length%3,i="",a,o;function s(e){return n.charAt(e)}function f(e){return s(e>>18&63)+s(e>>12&63)+s(e>>6&63)+s(e&63)}for(t=0,o=e.length-r;t<o;t+=3){a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];i+=f(a)}switch(r){case 1:a=e[e.length-1];i+=s(a>>2);i+=s(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=s(a>>10);i+=s(a>>4&63);i+=s(a<<2&63);i+="=";break}return i}e.toByteArray=u;e.fromByteArray=d})(typeof r==="undefined"?this.base64js={}:r)},{}],67:[function(e,t,r){r.read=function(e,t,r,n,i){var a,o;var s=i*8-n-1;var f=(1<<s)-1;var c=f>>1;var l=-7;var u=r?i-1:0;var d=r?-1:1;var p=e[t+u];u+=d;a=p&(1<<-l)-1;p>>=-l;l+=s;for(;l>0;a=a*256+e[t+u],u+=d,l-=8){}o=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;o=o*256+e[t+u],u+=d,l-=8){}if(a===0){a=1-c}else if(a===f){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,n);a=a-c}return(p?-1:1)*o*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var o,s,f;var c=a*8-i-1;var l=(1<<c)-1;var u=l>>1;var d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:a-1;var h=n?1:-1;var v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;o=l}else{o=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-o))<1){o--;f*=2}if(o+u>=1){t+=d/f}else{t+=d*Math.pow(2,1-u)}if(t*f>=2){o++;f/=2}if(o+u>=l){s=0;o=l}else if(o+u>=1){s=(t*f-1)*Math.pow(2,i);o=o+u}else{s=t*Math.pow(2,u-1)*Math.pow(2,i);o=0}}for(;i>=8;e[r+p]=s&255,p+=h,s/=256,i-=8){}o=o<<i|s;c+=i;for(;c>0;e[r+p]=o&255,p+=h,o/=256,c-=8){}e[r+p-h]|=v*128}},{}],68:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],69:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,c;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||o(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(s(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f<n;f++)a[f-1]=arguments[f];r.apply(this,a)}}else if(o(r)){n=arguments.length;a=new Array(n-1);for(f=1;f<n;f++)a[f-1]=arguments[f];c=r.slice();n=c.length;for(f=0;f<n;f++)c[f].apply(this,a)}return true};n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",e,i(t.listener)?t.listener:t);if(!this._events[e])this._events[e]=t;else if(o(this._events[e]))this._events[e].push(t);else this._events[e]=[this._events[e],t];if(o(this._events[e])&&!this._events[e].warned){var r;if(!s(this._maxListeners)){r=this._maxListeners}else{r=n.defaultMaxListeners}if(r&&r>0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(o(r)){for(s=a;s-->0;){if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function o(e){return typeof e==="object"&&e!==null}function s(e){return e===void 0}},{}],70:[function(e,t,r){var n=t.exports;var i=e("events").EventEmitter;var a=e("./lib/request");var o=e("url");n.request=function(e,t){if(typeof e==="string"){e=o.parse(e)}if(!e)e={};if(!e.host&&!e.port){e.port=parseInt(window.location.port,10)}if(!e.host&&e.hostname){e.host=e.hostname}if(!e.protocol){if(e.scheme){e.protocol=e.scheme+":"}else{e.protocol=window.location.protocol}}if(!e.host){e.host=window.location.hostname||window.location.host}if(/:/.test(e.host)){if(!e.port){e.port=e.host.split(":")[1]}e.host=e.host.split(":")[0]}if(!e.port)e.port=e.protocol=="https:"?443:80;var r=new a(new s,e);if(t)r.on("response",t);return r};n.get=function(e,t){e.method="GET";var r=n.request(e,t);r.end();return r};n.Agent=function(){};n.Agent.defaultMaxSockets=4;var s=function(){if(typeof window==="undefined"){throw new Error("no window object present")}else if(window.XMLHttpRequest){return window.XMLHttpRequest}else if(window.ActiveXObject){var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];for(var t=0;t<e.length;t++){try{var r=new window.ActiveXObject(e[t]);return function(){if(r){var n=r;r=null;return n}else{return new window.ActiveXObject(e[t])}}}catch(n){}}throw new Error("ajax not supported in this browser")}else{throw new Error("ajax not supported in this browser")}}();n.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{"./lib/request":71,events:69,url:95}],71:[function(e,t,r){var n=e("stream");var i=e("./response");var a=e("Base64");var o=e("inherits");var s=t.exports=function(e,t){var r=this;r.writable=true;r.xhr=e;r.body=[];r.uri=(t.protocol||"http:")+"//"+t.host+(t.port?":"+t.port:"")+(t.path||"/");if(typeof t.withCredentials==="undefined"){t.withCredentials=true}try{e.withCredentials=t.withCredentials}catch(n){}if(t.responseType)try{e.responseType=t.responseType}catch(n){}e.open(t.method||"GET",r.uri,true);e.onerror=function(e){r.emit("error",new Error("Network error"))};r._headers={};if(t.headers){var o=f(t.headers);for(var s=0;s<o.length;s++){var c=o[s];if(!r.isSafeRequestHeader(c))continue;var l=t.headers[c];r.setHeader(c,l)}}if(t.auth){this.setHeader("Authorization","Basic "+a.btoa(t.auth))}var u=new i;u.on("close",function(){r.emit("close")});u.on("ready",function(){r.emit("response",u)});u.on("error",function(e){r.emit("error",e)});e.onreadystatechange=function(){if(e.__aborted)return;u.handle(e)}};o(s,n);s.prototype.setHeader=function(e,t){this._headers[e.toLowerCase()]=t};s.prototype.getHeader=function(e){return this._headers[e.toLowerCase()]};s.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]};s.prototype.write=function(e){this.body.push(e)};s.prototype.destroy=function(e){this.xhr.__aborted=true;this.xhr.abort();this.emit("close")};s.prototype.end=function(e){if(e!==undefined)this.body.push(e);var t=f(this._headers);for(var r=0;r<t.length;r++){var n=t[r];var i=this._headers[n];if(c(i)){for(var a=0;a<i.length;a++){this.xhr.setRequestHeader(n,i[a])}}else this.xhr.setRequestHeader(n,i)}if(this.body.length===0){this.xhr.send("")}else if(typeof this.body[0]==="string"){this.xhr.send(this.body.join(""))}else if(c(this.body[0])){var o=[];for(var r=0;r<this.body.length;r++){o.push.apply(o,this.body[r])}this.xhr.send(o)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){var s=0;for(var r=0;r<this.body.length;r++){s+=this.body[r].length}var o=new this.body[0].constructor(s);var l=0;for(var r=0;r<this.body.length;r++){var d=this.body[r];for(var a=0;a<d.length;a++){o[l++]=d[a]}}this.xhr.send(o)}else if(u(this.body[0])){this.xhr.send(this.body[0])}else{var o="";for(var r=0;r<this.body.length;r++){o+=this.body[r].toString()}this.xhr.send(o)}};s.unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];s.prototype.isSafeRequestHeader=function(e){if(!e)return false;return l(s.unsafeHeaders,e.toLowerCase())===-1};var f=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};var c=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var l=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++){if(e[r]===t)return r}return-1};var u=function(e){if(typeof Blob!=="undefined"&&e instanceof Blob)return true;if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer)return true;if(typeof FormData!=="undefined"&&e instanceof FormData)return true}},{"./response":72,Base64:73,inherits:146,stream:93}],72:[function(e,t,r){var n=e("stream");var i=e("util");var a=t.exports=function(e){this.offset=0;this.readable=true};i.inherits(a,n);var o={streaming:true,status2:true};function s(e){var t=e.getAllResponseHeaders().split(/\r?\n/);var r={};for(var n=0;n<t.length;n++){var i=t[n];if(i==="")continue;var a=i.match(/^([^:]+):\s*(.*)/);if(a){var o=a[1].toLowerCase(),s=a[2];if(r[o]!==undefined){if(f(r[o])){r[o].push(s)}else{r[o]=[r[o],s]}}else{r[o]=s}}else{r[i]=true}}return r}a.prototype.getResponse=function(e){var t=String(e.responseType).toLowerCase();if(t==="blob")return e.responseBlob||e.response;if(t==="arraybuffer")return e.response;return e.responseText};a.prototype.getHeader=function(e){return this.headers[e.toLowerCase()]};a.prototype.handle=function(e){if(e.readyState===2&&o.status2){try{this.statusCode=e.status;this.headers=s(e)}catch(t){o.status2=false}if(o.status2){this.emit("ready")}}else if(o.streaming&&e.readyState===3){try{if(!this.statusCode){this.statusCode=e.status;this.headers=s(e);this.emit("ready")}}catch(t){}try{this._emitData(e)}catch(t){o.streaming=false}}else if(e.readyState===4){if(!this.statusCode){this.statusCode=e.status;this.emit("ready")}this._emitData(e);if(e.error){this.emit("error",this.getResponse(e))}else this.emit("end");this.emit("close")}};a.prototype._emitData=function(e){var t=this.getResponse(e);if(t.toString().match(/ArrayBuffer/)){this.emit("data",new Uint8Array(t,this.offset));this.offset=t.byteLength;return}if(t.length>this.offset){this.emit("data",t.slice(this.offset));this.offset=t.length}};var f=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{stream:93,util:97}],73:[function(e,t,r){(function(){var e=typeof r!="undefined"?r:this;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function n(e){this.message=e}n.prototype=new Error;n.prototype.name="InvalidCharacterError";e.btoa||(e.btoa=function(e){for(var r,i,a=0,o=t,s="";e.charAt(a|0)||(o="=",a%1);s+=o.charAt(63&r>>8-a%1*8)){i=e.charCodeAt(a+=3/4);if(i>255){throw new n("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.")}r=r<<8|i}return s});e.atob||(e.atob=function(e){e=e.replace(/=+$/,"");if(e.length%4==1){throw new n("'atob' failed: The string to be decoded is not correctly encoded.")}for(var r=0,i,a,o=0,s="";a=e.charAt(o++);~a&&(i=r%4?i*64+a:a,r++%4)?s+=String.fromCharCode(255&i>>(-2*r&6)):0){a=t.indexOf(a)}return s})})()},{}],74:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:70}],75:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],76:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var o=i>=0?arguments[i]:e.cwd();if(typeof o!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!o){continue}r=o+"/"+r;n=o.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=o(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var r=e.length-1;for(;r>=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var o=Math.min(i.length,a.length);var s=o;for(var f=0;f<o;f++){if(i[f]!==a[f]){s=f;break}}var c=[];for(var f=s;f<i.length;f++){c.push("..")}c=c.concat(a.slice(s));return c.join("/")};r.sep="/";r.delimiter=":";r.dirname=function(e){var t=i(e),r=t[0],n=t[1];if(!r&&!n){return"."}if(n){n=n.substr(0,n.length-1)}return r+n};r.basename=function(e,t){var r=i(e)[2];if(t&&r.substr(-1*t.length)===t){r=r.substr(0,r.length-t.length)}return r};r.extname=function(e){return i(e)[3]};function a(e,t){if(e.filter)return e.filter(t);var r=[];for(var n=0;n<e.length;n++){if(t(e[n],n,e))r.push(e[n])}return r}var o="ab".substr(-1)==="b"?function(e,t,r){return e.substr(t,r)}:function(e,t,r){if(t<0)t=e.length+t;return e.substr(t,r)}}).call(this,e("_process"))},{_process:77}],77:[function(e,t,r){var n=t.exports={};var i=[];var a=false;var o;var s=-1;function f(){a=false;if(o.length){i=o.concat(i)}else{s=-1}if(i.length){c()}}function c(){if(a){return}var e=setTimeout(f);a=true;var t=i.length;while(t){o=i;i=[];while(++s<t){o[s].run()}s=-1;t=i.length}o=null;a=false;clearTimeout(e)}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}}i.push(new l(e,t));if(i.length===1&&!a){setTimeout(c,0)}};function l(e,t){this.fun=e;this.array=t}l.prototype.run=function(){this.fun.apply(null,this.array)};n.title="browser";n.browser=true;n.env={};n.argv=[];n.version="";n.versions={};function u(){}n.on=u;n.addListener=u;n.once=u;n.off=u;n.removeListener=u;n.removeAllListeners=u;n.emit=u;n.binding=function(e){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(e){throw new Error("process.chdir is not supported")};n.umask=function(){return 0}},{}],78:[function(t,r,n){(function(t){(function(i){var a=typeof n=="object"&&n&&!n.nodeType&&n;var o=typeof r=="object"&&r&&!r.nodeType&&r;var s=typeof t=="object"&&t;if(s.global===s||s.window===s||s.self===s){i=s}var f,c=2147483647,l=36,u=1,d=26,p=38,h=700,v=72,m=128,g="-",_=/^xn--/,w=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-u,k=Math.floor,E=String.fromCharCode,S;function A(e){throw RangeError(y[e])}function T(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function I(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=T(i,t).join(".");return n+a}function L(e){var t=[],r=0,n=e.length,i,a;while(r<n){i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){a=e.charCodeAt(r++);if((a&64512)==56320){t.push(((i&1023)<<10)+(a&1023)+65536)}else{t.push(i);r--}}else{t.push(i)}}return t}function C(e){return T(e,function(e){var t="";if(e>65535){e-=65536;t+=E(e>>>10&1023|55296);e=56320|e&1023}t+=E(e);return t}).join("")}function R(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function B(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*d>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+p))}function z(e){var t=[],r=e.length,n,i=0,a=m,o=v,s,f,p,h,_,w,b,y,x;s=e.lastIndexOf(g);if(s<0){s=0}for(f=0;f<s;++f){if(e.charCodeAt(f)>=128){A("not-basic")}t.push(e.charCodeAt(f))}for(p=s>0?s+1:0;p<r;){for(h=i,_=1,w=l;;w+=l){if(p>=r){A("invalid-input")}b=R(e.charCodeAt(p++));if(b>=l||b>k((c-i)/_)){A("overflow")}i+=b*_;y=w<=o?u:w>=o+d?d:w-o;if(b<y){break}x=l-y;if(_>k(c/x)){A("overflow")}_*=x}n=t.length+1;o=j(i-h,n,h==0);if(k(i/n)>c-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return C(t)}function M(e){var t,r,n,i,a,o,s,f,p,h,_,w=[],b,y,x,S;e=L(e);b=e.length;t=m;r=0;a=v;for(o=0;o<b;++o){_=e[o];if(_<128){w.push(E(_))}}n=i=w.length;if(i){w.push(g)}while(n<b){for(s=c,o=0;o<b;++o){_=e[o];if(_>=t&&_<s){s=_}}y=n+1;if(s-t>k((c-r)/y)){A("overflow")}r+=(s-t)*y;t=s;for(o=0;o<b;++o){_=e[o];if(_<t&&++r>c){A("overflow")}if(_==t){for(f=r,p=l;;p+=l){h=p<=a?u:p>=a+d?d:p-a;if(f<h){break}S=f-h;x=l-h;w.push(E(B(h+S%x,0)));f=k(S/x)}w.push(E(B(f,0)));a=j(r,y,n==i);r=0;++n}}++r;++t}return w.join("")}function O(e){return I(e,function(e){return _.test(e)?z(e.slice(4).toLowerCase()):e})}function U(e){return I(e,function(e){return w.test(e)?"xn--"+M(e):e})}f={version:"1.3.2",ucs2:{decode:L,encode:C},decode:z,encode:M,toASCII:U,toUnicode:O};if(typeof e=="function"&&typeof e.amd=="object"&&e.amd){e("punycode",function(){return f})}else if(a&&o){if(r.exports==a){o.exports=f}else{for(S in f){f.hasOwnProperty(S)&&(a[S]=f[S])}}}else{i.punycode=f}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&";r=r||"=";var o={};if(typeof e!=="string"||e.length===0){return o}var s=/\+/g;e=e.split(t);var f=1e3;if(a&&typeof a.maxKeys==="number"){f=a.maxKeys}var c=e.length;if(f>0&&c>f){c=f}for(var l=0;l<c;++l){var u=e[l].replace(s,"%20"),d=u.indexOf(r),p,h,v,m;if(d>=0){p=u.substr(0,d);h=u.substr(d+1)}else{p=u;h=""}v=decodeURIComponent(p);m=decodeURIComponent(h);if(!n(o,v)){o[v]=m}else if(i(o[v])){o[v].push(m)}else{o[v]=[o[v],m]}}return o};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],80:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(o(e),function(o){var s=encodeURIComponent(n(o))+r;if(i(e[o])){return a(e[o],function(e){return s+encodeURIComponent(n(e))}).join(t)}else{return s+encodeURIComponent(n(e[o]))}}).join(t)}if(!s)return"";return encodeURIComponent(n(s))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n<e.length;n++){r.push(t(e[n],n))}return r}var o=Object.keys||function(e){var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t.push(r)}return t}},{}],81:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode");r.encode=r.stringify=e("./encode")},{"./decode":79,"./encode":80}],82:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":83}],83:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{"./_stream_readable":85,"./_stream_writable":87,_process:77,"core-util-is":88,dup:40,inherits:146}],84:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./_stream_transform":86,"core-util-is":88,dup:41,inherits:146}],85:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./_stream_duplex":83,_process:77,buffer:65,"core-util-is":88,dup:42,events:69,inherits:146,isarray:75,stream:93,"string_decoder/":94,util:51}],86:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{"./_stream_duplex":83,"core-util-is":88,dup:43,inherits:146}],87:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{"./_stream_duplex":83,_process:77,buffer:65,"core-util-is":88,dup:44,inherits:146,stream:93}],88:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{buffer:65,dup:45}],89:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":84}],90:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{"./lib/_stream_duplex.js":83,"./lib/_stream_passthrough.js":84,"./lib/_stream_readable.js":85,"./lib/_stream_transform.js":86,"./lib/_stream_writable.js":87,dup:48,stream:93}],91:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":86}],92:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":87}],93:[function(e,t,r){t.exports=a;var n=e("events").EventEmitter;var i=e("inherits");i(a,n);a.Readable=e("readable-stream/readable.js");a.Writable=e("readable-stream/writable.js");a.Duplex=e("readable-stream/duplex.js");a.Transform=e("readable-stream/transform.js");a.PassThrough=e("readable-stream/passthrough.js");a.Stream=a;function a(){n.call(this)}a.prototype.pipe=function(e,t){var r=this;function i(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",i);function a(){if(r.readable&&r.resume){r.resume()}}e.on("drain",a);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",s);r.on("close",f)}var o=false;function s(){if(o)return;o=true;e.end()}function f(){if(o)return;o=true;if(typeof e.destroy==="function")e.destroy()}function c(e){l();if(n.listenerCount(this,"error")===0){throw e}}r.on("error",c);e.on("error",c);function l(){r.removeListener("data",i);e.removeListener("drain",a);r.removeListener("end",s);r.removeListener("close",f);r.removeListener("error",c);e.removeListener("error",c);r.removeListener("end",l);r.removeListener("close",l);e.removeListener("close",l)}r.on("end",l);r.on("close",l);e.on("close",l);e.emit("pipe",r);return e}},{events:69,inherits:146,"readable-stream/duplex.js":82,"readable-stream/passthrough.js":89,"readable-stream/readable.js":90,"readable-stream/transform.js":91,"readable-stream/writable.js":92}],94:[function(e,t,r){arguments[4][47][0].apply(r,arguments)},{buffer:65,dup:47}],95:[function(e,t,r){var n=e("punycode");r.parse=w;r.resolve=y;r.resolveObject=x;r.format=b;r.Url=i;function i(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,s=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(s),c=["'"].concat(f),l=["%","/","?",";","#"].concat(c),u=["/","?","#"],d=255,p=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:true,"javascript:":true},m={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},_=e("querystring");function w(e,t,r){if(e&&E(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var o=a.exec(i);if(o){o=o[0];var s=o.toLowerCase();this.protocol=s;i=i.substr(o.length)}if(r||o||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(o&&m[o])){i=i.substr(2);this.slashes=true}}if(!m[o]&&(f||o&&!g[o])){var w=-1;for(var b=0;b<u.length;b++){var y=i.indexOf(u[b]);if(y!==-1&&(w===-1||y<w))w=y}var x,E;if(w===-1){E=i.lastIndexOf("@")}else{E=i.lastIndexOf("@",w)}if(E!==-1){x=i.slice(0,E);i=i.slice(E+1);this.auth=decodeURIComponent(x)}w=-1;for(var b=0;b<l.length;b++){var y=i.indexOf(l[b]);if(y!==-1&&(w===-1||y<w))w=y}if(w===-1)w=i.length;this.host=i.slice(0,w);i=i.slice(w);this.parseHost();this.hostname=this.hostname||"";var S=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!S){var A=this.hostname.split(/\./);for(var b=0,T=A.length;b<T;b++){var I=A[b];if(!I)continue;if(!I.match(p)){var L="";for(var C=0,R=I.length;C<R;C++){if(I.charCodeAt(C)>127){L+="x"}else{L+=I[C]}}if(!L.match(p)){var B=A.slice(0,b);var j=A.slice(b+1);var z=I.match(h);if(z){B.push(z[1]);j.unshift(z[2])}if(j.length){i="/"+j.join(".")+i}this.hostname=B.join(".");break}}}}if(this.hostname.length>d){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!S){var M=this.hostname.split(".");var O=[];for(var b=0;b<M.length;++b){var U=M[b];O.push(U.match(/[^A-Za-z0-9_-]/)?"xn--"+n.encode(U):U)}this.hostname=O.join(".")}var P=this.port?":"+this.port:"";var N=this.hostname||"";this.host=N+P;this.href+=this.host;if(S){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(i[0]!=="/"){i="/"+i}}}if(!v[s]){for(var b=0,T=c.length;b<T;b++){var D=c[b];var H=encodeURIComponent(D);if(H===D){H=escape(D)}i=i.split(D).join(H)}}var q=i.indexOf("#");if(q!==-1){this.hash=i.substr(q);i=i.slice(0,q)}var F=i.indexOf("?");if(F!==-1){this.search=i.substr(F);this.query=i.substr(F+1);if(t){this.query=_.parse(this.query)}i=i.slice(0,F)}else if(t){this.search="";this.query={}}if(i)this.pathname=i;if(g[s]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var P=this.pathname||"";var U=this.search||"";this.path=P+U}this.href=this.format();return this};function b(e){if(k(e))e=w(e);if(!(e instanceof i))return i.prototype.format.call(e);return e.format()}i.prototype.format=function(){var e=this.auth||"";if(e){e=encodeURIComponent(e);e=e.replace(/%3A/i,":");e+="@"}var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=false,a="";if(this.host){i=e+this.host}else if(this.hostname){i=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){i+=":"+this.port}}if(this.query&&E(this.query)&&Object.keys(this.query).length){a=_.stringify(this.query)}var o=this.search||a&&"?"+a||"";if(t&&t.substr(-1)!==":")t+=":";if(this.slashes||(!t||g[t])&&i!==false){i="//"+(i||"");if(r&&r.charAt(0)!=="/")r="/"+r}else if(!i){i=""}if(n&&n.charAt(0)!=="#")n="#"+n;if(o&&o.charAt(0)!=="?")o="?"+o;r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)});o=o.replace("#","%23");return t+i+r+o+n};function y(e,t){
-return w(e,false,true).resolve(t)}i.prototype.resolve=function(e){return this.resolveObject(w(e,false,true)).format()};function x(e,t){if(!e)return t;return w(e,false,true).resolveObject(t)}i.prototype.resolveObject=function(e){if(k(e)){var t=new i;t.parse(e,false,true);e=t}var r=new i;Object.keys(this).forEach(function(e){r[e]=this[e]},this);r.hash=e.hash;if(e.href===""){r.href=r.format();return r}if(e.slashes&&!e.protocol){Object.keys(e).forEach(function(t){if(t!=="protocol")r[t]=e[t]});if(g[r.protocol]&&r.hostname&&!r.pathname){r.path=r.pathname="/"}r.href=r.format();return r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){Object.keys(e).forEach(function(t){r[t]=e[t]});r.href=r.format();return r}r.protocol=e.protocol;if(!e.host&&!m[e.protocol]){var n=(e.pathname||"").split("/");while(n.length&&!(e.host=n.shift()));if(!e.host)e.host="";if(!e.hostname)e.hostname="";if(n[0]!=="")n.unshift("");if(n.length<2)n.unshift("");r.pathname=n.join("/")}else{r.pathname=e.pathname}r.search=e.search;r.query=e.query;r.host=e.host||"";r.auth=e.auth;r.hostname=e.hostname||e.host;r.port=e.port;if(r.pathname||r.search){var a=r.pathname||"";var o=r.search||"";r.path=a+o}r.slashes=r.slashes||e.slashes;r.href=r.format();return r}var s=r.pathname&&r.pathname.charAt(0)==="/",f=e.host||e.pathname&&e.pathname.charAt(0)==="/",c=f||s||r.host&&e.pathname,l=c,u=r.pathname&&r.pathname.split("/")||[],n=e.pathname&&e.pathname.split("/")||[],d=r.protocol&&!g[r.protocol];if(d){r.hostname="";r.port=null;if(r.host){if(u[0]==="")u[0]=r.host;else u.unshift(r.host)}r.host="";if(e.protocol){e.hostname=null;e.port=null;if(e.host){if(n[0]==="")n[0]=e.host;else n.unshift(e.host)}e.host=null}c=c&&(n[0]===""||u[0]==="")}if(f){r.host=e.host||e.host===""?e.host:r.host;r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname;r.search=e.search;r.query=e.query;u=n}else if(n.length){if(!u)u=[];u.pop();u=u.concat(n);r.search=e.search;r.query=e.query}else if(!A(e.search)){if(d){r.hostname=r.host=u.shift();var p=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}r.search=e.search;r.query=e.query;if(!S(r.pathname)||!S(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!u.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=u.slice(-1)[0];var v=(r.host||e.host)&&(h==="."||h==="..")||h==="";var _=0;for(var w=u.length;w>=0;w--){h=u[w];if(h=="."){u.splice(w,1)}else if(h===".."){u.splice(w,1);_++}else if(_){u.splice(w,1);_--}}if(!c&&!l){for(;_--;_){u.unshift("..")}}if(c&&u[0]!==""&&(!u[0]||u[0].charAt(0)!=="/")){u.unshift("")}if(v&&u.join("/").substr(-1)!=="/"){u.push("")}var b=u[0]===""||u[0]&&u[0].charAt(0)==="/";if(d){r.hostname=r.host=b?"":u.length?u.shift():"";var p=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(p){r.auth=p.shift();r.host=r.hostname=p.shift()}}c=c||r.host&&u.length;if(c&&!b){u.unshift("")}if(!u.length){r.pathname=null;r.path=null}else{r.pathname=u.join("/")}if(!S(r.pathname)||!S(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=o.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function E(e){return typeof e==="object"&&e!==null}function S(e){return e===null}function A(e){return e==null}},{punycode:78,querystring:81}],96:[function(e,t,r){t.exports=function n(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],97:[function(e,t,r){(function(t,n){var i=/%[sdj%]/g;r.format=function(e){if(!x(e)){var t=[];for(var r=0;r<arguments.length;r++){t.push(s(arguments[r]))}return t.join(" ")}var r=1;var n=arguments;var a=n.length;var o=String(e).replace(i,function(e){if(e==="%%")return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}});for(var f=n[r];r<a;f=n[++r]){if(w(f)||!A(f)){o+=" "+f}else{o+=" "+s(f)}}return o};r.deprecate=function(e,i){if(E(n.process)){return function(){return r.deprecate(e,i).apply(this,arguments)}}if(t.noDeprecation===true){return e}var a=false;function o(){if(!a){if(t.throwDeprecation){throw new Error(i)}else if(t.traceDeprecation){console.trace(i)}else{console.error(i)}a=true}return e.apply(this,arguments)}return o};var a={};var o;r.debuglog=function(e){if(E(o))o=t.env.NODE_DEBUG||"";e=e.toUpperCase();if(!a[e]){if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else{a[e]=function(){}}}return a[e]};function s(e,t){var n={seen:[],stylize:c};if(arguments.length>=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(_(t)){n.showHidden=t}else if(t){r._extend(n,t)}if(E(n.showHidden))n.showHidden=false;if(E(n.depth))n.depth=2;if(E(n.colors))n.colors=false;if(E(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=f;return u(n,e,n.depth)}r.inspect=s;s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};s.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function f(e,t){var r=s.styles[t];if(r){return"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m"}else{return e}}function c(e,t){return e}function l(e){var t={};e.forEach(function(e,r){t[e]=true});return t}function u(e,t,n){if(e.customInspect&&t&&L(t.inspect)&&t.inspect!==r.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);if(!x(i)){i=u(e,i,n)}return i}var a=d(e,t);if(a){return a}var o=Object.keys(t);var s=l(o);if(e.showHidden){o=Object.getOwnPropertyNames(t)}if(I(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0)){return p(t)}if(o.length===0){if(L(t)){var f=t.name?": "+t.name:"";return e.stylize("[Function"+f+"]","special")}if(S(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}if(T(t)){return e.stylize(Date.prototype.toString.call(t),"date")}if(I(t)){return p(t)}}var c="",_=false,w=["{","}"];if(g(t)){_=true;w=["[","]"]}if(L(t)){var b=t.name?": "+t.name:"";c=" [Function"+b+"]"}if(S(t)){c=" "+RegExp.prototype.toString.call(t)}if(T(t)){c=" "+Date.prototype.toUTCString.call(t)}if(I(t)){c=" "+p(t)}if(o.length===0&&(!_||t.length==0)){return w[0]+c+w[1]}if(n<0){if(S(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(t);var y;if(_){y=h(e,t,n,s,o)}else{y=o.map(function(r){return v(e,t,n,s,r,_)})}e.seen.pop();return m(y,c,w)}function d(e,t){if(E(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(_(t))return e.stylize(""+t,"boolean");if(w(t))return e.stylize("null","null")}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i){var a=[];for(var o=0,s=t.length;o<s;++o){if(M(t,String(o))){a.push(v(e,t,r,n,String(o),true))}else{a.push("")}}i.forEach(function(i){if(!i.match(/^\d+$/)){a.push(v(e,t,r,n,i,true))}});return a}function v(e,t,r,n,i,a){var o,s,f;f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]};if(f.get){if(f.set){s=e.stylize("[Getter/Setter]","special")}else{s=e.stylize("[Getter]","special")}}else{if(f.set){s=e.stylize("[Setter]","special")}}if(!M(n,i)){o="["+i+"]"}if(!s){if(e.seen.indexOf(f.value)<0){if(w(r)){s=u(e,f.value,null)}else{s=u(e,f.value,r-1)}if(s.indexOf("\n")>-1){if(a){s=s.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{s="\n"+s.split("\n").map(function(e){return" "+e}).join("\n")}}}else{s=e.stylize("[Circular]","special")}}if(E(o)){if(a&&i.match(/^\d+$/)){return s}o=JSON.stringify(""+i);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=e.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=e.stylize(o,"string")}}return o+": "+s}function m(e,t,r){var n=0;var i=e.reduce(function(e,t){n++;if(t.indexOf("\n")>=0)n++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60){return r[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]}return r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}r.isArray=g;function _(e){return typeof e==="boolean"}r.isBoolean=_;function w(e){return e===null}r.isNull=w;function b(e){return e==null}r.isNullOrUndefined=b;function y(e){return typeof e==="number"}r.isNumber=y;function x(e){return typeof e==="string"}r.isString=x;function k(e){return typeof e==="symbol"}r.isSymbol=k;function E(e){return e===void 0}r.isUndefined=E;function S(e){return A(e)&&R(e)==="[object RegExp]"}r.isRegExp=S;function A(e){return typeof e==="object"&&e!==null}r.isObject=A;function T(e){return A(e)&&R(e)==="[object Date]"}r.isDate=T;function I(e){return A(e)&&(R(e)==="[object Error]"||e instanceof Error)}r.isError=I;function L(e){return typeof e==="function"}r.isFunction=L;function C(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=C;r.isBuffer=e("./support/isBuffer");function R(e){return Object.prototype.toString.call(e)}function B(e){return e<10?"0"+e.toString(10):e.toString(10)}var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function z(){var e=new Date;var t=[B(e.getHours()),B(e.getMinutes()),B(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}r.log=function(){console.log("%s - %s",z(),r.format.apply(r,arguments))};r.inherits=e("inherits");r._extend=function(e,t){if(!t||!A(t))return e;var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e};function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":96,_process:77,inherits:146}],98:[function(e,t,r){(function(r,n){t.exports=w;t.exports.announceList=[["udp://tracker.publicbt.com:80"],["udp://tracker.openbittorrent.com:80"],["udp://open.demonii.com:1337"],["udp://tracker.webtorrent.io:80"],["wss://tracker.webtorrent.io"]];t.exports.parseInput=b;var i=e("bencode");var a=e("block-stream2");var o=e("piece-length");var s=e("path");var f=e("dezalgo");var c=e("filestream/read");var l=e("flatten");var u=e("fs");var d=e("is-file");var p=e("junk");var h=e("multistream");var v=e("once");var m=e("run-parallel");var g=e("simple-sha1");var _=e("stream");function w(e,t,r){if(typeof t==="function"){r=t;t={}}if(!t)t={};b(e,t,function(e,n,i){if(e)return r(e);t.singleFileTorrent=i;A(n,t,r)})}function b(e,t,r){if(typeof t==="function"){r=t;t={}}if(!t)t={};r=f(r);if(Array.isArray(e)&&e.length===0)throw new Error("invalid input type");if(L(e))e=Array.prototype.slice.call(e);if(!Array.isArray(e))e=[e];if(!t.name)t.name=e[0]&&e[0].name;if(!t.name)t.name=typeof e[0]==="string"&&s.basename(e[0]);if(t.name===undefined){throw new Error("missing option 'name' and unable to infer it from input[0].name")}if(e.length===1&&!e[0].name)e[0].name=t.name;var i=e.reduce(function(e,t){return e+Number(typeof t==="string")},0);var a=e.length===1;if(e.length===1&&typeof e[0]==="string"){d(e[0],function(e,t){if(e)return r(e);a=t;o()})}else{o()}function o(){m(e.map(function(e){return function(r){var o={};if(I(e)){o.getStream=R(e);o.length=e.size}else if(n.isBuffer(e)){o.getStream=B(e);o.length=e.length}else if(C(e)){if(!t.pieceLength){throw new Error("must specify `pieceLength` option if input is Stream")}o.getStream=z(e,o);o.length=0}else if(typeof e==="string"){if(typeof u.readdir!=="function"){throw new Error("filesystem paths do not work in the browser")}var f=i>1||a;y(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");o.path=e.name.split(s.sep);r(null,o)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function y(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=s.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(s.sep)+1)}if(e[e.length-1]!==s.sep)e+=s.sep;i.forEach(function(t){t.getStream=j(t.path);t.path=t.path.replace(e,"").split(s.sep)});r(null,i)})}function x(e,t){t=v(t);u.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){u.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{m(i.filter(E).filter(p.not).map(function(r){return function(n){k(s.join(e,r),t,n)}}),r)}})}function E(e){return e[0]!=="."}function S(e,t,r){r=v(r);var i=[];var o=0;var s=e.map(function(e){return e.getStream});var f=0;var c=0;var l=false;var u=new h(s);var d=new a(t,{zeroPadding:false});u.on("error",_);u.pipe(d).on("data",p).on("end",m).on("error",_);function p(e){o+=e.length;var t=c;g(e,function(e){i[t]=e;f-=1;b()});f+=1;c+=1}function m(){l=true;b()}function _(e){w();r(e)}function w(){u.removeListener("error",_);d.removeListener("data",p);d.removeListener("end",m);d.removeListener("error",_)}function b(){if(l&&f===0){w();r(null,new n(i.join(""),"hex"),o)}}}function A(e,n,a){var s=n.announceList;if(!s){if(typeof n.announce==="string")s=[[n.announce]];else if(Array.isArray(n.announce)){s=n.announce.map(function(e){return[e]})}}if(!s)s=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){s.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){s=s.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(s.length===0){s=s.concat(t.exports.announceList)}var f={info:{name:n.name},announce:s[0][0],"announce-list":s,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var c=n.pieceLength||o(e.reduce(T,0));f.info["piece length"]=c;S(e,c,function(t,r,o){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=o}else{f.info.files=e}a(null,i.encode(f))})}function T(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function L(e){return typeof FileList==="function"&&e instanceof FileList}function C(e){return typeof e==="object"&&typeof e.pipe==="function"}function R(e){return function(){return new c(e)}}function B(e){return function(){var t=new _.PassThrough;t.end(e);return t}}function j(e){return function(){return u.createReadStream(e)}}function z(e,t){return function(){var r=new _.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:99,"block-stream2":103,buffer:65,dezalgo:115,"filestream/read":121,flatten:122,fs:49,"is-file":123,junk:124,multistream:125,once:128,path:76,"piece-length":129,"run-parallel":131,"simple-sha1":135,stream:93}],99:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":100,"./lib/encode":102,dup:16}],100:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":101,buffer:65,dup:17}],101:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],102:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:65,dup:19}],103:[function(e,t,r){arguments[4][38][0].apply(r,arguments)},{buffer:65,defined:104,dup:38,inherits:105,"readable-stream":114}],104:[function(e,t,r){arguments[4][39][0].apply(r,arguments)},{dup:39}],105:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],106:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{"./_stream_readable":108,"./_stream_writable":110,_process:77,"core-util-is":111,dup:40,inherits:105}],107:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./_stream_transform":109,"core-util-is":111,dup:41,inherits:105}],108:[function(e,t,r){(function(r){t.exports=l;var n=e("isarray");var i=e("buffer").Buffer;l.ReadableState=c;var a=e("events").EventEmitter;if(!a.listenerCount)a.listenerCount=function(e,t){return e.listeners(t).length};var o=e("stream");var s=e("core-util-is");s.inherits=e("inherits");var f;s.inherits(l,o);function c(t,r){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||n===0?n:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!t.objectMode;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!f)f=e("string_decoder/").StringDecoder;this.decoder=new f(t.encoding);this.encoding=t.encoding}}function l(e){if(!(this instanceof l))return new l(e);this._readableState=new c(e,this);this.readable=true;o.call(this)}l.prototype.push=function(e,t){var r=this._readableState;if(typeof e==="string"&&!r.objectMode){t=t||r.defaultEncoding;if(t!==r.encoding){e=new i(e,t);t=""}}return u(this,r,e,t,false)};l.prototype.unshift=function(e){var t=this._readableState;return u(this,t,e,"",true)};function u(e,t,r,n,i){var a=m(t,r);if(a){e.emit("error",a)}else if(r===null||r===undefined){t.reading=false;if(!t.ended)g(e,t)}else if(t.objectMode||r&&r.length>0){if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);t.length+=t.objectMode?1:r.length;if(i){t.buffer.unshift(r)}else{t.reading=false;t.buffer.push(r)}if(t.needReadable)_(e);b(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}l.prototype.setEncoding=function(t){if(!f)f=e("string_decoder/").StringDecoder;this._readableState.decoder=new f(t);this._readableState.encoding=t};var p=8388608;function h(e){if(e>=p){e=p}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=h(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}l.prototype.read=function(e){var t=this._readableState;t.calledRead=true;var r=e;var n;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){_(this);return null}e=v(e,t);if(e===0&&t.ended){n=null;if(t.length>0&&t.decoder){n=A(e,t);t.length-=n.length}if(t.length===0)T(this);return n}var i=t.needReadable;if(t.length-e<=t.highWaterMark)i=true;if(t.ended||t.reading)i=false;if(i){t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false}if(i&&!t.reading)e=v(r,t);if(e>0)n=A(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(t.ended&&!t.endEmitted&&t.length===0)T(this);return n};function m(e,t){var r=null;if(!i.isBuffer(t)&&"string"!==typeof t&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function g(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.length>0)_(e);else T(e)}function _(e){var t=e._readableState;t.needReadable=false;if(t.emittedReadable)return;t.emittedReadable=true;if(t.sync)r.nextTick(function(){w(e)});else w(e)}function w(e){e.emit("readable")}function b(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){y(e,t)})}}function y(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}l.prototype._read=function(e){this.emit("error",new Error("not implemented"))};l.prototype.pipe=function(e,t){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1;var s=(!t||t.end!==false)&&e!==r.stdout&&e!==r.stderr;var f=s?l:d;if(o.endEmitted)r.nextTick(f);else i.once("end",f);e.on("unpipe",c);function c(e){if(e!==i)return;d()}function l(){e.end()}var u=x(i);e.on("drain",u);function d(){e.removeListener("close",h);e.removeListener("finish",v);e.removeListener("drain",u);e.removeListener("error",p);e.removeListener("unpipe",c);i.removeListener("end",l);i.removeListener("end",d);if(!e._writableState||e._writableState.needDrain)u()}function p(t){m();e.removeListener("error",p);if(a.listenerCount(e,"error")===0)e.emit("error",t)}if(!e._events||!e._events.error)e.on("error",p);else if(n(e._events.error))e._events.error.unshift(p);else e._events.error=[p,e._events.error];function h(){e.removeListener("finish",v);m()}e.once("close",h);function v(){e.removeListener("close",h);m()}e.once("finish",v);function m(){i.unpipe(e)}e.emit("pipe",i);if(!o.flowing){this.on("readable",E);o.flowing=true;r.nextTick(function(){k(i)})}return e};function x(e){return function(){var t=this;var r=e._readableState;r.awaitDrain--;if(r.awaitDrain===0)k(e)}}function k(e){var t=e._readableState;var r;t.awaitDrain=0;function n(e,n,i){var a=e.write(r);if(false===a){t.awaitDrain++}}while(t.pipesCount&&null!==(r=e.read())){if(t.pipesCount===1)n(t.pipes,0,null);else I(t.pipes,n);e.emit("data",r);if(t.awaitDrain>0)return}if(t.pipesCount===0){t.flowing=false;if(a.listenerCount(e,"data")>0)S(e);return}t.ranOut=true}function E(){if(this._readableState.ranOut){this._readableState.ranOut=false;k(this)}}l.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;this.removeListener("readable",E);t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var r=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;this.removeListener("readable",E);t.flowing=false;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var i=L(t.pipes,e);if(i===-1)return this;t.pipes.splice(i,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this);return this};l.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t);if(e==="data"&&!this._readableState.flowing)S(this);if(e==="readable"&&this.readable){var n=this._readableState;if(!n.readableListening){n.readableListening=true;n.emittedReadable=false;n.needReadable=true;if(!n.reading){this.read(0)}else if(n.length){_(this,n)}}}return r};l.prototype.addListener=l.prototype.on;l.prototype.resume=function(){S(this);this.read(0);this.emit("resume")};l.prototype.pause=function(){S(this,true);this.emit("pause")};function S(e,t){var n=e._readableState;if(n.flowing){throw new Error("Cannot switch to old mode now.")}var i=t||false;var a=false;e.readable=true;e.pipe=o.prototype.pipe;e.on=e.addListener=o.prototype.on;e.on("readable",function(){a=true;var t;while(!i&&null!==(t=e.read()))e.emit("data",t);if(t===null){a=false;e._readableState.needReadable=true}});e.pause=function(){i=true;this.emit("pause")};e.resume=function(){i=false;if(a)r.nextTick(function(){e.emit("readable")});else this.read(0);this.emit("resume")};e.emit("readable")}l.prototype.wrap=function(e){var t=this._readableState;var r=false;var n=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)n.push(e)}n.push(null)});e.on("data",function(i){if(t.decoder)i=t.decoder.write(i);if(t.objectMode&&(i===null||i===undefined))return;else if(!t.objectMode&&(!i||!i.length))return;var a=n.push(i);if(!a){r=true;e.pause()}});for(var i in e){if(typeof e[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)}}var a=["error","close","destroy","pause","resume"];I(a,function(t){e.on(t,n.emit.bind(n,t))});n._read=function(t){if(r){r=false;e.resume()}};return n};l._fromList=A;function A(e,t){var r=t.buffer;var n=t.length;var a=!!t.decoder;var o=!!t.objectMode;var s;if(r.length===0)return null;if(n===0)s=null;else if(o)s=r.shift();else if(!e||e>=n){if(a)s=r.join("");else s=i.concat(r,n);r.length=0}else{if(e<r[0].length){var f=r[0];s=f.slice(0,e);r[0]=f.slice(e)}else if(e===r[0].length){s=r.shift()}else{if(a)s="";else s=new i(e);var c=0;for(var l=0,u=r.length;l<u&&c<e;l++){var f=r[0];var d=Math.min(e-c,f.length);if(a)s+=f.slice(0,d);else f.copy(s,c,0,d);if(d<f.length)r[0]=f.slice(d);else r.shift();c+=d}}}return s}function T(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted&&t.calledRead){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}function L(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}}).call(this,e("_process"))},{_process:77,buffer:65,"core-util-is":111,events:69,inherits:105,isarray:112,stream:93,"string_decoder/":113}],109:[function(e,t,r){t.exports=s;var n=e("./_stream_duplex");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(s,n);function a(e,t){this.afterTransform=function(e,r){return o(t,e,r)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function o(e,t,r){var n=e._transformState;n.transforming=false;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null;n.writecb=null;if(r!==null&&r!==undefined)e.push(r);if(i)i(t);var a=e._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){e._read(a.highWaterMark)}}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e);var t=this._transformState=new a(e,this);var r=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(e){f(r,e)});else f(r)})}s.prototype.push=function(e,t){this._transformState.needTransform=false;return n.prototype.push.call(this,e,t)};s.prototype._transform=function(e,t,r){throw new Error("not implemented")};s.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r;n.writechunk=e;n.writeencoding=t;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};s.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};function f(e,t){if(t)return e.emit("error",t);var r=e._writableState;var n=e._readableState;var i=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(i.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":106,"core-util-is":111,inherits:105}],110:[function(e,t,r){(function(r){t.exports=f;var n=e("buffer").Buffer;f.WritableState=s;var i=e("core-util-is");i.inherits=e("inherits");var a=e("stream");i.inherits(f,a);function o(e,t,r){this.chunk=e;this.encoding=t;this.callback=r}function s(e,t){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||r===0?r:16*1024;this.objectMode=!!e.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var n=e.decodeStrings===false;this.decodeStrings=!n;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){m(t,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function f(t){var r=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof r))return new f(t);this._writableState=new s(t,this);this.writable=true;a.call(this)}f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function c(e,t,n){var i=new Error("write after end");e.emit("error",i);r.nextTick(function(){n(i)})}function l(e,t,i,a){var o=true;if(!n.isBuffer(i)&&"string"!==typeof i&&i!==null&&i!==undefined&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s);r.nextTick(function(){a(s)});o=false}return o}f.prototype.write=function(e,t,r){var i=this._writableState;var a=false;if(typeof t==="function"){r=t;t=null}if(n.isBuffer(e))t="buffer";else if(!t)t=i.defaultEncoding;if(typeof r!=="function")r=function(){};if(i.ended)c(this,i,r);else if(l(this,i,e,r))a=d(this,i,e,t,r);return a};function u(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function d(e,t,r,i,a){r=u(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing)t.buffer.push(new o(r,i,a));else p(e,t,s,r,i,a);return f}function p(e,t,r,n,i,a){t.writelen=r;t.writecb=a;t.writing=true;t.sync=true;e._write(n,i,t.onwrite);t.sync=false}function h(e,t,n,i,a){if(n)r.nextTick(function(){a(i)});else a(i);e._writableState.errorEmitted=true;e.emit("error",i)}function v(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function m(e,t){var n=e._writableState;var i=n.sync;var a=n.writecb;v(n);if(t)h(e,n,i,t,a);else{var o=b(e,n);if(!o&&!n.bufferProcessing&&n.buffer.length)w(e,n);if(i){r.nextTick(function(){g(e,n,o,a)})}else{g(e,n,o,a)}}}function g(e,t,r,n){if(!r)_(e,t);n();if(r)y(e,t)}function _(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function w(e,t){t.bufferProcessing=true;for(var r=0;r<t.buffer.length;r++){var n=t.buffer[r];var i=n.chunk;var a=n.encoding;var o=n.callback;var s=t.objectMode?1:i.length;p(e,t,s,i,a,o);if(t.writing){r++;break}}t.bufferProcessing=false;if(r<t.buffer.length)t.buffer=t.buffer.slice(r);else t.buffer.length=0}f.prototype._write=function(e,t,r){r(new Error("not implemented"))};f.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(typeof e!=="undefined"&&e!==null)this.write(e,t);if(!n.ending&&!n.finished)x(this,n,r)};function b(e,t){return t.ending&&t.length===0&&!t.finished&&!t.writing}function y(e,t){var r=b(e,t);if(r){t.finished=true;e.emit("finish")}return r}function x(e,t,n){t.ending=true;y(e,t);if(n){if(t.finished)r.nextTick(n);else e.once("finish",n)}t.ended=true}}).call(this,e("_process"))},{"./_stream_duplex":106,_process:77,buffer:65,"core-util-is":111,inherits:105,stream:93}],111:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{buffer:65,dup:45}],112:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],113:[function(e,t,r){arguments[4][47][0].apply(r,arguments)},{buffer:65,dup:47}],114:[function(e,t,r){var n=e("stream");r=t.exports=e("./lib/_stream_readable.js");r.Stream=n;r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":106,"./lib/_stream_passthrough.js":107,"./lib/_stream_readable.js":108,"./lib/_stream_transform.js":109,"./lib/_stream_writable.js":110,stream:93}],115:[function(e,t,r){arguments[4][30][0].apply(r,arguments);
-},{asap:116,dup:30,wrappy:117}],116:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{_process:77,dup:31}],117:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],118:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],119:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:65,"is-typedarray":120}],120:[function(e,t,r){t.exports=a;a.strict=o;a.loose=s;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return o(e)||s(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return i[n.call(e)]}},{}],121:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var o=e("typedarray-to-buffer");function s(e,t){var r=this;if(!(this instanceof s)){return new s(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(s,n);t.exports=s;s.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};s.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(o(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};s.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:118,stream:93,"typedarray-to-buffer":119}],122:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n<t){return e.concat(r(i,n+1))}else{return e.concat(i)}},[])}}},{}],123:[function(e,t,r){"use strict";var n=e("fs");t.exports=function a(e,t){if(!t)return i(e);n.stat(e,function(e,r){if(e)return t(e);return t(null,r.isFile())})};t.exports.sync=i;function i(e){return n.existsSync(e)&&n.statSync(e).isFile()}},{fs:49}],124:[function(e,t,r){"use strict";r.re=/^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon[\r\?]?|^\._.*|^.Spotlight-V100$|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^Desktop\.ini$/;r.is=function(e){return r.re.test(e)};r.not=r.isnt=function(e){return!r.is(e)}},{}],125:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=e.map(o);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();this._queue.forEach(function(e){if(e.destroy)e.destroy()});if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=e._queue.shift();if(typeof t==="function")t=o(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function o(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:126,stream:93}],126:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],127:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],128:[function(e,t,r){arguments[4][36][0].apply(r,arguments)},{dup:36,wrappy:127}],129:[function(e,t,r){var n=e("closest-to");var i=[];for(var a=14;a<=22;a++){i.push(Math.pow(2,a))}t.exports=function(e){return n(e/Math.pow(2,10),i)}},{"closest-to":130}],130:[function(e,t,r){t.exports=function(e,t){var r=Infinity;var n=0;var i=null;t.sort(function(e,t){return e-t});for(var a=0,o=t.length;a<o;a++){n=Math.abs(e-t[a]);if(n>=r){break}r=n;i=t[a]}return i}},{}],131:[function(e,t,r){var n=e("dezalgo");t.exports=function(e,t){if(t)t=n(t);var r,i,a;if(Array.isArray(e)){r=[];i=e.length}else{a=Object.keys(e);r={};i=a.length}function o(e,n,a){r[e]=a;if(--i===0||n){if(t)t(n,r);t=null}}if(!i){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](o.bind(undefined,t))})}else{e.forEach(function(e,t){e(o.bind(undefined,t))})}}},{dezalgo:132}],132:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{asap:133,dup:30,wrappy:134}],133:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{_process:77,dup:31}],134:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],135:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var o=a.subtle||a.webkitSubtle;var s=i.digest.bind(i);try{o.digest({name:"sha-1"},new Uint8Array).catch(function(){o=false})}catch(f){o=false}function c(e,t){if(!o){setTimeout(t,0,s(e));return}if(typeof e==="string"){e=l(e)}o.digest({name:"sha-1"},e).then(function r(e){t(u(new Uint8Array(e)))},function n(r){t(s(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n<t;n++){r[n]=e.charCodeAt(n)}return r}function u(e){var t=e.length;var r=[];for(var n=0;n<t;n++){var i=e[n];r.push((i>>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=c;t.exports.sync=s},{rusha:136}],136:[function(e,t,r){(function(e){(function(){if(typeof t!=="undefined"){t.exports=a}else if(typeof window!=="undefined"){window.Rusha=a}if(typeof FileReaderSync!=="undefined"){var r=new FileReaderSync,n=new a(4*1024*1024);self.onmessage=function s(e){var t,r=e.data.data;try{t=n.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}var i={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function a(e){"use strict";var t={fill:0};var n=function(e){for(e+=9;e%64>0;e+=1);return e};var a=function(e,t){for(var r=t>>2;r<e.length;r++)e[r]=0};var s=function(e,t,r){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,o,s=i%4,f=n%4,c=n-f;if(c>0){switch(s){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(o=s;o<c;o=o+4|0){t[i+o>>2]=a.charCodeAt(r+o)<<24|a.charCodeAt(r+o+1)<<16|a.charCodeAt(r+o+2)<<8|a.charCodeAt(r+o+3)}switch(f){case 3:e[i+c+1|0]=a.charCodeAt(r+c+2);case 2:e[i+c+2|0]=a.charCodeAt(r+c+1);case 1:e[i+c+3|0]=a.charCodeAt(r+c)}};var c=function(e,t,r,n,i){var a=this,o,s=i%4,f=n%4,c=n-f;if(c>0){switch(s){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(o=4-s;o<c;o=o+=4|0){t[i+o>>2]=a[r+o]<<24|a[r+o+1]<<16|a[r+o+2]<<8|a[r+o+3]}switch(f){case 3:e[i+c+1|0]=a[r+c+2];case 2:e[i+c+2|0]=a[r+c+1];case 1:e[i+c+3|0]=a[r+c]}};var l=function(e,t,n,i,a){var o=this,s,f=a%4,c=i%4,l=i-c;var u=new Uint8Array(r.readAsArrayBuffer(o.slice(n,n+i)));if(l>0){switch(f){case 0:e[a+3|0]=u[0];case 1:e[a+2|0]=u[1];case 2:e[a+1|0]=u[2];case 3:e[a|0]=u[3]}}for(s=4-f;s<l;s=s+=4|0){t[a+s>>2]=u[s]<<24|u[s+1]<<16|u[s+2]<<8|u[s+3]}switch(c){case 3:e[a+l+1|0]=u[l+2];case 2:e[a+l+2|0]=u[l+1];case 1:e[a+l+3|0]=u[l]}};var u=function(e){switch(i.getDataType(e)){case"string":return f.bind(e);case"array":return c.bind(e);case"buffer":return c.bind(e);case"arraybuffer":return c.bind(new Uint8Array(e));case"view":return c.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var d=function(e,t){switch(i.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var p=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){r=a[t];i[t]=n.charAt(r>>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t<e;t=t<<1);}else{for(t=16777216;t<e;t+=16777216);}return t};var v=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=n(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=o({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};v(e||64*1024);var m=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=n(e);var o=new Int32Array(t.heap,0,i>>2);a(o,e);s(o,e,r);return i};var _=function(e,r,n){u(e)(t.h8,t.h32,r,n,0)};var w=function(e,r,n,i,a){var o=n;if(a){o=g(n,i)}_(e,r,n);t.core.hash(o,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var y=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;m(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){w(e,n,i,r,false)}w(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return p(y(e).buffer)}}function o(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,o=0,s=0,f=0,c=0,l=0,u=0,d=0,p=0,h=0,v=0,m=0;a=n[t+320>>2]|0;s=n[t+324>>2]|0;c=n[t+328>>2]|0;u=n[t+332>>2]|0;p=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){o=a;f=s;l=c;d=u;h=p;for(i=0;(i|0)<64;i=i+4|0){m=n[r+i>>2]|0;v=((a<<5|a>>>27)+(s&c|~s&u)|0)+((m+p|0)+1518500249|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[e+i>>2]=m}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|~s&u)|0)+((m+p|0)+1518500249|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^u)|0)+((m+p|0)+1859775393|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|s&u|c&u)|0)+((m+p|0)-1894007588|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^u)|0)+((m+p|0)-899497514|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}a=a+o|0;s=s+f|0;c=c+l|0;u=u+d|0;p=p+h|0}n[t+320>>2]=a;n[t+324>>2]=s;n[t+328>>2]=c;n[t+332>>2]=u;n[t+336>>2]=p}return{hash:i}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],137:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=i;r.save=o;r.load=s;r.useColors=n;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function s(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(s());function f(){try{return window.localStorage}catch(e){}}},{"./debug":138}],138:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22,ms:139}],139:[function(e,t,r){var n=1e3;var i=n*60;var a=i*60;var o=a*24;var s=o*365.25;t.exports=function(e,t){t=t||{};if("string"==typeof e)return f(e);return t.long?l(e):c(e)};function f(e){e=""+e;if(e.length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*s;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function c(e){if(e>=o)return Math.round(e/o)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return u(e,o,"day")||u(e,a,"hour")||u(e,i,"minute")||u(e,n,"second")||e+" ms"}function u(e,t,r){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+r;return Math.ceil(e/t)+" "+r+"s"}},{}],140:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{asap:141,dup:30,wrappy:143}],141:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var o=n.makeRequestCallFromTimer(s);function s(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new c}t.task=e;n(t)}function c(){this.task=null}c.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);o()}}finally{this.task=null;i[i.length]=this}}},{"./raw":142}],142:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var o=0;var s=1024;function f(){while(o<n.length){var e=o;o=o+1;n[e].call();if(o>s){for(var t=0,r=n.length-o;t<r;t++){n[t]=n[t+o]}n.length-=o;o=0}}n.length=0;o=0;i=false}var c=e.MutationObserver||e.WebKitMutationObserver;if(typeof c==="function"){a=l(f)}else{a=u(f)}r.requestFlush=a;function l(e){var t=1;var r=new c(e);var n=document.createTextNode("");r.observe(n,{characterData:true});return function i(){t=-t;n.data=t}}function u(e){return function t(){var t=setTimeout(n,0);var r=setInterval(n,50);function n(){clearTimeout(t);clearInterval(r);e()}}}r.makeRequestCallFromTimer=u}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],143:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],144:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var s=function(e,t,r){if(typeof t==="function")return s(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var c=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var u=t.writable||t.writable!==false&&e.writable;var d=function(){if(!e.writable)p()};var p=function(){u=false;if(!l)r()};var h=function(){l=false;if(!u)r()};var v=function(e){r(e?new Error("exited with error code: "+e):null)};var m=function(){if(l&&!(c&&c.ended))return r(new Error("premature close"));if(u&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",p)};if(a(e)){e.on("complete",p);e.on("abort",m);if(e.req)g();else e.on("request",g)}else if(u&&!f){e.on("end",d);e.on("close",d)}if(o(e))e.on("exit",v);e.on("end",h);e.on("finish",p);if(t.error!==false)e.on("error",r);e.on("close",m);return function(){e.removeListener("complete",p);e.removeListener("abort",m);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",p);e.removeListener("end",d);e.removeListener("close",d);e.removeListener("finish",p);e.removeListener("exit",v);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",m)}};t.exports=s},{once:152}],145:[function(e,t,r){var n=t.exports=function(e,t){if(!t)t=16;if(e===undefined)e=128;if(e<=0)return"0";var r=Math.log(Math.pow(2,e))/Math.log(t);for(var i=2;r===Infinity;i*=2){r=Math.log(Math.pow(2,e/i))/Math.log(t)*i}var a=r-Math.floor(r);var o="";for(var i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*t).toString(t);o=s+o}if(a){var f=Math.pow(t,a);var s=Math.floor(Math.random()*f).toString(t);o=s+o}var c=parseInt(o,t);if(c!==Infinity&&c>=Math.pow(2,e)){return n(e,t)}else return o};n.rack=function(e,t,r){var i=function(i){var o=0;do{if(o++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var s=n(e,t)}while(Object.hasOwnProperty.call(a,s));a[s]=i;return s};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],146:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],147:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i<n.length;i++){if(r.env.DEBUG_MIME&&this.types[n]){console.warn(this._loading.replace(/.*\//,""),'changes "'+n[i]+'" extension type from '+this.types[n]+" to "+t)}this.types[n[i]]=t}if(!this.extensions[t]){this.extensions[t]=n[0]}}};a.prototype.load=function(e){this._loading=e;var t={},r=i.readFileSync(e,"ascii"),n=r.split(/[\r\n]+/);n.forEach(function(e){var r=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);t[r.shift()]=r});this.define(t);this._loading=null};a.prototype.lookup=function(e,t){var r=e.replace(/.*[\.\/\\]/,"").toLowerCase();return this.types[r]||t||this.default_type};a.prototype.extension=function(e){var t=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[t]};var o=new a;o.define(e("./types.json"));o.default_type=o.lookup("bin");o.Mime=a;o.charsets={lookup:function(e,t){return/^text\//.test(e)?"UTF-8":t}};t.exports=o}).call(this,e("_process"))},{"./types.json":148,_process:77,fs:49,path:76}],148:[function(e,t,r){t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],
-"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],149:[function(e,t,r){arguments[4][125][0].apply(r,arguments)},{dup:125,inherits:150,stream:93}],150:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],151:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],152:[function(e,t,r){arguments[4][36][0].apply(r,arguments)},{dup:36,wrappy:151}],153:[function(e,t,r){(function(r){t.exports=f;t.exports.remote=c;var n=e("dezalgo");var i=e("fs");var a=e("simple-get");var o=e("magnet-uri");var s=e("parse-torrent-file");t.exports.toMagnetURI=o.encode;t.exports.toTorrentFile=s.encode;function f(e){var t=e&&e.length;if(typeof e==="string"&&/magnet:/.test(e)){return o(e)}else if(typeof e==="string"&&(t===40||t===32)){return o("magnet:?xt=urn:btih:"+e)}else if(r.isBuffer(e)&&t===20){return o("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(r.isBuffer(e)){return s(e)}else if(e&&e.infoHash){if(!e.announce)e.announce=[];if(typeof e.announce==="string"){e.announce=[e.announce]}return e}else{throw new Error("Invalid torrent identifier")}}function c(e,t){var r;if(typeof t!=="function")throw new Error("second argument must be a Function");t=n(t);try{r=f(e)}catch(o){}if(r&&r.infoHash){t(null,r)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}s(r)})}else if(typeof i.readFile==="function"&&typeof e==="string"){i.readFile(e,function(e,r){if(e)return t(new Error("Invalid torrent identifier"));s(r)})}else{t(new Error("Invalid torrent identifier"))}function s(e){try{r=f(e)}catch(n){return t(n)}if(r&&r.infoHash)t(null,r);else t(new Error("Invalid torrent identifier"))}}}).call(this,e("buffer").Buffer)},{buffer:65,dezalgo:154,fs:49,"magnet-uri":158,"parse-torrent-file":163,"simple-get":51}],154:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{asap:155,dup:30,wrappy:157}],155:[function(e,t,r){arguments[4][141][0].apply(r,arguments)},{"./raw":156,dup:141}],156:[function(e,t,r){arguments[4][142][0].apply(r,arguments)},{dup:142}],157:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],158:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=s;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function o(e){var t={};var i=e.split("magnet:?")[1];var o=i&&i.length>=0?i.split("&"):[];o.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var s;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(s=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(s[1],"hex").toString("hex")}else if(s=e.match(/^urn:btih:(.{32})/)){var i=n.decode(s[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function s(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:65,"thirty-two":159,uniq:161,xtend:162}],159:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":160}],160:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var o=0;var s=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n<r.length){var c=r[n];if(o>3){s=c&255>>o;o=(o+5)%8;s=s<<o|(n+1<r.length?r[n+1]:0)>>8-o;n++}else{s=c>>8-(o+5)&31;o=(o+5)%8;if(o==0)n++}f[a]=t.charCodeAt(s);a++}for(n=a;n<f.length;n++)f[n]=61;return f};r.decode=function(t){var r=0;var i=0;var a;var o=0;if(!e.isBuffer(t)){t=new e(t)}var s=new e(Math.ceil(t.length*5/8));for(var f=0;f<t.length;f++){if(t[f]==61){break}var c=t[f]-48;if(c<n.length){i=n[c];if(r<=3){r=(r+5)%8;if(r==0){a|=i;s[o]=a;o++;a=0}else{a|=255&i<<8-r}}else{r=(r+5)%8;a|=255&i>>>r;s[o]=a;o++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return s.slice(0,o)}}).call(this,e("buffer").Buffer)},{buffer:65}],161:[function(e,t,r){"use strict";function n(e,t){var r=1,n=e.length,i=e[0],a=e[0];for(var o=1;o<n;++o){a=i;i=e[o];if(t(i,a)){if(o===r){r++;continue}e[r++]=i}}e.length=r;return e}function i(e){var t=1,r=e.length,n=e[0],i=e[0];for(var a=1;a<r;++a,i=n){i=n;n=e[a];if(n!==i){if(a===t){t++;continue}e[t++]=n}}e.length=t;return e}function a(e,t,r){if(e.length===0){return e}if(t){if(!r){e.sort(t)}return n(e,t)}if(!r){e.sort()}return i(e)}t.exports=a},{}],162:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],163:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var o=e("uniq");function s(e){if(r.isBuffer(e)){e=n.decode(e)}u(e.info,"info");u(e.info["name.utf-8"]||e.info.name,"info.name");u(e.info["piece length"],"info['piece length']");u(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){u(typeof e.length==="number","info.files[0].length");u(e["path.utf-8"]||e.path,"info.files[0].path")})}else{u(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce)}o(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var s=e.info.files||[e.info];t.files=s.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:s.slice(0,r).reduce(c,0)}});t.length=s.reduce(c,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function c(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r<e.length;r+=20){t.push(e.slice(r,r+20).toString("hex"))}return t}function u(e,t){if(!e)throw new Error("Torrent is missing required field: "+t)}}).call(this,e("buffer").Buffer)},{bencode:164,buffer:65,path:76,"simple-sha1":168,uniq:170}],164:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":165,"./lib/encode":167,dup:16}],165:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":166,buffer:65,dup:17}],166:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],167:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:65,dup:19}],168:[function(e,t,r){arguments[4][135][0].apply(r,arguments)},{dup:135,rusha:169}],169:[function(e,t,r){arguments[4][136][0].apply(r,arguments)},{dup:136}],170:[function(e,t,r){arguments[4][161][0].apply(r,arguments)},{dup:161}],171:[function(e,t,r){var n=e("once");var i=e("end-of-stream");var a=e("fs");var o=function(){};var s=function(e){return typeof e==="function"};var f=function(e){return(e instanceof(a.ReadStream||o)||e instanceof(a.WriteStream||o))&&s(e.close)};var c=function(e){return e.setHeader&&s(e.abort)};var l=function(e,t,r,a){a=n(a);var o=false;e.on("close",function(){o=true});i(e,{readable:t,writable:r},function(e){if(e)return a(e);o=true;a()});var l=false;return function(t){if(o)return;if(l)return;l=true;if(f(e))return e.close();if(c(e))return e.abort();if(s(e.destroy))return e.destroy();a(t||new Error("stream was destroyed"))}};var u=function(e){e()};var d=function(e,t){return e.pipe(t)};var p=function(){var e=Array.prototype.slice.call(arguments);var t=s(e[e.length-1]||o)&&e.pop()||o;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var n=e.map(function(i,a){var o=a<e.length-1;var s=a>0;return l(i,o,s,function(e){if(!r)r=e;if(e)n.forEach(u);if(o)return;n.forEach(u);t(r)})});return e.reduce(d)};t.exports=p},{"end-of-stream":144,fs:49,once:152}],172:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],173:[function(e,t,r){t.exports=i;t.exports.filter=a;var n=e("events").EventEmitter;function i(e,t,r){if(!Array.isArray(r))r=[r];var n=[];r.forEach(function(r){var i=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};n.push(i);e.on(r,i)});return function i(){r.forEach(function(t,r){e.removeListener(t,n[r])})}}function a(e,t){var r=new n;i(e,r,t);return r}},{events:69}],174:[function(e,t,r){arguments[4][131][0].apply(r,arguments)},{dezalgo:175,dup:131}],175:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{asap:176,dup:30,wrappy:177}],176:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{_process:77,dup:31}],177:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],178:[function(e,t,r){arguments[4][135][0].apply(r,arguments)},{dup:135,rusha:179}],179:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var o=function(e,t){for(var r=t>>2;r<e.length;r++)e[r]=0};var s=function(e,t,r){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,o,s=i%4,f=n%4,c=n-f;if(c>0){switch(s){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(o=s;o<c;o=o+4|0){t[i+o>>2]=a.charCodeAt(r+o)<<24|a.charCodeAt(r+o+1)<<16|a.charCodeAt(r+o+2)<<8|a.charCodeAt(r+o+3)}switch(f){case 3:e[i+c+1|0]=a.charCodeAt(r+c+2);case 2:e[i+c+2|0]=a.charCodeAt(r+c+1);case 1:e[i+c+3|0]=a.charCodeAt(r+c)}};var c=function(e,t,r,n,i){var a=this,o,s=i%4,f=n%4,c=n-f;if(c>0){switch(s){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(o=4-s;o<c;o=o+=4|0){t[i+o>>2]=a[r+o]<<24|a[r+o+1]<<16|a[r+o+2]<<8|a[r+o+3]}switch(f){case 3:e[i+c+1|0]=a[r+c+2];case 2:e[i+c+2|0]=a[r+c+1];case 1:e[i+c+3|0]=a[r+c]}};var l=function(e,t,r,n,a){var o=this,s,f=a%4,c=n%4,l=n-c;var u=new Uint8Array(i.readAsArrayBuffer(o.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=u[0];case 1:e[a+2|0]=u[1];case 2:e[a+1|0]=u[2];case 3:e[a|0]=u[3]}}for(s=4-f;s<l;s=s+=4|0){t[a+s>>2]=u[s]<<24|u[s+1]<<16|u[s+2]<<8|u[s+3]}switch(c){case 3:e[a+l+1|0]=u[l+2];case 2:e[a+l+2|0]=u[l+1];case 1:e[a+l+3|0]=u[l]}};var u=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return c.bind(e);case"buffer":return c.bind(e);case"arraybuffer":return c.bind(new Uint8Array(e));case"view":return c.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var d=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var p=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){r=a[t];i[t]=n.charAt(r>>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t<e;t=t<<1);}else{for(t=16777216;t<e;t+=16777216);}return t};var v=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};v(e||64*1024);var m=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);o(i,e);s(i,e,r);return n};var _=function(e,r,n){u(e)(t.h8,t.h32,r,n,0)};var w=function(e,r,n,i,a){var o=n;if(a){o=g(n,i)}_(e,r,n);t.core.hash(o,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);
-i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var y=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;m(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){w(e,n,i,r,false)}w(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return p(y(e).buffer)}}n._core=function o(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,o=0,s=0,f=0,c=0,l=0,u=0,d=0,p=0,h=0,v=0,m=0;a=n[t+320>>2]|0;s=n[t+324>>2]|0;c=n[t+328>>2]|0;u=n[t+332>>2]|0;p=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){o=a;f=s;l=c;d=u;h=p;for(i=0;(i|0)<64;i=i+4|0){m=n[r+i>>2]|0;v=((a<<5|a>>>27)+(s&c|~s&u)|0)+((m+p|0)+1518500249|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[e+i>>2]=m}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|~s&u)|0)+((m+p|0)+1518500249|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^u)|0)+((m+p|0)+1859775393|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|s&u|c&u)|0)+((m+p|0)-1894007588|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){m=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^u)|0)+((m+p|0)-899497514|0)|0;p=u;u=c;c=s<<30|s>>>2;s=a;a=v;n[i>>2]=m}a=a+o|0;s=s+f|0;c=c+l|0;u=u+d|0;p=p+h|0}n[t+320>>2]=a;n[t+324>>2]=s;n[t+328>>2]=c;n[t+332>>2]=u;n[t+336>>2]=p}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function s(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],180:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],181:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("torrent-discovery");var i=e("bittorrent-dht/client");var a=e("events").EventEmitter;var o=e("xtend/mutable");var s=e("inherits");var f=e("re-emitter");var c=e("bittorrent-tracker/client");s(l,a);function l(e){var t=this;if(!(t instanceof l))return new l(e);a.call(t);o(t,{announce:[],dht:typeof i==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}l.prototype.setTorrent=function(e){var t=this;if(t.torrent)return;if(e&&e.infoHash){t.torrent=e;t.infoHash=e.infoHash}else{if(t.infoHash)return;t.infoHash=e}n("setTorrent %s",t.infoHash);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};l.prototype.stop=function(e){var t=this;if(t.tracker){if(t.tracker.stop)t.tracker.stop();if(t.tracker.destroy)t.tracker.destroy()}if(!t._externalDHT&&t.dht&&t.dht.destroy)t.dht.destroy(e);else r.nextTick(function(){e(null)})};l.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new i;f(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHash)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};l.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHash,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);f(e.tracker,e,["peer","warning","error"]);e.tracker.start()};l.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;n("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;n("dht announce");e.dht.announce(e.infoHash,e.port,function(){n("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"))},{_process:77,"bittorrent-dht/client":51,"bittorrent-tracker/client":182,debug:195,events:69,inherits:199,"re-emitter":200,"xtend/mutable":201}],182:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("bittorrent-tracker");var a=e("events").EventEmitter;var o=e("inherits");var s=e("once");var f=e("url");var c=e("./lib/common");var l=e("./lib/http-tracker");var u=e("./lib/udp-tracker");var d=e("./lib/websocket-tracker");o(p,a);function p(e,t,o,s){var h=this;if(!(h instanceof p))return new p(e,t,o,s);a.call(h);if(!s)s={};h._peerId=n.isBuffer(e)?e:new n(e,"hex");h._peerIdHex=h._peerId.toString("hex");h._peerIdBinary=h._peerId.toString("binary");h._infoHash=n.isBuffer(o.infoHash)?o.infoHash:new n(o.infoHash,"hex");h._infoHashHex=h._infoHash.toString("hex");h._infoHashBinary=h._infoHash.toString("binary");h._port=t;h.torrentLength=o.length;h._rtcConfig=s.rtcConfig;h._wrtc=s.wrtc;h._numWant=s.numWant||c.DEFAULT_ANNOUNCE_PEERS;h._intervalMs=s.interval||c.DEFAULT_ANNOUNCE_INTERVAL;i("new client %s",h._infoHashHex);var v={interval:h._intervalMs};var m=!!h._wrtc||typeof window!=="undefined";var g=typeof o.announce==="string"?[o.announce]:o.announce==null?[]:o.announce;h._trackers=g.map(function(e){e=e.toString();var t=f.parse(e).protocol;if((t==="http:"||t==="https:")&&typeof l==="function"){return new l(h,e,v)}else if(t==="udp:"&&typeof u==="function"){return new u(h,e,v)}else if((t==="ws:"||t==="wss:")&&m){return new d(h,e,v)}else{r.nextTick(function(){var t=new Error("unsupported tracker protocol for "+e);h.emit("warning",t)})}return null}).filter(Boolean)}p.scrape=function(e,t,r){r=s(r);var i=new n("01234567890123456789");var a=6881;var o={infoHash:Array.isArray(t)?t[0]:t,announce:[e]};var f=new p(i,a,o);f.once("error",r);var c=Array.isArray(t)?t.length:1;var l={};f.on("scrape",function(e){c-=1;l[e.infoHash]=e;if(c===0){f.destroy();var t=Object.keys(l);if(t.length===1){r(null,l[t[0]])}else{r(null,l)}}});t=Array.isArray(t)?t.map(function(e){return new n(e,"hex")}):new n(t,"hex");f.scrape({infoHash:t})};p.prototype.start=function(e){var t=this;i("send `start`");e=t._defaultAnnounceOpts(e);e.event="started";t._announce(e);t._trackers.forEach(function(e){e.setInterval(t._intervalMs)})};p.prototype.stop=function(e){var t=this;i("send `stop`");e=t._defaultAnnounceOpts(e);e.event="stopped";t._announce(e)};p.prototype.complete=function(e){var t=this;i("send `complete`");if(!e)e={};if(e.downloaded==null&&t.torrentLength!=null){e.downloaded=t.torrentLength}e=t._defaultAnnounceOpts(e);e.event="completed";t._announce(e)};p.prototype.update=function(e){var t=this;i("send `update`");e=t._defaultAnnounceOpts(e);if(e.event)delete e.event;t._announce(e)};p.prototype._announce=function(e){var t=this;t._trackers.forEach(function(t){t.announce(e)})};p.prototype.scrape=function(e){var t=this;i("send `scrape`");if(!e)e={};t._trackers.forEach(function(t){t.scrape(e)})};p.prototype.setInterval=function(e){var t=this;i("setInterval");t._intervalMs=e;t._trackers.forEach(function(t){t.setInterval(e)})};p.prototype.destroy=function(){var e=this;i("destroy");e._trackers.forEach(function(e){e.destroy();e.setInterval(0)});e._trackers=[]};p.prototype._defaultAnnounceOpts=function(e){var t=this;if(!e)e={};if(e.numWant==null)e.numWant=t._numWant;if(e.uploaded==null)e.uploaded=0;if(e.downloaded==null)e.downloaded=0;if(e.left==null&&t.torrentLength!=null){e.left=t.torrentLength-e.downloaded}return e}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/common":184,"./lib/http-tracker":51,"./lib/udp-tracker":51,"./lib/websocket-tracker":185,_process:77,buffer:65,debug:195,events:69,inherits:199,once:187,url:95}],183:[function(e,t,r){(function(t){var n=e("querystring");r.IPV4_RE=/^[\d\.]+$/;r.IPV6_RE=/^[\da-fA-F:]+$/;r.CONNECTION_ID=t.concat([i(1047),i(655366528)]);r.ACTIONS={CONNECT:0,ANNOUNCE:1,SCRAPE:2,ERROR:3};r.EVENTS={update:0,completed:1,started:2,stopped:3};r.EVENT_IDS={0:"update",1:"completed",2:"started",3:"stopped"};r.EVENT_NAMES={update:"update",completed:"complete",started:"start",stopped:"stop"};function i(e){var r=new t(4);r.writeUInt32BE(e,0);return r}r.toUInt32=i;r.querystringParse=function(e){var t=n.unescape;n.unescape=unescape;var r=n.parse(e);n.unescape=t;return r};r.querystringStringify=function(e){var t=n.escape;n.escape=escape;var r=n.stringify(e);r=r.replace(/[\@\*\/\+]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});n.escape=t;return r}}).call(this,e("buffer").Buffer)},{buffer:65,querystring:81}],184:[function(e,t,r){(function(t){var n=e("xtend/mutable");r.DEFAULT_ANNOUNCE_INTERVAL=30*60*1e3;r.DEFAULT_ANNOUNCE_PEERS=50;r.MAX_ANNOUNCE_PEERS=82;r.binaryToHex=function(e){return new t(e,"binary").toString("hex")};r.hexToBinary=function(e){return new t(e,"hex").toString("binary")};var i=e("./common-node");n(r,i)}).call(this,e("buffer").Buffer)},{"./common-node":183,buffer:65,"xtend/mutable":201}],185:[function(e,t,r){t.exports=p;var n=e("debug")("bittorrent-tracker:websocket-tracker");var i=e("events").EventEmitter;var a=e("hat");var o=e("inherits");var s=e("simple-peer");var f=e("simple-websocket");var c=e("./common");var l={};var u=30*1e3;var d=5*1e3;o(p,i);function p(e,t,r){var a=this;i.call(a);n("new websocket tracker %s",t);a.client=e;a.destroyed=false;a._opts=r;if(t[t.length-1]==="/"){t=t.substring(0,t.length-1)}a._announceUrl=t;a._peers={};a._socket=null;a._intervalMs=a.client._intervalMs;a._interval=null;a._openSocket()}p.prototype.announce=function(e){var t=this;if(t.destroyed)return;if(!t._socket.connected){return t._socket.once("connect",t.announce.bind(t,e))}e.info_hash=t.client._infoHashBinary;e.peer_id=t.client._peerIdBinary;if(e.numWant>10)e.numWant=10;t._generateOffers(e.numWant,function(r){e.offers=r;if(t._trackerId){e.trackerid=t._trackerId}t._send(e)})};p.prototype.scrape=function(e){var t=this;if(t.destroyed)return;t._onSocketError(new Error("scrape not supported "+t._announceUrl))};p.prototype.setInterval=function(e){var t=this;clearInterval(t._interval);t._intervalMs=e;if(e){var r=t.announce.bind(t,t.client._defaultAnnounceOpts());t._interval=setInterval(r,t._intervalMs)}};p.prototype.destroy=function(){var e=this;if(e.destroyed)return;e.destroyed=true;e._socket.removeListener("data",e._onSocketDataBound);e._socket.removeListener("close",e._onSocketCloseBound);e._socket.removeListener("error",e._onSocketErrorBound);e._onSocketErrorBound=null;e._onSocketDataBound=null;e._onSocketCloseBound=null;e._socket.on("error",h);try{e._socket.close()}catch(t){}e._socket=null};p.prototype._openSocket=function(){var e=this;e._onSocketErrorBound=e._onSocketError.bind(e);e._onSocketDataBound=e._onSocketData.bind(e);e._onSocketCloseBound=e._onSocketClose.bind(e);e._socket=l[e._announceUrl];if(!e._socket){e._socket=l[e._announceUrl]=new f(e._announceUrl)}e._socket.on("data",e._onSocketDataBound);e._socket.on("close",e._onSocketCloseBound);e._socket.on("error",e._onSocketErrorBound)};p.prototype._onSocketData=function(e){var t=this;if(t.destroyed)return;if(!(typeof e==="object"&&e!==null)){return t.client.emit("warning",new Error("Invalid tracker response"))}if(e.info_hash!==t.client._infoHashBinary){n("ignoring websocket data from %s for %s (looking for %s: reused socket)",t._announceUrl,c.binaryToHex(e.info_hash),t.client._infoHashHex);return}if(e.peer_id&&e.peer_id===t.client._peerIdBinary){return}n("received %s from %s for %s",JSON.stringify(e),t._announceUrl,t.client._infoHashHex);var r=e["failure reason"];if(r)return t.client.emit("warning",new Error(r));var i=e["warning message"];if(i)t.client.emit("warning",new Error(i));var a=e.interval||e["min interval"];if(a&&!t._opts.interval&&t._intervalMs!==0){t.setInterval(a*1e3)}var o=e["tracker id"];if(o){t._trackerId=o}if(e.complete){t.client.emit("update",{announce:t._announceUrl,complete:e.complete,incomplete:e.incomplete})}var f;if(e.offer&&e.peer_id){f=new s({trickle:false,config:t.client._rtcConfig,wrtc:t.client._wrtc});f.id=c.binaryToHex(e.peer_id);f.once("signal",function(r){var n={info_hash:t.client._infoHashBinary,peer_id:t.client._peerIdBinary,to_peer_id:e.peer_id,answer:r,offer_id:e.offer_id};if(t._trackerId)n.trackerid=t._trackerId;t._send(n)});f.signal(e.offer);t.client.emit("peer",f)}if(e.answer&&e.peer_id){f=t._peers[c.binaryToHex(e.offer_id)];if(f){f.id=c.binaryToHex(e.peer_id);f.signal(e.answer);t.client.emit("peer",f)}else{n("got unexpected answer: "+JSON.stringify(e.answer))}}};p.prototype._onSocketClose=function(){var e=this;if(e.destroyed)return;e.destroy();e._startReconnectTimer()};p.prototype._onSocketError=function(e){var t=this;if(t.destroyed)return;t.destroy();t.client.emit("warning",e);t._startReconnectTimer()};p.prototype._startReconnectTimer=function(){var e=this;var t=Math.floor(Math.random()*u)+d;setTimeout(function(){e.destroyed=false;e._openSocket()},t);n("reconnecting socket in %s ms",t)};p.prototype._send=function(e){var t=this;if(t.destroyed)return;var r=JSON.stringify(e);n("send %s",r);t._socket.send(r)};p.prototype._generateOffers=function(e,t){var r=this;var i=[];n("generating %s offers",e);for(var o=0;o<e;++o){f()}function f(){var e=a(160);var t=r._peers[e]=new s({initiator:true,trickle:false,config:r.client._rtcConfig,wrtc:r.client._wrtc});t.once("signal",function(t){i.push({offer:t,offer_id:c.hexToBinary(e)});l()})}function l(){if(i.length===e){n("generated %s offers",e);t(i)}}};function h(){}},{"./common":184,debug:195,events:69,hat:198,inherits:199,"simple-peer":188,"simple-websocket":192}],186:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],187:[function(e,t,r){arguments[4][36][0].apply(r,arguments)},{dup:36,wrappy:186}],188:[function(e,t,r){(function(r){t.exports=u;var n=e("debug")("simple-peer");var i=e("get-browser-rtc");var a=e("hat");var o=e("inherits");var s=e("is-typedarray");var f=e("once");var c=e("stream");var l=e("typedarray-to-buffer");o(u,c.Duplex);function u(e){var t=this;if(!(t instanceof u))return new u(e);t._debug("new peer %o",e);if(!e)e={};e.allowHalfOpen=false;if(e.highWaterMark==null)e.highWaterMark=1024*1024;c.Duplex.call(t,e);t.initiator=e.initiator||false;t.channelConfig=e.channelConfig||u.channelConfig;t.channelName=e.channelName||a(160);if(!e.initiator)t.channelName=null;t.config=e.config||u.config;t.constraints=e.constraints||u.constraints;t.reconnectTimer=e.reconnectTimer||0;t.sdpTransform=e.sdpTransform||function(e){return e};t.stream=e.stream||false;t.trickle=e.trickle!==undefined?e.trickle:true;t.destroyed=false;t.connected=false;t.remoteAddress=undefined;t.remoteFamily=undefined;t.remotePort=undefined;t.localAddress=undefined;t.localPort=undefined;t._wrtc=e.wrtc||i();if(!t._wrtc){if(typeof window==="undefined"){throw new Error("No WebRTC support: Specify `opts.wrtc` option in this environment")}else{throw new Error("No WebRTC support: Not a supported browser")}}t._maxBufferedAmount=e.highWaterMark;t._pcReady=false;t._channelReady=false;t._iceComplete=false;t._channel=null;t._chunk=null;t._cb=null;t._interval=null;t._reconnectTimeout=null;t._pc=new t._wrtc.RTCPeerConnection(t.config,t.constraints);t._pc.oniceconnectionstatechange=t._onIceConnectionStateChange.bind(t);t._pc.onsignalingstatechange=t._onSignalingStateChange.bind(t);t._pc.onicecandidate=t._onIceCandidate.bind(t);if(t.stream)t._pc.addStream(t.stream);t._pc.onaddstream=t._onAddStream.bind(t);if(t.initiator){t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)});t._pc.onnegotiationneeded=f(t._createOffer.bind(t));if(typeof window==="undefined"||!window.webkitRTCPeerConnection){t._pc.onnegotiationneeded()}}else{t._pc.ondatachannel=t._setupData.bind(t)}t.on("finish",function(){if(t.connected){setTimeout(function(){t._destroy()},100)}else{t.once("connect",function(){setTimeout(function(){t._destroy()},100)})}})}u.WEBRTC_SUPPORT=!!i();u.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]};u.constraints={};u.channelConfig={};Object.defineProperty(u.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}});u.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}};u.prototype.signal=function(e){var t=this;if(t.destroyed)throw new Error("cannot signal after peer is destroyed");if(typeof e==="string"){try{e=JSON.parse(e)}catch(r){e={}}}t._debug("signal()");if(e.sdp){t._pc.setRemoteDescription(new t._wrtc.RTCSessionDescription(e),function(){if(t.destroyed)return;if(t._pc.remoteDescription.type==="offer")t._createAnswer()},t._onError.bind(t))}if(e.candidate){try{t._pc.addIceCandidate(new t._wrtc.RTCIceCandidate(e.candidate),d,t._onError.bind(t))}catch(r){t._destroy(new Error("error adding candidate: "+r.message))}}if(!e.sdp&&!e.candidate){t._destroy(new Error("signal() called with invalid signal data"))}};u.prototype.send=function(e){var t=this;if(!s.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}if(r.isBuffer(e)&&!s.strict(e)){e=new Uint8Array(e)}var n=e.length||e.byteLength||e.size;t._channel.send(e);t._debug("write: %d bytes",n)};u.prototype.destroy=function(e){var t=this;t._destroy(null,e)};u.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);r._debug("destroy (error: %s)",e&&e.message);r.readable=r.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.destroyed=true;r.connected=false;r._pcReady=false;r._channelReady=false;r._chunk=null;r._cb=null;clearInterval(r._interval);clearTimeout(r._reconnectTimeout);if(r._pc){try{r._pc.close()}catch(e){}r._pc.oniceconnectionstatechange=null;r._pc.onsignalingstatechange=null;r._pc.onicecandidate=null}if(r._channel){try{r._channel.close()}catch(e){}r._channel.onmessage=null;r._channel.onopen=null;r._channel.onclose=null}r._pc=null;r._channel=null;if(e)r.emit("error",e);r.emit("close")};u.prototype._setupData=function(e){var t=this;t._channel=e.channel;t.channelName=t._channel.label;t._channel.binaryType="arraybuffer";t._channel.onmessage=t._onChannelMessage.bind(t);t._channel.onopen=t._onChannelOpen.bind(t);t._channel.onclose=t._onChannelClose.bind(t)};u.prototype._read=function(){};u.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after peer is destroyed"));if(n.connected){try{n.send(e)}catch(i){return n._onError(i)}if(n._channel.bufferedAmount>n._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};u.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,d,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};u.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,d,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};u.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};u.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remoteFamily="IPv4";e.remotePort=Number(t.portNumber);e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};u.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};u.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};u.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};u.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};u.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};u.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};u.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};u.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function d(){}}).call(this,e("buffer").Buffer)},{buffer:65,debug:195,"get-browser-rtc":189,hat:198,inherits:199,"is-typedarray":190,once:187,stream:93,"typedarray-to-buffer":191}],189:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],190:[function(e,t,r){t.exports=a;a.strict=o;a.loose=s;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return o(e)||s(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return i[n.call(e)]}},{}],191:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{buffer:65,dup:119,"is-typedarray":190}],192:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var o=e("stream");var s=e("typedarray-to-buffer");var f=e("ws");var c=typeof window!=="undefined"?window.WebSocket:f;i(l,o.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;o.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new c(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){try{r._ws.close()}catch(e){}r._ws.onopen=null;r._ws.onmessage=null;r._ws.onclose=null;r._ws.onerror=null}r._ws=null;if(e)r.emit("error",e);r.emit("close")};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=s(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:65,debug:195,inherits:199,"is-typedarray":193,stream:93,"typedarray-to-buffer":194,ws:51}],193:[function(e,t,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],194:[function(e,t,r){arguments[4][119][0].apply(r,arguments)},{buffer:65,dup:119,"is-typedarray":193}],195:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{"./debug":196,dup:137}],196:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22,ms:197}],197:[function(e,t,r){arguments[4][139][0].apply(r,arguments)},{dup:139}],198:[function(e,t,r){arguments[4][145][0].apply(r,arguments)},{dup:145}],199:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],200:[function(e,t,r){arguments[4][173][0].apply(r,arguments)},{dup:173,events:69}],201:[function(e,t,r){t.exports=n;function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(r.hasOwnProperty(n)){e[n]=r[n]}}}return e}},{}],202:[function(e,t,r){arguments[4][161][0].apply(r,arguments)},{dup:161}],203:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var o=e("inherits");var s=e("simple-sha1");var f=1e7;var c=1e3;var l=16*1024;t.exports=function(e){o(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:c});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(o){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==s.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){
-this.metadata=new r(this._metadataSize);for(var e=0;e<this._numPieces;e++){this._request(e)}};t.prototype._checkDone=function(){var e=true;for(var t=0;t<this._numPieces;t++){if(!this._bitfield.get(t)){e=false;break}}if(!e)return;var r=this.setMetadata(this.metadata);if(!r){this._failedMetadata()}};t.prototype._failedMetadata=function(){this._bitfield=new i(0,{grow:c});this._remainingRejects-=this._numPieces;if(this._remainingRejects>0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:204,bitfield:208,buffer:65,events:69,inherits:209,"simple-sha1":210}],204:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":205,"./lib/encode":207,dup:16}],205:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":206,buffer:65,dup:17}],206:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],207:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:65,dup:19}],208:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{buffer:65,dup:9}],209:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],210:[function(e,t,r){arguments[4][135][0].apply(r,arguments)},{dup:135,rusha:211}],211:[function(e,t,r){arguments[4][136][0].apply(r,arguments)},{dup:136}],212:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],213:[function(e,t,r){t.exports=function n(e,t,r){if(t===undefined){return function(t,r){return n(e,t,r)}}if(r===undefined)r="0";e-=t.toString().length;if(e>0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],214:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.51.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^5.0.0",brfs:"^1.2.0",browserify:"^10.0.0",finalhandler:"^0.3.6","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],215:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var o=e("debug")("webtorrent");var s=e("bittorrent-dht/client");var f=e("events").EventEmitter;var c=e("xtend");var l=e("hat");var u=e("inherits");var d=e("load-ip-set");var p=e("run-parallel");var h=e("parse-torrent");var v=e("speedometer");var m=e("zero-fill");var g=e("path");var _=e("./lib/fs-storage");var w=e("./lib/storage");var b=e("./lib/torrent");u(k,f);var y=e("./package.json").version;var x=y.match(/([0-9]+)/g).slice(0,2).map(m(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!o.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=v();t.uploadSpeed=v();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof _==="function"?_:w;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof s==="function"){t.dht=new s(c({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}o("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof d==="function"){d(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i<a;i++){var o=t.torrents[i];if(o.infoHash===r.infoHash)return o}return null};k.prototype.add=k.prototype.download=function(e,t,n){var i=this;if(i.destroyed)throw new Error("client is destroyed");o("add");if(typeof t==="function"){n=t;t={}}if(!t)t={};if(!t.storage)t.storage=i.storage;t.client=i;var a=i.get(e);function s(){o("on torrent");if(typeof n==="function")n(a)}if(a){if(a.ready)r.nextTick(s);else a.on("ready",s)}else{a=new b(e,t);i.torrents.push(a);a.on("error",function(e){i.emit("error",e,a);i.remove(a)});a.on("listening",function(e){i.emit("listening",e,a)});a.on("ready",function(){s();i.emit("torrent",a)})}return a};k.prototype.seed=function(e,t,r){var n=this;if(n.destroyed)throw new Error("client is destroyed");o("seed");if(typeof t==="function"){r=t;t={}}if(!t)t={};t.noVerify=true;t.createdBy="WebTorrent/"+y;if(typeof e==="string"&&!t.path)t.path=g.dirname(e);var i;var s=n.add(undefined,t,function(e){var t=[function(t){e.storage.load(i,t)}];if(n.dht){t.push(function(t){e.on("dhtAnnounce",t)})}p(t,function(t){if(t)return n.emit("error",t);f();n.emit("seed",e)})});a.parseInput(e,t,function(r,o){if(r)return n.emit("error",r);i=o.map(function(e){return e.getStream});a(e,t,function(e,t){if(e)return n.emit("error",e);if(n.destroyed)return;var r=n.get(t);if(r){s.destroy();f();return}else{s._onTorrentId(t)}})});function f(){o("on seed");if(typeof r==="function")r(s)}return s};k.prototype.remove=function(e,t){var r=this;var n=r.get(e);if(!n)throw new Error("No torrent with id "+e);o("remove");r.torrents.splice(r.torrents.indexOf(n),1);n.destroy(t)};k.prototype.address=function(){var e=this;return{address:"0.0.0.0",family:"IPv4",port:e.torrentPort}};k.prototype.destroy=function(e){var t=this;t.destroyed=true;o("destroy");var r=t.torrents.map(function(e){return function(r){t.remove(e,r)}});if(t.dht){r.push(function(e){t.dht.destroy(e)})}p(r,e)}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{"./lib/fs-storage":51,"./lib/storage":6,"./lib/torrent":7,"./package.json":214,_process:77,"bittorrent-dht/client":51,buffer:65,"create-torrent":98,debug:137,events:69,hat:145,inherits:146,"load-ip-set":51,"parse-torrent":153,path:76,"run-parallel":174,speedometer:180,xtend:212,"zero-fill":213}]},{},[215])(215)});
+(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=t[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return i(r?r:t)},u,u.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,r){var i=e("debug")("webtorrent:append-to");var n=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var l=[".mp4",".m4v",".webm"];var u=[".m4a",".mp3"];var c=l.concat(u);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=n(r);var u;var v=s.extname(e.name).toLowerCase();if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)g();else if(p.indexOf(v)>=0)y();else if(d.indexOf(v)>=0)b();else if(h.indexOf(v)>=0)w();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function g(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var n=l.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){i("Use `videostream` package for "+e.name);g();u.addEventListener("error",d);u.addEventListener("playing",_);o(e,u);y()}function c(){i("Use MediaSource API for "+e.name);g();u.addEventListener("error",h);u.addEventListener("playing",_);e.createReadStream().pipe(new a(u,{extname:v}));y()}function p(){i("Use Blob URL for "+e.name);g();u.addEventListener("error",x);u.addEventListener("playing",_);y();e.getBlobURL(function(e,t){if(e)return x(e);u.src=t})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",_);c()}function h(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",h);u.removeEventListener("playing",_);p()}function g(){if(u)u.remove();u=window.elem=document.createElement(n);u.controls=true;u.autoplay=true}function y(){t.appendChild(u);u.play()}}function _(){u.removeEventListener("playing",_);r(null,u)}function y(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return x(e);u.addEventListener("error",x);u.addEventListener("playing",_);u.src=t;u.play()})}function b(){e.getBlobURL(function(i,n){if(i)return x(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function w(){e.getBlobURL(function(e,i){if(e)return x(e);u=document.createElement("iframe");u.src=i;if(v!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function x(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}}},{"./media-stream":3,debug:138,dezalgo:141,path:77,videostream:237}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);i("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var n=t.start+e.offset;var o=t.pieceLength;r.startPiece=n/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=n-r.startPiece*o}s.prototype._read=function(){var e=this;i("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;i("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,n){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing<n.length){n=n.slice(0,e._missing)}e._missing-=n.length;i("pushing buffer of length %s",n.length);e._reading=false;e.push(n);if(e._missing===0)e.push(null)})};s.prototype.destroy=function(){var e=this;if(e.destroyed)return;e.destroyed=true;e._storage.emit("deselect",e.startPiece,e.endPiece,true)}},{debug:138,inherits:147,stream:94}],3:[function(e,t,r){t.exports=o;var i=e("debug")("webtorrent:media-source-stream");var n=e("inherits");var a=e("stream");var s=typeof window!=="undefined"&&window.MediaSource;n(o,a.Writable);function o(e,t){var r=this;if(!(r instanceof o))return new o(e,t);a.Writable.call(r,t);if(!s)throw new Error("web browser lacks MediaSource support");if(!t)t={};i("new MediaSourceStream %s %s",e,JSON.stringify(t));r._elem=e;r._mediaSource=new s;r._sourceBuffer=null;r._cb=null;r._type=t.type||f(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(s.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){i("finish");r._mediaSource.endOfStream()});window.vs=r}o.prototype._write=function(e,t,r){var n=this;if(!n._sourceBuffer){n._cb=function(i){if(i)return r(i);n._write(e,t,r)};return}if(n._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}n._sourceBuffer.appendBuffer(e);i("appendBuffer %s",e.length);n._cb=r};o.prototype._flow=function(){var e=this;i("flow");if(e._cb){e._cb(null)}};function f(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{debug:138,inherits:147,stream:94}],4:[function(e,t,r){t.exports={".aac":"audio/aac",".css":"text/css",".html":"text/html",".js":"application/javascript",".m4a":"audio/mp4",".md":"text/x-markdown",".mp3":"audio/mpeg",".mp4":"video/mp4",".oga":"audio/ogg",".ogg":"audio/ogg",".pdf":"application/pdf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm"}},{}],5:[function(e,t,r){t.exports=i;function i(e,t){var r=this;r.swarm=e;r.numPieces=t;function i(e){e.on("have",function(e){r.pieces[e]++});e.on("bitfield",r.recalculate.bind(r));e.on("close",function(){for(var t=0;t<r.numPieces;++t){r.pieces[t]-=e.peerPieces.get(t)}})}r.swarm.wires.forEach(i);r.swarm.on("wire",function(e){r.recalculate();i(e)});r.recalculate()}i.prototype.recalculate=function(){var e=this;e.pieces=[];for(var t=0;t<e.numPieces;++t){e.pieces[t]=0}e.swarm.wires.forEach(function(t){for(var r=0;r<e.numPieces;++r){e.pieces[r]+=t.peerPieces.get(r)}})};i.prototype.getRarestPiece=function(e){var t=this;var r=[];var i=Infinity;e=e||function(){return true};for(var n=0;n<t.numPieces;++n){if(!e(n))continue;var a=t.pieces[n];if(a===i){r.push(n)}else if(a<i){r=[n];i=a}}if(r.length>0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");t.exports=function l(e,t){var r=n.createServer(t);r.on("connection",function(e){e.setTimeout(36e6)});r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)l();else e.once("ready",l);function l(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'<li><a href="/'+t+'">'+e.name+"</a></li>"}).join("<br>");return r.end("<h1>WebTorrent</h1><ol>"+f+"</ol>")}var l=Number(n.slice(1));if(Number.isNaN(l)||l>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var u=e.files[l];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(u.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(u.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+u.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",u.length)}if(t.method==="HEAD")r.end();s(u.createReadStream(c),r)}});return r}},{debug:138,http:71,mime:148,pump:172,"range-parser":173,url:96}],7:[function(e,t,r){(function(i,n){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var l=e("dezalgo");var u=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var _=e("simple-sha1");var y=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,i){var n=this;c.call(n);if(!f.enabled)n.setMaxListeners(0);n.index=e;n.hash=t;n.noVerify=!!i;if(typeof r==="number"){n.buffer=null;n.length=r}else{n.buffer=r;n.length=r.length}n._reset()}S.prototype.readBlock=function(e,t,r){var i=this;r=l(r);if(!i.buffer||!i._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,i.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var i=this;r=l(r);if(!i._verifyOffset(e)||!i._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}i._lazyAllocBuffer();var n=e/y;if(i.blocks[n]===x){return r(null)}t.copy(i.buffer,e);i.blocks[n]=x;i.blocksWritten+=1;if(i.blocksWritten===i.blocks.length){i.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var i=0;i<r;i++){if(t.blocks[i]&&!e||t.blocks[i]===x){continue}t.blocks[i]=w;return{offset:i*y,length:i===r-1?t.length-i*y:y}}return null};S.prototype.cancelBlock=function(e){var t=this;if(!t._verifyOffset(e)){return false}var r=e/y;if(t.blocks[r]===w){t.blocks[r]=b}return true};S.prototype._reset=function(){var e=this;e.verified=false;e.blocks=new n(Math.ceil(e.length/y));if(!i.browser)e.blocks.fill(0);e.blocksWritten=0};S.prototype.verify=function(e){var t=this;if(!e)e=t.buffer;if(t.verified||!e){return}if(t.noVerify){t.verified=true;r();return}_(e,function(e){t.verified=e===t.hash;r()});function r(){if(t.verified){t.emit("done")}else{t.emit("warning",new Error("piece "+t.index+" failed verification"));t._reset()}}};S.prototype._verifyOffset=function(e){var t=this;if(e%y===0){return true}else{t.emit("warning",new Error("invalid block offset "+e+", not multiple of "+y));return false}};S.prototype._verifyBlock=function(e,t){var r=this;if(t.length===y){return true}else if(t.length===r.length-e&&r.length-e<y){return true}else{r.emit("warning",new Error("invalid block size "+t.length));return false}};S.prototype._lazyAllocBuffer=function(){var e=this;if(!e.buffer)e.buffer=new n(e.length)};d(E,c);function E(e,t,r,i){var n=this;c.call(n);if(!f.enabled)n.setMaxListeners(0);n.storage=e;n.name=t.name;n.path=t.path;n.length=t.length;n.offset=t.offset;n.pieces=r;n.pieceLength=i;n.done=false;n._blobUrl=null;n._blobUrlPending=false;n.pieces.forEach(function(e){e.on("done",function(){n._checkDone()})});n._checkDone()}E.prototype.select=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));u(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=l(v(e));var r;if(t.storage.buffer){var i=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)i();else t.once("done",i)}else{r=new n(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=l(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,i){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var n=h[g.extname(t.name).toLowerCase()];var a=n?new window.Blob([i],{type:n}):new window.Blob([i]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){i.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new n(e.length)}var i=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,n){var s=n*i;var f=s+(n===o-1?a:i);var l=r.buffer?r.buffer.slice(s,f):f-s;var u=new S(n,e,l,!!t.noVerify);u.on("done",r._onPieceDone.bind(r,u));return u});r.files=e.files.map(function(e){var t=e.offset;var n=t+e.length-1;var a=t/i|0;var s=n/i|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,i);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=y;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var i=0;var n=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});n.on("error",f);r.once("done",l);n.pipe(a).on("data",s).on("error",f);function s(e){var t=i;i+=1;var n=0;var a=new o(y,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var i=n*y;n+=1;r.writeBlock(t,i,e)}function f(){l()}function l(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){u();t(e)}function l(){u();t(null)}function u(){n.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",l)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*y)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,i=e.pieces.length;r<i;r++){t-=e.bitfield.get(r)}return t}});A.prototype.readBlock=function(e,t,r,i){var n=this;i=l(i);var a=n.pieces[e];if(!a)return i(new Error("invalid piece index "+e));a.readBlock(t,r,i)};A.prototype.writeBlock=function(e,t,r,i){var n=this;if(!i)i=k;i=l(i);if(n.readonly)return i(new Error("cannot write to readonly storage"));var a=n.pieces[e];if(!a)return i(new Error("invalid piece index "+e));a.writeBlock(t,r,i)};A.prototype.read=function(e,t,r,i){var a=this;if(typeof t==="function"){i=r;r=t;t=null}r=l(r);var s=a.pieces[e];if(!s){return r(new Error("invalid piece index "+e))}if(!s.verified&&!i){return r(new Error("Storage.read called on incomplete piece "+e))}var o=0;var f=s.length;if(t){o=t.offset||0;f=t.length||f}if(s.buffer){return r(null,s.buffer.slice(o,o+f))}var u=[];function c(){if(f<=0)return r(null,n.concat(u));var t=o;var i=Math.min(y,f);o+=i;f-=i;a.readBlock(e,t,i,function(e,t){if(e)return r(e);u.push(t);c()})}c()};A.prototype.reserveBlock=function(e,t){var r=this;var i=r.pieces[e];if(!i)return null;return i.reserveBlock(t)};A.prototype.cancelBlock=function(e,t){var r=this;var i=r.pieces[e];if(!i)return false;return i.cancelBlock(t)};A.prototype.remove=function(e){if(e)l(e)(null)};A.prototype.close=function(e){var t=this;t.closed=true;if(e)l(e)(null)};A.prototype._onPieceDone=function(e){var t=this;t.bitfield.set(e.index);f("piece done "+e.index+" ("+t.numMissing+" still missing)");t.emit("piece",e)};A.prototype._onFileDone=function(e){var t=this;f("file done "+e.name);t.emit("file",e);t._checkDone()};A.prototype._checkDone=function(){var e=this;if(!e.done&&e.files.every(function(e){return e.done})){e.done=true;e.emit("done")}}}).call(this,e("_process"),e("buffer").Buffer)},{"./append-to":1,"./file-stream":2,"./mime.json":4,_process:78,bitfield:10,"block-stream2":39,buffer:66,debug:138,dezalgo:141,"end-of-stream":145,events:70,inherits:147,multistream:150,once:153,path:77,"simple-sha1":179}],8:[function(e,t,r){(function(r,i){t.exports=U;var n=e("addr-to-ip-port");var a=e("create-torrent");var s=e("debug")("webtorrent:torrent");var o=e("torrent-discovery");var f=e("events").EventEmitter;var l=e("inherits");var u=e("run-parallel");var c=e("parse-torrent");var p=e("re-emitter");var d=e("bittorrent-swarm");var h=e("uniq");var m=e("ut_metadata");var v=e("ut_pex");var g=e("./rarity-map");var _=e("./server");var y=e("./storage");var b=128*1024;var w=3e4;var x=5e3;var k=3*y.BLOCK_LENGTH;var S=.5;var E=1;var A=1e4;var T=2;function I(){}l(U,f);function U(e,t){var r=this;f.call(r);if(!s.enabled)r.setMaxListeners(0);s("new torrent");r.opts=t;r.client=t.client;r.hotswapEnabled="hotswap"in t?t.hotswap:true;r.verify=t.verify;r.chokeTimeout=t.chokeTimeout||x;r.pieceTimeout=t.pieceTimeout||w;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.files=[];r.metadata=null;r.parsedTorrent=null;r.storage=null;r.numBlockedPeers=0;r._amInterested=false;r._selections=[];r._critical=[];r._storageImpl=t.storage||y;this._torrentFileURL=null;if(e)r._onTorrentId(e)}Object.defineProperty(U.prototype,"length",{get:function(){return this.parsedTorrent&&this.parsedTorrent.length||0}});Object.defineProperty(U.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(U.prototype,"progress",{get:function(){return this.parsedTorrent&&this.downloaded/this.parsedTorrent.length||0}});Object.defineProperty(U.prototype,"downloaded",{get:function(){return this.storage&&this.storage.downloaded||0}});Object.defineProperty(U.prototype,"uploaded",{get:function(){return this.swarm.uploaded}});Object.defineProperty(U.prototype,"ratio",{get:function(){return this.uploaded&&this.downloaded/this.uploaded||0}});Object.defineProperty(U.prototype,"magnetURI",{get:function(){return c.toMagnetURI(this.parsedTorrent)}});Object.defineProperty(U.prototype,"torrentFile",{get:function(){return c.toTorrentFile(this.parsedTorrent)}});Object.defineProperty(U.prototype,"torrentFileURL",{get:function(){if(typeof window==="undefined")throw new Error("browser-only property");if(this._torrentFileURL)return this._torrentFileURL;this._torrentFileURL=window.URL.createObjectURL(new window.Blob([this.torrentFile],{type:"application/x-bittorrent"}));return this._torrentFileURL}});U.prototype._onTorrentId=function(e){var t=this;if(t.destroyed)return;var r=e&&e.parsedTorrent;if(r){t._onParsedTorrent(r)}else{c.remote(e,function(e,r){if(t.destroyed)return;if(e)return t._onError(e);t._onParsedTorrent(r)})}};U.prototype._onParsedTorrent=function(e){var t=this;if(t.destroyed)return;t.parsedTorrent=e;t.infoHash=e.infoHash;if(!t.infoHash){return t._onError(new Error("Malformed torrent data: Missing info hash."))}if(t.parsedTorrent.name)t.name=t.parsedTorrent.name;if(t.opts.announce){t.parsedTorrent.announce=t.parsedTorrent.announce.concat(t.opts.announce)}if(i.WEBTORRENT_ANNOUNCE){t.parsedTorrent.announce=t.parsedTorrent.announce.concat(i.WEBTORRENT_ANNOUNCE)}if(t.parsedTorrent.announce.length===0){t.parsedTorrent.announce=a.announceList.map(function(e){return e[0]})}h(t.parsedTorrent.announce);t.swarm=new d(t.infoHash,t.client.peerId,{handshake:{dht:!!t.client.dht}});t.swarm.on("error",t._onError.bind(t));p(t.swarm,t,["warning"]);t.swarm.on("wire",t._onWire.bind(t));t.swarm.on("download",t.client.downloadSpeed.bind(t.client));t.swarm.on("upload",t.client.uploadSpeed.bind(t.client));t.swarm.listen(t.client.torrentPort,t._onSwarmListening.bind(t));if(t.parsedTorrent.urlList){t.parsedTorrent.urlList.forEach(t.addWebSeed.bind(t))}r.nextTick(function(){if(t.destroyed)return;t.emit("infoHash",t.infoHash)})};U.prototype._onSwarmListening=function(){var e=this;if(e.destroyed)return;if(e.swarm.server)e.client.torrentPort=e.swarm.address().port;e.discovery=new o({announce:e.parsedTorrent.announce,dht:e.client.dht,tracker:e.client.tracker,peerId:e.client.peerId,port:e.client.torrentPort,rtcConfig:e.client._rtcConfig,wrtc:e.client._wrtc});e.discovery.on("error",e._onError.bind(e));e.discovery.setTorrent(e.infoHash);e.discovery.on("peer",e.addPeer.bind(e));p(e.discovery,e,["dhtAnnounce","warning"]);if(e.parsedTorrent.info)e._onMetadata(e.parsedTorrent);e.emit("listening",e.client.torrentPort)};U.prototype._onMetadata=function(e){var t=this;if(t.metadata||t.destroyed)return;s("got metadata");if(e&&e.infoHash){t.metadata=c.toTorrentFile(e);t.parsedTorrent=e}else{t.metadata=e;var i=t.parsedTorrent.announce;try{t.parsedTorrent=c(t.metadata)}catch(n){return t._onError(n)}t.parsedTorrent.announce=i}t.name=t.parsedTorrent.name;t.discovery.setTorrent(t.parsedTorrent);t.rarityMap=new g(t.swarm,t.parsedTorrent.pieces.length);t.storage=new t._storageImpl(t.parsedTorrent,t.opts);t.storage.on("piece",t._onStoragePiece.bind(t));t.storage.on("file",function(e){t.emit("file",e)});t._reservations=t.storage.pieces.map(function(){return[]});t.storage.on("done",function(){if(t.discovery.tracker)t.discovery.tracker.complete();s("torrent "+t.infoHash+" done");t.emit("done")});t.storage.on("select",t.select.bind(t));t.storage.on("deselect",t.deselect.bind(t));t.storage.on("critical",t.critical.bind(t));t.storage.files.forEach(function(e){t.files.push(e)});t.swarm.wires.forEach(function(e){if(e.ut_metadata)e.ut_metadata.setMetadata(t.metadata);t._onWireWithMetadata(e)});if(t.verify){r.nextTick(function(){s("verifying existing torrent data");var e=0;var r=0;u(t.storage.pieces.map(function(i){return function(n){t.storage.read(i.index,function(a,o){e+=1;t.emit("verifying",{percentDone:100*e/t.storage.pieces.length,percentVerified:100*r/t.storage.pieces.length});if(!a&&o){i.verify(o);r+=i.verified;s("piece "+(i.verified?"verified":"invalid")+" "+i.index)}n()},true)}}),t._onStorage.bind(t))})}else{r.nextTick(t._onStorage.bind(t))}r.nextTick(function(){t.emit("metadata")})};U.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;s("destroy");if(t._rechokeIntervalId){clearInterval(t._rechokeIntervalId);t._rechokeIntervalId=null}if(t._torrentFileURL)window.URL.revokeObjectURL(t._torrentFileURL);var r=[];if(t.swarm)r.push(function(e){t.swarm.destroy(e)});if(t.discovery)r.push(function(e){t.discovery.stop(e)});if(t.storage)r.push(function(e){t.storage.close(e)});u(r,e)};U.prototype.addPeer=function(e){var t=this;function r(){t.emit("peer",e);t.swarm.addPeer(e)}if(typeof e==="string"&&t.client.blocked&&t.client.blocked.contains(n(e)[0])){t.numBlockedPeers+=1;t.emit("blockedPeer",e);return false}else{if(t.swarm)r();else t.on("listening",r);return true}};U.prototype.addWebSeed=function(e){var t=this;t.swarm.addWebSeed(e,t.parsedTorrent)};U.prototype.select=function(e,t,r,i){var n=this;if(e>t||e<0||t>=n.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||I});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};U.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n<i._selections.length;++n){var a=i._selections[n];if(a.from===e&&a.to===t&&a.priority===r){i._selections.splice(n--,1);break}}i._updateSelections()};U.prototype.critical=function(e,t){var r=this;s("critical %s-%s",e,t);for(var i=e;i<=t;++i){r._critical[i]=true}r._updateSelections()};U.prototype._onWire=function(e,t){var r=this;s("got wire (%s)",t||"Unknown");if(t){var i=n(t);e.remoteAddress=i[0];e.remotePort=i[1]}if(e.peerExtensions.dht&&r.client.dht&&r.client.dht.listening){e.on("port",function(t){if(!e.remoteAddress){s("ignoring port from peer with no address");return}s("port: %s (from %s)",t,e.remoteAddress+":"+e.remotePort);r.client.dht.addNode(e.remoteAddress+":"+t)});e.port(r.client.dht.address().port)}e.on("timeout",function(){s("wire timeout (%s)",t);e.destroy()});e.setTimeout(r.pieceTimeout,true);e.setKeepAlive(true);e.use(m(r.metadata));if(!r.metadata){e.ut_metadata.on("metadata",function(e){s("got metadata via ut_metadata");r._onMetadata(e)});e.ut_metadata.fetch()}if(typeof v==="function"){e.use(v());e.ut_pex.on("peer",function(e){s("ut_pex: got peer: %s (from %s)",e,t);r.addPeer(e)});e.ut_pex.on("dropped",function(e){s("ut_pex: dropped peer: %s (from %s)",e,t);var i=r.swarm._peers[e];if(!i||!i.conn)r.swarm.removePeer(e)})}r.emit("wire",e);if(r.metadata){r._onWireWithMetadata(e)}};U.prototype._onWireWithMetadata=function(e){var t=this;var r=null;var i=t.chokeTimeout;function n(){if(t.destroyed||e.destroyed)return;if(t.swarm.numQueued>2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(n,i);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;a<t.storage.pieces.length;++a){if(!e.peerPieces.get(a))return}e.isSeeder=true;e.choke()}e.on("bitfield",function(){o();t._update()});e.on("have",function(){o();t._update()});e.once("interested",function(){e.unchoke()});e.on("close",function(){clearTimeout(r)});e.on("choke",function(){clearTimeout(r);r=setTimeout(n,i);if(r.unref)r.unref()});e.on("unchoke",function(){clearTimeout(r);t._update()});e.on("request",function(r,i,n,a){if(n>b){s("got invalid block size request %s (from %s)",n,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,i,n,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(n,i);if(r.unref)r.unref();e.isSeeder=false;o()};U.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),A);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};U.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};U.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};U.prototype._gcSelections=function(){var e=this;for(var t=0;t<e._selections.length;t++){var r=e._selections[t];var i=r.offset;while(e.storage.bitfield.get(r.from+r.offset)&&r.from+r.offset<r.to){r.offset++}if(i!==r.offset)r.notify();if(r.to!==r.from+r.offset)continue;if(!e.storage.bitfield.get(r.from+r.offset))continue;e._selections.splice(t--,1);r.notify();e._updateInterest()}if(!e._selections.length)e.emit("idle")};U.prototype._updateInterest=function(){var e=this;var t=e._amInterested;e._amInterested=!!e._selections.length;e.swarm.wires.forEach(function(t){if(e._amInterested)t.interested();else t.uninterested()});if(t===e._amInterested)return;if(e._amInterested)e.emit("interested");else e.emit("uninterested")};U.prototype._update=function(){var e=this;if(e.destroyed)return;z(e.swarm.wires,e._updateWire.bind(e))};U.prototype._updateWire=function(e){var t=this;if(e.peerChoking)return;if(!e.downloaded)return a();var r=L(e,S);if(e.requests.length>=r)return;var i=L(e,E);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var l={};var u=0;var c=n(s,o,l);while(u<f){a=t.rarityMap.getRarestPiece(c);if(a<0)break;if(t._request(e,a,false))return;l[a]=true;u+=1}}else{for(a=i.to;a>=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>k)return function(){return true};var i=Math.max(1,e.requests.length)*y.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a<t.swarm.wires.length;a++){var f=t.swarm.wires[a];var l=f.downloadSpeed();if(l<k)continue;if(l<=r)continue;if(!f.peerPieces.get(e))continue;if((o-=l*i)>0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i<t._selections.length&&t._selections[i].priority;i++){r=i}var n=t._selections[e];t._selections[e]=t._selections[r];t._selections[r]=n}function f(r){if(e.requests.length>=i)return true;var a=s();for(var f=0;f<t._selections.length;f++){var l=t._selections[f];var u;if(t.strategy==="rarest"){var c=l.from+l.offset;var p=l.to;var d=p-c+1;var h={};var m=0;var v=n(c,p,h,a);while(m<d){u=t.rarityMap.getRarestPiece(v);if(u<0)break;while(t._request(e,u,t._critical[u]||r)){}if(e.requests.length<i){h[u]=true;m++;continue}if(l.priority)o(f);return true}}else{for(u=l.from+l.offset;u<=l.to;u++){if(!e.peerPieces.get(u)||!a(u))continue;while(t._request(e,u,t._critical[u]||r)){}if(e.requests.length<i)continue;if(l.priority)o(f);return true}}}return false}};U.prototype._rechoke=function(){var e=this;if(e._rechokeOptimisticTime>0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i<t.length&&r<e._rechokeNumSlots;++i){t[i].isChoked=false;if(t[i].wire.peerInterested)r+=1}if(!e._rechokeOptimisticWire&&i<t.length&&e._rechokeNumSlots){var n=t.slice(i).filter(function(e){return e.wire.peerInterested});var a=n[B(n.length)];if(a){a.isChoked=false;e._rechokeOptimisticWire=a.wire;e._rechokeOptimisticTime=T}}t.forEach(function(e){if(e.wire.amChoking!==e.isChoked){if(e.isChoked)e.wire.choke();else e.wire.unchoke()}});function s(e,t){if(e.downloadSpeed!==t.downloadSpeed){return t.downloadSpeed-e.downloadSpeed;
+}if(e.uploadSpeed!==t.uploadSpeed){return t.uploadSpeed-e.uploadSpeed}if(e.wire.amChoking!==t.wire.amChoking){return e.wire.amChoking?1:-1}return e.salt-t.salt}};U.prototype._hotswap=function(e,t){var r=this;if(!r.hotswapEnabled)return false;var i=e.downloadSpeed();if(i<y.BLOCK_LENGTH)return false;if(!r._reservations[t])return false;var n=r._reservations[t];if(!n){return false}var a=Infinity;var s;var o;for(o=0;o<n.length;o++){var f=n[o];if(!f||f===e)continue;var l=f.downloadSpeed();if(l>=k)continue;if(2*l>i||l>a)continue;s=f;a=l}if(!s)return false;for(o=0;o<n.length;o++){if(n[o]===s)n[o]=null}for(o=0;o<s.requests.length;o++){var u=s.requests[o];if(u.piece!==t)continue;r.storage.cancelBlock(t,u.offset)}r.emit("hotswap",s,e,t);return true};U.prototype._request=function(e,t,i){var n=this;var a=e.requests.length;if(n.storage.bitfield.get(t))return false;var o=L(e,E);if(a>=o)return false;var f=e.requests.length===0&&n.storage.numMissing<30;var l=n.storage.reserveBlock(t,f);if(!l&&!f&&i&&n._hotswap(e,t)){l=n.storage.reserveBlock(t,false)}if(!l)return false;var u=n._reservations[t];if(!u){u=n._reservations[t]=[]}var c=u.indexOf(null);if(c===-1)c=u.length;u[c]=e;function p(i,a){if(!n.ready){n.once("ready",function(){p(i,a)});return}if(u[c]===e)u[c]=null;if(i){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,l.offset,l.length,e.remoteAddress+":"+e.remotePort,i.message);n.storage.cancelBlock(t,l.offset);r.nextTick(n._update.bind(n));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,l.offset,l.length,e.remoteAddress+":"+e.remotePort);n.storage.writeBlock(t,l.offset,a,function(e){if(e){s("error writing block");n.storage.cancelBlock(t,l.offset)}r.nextTick(n._update.bind(n))})}}e.request(t,l.offset,l.length,p);return true};U.prototype.createServer=function(e){var t=this;if(typeof _==="function"){return new _(t,e)}};U.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function L(e,t){return Math.ceil(2+t*e.downloadSpeed()/y.BLOCK_LENGTH)}function B(e){return Math.random()*e|0}function z(e,t){var r=e.map(function(e,t){return t});for(var i=r.length-1;i>0;--i){var n=B(i+1);var a=r[i];r[i]=r[n];r[n]=a}r.forEach(function(r){t(e[r],r,e)})}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":5,"./server":6,"./storage":7,_process:78,"addr-to-ip-port":9,"bittorrent-swarm":11,"create-torrent":99,debug:138,events:70,inherits:147,"parse-torrent":154,"re-emitter":174,"run-parallel":175,"torrent-discovery":182,uniq:221,ut_metadata:222,ut_pex:52}],9:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],10:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r<e;r++)t[r]=0};function i(e,t){if(!(this instanceof i)){return new i(e,t)}if(arguments.length===0){e=0}this.grow=t&&(isFinite(t.grow)&&n(t.grow)||t.grow)||0;if(typeof e==="number"||e===undefined){e=new r(n(e));if(e.fill)e.fill(0)}this.buffer=e}function n(e){var t=e>>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t<this.buffer.length&&!!(this.buffer[t]&128>>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length<r+1)this._grow(Math.max(r+1,Math.min(2*this.buffer.length,this.grow)));this.buffer[r]|=128>>e%8}else if(r<this.buffer.length){this.buffer[r]&=~(128>>e%8)}};i.prototype._grow=function(e){if(this.buffer.length<e&&e<=this.grow){var t=new r(e);if(t.fill)t.fill(0);if(this.buffer.copy)this.buffer.copy(t,0);else{for(var i=0;i<this.buffer.length;i++){t[i]=this.buffer[i]}}this.buffer=t}};if(typeof t!=="undefined")t.exports=i}).call(this,e("buffer").Buffer)},{buffer:66}],11:[function(e,t,r){(function(r,i){t.exports=m;var n=e("addr-to-ip-port");var a=e("debug")("bittorrent-swarm");var s=e("dezalgo");var o=e("events").EventEmitter;var f=e("inherits");var l=e("net");var u=e("./lib/peer");var c=e("speedometer");var p=e("./lib/tcp-pool");var d=55;var h=[1e3,5e3,15e3];f(m,o);function m(e,t,r){var n=this;if(!(n instanceof m))return new m(e,t,r);o.call(n);n.infoHash=typeof e==="string"?new i(e,"hex"):e;n.infoHashHex=n.infoHash.toString("hex");n.peerId=typeof t==="string"?new i(t,"hex"):t;n.peerIdHex=n.peerId.toString("hex");if(!r)r={};a("new swarm (i %s p %s)",n.infoHashHex,n.peerIdHex);n.handshakeOpts=r.handshake;n.maxConns=r.maxConns!==undefined?r.maxConns:d;n.destroyed=false;n.listening=false;n.paused=false;n.server=null;n.wires=[];n._queue=[];n._peers={};n._peersLength=0;n._port=0;n.downloaded=0;n.uploaded=0;n.downloadSpeed=c();n.uploadSpeed=c()}Object.defineProperty(m.prototype,"ratio",{get:function(){var e=this;return e.uploaded/e.downloaded||0}});Object.defineProperty(m.prototype,"numQueued",{get:function(){var e=this;return e._queue.length+(e._peersLength-e.numConns)}});Object.defineProperty(m.prototype,"numConns",{get:function(){var e=this;var t=0;for(var r in e._peers){var i=e._peers[r];if(i&&i.conn)t+=1}return t}});Object.defineProperty(m.prototype,"numPeers",{get:function(){var e=this;return e.wires.length}});m.prototype.addPeer=function(e){var t=this;if(t.destroyed){if(e&&e.destroy)e.destroy(new Error("swarm already destroyed"));return}if(typeof e==="string"&&!t._validAddr(e)){a("ignoring invalid peer %s (from swarm.addPeer)",e);return}var r=e&&e.id||e;if(t._peers[r])return;a("addPeer %s",r);var i;if(typeof e==="string"){i=u.createOutgoingTCPPeer(e,t);t._queue.push(i);t._drain()}else{i=u.createWebRTCPeer(e,t)}t._peers[i.id]=i;t._peersLength+=1};m.prototype.addWebSeed=function(e,t){var r=this;if(r.destroyed)return;if(!/^https?:\/\/.+/.test(e)){a("ignoring invalid web seed %s (from swarm.addWebSeed)",e);return}if(r._peers[e])return;a("addWebSeed %s",e);r._peers[e]=u.createWebPeer(e,t,r);r._peersLength+=1};m.prototype._addIncomingPeer=function(e){var t=this;if(t.destroyed)return e.destroy(new Error("swarm already destroyed"));if(t.paused)return e.destroy(new Error("swarm paused"));if(!t._validAddr(e.addr)){return e.destroy(new Error("invalid addr "+e.addr+" (from incoming)"))}a("_addIncomingPeer %s",e.id);t._peers[e.id]=e;t._peersLength+=1};m.prototype.removePeer=function(e){var t=this;var r=t._peers[e];if(!r)return;a("removePeer %s",e);t._peers[e]=null;t._peersLength-=1;r.destroy()};m.prototype.pause=function(){var e=this;if(e.destroyed)return;a("pause");e.paused=true};m.prototype.resume=function(){var e=this;if(e.destroyed)return;a("resume");e.paused=false;e._drain()};m.prototype.listen=function(e,t,i){var n=this;if(typeof t==="function"){i=t;t=undefined}if(i)i=s(i);if(n.listening)throw new Error("swarm already listening");if(r.browser){i()}else{n._port=e||p.getDefaultListenPort(n.infoHashHex);n._hostname=t;if(i)n.once("listening",i);a("listen %s",e);var o=p.addSwarm(n);n.server=o.server}};m.prototype._onListening=function(e){var t=this;t._port=e;t.listening=true;t.emit("listening")};m.prototype.address=function(){var e=this;return e.server.address()};m.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.listening=false;t.paused=false;if(e)t.once("close",e);a("destroy");for(var r in t._peers){t.removePeer(r)}p.removeSwarm(t,function(){t.emit("close")})};m.prototype._drain=function(){var e=this;a("_drain numConns %s maxConns %s",e.numConns,e.maxConns);if(typeof l.connect!=="function"||e.destroyed||e.paused||e.numConns>=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i=r[0];var s=r[1];var o=t.conn=l.connect({host:i,port:s,localAddress:e._hostname});o.once("connect",function(){t.onConnect()});o.once("error",function(e){t.destroy(e)});t.setConnectTimeout();o.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}function r(){var r=u.createOutgoingTCPPeer(t.addr,e);r.retries=t.retries+1;e._queue.push(r);e._drain()}var i=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,i,t.retries+1);var n=setTimeout(r,i);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":12,"./lib/tcp-pool":13,_process:78,"addr-to-ip-port":52,buffer:66,debug:28,dezalgo:31,events:70,inherits:34,net:52,speedometer:38}],12:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;i("destroy Peer %s (error: %s)",t.id,e&&(e.message||e));if(t.swarm)t.swarm.wires.splice(t.swarm.wires.indexOf(t.wire),1);if(t.conn)t.conn.destroy();if(t.wire)t.wire.destroy();if(t.swarm){t.swarm.removePeer(t.id);t.swarm._drain()}clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);t.conn=null;t.swarm=null;t.wire=null}},{"./webconn":14,"bittorrent-protocol":16,debug:28}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":12,_process:78,debug:28,dezalgo:31,net:52}],14:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var l=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,l);var u={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+l}};a.concat(u,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:15,"bittorrent-protocol":16,buffer:66,debug:28,inherits:34,"simple-get":35}],15:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{buffer:66,dup:10}],16:[function(e,t,r){(function(r){t.exports=b;var i=e("bitfield");var n=e("bencode");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("inherits");var f=e("speedometer");var l=e("stream");var u=4e5;var c=new r("BitTorrent protocol");var p=new r([0,0,0,0]);var d=new r([0,0,0,1,0]);var h=new r([0,0,0,1,1]);var m=new r([0,0,0,1,2]);var v=new r([0,0,0,1,3]);var g=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function y(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}o(b,l.Duplex);function b(){if(!(this instanceof b))return new b;l.Duplex.call(this);a("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new i(0,{grow:u});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};this._ext={};this._nextExt=1;this.uploaded=0;this.downloaded=0;this.uploadSpeed=f();this.downloadSpeed=f();this._keepAlive=null;this._timeout=null;this._timeoutMs=0;this.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}b.prototype.setKeepAlive=function(e){clearInterval(this._keepAlive);if(e===false)return;this._keepAlive=setInterval(this._push.bind(this,p),6e4)};b.prototype.setTimeout=function(e,t){this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};b.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;a("destroy");this.end()};b.prototype.end=function(){this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};b.prototype.use=function(e){var t=e.prototype.name;if(!t){throw new Error("Extension API requires a named function, e.g. function name() {}")}var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};b.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}var n=new r(g);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([c,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};b.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,n.encode(e))};b.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this.peerRequests.splice(0,this.peerRequests.length);this._push(d)};b.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._push(h)};b.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._push(m)};b.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._push(v)};b.prototype.have=function(e){this._message(4,[e],null)};b.prototype.bitfield=function(e){if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};b.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this.requests.push(new y(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};b.prototype.piece=function(e,t,r){this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};b.prototype.cancel=function(e,t,r){this._callback(w(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};b.prototype.port=function(e){var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};b.prototype.extended=function(e,t){if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var i=new r([e]);var a=r.isBuffer(t)?t:n.encode(t);this._message(20,[],r.concat([i,a]))}else{throw new Error("Unrecognized extension: "+e)}};b.prototype._onKeepAlive=function(){this.emit("keep-alive")};b.prototype._onHandshake=function(e,t,r){this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};b.prototype._onChoke=function(){this.peerChoking=true;this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};b.prototype._onUnchoke=function(){this.peerChoking=false;this.emit("unchoke")};b.prototype._onInterested=function(){this.peerInterested=true;this.emit("interested")};b.prototype._onUninterested=function(){this.peerInterested=false;this.emit("uninterested")};b.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this.peerPieces.set(e,true);this.emit("have",e)};b.prototype._onBitField=function(e){this.peerPieces=new i(e);this.emit("bitfield",this.peerPieces)};b.prototype._onRequest=function(e,t,r){if(this.amChoking)return;var i=function(i,a){if(n!==w(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new y(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};b.prototype._onPiece=function(e,t,r){this._callback(w(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};b.prototype._onCancel=function(e,t,r){w(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};b.prototype._onPort=function(e){this.emit("port",e)};b.prototype._onExtended=function(e,t){var r,i;if(e===0&&(r=x(t))){this.peerExtendedHandshake=r;if(typeof r.m==="object"){for(i in r.m){this.peerExtendedMapping[i]=Number(r.m[i].toString())}}for(i in this._ext){if(this.peerExtendedMapping[i]){this._ext[i].onExtendedHandshake(this.peerExtendedHandshake)}}this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this.emit("extended",e,t)}};b.prototype._onTimeout=function(){this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};b.prototype._push=function(e){if(this._finished)return;return this.push(e)};b.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};b.prototype._read=function(){};b.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};b.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};b.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};b.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};b.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s<t.length;s++){a.writeUInt32BE(t[s],5+4*s)}this._push(a);if(i)this._push(i)};b.prototype._onmessagelength=function(e){var t=e.readUInt32BE(0);if(t>0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};b.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:return this.emit("unknownmessage",e)}};b.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){a("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};b.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAlive);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};function w(e,t,r,i){for(var n=0;n<e.length;n++){var a=e[n];if(a.piece!==t||a.offset!==r||a.length!==i)continue;if(n===0)e.shift();else e.splice(n,1);return a}return null}function x(e){try{return n.decode(e)}catch(t){console.warn(t)}}}).call(this,e("buffer").Buffer)},{bencode:17,bitfield:21,buffer:66,debug:22,inherits:25,speedometer:26,stream:94,xtend:27}],17:[function(e,t,r){t.exports={encode:e("./lib/encode"),decode:e("./lib/decode")}},{"./lib/decode":18,"./lib/encode":20}],18:[function(e,t,r){(function(r){var i=e("./dict");function n(e,t){n.position=0;n.encoding=t||null;n.data=!r.isBuffer(e)?new r(e):e;return n.next()}n.position=0;n.data=null;n.encoding=null;n.next=function(){switch(n.data[n.position]){case 100:return n.dictionary();break;case 108:return n.list();break;case 105:return n.integer();break;default:return n.bytes();break}};n.find=function(e){var t=n.position;var r=n.data.length;var i=n.data;while(t<r){if(i[t]===e)return t;t++}throw new Error('Invalid data: Missing delimiter "'+String.fromCharCode(e)+'" [0x'+e.toString(16)+"]")};n.dictionary=function(){n.position++;var e=new i;while(n.data[n.position]!==101){e.binarySet(n.bytes(),n.next())}n.position++;return e};n.list=function(){n.position++;var e=[];while(n.data[n.position]!==101){e.push(n.next())}n.position++;return e};n.integer=function(){var e=n.find(101);var t=n.data.toString("ascii",n.position+1,e);n.position+=e+1-n.position;return parseInt(t,10)};n.bytes=function(){var e=n.find(58);var t=parseInt(n.data.toString("ascii",n.position,e),10);var r=++e+t;n.position=r;return n.encoding?n.data.toString(n.encoding,e,r):n.data.slice(e,r)};t.exports=n}).call(this,e("buffer").Buffer)},{"./dict":19,buffer:66}],19:[function(e,t,r){var i=t.exports=function n(){Object.defineProperty(this,"_keys",{enumerable:false,value:[]})};i.prototype.binaryKeys=function a(){return this._keys.slice()};i.prototype.binarySet=function s(e,t){this._keys.push(e);this[e]=t}},{}],20:[function(e,t,r){(function(e){function r(t){var i=[];r._encode(i,t);return e.concat(i)}r._floatConversionDetected=false;r._encode=function(t,i){if(e.isBuffer(i)){t.push(new e(i.length+":"));t.push(i);return}switch(typeof i){case"string":r.bytes(t,i);break;case"number":r.number(t,i);break;case"object":i.constructor===Array?r.list(t,i):r.dict(t,i);break}};var i=new e("e"),n=new e("d"),a=new e("l");r.bytes=function(t,r){t.push(new e(e.byteLength(r)+":"+r))};r.number=function(t,i){var n=2147483648;var a=i/n<<0;var s=i%n<<0;var o=a*n+s;t.push(new e("i"+o+"e"));if(o!==i&&!r._floatConversionDetected){r._floatConversionDetected=true;console.warn('WARNING: Possible data corruption detected with value "'+i+'":','Bencoding only defines support for integers, value was converted to "'+o+'"');console.trace()}};r.dict=function(e,t){e.push(n);var a=0;var s;var o=Object.keys(t).sort();var f=o.length;for(;a<f;a++){s=o[a];r.bytes(e,s);r._encode(e,t[s])}e.push(i)};r.list=function(e,t){var n=0,s=1;var o=t.length;e.push(a);for(;n<o;n++){r._encode(e,t[n])}e.push(i)};t.exports=r}).call(this,e("buffer").Buffer)},{buffer:66}],21:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{buffer:66,dup:10}],22:[function(e,t,r){r=t.exports=e("./debug");r.log=s;r.formatArgs=a;r.save=o;r.load=f;r.useColors=n;var i;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")i=chrome.storage.local;else i=l();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function a(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function s(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{if(null==e){i.removeItem("debug")}else{i.debug=e}}catch(t){}}function f(){var e;try{e=i.debug}catch(t){}return e}r.enable(f());function l(){try{return window.localStorage}catch(e){}}},{"./debug":23}],23:[function(e,t,r){r=t.exports=s;r.coerce=u;r.disable=f;r.enable=o;r.enabled=l;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var l=i.log||r.log||console.log.bind(console);l.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n<i;n++){if(!t[n])continue;e=t[n].replace(/\*/g,".*?");if(e[0]==="-"){r.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{r.names.push(new RegExp("^"+e+"$"))}}}function f(){r.enable("")}function l(e){var t,i;for(t=0,i=r.skips.length;t<i;t++){if(r.skips[t].test(e)){return false}}for(t=0,i=r.names.length;t<i;t++){if(r.names[t].test(e)){return true}}return false}function u(e){if(e instanceof Error)return e.stack||e.message;return e}},{ms:24}],24:[function(e,t,r){var i=1e3;var n=i*60;var a=n*60;var s=a*24;var o=s*365.25;t.exports=function(e,t){t=t||{};if("string"==typeof e)return f(e);return t.long?u(e):l(e)};function f(e){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":
+case"ms":return r}}function l(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function u(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+r;return Math.ceil(e/t)+" "+r+"s"}},{}],25:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],26:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var l=r[s-1];var u=r.length<t?0:r[s===t?0:s];return r.length<a?l:(l-u)*a/r.length}}},{}],27:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r){if(r.hasOwnProperty(i)){e[i]=r[i]}}}return e}},{}],28:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{"./debug":29,dup:22}],29:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:30}],30:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],31:[function(e,t,r){var i=e("wrappy");t.exports=i(a);var n=e("asap");function a(e){var t=true;n(function(){t=false});return function r(){var r=arguments;var i=this;if(t)n(function(){e.apply(i,r)});else e.apply(i,r)}}},{asap:32,wrappy:33}],32:[function(e,t,r){(function(e){var r={task:void 0,next:null};var i=r;var n=false;var a=void 0;var s=false;function o(){while(r.next){r=r.next;var e=r.task;r.task=void 0;var t=r.domain;if(t){r.domain=void 0;t.enter()}try{e()}catch(i){if(s){if(t){t.exit()}setTimeout(o,0);if(t){t.enter()}throw i}else{setTimeout(function(){throw i},0)}}if(t){t.exit()}}n=false}if(typeof e!=="undefined"&&e.nextTick){s=true;a=function(){e.nextTick(o)}}else if(typeof setImmediate==="function"){if(typeof window!=="undefined"){a=setImmediate.bind(window,o)}else{a=function(){setImmediate(o)}}}else if(typeof MessageChannel!=="undefined"){var f=new MessageChannel;f.port1.onmessage=o;a=function(){f.port2.postMessage(0)}}else{a=function(){setTimeout(o,0)}}function l(t){i=i.next={task:t,domain:s&&e.domain,next:null};if(!n){n=true;a()}}t.exports=l}).call(this,e("_process"))},{_process:78}],33:[function(e,t,r){t.exports=i;function i(e,t){if(e&&t)return i(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var i=e.apply(this,t);var n=t[t.length-1];if(typeof i==="function"&&i!==n){Object.keys(n).forEach(function(e){i[e]=n[e]})}return i}}},{}],34:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],35:[function(e,t,r){(function(r){t.exports=f;var i=e("http");var n=e("https");var a=e("once");var s=e("url");var o=e("zlib");function f(e,t){if(typeof e==="string")e={url:e};t=a(t);if(e.maxRedirects===0){t(new Error("too many redirects"));return}if(!e.maxRedirects)e.maxRedirects=10;if(e.url)l(e);if(!e.headers)e.headers={};var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var s=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!s)e.headers["accept-encoding"]="gzip, deflate";var u=e.protocol==="https:"?n:i;var c=u.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;return f(e,t)}if(["gzip","deflate"].indexOf(r.headers["content-encoding"])!==-1){var i=o.createUnzip();r.pipe(i);r.on("close",function(){i.emit("close")});i.httpVersion=r.httpVersion;i.headers=r.headers;i.trailers=r.trailers;i.setTimeout=r.setTimeout.bind(r);i.method=r.method;i.url=r.url;i.statusCode=r.statusCode;i.socket=r.socket;t(null,i)}else{t(null,r)}});c.on("error",t);c.end(r);return c}t.exports.concat=function(e,t){return f(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return f(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:66,http:71,https:75,once:37,url:96,zlib:65}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],37:[function(e,t,r){var i=e("wrappy");t.exports=i(n);n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:true})});function n(e){var t=function(){if(t.called)return t.value;t.called=true;return t.value=e.apply(this,arguments)};t.called=false;return t}},{wrappy:36}],38:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],39:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:66,defined:40,inherits:147,"readable-stream":49}],40:[function(e,t,r){t.exports=function(){for(var e=0;e<arguments.length;e++){if(arguments[e]!==undefined)return arguments[e]}}},{}],41:[function(e,t,r){(function(r){t.exports=o;var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};var n=e("core-util-is");n.inherits=e("inherits");var a=e("./_stream_readable");var s=e("./_stream_writable");n.inherits(o,a);l(i(s.prototype),function(e){if(!o.prototype[e])o.prototype[e]=s.prototype[e]});function o(e){if(!(this instanceof o))return new o(e);a.call(this,e);s.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",f)}function f(){if(this.allowHalfOpen||this._writableState.ended)return;r.nextTick(this.end.bind(this))}function l(e,t){for(var r=0,i=e.length;r<i;r++){t(e[r],r)}}}).call(this,e("_process"))},{"./_stream_readable":43,"./_stream_writable":45,_process:78,"core-util-is":46,inherits:147}],42:[function(e,t,r){t.exports=a;var i=e("./_stream_transform");var n=e("core-util-is");n.inherits=e("inherits");n.inherits(a,i);function a(e){if(!(this instanceof a))return new a(e);i.call(this,e)}a.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":44,"core-util-is":46,inherits:147}],43:[function(e,t,r){(function(r){t.exports=c;var i=e("isarray");var n=e("buffer").Buffer;c.ReadableState=u;var a=e("events").EventEmitter;if(!a.listenerCount)a.listenerCount=function(e,t){return e.listeners(t).length};var s=e("stream");var o=e("core-util-is");o.inherits=e("inherits");var f;var l=e("util");if(l&&l.debuglog){l=l.debuglog("stream")}else{l=function(){}}o.inherits(c,s);function u(t,r){var i=e("./_stream_duplex");t=t||{};var n=t.highWaterMark;var a=t.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:a;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!t.objectMode;if(r instanceof i)this.objectMode=this.objectMode||!!t.readableObjectMode;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!f)f=e("string_decoder/").StringDecoder;this.decoder=new f(t.encoding);this.encoding=t.encoding}}function c(t){var r=e("./_stream_duplex");if(!(this instanceof c))return new c(t);this._readableState=new u(t,this);this.readable=true;s.call(this)}c.prototype.push=function(e,t){var r=this._readableState;if(o.isString(e)&&!r.objectMode){t=t||r.defaultEncoding;if(t!==r.encoding){e=new n(e,t);t=""}}return p(this,r,e,t,false)};c.prototype.unshift=function(e){var t=this._readableState;return p(this,t,e,"",true)};function p(e,t,r,i,n){var a=g(t,r);if(a){e.emit("error",a)}else if(o.isNullOrUndefined(r)){t.reading=false;if(!t.ended)_(e,t)}else if(t.objectMode||r&&r.length>0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)y(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}c.prototype.setEncoding=function(t){if(!f)f=e("string_decoder/").StringDecoder;this._readableState.decoder=new f(t);this._readableState.encoding=t;return this};var h=8388608;function m(e){if(e>=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){l("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){l("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else y(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;l("need readable",i);if(t.length===0||t.length-e<t.highWaterMark){i=true;l("length less than watermark",i)}if(t.ended||t.reading){i=false;l("reading or ended",i)}if(i){l("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false}if(i&&!t.reading)e=v(r,t);var n;if(e>0)n=T(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;y(e)}function y(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){l("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){l("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){l("maybeReadMore read 0");e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}c.prototype._read=function(e){this.emit("error",new Error("not implemented"))};c.prototype.pipe=function(e,t){var n=this;var s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e);break}s.pipesCount+=1;l("pipe count=%d opts=%j",s.pipesCount,t);var o=(!t||t.end!==false)&&e!==r.stdout&&e!==r.stderr;var f=o?c:d;if(s.endEmitted)r.nextTick(f);else n.once("end",f);e.on("unpipe",u);function u(e){l("onunpipe");if(e===n){d()}}function c(){l("onend");e.end()}var p=k(n);e.on("drain",p);function d(){l("cleanup");e.removeListener("close",v);e.removeListener("finish",g);e.removeListener("drain",p);e.removeListener("error",m);e.removeListener("unpipe",u);n.removeListener("end",c);n.removeListener("end",d);n.removeListener("data",h);if(s.awaitDrain&&(!e._writableState||e._writableState.needDrain))p()}n.on("data",h);function h(t){l("ondata");var r=e.write(t);if(false===r){l("false write response, pause",n._readableState.awaitDrain);n._readableState.awaitDrain++;n.pause()}}function m(t){l("onerror",t);_();e.removeListener("error",m);if(a.listenerCount(e,"error")===0)e.emit("error",t)}if(!e._events||!e._events.error)e.on("error",m);else if(i(e._events.error))e._events.error.unshift(m);else e._events.error=[m,e._events.error];function v(){e.removeListener("finish",g);_()}e.once("close",v);function g(){l("onfinish");e.removeListener("close",v);_()}e.once("finish",g);function _(){l("unpipe");n.unpipe(e)}e.emit("pipe",n);if(!s.flowing){l("pipe resume");n.resume()}return e};function k(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a.listenerCount(e,"data")){t.flowing=true;A(e)}}}c.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var r=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var n=0;n<i;n++)r[n].emit("unpipe",this);return this}var n=L(t.pipes,e);if(n===-1)return this;t.pipes.splice(n,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this);return this};c.prototype.on=function(e,t){var i=s.prototype.on.call(this,e,t);if(e==="data"&&false!==this._readableState.flowing){this.resume()}if(e==="readable"&&this.readable){var n=this._readableState;if(!n.readableListening){n.readableListening=true;n.emittedReadable=false;n.needReadable=true;if(!n.reading){var a=this;r.nextTick(function(){l("readable nexttick read 0");a.read(0)})}else if(n.length){y(this,n)}}}return i};c.prototype.addListener=c.prototype.on;c.prototype.resume=function(){var e=this._readableState;if(!e.flowing){l("resume");e.flowing=true;if(!e.reading){l("resume read 0");this.read(0)}S(this,e)}return this};function S(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;r.nextTick(function(){E(e,t)})}}function E(e,t){t.resumeScheduled=false;e.emit("resume");A(e);if(t.flowing&&!t.reading)e.read(0)}c.prototype.pause=function(){l("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){l("pause");this._readableState.flowing=false;this.emit("pause")}return this};function A(e){var t=e._readableState;l("flow",t.flowing);if(t.flowing){do{var r=e.read()}while(null!==r&&t.flowing)}}c.prototype.wrap=function(e){var t=this._readableState;var r=false;var i=this;e.on("end",function(){l("wrapped end");if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)i.push(e)}i.push(null)});e.on("data",function(n){l("wrapped data");if(t.decoder)n=t.decoder.write(n);if(!n||!t.objectMode&&!n.length)return;var a=i.push(n);if(!a){r=true;e.pause()}});for(var n in e){if(o.isFunction(e[n])&&o.isUndefined(this[n])){this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n)}}var a=["error","close","destroy","pause","resume"];U(a,function(t){e.on(t,i.emit.bind(i,t))});i._read=function(t){l("wrapped _read",t);if(r){r=false;e.resume()}};return i};c._fromList=T;function T(e,t){var r=t.buffer;var i=t.length;var a=!!t.decoder;var s=!!t.objectMode;var o;if(r.length===0)return null;if(i===0)o=null;else if(s)o=r.shift();else if(!e||e>=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e<r[0].length){var f=r[0];o=f.slice(0,e);r[0]=f.slice(e)}else if(e===r[0].length){o=r.shift()}else{if(a)o="";else o=new n(e);var l=0;for(var u=0,c=r.length;u<c&&l<e;u++){var f=r[0];var p=Math.min(e-l,f.length);if(a)o+=f.slice(0,p);else f.copy(o,l,0,p);if(p<f.length)r[0]=f.slice(p);else r.shift();l+=p}}}return o}function I(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function U(e,t){for(var r=0,i=e.length;r<i;r++){t(e[r],r)}}function L(e,t){for(var r=0,i=e.length;r<i;r++){if(e[r]===t)return r}return-1}}).call(this,e("_process"))},{"./_stream_duplex":41,_process:78,buffer:66,"core-util-is":46,events:70,inherits:147,isarray:47,stream:94,"string_decoder/":48,util:52}],44:[function(e,t,r){t.exports=o;var i=e("./_stream_duplex");var n=e("core-util-is");n.inherits=e("inherits");n.inherits(o,i);function a(e,t){this.afterTransform=function(e,r){return s(t,e,r)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function s(e,t,r){var i=e._transformState;i.transforming=false;var a=i.writecb;if(!a)return e.emit("error",new Error("no writecb in Transform class"));i.writechunk=null;i.writecb=null;if(!n.isNullOrUndefined(r))e.push(r);if(a)a(t);var s=e._readableState;s.reading=false;if(s.needReadable||s.length<s.highWaterMark){e._read(s.highWaterMark)}}function o(e){if(!(this instanceof o))return new o(e);i.call(this,e);this._transformState=new a(e,this);var t=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("prefinish",function(){if(n.isFunction(this._flush))this._flush(function(e){f(t,e)});else f(t)})}o.prototype.push=function(e,t){this._transformState.needTransform=false;return i.prototype.push.call(this,e,t)};o.prototype._transform=function(e,t,r){throw new Error("not implemented")};o.prototype._write=function(e,t,r){var i=this._transformState;i.writecb=r;i.writechunk=e;i.writeencoding=t;if(!i.transforming){var n=this._readableState;if(i.needTransform||n.needReadable||n.length<n.highWaterMark)this._read(n.highWaterMark)}};o.prototype._read=function(e){var t=this._transformState;if(!n.isNull(t.writechunk)&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};function f(e,t){if(t)return e.emit("error",t);var r=e._writableState;var i=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(i.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":41,"core-util-is":46,inherits:147}],45:[function(e,t,r){(function(r){t.exports=f;var i=e("buffer").Buffer;f.WritableState=o;var n=e("core-util-is");n.inherits=e("inherits");var a=e("stream");n.inherits(f,a);function s(e,t,r){this.chunk=e;this.encoding=t;this.callback=r}function o(t,r){var i=e("./_stream_duplex");t=t||{};var n=t.highWaterMark;var a=t.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:a;this.objectMode=!!t.objectMode;if(r instanceof i)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var s=t.decodeStrings===false;this.decodeStrings=!s;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){v(r,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.pendingcb=0;this.prefinished=false;this.errorEmitted=false}function f(t){var r=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof r))return new f(t);this._writableState=new o(t,this);this.writable=true;a.call(this)}f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function l(e,t,i){var n=new Error("write after end");e.emit("error",n);r.nextTick(function(){i(n)})}function u(e,t,i,a){var s=true;if(!n.isBuffer(i)&&!n.isString(i)&&!n.isNullOrUndefined(i)&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o);r.nextTick(function(){a(o)});s=false}return s}f.prototype.write=function(e,t,r){var i=this._writableState;var a=false;if(n.isFunction(t)){r=t;t=null}if(n.isBuffer(e))t="buffer";else if(!t)t=i.defaultEncoding;if(!n.isFunction(r))r=function(){};if(i.ended)l(this,i,r);else if(u(this,i,e,r)){i.pendingcb++;a=p(this,i,e,t,r)}return a};f.prototype.cork=function(){var e=this._writableState;e.corked++};f.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.buffer.length)y(this,e)}};function c(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&n.isString(t)){t=new i(t,r)}return t}function p(e,t,r,i,a){r=c(t,r,i);if(n.isBuffer(r))i="buffer";var o=t.objectMode?1:r.length;t.length+=o;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing||t.corked)t.buffer.push(new s(r,i,a));else d(e,t,false,o,r,i,a);return f}function d(e,t,r,i,n,a,s){t.writelen=i;t.writecb=s;t.writing=true;t.sync=true;if(r)e._writev(n,t.onwrite);else e._write(n,a,t.onwrite);t.sync=false}function h(e,t,i,n,a){if(i)r.nextTick(function(){t.pendingcb--;a(n)});else{t.pendingcb--;a(n)}e._writableState.errorEmitted=true;e.emit("error",n)}function m(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function v(e,t){var i=e._writableState;var n=i.sync;var a=i.writecb;m(i);if(t)h(e,i,n,t,a);else{var s=b(e,i);if(!s&&!i.corked&&!i.bufferProcessing&&i.buffer.length){y(e,i)}if(n){r.nextTick(function(){g(e,i,s,a)})}else{g(e,i,s,a)}}}function g(e,t,r,i){if(!r)_(e,t);t.pendingcb--;i();x(e,t)}function _(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function y(e,t){t.bufferProcessing=true;if(e._writev&&t.buffer.length>1){var r=[];for(var i=0;i<t.buffer.length;i++)r.push(t.buffer[i].callback);t.pendingcb++;d(e,t,true,t.length,t.buffer,"",function(e){for(var i=0;i<r.length;i++){t.pendingcb--;r[i](e)}});t.buffer=[]}else{for(var i=0;i<t.buffer.length;i++){var n=t.buffer[i];var a=n.chunk;var s=n.encoding;var o=n.callback;var f=t.objectMode?1:a.length;d(e,t,false,f,a,s,o);if(t.writing){i++;break}}if(i<t.buffer.length)t.buffer=t.buffer.slice(i);else t.buffer.length=0}t.bufferProcessing=false}f.prototype._write=function(e,t,r){r(new Error("not implemented"))};f.prototype._writev=null;f.prototype.end=function(e,t,r){var i=this._writableState;if(n.isFunction(e)){r=e;e=null;t=null}else if(n.isFunction(t)){r=t;t=null}if(!n.isNullOrUndefined(e))this.write(e,t);if(i.corked){i.corked=1;this.uncork()}if(!i.ending&&!i.finished)k(this,i,r)};function b(e,t){return t.ending&&t.length===0&&!t.finished&&!t.writing}function w(e,t){if(!t.prefinished){t.prefinished=true;e.emit("prefinish")}}function x(e,t){var r=b(e,t);if(r){if(t.pendingcb===0){w(e,t);t.finished=true;e.emit("finish")}else w(e,t)}return r}function k(e,t,i){t.ending=true;x(e,t);if(i){if(t.finished)r.nextTick(i);else e.once("finish",i)}t.ended=true}}).call(this,e("_process"))},{"./_stream_duplex":41,_process:78,buffer:66,"core-util-is":46,inherits:147,stream:94}],46:[function(e,t,r){(function(e){function t(e){return Array.isArray(e)}r.isArray=t;function i(e){return typeof e==="boolean"}r.isBoolean=i;function n(e){return e===null}r.isNull=n;function a(e){return e==null}r.isNullOrUndefined=a;function s(e){return typeof e==="number"}r.isNumber=s;function o(e){return typeof e==="string"}r.isString=o;function f(e){return typeof e==="symbol"}r.isSymbol=f;function l(e){return e===void 0}r.isUndefined=l;function u(e){return c(e)&&g(e)==="[object RegExp]"}r.isRegExp=u;function c(e){return typeof e==="object"&&e!==null}r.isObject=c;function p(e){return c(e)&&g(e)==="[object Date]"}r.isDate=p;function d(e){return c(e)&&(g(e)==="[object Error]"||e instanceof Error)}r.isError=d;function h(e){return typeof e==="function"}r.isFunction=h;function m(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=m;function v(t){return e.isBuffer(t)}r.isBuffer=v;function g(e){return Object.prototype.toString.call(e)}}).call(this,e("buffer").Buffer)},{buffer:66}],47:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],48:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=l;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived<this.charLength){return""}e=e.slice(r,e.length);t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function l(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:66}],49:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":41,"./lib/_stream_passthrough.js":42,"./lib/_stream_readable.js":43,"./lib/_stream_transform.js":44,"./lib/_stream_writable.js":45,stream:94}],50:[function(e,t,r){},{}],51:[function(e,t,r){var i=e("util/");var n=Array.prototype.slice;var a=Object.prototype.hasOwnProperty;var s=t.exports=c;s.AssertionError=function _(e){this.name="AssertionError";this.actual=e.actual;this.expected=e.expected;this.operator=e.operator;if(e.message){this.message=e.message;this.generatedMessage=false}else{this.message=l(this);this.generatedMessage=true}var t=e.stackStartFunction||u;if(Error.captureStackTrace){Error.captureStackTrace(this,t)}else{var r=new Error;if(r.stack){var i=r.stack;var n=t.name;var a=i.indexOf("\n"+n);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}};i.inherits(s.AssertionError,Error);function o(e,t){if(i.isUndefined(t)){return""+t}if(i.isNumber(t)&&!isFinite(t)){return t.toString()}if(i.isFunction(t)||i.isRegExp(t)){return t.toString()}return t}function f(e,t){if(i.isString(e)){return e.length<t?e:e.slice(0,t)}else{return e}}function l(e){return f(JSON.stringify(e.actual,o),128)+" "+e.operator+" "+f(JSON.stringify(e.expected,o),128)}function u(e,t,r,i,n){throw new s.AssertionError({message:r,actual:e,expected:t,operator:i,stackStartFunction:n})}s.fail=u;function c(e,t){if(!e)u(e,true,t,"==",s.ok)}s.ok=c;s.equal=function y(e,t,r){if(e!=t)u(e,t,r,"==",s.equal)};s.notEqual=function b(e,t,r){if(e==t){u(e,t,r,"!=",s.notEqual)}};s.deepEqual=function w(e,t,r){if(!p(e,t)){u(e,t,r,"deepEqual",s.deepEqual)}};function p(e,t){if(e===t){return true}else if(i.isBuffer(e)&&i.isBuffer(t)){if(e.length!=t.length)return false;for(var r=0;r<e.length;r++){if(e[r]!==t[r])return false}return true}else if(i.isDate(e)&&i.isDate(t)){return e.getTime()===t.getTime()}else if(i.isRegExp(e)&&i.isRegExp(t)){return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase}else if(!i.isObject(e)&&!i.isObject(t)){return e==t}else{return h(e,t)}}function d(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function h(e,t){if(i.isNullOrUndefined(e)||i.isNullOrUndefined(t))return false;if(e.prototype!==t.prototype)return false;if(i.isPrimitive(e)||i.isPrimitive(t)){return e===t}var r=d(e),a=d(t);if(r&&!a||!r&&a)return false;if(r){e=n.call(e);t=n.call(t);return p(e,t)}var s=g(e),o=g(t),f,l;if(s.length!=o.length)return false;s.sort();o.sort();for(l=s.length-1;l>=0;l--){if(s[l]!=o[l])return false}for(l=s.length-1;l>=0;l--){f=s[l];if(!p(e[f],t[f]))return false}return true}s.notDeepEqual=function x(e,t,r){if(p(e,t)){u(e,t,r,"notDeepEqual",s.notDeepEqual)}};s.strictEqual=function k(e,t,r){if(e!==t){u(e,t,r,"===",s.strictEqual)}};s.notStrictEqual=function S(e,t,r){if(e===t){u(e,t,r,"!==",s.notStrictEqual)}};function m(e,t){if(!e||!t){return false}if(Object.prototype.toString.call(t)=="[object RegExp]"){return t.test(e)}else if(e instanceof t){return true}else if(t.call({},e)===true){return true}return false}function v(e,t,r,n){var a;if(i.isString(r)){n=r;r=null}try{t()}catch(s){a=s}n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:".");if(e&&!a){u(a,r,"Missing expected exception"+n)}if(!e&&m(a,r)){u(a,r,"Got unwanted exception"+n)}if(e&&a&&r&&!m(a,r)||!e&&a){throw a}}s.throws=function(e,t,r){v.apply(this,[true].concat(n.call(arguments)))};s.doesNotThrow=function(e,t){v.apply(this,[false].concat(n.call(arguments)))};s.ifError=function(e){if(e){throw e}};var g=Object.keys||function(e){var t=[];for(var r in e){if(a.call(e,r))t.push(r)}return t}},{"util/":98}],52:[function(e,t,r){arguments[4][50][0].apply(r,arguments)},{dup:50}],53:[function(e,t,r){"use strict";var i=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";r.assign=function(e){var t=Array.prototype.slice.call(arguments,1);while(t.length){var r=t.shift();if(!r){continue}if(typeof r!=="object"){throw new TypeError(r+"must be non-object")}for(var i in r){if(r.hasOwnProperty(i)){e[i]=r[i]}}}return e};r.shrinkBuf=function(e,t){if(e.length===t){return e}if(e.subarray){return e.subarray(0,t)}e.length=t;return e};var n={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var a=0;a<i;a++){e[n+a]=t[r+a]}},flattenChunks:function(e){var t,r,i,n,a,s;i=0;for(t=0,r=e.length;t<r;t++){
+i+=e[t].length}s=new Uint8Array(i);n=0;for(t=0,r=e.length;t<r;t++){a=e[t];s.set(a,n);n+=a.length}return s}};var a={arraySet:function(e,t,r,i,n){for(var a=0;a<i;a++){e[n+a]=t[r+a]}},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){if(e){r.Buf8=Uint8Array;r.Buf16=Uint16Array;r.Buf32=Int32Array;r.assign(r,n)}else{r.Buf8=Array;r.Buf16=Array;r.Buf32=Array;r.assign(r,a)}};r.setTyped(i)},{}],54:[function(e,t,r){"use strict";function i(e,t,r,i){var n=e&65535|0,a=e>>>16&65535|0,s=0;while(r!==0){s=r>2e3?2e3:r;r-=s;do{n=n+t[i++]|0;a=a+n|0}while(--s);n%=65521;a%=65521}return n|a<<16|0}t.exports=i},{}],55:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],56:[function(e,t,r){"use strict";function i(){var e,t=[];for(var r=0;r<256;r++){e=r;for(var i=0;i<8;i++){e=e&1?3988292384^e>>>1:e>>>1}t[r]=e}return t}var n=i();function a(e,t,r,i){var a=n,s=i+r;e=e^-1;for(var o=i;o<s;o++){e=e>>>8^a[(e^t[o])&255]}return e^-1}t.exports=a},{}],57:[function(e,t,r){"use strict";var i=e("../utils/common");var n=e("./trees");var a=e("./adler32");var s=e("./crc32");var o=e("./messages");var f=0;var l=1;var u=3;var c=4;var p=5;var d=0;var h=1;var m=-2;var v=-3;var g=-5;var _=-1;var y=1;var b=2;var w=3;var x=4;var k=0;var S=2;var E=8;var A=9;var T=15;var I=8;var U=29;var L=256;var B=L+1+U;var z=30;var C=19;var R=2*B+1;var F=15;var O=3;var M=258;var N=M+O+1;var D=32;var P=42;var j=69;var H=73;var q=91;var G=103;var W=113;var Z=666;var V=1;var Y=2;var K=3;var $=4;var X=3;function J(e,t){e.msg=o[t];return t}function Q(e){return(e<<1)-(e>4?9:0)}function ee(e){var t=e.length;while(--t>=0){e[t]=0}}function te(e){var t=e.state;var r=t.pending;if(r>e.avail_out){r=e.avail_out}if(r===0){return}i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out);e.next_out+=r;t.pending_out+=r;e.total_out+=r;e.avail_out-=r;t.pending-=r;if(t.pending===0){t.pending_out=0}}function re(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t);e.block_start=e.strstart;te(e.strm)}function ie(e,t){e.pending_buf[e.pending++]=t}function ne(e,t){e.pending_buf[e.pending++]=t>>>8&255;e.pending_buf[e.pending++]=t&255}function ae(e,t,r,n){var o=e.avail_in;if(o>n){o=n}if(o===0){return 0}e.avail_in-=o;i.arraySet(t,e.input,e.next_in,o,r);if(e.state.wrap===1){e.adler=a(e.adler,t,o,r)}else if(e.state.wrap===2){e.adler=s(e.adler,t,o,r)}e.next_in+=o;e.total_in+=o;return o}function se(e,t){var r=e.max_chain_length;var i=e.strstart;var n;var a;var s=e.prev_length;var o=e.nice_match;var f=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0;var l=e.window;var u=e.w_mask;var c=e.prev;var p=e.strstart+M;var d=l[i+s-1];var h=l[i+s];if(e.prev_length>=e.good_match){r>>=2}if(o>e.lookahead){o=e.lookahead}do{n=t;if(l[n+s]!==h||l[n+s-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1]){continue}i+=2;n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&i<p);a=M-(p-i);i=p-M;if(a>s){e.match_start=t;s=a;if(a>=o){break}d=l[i+s-1];h=l[i+s]}}while((t=c[t&u])>f&&--r!==0);if(s<=e.lookahead){return s}return e.lookahead}function oe(e){var t=e.w_size;var r,n,a,s,o;do{s=e.window_size-e.lookahead-e.strstart;if(e.strstart>=t+(t-N)){i.arraySet(e.window,e.window,t,t,0);e.match_start-=t;e.strstart-=t;e.block_start-=t;n=e.hash_size;r=n;do{a=e.head[--r];e.head[r]=a>=t?a-t:0}while(--n);n=t;r=n;do{a=e.prev[--r];e.prev[r]=a>=t?a-t:0}while(--n);s+=t}if(e.strm.avail_in===0){break}n=ae(e.strm,e.window,e.strstart+e.lookahead,s);e.lookahead+=n;if(e.lookahead+e.insert>=O){o=e.strstart-e.insert;e.ins_h=e.window[o];e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;while(e.insert){e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+O-1])&e.hash_mask;e.prev[o&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=o;o++;e.insert--;if(e.lookahead+e.insert<O){break}}}}while(e.lookahead<N&&e.strm.avail_in!==0)}function fe(e,t){var r=65535;if(r>e.pending_buf_size-5){r=e.pending_buf_size-5}for(;;){if(e.lookahead<=1){oe(e);if(e.lookahead===0&&t===f){return V}if(e.lookahead===0){break}}e.strstart+=e.lookahead;e.lookahead=0;var i=e.block_start+r;if(e.strstart===0||e.strstart>=i){e.lookahead=e.strstart-i;e.strstart=i;re(e,false);if(e.strm.avail_out===0){return V}}if(e.strstart-e.block_start>=e.w_size-N){re(e,false);if(e.strm.avail_out===0){return V}}}e.insert=0;if(t===c){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.strstart>e.block_start){re(e,false);if(e.strm.avail_out===0){return V}}return V}function le(e,t){var r;var i;for(;;){if(e.lookahead<N){oe(e);if(e.lookahead<N&&t===f){return V}if(e.lookahead===0){break}}r=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}if(r!==0&&e.strstart-r<=e.w_size-N){e.match_length=se(e,r)}if(e.match_length>=O){i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-O);e.lookahead-=e.match_length;if(e.match_length<=e.max_lazy_match&&e.lookahead>=O){e.match_length--;do{e.strstart++;e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}while(--e.match_length!==0);e.strstart++}else{e.strstart+=e.match_length;e.match_length=0;e.ins_h=e.window[e.strstart];e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}}else{i=n._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(i){re(e,false);if(e.strm.avail_out===0){return V}}}e.insert=e.strstart<O-1?e.strstart:O-1;if(t===c){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return V}}return Y}function ue(e,t){var r;var i;var a;for(;;){if(e.lookahead<N){oe(e);if(e.lookahead<N&&t===f){return V}if(e.lookahead===0){break}}r=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}e.prev_length=e.match_length;e.prev_match=e.match_start;e.match_length=O-1;if(r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-N){e.match_length=se(e,r);if(e.match_length<=5&&(e.strategy===y||e.match_length===O&&e.strstart-e.match_start>4096)){e.match_length=O-1}}if(e.prev_length>=O&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-O;i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-O);e.lookahead-=e.prev_length-1;e.prev_length-=2;do{if(++e.strstart<=a){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}}while(--e.prev_length!==0);e.match_available=0;e.match_length=O-1;e.strstart++;if(i){re(e,false);if(e.strm.avail_out===0){return V}}}else if(e.match_available){i=n._tr_tally(e,0,e.window[e.strstart-1]);if(i){re(e,false)}e.strstart++;e.lookahead--;if(e.strm.avail_out===0){return V}}else{e.match_available=1;e.strstart++;e.lookahead--}}if(e.match_available){i=n._tr_tally(e,0,e.window[e.strstart-1]);e.match_available=0}e.insert=e.strstart<O-1?e.strstart:O-1;if(t===c){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return V}}return Y}function ce(e,t){var r;var i;var a,s;var o=e.window;for(;;){if(e.lookahead<=M){oe(e);if(e.lookahead<=M&&t===f){return V}if(e.lookahead===0){break}}e.match_length=0;if(e.lookahead>=O&&e.strstart>0){a=e.strstart-1;i=o[a];if(i===o[++a]&&i===o[++a]&&i===o[++a]){s=e.strstart+M;do{}while(i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&a<s);e.match_length=M-(s-a);if(e.match_length>e.lookahead){e.match_length=e.lookahead}}}if(e.match_length>=O){r=n._tr_tally(e,1,e.match_length-O);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{r=n._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(r){re(e,false);if(e.strm.avail_out===0){return V}}}e.insert=0;if(t===c){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return V}}return Y}function pe(e,t){var r;for(;;){if(e.lookahead===0){oe(e);if(e.lookahead===0){if(t===f){return V}break}}e.match_length=0;r=n._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(r){re(e,false);if(e.strm.avail_out===0){return V}}}e.insert=0;if(t===c){re(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){re(e,false);if(e.strm.avail_out===0){return V}}return Y}var de=function(e,t,r,i,n){this.good_length=e;this.max_lazy=t;this.nice_length=r;this.max_chain=i;this.func=n};var he;he=[new de(0,0,0,0,fe),new de(4,4,8,4,le),new de(4,5,16,8,le),new de(4,6,32,32,le),new de(4,4,16,16,ue),new de(8,16,32,32,ue),new de(8,16,128,128,ue),new de(8,32,128,256,ue),new de(32,128,258,1024,ue),new de(32,258,258,4096,ue)];function me(e){e.window_size=2*e.w_size;ee(e.head);e.max_lazy_match=he[e.level].max_lazy;e.good_match=he[e.level].good_length;e.nice_match=he[e.level].nice_length;e.max_chain_length=he[e.level].max_chain;e.strstart=0;e.block_start=0;e.lookahead=0;e.insert=0;e.match_length=e.prev_length=O-1;e.match_available=0;e.ins_h=0}function ve(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=E;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new i.Buf16(R*2);this.dyn_dtree=new i.Buf16((2*z+1)*2);this.bl_tree=new i.Buf16((2*C+1)*2);ee(this.dyn_ltree);ee(this.dyn_dtree);ee(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new i.Buf16(F+1);this.heap=new i.Buf16(2*B+1);ee(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new i.Buf16(2*B+1);ee(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function ge(e){var t;if(!e||!e.state){return J(e,m)}e.total_in=e.total_out=0;e.data_type=S;t=e.state;t.pending=0;t.pending_out=0;if(t.wrap<0){t.wrap=-t.wrap}t.status=t.wrap?P:W;e.adler=t.wrap===2?0:1;t.last_flush=f;n._tr_init(t);return d}function _e(e){var t=ge(e);if(t===d){me(e.state)}return t}function ye(e,t){if(!e||!e.state){return m}if(e.state.wrap!==2){return m}e.state.gzhead=t;return d}function be(e,t,r,n,a,s){if(!e){return m}var o=1;if(t===_){t=6}if(n<0){o=0;n=-n}else if(n>15){o=2;n-=16}if(a<1||a>A||r!==E||n<8||n>15||t<0||t>9||s<0||s>x){return J(e,m)}if(n===8){n=9}var f=new ve;e.state=f;f.strm=e;f.wrap=o;f.gzhead=null;f.w_bits=n;f.w_size=1<<f.w_bits;f.w_mask=f.w_size-1;f.hash_bits=a+7;f.hash_size=1<<f.hash_bits;f.hash_mask=f.hash_size-1;f.hash_shift=~~((f.hash_bits+O-1)/O);f.window=new i.Buf8(f.w_size*2);f.head=new i.Buf16(f.hash_size);f.prev=new i.Buf16(f.w_size);f.lit_bufsize=1<<a+6;f.pending_buf_size=f.lit_bufsize*4;f.pending_buf=new i.Buf8(f.pending_buf_size);f.d_buf=f.lit_bufsize>>1;f.l_buf=(1+2)*f.lit_bufsize;f.level=t;f.strategy=s;f.method=r;return _e(e)}function we(e,t){return be(e,t,E,T,I,k)}function xe(e,t){var r,i;var a,o;if(!e||!e.state||t>p||t<0){return e?J(e,m):m}i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===Z&&t!==c){return J(e,e.avail_out===0?g:m)}i.strm=e;r=i.last_flush;i.last_flush=t;if(i.status===P){if(i.wrap===2){e.adler=0;ie(i,31);ie(i,139);ie(i,8);if(!i.gzhead){ie(i,0);ie(i,0);ie(i,0);ie(i,0);ie(i,0);ie(i,i.level===9?2:i.strategy>=b||i.level<2?4:0);ie(i,X);i.status=W}else{ie(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));ie(i,i.gzhead.time&255);ie(i,i.gzhead.time>>8&255);ie(i,i.gzhead.time>>16&255);ie(i,i.gzhead.time>>24&255);ie(i,i.level===9?2:i.strategy>=b||i.level<2?4:0);ie(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){ie(i,i.gzhead.extra.length&255);ie(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){e.adler=s(e.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=j}}else{var v=E+(i.w_bits-8<<4)<<8;var _=-1;if(i.strategy>=b||i.level<2){_=0}else if(i.level<6){_=1}else if(i.level===6){_=2}else{_=3}v|=_<<6;if(i.strstart!==0){v|=D}v+=31-v%31;i.status=W;ne(i,v);if(i.strstart!==0){ne(i,e.adler>>>16);ne(i,e.adler&65535)}e.adler=1}}if(i.status===j){if(i.gzhead.extra){a=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}te(e);a=i.pending;if(i.pending===i.pending_buf_size){break}}ie(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=H}}else{i.status=H}}if(i.status===H){if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}te(e);a=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.name.length){o=i.gzhead.name.charCodeAt(i.gzindex++)&255}else{o=0}ie(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}if(o===0){i.gzindex=0;i.status=q}}else{i.status=q}}if(i.status===q){if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}te(e);a=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.comment.length){o=i.gzhead.comment.charCodeAt(i.gzindex++)&255}else{o=0}ie(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>a){e.adler=s(e.adler,i.pending_buf,i.pending-a,a)}if(o===0){i.status=G}}else{i.status=G}}if(i.status===G){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){te(e)}if(i.pending+2<=i.pending_buf_size){ie(i,e.adler&255);ie(i,e.adler>>8&255);e.adler=0;i.status=W}}else{i.status=W}}if(i.pending!==0){te(e);if(e.avail_out===0){i.last_flush=-1;return d}}else if(e.avail_in===0&&Q(t)<=Q(r)&&t!==c){return J(e,g)}if(i.status===Z&&e.avail_in!==0){return J(e,g)}if(e.avail_in!==0||i.lookahead!==0||t!==f&&i.status!==Z){var y=i.strategy===b?pe(i,t):i.strategy===w?ce(i,t):he[i.level].func(i,t);if(y===K||y===$){i.status=Z}if(y===V||y===K){if(e.avail_out===0){i.last_flush=-1}return d}if(y===Y){if(t===l){n._tr_align(i)}else if(t!==p){n._tr_stored_block(i,0,0,false);if(t===u){ee(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}te(e);if(e.avail_out===0){i.last_flush=-1;return d}}}if(t!==c){return d}if(i.wrap<=0){return h}if(i.wrap===2){ie(i,e.adler&255);ie(i,e.adler>>8&255);ie(i,e.adler>>16&255);ie(i,e.adler>>24&255);ie(i,e.total_in&255);ie(i,e.total_in>>8&255);ie(i,e.total_in>>16&255);ie(i,e.total_in>>24&255)}else{ne(i,e.adler>>>16);ne(i,e.adler&65535)}te(e);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?d:h}function ke(e){var t;if(!e||!e.state){return m}t=e.state.status;if(t!==P&&t!==j&&t!==H&&t!==q&&t!==G&&t!==W&&t!==Z){return J(e,m)}e.state=null;return t===W?J(e,v):d}r.deflateInit=we;r.deflateInit2=be;r.deflateReset=_e;r.deflateResetKeep=ge;r.deflateSetHeader=ye;r.deflate=xe;r.deflateEnd=ke;r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":53,"./adler32":54,"./crc32":56,"./messages":61,"./trees":62}],58:[function(e,t,r){"use strict";var i=30;var n=12;t.exports=function a(e,t){var r;var a;var s;var o;var f;var l;var u;var c;var p;var d;var h;var m;var v;var g;var _;var y;var b;var w;var x;var k;var S;var E;var A;var T,I;r=e.state;a=e.next_in;T=e.input;s=a+(e.avail_in-5);o=e.next_out;I=e.output;f=o-(t-e.avail_out);l=o+(e.avail_out-257);u=r.dmax;c=r.wsize;p=r.whave;d=r.wnext;h=r.window;m=r.hold;v=r.bits;g=r.lencode;_=r.distcode;y=(1<<r.lenbits)-1;b=(1<<r.distbits)-1;e:do{if(v<15){m+=T[a++]<<v;v+=8;m+=T[a++]<<v;v+=8}w=g[m&y];t:for(;;){x=w>>>24;m>>>=x;v-=x;x=w>>>16&255;if(x===0){I[o++]=w&65535}else if(x&16){k=w&65535;x&=15;if(x){if(v<x){m+=T[a++]<<v;v+=8}k+=m&(1<<x)-1;m>>>=x;v-=x}if(v<15){m+=T[a++]<<v;v+=8;m+=T[a++]<<v;v+=8}w=_[m&b];r:for(;;){x=w>>>24;m>>>=x;v-=x;x=w>>>16&255;if(x&16){S=w&65535;x&=15;if(v<x){m+=T[a++]<<v;v+=8;if(v<x){m+=T[a++]<<v;v+=8}}S+=m&(1<<x)-1;if(S>u){e.msg="invalid distance too far back";r.mode=i;break e}m>>>=x;v-=x;x=o-f;if(S>x){x=S-x;if(x>p){if(r.sane){e.msg="invalid distance too far back";r.mode=i;break e}}E=0;A=h;if(d===0){E+=c-x;if(x<k){k-=x;do{I[o++]=h[E++]}while(--x);E=o-S;A=I}}else if(d<x){E+=c+d-x;x-=d;if(x<k){k-=x;do{I[o++]=h[E++]}while(--x);E=0;if(d<k){x=d;k-=x;do{I[o++]=h[E++]}while(--x);E=o-S;A=I}}}else{E+=d-x;if(x<k){k-=x;do{I[o++]=h[E++]}while(--x);E=o-S;A=I}}while(k>2){I[o++]=A[E++];I[o++]=A[E++];I[o++]=A[E++];k-=3}if(k){I[o++]=A[E++];if(k>1){I[o++]=A[E++]}}}else{E=o-S;do{I[o++]=I[E++];I[o++]=I[E++];I[o++]=I[E++];k-=3}while(k>2);if(k){I[o++]=I[E++];if(k>1){I[o++]=I[E++]}}}}else if((x&64)===0){w=_[(w&65535)+(m&(1<<x)-1)];continue r}else{e.msg="invalid distance code";r.mode=i;break e}break}}else if((x&64)===0){w=g[(w&65535)+(m&(1<<x)-1)];continue t}else if(x&32){r.mode=n;break e}else{e.msg="invalid literal/length code";r.mode=i;break e}break}}while(a<s&&o<l);k=v>>3;a-=k;v-=k<<3;m&=(1<<v)-1;e.next_in=a;e.next_out=o;e.avail_in=a<s?5+(s-a):5-(a-s);e.avail_out=o<l?257+(l-o):257-(o-l);r.hold=m;r.bits=v;return}},{}],59:[function(e,t,r){"use strict";var i=e("../utils/common");var n=e("./adler32");var a=e("./crc32");var s=e("./inffast");var o=e("./inftrees");var f=0;var l=1;var u=2;var c=4;var p=5;var d=6;var h=0;var m=1;var v=2;var g=-2;var _=-3;var y=-4;var b=-5;var w=8;var x=1;var k=2;var S=3;var E=4;var A=5;var T=6;var I=7;var U=8;var L=9;var B=10;var z=11;var C=12;var R=13;var F=14;var O=15;var M=16;var N=17;var D=18;var P=19;var j=20;var H=21;var q=22;var G=23;var W=24;var Z=25;var V=26;var Y=27;var K=28;var $=29;var X=30;var J=31;var Q=32;var ee=852;var te=592;var re=15;var ie=re;function ne(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function ae(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new i.Buf16(320);this.work=new i.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function se(e){var t;if(!e||!e.state){return g}t=e.state;e.total_in=e.total_out=t.total=0;e.msg="";if(t.wrap){e.adler=t.wrap&1}t.mode=x;t.last=0;t.havedict=0;t.dmax=32768;t.head=null;t.hold=0;t.bits=0;t.lencode=t.lendyn=new i.Buf32(ee);t.distcode=t.distdyn=new i.Buf32(te);t.sane=1;t.back=-1;return h}function oe(e){var t;if(!e||!e.state){return g}t=e.state;t.wsize=0;t.whave=0;t.wnext=0;return se(e)}function fe(e,t){var r;var i;if(!e||!e.state){return g}i=e.state;if(t<0){r=0;t=-t}else{r=(t>>4)+1;if(t<48){t&=15}}if(t&&(t<8||t>15)){return g}if(i.window!==null&&i.wbits!==t){i.window=null}i.wrap=r;i.wbits=t;return oe(e)}function le(e,t){var r;var i;if(!e){return g}i=new ae;e.state=i;i.window=null;r=fe(e,t);if(r!==h){e.state=null}return r}function ue(e){return le(e,ie)}var ce=true;var pe,de;function he(e){if(ce){var t;pe=new i.Buf32(512);de=new i.Buf32(32);t=0;while(t<144){e.lens[t++]=8}while(t<256){e.lens[t++]=9}while(t<280){e.lens[t++]=7}while(t<288){e.lens[t++]=8}o(l,e.lens,0,288,pe,0,e.work,{bits:9});t=0;while(t<32){e.lens[t++]=5}o(u,e.lens,0,32,de,0,e.work,{bits:5});ce=false}e.lencode=pe;e.lenbits=9;e.distcode=de;e.distbits=5}function me(e,t,r,n){var a;var s=e.state;if(s.window===null){s.wsize=1<<s.wbits;s.wnext=0;s.whave=0;s.window=new i.Buf8(s.wsize)}if(n>=s.wsize){i.arraySet(s.window,t,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{a=s.wsize-s.wnext;if(a>n){a=n}i.arraySet(s.window,t,r-n,a,s.wnext);n-=a;if(n){i.arraySet(s.window,t,r-n,n,0);s.wnext=n;s.whave=s.wsize}else{s.wnext+=a;if(s.wnext===s.wsize){s.wnext=0}if(s.whave<s.wsize){s.whave+=a}}}return 0}function ve(e,t){var r;var ee,te;var re;var ie;var ae,se;var oe;var fe;var le,ue;var ce;var pe;var de;var ve=0;var ge,_e,ye;var be,we,xe;var ke;var Se;var Ee=new i.Buf8(4);var Ae;var Te;var Ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0){return g}r=e.state;if(r.mode===C){r.mode=R}ie=e.next_out;te=e.output;se=e.avail_out;re=e.next_in;ee=e.input;ae=e.avail_in;oe=r.hold;fe=r.bits;le=ae;ue=se;Se=h;e:for(;;){switch(r.mode){case x:if(r.wrap===0){r.mode=R;break}while(fe<16){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(r.wrap&2&&oe===35615){r.check=0;Ee[0]=oe&255;Ee[1]=oe>>>8&255;r.check=a(r.check,Ee,2,0);oe=0;fe=0;r.mode=k;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((oe&255)<<8)+(oe>>8))%31){e.msg="incorrect header check";r.mode=X;break}if((oe&15)!==w){e.msg="unknown compression method";r.mode=X;break}oe>>>=4;fe-=4;ke=(oe&15)+8;if(r.wbits===0){r.wbits=ke}else if(ke>r.wbits){e.msg="invalid window size";r.mode=X;break}r.dmax=1<<ke;e.adler=r.check=1;r.mode=oe&512?B:C;oe=0;fe=0;break;case k:while(fe<16){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.flags=oe;if((r.flags&255)!==w){e.msg="unknown compression method";r.mode=X;break}if(r.flags&57344){e.msg="unknown header flags set";r.mode=X;break}if(r.head){r.head.text=oe>>8&1}if(r.flags&512){Ee[0]=oe&255;Ee[1]=oe>>>8&255;r.check=a(r.check,Ee,2,0)}oe=0;fe=0;r.mode=S;case S:while(fe<32){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(r.head){r.head.time=oe}if(r.flags&512){Ee[0]=oe&255;Ee[1]=oe>>>8&255;Ee[2]=oe>>>16&255;Ee[3]=oe>>>24&255;r.check=a(r.check,Ee,4,0)}oe=0;fe=0;r.mode=E;case E:while(fe<16){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(r.head){r.head.xflags=oe&255;r.head.os=oe>>8}if(r.flags&512){Ee[0]=oe&255;Ee[1]=oe>>>8&255;r.check=a(r.check,Ee,2,0)}oe=0;fe=0;r.mode=A;case A:if(r.flags&1024){while(fe<16){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.length=oe;if(r.head){r.head.extra_len=oe}if(r.flags&512){Ee[0]=oe&255;Ee[1]=oe>>>8&255;r.check=a(r.check,Ee,2,0)}oe=0;fe=0}else if(r.head){r.head.extra=null}r.mode=T;case T:if(r.flags&1024){ce=r.length;if(ce>ae){ce=ae}if(ce){if(r.head){ke=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}i.arraySet(r.head.extra,ee,re,ce,ke)}if(r.flags&512){r.check=a(r.check,ee,ce,re)}ae-=ce;re+=ce;r.length-=ce}if(r.length){break e}}r.length=0;r.mode=I;case I:if(r.flags&2048){if(ae===0){break e}ce=0;do{ke=ee[re+ce++];if(r.head&&ke&&r.length<65536){r.head.name+=String.fromCharCode(ke)}}while(ke&&ce<ae);if(r.flags&512){r.check=a(r.check,ee,ce,re)}ae-=ce;re+=ce;if(ke){break e}}else if(r.head){r.head.name=null}r.length=0;r.mode=U;case U:if(r.flags&4096){if(ae===0){break e}ce=0;do{ke=ee[re+ce++];if(r.head&&ke&&r.length<65536){r.head.comment+=String.fromCharCode(ke)}}while(ke&&ce<ae);if(r.flags&512){r.check=a(r.check,ee,ce,re)}ae-=ce;re+=ce;if(ke){break e}}else if(r.head){r.head.comment=null}r.mode=L;case L:if(r.flags&512){while(fe<16){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(oe!==(r.check&65535)){e.msg="header crc mismatch";r.mode=X;break}oe=0;fe=0}if(r.head){r.head.hcrc=r.flags>>9&1;r.head.done=true}e.adler=r.check=0;r.mode=C;break;case B:while(fe<32){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}e.adler=r.check=ne(oe);oe=0;fe=0;r.mode=z;case z:if(r.havedict===0){e.next_out=ie;e.avail_out=se;e.next_in=re;e.avail_in=ae;r.hold=oe;r.bits=fe;return v}e.adler=r.check=1;r.mode=C;case C:if(t===p||t===d){break e}case R:if(r.last){oe>>>=fe&7;fe-=fe&7;r.mode=Y;break}while(fe<3){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.last=oe&1;oe>>>=1;fe-=1;switch(oe&3){case 0:r.mode=F;break;case 1:he(r);r.mode=j;if(t===d){oe>>>=2;fe-=2;break e}break;case 2:r.mode=N;break;case 3:e.msg="invalid block type";r.mode=X}oe>>>=2;fe-=2;break;case F:oe>>>=fe&7;fe-=fe&7;while(fe<32){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if((oe&65535)!==(oe>>>16^65535)){e.msg="invalid stored block lengths";r.mode=X;break}r.length=oe&65535;oe=0;fe=0;r.mode=O;if(t===d){break e}case O:r.mode=M;case M:ce=r.length;if(ce){if(ce>ae){ce=ae}if(ce>se){ce=se}if(ce===0){break e}i.arraySet(te,ee,re,ce,ie);ae-=ce;re+=ce;se-=ce;ie+=ce;r.length-=ce;break}r.mode=C;break;case N:while(fe<14){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.nlen=(oe&31)+257;oe>>>=5;fe-=5;r.ndist=(oe&31)+1;oe>>>=5;fe-=5;r.ncode=(oe&15)+4;oe>>>=4;fe-=4;if(r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols";r.mode=X;break}r.have=0;r.mode=D;case D:while(r.have<r.ncode){while(fe<3){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.lens[Ie[r.have++]]=oe&7;oe>>>=3;fe-=3}while(r.have<19){r.lens[Ie[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;Ae={bits:r.lenbits};Se=o(f,r.lens,0,19,r.lencode,0,r.work,Ae);r.lenbits=Ae.bits;if(Se){e.msg="invalid code lengths set";r.mode=X;break}r.have=0;r.mode=P;case P:while(r.have<r.nlen+r.ndist){for(;;){ve=r.lencode[oe&(1<<r.lenbits)-1];ge=ve>>>24;_e=ve>>>16&255;ye=ve&65535;if(ge<=fe){break}if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(ye<16){oe>>>=ge;fe-=ge;r.lens[r.have++]=ye}else{if(ye===16){Te=ge+2;while(fe<Te){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}oe>>>=ge;fe-=ge;if(r.have===0){e.msg="invalid bit length repeat";r.mode=X;break}ke=r.lens[r.have-1];ce=3+(oe&3);oe>>>=2;fe-=2}else if(ye===17){Te=ge+3;while(fe<Te){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}oe>>>=ge;fe-=ge;ke=0;ce=3+(oe&7);oe>>>=3;fe-=3}else{Te=ge+7;while(fe<Te){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}oe>>>=ge;fe-=ge;ke=0;ce=11+(oe&127);oe>>>=7;fe-=7}if(r.have+ce>r.nlen+r.ndist){e.msg="invalid bit length repeat";r.mode=X;break}while(ce--){r.lens[r.have++]=ke}}}if(r.mode===X){break}if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block";r.mode=X;break}r.lenbits=9;Ae={bits:r.lenbits};Se=o(l,r.lens,0,r.nlen,r.lencode,0,r.work,Ae);r.lenbits=Ae.bits;if(Se){e.msg="invalid literal/lengths set";r.mode=X;break}r.distbits=6;r.distcode=r.distdyn;Ae={bits:r.distbits};Se=o(u,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ae);r.distbits=Ae.bits;if(Se){e.msg="invalid distances set";r.mode=X;break}r.mode=j;if(t===d){break e}case j:r.mode=H;case H:if(ae>=6&&se>=258){e.next_out=ie;e.avail_out=se;e.next_in=re;e.avail_in=ae;r.hold=oe;r.bits=fe;s(e,ue);ie=e.next_out;te=e.output;se=e.avail_out;re=e.next_in;ee=e.input;ae=e.avail_in;oe=r.hold;fe=r.bits;if(r.mode===C){r.back=-1}break}r.back=0;for(;;){ve=r.lencode[oe&(1<<r.lenbits)-1];ge=ve>>>24;_e=ve>>>16&255;ye=ve&65535;if(ge<=fe){break}if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(_e&&(_e&240)===0){be=ge;we=_e;xe=ye;for(;;){ve=r.lencode[xe+((oe&(1<<be+we)-1)>>be)];ge=ve>>>24;_e=ve>>>16&255;ye=ve&65535;if(be+ge<=fe){break}if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}oe>>>=be;fe-=be;r.back+=be}oe>>>=ge;fe-=ge;r.back+=ge;r.length=ye;if(_e===0){r.mode=V;break}if(_e&32){r.back=-1;r.mode=C;break}if(_e&64){e.msg="invalid literal/length code";r.mode=X;break}r.extra=_e&15;r.mode=q;case q:if(r.extra){Te=r.extra;while(fe<Te){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.length+=oe&(1<<r.extra)-1;oe>>>=r.extra;fe-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=G;case G:for(;;){ve=r.distcode[oe&(1<<r.distbits)-1];ge=ve>>>24;_e=ve>>>16&255;ye=ve&65535;if(ge<=fe){break}if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if((_e&240)===0){be=ge;we=_e;xe=ye;for(;;){ve=r.distcode[xe+((oe&(1<<be+we)-1)>>be)];ge=ve>>>24;_e=ve>>>16&255;ye=ve&65535;if(be+ge<=fe){break}if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}oe>>>=be;fe-=be;r.back+=be}oe>>>=ge;fe-=ge;r.back+=ge;if(_e&64){e.msg="invalid distance code";r.mode=X;break}r.offset=ye;r.extra=_e&15;r.mode=W;case W:if(r.extra){Te=r.extra;while(fe<Te){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}r.offset+=oe&(1<<r.extra)-1;oe>>>=r.extra;fe-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back";r.mode=X;break}r.mode=Z;case Z:if(se===0){break e}ce=ue-se;if(r.offset>ce){ce=r.offset-ce;if(ce>r.whave){if(r.sane){e.msg="invalid distance too far back";r.mode=X;break}}if(ce>r.wnext){ce-=r.wnext;pe=r.wsize-ce}else{pe=r.wnext-ce}if(ce>r.length){ce=r.length}de=r.window}else{de=te;pe=ie-r.offset;ce=r.length}if(ce>se){ce=se}se-=ce;r.length-=ce;do{te[ie++]=de[pe++]}while(--ce);if(r.length===0){r.mode=H}break;case V:if(se===0){break e}te[ie++]=r.length;se--;r.mode=H;break;case Y:if(r.wrap){while(fe<32){if(ae===0){break e}ae--;oe|=ee[re++]<<fe;fe+=8}ue-=se;e.total_out+=ue;r.total+=ue;if(ue){e.adler=r.check=r.flags?a(r.check,te,ue,ie-ue):n(r.check,te,ue,ie-ue)}ue=se;if((r.flags?oe:ne(oe))!==r.check){e.msg="incorrect data check";r.mode=X;break}oe=0;fe=0}r.mode=K;case K:if(r.wrap&&r.flags){while(fe<32){if(ae===0){break e}ae--;oe+=ee[re++]<<fe;fe+=8}if(oe!==(r.total&4294967295)){e.msg="incorrect length check";r.mode=X;break}oe=0;fe=0}r.mode=$;case $:Se=m;break e;case X:Se=_;break e;case J:return y;case Q:default:return g}}e.next_out=ie;e.avail_out=se;e.next_in=re;e.avail_in=ae;r.hold=oe;r.bits=fe;if(r.wsize||ue!==e.avail_out&&r.mode<X&&(r.mode<Y||t!==c)){if(me(e,e.output,e.next_out,ue-e.avail_out)){r.mode=J;return y}}le-=e.avail_in;ue-=e.avail_out;e.total_in+=le;e.total_out+=ue;r.total+=ue;if(r.wrap&&ue){e.adler=r.check=r.flags?a(r.check,te,ue,e.next_out-ue):n(r.check,te,ue,e.next_out-ue)}e.data_type=r.bits+(r.last?64:0)+(r.mode===C?128:0)+(r.mode===j||r.mode===O?256:0);if((le===0&&ue===0||t===c)&&Se===h){Se=b}return Se}function ge(e){if(!e||!e.state){return g}var t=e.state;if(t.window){t.window=null}e.state=null;return h}function _e(e,t){var r;if(!e||!e.state){return g}r=e.state;if((r.wrap&2)===0){return g}r.head=t;t.done=false;return h}r.inflateReset=oe;r.inflateReset2=fe;r.inflateResetKeep=se;r.inflateInit=ue;r.inflateInit2=le;r.inflate=ve;r.inflateEnd=ge;r.inflateGetHeader=_e;r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":53,"./adler32":54,"./crc32":56,"./inffast":58,"./inftrees":60}],60:[function(e,t,r){"use strict";var i=e("../utils/common");var n=15;var a=852;var s=592;var o=0;var f=1;var l=2;var u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var c=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var p=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function h(e,t,r,m,v,g,_,y){var b=y.bits;var w=0;var x=0;var k=0,S=0;var E=0;var A=0;var T=0;var I=0;var U=0;var L=0;var B;var z;var C;var R;var F;var O=null;var M=0;var N;var D=new i.Buf16(n+1);var P=new i.Buf16(n+1);var j=null;var H=0;var q,G,W;for(w=0;w<=n;w++){D[w]=0}for(x=0;x<m;x++){D[t[r+x]]++}E=b;for(S=n;S>=1;S--){if(D[S]!==0){break}}if(E>S){E=S}if(S===0){v[g++]=1<<24|64<<16|0;v[g++]=1<<24|64<<16|0;y.bits=1;return 0}for(k=1;k<S;k++){if(D[k]!==0){break}}if(E<k){E=k}I=1;for(w=1;w<=n;w++){I<<=1;I-=D[w];if(I<0){return-1}}if(I>0&&(e===o||S!==1)){return-1}P[1]=0;for(w=1;w<n;w++){P[w+1]=P[w]+D[w]}for(x=0;x<m;x++){if(t[r+x]!==0){_[P[t[r+x]]++]=x}}if(e===o){O=j=_;N=19}else if(e===f){O=u;M-=257;j=c;H-=257;N=256}else{O=p;j=d;N=-1}L=0;x=0;w=k;F=g;A=E;T=0;C=-1;U=1<<E;R=U-1;if(e===f&&U>a||e===l&&U>s){return 1}var Z=0;for(;;){Z++;q=w-T;if(_[x]<N){G=0;W=_[x]}else if(_[x]>N){G=j[H+_[x]];W=O[M+_[x]]}else{G=32+64;W=0}B=1<<w-T;z=1<<A;k=z;do{z-=B;v[F+(L>>T)+z]=q<<24|G<<16|W|0}while(z!==0);B=1<<w-1;
+while(L&B){B>>=1}if(B!==0){L&=B-1;L+=B}else{L=0}x++;if(--D[w]===0){if(w===S){break}w=t[r+_[x]]}if(w>E&&(L&R)!==C){if(T===0){T=E}F+=k;A=w-T;I=1<<A;while(A+T<S){I-=D[A+T];if(I<=0){break}A++;I<<=1}U+=1<<A;if(e===f&&U>a||e===l&&U>s){return 1}C=L&R;v[C]=E<<24|A<<16|F-g|0}}if(L!==0){v[F+L]=w-T<<24|64<<16|0}y.bits=E;return 0}},{"../utils/common":53}],61:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],62:[function(e,t,r){"use strict";var i=e("../utils/common");var n=4;var a=0;var s=1;var o=2;function f(e){var t=e.length;while(--t>=0){e[t]=0}}var l=0;var u=1;var c=2;var p=3;var d=258;var h=29;var m=256;var v=m+1+h;var g=30;var _=19;var y=2*v+1;var b=15;var w=16;var x=7;var k=256;var S=16;var E=17;var A=18;var T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var U=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var B=512;var z=new Array((v+2)*2);f(z);var C=new Array(g*2);f(C);var R=new Array(B);f(R);var F=new Array(d-p+1);f(F);var O=new Array(h);f(O);var M=new Array(g);f(M);var N=function(e,t,r,i,n){this.static_tree=e;this.extra_bits=t;this.extra_base=r;this.elems=i;this.max_length=n;this.has_stree=e&&e.length};var D;var P;var j;var H=function(e,t){this.dyn_tree=e;this.max_code=0;this.stat_desc=t};function q(e){return e<256?R[e]:R[256+(e>>>7)]}function G(e,t){e.pending_buf[e.pending++]=t&255;e.pending_buf[e.pending++]=t>>>8&255}function W(e,t,r){if(e.bi_valid>w-r){e.bi_buf|=t<<e.bi_valid&65535;G(e,e.bi_buf);e.bi_buf=t>>w-e.bi_valid;e.bi_valid+=r-w}else{e.bi_buf|=t<<e.bi_valid&65535;e.bi_valid+=r}}function Z(e,t,r){W(e,r[t*2],r[t*2+1])}function V(e,t){var r=0;do{r|=e&1;e>>>=1;r<<=1}while(--t>0);return r>>>1}function Y(e){if(e.bi_valid===16){G(e,e.bi_buf);e.bi_buf=0;e.bi_valid=0}else if(e.bi_valid>=8){e.pending_buf[e.pending++]=e.bi_buf&255;e.bi_buf>>=8;e.bi_valid-=8}}function K(e,t){var r=t.dyn_tree;var i=t.max_code;var n=t.stat_desc.static_tree;var a=t.stat_desc.has_stree;var s=t.stat_desc.extra_bits;var o=t.stat_desc.extra_base;var f=t.stat_desc.max_length;var l;var u,c;var p;var d;var h;var m=0;for(p=0;p<=b;p++){e.bl_count[p]=0}r[e.heap[e.heap_max]*2+1]=0;for(l=e.heap_max+1;l<y;l++){u=e.heap[l];p=r[r[u*2+1]*2+1]+1;if(p>f){p=f;m++}r[u*2+1]=p;if(u>i){continue}e.bl_count[p]++;d=0;if(u>=o){d=s[u-o]}h=r[u*2];e.opt_len+=h*(p+d);if(a){e.static_len+=h*(n[u*2+1]+d)}}if(m===0){return}do{p=f-1;while(e.bl_count[p]===0){p--}e.bl_count[p]--;e.bl_count[p+1]+=2;e.bl_count[f]--;m-=2}while(m>0);for(p=f;p!==0;p--){u=e.bl_count[p];while(u!==0){c=e.heap[--l];if(c>i){continue}if(r[c*2+1]!==p){e.opt_len+=(p-r[c*2+1])*r[c*2];r[c*2+1]=p}u--}}}function $(e,t,r){var i=new Array(b+1);var n=0;var a;var s;for(a=1;a<=b;a++){i[a]=n=n+r[a-1]<<1}for(s=0;s<=t;s++){var o=e[s*2+1];if(o===0){continue}e[s*2]=V(i[o]++,o)}}function X(){var e;var t;var r;var i;var n;var a=new Array(b+1);r=0;for(i=0;i<h-1;i++){O[i]=r;for(e=0;e<1<<T[i];e++){F[r++]=i}}F[r-1]=i;n=0;for(i=0;i<16;i++){M[i]=n;for(e=0;e<1<<I[i];e++){R[n++]=i}}n>>=7;for(;i<g;i++){M[i]=n<<7;for(e=0;e<1<<I[i]-7;e++){R[256+n++]=i}}for(t=0;t<=b;t++){a[t]=0}e=0;while(e<=143){z[e*2+1]=8;e++;a[8]++}while(e<=255){z[e*2+1]=9;e++;a[9]++}while(e<=279){z[e*2+1]=7;e++;a[7]++}while(e<=287){z[e*2+1]=8;e++;a[8]++}$(z,v+1,a);for(e=0;e<g;e++){C[e*2+1]=5;C[e*2]=V(e,5)}D=new N(z,T,m+1,v,b);P=new N(C,I,0,g,b);j=new N(new Array(0),U,0,_,x)}function J(e){var t;for(t=0;t<v;t++){e.dyn_ltree[t*2]=0}for(t=0;t<g;t++){e.dyn_dtree[t*2]=0}for(t=0;t<_;t++){e.bl_tree[t*2]=0}e.dyn_ltree[k*2]=1;e.opt_len=e.static_len=0;e.last_lit=e.matches=0}function Q(e){if(e.bi_valid>8){G(e,e.bi_buf)}else if(e.bi_valid>0){e.pending_buf[e.pending++]=e.bi_buf}e.bi_buf=0;e.bi_valid=0}function ee(e,t,r,n){Q(e);if(n){G(e,r);G(e,~r)}i.arraySet(e.pending_buf,e.window,t,r,e.pending);e.pending+=r}function te(e,t,r,i){var n=t*2;var a=r*2;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]}function re(e,t,r){var i=e.heap[r];var n=r<<1;while(n<=e.heap_len){if(n<e.heap_len&&te(t,e.heap[n+1],e.heap[n],e.depth)){n++}if(te(t,i,e.heap[n],e.depth)){break}e.heap[r]=e.heap[n];r=n;n<<=1}e.heap[r]=i}function ie(e,t,r){var i;var n;var a=0;var s;var o;if(e.last_lit!==0){do{i=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1];n=e.pending_buf[e.l_buf+a];a++;if(i===0){Z(e,n,t)}else{s=F[n];Z(e,s+m+1,t);o=T[s];if(o!==0){n-=O[s];W(e,n,o)}i--;s=q(i);Z(e,s,r);o=I[s];if(o!==0){i-=M[s];W(e,i,o)}}}while(a<e.last_lit)}Z(e,k,t)}function ne(e,t){var r=t.dyn_tree;var i=t.stat_desc.static_tree;var n=t.stat_desc.has_stree;var a=t.stat_desc.elems;var s,o;var f=-1;var l;e.heap_len=0;e.heap_max=y;for(s=0;s<a;s++){if(r[s*2]!==0){e.heap[++e.heap_len]=f=s;e.depth[s]=0}else{r[s*2+1]=0}}while(e.heap_len<2){l=e.heap[++e.heap_len]=f<2?++f:0;r[l*2]=1;e.depth[l]=0;e.opt_len--;if(n){e.static_len-=i[l*2+1]}}t.max_code=f;for(s=e.heap_len>>1;s>=1;s--){re(e,r,s)}l=a;do{s=e.heap[1];e.heap[1]=e.heap[e.heap_len--];re(e,r,1);o=e.heap[1];e.heap[--e.heap_max]=s;e.heap[--e.heap_max]=o;r[l*2]=r[s*2]+r[o*2];e.depth[l]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1;r[s*2+1]=r[o*2+1]=l;e.heap[1]=l++;re(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];K(e,t);$(r,f,e.bl_count)}function ae(e,t,r){var i;var n=-1;var a;var s=t[0*2+1];var o=0;var f=7;var l=4;if(s===0){f=138;l=3}t[(r+1)*2+1]=65535;for(i=0;i<=r;i++){a=s;s=t[(i+1)*2+1];if(++o<f&&a===s){continue}else if(o<l){e.bl_tree[a*2]+=o}else if(a!==0){if(a!==n){e.bl_tree[a*2]++}e.bl_tree[S*2]++}else if(o<=10){e.bl_tree[E*2]++}else{e.bl_tree[A*2]++}o=0;n=a;if(s===0){f=138;l=3}else if(a===s){f=6;l=3}else{f=7;l=4}}}function se(e,t,r){var i;var n=-1;var a;var s=t[0*2+1];var o=0;var f=7;var l=4;if(s===0){f=138;l=3}for(i=0;i<=r;i++){a=s;s=t[(i+1)*2+1];if(++o<f&&a===s){continue}else if(o<l){do{Z(e,a,e.bl_tree)}while(--o!==0)}else if(a!==0){if(a!==n){Z(e,a,e.bl_tree);o--}Z(e,S,e.bl_tree);W(e,o-3,2)}else if(o<=10){Z(e,E,e.bl_tree);W(e,o-3,3)}else{Z(e,A,e.bl_tree);W(e,o-11,7)}o=0;n=a;if(s===0){f=138;l=3}else if(a===s){f=6;l=3}else{f=7;l=4}}}function oe(e){var t;ae(e,e.dyn_ltree,e.l_desc.max_code);ae(e,e.dyn_dtree,e.d_desc.max_code);ne(e,e.bl_desc);for(t=_-1;t>=3;t--){if(e.bl_tree[L[t]*2+1]!==0){break}}e.opt_len+=3*(t+1)+5+5+4;return t}function fe(e,t,r,i){var n;W(e,t-257,5);W(e,r-1,5);W(e,i-4,4);for(n=0;n<i;n++){W(e,e.bl_tree[L[n]*2+1],3)}se(e,e.dyn_ltree,t-1);se(e,e.dyn_dtree,r-1)}function le(e){var t=4093624447;var r;for(r=0;r<=31;r++,t>>>=1){if(t&1&&e.dyn_ltree[r*2]!==0){return a}}if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0){return s}for(r=32;r<m;r++){if(e.dyn_ltree[r*2]!==0){return s}}return a}var ue=false;function ce(e){if(!ue){X();ue=true}e.l_desc=new H(e.dyn_ltree,D);e.d_desc=new H(e.dyn_dtree,P);e.bl_desc=new H(e.bl_tree,j);e.bi_buf=0;e.bi_valid=0;J(e)}function pe(e,t,r,i){W(e,(l<<1)+(i?1:0),3);ee(e,t,r,true)}function de(e){W(e,u<<1,3);Z(e,k,z);Y(e)}function he(e,t,r,i){var a,s;var f=0;if(e.level>0){if(e.strm.data_type===o){e.strm.data_type=le(e)}ne(e,e.l_desc);ne(e,e.d_desc);f=oe(e);a=e.opt_len+3+7>>>3;s=e.static_len+3+7>>>3;if(s<=a){a=s}}else{a=s=r+5}if(r+4<=a&&t!==-1){pe(e,t,r,i)}else if(e.strategy===n||s===a){W(e,(u<<1)+(i?1:0),3);ie(e,z,C)}else{W(e,(c<<1)+(i?1:0),3);fe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1);ie(e,e.dyn_ltree,e.dyn_dtree)}J(e);if(i){Q(e)}}function me(e,t,r){e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255;e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255;e.pending_buf[e.l_buf+e.last_lit]=r&255;e.last_lit++;if(t===0){e.dyn_ltree[r*2]++}else{e.matches++;t--;e.dyn_ltree[(F[r]+m+1)*2]++;e.dyn_dtree[q(t)*2]++}return e.last_lit===e.lit_bufsize-1}r._tr_init=ce;r._tr_stored_block=pe;r._tr_flush_block=he;r._tr_tally=me;r._tr_align=de},{"../utils/common":53}],63:[function(e,t,r){"use strict";function i(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}t.exports=i},{}],64:[function(e,t,r){(function(t,i){var n=e("pako/lib/zlib/messages");var a=e("pako/lib/zlib/zstream");var s=e("pako/lib/zlib/deflate.js");var o=e("pako/lib/zlib/inflate.js");var f=e("pako/lib/zlib/constants");for(var l in f){r[l]=f[l]}r.NONE=0;r.DEFLATE=1;r.INFLATE=2;r.GZIP=3;r.GUNZIP=4;r.DEFLATERAW=5;r.INFLATERAW=6;r.UNZIP=7;function u(e){if(e<r.DEFLATE||e>r.UNZIP)throw new TypeError("Bad argument");this.mode=e;this.init_done=false;this.write_in_progress=false;this.pending_close=false;this.windowBits=0;this.level=0;this.memLevel=0;this.strategy=0;this.dictionary=null}u.prototype.init=function(e,t,i,n,f){this.windowBits=e;this.level=t;this.memLevel=i;this.strategy=n;if(this.mode===r.GZIP||this.mode===r.GUNZIP)this.windowBits+=16;if(this.mode===r.UNZIP)this.windowBits+=32;if(this.mode===r.DEFLATERAW||this.mode===r.INFLATERAW)this.windowBits=-this.windowBits;this.strm=new a;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:var l=s.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:var l=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(l!==r.Z_OK){this._error(l);return}this.write_in_progress=false;this.init_done=true};u.prototype.params=function(){throw new Error("deflateParams Not supported")};u.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===r.NONE)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")};u.prototype.write=function(e,r,i,n,a,s,o){this._writeCheck();this.write_in_progress=true;var f=this;t.nextTick(function(){f.write_in_progress=false;var t=f._write(e,r,i,n,a,s,o);f.callback(t[0],t[1]);if(f.pending_close)f.close()});return this};function c(e,t){for(var r=0;r<e.length;r++){this[t+r]=e[r]}}u.prototype.writeSync=function(e,t,r,i,n,a,s){this._writeCheck();return this._write(e,t,r,i,n,a,s)};u.prototype._write=function(e,t,n,a,f,l,u){this.write_in_progress=true;if(e!==r.Z_NO_FLUSH&&e!==r.Z_PARTIAL_FLUSH&&e!==r.Z_SYNC_FLUSH&&e!==r.Z_FULL_FLUSH&&e!==r.Z_FINISH&&e!==r.Z_BLOCK){throw new Error("Invalid flush value")}if(t==null){t=new i(0);a=0;n=0}if(f._set)f.set=f._set;else f.set=c;var p=this.strm;p.avail_in=a;p.input=t;p.next_in=n;p.avail_out=u;p.output=f;p.next_out=l;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:var d=s.deflate(p,e);break;case r.UNZIP:case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:var d=o.inflate(p,e);break;default:throw new Error("Unknown mode "+this.mode)}if(d!==r.Z_STREAM_END&&d!==r.Z_OK){this._error(d)}this.write_in_progress=false;return[p.avail_in,p.avail_out]};u.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;if(this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW){s.deflateEnd(this.strm)}else{o.inflateEnd(this.strm)}this.mode=r.NONE};u.prototype.reset=function(){switch(this.mode){case r.DEFLATE:case r.DEFLATERAW:var e=s.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:var e=o.inflateReset(this.strm);break}if(e!==r.Z_OK){this._error(e)}};u.prototype._error=function(e){this.onerror(n[e]+": "+this.strm.msg,e);this.write_in_progress=false;if(this.pending_close)this.close()};r.Zlib=u}).call(this,e("_process"),e("buffer").Buffer)},{_process:78,buffer:66,"pako/lib/zlib/constants":55,"pako/lib/zlib/deflate.js":57,"pako/lib/zlib/inflate.js":59,"pako/lib/zlib/messages":61,"pako/lib/zlib/zstream":63}],65:[function(e,t,r){(function(t,i){var n=e("_stream_transform");var a=e("./binding");var s=e("util");var o=e("assert").ok;a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;Object.keys(a).forEach(function(e){if(e.match(/^Z/))r[e]=a[e]});r.codes={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR};Object.keys(r.codes).forEach(function(e){r.codes[r.codes[e]]=e});r.Deflate=u;r.Inflate=c;r.Gzip=p;r.Gunzip=d;r.DeflateRaw=h;r.InflateRaw=m;r.Unzip=v;r.createDeflate=function(e){return new u(e)};r.createInflate=function(e){return new c(e)};r.createDeflateRaw=function(e){return new h(e)};r.createInflateRaw=function(e){return new m(e)};r.createGzip=function(e){return new p(e)};r.createGunzip=function(e){return new d(e)};r.createUnzip=function(e){return new v(e)};r.deflate=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new u(t),e,r)};r.deflateSync=function(e,t){return l(new u(t),e)};r.gzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new p(t),e,r)};r.gzipSync=function(e,t){return l(new p(t),e)};r.deflateRaw=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new h(t),e,r)};r.deflateRawSync=function(e,t){return l(new h(t),e)};r.unzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new v(t),e,r)};r.unzipSync=function(e,t){return l(new v(t),e)};r.inflate=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new c(t),e,r)};r.inflateSync=function(e,t){return l(new c(t),e)};r.gunzip=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new d(t),e,r)};r.gunzipSync=function(e,t){return l(new d(t),e)};r.inflateRaw=function(e,t,r){if(typeof t==="function"){r=t;t={}}return f(new m(t),e,r)};r.inflateRawSync=function(e,t){return l(new m(t),e)};function f(e,t,r){var n=[];var a=0;e.on("error",o);e.on("end",f);e.end(t);s();function s(){var t;while(null!==(t=e.read())){n.push(t);a+=t.length}e.once("readable",s)}function o(t){e.removeListener("end",f);e.removeListener("readable",s);r(t)}function f(){var t=i.concat(n,a);n=[];r(null,t);e.close()}}function l(e,t){if(typeof t==="string")t=new i(t);if(!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=a.Z_FINISH;return e._processChunk(t,r)}function u(e){if(!(this instanceof u))return new u(e);g.call(this,e,a.DEFLATE)}function c(e){if(!(this instanceof c))return new c(e);g.call(this,e,a.INFLATE)}function p(e){if(!(this instanceof p))return new p(e);g.call(this,e,a.GZIP)}function d(e){if(!(this instanceof d))return new d(e);g.call(this,e,a.GUNZIP)}function h(e){if(!(this instanceof h))return new h(e);g.call(this,e,a.DEFLATERAW)}function m(e){if(!(this instanceof m))return new m(e);g.call(this,e,a.INFLATERAW)}function v(e){if(!(this instanceof v))return new v(e);g.call(this,e,a.UNZIP)}function g(e,t){this._opts=e=e||{};this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK;n.call(this,e);if(e.flush){if(e.flush!==a.Z_NO_FLUSH&&e.flush!==a.Z_PARTIAL_FLUSH&&e.flush!==a.Z_SYNC_FLUSH&&e.flush!==a.Z_FULL_FLUSH&&e.flush!==a.Z_FINISH&&e.flush!==a.Z_BLOCK){throw new Error("Invalid flush flag: "+e.flush)}}this._flushFlag=e.flush||a.Z_NO_FLUSH;if(e.chunkSize){if(e.chunkSize<r.Z_MIN_CHUNK||e.chunkSize>r.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+e.chunkSize)}}if(e.windowBits){if(e.windowBits<r.Z_MIN_WINDOWBITS||e.windowBits>r.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+e.windowBits)}}if(e.level){if(e.level<r.Z_MIN_LEVEL||e.level>r.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+e.level)}}if(e.memLevel){if(e.memLevel<r.Z_MIN_MEMLEVEL||e.memLevel>r.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+e.memLevel)}}if(e.strategy){if(e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+e.strategy)}}if(e.dictionary){if(!i.isBuffer(e.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._binding=new a.Zlib(t);var s=this;this._hadError=false;this._binding.onerror=function(e,t){s._binding=null;s._hadError=true;var i=new Error(e);i.errno=t;i.code=r.codes[t];s.emit("error",i)};var o=r.Z_DEFAULT_COMPRESSION;if(typeof e.level==="number")o=e.level;var f=r.Z_DEFAULT_STRATEGY;if(typeof e.strategy==="number")f=e.strategy;this._binding.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,o,e.memLevel||r.Z_DEFAULT_MEMLEVEL,f,e.dictionary);this._buffer=new i(this._chunkSize);this._offset=0;this._closed=false;this._level=o;this._strategy=f;this.once("end",this.close)}s.inherits(g,n);g.prototype.params=function(e,i,n){if(e<r.Z_MIN_LEVEL||e>r.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+e)}if(i!=r.Z_FILTERED&&i!=r.Z_HUFFMAN_ONLY&&i!=r.Z_RLE&&i!=r.Z_FIXED&&i!=r.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+i)}if(this._level!==e||this._strategy!==i){var s=this;this.flush(a.Z_SYNC_FLUSH,function(){s._binding.params(e,i);if(!s._hadError){s._level=e;s._strategy=i;if(n)n()}})}else{t.nextTick(n)}};g.prototype.reset=function(){return this._binding.reset()};g.prototype._flush=function(e){this._transform(new i(0),"",e)};g.prototype.flush=function(e,r){var n=this._writableState;if(typeof e==="function"||e===void 0&&!r){r=e;e=a.Z_FULL_FLUSH}if(n.ended){if(r)t.nextTick(r)}else if(n.ending){if(r)this.once("end",r)}else if(n.needDrain){var s=this;this.once("drain",function(){s.flush(r)})}else{this._flushFlag=e;this.write(new i(0),"",r)}};g.prototype.close=function(e){if(e)t.nextTick(e);if(this._closed)return;this._closed=true;this._binding.close();var r=this;t.nextTick(function(){r.emit("close")})};g.prototype._transform=function(e,t,r){var n;var s=this._writableState;var o=s.ending||s.ended;var f=o&&(!e||s.length===e.length);if(!e===null&&!i.isBuffer(e))return r(new Error("invalid input"));if(f)n=a.Z_FINISH;else{n=this._flushFlag;if(e.length>=s.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}var l=this;this._processChunk(e,n,r)};g.prototype._processChunk=function(e,t,r){var n=e&&e.length;var a=this._chunkSize-this._offset;var s=0;var f=this;var l=typeof r==="function";if(!l){var u=[];var c=0;var p;this.on("error",function(e){p=e});do{var d=this._binding.writeSync(t,e,s,n,this._buffer,this._offset,a)}while(!this._hadError&&v(d[0],d[1]));if(this._hadError){throw p}var h=i.concat(u,c);this.close();return h}var m=this._binding.write(t,e,s,n,this._buffer,this._offset,a);m.buffer=e;m.callback=v;function v(p,d){if(f._hadError)return;var h=a-d;o(h>=0,"have should not go down");if(h>0){var m=f._buffer.slice(f._offset,f._offset+h);f._offset+=h;if(l){f.push(m)}else{u.push(m);c+=m.length}}if(d===0||f._offset>=f._chunkSize){a=f._chunkSize;f._offset=0;f._buffer=new i(f._chunkSize)}if(d===0){s+=n-p;n=p;if(!l)return true;var g=f._binding.write(t,e,s,n,f._buffer,f._offset,f._chunkSize);g.callback=v;g.buffer=e;return}if(!l)return false;r()}};s.inherits(u,g);s.inherits(c,g);s.inherits(p,g);s.inherits(d,g);s.inherits(h,g);s.inherits(m,g);s.inherits(v,g)}).call(this,e("_process"),e("buffer").Buffer)},{"./binding":64,_process:78,_stream_transform:92,assert:51,buffer:66,util:98}],66:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=y;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s=1073741823;var o={};f.TYPED_ARRAY_SUPPORT=function(){try{var e=new ArrayBuffer(0);var t=new Uint8Array(e);t.foo=function(){return 42};return t.foo()===42&&typeof t.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(r){return false}}();function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return l(this,e)}if(typeof e==="string"){return u(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function l(e,t){e=g(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;r++){e[r]=0}}return e}function u(e,t,r){if(typeof r!=="string"||r==="")r="utf8";var i=b(t,r)|0;e=g(e,i);e.write(t,r);return e}function c(e,t){if(f.isBuffer(t))return p(e,t);if(a(t))return d(e,t);if(t==null){throw new TypeError("must start with number, buffer, array or string")}if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer){return h(e,t)}if(t.length)return m(e,t);return v(e,t)}function p(e,t){var r=_(t.length)|0;e=g(e,r);t.copy(e,0,0,r);return e}function d(e,t){var r=_(t.length)|0;e=g(e,r);for(var i=0;i<r;i+=1){e[i]=t[i]&255}return e}function h(e,t){var r=_(t.length)|0;e=g(e,r);for(var i=0;i<r;i+=1){e[i]=t[i]&255}return e}function m(e,t){var r=_(t.length)|0;e=g(e,r);for(var i=0;i<r;i+=1){e[i]=t[i]&255}return e}function v(e,t){var r;var i=0;if(t.type==="Buffer"&&a(t.data)){r=t.data;i=_(r.length)|0}e=g(e,i);for(var n=0;n<i;n+=1){e[n]=r[n]&255}return e}function g(e,t){if(f.TYPED_ARRAY_SUPPORT){e=f._augment(new Uint8Array(t))}else{e.length=t;e._isBuffer=true}var r=t!==0&&t<=f.poolSize>>>1;if(r)e.parent=o;return e}function _(e){if(e>=s){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+s.toString(16)+" bytes")}return e|0}function y(e,t){if(!(this instanceof y))return new y(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function X(e){return!!(e!=null&&e._isBuffer)};f.compare=function J(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n<a){if(e[n]!==t[n])break;++n}if(n!==a){r=e[n];i=t[n]}if(r<i)return-1;if(i<r)return 1;return 0};f.isEncoding=function Q(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};f.concat=function ee(e,t){if(!a(e))throw new TypeError("list argument must be an Array of Buffers.");if(e.length===0){return new f(0)}else if(e.length===1){return e[0]}var r;if(t===undefined){t=0;for(r=0;r<e.length;r++){t+=e[r].length}}var i=new f(t);var n=0;for(r=0;r<e.length;r++){var s=e[r];s.copy(i,n);n+=s.length}return i};function b(e,t){if(typeof e!=="string")e=String(e);if(e.length===0)return 0;switch(t||"utf8"){case"ascii":case"binary":case"raw":return e.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e.length*2;case"hex":return e.length>>>1;case"utf8":case"utf-8":return W(e).length;case"base64":return Y(e).length;default:return e.length}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;f.prototype.toString=function te(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return U(this,t,r);case"binary":return L(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}};f.prototype.equals=function re(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return"<Buffer "+e+">"};f.prototype.compare=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function ae(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+n<e.length;n++){if(e[r+n]===t[i===-1?0:n-i]){if(i===-1)i=n;if(n-i+1===t.length)return r+i}else{i=-1}}return-1}throw new TypeError("val must be string, number or Buffer")};f.prototype.get=function se(e){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(e)};f.prototype.set=function oe(e,t){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(e,t)};function w(e,t,r,i){r=Number(r)||0;var n=e.length-r;if(!i){i=n}else{i=Number(i);if(i>n){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;s<i;s++){var o=parseInt(t.substr(s*2,2),16);if(isNaN(o))throw new Error("Invalid hex string");e[r+s]=o}return s}function x(e,t,r,i){return K(W(t,e.length-r),e,r,i)}function k(e,t,r,i){return K(Z(t),e,r,i)}function S(e,t,r,i){return k(e,t,r,i)}function E(e,t,r,i){return K(Y(t),e,r,i)}function A(e,t,r,i){return K(V(t,e.length-r),e,r,i)}f.prototype.write=function fe(e,t,r,i){if(t===undefined){i="utf8";r=this.length;t=0}else if(r===undefined&&typeof t==="string"){i=t;r=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(r)){r=r|0;if(i===undefined)i="utf8"}else{i=r;r=undefined}}else{var n=i;i=t;t=r|0;r=n}var a=this.length-t;if(r===undefined||r>a)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return k(this,e,t,r);case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function I(e,t,r){var i="";var n="";r=Math.min(e.length,r);for(var a=t;a<r;a++){if(e[a]<=127){i+=$(n)+String.fromCharCode(e[a]);n=""}else{n+="%"+e[a].toString(16)}}return i+$(n)}function U(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;n++){i+=String.fromCharCode(e[n]&127)}return i}function L(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;n++){i+=String.fromCharCode(e[n])}return i}function B(e,t,r){var i=e.length;if(!t||t<0)t=0;if(!r||r<0||r>i)r=i;var n="";for(var a=t;a<r;a++){n+=G(e[a])}return n}function z(e,t,r){var i=e.slice(t,r);var n="";for(var a=0;a<i.length;a+=2){n+=String.fromCharCode(i[a]+i[a+1]*256)}return n}f.prototype.slice=function ue(e,t){var r=this.length;e=~~e;t=t===undefined?r:~~t;if(e<0){e+=r;if(e<0)e=0}else if(e>r){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(t<e)t=e;var i;if(f.TYPED_ARRAY_SUPPORT){i=f._augment(this.subarray(e,t))}else{var n=t-e;i=new f(n,undefined);for(var a=0;a<n;a++){i[a]=this[a+e]}}if(i.length)i.parent=this.parent||this;return i};function C(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function ce(e,t,r){e=e|0;t=t|0;if(!r)C(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a<t&&(n*=256)){i+=this[e+a]*n}return i};f.prototype.readUIntBE=function pe(e,t,r){e=e|0;t=t|0;if(!r){C(e,t,this.length)}var i=this[e+--t];var n=1;while(t>0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function de(e,t){if(!t)C(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function he(e,t){if(!t)C(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function me(e,t){if(!t)C(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ve(e,t){if(!t)C(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ge(e,t){if(!t)C(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)C(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a<t&&(n*=256)){i+=this[e+a]*n}n*=128;if(i>=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function ye(e,t,r){e=e|0;t=t|0;if(!r)C(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function be(e,t){if(!t)C(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function we(e,t){if(!t)C(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function xe(e,t){if(!t)C(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function ke(e,t){if(!t)C(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Se(e,t){if(!t)C(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ee(e,t){if(!t)C(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ae(e,t){if(!t)C(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)C(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)C(e,8,this.length);return n.read(this,e,false,52,8)};function R(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||t<a)throw new RangeError("value is out of bounds");if(r+i>e.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ue(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)R(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a<r&&(n*=256)){this[t+a]=e/n&255}return t+r};f.prototype.writeUIntBE=function Le(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)R(this,e,t,r,Math.pow(2,8*r),0);var n=r-1;var a=1;this[t+n]=e&255;while(--n>=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Be(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function F(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n<a;n++){e[r+n]=(t&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{F(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Ce(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{F(this,e,t,false)}return t+2};function O(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n<a;n++){e[r+n]=t>>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Re(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{O(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Fe(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{O(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Oe(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a<r&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{F(this,e,t,true)}return t+2;
+};f.prototype.writeInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{F(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function je(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{O(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function He(e,t,r){e=+e;t=t|0;if(!r)R(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{O(this,e,t,false)}return t+4};function M(e,t,r,i,n,a){if(t>n||t<a)throw new RangeError("value is out of bounds");if(r+i>e.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function N(e,t,r,i,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function qe(e,t,r){return N(this,e,t,true,r)};f.prototype.writeFloatBE=function Ge(e,t,r){return N(this,e,t,false,r)};function D(e,t,r,i,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function We(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ze(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function Ve(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<r)i=r;if(i===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t<i-r){i=e.length-t+r}var n=i-r;if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(var a=0;a<n;a++){e[a+t]=this[a+r]}}else{e._set(this.subarray(r,r+n),t)}return n};f.prototype.fill=function Ye(e,t,r){if(!e)e=0;if(!t)t=0;if(!r)r=this.length;if(r<t)throw new RangeError("end < start");if(r===t)return;if(this.length===0)return;if(t<0||t>=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i<r;i++){this[i]=e}}else{var n=W(e.toString());var a=n.length;for(i=t;i<r;i++){this[i]=n[i%a]}}return this};f.prototype.toArrayBuffer=function Ke(){if(typeof Uint8Array!=="undefined"){if(f.TYPED_ARRAY_SUPPORT){return new f(this).buffer}else{var e=new Uint8Array(this.length);for(var t=0,r=e.length;t<r;t+=1){e[t]=this[t]}return e.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var P=f.prototype;f._augment=function $e(e){e.constructor=f;e._isBuffer=true;e._set=e.set;e.get=P.get;e.set=P.set;e.write=P.write;e.toString=P.toString;e.toLocaleString=P.toString;e.toJSON=P.toJSON;e.equals=P.equals;e.compare=P.compare;e.indexOf=P.indexOf;e.copy=P.copy;e.slice=P.slice;e.readUIntLE=P.readUIntLE;e.readUIntBE=P.readUIntBE;e.readUInt8=P.readUInt8;e.readUInt16LE=P.readUInt16LE;e.readUInt16BE=P.readUInt16BE;e.readUInt32LE=P.readUInt32LE;e.readUInt32BE=P.readUInt32BE;e.readIntLE=P.readIntLE;e.readIntBE=P.readIntBE;e.readInt8=P.readInt8;e.readInt16LE=P.readInt16LE;e.readInt16BE=P.readInt16BE;e.readInt32LE=P.readInt32LE;e.readInt32BE=P.readInt32BE;e.readFloatLE=P.readFloatLE;e.readFloatBE=P.readFloatBE;e.readDoubleLE=P.readDoubleLE;e.readDoubleBE=P.readDoubleBE;e.writeUInt8=P.writeUInt8;e.writeUIntLE=P.writeUIntLE;e.writeUIntBE=P.writeUIntBE;e.writeUInt16LE=P.writeUInt16LE;e.writeUInt16BE=P.writeUInt16BE;e.writeUInt32LE=P.writeUInt32LE;e.writeUInt32BE=P.writeUInt32BE;e.writeIntLE=P.writeIntLE;e.writeIntBE=P.writeIntBE;e.writeInt8=P.writeInt8;e.writeInt16LE=P.writeInt16LE;e.writeInt16BE=P.writeInt16BE;e.writeInt32LE=P.writeInt32LE;e.writeInt32BE=P.writeInt32BE;e.writeFloatLE=P.writeFloatLE;e.writeFloatBE=P.writeFloatBE;e.writeDoubleLE=P.writeDoubleLE;e.writeDoubleBE=P.writeDoubleBE;e.fill=P.fill;e.inspect=P.inspect;e.toArrayBuffer=P.toArrayBuffer;return e};var j=/[^+\/0-9A-z\-]/g;function H(e){e=q(e).replace(j,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function q(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function G(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function W(e,t){t=t||Infinity;var r;var i=e.length;var n=null;var a=[];var s=0;for(;s<i;s++){r=e.charCodeAt(s);if(r>55295&&r<57344){if(n){if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}else{r=n-55296<<10|r-56320|65536;n=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}else{n=r;continue}}}else if(n){if((t-=3)>-1)a.push(239,191,189);n=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r<e.length;r++){t.push(e.charCodeAt(r)&255)}return t}function V(e,t){var r,i,n;var a=[];for(var s=0;s<e.length;s++){if((t-=2)<0)break;r=e.charCodeAt(s);i=r>>8;n=r%256;a.push(n);a.push(i)}return a}function Y(e){return i.toByteArray(H(e))}function K(e,t,r,i){for(var n=0;n<i;n++){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function $(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":67,ieee754:68,"is-array":69}],67:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var l="_".charCodeAt(0);function u(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===l)return 63;if(t<a)return-1;if(t<a+10)return t-a+26+26;if(t<o+26)return t-o;if(t<s+26)return t-s+26}function c(e){var r,i,n,a,s,o;if(e.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var l=0;function c(e){o[l++]=e}for(r=0,i=0;r<n;r+=4,i+=3){a=u(e.charAt(r))<<18|u(e.charAt(r+1))<<12|u(e.charAt(r+2))<<6|u(e.charAt(r+3));c((a&16711680)>>16);c((a&65280)>>8);c(a&255)}if(s===2){a=u(e.charAt(r))<<2|u(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=u(e.charAt(r))<<10|u(e.charAt(r+1))<<4|u(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t<s;t+=3){a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];n+=f(a)}switch(r){case 1:a=e[e.length-1];n+=o(a>>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],68:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<<o)-1;var l=f>>1;var u=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-u)-1;d>>=-u;u+=o;for(;u>0;a=a*256+e[t+c],c+=p,u-=8){}s=a&(1<<-u)-1;a>>=-u;u+=i;for(;u>0;s=s*256+e[t+c],c+=p,u-=8){}if(a===0){a=1-l}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-l}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var l=a*8-n-1;var u=(1<<l)-1;var c=u>>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=u}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=u){o=0;s=u}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<<n|o;l+=n;for(;l>0;e[r+d]=s&255,d+=h,s/=256,l-=8){}e[r+d-h]|=m*128}},{}],69:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],70:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,l;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f<i;f++)a[f-1]=arguments[f];r.apply(this,a)}}else if(s(r)){i=arguments.length;a=new Array(i-1);for(f=1;f<i;f++)a[f-1]=arguments[f];l=r.slice();i=l.length;for(f=0;f<i;f++)l[f].apply(this,a)}return true};i.prototype.addListener=function(e,t){var r;if(!n(t))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",e,n(t.listener)?t.listener:t);if(!this._events[e])this._events[e]=t;else if(s(this._events[e]))this._events[e].push(t);else this._events[e]=[this._events[e],t];if(s(this._events[e])&&!this._events[e].warned){var r;if(!o(this._maxListeners)){r=this._maxListeners}else{r=i.defaultMaxListeners}if(r&&r>0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],71:[function(e,t,r){var i=t.exports;var n=e("events").EventEmitter;var a=e("./lib/request");var s=e("url");i.request=function(e,t){if(typeof e==="string"){e=s.parse(e)}if(!e)e={};if(!e.host&&!e.port){e.port=parseInt(window.location.port,10)}if(!e.host&&e.hostname){e.host=e.hostname}if(!e.protocol){if(e.scheme){e.protocol=e.scheme+":"}else{e.protocol=window.location.protocol}}if(!e.host){e.host=window.location.hostname||window.location.host}if(/:/.test(e.host)){if(!e.port){e.port=e.host.split(":")[1]}e.host=e.host.split(":")[0]}if(!e.port)e.port=e.protocol=="https:"?443:80;var r=new a(new o,e);if(t)r.on("response",t);return r};i.get=function(e,t){e.method="GET";var r=i.request(e,t);r.end();return r};i.Agent=function(){};i.Agent.defaultMaxSockets=4;var o=function(){if(typeof window==="undefined"){throw new Error("no window object present")}else if(window.XMLHttpRequest){return window.XMLHttpRequest}else if(window.ActiveXObject){var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];for(var t=0;t<e.length;t++){try{var r=new window.ActiveXObject(e[t]);return function(){if(r){var i=r;r=null;return i}else{return new window.ActiveXObject(e[t])}}}catch(i){}}throw new Error("ajax not supported in this browser")}else{throw new Error("ajax not supported in this browser")}}();i.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{"./lib/request":72,events:70,url:96}],72:[function(e,t,r){var i=e("stream");var n=e("./response");var a=e("Base64");var s=e("inherits");var o=t.exports=function(e,t){var r=this;r.writable=true;r.xhr=e;r.body=[];r.uri=(t.protocol||"http:")+"//"+t.host+(t.port?":"+t.port:"")+(t.path||"/");if(typeof t.withCredentials==="undefined"){t.withCredentials=true}try{e.withCredentials=t.withCredentials}catch(i){}if(t.responseType)try{e.responseType=t.responseType}catch(i){}e.open(t.method||"GET",r.uri,true);e.onerror=function(e){r.emit("error",new Error("Network error"))};r._headers={};if(t.headers){var s=f(t.headers);for(var o=0;o<s.length;o++){var l=s[o];if(!r.isSafeRequestHeader(l))continue;var u=t.headers[l];r.setHeader(l,u)}}if(t.auth){this.setHeader("Authorization","Basic "+a.btoa(t.auth))}var c=new n;c.on("close",function(){r.emit("close")});c.on("ready",function(){r.emit("response",c)});c.on("error",function(e){r.emit("error",e)});e.onreadystatechange=function(){if(e.__aborted)return;c.handle(e)}};s(o,i);o.prototype.setHeader=function(e,t){this._headers[e.toLowerCase()]=t};o.prototype.getHeader=function(e){return this._headers[e.toLowerCase()]};o.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]};o.prototype.write=function(e){this.body.push(e)};o.prototype.destroy=function(e){this.xhr.__aborted=true;this.xhr.abort();this.emit("close")};o.prototype.end=function(e){if(e!==undefined)this.body.push(e);var t=f(this._headers);for(var r=0;r<t.length;r++){var i=t[r];var n=this._headers[i];if(l(n)){for(var a=0;a<n.length;a++){this.xhr.setRequestHeader(i,n[a])}}else this.xhr.setRequestHeader(i,n)}if(this.body.length===0){this.xhr.send("")}else if(typeof this.body[0]==="string"){this.xhr.send(this.body.join(""))}else if(l(this.body[0])){var s=[];for(var r=0;r<this.body.length;r++){s.push.apply(s,this.body[r])}this.xhr.send(s)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){var o=0;for(var r=0;r<this.body.length;r++){o+=this.body[r].length}var s=new this.body[0].constructor(o);var u=0;for(var r=0;r<this.body.length;r++){var p=this.body[r];for(var a=0;a<p.length;a++){s[u++]=p[a]}}this.xhr.send(s)}else if(c(this.body[0])){this.xhr.send(this.body[0])}else{var s="";for(var r=0;r<this.body.length;r++){s+=this.body[r].toString()}this.xhr.send(s)}};o.unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];o.prototype.isSafeRequestHeader=function(e){if(!e)return false;return u(o.unsafeHeaders,e.toLowerCase())===-1};var f=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};var l=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var u=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++){if(e[r]===t)return r}return-1};var c=function(e){if(typeof Blob!=="undefined"&&e instanceof Blob)return true;if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer)return true;if(typeof FormData!=="undefined"&&e instanceof FormData)return true}},{"./response":73,Base64:74,inherits:147,stream:94}],73:[function(e,t,r){var i=e("stream");var n=e("util");var a=t.exports=function(e){this.offset=0;this.readable=true};n.inherits(a,i);var s={streaming:true,status2:true};function o(e){var t=e.getAllResponseHeaders().split(/\r?\n/);var r={};for(var i=0;i<t.length;i++){var n=t[i];if(n==="")continue;var a=n.match(/^([^:]+):\s*(.*)/);if(a){var s=a[1].toLowerCase(),o=a[2];if(r[s]!==undefined){if(f(r[s])){r[s].push(o)}else{r[s]=[r[s],o]}}else{r[s]=o}}else{r[n]=true}}return r}a.prototype.getResponse=function(e){var t=String(e.responseType).toLowerCase();if(t==="blob")return e.responseBlob||e.response;if(t==="arraybuffer")return e.response;return e.responseText};a.prototype.getHeader=function(e){return this.headers[e.toLowerCase()]};a.prototype.handle=function(e){if(e.readyState===2&&s.status2){try{this.statusCode=e.status;this.headers=o(e)}catch(t){s.status2=false}if(s.status2){this.emit("ready")}}else if(s.streaming&&e.readyState===3){try{if(!this.statusCode){this.statusCode=e.status;this.headers=o(e);this.emit("ready")}}catch(t){}try{this._emitData(e)}catch(t){s.streaming=false}}else if(e.readyState===4){if(!this.statusCode){this.statusCode=e.status;this.emit("ready")}this._emitData(e);if(e.error){this.emit("error",this.getResponse(e))}else this.emit("end");this.emit("close")}};a.prototype._emitData=function(e){var t=this.getResponse(e);if(t.toString().match(/ArrayBuffer/)){this.emit("data",new Uint8Array(t,this.offset));this.offset=t.byteLength;return}if(t.length>this.offset){this.emit("data",t.slice(this.offset));this.offset=t.length}};var f=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{stream:94,util:98}],74:[function(e,t,r){(function(){var e=typeof r!="undefined"?r:this;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(e){this.message=e}i.prototype=new Error;i.prototype.name="InvalidCharacterError";e.btoa||(e.btoa=function(e){for(var r,n,a=0,s=t,o="";e.charAt(a|0)||(s="=",a%1);o+=s.charAt(63&r>>8-a%1*8)){n=e.charCodeAt(a+=3/4);if(n>255){throw new i("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.")}r=r<<8|n}return o});e.atob||(e.atob=function(e){e=e.replace(/=+$/,"");if(e.length%4==1){throw new i("'atob' failed: The string to be decoded is not correctly encoded.")}for(var r=0,n,a,s=0,o="";a=e.charAt(s++);~a&&(n=r%4?n*64+a:a,r++%4)?o+=String.fromCharCode(255&n>>(-2*r&6)):0){a=t.indexOf(a)}return o})})()},{}],75:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:71}],76:[function(e,t,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],77:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var r=e.length-1;for(;r>=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f<s;f++){if(n[f]!==a[f]){o=f;break}}var l=[];for(var f=o;f<n.length;f++){l.push("..")}l=l.concat(a.slice(o));return l.join("/")};r.sep="/";r.delimiter=":";r.dirname=function(e){var t=n(e),r=t[0],i=t[1];if(!r&&!i){return"."}if(i){i=i.substr(0,i.length-1)}return r+i};r.basename=function(e,t){var r=n(e)[2];if(t&&r.substr(-1*t.length)===t){r=r.substr(0,r.length-t.length)}return r};r.extname=function(e){return n(e)[3]};function a(e,t){if(e.filter)return e.filter(t);var r=[];for(var i=0;i<e.length;i++){if(t(e[i],i,e))r.push(e[i])}return r}var s="ab".substr(-1)==="b"?function(e,t,r){return e.substr(t,r)}:function(e,t,r){if(t<0)t=e.length+t;return e.substr(t,r)}}).call(this,e("_process"))},{_process:78}],78:[function(e,t,r){var i=t.exports={};var n=[];var a=false;var s;var o=-1;function f(){a=false;if(s.length){n=s.concat(n)}else{o=-1}if(n.length){l()}}function l(){if(a){return}var e=setTimeout(f);a=true;var t=n.length;while(t){s=n;n=[];while(++o<t){s[o].run()}o=-1;t=n.length}s=null;a=false;clearTimeout(e)}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}}n.push(new u(e,t));if(n.length===1&&!a){setTimeout(l,0)}};function u(e,t){this.fun=e;this.array=t}u.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=true;i.env={};i.argv=[];i.version="";i.versions={};function c(){}i.on=c;i.addListener=c;i.once=c;i.off=c;i.removeListener=c;i.removeAllListeners=c;i.emit=c;i.binding=function(e){throw new Error("process.binding is not supported")};i.cwd=function(){return"/"};i.chdir=function(e){throw new Error("process.chdir is not supported")};i.umask=function(){return 0}},{}],79:[function(t,r,i){(function(t){(function(n){var a=typeof i=="object"&&i&&!i.nodeType&&i;var s=typeof r=="object"&&r&&!r.nodeType&&r;var o=typeof t=="object"&&t;if(o.global===o||o.window===o||o.self===o){n=o}var f,l=2147483647,u=36,c=1,p=26,d=38,h=700,m=72,v=128,g="-",_=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=u-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function T(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=T(n,t).join(".");return i+a}function U(e){var t=[],r=0,i=e.length,n,a;while(r<i){n=e.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){a=e.charCodeAt(r++);if((a&64512)==56320){t.push(((n&1023)<<10)+(a&1023)+65536)}else{t.push(n);r--}}else{t.push(n)}}return t}function L(e){return T(e,function(e){var t="";if(e>65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return u}function z(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function C(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=u){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function R(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,_,y,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f<o;++f){if(e.charCodeAt(f)>=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d<r;){for(h=n,_=1,y=u;;y+=u){if(d>=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=u||b>k((l-n)/_)){A("overflow")}n+=b*_;w=y<=s?c:y>=s+p?p:y-s;if(b<w){break}x=u-w;if(_>k(l/x)){A("overflow")}_*=x}i=t.length+1;s=C(n-h,i,h==0);if(k(n/i)>l-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function F(e){var t,r,i,n,a,s,o,f,d,h,_,y=[],b,w,x,E;e=U(e);b=e.length;t=v;r=0;a=m;for(s=0;s<b;++s){_=e[s];if(_<128){y.push(S(_))}}i=n=y.length;if(n){y.push(g)}while(i<b){for(o=l,s=0;s<b;++s){_=e[s];if(_>=t&&_<o){o=_}}w=i+1;if(o-t>k((l-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;s<b;++s){_=e[s];if(_<t&&++r>l){A("overflow")}if(_==t){for(f=r,d=u;;d+=u){h=d<=a?c:d>=a+p?p:d-a;if(f<h){break}E=f-h;x=u-h;y.push(S(z(h+E%x,0)));f=k(E/x)}y.push(S(z(f,0)));a=C(r,w,i==n);r=0;++i}}++r;++t}return y.join("")}function O(e){return I(e,function(e){return _.test(e)?R(e.slice(4).toLowerCase()):e})}function M(e){return I(e,function(e){return y.test(e)?"xn--"+F(e):e})}f={version:"1.3.2",ucs2:{decode:U,encode:L},decode:R,encode:F,toASCII:M,toUnicode:O};if(typeof e=="function"&&typeof e.amd=="object"&&e.amd){e("punycode",function(){return f})}else if(a&&s){if(r.exports==a){s.exports=f}else{for(E in f){f.hasOwnProperty(E)&&(a[E]=f[E])}}}else{n.punycode=f}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],80:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&";r=r||"=";var s={};if(typeof e!=="string"||e.length===0){return s}var o=/\+/g;e=e.split(t);var f=1e3;if(a&&typeof a.maxKeys==="number"){f=a.maxKeys}var l=e.length;if(f>0&&l>f){l=f}for(var u=0;u<l;++u){var c=e[u].replace(o,"%20"),p=c.indexOf(r),d,h,m,v;if(p>=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],81:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i<e.length;i++){r.push(t(e[i],i))}return r}var s=Object.keys||function(e){var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t.push(r)}return t}},{}],82:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode");r.encode=r.stringify=e("./encode")},{"./decode":80,"./encode":81}],83:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":84}],84:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./_stream_readable":86,"./_stream_writable":88,_process:78,"core-util-is":89,dup:41,inherits:147}],85:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./_stream_transform":87,"core-util-is":89,dup:42,inherits:147}],86:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{"./_stream_duplex":84,_process:78,buffer:66,"core-util-is":89,dup:43,events:70,inherits:147,isarray:76,stream:94,"string_decoder/":95,util:52}],87:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{"./_stream_duplex":84,"core-util-is":89,dup:44,inherits:147}],88:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{"./_stream_duplex":84,_process:78,buffer:66,"core-util-is":89,dup:45,inherits:147,stream:94}],89:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{buffer:66,dup:46}],90:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":85}],91:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{"./lib/_stream_duplex.js":84,"./lib/_stream_passthrough.js":85,"./lib/_stream_readable.js":86,"./lib/_stream_transform.js":87,"./lib/_stream_writable.js":88,dup:49,stream:94}],92:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":87}],93:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":88}],94:[function(e,t,r){t.exports=a;var i=e("events").EventEmitter;var n=e("inherits");n(a,i);a.Readable=e("readable-stream/readable.js");a.Writable=e("readable-stream/writable.js");a.Duplex=e("readable-stream/duplex.js");a.Transform=e("readable-stream/transform.js");a.PassThrough=e("readable-stream/passthrough.js");a.Stream=a;function a(){i.call(this)}a.prototype.pipe=function(e,t){var r=this;function n(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",n);function a(){if(r.readable&&r.resume){r.resume()}}e.on("drain",a);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",o);r.on("close",f)}var s=false;function o(){if(s)return;s=true;e.end()}function f(){if(s)return;s=true;if(typeof e.destroy==="function")e.destroy()}function l(e){u();if(i.listenerCount(this,"error")===0){throw e}}r.on("error",l);e.on("error",l);function u(){r.removeListener("data",n);e.removeListener("drain",a);r.removeListener("end",o);r.removeListener("close",f);r.removeListener("error",l);e.removeListener("error",l);r.removeListener("end",u);r.removeListener("close",u);e.removeListener("close",u)}r.on("end",u);r.on("close",u);e.on("close",u);e.emit("pipe",r);return e}},{events:70,inherits:147,"readable-stream/duplex.js":83,"readable-stream/passthrough.js":90,"readable-stream/readable.js":91,"readable-stream/transform.js":92,"readable-stream/writable.js":93}],95:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:66,dup:48}],96:[function(e,t,r){var i=e("punycode");r.parse=y;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(f),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,
+gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},_=e("querystring");function y(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var y=-1;for(var b=0;b<c.length;b++){var w=n.indexOf(c[b]);if(w!==-1&&(y===-1||w<y))y=w}var x,S;if(y===-1){S=n.lastIndexOf("@")}else{S=n.lastIndexOf("@",y)}if(S!==-1){x=n.slice(0,S);n=n.slice(S+1);this.auth=decodeURIComponent(x)}y=-1;for(var b=0;b<u.length;b++){var w=n.indexOf(u[b]);if(w!==-1&&(y===-1||w<y))y=w}if(y===-1)y=n.length;this.host=n.slice(0,y);n=n.slice(y);this.parseHost();this.hostname=this.hostname||"";var E=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!E){var A=this.hostname.split(/\./);for(var b=0,T=A.length;b<T;b++){var I=A[b];if(!I)continue;if(!I.match(d)){var U="";for(var L=0,B=I.length;L<B;L++){if(I.charCodeAt(L)>127){U+="x"}else{U+=I[L]}}if(!U.match(d)){var z=A.slice(0,b);var C=A.slice(b+1);var R=I.match(h);if(R){z.push(R[1]);C.unshift(R[2])}if(C.length){n="/"+C.join(".")+n}this.hostname=z.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var F=this.hostname.split(".");var O=[];for(var b=0;b<F.length;++b){var M=F[b];O.push(M.match(/[^A-Za-z0-9_-]/)?"xn--"+i.encode(M):M)}this.hostname=O.join(".")}var N=this.port?":"+this.port:"";var D=this.hostname||"";this.host=D+N;this.href+=this.host;if(E){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(n[0]!=="/"){n="/"+n}}}if(!m[o]){for(var b=0,T=l.length;b<T;b++){var P=l[b];var j=encodeURIComponent(P);if(j===P){j=escape(P)}n=n.split(P).join(j)}}var H=n.indexOf("#");if(H!==-1){this.hash=n.substr(H);n=n.slice(0,H)}var q=n.indexOf("?");if(q!==-1){this.search=n.substr(q);this.query=n.substr(q+1);if(t){this.query=_.parse(this.query)}n=n.slice(0,q)}else if(t){this.search="";this.query={}}if(n)this.pathname=n;if(g[o]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var N=this.pathname||"";var M=this.search||"";this.path=N+M}this.href=this.format();return this};function b(e){if(k(e))e=y(e);if(!(e instanceof n))return n.prototype.format.call(e);return e.format()}n.prototype.format=function(){var e=this.auth||"";if(e){e=encodeURIComponent(e);e=e.replace(/%3A/i,":");e+="@"}var t=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=false,a="";if(this.host){n=e+this.host}else if(this.hostname){n=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){n+=":"+this.port}}if(this.query&&S(this.query)&&Object.keys(this.query).length){a=_.stringify(this.query)}var s=this.search||a&&"?"+a||"";if(t&&t.substr(-1)!==":")t+=":";if(this.slashes||(!t||g[t])&&n!==false){n="//"+(n||"");if(r&&r.charAt(0)!=="/")r="/"+r}else if(!n){n=""}if(i&&i.charAt(0)!=="#")i="#"+i;if(s&&s.charAt(0)!=="?")s="?"+s;r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)});s=s.replace("#","%23");return t+n+r+s+i};function w(e,t){return y(e,false,true).resolve(t)}n.prototype.resolve=function(e){return this.resolveObject(y(e,false,true)).format()};function x(e,t){if(!e)return t;return y(e,false,true).resolveObject(t)}n.prototype.resolveObject=function(e){if(k(e)){var t=new n;t.parse(e,false,true);e=t}var r=new n;Object.keys(this).forEach(function(e){r[e]=this[e]},this);r.hash=e.hash;if(e.href===""){r.href=r.format();return r}if(e.slashes&&!e.protocol){Object.keys(e).forEach(function(t){if(t!=="protocol")r[t]=e[t]});if(g[r.protocol]&&r.hostname&&!r.pathname){r.path=r.pathname="/"}r.href=r.format();return r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){Object.keys(e).forEach(function(t){r[t]=e[t]});r.href=r.format();return r}r.protocol=e.protocol;if(!e.host&&!v[e.protocol]){var i=(e.pathname||"").split("/");while(i.length&&!(e.host=i.shift()));if(!e.host)e.host="";if(!e.hostname)e.hostname="";if(i[0]!=="")i.unshift("");if(i.length<2)i.unshift("");r.pathname=i.join("/")}else{r.pathname=e.pathname}r.search=e.search;r.query=e.query;r.host=e.host||"";r.auth=e.auth;r.hostname=e.hostname||e.host;r.port=e.port;if(r.pathname||r.search){var a=r.pathname||"";var s=r.search||"";r.path=a+s}r.slashes=r.slashes||e.slashes;r.href=r.format();return r}var o=r.pathname&&r.pathname.charAt(0)==="/",f=e.host||e.pathname&&e.pathname.charAt(0)==="/",l=f||o||r.host&&e.pathname,u=l,c=r.pathname&&r.pathname.split("/")||[],i=e.pathname&&e.pathname.split("/")||[],p=r.protocol&&!g[r.protocol];if(p){r.hostname="";r.port=null;if(r.host){if(c[0]==="")c[0]=r.host;else c.unshift(r.host)}r.host="";if(e.protocol){e.hostname=null;e.port=null;if(e.host){if(i[0]==="")i[0]=e.host;else i.unshift(e.host)}e.host=null}l=l&&(i[0]===""||c[0]==="")}if(f){r.host=e.host||e.host===""?e.host:r.host;r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname;r.search=e.search;r.query=e.query;c=i}else if(i.length){if(!c)c=[];c.pop();c=c.concat(i);r.search=e.search;r.query=e.query}else if(!A(e.search)){if(p){r.hostname=r.host=c.shift();var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var _=0;for(var y=c.length;y>=0;y--){h=c[y];if(h=="."){c.splice(y,1)}else if(h===".."){c.splice(y,1);_++}else if(_){c.splice(y,1);_--}}if(!l&&!u){for(;_--;_){c.unshift("..")}}if(l&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}l=l||r.host&&c.length;if(l&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:79,querystring:82}],97:[function(e,t,r){t.exports=function i(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],98:[function(e,t,r){(function(t,i){var n=/%[sdj%]/g;r.format=function(e){if(!x(e)){var t=[];for(var r=0;r<arguments.length;r++){t.push(o(arguments[r]))}return t.join(" ")}var r=1;var i=arguments;var a=i.length;var s=String(e).replace(n,function(e){if(e==="%%")return"%";if(r>=a)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return e}});for(var f=i[r];r<a;f=i[++r]){if(y(f)||!A(f)){s+=" "+f}else{s+=" "+o(f)}}return s};r.deprecate=function(e,n){if(S(i.process)){return function(){return r.deprecate(e,n).apply(this,arguments)}}if(t.noDeprecation===true){return e}var a=false;function s(){if(!a){if(t.throwDeprecation){throw new Error(n)}else if(t.traceDeprecation){console.trace(n)}else{console.error(n)}a=true}return e.apply(this,arguments)}return s};var a={};var s;r.debuglog=function(e){if(S(s))s=t.env.NODE_DEBUG||"";e=e.toUpperCase();if(!a[e]){if(new RegExp("\\b"+e+"\\b","i").test(s)){var i=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,i,t)}}else{a[e]=function(){}}}return a[e]};function o(e,t){var i={seen:[],stylize:l};if(arguments.length>=3)i.depth=arguments[2];if(arguments.length>=4)i.colors=arguments[3];if(_(t)){i.showHidden=t}else if(t){r._extend(i,t)}if(S(i.showHidden))i.showHidden=false;if(S(i.depth))i.depth=2;if(S(i.colors))i.colors=false;if(S(i.customInspect))i.customInspect=true;if(i.colors)i.stylize=f;return c(i,e,i.depth)}r.inspect=o;o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function f(e,t){var r=o.styles[t];if(r){return"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m"}else{return e}}function l(e,t){return e}function u(e){var t={};e.forEach(function(e,r){t[e]=true});return t}function c(e,t,i){if(e.customInspect&&t&&U(t.inspect)&&t.inspect!==r.inspect&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(i,e);if(!x(n)){n=c(e,n,i)}return n}var a=p(e,t);if(a){return a}var s=Object.keys(t);var o=u(s);if(e.showHidden){s=Object.getOwnPropertyNames(t)}if(I(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return d(t)}if(s.length===0){if(U(t)){var f=t.name?": "+t.name:"";return e.stylize("[Function"+f+"]","special")}if(E(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}if(T(t)){return e.stylize(Date.prototype.toString.call(t),"date")}if(I(t)){return d(t)}}var l="",_=false,y=["{","}"];if(g(t)){_=true;y=["[","]"]}if(U(t)){var b=t.name?": "+t.name:"";l=" [Function"+b+"]"}if(E(t)){l=" "+RegExp.prototype.toString.call(t)}if(T(t)){l=" "+Date.prototype.toUTCString.call(t)}if(I(t)){l=" "+d(t)}if(s.length===0&&(!_||t.length==0)){return y[0]+l+y[1]}if(i<0){if(E(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(t);var w;if(_){w=h(e,t,i,o,s)}else{w=s.map(function(r){return m(e,t,i,o,r,_)})}e.seen.pop();return v(w,l,y)}function p(e,t){if(S(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(w(t))return e.stylize(""+t,"number");if(_(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,i,n){var a=[];for(var s=0,o=t.length;s<o;++s){if(F(t,String(s))){a.push(m(e,t,r,i,String(s),true))}else{a.push("")}}n.forEach(function(n){if(!n.match(/^\d+$/)){a.push(m(e,t,r,i,n,true))}});return a}function m(e,t,r,i,n,a){var s,o,f;f=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]};if(f.get){if(f.set){o=e.stylize("[Getter/Setter]","special")}else{o=e.stylize("[Getter]","special")}}else{if(f.set){o=e.stylize("[Setter]","special")}}if(!F(i,n)){s="["+n+"]"}if(!o){if(e.seen.indexOf(f.value)<0){if(y(r)){o=c(e,f.value,null)}else{o=c(e,f.value,r-1)}if(o.indexOf("\n")>-1){if(a){o=o.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{o="\n"+o.split("\n").map(function(e){return" "+e}).join("\n")}}}else{o=e.stylize("[Circular]","special")}}if(S(s)){if(a&&n.match(/^\d+$/)){return o}s=JSON.stringify(""+n);if(s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){s=s.substr(1,s.length-2);s=e.stylize(s,"name")}else{s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");s=e.stylize(s,"string")}}return s+": "+o}function v(e,t,r){var i=0;var n=e.reduce(function(e,t){i++;if(t.indexOf("\n")>=0)i++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]}return r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}r.isArray=g;function _(e){return typeof e==="boolean"}r.isBoolean=_;function y(e){return e===null}r.isNull=y;function b(e){return e==null}r.isNullOrUndefined=b;function w(e){return typeof e==="number"}r.isNumber=w;function x(e){return typeof e==="string"}r.isString=x;function k(e){return typeof e==="symbol"}r.isSymbol=k;function S(e){return e===void 0}r.isUndefined=S;function E(e){return A(e)&&B(e)==="[object RegExp]"}r.isRegExp=E;function A(e){return typeof e==="object"&&e!==null}r.isObject=A;function T(e){return A(e)&&B(e)==="[object Date]"}r.isDate=T;function I(e){return A(e)&&(B(e)==="[object Error]"||e instanceof Error)}r.isError=I;function U(e){return typeof e==="function"}r.isFunction=U;function L(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=L;r.isBuffer=e("./support/isBuffer");function B(e){return Object.prototype.toString.call(e)}function z(e){return e<10?"0"+e.toString(10):e.toString(10)}var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date;var t=[z(e.getHours()),z(e.getMinutes()),z(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}r.log=function(){console.log("%s - %s",R(),r.format.apply(r,arguments))};r.inherits=e("inherits");r._extend=function(e,t){if(!t||!A(t))return e;var r=Object.keys(t);var i=r.length;while(i--){e[r[i]]=t[r[i]]}return e};function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":97,_process:78,inherits:147}],99:[function(e,t,r){(function(r,i){t.exports=y;t.exports.announceList=[["udp://tracker.publicbt.com:80"],["udp://tracker.openbittorrent.com:80"],["udp://open.demonii.com:1337"],["udp://tracker.webtorrent.io:80"],["wss://tracker.webtorrent.io"]];t.exports.parseInput=b;var n=e("bencode");var a=e("block-stream2");var s=e("piece-length");var o=e("path");var f=e("dezalgo");var l=e("filestream/read");var u=e("flatten");var c=e("fs");var p=e("is-file");var d=e("junk");var h=e("multistream");var m=e("once");var v=e("run-parallel");var g=e("simple-sha1");var _=e("stream");function y(e,t,r){if(typeof t==="function"){r=t;t={}}if(!t)t={};b(e,t,function(e,i,n){if(e)return r(e);t.singleFileTorrent=n;A(i,t,r)})}function b(e,t,r){if(typeof t==="function"){r=t;t={}}if(!t)t={};r=f(r);if(Array.isArray(e)&&e.length===0)throw new Error("invalid input type");if(U(e))e=Array.prototype.slice.call(e);if(!Array.isArray(e))e=[e];if(!t.name)t.name=e[0]&&e[0].name;if(!t.name)t.name=typeof e[0]==="string"&&o.basename(e[0]);if(t.name===undefined){throw new Error("missing option 'name' and unable to infer it from input[0].name")}if(e.length===1&&!e[0].name)e[0].name=t.name;var n=e.reduce(function(e,t){return e+Number(typeof t==="string")},0);var a=e.length===1;if(e.length===1&&typeof e[0]==="string"){p(e[0],function(e,t){if(e)return r(e);a=t;s()})}else{s()}function s(){v(e.map(function(e){return function(r){var s={};if(I(e)){s.getStream=B(e);s.length=e.size}else if(i.isBuffer(e)){s.getStream=z(e);s.length=e.length}else if(L(e)){if(!t.pieceLength){throw new Error("must specify `pieceLength` option if input is Stream")}s.getStream=R(e,s);s.length=0}else if(typeof e==="string"){if(typeof c.readdir!=="function"){throw new Error("filesystem paths do not work in the browser")}var f=n>1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=u(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=u(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=C(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var l=0;var u=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",_);c.pipe(p).on("data",d).on("end",v).on("error",_);function d(e){s+=e.length;var t=l;g(e,function(e){n[t]=e;f-=1;b()});f+=1;l+=1}function v(){u=true;b()}function _(e){y();r(e)}function y(){c.removeListener("error",_);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",_)}function b(){if(u&&f===0){y();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var l=i.pieceLength||s(e.reduce(T,0));f.info["piece length"]=l;E(e,l,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function T(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function U(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new l(e)}}function z(e){return function(){var t=new _.PassThrough;t.end(e);return t}}function C(e){return function(){return c.createReadStream(e)}}function R(e,t){return function(){var r=new _.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:100,"block-stream2":104,buffer:66,dezalgo:116,"filestream/read":122,flatten:123,fs:50,"is-file":124,junk:125,multistream:126,once:129,path:77,"piece-length":130,"run-parallel":132,"simple-sha1":136,stream:94}],100:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./lib/decode":101,"./lib/encode":103,dup:17}],101:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{"./dict":102,buffer:66,dup:18}],102:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],103:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{buffer:66,dup:20}],104:[function(e,t,r){arguments[4][39][0].apply(r,arguments)},{buffer:66,defined:105,dup:39,inherits:106,"readable-stream":115}],105:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40}],106:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],107:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./_stream_readable":109,"./_stream_writable":111,_process:78,"core-util-is":112,dup:41,inherits:106}],108:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./_stream_transform":110,"core-util-is":112,dup:42,inherits:106}],109:[function(e,t,r){(function(r){t.exports=u;var i=e("isarray");var n=e("buffer").Buffer;u.ReadableState=l;var a=e("events").EventEmitter;if(!a.listenerCount)a.listenerCount=function(e,t){return e.listeners(t).length};var s=e("stream");var o=e("core-util-is");o.inherits=e("inherits");var f;o.inherits(u,s);function l(t,r){t=t||{};var i=t.highWaterMark;this.highWaterMark=i||i===0?i:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!t.objectMode;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!f)f=e("string_decoder/").StringDecoder;this.decoder=new f(t.encoding);this.encoding=t.encoding}}function u(e){if(!(this instanceof u))return new u(e);this._readableState=new l(e,this);this.readable=true;s.call(this)}u.prototype.push=function(e,t){var r=this._readableState;if(typeof e==="string"&&!r.objectMode){t=t||r.defaultEncoding;if(t!==r.encoding){e=new n(e,t);t=""}}return c(this,r,e,t,false)};u.prototype.unshift=function(e){var t=this._readableState;return c(this,t,e,"",true)};function c(e,t,r,i,n){var a=v(t,r);if(a){e.emit("error",a)}else if(r===null||r===undefined){t.reading=false;if(!t.ended)g(e,t)}else if(t.objectMode||r&&r.length>0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);t.length+=t.objectMode?1:r.length;if(n){t.buffer.unshift(r)}else{t.reading=false;t.buffer.push(r)}if(t.needReadable)_(e);b(e,t)}}else if(!n){t.reading=false}return p(t)}function p(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}u.prototype.setEncoding=function(t){if(!f)f=e("string_decoder/").StringDecoder;this._readableState.decoder=new f(t);this._readableState.encoding=t};var d=8388608;function h(e){if(e>=d){e=d}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function m(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=h(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}u.prototype.read=function(e){var t=this._readableState;t.calledRead=true;var r=e;var i;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){_(this);return null}e=m(e,t);if(e===0&&t.ended){i=null;if(t.length>0&&t.decoder){i=A(e,t);t.length-=i.length}if(t.length===0)T(this);return i}var n=t.needReadable;if(t.length-e<=t.highWaterMark)n=true;if(t.ended||t.reading)n=false;if(n){t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false}if(n&&!t.reading)e=m(r,t);if(e>0)i=A(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(t.ended&&!t.endEmitted&&t.length===0)T(this);return i};function v(e,t){var r=null;if(!n.isBuffer(t)&&"string"!==typeof t&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function g(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.length>0)_(e);else T(e)}function _(e){var t=e._readableState;t.needReadable=false;if(t.emittedReadable)return;t.emittedReadable=true;if(t.sync)r.nextTick(function(){y(e)});else y(e)}function y(e){e.emit("readable")}function b(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){w(e,t)})}}function w(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}u.prototype._read=function(e){this.emit("error",new Error("not implemented"))};u.prototype.pipe=function(e,t){var n=this;var s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e);break}s.pipesCount+=1;var o=(!t||t.end!==false)&&e!==r.stdout&&e!==r.stderr;var f=o?u:p;if(s.endEmitted)r.nextTick(f);else n.once("end",f);e.on("unpipe",l);function l(e){if(e!==n)return;p()}function u(){e.end()}var c=x(n);e.on("drain",c);function p(){e.removeListener("close",h);e.removeListener("finish",m);e.removeListener("drain",c);e.removeListener("error",d);e.removeListener("unpipe",l);n.removeListener("end",u);n.removeListener("end",p);if(!e._writableState||e._writableState.needDrain)c()}function d(t){v();e.removeListener("error",d);if(a.listenerCount(e,"error")===0)e.emit("error",t)}if(!e._events||!e._events.error)e.on("error",d);else if(i(e._events.error))e._events.error.unshift(d);else e._events.error=[d,e._events.error];function h(){e.removeListener("finish",m);v()}e.once("close",h);function m(){e.removeListener("close",h);v()}e.once("finish",m);function v(){n.unpipe(e)}e.emit("pipe",n);if(!s.flowing){this.on("readable",S);s.flowing=true;r.nextTick(function(){k(n)})}return e};function x(e){return function(){var t=this;var r=e._readableState;r.awaitDrain--;if(r.awaitDrain===0)k(e)}}function k(e){var t=e._readableState;var r;t.awaitDrain=0;function i(e,i,n){var a=e.write(r);if(false===a){t.awaitDrain++}}while(t.pipesCount&&null!==(r=e.read())){if(t.pipesCount===1)i(t.pipes,0,null);else I(t.pipes,i);e.emit("data",r);if(t.awaitDrain>0)return}if(t.pipesCount===0){t.flowing=false;if(a.listenerCount(e,"data")>0)E(e);return}t.ranOut=true}function S(){if(this._readableState.ranOut){this._readableState.ranOut=false;k(this)}}u.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;this.removeListener("readable",S);t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var r=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;this.removeListener("readable",S);t.flowing=false;for(var n=0;n<i;n++)r[n].emit("unpipe",this);return this}var n=U(t.pipes,e);if(n===-1)return this;t.pipes.splice(n,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this);return this};u.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t);if(e==="data"&&!this._readableState.flowing)E(this);if(e==="readable"&&this.readable){var i=this._readableState;if(!i.readableListening){i.readableListening=true;i.emittedReadable=false;i.needReadable=true;if(!i.reading){this.read(0)}else if(i.length){_(this,i)}}}return r};u.prototype.addListener=u.prototype.on;u.prototype.resume=function(){E(this);this.read(0);this.emit("resume")};u.prototype.pause=function(){E(this,true);this.emit("pause")};function E(e,t){var i=e._readableState;if(i.flowing){throw new Error("Cannot switch to old mode now.")}var n=t||false;var a=false;e.readable=true;e.pipe=s.prototype.pipe;e.on=e.addListener=s.prototype.on;e.on("readable",function(){a=true;var t;while(!n&&null!==(t=e.read()))e.emit("data",t);if(t===null){a=false;e._readableState.needReadable=true}});e.pause=function(){n=true;this.emit("pause")};e.resume=function(){n=false;if(a)r.nextTick(function(){e.emit("readable")});else this.read(0);this.emit("resume")};e.emit("readable")}u.prototype.wrap=function(e){var t=this._readableState;var r=false;var i=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)i.push(e)}i.push(null)});e.on("data",function(n){if(t.decoder)n=t.decoder.write(n);if(t.objectMode&&(n===null||n===undefined))return;else if(!t.objectMode&&(!n||!n.length))return;var a=i.push(n);if(!a){r=true;e.pause()}});for(var n in e){if(typeof e[n]==="function"&&typeof this[n]==="undefined"){this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n)}}var a=["error","close","destroy","pause","resume"];I(a,function(t){e.on(t,i.emit.bind(i,t))});i._read=function(t){if(r){r=false;e.resume()}};return i};u._fromList=A;function A(e,t){var r=t.buffer;var i=t.length;var a=!!t.decoder;var s=!!t.objectMode;var o;if(r.length===0)return null;if(i===0)o=null;else if(s)o=r.shift();else if(!e||e>=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e<r[0].length){var f=r[0];o=f.slice(0,e);r[0]=f.slice(e)}else if(e===r[0].length){o=r.shift()}else{if(a)o="";else o=new n(e);var l=0;for(var u=0,c=r.length;u<c&&l<e;u++){var f=r[0];var p=Math.min(e-l,f.length);if(a)o+=f.slice(0,p);else f.copy(o,l,0,p);if(p<f.length)r[0]=f.slice(p);else r.shift();l+=p}}}return o}function T(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted&&t.calledRead){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,i=e.length;r<i;r++){t(e[r],r)}}function U(e,t){for(var r=0,i=e.length;r<i;r++){if(e[r]===t)return r}return-1}}).call(this,e("_process"))},{_process:78,buffer:66,"core-util-is":112,events:70,inherits:106,isarray:113,stream:94,"string_decoder/":114}],110:[function(e,t,r){t.exports=o;var i=e("./_stream_duplex");var n=e("core-util-is");n.inherits=e("inherits");n.inherits(o,i);function a(e,t){this.afterTransform=function(e,r){return s(t,e,r)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function s(e,t,r){var i=e._transformState;i.transforming=false;var n=i.writecb;if(!n)return e.emit("error",new Error("no writecb in Transform class"));i.writechunk=null;i.writecb=null;if(r!==null&&r!==undefined)e.push(r);if(n)n(t);var a=e._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){e._read(a.highWaterMark)}}function o(e){if(!(this instanceof o))return new o(e);i.call(this,e);var t=this._transformState=new a(e,this);var r=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(e){f(r,e)});else f(r)})}o.prototype.push=function(e,t){this._transformState.needTransform=false;return i.prototype.push.call(this,e,t)};o.prototype._transform=function(e,t,r){throw new Error("not implemented")};o.prototype._write=function(e,t,r){var i=this._transformState;i.writecb=r;i.writechunk=e;i.writeencoding=t;if(!i.transforming){var n=this._readableState;if(i.needTransform||n.needReadable||n.length<n.highWaterMark)this._read(n.highWaterMark)}};o.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};function f(e,t){if(t)return e.emit("error",t);var r=e._writableState;var i=e._readableState;var n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":107,"core-util-is":112,inherits:106}],111:[function(e,t,r){(function(r){t.exports=f;var i=e("buffer").Buffer;f.WritableState=o;var n=e("core-util-is");n.inherits=e("inherits");var a=e("stream");n.inherits(f,a);function s(e,t,r){this.chunk=e;this.encoding=t;this.callback=r}function o(e,t){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||r===0?r:16*1024;this.objectMode=!!e.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var i=e.decodeStrings===false;this.decodeStrings=!i;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){v(t,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function f(t){var r=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof r))return new f(t);this._writableState=new o(t,this);this.writable=true;a.call(this)}f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."));
+};function l(e,t,i){var n=new Error("write after end");e.emit("error",n);r.nextTick(function(){i(n)})}function u(e,t,n,a){var s=true;if(!i.isBuffer(n)&&"string"!==typeof n&&n!==null&&n!==undefined&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o);r.nextTick(function(){a(o)});s=false}return s}f.prototype.write=function(e,t,r){var n=this._writableState;var a=false;if(typeof t==="function"){r=t;t=null}if(i.isBuffer(e))t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=function(){};if(n.ended)l(this,n,r);else if(u(this,n,e,r))a=p(this,n,e,t,r);return a};function c(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function p(e,t,r,n,a){r=c(t,r,n);if(i.isBuffer(r))n="buffer";var o=t.objectMode?1:r.length;t.length+=o;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing)t.buffer.push(new s(r,n,a));else d(e,t,o,r,n,a);return f}function d(e,t,r,i,n,a){t.writelen=r;t.writecb=a;t.writing=true;t.sync=true;e._write(i,n,t.onwrite);t.sync=false}function h(e,t,i,n,a){if(i)r.nextTick(function(){a(n)});else a(n);e._writableState.errorEmitted=true;e.emit("error",n)}function m(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function v(e,t){var i=e._writableState;var n=i.sync;var a=i.writecb;m(i);if(t)h(e,i,n,t,a);else{var s=b(e,i);if(!s&&!i.bufferProcessing&&i.buffer.length)y(e,i);if(n){r.nextTick(function(){g(e,i,s,a)})}else{g(e,i,s,a)}}}function g(e,t,r,i){if(!r)_(e,t);i();if(r)w(e,t)}function _(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function y(e,t){t.bufferProcessing=true;for(var r=0;r<t.buffer.length;r++){var i=t.buffer[r];var n=i.chunk;var a=i.encoding;var s=i.callback;var o=t.objectMode?1:n.length;d(e,t,o,n,a,s);if(t.writing){r++;break}}t.bufferProcessing=false;if(r<t.buffer.length)t.buffer=t.buffer.slice(r);else t.buffer.length=0}f.prototype._write=function(e,t,r){r(new Error("not implemented"))};f.prototype.end=function(e,t,r){var i=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(typeof e!=="undefined"&&e!==null)this.write(e,t);if(!i.ending&&!i.finished)x(this,i,r)};function b(e,t){return t.ending&&t.length===0&&!t.finished&&!t.writing}function w(e,t){var r=b(e,t);if(r){t.finished=true;e.emit("finish")}return r}function x(e,t,i){t.ending=true;w(e,t);if(i){if(t.finished)r.nextTick(i);else e.once("finish",i)}t.ended=true}}).call(this,e("_process"))},{"./_stream_duplex":107,_process:78,buffer:66,"core-util-is":112,inherits:106,stream:94}],112:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{buffer:66,dup:46}],113:[function(e,t,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],114:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:66,dup:48}],115:[function(e,t,r){var i=e("stream");r=t.exports=e("./lib/_stream_readable.js");r.Stream=i;r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":107,"./lib/_stream_passthrough.js":108,"./lib/_stream_readable.js":109,"./lib/_stream_transform.js":110,"./lib/_stream_writable.js":111,stream:94}],116:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{asap:117,dup:31,wrappy:118}],117:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{_process:78,dup:32}],118:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],119:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],120:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:66,"is-typedarray":121}],121:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],122:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:119,stream:94,"typedarray-to-buffer":120}],123:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i<t){return e.concat(r(n,i+1))}else{return e.concat(n)}},[])}}},{}],124:[function(e,t,r){"use strict";var i=e("fs");t.exports=function a(e,t){if(!t)return n(e);i.stat(e,function(e,r){if(e)return t(e);return t(null,r.isFile())})};t.exports.sync=n;function n(e){return i.existsSync(e)&&i.statSync(e).isFile()}},{fs:50}],125:[function(e,t,r){"use strict";r.re=/^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon[\r\?]?|^\._.*|^.Spotlight-V100$|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^Desktop\.ini$/;r.is=function(e){return r.re.test(e)};r.not=r.isnt=function(e){return!r.is(e)}},{}],126:[function(e,t,r){t.exports=a;var i=e("inherits");var n=e("stream");i(a,n.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);n.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();this._queue.forEach(function(e){if(e.destroy)e.destroy()});if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",n);t.on("error",a);t.on("close",i);function r(){e._forward()}function i(){if(!t._readableState.ended){e.destroy()}}function n(){e._current=null;t.removeListener("readable",r);t.removeListener("end",n);t.removeListener("error",a);t.removeListener("close",i);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new n.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:127,stream:94}],127:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],128:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],129:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37,wrappy:128}],130:[function(e,t,r){var i=e("closest-to");var n=[];for(var a=14;a<=22;a++){n.push(Math.pow(2,a))}t.exports=function(e){return i(e/Math.pow(2,10),n)}},{"closest-to":131}],131:[function(e,t,r){t.exports=function(e,t){var r=Infinity;var i=0;var n=null;t.sort(function(e,t){return e-t});for(var a=0,s=t.length;a<s;a++){i=Math.abs(e-t[a]);if(i>=r){break}r=i;n=t[a]}return n}},{}],132:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:133}],133:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{asap:134,dup:31,wrappy:135}],134:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{_process:78,dup:32}],135:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],136:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function l(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=u(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function u(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i<t;i++){r[i]=e.charCodeAt(i)}return r}function c(e){var t=e.length;var r=[];for(var i=0;i<t;i++){var n=e[i];r.push((n>>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=l;t.exports.sync=o},{rusha:137}],137:[function(e,t,r){(function(e){(function(){if(typeof t!=="undefined"){t.exports=a}else if(typeof window!=="undefined"){window.Rusha=a}if(typeof FileReaderSync!=="undefined"){var r=new FileReaderSync,i=new a(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=i.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}var n={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function a(e){"use strict";var t={fill:0};var i=function(e){for(e+=9;e%64>0;e+=1);return e};var a=function(e,t){for(var r=t>>2;r<e.length;r++)e[r]=0};var o=function(e,t,r){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,l=i-f;if(l>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s<l;s=s+4|0){t[n+s>>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+l+1|0]=a.charCodeAt(r+l+2);case 2:e[n+l+2|0]=a.charCodeAt(r+l+1);case 1:e[n+l+3|0]=a.charCodeAt(r+l)}};var l=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,l=i-f;if(l>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s<l;s=s+=4|0){t[n+s>>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+l+1|0]=a[r+l+2];case 2:e[n+l+2|0]=a[r+l+1];case 1:e[n+l+3|0]=a[r+l]}};var u=function(e,t,i,n,a){var s=this,o,f=a%4,l=n%4,u=n-l;var c=new Uint8Array(r.readAsArrayBuffer(s.slice(i,i+n)));if(u>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o<u;o=o+=4|0){t[a+o>>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(l){case 3:e[a+u+1|0]=c[u+2];case 2:e[a+u+2|0]=c[u+1];case 1:e[a+u+3|0]=c[u]}};var c=function(e){switch(n.getDataType(e)){case"string":return f.bind(e);case"array":return l.bind(e);case"buffer":return l.bind(e);case"arraybuffer":return l.bind(new Uint8Array(e));case"view":return l.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return u.bind(e)}};var p=function(e,t){switch(n.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){r=a[t];n[t]=i.charAt(r>>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t<e;t=t<<1);}else{for(t=16777216;t<e;t+=16777216);}return t};var m=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=i(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=s({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=i(e);var s=new Int32Array(t.heap,0,n>>2);a(s,e);o(s,e,r);return n};var _=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var y=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}_(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){y(e,i,n,r,false)}y(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,l=0,u=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;l=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;u=l;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&l|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&l|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^l^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&l|o&c|l&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^l^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;l=l+u|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=l;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],138:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":139}],139:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:140}],140:[function(e,t,r){var i=1e3;var n=i*60;var a=n*60;var s=a*24;var o=s*365.25;t.exports=function(e,t){t=t||{};if("string"==typeof e)return f(e);return t.long?u(e):l(e)};function f(e){e=""+e;if(e.length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function l(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function u(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+r;return Math.ceil(e/t)+" "+r+"s"}},{}],141:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{asap:142,dup:31,wrappy:144}],142:[function(e,t,r){"use strict";var i=e("./raw");var n=[];var a=[];var s=i.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(n.length){t=n.pop()}else{t=new l}t.task=e;i(t)}function l(){this.task=null}l.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;n[n.length]=this}}},{"./raw":143}],143:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!i.length){a();n=true}i[i.length]=e}var i=[];var n=false;var a;var s=0;var o=1024;function f(){while(s<i.length){var e=s;s=s+1;i[e].call();if(s>o){for(var t=0,r=i.length-s;t<r;t++){i[t]=i[t+s]}i.length-=s;s=0}}i.length=0;s=0;n=false}var l=e.MutationObserver||e.WebKitMutationObserver;if(typeof l==="function"){a=u(f)}else{a=c(f)}r.requestFlush=a;function u(e){var t=1;var r=new l(e);var i=document.createTextNode("");r.observe(i,{characterData:true});return function n(){t=-t;i.data=t}}function c(e){return function t(){var t=setTimeout(i,0);var r=setInterval(i,50);function i(){clearTimeout(t);clearInterval(r);e()}}}r.makeRequestCallFromTimer=c}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],144:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],145:[function(e,t,r){var i=e("once");var n=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=i(r||n);var f=e._writableState;var l=e._readableState;var u=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!u)r()};var h=function(){u=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(u&&!(l&&l.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:153}],146:[function(e,t,r){var i=t.exports=function(e,t){if(!t)t=16;if(e===undefined)e=128;if(e<=0)return"0";var r=Math.log(Math.pow(2,e))/Math.log(t);for(var n=2;r===Infinity;n*=2){r=Math.log(Math.pow(2,e/n))/Math.log(t)*n}var a=r-Math.floor(r);var s="";for(var n=0;n<Math.floor(r);n++){var o=Math.floor(Math.random()*t).toString(t);s=o+s}if(a){var f=Math.pow(t,a);var o=Math.floor(Math.random()*f).toString(t);s=o+s}var l=parseInt(s,t);if(l!==Infinity&&l>=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],147:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],148:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n<i.length;n++){if(r.env.DEBUG_MIME&&this.types[i]){console.warn(this._loading.replace(/.*\//,""),'changes "'+i[n]+'" extension type from '+this.types[i]+" to "+t)}this.types[i[n]]=t}if(!this.extensions[t]){this.extensions[t]=i[0]}}};a.prototype.load=function(e){this._loading=e;var t={},r=n.readFileSync(e,"ascii"),i=r.split(/[\r\n]+/);i.forEach(function(e){var r=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);t[r.shift()]=r});this.define(t);this._loading=null};a.prototype.lookup=function(e,t){var r=e.replace(/.*[\.\/\\]/,"").toLowerCase();return this.types[r]||t||this.default_type};a.prototype.extension=function(e){var t=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[t]};var s=new a;s.define(e("./types.json"));s.default_type=s.lookup("bin");s.Mime=a;s.charsets={lookup:function(e,t){return/^text\//.test(e)?"UTF-8":t}};t.exports=s}).call(this,e("_process"))},{"./types.json":149,_process:78,fs:50,path:77}],149:[function(e,t,r){t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],
+"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],150:[function(e,t,r){arguments[4][126][0].apply(r,arguments)},{dup:126,inherits:151,stream:94}],151:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],152:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],153:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37,wrappy:152}],154:[function(e,t,r){(function(r){t.exports=f;t.exports.remote=l;var i=e("dezalgo");var n=e("fs");var a=e("simple-get");var s=e("magnet-uri");var o=e("parse-torrent-file");t.exports.toMagnetURI=s.encode;t.exports.toTorrentFile=o.encode;function f(e){var t=e&&e.length;if(typeof e==="string"&&/magnet:/.test(e)){return s(e)}else if(typeof e==="string"&&(t===40||t===32)){return s("magnet:?xt=urn:btih:"+e)}else if(r.isBuffer(e)&&t===20){return s("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(r.isBuffer(e)){return o(e)}else if(e&&e.infoHash){if(!e.announce)e.announce=[];if(typeof e.announce==="string"){e.announce=[e.announce]}return e}else{throw new Error("Invalid torrent identifier")}}function l(e,t){var r;if(typeof t!=="function")throw new Error("second argument must be a Function");t=i(t);try{r=f(e)}catch(s){}if(r&&r.infoHash){t(null,r)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}o(r)})}else if(typeof n.readFile==="function"&&typeof e==="string"){n.readFile(e,function(e,r){if(e)return t(new Error("Invalid torrent identifier"));o(r)})}else{t(new Error("Invalid torrent identifier"))}function o(e){try{r=f(e)}catch(i){return t(i)}if(r&&r.infoHash)t(null,r);else t(new Error("Invalid torrent identifier"))}}}).call(this,e("buffer").Buffer)},{buffer:66,dezalgo:155,fs:50,"magnet-uri":159,"parse-torrent-file":164,"simple-get":52}],155:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{asap:156,dup:31,wrappy:158}],156:[function(e,t,r){arguments[4][142][0].apply(r,arguments)},{"./raw":157,dup:142}],157:[function(e,t,r){arguments[4][143][0].apply(r,arguments)},{dup:143}],158:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],159:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var i=e("thirty-two");var n=e("xtend");var a=e("uniq");function s(e){var t={};var n=e.split("magnet:?")[1];var s=n&&n.length>=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:66,"thirty-two":160,uniq:162,xtend:163}],160:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":161}],161:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i<r.length){var l=r[i];if(s>3){o=l&255>>s;s=(s+5)%8;o=o<<s|(i+1<r.length?r[i+1]:0)>>8-s;i++}else{o=l>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i<f.length;i++)f[i]=61;return f};r.decode=function(t){var r=0;var n=0;var a;var s=0;if(!e.isBuffer(t)){t=new e(t)}var o=new e(Math.ceil(t.length*5/8));for(var f=0;f<t.length;f++){if(t[f]==61){break}var l=t[f]-48;if(l<i.length){n=i[l];if(r<=3){r=(r+5)%8;if(r==0){a|=n;o[s]=a;s++;a=0}else{a|=255&n<<8-r}}else{r=(r+5)%8;a|=255&n>>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:66}],162:[function(e,t,r){"use strict";function i(e,t){var r=1,i=e.length,n=e[0],a=e[0];for(var s=1;s<i;++s){a=n;n=e[s];if(t(n,a)){if(s===r){r++;continue}e[r++]=n}}e.length=r;return e}function n(e){var t=1,r=e.length,i=e[0],n=e[0];for(var a=1;a<r;++a,n=i){n=i;i=e[a];if(i!==n){if(a===t){t++;continue}e[t++]=i}}e.length=t;return e}function a(e,t,r){if(e.length===0){return e}if(t){if(!r){e.sort(t)}return i(e,t)}if(!r){e.sort()}return n(e)}t.exports=a},{}],163:[function(e,t,r){arguments[4][27][0].apply(r,arguments)},{dup:27}],164:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce)}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(l,0)}});t.length=o.reduce(l,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=u(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function l(e,t){return e+t.length}function u(e){var t=[];for(var r=0;r<e.length;r+=20){t.push(e.slice(r,r+20).toString("hex"))}return t}function c(e,t){if(!e)throw new Error("Torrent is missing required field: "+t)}}).call(this,e("buffer").Buffer)},{bencode:165,buffer:66,path:77,"simple-sha1":169,uniq:171}],165:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./lib/decode":166,"./lib/encode":168,dup:17}],166:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{"./dict":167,buffer:66,dup:18}],167:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],168:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{buffer:66,dup:20}],169:[function(e,t,r){arguments[4][136][0].apply(r,arguments)},{dup:136,rusha:170}],170:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{dup:137}],171:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],172:[function(e,t,r){var i=e("once");var n=e("end-of-stream");var a=e("fs");var s=function(){};var o=function(e){return typeof e==="function"};var f=function(e){return(e instanceof(a.ReadStream||s)||e instanceof(a.WriteStream||s))&&o(e.close)};var l=function(e){return e.setHeader&&o(e.abort)};var u=function(e,t,r,a){a=i(a);var s=false;e.on("close",function(){s=true});n(e,{readable:t,writable:r},function(e){if(e)return a(e);s=true;a()});var u=false;return function(t){if(s)return;if(u)return;u=true;if(f(e))return e.close();if(l(e))return e.abort();if(o(e.destroy))return e.destroy();a(t||new Error("stream was destroyed"))}};var c=function(e){e()};var p=function(e,t){return e.pipe(t)};var d=function(){var e=Array.prototype.slice.call(arguments);var t=o(e[e.length-1]||s)&&e.pop()||s;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var i=e.map(function(n,a){var s=a<e.length-1;var o=a>0;return u(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":145,fs:50,once:153}],173:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],174:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:70}],175:[function(e,t,r){arguments[4][132][0].apply(r,arguments)},{dezalgo:176,dup:132}],176:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{asap:177,dup:31,wrappy:178}],177:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{_process:78,dup:32}],178:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],179:[function(e,t,r){arguments[4][136][0].apply(r,arguments)},{dup:136,rusha:180}],180:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){
+if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r<e.length;r++)e[r]=0};var o=function(e,t,r){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,l=i-f;if(l>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s<l;s=s+4|0){t[n+s>>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+l+1|0]=a.charCodeAt(r+l+2);case 2:e[n+l+2|0]=a.charCodeAt(r+l+1);case 1:e[n+l+3|0]=a.charCodeAt(r+l)}};var l=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,l=i-f;if(l>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s<l;s=s+=4|0){t[n+s>>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+l+1|0]=a[r+l+2];case 2:e[n+l+2|0]=a[r+l+1];case 1:e[n+l+3|0]=a[r+l]}};var u=function(e,t,r,i,a){var s=this,o,f=a%4,l=i%4,u=i-l;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(u>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o<u;o=o+=4|0){t[a+o>>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(l){case 3:e[a+u+1|0]=c[u+2];case 2:e[a+u+2|0]=c[u+1];case 1:e[a+u+3|0]=c[u]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return l.bind(e);case"buffer":return l.bind(e);case"arraybuffer":return l.bind(new Uint8Array(e));case"view":return l.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return u.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){r=a[t];n[t]=i.charAt(r>>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t<e;t=t<<1);}else{for(t=16777216;t<e;t+=16777216);}return t};var m=function(e){if(e%64>0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var _=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var y=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}_(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){y(e,i,n,r,false)}y(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,l=0,u=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;l=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;u=l;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&l|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&l|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^l^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&l|o&c|l&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^l^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=l;l=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;l=l+u|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=l;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],181:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],182:[function(e,t,r){(function(r){t.exports=u;var i=e("debug")("torrent-discovery");var n=e("bittorrent-dht/client");var a=e("events").EventEmitter;var s=e("xtend/mutable");var o=e("inherits");var f=e("re-emitter");var l=e("bittorrent-tracker/client");o(u,a);function u(e){var t=this;if(!(t instanceof u))return new u(e);a.call(t);s(t,{announce:[],dht:typeof n==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}u.prototype.setTorrent=function(e){var t=this;if(t.torrent)return;if(e&&e.infoHash){t.torrent=e;t.infoHash=e.infoHash}else{if(t.infoHash)return;t.infoHash=e}i("setTorrent %s",t.infoHash);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};u.prototype.stop=function(e){var t=this;if(t.tracker){if(t.tracker.stop)t.tracker.stop();if(t.tracker.destroy)t.tracker.destroy()}if(!t._externalDHT&&t.dht&&t.dht.destroy)t.dht.destroy(e);else r.nextTick(function(){e(null)})};u.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new n;f(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHash)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};u.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHash,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new l(e.peerId,e.port,t,r);f(e.tracker,e,["peer","warning","error"]);e.tracker.start()};u.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"))},{_process:78,"bittorrent-dht/client":52,"bittorrent-tracker/client":183,debug:215,events:70,inherits:218,"re-emitter":219,"xtend/mutable":220}],183:[function(e,t,r){(function(r,i){t.exports=d;var n=e("debug")("bittorrent-tracker");var a=e("events").EventEmitter;var s=e("inherits");var o=e("once");var f=e("url");var l=e("./lib/common");var u=e("./lib/http-tracker");var c=e("./lib/udp-tracker");var p=e("./lib/websocket-tracker");s(d,a);function d(e,t,s,o){var h=this;if(!(h instanceof d))return new d(e,t,s,o);a.call(h);if(!o)o={};h._peerId=i.isBuffer(e)?e:new i(e,"hex");h._peerIdHex=h._peerId.toString("hex");h._peerIdBinary=h._peerId.toString("binary");h._infoHash=i.isBuffer(s.infoHash)?s.infoHash:new i(s.infoHash,"hex");h._infoHashHex=h._infoHash.toString("hex");h._infoHashBinary=h._infoHash.toString("binary");h._port=t;h.torrentLength=s.length;h._rtcConfig=o.rtcConfig;h._wrtc=o.wrtc;h._numWant=o.numWant||l.DEFAULT_ANNOUNCE_PEERS;h._intervalMs=o.interval||l.DEFAULT_ANNOUNCE_INTERVAL;n("new client %s",h._infoHashHex);var m={interval:h._intervalMs};var v=!!h._wrtc||typeof window!=="undefined";var g=typeof s.announce==="string"?[s.announce]:s.announce==null?[]:s.announce;h._trackers=g.map(function(e){e=e.toString();var t=f.parse(e).protocol;if((t==="http:"||t==="https:")&&typeof u==="function"){return new u(h,e,m)}else if(t==="udp:"&&typeof c==="function"){return new c(h,e,m)}else if((t==="ws:"||t==="wss:")&&v){return new p(h,e,m)}else{r.nextTick(function(){var t=new Error("unsupported tracker protocol for "+e);h.emit("warning",t)})}return null}).filter(Boolean)}d.scrape=function(e,t,r){r=o(r);var n=new i("01234567890123456789");var a=6881;var s={infoHash:Array.isArray(t)?t[0]:t,announce:[e]};var f=new d(n,a,s);f.once("error",r);var l=Array.isArray(t)?t.length:1;var u={};f.on("scrape",function(e){l-=1;u[e.infoHash]=e;if(l===0){f.destroy();var t=Object.keys(u);if(t.length===1){r(null,u[t[0]])}else{r(null,u)}}});t=Array.isArray(t)?t.map(function(e){return new i(e,"hex")}):new i(t,"hex");f.scrape({infoHash:t})};d.prototype.start=function(e){var t=this;n("send `start`");e=t._defaultAnnounceOpts(e);e.event="started";t._announce(e);t._trackers.forEach(function(e){e.setInterval(t._intervalMs)})};d.prototype.stop=function(e){var t=this;n("send `stop`");e=t._defaultAnnounceOpts(e);e.event="stopped";t._announce(e)};d.prototype.complete=function(e){var t=this;n("send `complete`");if(!e)e={};if(e.downloaded==null&&t.torrentLength!=null){e.downloaded=t.torrentLength}e=t._defaultAnnounceOpts(e);e.event="completed";t._announce(e)};d.prototype.update=function(e){var t=this;n("send `update`");e=t._defaultAnnounceOpts(e);if(e.event)delete e.event;t._announce(e)};d.prototype._announce=function(e){var t=this;t._trackers.forEach(function(t){t.announce(e)})};d.prototype.scrape=function(e){var t=this;n("send `scrape`");if(!e)e={};t._trackers.forEach(function(t){t.scrape(e)})};d.prototype.setInterval=function(e){var t=this;n("setInterval");t._intervalMs=e;t._trackers.forEach(function(t){t.setInterval(e)})};d.prototype.destroy=function(){var e=this;n("destroy");e._trackers.forEach(function(e){e.destroy();e.setInterval(0)});e._trackers=[]};d.prototype._defaultAnnounceOpts=function(e){var t=this;if(!e)e={};if(e.numWant==null)e.numWant=t._numWant;if(e.uploaded==null)e.uploaded=0;if(e.downloaded==null)e.downloaded=0;if(e.left==null&&t.torrentLength!=null){e.left=t.torrentLength-e.downloaded}return e}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/common":185,"./lib/http-tracker":52,"./lib/udp-tracker":52,"./lib/websocket-tracker":186,_process:78,buffer:66,debug:187,events:70,inherits:191,once:193,url:96}],184:[function(e,t,r){(function(t){var i=e("querystring");r.IPV4_RE=/^[\d\.]+$/;r.IPV6_RE=/^[\da-fA-F:]+$/;r.CONNECTION_ID=t.concat([n(1047),n(655366528)]);r.ACTIONS={CONNECT:0,ANNOUNCE:1,SCRAPE:2,ERROR:3};r.EVENTS={update:0,completed:1,started:2,stopped:3};r.EVENT_IDS={0:"update",1:"completed",2:"started",3:"stopped"};r.EVENT_NAMES={update:"update",completed:"complete",started:"start",stopped:"stop"};function n(e){var r=new t(4);r.writeUInt32BE(e,0);return r}r.toUInt32=n;r.querystringParse=function(e){var t=i.unescape;i.unescape=unescape;var r=i.parse(e);i.unescape=t;return r};r.querystringStringify=function(e){var t=i.escape;i.escape=escape;var r=i.stringify(e);r=r.replace(/[\@\*\/\+]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});i.escape=t;return r}}).call(this,e("buffer").Buffer)},{buffer:66,querystring:82}],185:[function(e,t,r){(function(t){var i=e("xtend/mutable");r.DEFAULT_ANNOUNCE_INTERVAL=30*60*1e3;r.DEFAULT_ANNOUNCE_PEERS=50;r.MAX_ANNOUNCE_PEERS=82;r.binaryToHex=function(e){return new t(e,"binary").toString("hex")};r.hexToBinary=function(e){return new t(e,"hex").toString("binary")};var n=e("./common-node");i(r,n)}).call(this,e("buffer").Buffer)},{"./common-node":184,buffer:66,"xtend/mutable":214}],186:[function(e,t,r){t.exports=d;var i=e("debug")("bittorrent-tracker:websocket-tracker");var n=e("events").EventEmitter;var a=e("hat");var s=e("inherits");var o=e("simple-peer");var f=e("simple-websocket");var l=e("./common");var u={};var c=30*1e3;var p=5*1e3;s(d,n);function d(e,t,r){var a=this;n.call(a);i("new websocket tracker %s",t);a.client=e;a.destroyed=false;a._opts=r;if(t[t.length-1]==="/"){t=t.substring(0,t.length-1)}a._announceUrl=t;a._peers={};a._socket=null;a._intervalMs=a.client._intervalMs;a._interval=null;a._openSocket()}d.prototype.announce=function(e){var t=this;if(t.destroyed)return;if(!t._socket.connected){return t._socket.once("connect",t.announce.bind(t,e))}e.info_hash=t.client._infoHashBinary;e.peer_id=t.client._peerIdBinary;if(e.numWant>10)e.numWant=10;t._generateOffers(e.numWant,function(r){e.offers=r;if(t._trackerId){e.trackerid=t._trackerId}t._send(e)})};d.prototype.scrape=function(e){var t=this;if(t.destroyed)return;t._onSocketError(new Error("scrape not supported "+t._announceUrl))};d.prototype.setInterval=function(e){var t=this;clearInterval(t._interval);t._intervalMs=e;if(e){var r=t.announce.bind(t,t.client._defaultAnnounceOpts());t._interval=setInterval(r,t._intervalMs)}};d.prototype.destroy=function(){var e=this;if(e.destroyed)return;e.destroyed=true;e._socket.removeListener("data",e._onSocketDataBound);e._socket.removeListener("close",e._onSocketCloseBound);e._socket.removeListener("error",e._onSocketErrorBound);e._onSocketErrorBound=null;e._onSocketDataBound=null;e._onSocketCloseBound=null;e._socket.on("error",h);try{e._socket.close()}catch(t){}e._socket=null};d.prototype._openSocket=function(){var e=this;e._onSocketErrorBound=e._onSocketError.bind(e);e._onSocketDataBound=e._onSocketData.bind(e);e._onSocketCloseBound=e._onSocketClose.bind(e);e._socket=u[e._announceUrl];if(!e._socket){e._socket=u[e._announceUrl]=new f(e._announceUrl)}e._socket.on("data",e._onSocketDataBound);e._socket.on("close",e._onSocketCloseBound);e._socket.on("error",e._onSocketErrorBound)};d.prototype._onSocketData=function(e){var t=this;if(t.destroyed)return;if(!(typeof e==="object"&&e!==null)){return t.client.emit("warning",new Error("Invalid tracker response"))}if(e.info_hash!==t.client._infoHashBinary){i("ignoring websocket data from %s for %s (looking for %s: reused socket)",t._announceUrl,l.binaryToHex(e.info_hash),t.client._infoHashHex);return}if(e.peer_id&&e.peer_id===t.client._peerIdBinary){return}i("received %s from %s for %s",JSON.stringify(e),t._announceUrl,t.client._infoHashHex);var r=e["failure reason"];if(r)return t.client.emit("warning",new Error(r));var n=e["warning message"];if(n)t.client.emit("warning",new Error(n));var a=e.interval||e["min interval"];if(a&&!t._opts.interval&&t._intervalMs!==0){t.setInterval(a*1e3)}var s=e["tracker id"];if(s){t._trackerId=s}if(e.complete){t.client.emit("update",{announce:t._announceUrl,complete:e.complete,incomplete:e.incomplete})}var f;if(e.offer&&e.peer_id){f=new o({trickle:false,config:t.client._rtcConfig,wrtc:t.client._wrtc});f.id=l.binaryToHex(e.peer_id);f.once("signal",function(r){var i={info_hash:t.client._infoHashBinary,peer_id:t.client._peerIdBinary,to_peer_id:e.peer_id,answer:r,offer_id:e.offer_id};if(t._trackerId)i.trackerid=t._trackerId;t._send(i)});f.signal(e.offer);t.client.emit("peer",f)}if(e.answer&&e.peer_id){f=t._peers[l.binaryToHex(e.offer_id)];if(f){f.id=l.binaryToHex(e.peer_id);f.signal(e.answer);t.client.emit("peer",f)}else{i("got unexpected answer: "+JSON.stringify(e.answer))}}};d.prototype._onSocketClose=function(){var e=this;if(e.destroyed)return;e.destroy();e._startReconnectTimer()};d.prototype._onSocketError=function(e){var t=this;if(t.destroyed)return;t.destroy();t.client.emit("warning",e);t._startReconnectTimer()};d.prototype._startReconnectTimer=function(){var e=this;var t=Math.floor(Math.random()*c)+p;setTimeout(function(){e.destroyed=false;e._openSocket()},t);i("reconnecting socket in %s ms",t)};d.prototype._send=function(e){var t=this;if(t.destroyed)return;var r=JSON.stringify(e);i("send %s",r);t._socket.send(r)};d.prototype._generateOffers=function(e,t){var r=this;var n=[];i("generating %s offers",e);for(var s=0;s<e;++s){f()}function f(){var e=a(160);var t=r._peers[e]=new o({initiator:true,trickle:false,config:r.client._rtcConfig,wrtc:r.client._wrtc});t.once("signal",function(t){n.push({offer:t,offer_id:l.hexToBinary(e)});u()})}function u(){if(n.length===e){i("generated %s offers",e);t(n)}}};function h(){}},{"./common":185,debug:187,events:70,hat:190,inherits:191,"simple-peer":194,"simple-websocket":206}],187:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{"./debug":188,dup:138}],188:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:189}],189:[function(e,t,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],190:[function(e,t,r){arguments[4][146][0].apply(r,arguments)},{dup:146}],191:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],192:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],193:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37,wrappy:192}],194:[function(e,t,r){(function(r){t.exports=c;var i=e("debug")("simple-peer");var n=e("get-browser-rtc");var a=e("hat");var s=e("inherits");var o=e("is-typedarray");var f=e("once");var l=e("stream");var u=e("typedarray-to-buffer");s(c,l.Duplex);function c(e){var t=this;if(!(t instanceof c))return new c(e);t._debug("new peer %o",e);if(!e)e={};e.allowHalfOpen=false;if(e.highWaterMark==null)e.highWaterMark=1024*1024;l.Duplex.call(t,e);t.initiator=e.initiator||false;t.channelConfig=e.channelConfig||c.channelConfig;t.channelName=e.channelName||a(160);if(!e.initiator)t.channelName=null;t.config=e.config||c.config;t.constraints=e.constraints||c.constraints;t.reconnectTimer=e.reconnectTimer||0;t.sdpTransform=e.sdpTransform||function(e){return e};t.stream=e.stream||false;t.trickle=e.trickle!==undefined?e.trickle:true;t.destroyed=false;t.connected=false;t.remoteAddress=undefined;t.remoteFamily=undefined;t.remotePort=undefined;t.localAddress=undefined;t.localPort=undefined;t._wrtc=e.wrtc||n();if(!t._wrtc){if(typeof window==="undefined"){throw new Error("No WebRTC support: Specify `opts.wrtc` option in this environment")}else{throw new Error("No WebRTC support: Not a supported browser")}}t._maxBufferedAmount=e.highWaterMark;t._pcReady=false;t._channelReady=false;t._iceComplete=false;t._channel=null;t._chunk=null;t._cb=null;t._interval=null;t._reconnectTimeout=null;t._pc=new t._wrtc.RTCPeerConnection(t.config,t.constraints);t._pc.oniceconnectionstatechange=t._onIceConnectionStateChange.bind(t);t._pc.onsignalingstatechange=t._onSignalingStateChange.bind(t);t._pc.onicecandidate=t._onIceCandidate.bind(t);if(t.stream)t._pc.addStream(t.stream);t._pc.onaddstream=t._onAddStream.bind(t);if(t.initiator){t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)});t._pc.onnegotiationneeded=f(t._createOffer.bind(t));if(typeof window==="undefined"||!window.webkitRTCPeerConnection){t._pc.onnegotiationneeded()}}else{t._pc.ondatachannel=t._setupData.bind(t)}t.on("finish",function(){if(t.connected){setTimeout(function(){t._destroy()},100)}else{t.once("connect",function(){setTimeout(function(){t._destroy()},100)})}})}c.WEBRTC_SUPPORT=!!n();c.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]};c.constraints={};c.channelConfig={};Object.defineProperty(c.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}});c.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}};c.prototype.signal=function(e){var t=this;if(t.destroyed)throw new Error("cannot signal after peer is destroyed");if(typeof e==="string"){try{e=JSON.parse(e)}catch(r){e={}}}t._debug("signal()");if(e.sdp){t._pc.setRemoteDescription(new t._wrtc.RTCSessionDescription(e),function(){if(t.destroyed)return;if(t._pc.remoteDescription.type==="offer")t._createAnswer()},t._onError.bind(t))}if(e.candidate){try{t._pc.addIceCandidate(new t._wrtc.RTCIceCandidate(e.candidate),p,t._onError.bind(t))}catch(r){t._destroy(new Error("error adding candidate: "+r.message))}}if(!e.sdp&&!e.candidate){t._destroy(new Error("signal() called with invalid signal data"))}};c.prototype.send=function(e){var t=this;if(!o.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}if(r.isBuffer(e)&&!o.strict(e)){e=new Uint8Array(e)}var i=e.length||e.byteLength||e.size;t._channel.send(e);t._debug("write: %d bytes",i)};c.prototype.destroy=function(e){var t=this;t._destroy(null,e)};c.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);r._debug("destroy (error: %s)",e&&e.message);r.readable=r.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.destroyed=true;r.connected=false;r._pcReady=false;r._channelReady=false;r._chunk=null;r._cb=null;clearInterval(r._interval);clearTimeout(r._reconnectTimeout);if(r._pc){try{r._pc.close()}catch(e){}r._pc.oniceconnectionstatechange=null;r._pc.onsignalingstatechange=null;r._pc.onicecandidate=null}if(r._channel){try{r._channel.close()}catch(e){}r._channel.onmessage=null;r._channel.onopen=null;r._channel.onclose=null}r._pc=null;r._channel=null;if(e)r.emit("error",e);r.emit("close")};c.prototype._setupData=function(e){var t=this;t._channel=e.channel;t.channelName=t._channel.label;t._channel.binaryType="arraybuffer";t._channel.onmessage=t._onChannelMessage.bind(t);t._channel.onopen=t._onChannelOpen.bind(t);t._channel.onclose=t._onChannelClose.bind(t)};c.prototype._read=function(){};c.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after peer is destroyed"));if(i.connected){try{i.send(e)}catch(n){return i._onError(n)}if(i._channel.bufferedAmount>i._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remoteFamily="IPv4";e.remotePort=Number(t.portNumber);e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=u(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:66,debug:195,"get-browser-rtc":198,hat:199,inherits:200,"is-typedarray":201,once:203,stream:94,"typedarray-to-buffer":204}],195:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{"./debug":196,dup:138}],196:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:197}],197:[function(e,t,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],198:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],199:[function(e,t,r){arguments[4][146][0].apply(r,arguments)},{dup:146}],200:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],201:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],202:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],203:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37,wrappy:202}],204:[function(e,t,r){arguments[4][120][0].apply(r,arguments)},{buffer:66,dup:120,"is-typedarray":205}],205:[function(e,t,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],206:[function(e,t,r){(function(r){t.exports=u;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var l=typeof window!=="undefined"?window.WebSocket:f;n(u,s.Duplex);function u(e,t){var r=this;if(!(r instanceof u))return new u(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new l(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}u.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};u.prototype.destroy=function(e){var t=this;t._destroy(null,e)};u.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){try{r._ws.close()}catch(e){}r._ws.onopen=null;r._ws.onmessage=null;r._ws.onclose=null;r._ws.onerror=null}r._ws=null;if(e)r.emit("error",e);r.emit("close")};u.prototype._read=function(){};u.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};u.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};u.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){
+return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};u.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};u.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:66,debug:207,inherits:210,"is-typedarray":211,stream:94,"typedarray-to-buffer":212,ws:52}],207:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{"./debug":208,dup:138}],208:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:209}],209:[function(e,t,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],210:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],211:[function(e,t,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],212:[function(e,t,r){arguments[4][120][0].apply(r,arguments)},{buffer:66,dup:120,"is-typedarray":213}],213:[function(e,t,r){arguments[4][201][0].apply(r,arguments)},{dup:201}],214:[function(e,t,r){t.exports=i;function i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r){if(r.hasOwnProperty(i)){e[i]=r[i]}}}return e}},{}],215:[function(e,t,r){arguments[4][138][0].apply(r,arguments)},{"./debug":216,dup:138}],216:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23,ms:217}],217:[function(e,t,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],218:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],219:[function(e,t,r){arguments[4][174][0].apply(r,arguments)},{dup:174,events:70}],220:[function(e,t,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],221:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],222:[function(e,t,r){(function(r){var i=e("bencode");var n=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var l=1e3;var u=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new n(0,{grow:l});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/u);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*u;var r=t+u;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>u){return}t.copy(this.metadata,e*u);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e<this._numPieces;e++){this._request(e)}};t.prototype._checkDone=function(){var e=true;for(var t=0;t<this._numPieces;t++){if(!this._bitfield.get(t)){e=false;break}}if(!e)return;var r=this.setMetadata(this.metadata);if(!r){this._failedMetadata()}};t.prototype._failedMetadata=function(){this._bitfield=new n(0,{grow:l});this._remainingRejects-=this._numPieces;if(this._remainingRejects>0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:223,bitfield:227,buffer:66,events:70,inherits:228,"simple-sha1":229}],223:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./lib/decode":224,"./lib/encode":226,dup:17}],224:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{"./dict":225,buffer:66,dup:18}],225:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],226:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{buffer:66,dup:20}],227:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{buffer:66,dup:10}],228:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],229:[function(e,t,r){arguments[4][136][0].apply(r,arguments)},{dup:136,rusha:230}],230:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{dup:137}],231:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeInt32(e[r],t)}}};i.prototype.writeInt16Array=function(e,t){this._realloc(e.length*2);if(e instanceof Int16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt16Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeInt16(e[r],t)}}};i.prototype.writeInt8Array=function(e){this._realloc(e.length*1);if(e instanceof Int8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt8Array(e.length)}else{for(var t=0;t<e.length;t++){this.writeInt8(e[t])}}};i.prototype.writeUint32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Uint32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapUint32Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeUint32(e[r],t)}}};i.prototype.writeUint16Array=function(e,t){this._realloc(e.length*2);if(e instanceof Uint16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapUint16Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeUint16(e[r],t)}}};i.prototype.writeUint8Array=function(e){this._realloc(e.length*1);if(e instanceof Uint8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapUint8Array(e.length)}else{for(var t=0;t<e.length;t++){this.writeUint8(e[t])}}};i.prototype.writeFloat64Array=function(e,t){this._realloc(e.length*8);if(e instanceof Float64Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapFloat64Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeFloat64(e[r],t)}}};i.prototype.writeFloat32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Float32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapFloat32Array(e.length,t)}else{for(var r=0;r<e.length;r++){this.writeFloat32(e[r],t)}}};i.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,e==null?this.endianness:e);this.position+=4;return t};i.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,e==null?this.endianness:e);this.position+=2;return t};i.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);this.position+=1;return e};i.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,e==null?this.endianness:e);this.position+=4;return t};i.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,e==null?this.endianness:e);this.position+=2;return t};i.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);this.position+=1;return e};i.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,e==null?this.endianness:e);this.position+=4;return t};i.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,e==null?this.endianness:e);this.position+=8;return t};i.prototype.writeInt32=function(e,t){this._realloc(4);this._dataView.setInt32(this.position,e,t==null?this.endianness:t);this.position+=4};i.prototype.writeInt16=function(e,t){this._realloc(2);this._dataView.setInt16(this.position,e,t==null?this.endianness:t);this.position+=2};i.prototype.writeInt8=function(e){this._realloc(1);this._dataView.setInt8(this.position,e);this.position+=1};i.prototype.writeUint32=function(e,t){this._realloc(4);this._dataView.setUint32(this.position,e,t==null?this.endianness:t);this.position+=4};i.prototype.writeUint16=function(e,t){this._realloc(2);this._dataView.setUint16(this.position,e,t==null?this.endianness:t);this.position+=2};i.prototype.writeUint8=function(e){this._realloc(1);this._dataView.setUint8(this.position,e);this.position+=1};i.prototype.writeFloat32=function(e,t){this._realloc(4);this._dataView.setFloat32(this.position,e,t==null?this.endianness:t);this.position+=4};i.prototype.writeFloat64=function(e,t){this._realloc(8);this._dataView.setFloat64(this.position,e,t==null?this.endianness:t);this.position+=8};i.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;r<e.byteLength;r+=e.BYTES_PER_ELEMENT){for(var i=r+e.BYTES_PER_ELEMENT-1,n=r;i>n;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s<e.length;s+=2){r=e[s+1];i=this.readType(r,t);if(i==null){if(this.failurePosition===0){this.failurePosition=this.position}this.position=a;return null}t[e[s]]=i}return t};i.prototype.readUCS2String=function(e,t){return String.fromCharCode.apply(null,this.readUint16Array(e,t))};i.prototype.writeUCS2String=function(e,t,r){if(r==null){r=e.length}for(var i=0;i<e.length&&i<r;i++){this.writeUint16(e.charCodeAt(i),t)}for(;i<r;i++){this.writeUint16(0)}};i.prototype.readString=function(e,t){if(t==null||t=="ASCII"){return String.fromCharCode.apply(null,this.mapUint8Array(e==null?this.byteLength-this.position:e))}else{return new TextDecoder(t).decode(this.mapUint8Array(e))}};i.prototype.writeString=function(e,t,r){var i=0;if(t==null||t=="ASCII"){if(r!=null){var n=Math.min(e.length,r);for(i=0;i<n;i++){this.writeUint8(e.charCodeAt(i))}for(;i<r;i++){this.writeUint8(0)}}else{for(i=0;i<e.length;i++){this.writeUint8(e.charCodeAt(i))}}}else{this.writeUint8Array(new TextEncoder(t).encode(e.substring(0,r)))}};i.prototype.readCString=function(e){var t=this.byteLength-this.position;var r=new Uint8Array(this._buffer,this._byteOffset+this.position);var i=t;if(e!=null){i=Math.min(e,t)}for(var n=0;n<i&&r[n]!==0;n++);var a=String.fromCharCode.apply(null,this.mapUint8Array(n));if(e!=null){this.position+=i-n}else if(n!=t){this.position+=1}return a};i.prototype.writeCString=function(e,t){var r=0;if(t!=null){var i=Math.min(e.length,t);for(r=0;r<i;r++){this.writeUint8(e.charCodeAt(r))}for(;r<t;r++){this.writeUint8(0)}}else{for(r=0;r<e.length;r++){this.writeUint8(e.charCodeAt(r))}this.writeUint8(0)}};i.prototype.readType=function(e,t){if(typeof e=="function"){return e(this,t)}else if(typeof e=="object"&&!(e instanceof Array)){return e.get(this,t)}else if(e instanceof Array&&e.length!=3){return this.readStruct(e,t)}var r=null;var n=null;var a="ASCII";var s=this.position;var o;var f;var l;if(typeof e=="string"&&/:/.test(e)){o=e.split(":");e=o[0];n=parseInt(o[1])}if(typeof e=="string"&&/,/.test(e)){o=e.split(",");e=o[0];a=parseInt(o[1])}switch(e){case"uint8":r=this.readUint8();break;case"int8":r=this.readInt8();break;case"uint16":r=this.readUint16(this.endianness);break;case"int16":r=this.readInt16(this.endianness);break;case"uint32":r=this.readUint32(this.endianness);break;case"int32":r=this.readInt32(this.endianness);break;case"float32":r=this.readFloat32(this.endianness);break;case"float64":r=this.readFloat64(this.endianness);break;case"uint16be":r=this.readUint16(i.BIG_ENDIAN);break;case"int16be":r=this.readInt16(i.BIG_ENDIAN);break;case"uint32be":r=this.readUint32(i.BIG_ENDIAN);break;case"int32be":r=this.readInt32(i.BIG_ENDIAN);break;case"float32be":r=this.readFloat32(i.BIG_ENDIAN);break;case"float64be":r=this.readFloat64(i.BIG_ENDIAN);break;case"uint16le":r=this.readUint16(i.LITTLE_ENDIAN);break;case"int16le":r=this.readInt16(i.LITTLE_ENDIAN);break;case"uint32le":r=this.readUint32(i.LITTLE_ENDIAN);break;case"int32le":r=this.readInt32(i.LITTLE_ENDIAN);break;case"float32le":r=this.readFloat32(i.LITTLE_ENDIAN);break;case"float64le":r=this.readFloat64(i.LITTLE_ENDIAN);break;case"cstring":r=this.readCString(n);break;case"string":r=this.readString(n,a);break;case"u16string":r=this.readUCS2String(n,this.endianness);break;case"u16stringle":r=this.readUCS2String(n,i.LITTLE_ENDIAN);break;case"u16stringbe":r=this.readUCS2String(n,i.BIG_ENDIAN);break;default:if(e.length==3){var u=e[1];var c=e[2];var p=0;if(typeof c=="function"){p=c(t,this,e)}else if(typeof c=="string"&&t[c]!=null){p=parseInt(t[c])}else{p=parseInt(c)}if(typeof u=="string"){var d=u.replace(/(le|be)$/,"");var h=null;if(/le$/.test(u)){h=i.LITTLE_ENDIAN}else if(/be$/.test(u)){h=i.BIG_ENDIAN}if(c=="*"){p=null}switch(d){case"uint8":r=this.readUint8Array(p);break;case"uint16":r=this.readUint16Array(p,h);break;case"uint32":r=this.readUint32Array(p,h);break;case"int8":r=this.readInt8Array(p);break;case"int16":r=this.readInt16Array(p,h);break;case"int32":r=this.readInt32Array(p,h);break;case"float32":r=this.readFloat32Array(p,h);break;case"float64":r=this.readFloat64Array(p,h);break;case"cstring":case"utf16string":case"string":if(p==null){r=[];while(!this.isEof()){l=this.readType(u,t);if(l==null)break;r.push(l)}}else{r=new Array(p);for(f=0;f<p;f++){r[f]=this.readType(u,t)}}break}}else{if(c=="*"){r=[];var m=this.buffer;while(true){var v=this.position;try{var g=this.readType(u,t);if(g==null){this.position=v;break}r.push(g)}catch(_){this.position=v;break}}}else{r=new Array(p);for(f=0;f<p;f++){l=this.readType(u,t);if(l==null)return null;r[f]=l}}}break}}if(n!=null){this.position=s+n}return r};i.prototype.writeStruct=function(e,t){for(var r=0;r<e.length;r+=2){var i=e[r+1];this.writeType(i,t[e[r]],t)}};i.prototype.writeType=function(e,t,r){var n;if(typeof e=="function"){return e(this,t)}else if(typeof e=="object"&&!(e instanceof Array)){return e.set(this,t,r)}var a=null;var s="ASCII";var o=this.position;if(typeof e=="string"&&/:/.test(e)){n=e.split(":");e=n[0];a=parseInt(n[1])}if(typeof e=="string"&&/,/.test(e)){n=e.split(",");e=n[0];s=parseInt(n[1])}switch(e){case"uint8":this.writeUint8(t);break;case"int8":this.writeInt8(t);break;case"uint16":this.writeUint16(t,this.endianness);break;case"int16":this.writeInt16(t,this.endianness);break;case"uint32":this.writeUint32(t,this.endianness);break;case"int32":this.writeInt32(t,this.endianness);break;case"float32":this.writeFloat32(t,this.endianness);break;case"float64":this.writeFloat64(t,this.endianness);break;case"uint16be":this.writeUint16(t,i.BIG_ENDIAN);break;case"int16be":this.writeInt16(t,i.BIG_ENDIAN);break;case"uint32be":this.writeUint32(t,i.BIG_ENDIAN);break;case"int32be":this.writeInt32(t,i.BIG_ENDIAN);break;case"float32be":this.writeFloat32(t,i.BIG_ENDIAN);break;case"float64be":this.writeFloat64(t,i.BIG_ENDIAN);break;case"uint16le":this.writeUint16(t,i.LITTLE_ENDIAN);break;case"int16le":this.writeInt16(t,i.LITTLE_ENDIAN);break;case"uint32le":this.writeUint32(t,i.LITTLE_ENDIAN);break;case"int32le":this.writeInt32(t,i.LITTLE_ENDIAN);break;case"float32le":this.writeFloat32(t,i.LITTLE_ENDIAN);break;case"float64le":this.writeFloat64(t,i.LITTLE_ENDIAN);break;case"cstring":this.writeCString(t,a);break;case"string":this.writeString(t,s,a);break;case"u16string":this.writeUCS2String(t,this.endianness,a);break;case"u16stringle":this.writeUCS2String(t,i.LITTLE_ENDIAN,a);break;case"u16stringbe":this.writeUCS2String(t,i.BIG_ENDIAN,a);break;default:if(e.length==3){var f=e[1];for(var l=0;l<t.length;l++){this.writeType(f,t[l])}break}else{this.writeStruct(e,t);break}}if(a!=null){this.position=o;this._realloc(a);this.position=o+a}};var n=Math.pow(2,32);r.MAX_SIZE=n;i.prototype.readUint64=function(){return this.readUint32()*n+this.readUint32()};i.prototype.writeUint64=function(e){var t=Math.floor(e/n);this.writeUint32(t);this.writeUint32(e&4294967295)};i.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()};i.prototype.writeUint24=function(e){this.writeUint8((e&16711680)>>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],232:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;e<r;e++){o[o.boxCodes[e]+"Box"]=function(e){return function(t){o.Box.call(this,o.boxCodes[e],t)}}(e);o[o.boxCodes[e]+"Box"].prototype=new o.Box}r=o.fullBoxCodes.length;for(e=0;e<r;e++){o[o.fullBoxCodes[e]+"Box"]=function(e){return function(t){o.FullBox.call(this,o.fullBoxCodes[e],t)}}(e);o[o.fullBoxCodes[e]+"Box"].prototype=new o.FullBox}r=o.containerBoxCodes.length;for(e=0;e<r;e++){o[o.containerBoxCodes[e][0]+"Box"]=function(e,t){return function(r){o.ContainerBox.call(this,o.containerBoxCodes[e][0],r);if(t){this.subBoxNames=t;var i=t.length;for(var n=0;n<i;n++){this[t[n]+"s"]=[]}}}}(e,o.containerBoxCodes[e][1]);o[o.containerBoxCodes[e][0]+"Box"].prototype=new o.ContainerBox}r=o.sampleEntryCodes.length;for(t=0;t<r;t++){var i=o.sampleEntryCodes[t].prefix;var n=o.sampleEntryCodes[t].types;var a=n.length;o[i+"SampleEntry"]=function(e,t){o.SampleEntry.call(this,e,t)};o[i+"SampleEntry"].prototype=new o.SampleEntry;for(e=0;e<a;e++){o[n[e]+"Box"]=function(e,t){return function(r){o[o.sampleEntryCodes[e].prefix+"SampleEntry"].call(this,o.sampleEntryCodes[e].types[t],r)}}(t,e);o[n[e]+"Box"].prototype=new o[i+"SampleEntry"]}}r=o.trackReferenceTypes.length;for(e=0;e<r;e++){o[o.trackReferenceTypes[e]+"Box"]=function(e){return function(t){o.TrackReferenceTypeBox.call(this,o.trackReferenceTypes[e],t)}}(e);o[o.trackReferenceTypes[e]+"Box"].prototype=new o.Box}},Box:function(e,t){this.type=e;this.size=t},FullBox:function(e,t){o.Box.call(this,e,t);this.flags=0;this.version=0},ContainerBox:function(e,t){o.Box.call(this,e,t);this.boxes=[]},SampleEntry:function(e,t){o.Box.call(this,e,t);this.boxes=[]},TrackReferenceTypeBox:function(e,t){o.Box.call(this,e,t);this.track_ids=[]},stsdBox:function(e){o.FullBox.call(this,"stsd",e);this.entries=[]},parseOneBox:function(e,t){var r;var i=e.position;var n=0;if(e.byteLength-e.position<8){s.d("BoxParser","Not enough data in stream to parse the type and size of the box");return{code:o.ERR_NOT_ENOUGH_DATA}}var a=e.readUint32();var f=e.readString(4);s.d("BoxParser","Found box of type "+f+" and size "+a+" at position "+i+" in the current buffer ("+(e.buffer.fileStart+i)+" in the file)");n=8;if(a==1){if(e.byteLength-e.position<8){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the extended size of the "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA}}a=e.readUint64();n+=8}else if(a===0){throw"Unlimited box size not supported"}if(i+a>e.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position<i+this.size){t=o.parseOneBox(e);r=t.box;this.boxes.push(r);if(this.subBoxNames&&this.subBoxNames.indexOf(r.type)!=-1){this[this.subBoxNames+"s"].push(r)}else{this[r.type]=r}}};o.SampleEntry.prototype.isVideo=function(){return false};o.SampleEntry.prototype.isAudio=function(){return false};o.SampleEntry.prototype.isSubtitle=function(){return false};o.SampleEntry.prototype.isMetadata=function(){return false};o.SampleEntry.prototype.isHint=function(){return false};o.SampleEntry.prototype.getCodec=function(){return this.type};o.SampleEntry.prototype.getWidth=function(){return""};o.SampleEntry.prototype.getHeight=function(){return""};o.SampleEntry.prototype.getChannelCount=function(){return""};o.SampleEntry.prototype.getSampleRate=function(){return""};o.SampleEntry.prototype.getSampleSize=function(){return""};o.SampleEntry.prototype.parseHeader=function(e){this.start=e.position;e.readUint8Array(6);this.data_reference_index=e.readUint16()};o.SampleEntry.prototype.parse=function(e){this.parseHeader(e);e.seek(this.start+this.size)};o.SampleEntry.prototype.parseFooter=function(e){var t;var r;while(e.position<this.start+this.size){t=o.parseOneBox(e,false);r=t.box;this.boxes.push(r);this[r.type]=r}};o.VisualSampleEntry.prototype.parse=function(e){this.parseHeader(e);e.readUint16();e.readUint16();e.readUint32Array(3);this.width=e.readUint16();this.height=e.readUint16();this.horizresolution=e.readUint32();this.vertresolution=e.readUint32();e.readUint32();this.frame_count=e.readUint16();this.compressorname=e.readString(32);this.depth=e.readUint16();e.readUint16();this.parseFooter(e)};o.VisualSampleEntry.prototype.isVideo=function(){return true};o.VisualSampleEntry.prototype.getWidth=function(){return this.width};o.VisualSampleEntry.prototype.getHeight=function(){return this.height};o.AudioSampleEntry.prototype.parse=function(e){this.parseHeader(e);e.readUint32Array(2);this.channel_count=e.readUint16();this.samplesize=e.readUint16();e.readUint16();e.readUint16();this.samplerate=e.readUint32()/(1<<16);this.parseFooter(e)};o.AudioSampleEntry.prototype.isAudio=function(){return true};o.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count};o.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate};o.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize};o.SubtitleSampleEntry.prototype.parse=function(e){this.parseHeader(e);this.parseFooter(e)};o.SubtitleSampleEntry.prototype.isSubtitle=function(){return true};o.MetadataSampleEntry.prototype.parse=function(e){this.parseHeader(e);this.parseFooter(e)};o.MetadataSampleEntry.prototype.isMetadata=function(){
+return true};o.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint8Array(this.size)};o.metxBox.prototype.parse=function(e){this.parseHeader(e);this.content_encoding=e.readCString();this.namespace=e.readCString();this.schema_location=e.readCString();this.parseFooter(e)};o.mettBox.prototype.parse=function(e){this.parseHeader(e);this.content_encoding=e.readCString();this.mime_format=e.readCString();this.parseFooter(e)};o.sbttBox.prototype.parse=function(e){this.parseHeader(e);this.content_encoding=e.readCString();this.mime_format=e.readCString();this.parseFooter(e)};o.stxtBox.prototype.parse=function(e){this.parseHeader(e);this.content_encoding=e.readCString();this.mime_format=e.readCString();this.parseFooter(e)};o.stppBox.prototype.parse=function(e){this.parseHeader(e);this.namespace=e.readCString();this.schema_location=e.readCString();this.auxiliary_mime_types=e.readCString();this.parseFooter(e)};o.tx3gBox.prototype.parse=function(e){this.parseHeader(e);this.displayFlags=e.readUint32();this.horizontal_justification=e.readInt8();this.vertical_justification=e.readInt8();this.bg_color_rgba=e.readUint8Array(4);this.box_record=e.readInt16Array(4);this.style_record=e.readUint8Array(12);this.parseFooter(e)};o.ftypBox.prototype.parse=function(e){this.major_brand=e.readString(4);this.minor_version=e.readUint32();this.size-=8;this.compatible_brands=[];var t=0;while(this.size>=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t<r;t++){i=e.readUint16();this.SPS[t]=e.readUint8Array(i);this.size-=2+i}r=e.readUint8();this.size--;this.PPS=new Array(r);for(t=0;t<r;t++){i=e.readUint16();this.PPS[t]=e.readUint8Array(i);this.size-=2+i}if(this.size>0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t<numOfArrays;t++){var a=[];this.nalu_arrays.push(a);n=e.readUint8();a.completeness=(n&128)>>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j<numNalus;j++){var s={};a.push(s);i=e.readUint16();s.data=e.readUint8Array(i)}}};function f(e,t){var r=Number(e).toString(16);t=typeof t==="undefined"||t===null?t=2:t;while(r.length<t){r="0"+r}return r}o.avc1Box.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.avcC){return e+"."+f(this.avcC.AVCProfileIndication)+""+f(this.avcC.profile_compatibility)+""+f(this.avcC.AVCLevelIndication)}else{return e}};o.hvc1Box.prototype.getCodec=function(){var e;var t=o.SampleEntry.prototype.getCodec.call(this);if(this.hvcC){t+=".";switch(this.hvcC.general_profile_space){case 0:t+="";break;case 1:t+="A";break;case 2:t+="B";break;case 3:t+="C";break}t+=this.hvcC.general_profile_idc;t+=".";var r=this.hvcC.general_profile_compatibility;var i=0;for(e=0;e<32;e++){i|=r&1;if(e==31)break;i<<=1;r>>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;r<t;r++){this.sample_counts.push(e.readUint32());this.sample_offsets.push(e.readInt32())}}else if(this.version==1){for(r=0;r<t;r++){this.sample_counts.push(e.readUint32());this.sample_offsets.push(e.readInt32())}}else{this.data=e.readUint8Array(this.size-4)}};o.cttsBox.prototype.unpack=function(e){var t,r,i;i=0;for(t=0;t<this.sample_counts.length;t++){for(r=0;r<this.sample_counts[t];r++){e[i].pts=e[i].dts+this.sample_offsets[t];i++}}};o.cslgBox.prototype.parse=function(e){var t;this.parseFullHeader(e);if(this.version===0){this.compositionToDTSShift=e.readInt32();this.leastDecodeToDisplayDelta=e.readInt32();this.greatestDecodeToDisplayDelta=e.readInt32();this.compositionStartTime=e.readInt32();this.compositionEndTime=e.readInt32()}else{this.data=e.readUint8Array(this.size-4)}};o.sttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_deltas=[];if(this.version===0){for(r=0;r<t;r++){this.sample_counts.push(e.readUint32());this.sample_deltas.push(e.readUint32())}}else{this.data=e.readUint8Array(this.size-4)}};o.sttsBox.prototype.unpack=function(e){var t,r,i;i=0;for(t=0;t<this.sample_counts.length;t++){for(r=0;r<this.sample_counts[t];r++){if(i===0){e[i].dts=0}else{e[i].dts=e[i-1].dts+this.sample_deltas[t]}i++}}};o.stssBox.prototype.parse=function(e){var t;this.parseFullHeader(e);t=e.readUint32();if(this.version===0){this.sample_numbers=e.readUint32Array(t)}else{this.data=e.readUint8Array(this.size-4)}};o.stshBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.shadowed_sample_numbers=[];this.sync_sample_numbers=[];if(this.version===0){for(r=0;r<t;r++){this.shadowed_sample_numbers.push(e.readUint32());this.sync_sample_numbers.push(e.readUint32())}}else{this.data=e.readUint8Array(this.size-4)}};o.stcoBox.prototype.parse=function(e){var t;this.parseFullHeader(e);t=e.readUint32();if(this.version===0){this.chunk_offsets=e.readUint32Array(t)}else{this.data=e.readUint8Array(this.size-4)}};o.stcoBox.prototype.unpack=function(e){var t;for(t=0;t<this.chunk_offsets.length;t++){e[t].offset=this.chunk_offsets[t]}};o.co64Box.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.chunk_offsets=[];if(this.version===0){for(r=0;r<t;r++){this.chunk_offsets.push(e.readUint64())}}else{this.data=e.readUint8Array(this.size-4)}};o.stscBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.first_chunk=[];this.samples_per_chunk=[];this.sample_description_index=[];if(this.version===0){for(r=0;r<t;r++){this.first_chunk.push(e.readUint32());this.samples_per_chunk.push(e.readUint32());this.sample_description_index.push(e.readUint32())}}else{this.data=e.readUint8Array(this.size-4)}};o.stscBox.prototype.unpack=function(e){var t,r,i,n,a;n=0;a=0;for(t=0;t<this.first_chunk.length;t++){for(r=0;r<(t+1<this.first_chunk.length?this.first_chunk[t+1]:Infinity);r++){a++;for(i=0;i<this.samples_per_chunk[t];i++){if(e[n]){e[n].description_index=this.sample_description_index[t];e[n].chunk_index=a}else{return}n++}}}};o.stszBox.prototype.parse=function(e){var t;var r;var i;this.parseFullHeader(e);this.sample_sizes=[];if(this.version===0){r=e.readUint32();i=e.readUint32();if(r===0){this.sample_sizes=e.readUint32Array(i)}else{this.sample_sizes=[];for(t=0;t<i;t++){this.sample_sizes[t]=r}}}else{this.data=e.readUint8Array(this.size)}};o.stszBox.prototype.unpack=function(e){var t;for(t=0;t<this.sample_sizes.length;t++){e[t].size=this.sample_sizes[t]}};o.mehdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.fragment_duration=e.readUint64()}else{this.fragment_duration=e.readUint32()}};o.trexBox.prototype.parse=function(e){this.parseFullHeader(e);this.track_id=e.readUint32();this.default_sample_description_index=e.readUint32();this.default_sample_duration=e.readUint32();this.default_sample_size=e.readUint32();this.default_sample_flags=e.readUint32()};o.mfhdBox.prototype.parse=function(e){this.parseFullHeader(e);this.sequence_number=e.readUint32()};o.TFHD_FLAG_BASE_DATA_OFFSET=1;o.TFHD_FLAG_SAMPLE_DESC=2;o.TFHD_FLAG_SAMPLE_DUR=8;o.TFHD_FLAG_SAMPLE_SIZE=16;o.TFHD_FLAG_SAMPLE_FLAGS=32;o.TFHD_FLAG_DUR_EMPTY=65536;o.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072;o.tfhdBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.track_id=e.readUint32();if(this.size>t&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r<this.sample_count;r++){if(this.flags&o.TRUN_FLAGS_DURATION){this.sample_duration[r]=e.readUint32()}if(this.flags&o.TRUN_FLAGS_SIZE){this.sample_size[r]=e.readUint32()}if(this.flags&o.TRUN_FLAGS_FLAGS){this.sample_flags[r]=e.readUint32()}if(this.flags&o.TRUN_FLAGS_CTS_OFFSET){if(this.version===0){this.sample_composition_time_offset[r]=e.readUint32()}else{this.sample_composition_time_offset[r]=e.readInt32()}}}}};o.tfdtBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.baseMediaDecodeTime=e.readUint64()}else{this.baseMediaDecodeTime=e.readUint32()}};o.paylBox.prototype.parse=function(e){this.text=e.readString(this.size)};o.subsBox.prototype.parse=function(e){var t,r;var i;var n;this.parseFullHeader(e);i=e.readUint32();this.samples=[];for(t=0;t<i;t++){var a={};this.samples[t]=a;a.sample_delta=e.readUint32();a.subsamples=[];n=e.readUint16();if(n>0){for(r=0;r<n;r++){var s={};a.subsamples.push(s);if(this.version==1){s.size=e.readUint32()}else{s.size=e.readUint16()}s.priority=e.readUint8();s.discardable=e.readUint8();s.reserved=e.readUint32()}}}};o.Box.prototype.writeHeader=function(e,t){this.size+=8;if(this.size>n.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t<this.boxes.length;t++){if(this.boxes[t]){this.boxes[t].write(e);this.size+=this.boxes[t].size}}s.d("BoxWriter","Adjusting box "+this.type+" with new size "+this.size);e.adjustUint32(this.sizePosition,this.size)};o.TrackReferenceTypeBox.prototype.write=function(e){this.size=this.track_ids.length*4;this.writeHeader(e);e.writeUint32Array(this.track_ids)};o.ftypBox.prototype.write=function(e){this.size=8+4*this.compatible_brands.length;this.writeHeader(e);e.writeString(this.major_brand,null,4);e.writeUint32(this.minor_version);for(var t=0;t<this.compatible_brands.length;t++){e.writeString(this.compatible_brands[t],null,4)}};o.mvhdBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=23*4+2*2;this.writeHeader(e);e.writeUint32(this.creation_time);e.writeUint32(this.modification_time);e.writeUint32(this.timescale);e.writeUint32(this.duration);e.writeUint32(this.rate);e.writeUint16(this.volume<<8);e.writeUint16(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32Array(this.matrix);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32(this.next_track_id)};o.tkhdBox.prototype.write=function(e){this.version=0;this.size=4*18+2*4;this.writeHeader(e);e.writeUint32(this.creation_time);e.writeUint32(this.modification_time);e.writeUint32(this.track_id);e.writeUint32(0);e.writeUint32(this.duration);e.writeUint32(0);e.writeUint32(0);e.writeInt16(this.layer);e.writeInt16(this.alternate_group);e.writeInt16(this.volume<<8);e.writeUint16(0);e.writeInt32Array(this.matrix);e.writeUint32(this.width);e.writeUint32(this.height)};o.mdhdBox.prototype.write=function(e){this.size=4*4+2*2;this.flags=0;this.version=0;this.writeHeader(e);e.writeUint32(this.creation_time);e.writeUint32(this.modification_time);e.writeUint32(this.timescale);e.writeUint32(this.duration);e.writeUint16(this.language);e.writeUint16(0)};o.hdlrBox.prototype.write=function(e){this.size=5*4+this.name.length+1;this.version=0;this.flags=0;this.writeHeader(e);e.writeUint32(0);e.writeString(this.handler,null,4);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeCString(this.name)};o.stsdBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=0;this.writeHeader(e);e.writeUint32(this.entries.length);this.size+=4;for(t=0;t<this.entries.length;t++){this.entries[t].write(e);this.size+=this.entries[t].size}s.d("BoxWriter","Adjusting box "+this.type+" with new size "+this.size);e.adjustUint32(this.sizePosition,this.size)};o.SampleEntry.prototype.writeHeader=function(e){this.size=8;o.Box.prototype.writeHeader.call(this,e);e.writeUint8(0);e.writeUint8(0);e.writeUint8(0);e.writeUint8(0);e.writeUint8(0);e.writeUint8(0);e.writeUint16(this.data_reference_index)};o.SampleEntry.prototype.writeFooter=function(e){for(var t=0;t<this.boxes.length;t++){this.boxes[t].write(e);this.size+=this.boxes[t].size}s.d("BoxWriter","Adjusting box "+this.type+" with new size "+this.size);e.adjustUint32(this.sizePosition,this.size)};o.SampleEntry.prototype.write=function(e){this.writeHeader(e);this.writeFooter(e)};o.VisualSampleEntry.prototype.write=function(e){this.writeHeader(e);this.size+=2*7+6*4+32;e.writeUint16(0);e.writeUint16(0);e.writeUint32(0);e.writeUint32(0);e.writeUint32(0);e.writeUint16(this.width-this.width%2);e.writeUint16(this.height-this.height%2);e.writeUint32(this.horizresolution);e.writeUint32(this.vertresolution);e.writeUint32(0);e.writeUint16(this.frame_count);e.writeString(this.compressorname,null,32);e.writeUint16(this.depth);e.writeInt16(-1);this.writeFooter(e)};o.AudioSampleEntry.prototype.write=function(e){this.writeHeader(e);this.size+=2*4+3*4;e.writeUint32(0);e.writeUint32(0);e.writeUint16(this.channel_count);e.writeUint16(this.samplesize);e.writeUint16(0);e.writeUint16(0);e.writeUint32(this.samplerate<<16);this.writeFooter(e)};o.avcCBox.prototype.write=function(e){var t;this.size=7;for(t=0;t<this.SPS.length;t++){this.size+=2+this.SPS[t].length}for(t=0;t<this.PPS.length;t++){this.size+=2+this.PPS[t].length}if(this.ext){this.size+=this.ext.length}this.writeHeader(e);e.writeUint8(this.configurationVersion);e.writeUint8(this.AVCProfileIndication);e.writeUint8(this.profile_compatibility);e.writeUint8(this.AVCLevelIndication);e.writeUint8(this.lengthSizeMinusOne+(63<<2));e.writeUint8(this.SPS.length+(7<<5));for(t=0;t<this.SPS.length;t++){e.writeUint16(this.SPS[t].length);e.writeUint8Array(this.SPS[t])}e.writeUint8(this.PPS.length);for(t=0;t<this.PPS.length;t++){e.writeUint16(this.PPS[t].length);e.writeUint8Array(this.PPS[t])}if(this.ext){e.writeUint8Array(this.ext)}};o.cttsBox.prototype.write=function(e){var t;this.version=1;this.flags=0;this.size=4+8*this.sample_counts.length;this.writeHeader(e);e.writeUint32(this.sample_counts.length);for(t=0;t<this.sample_counts.length;t++){e.writeUint32(this.sample_counts[t]);e.writeInt32(this.sample_offsets[t])}};o.cslgBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=4*5;this.writeHeader(e);e.writeInt32(this.compositionToDTSShift);e.writeInt32(this.leastDecodeToDisplayDelta);e.writeInt32(this.greatestDecodeToDisplayDelta);e.writeInt32(this.compositionStartTime);e.writeInt32(this.compositionEndTime)};o.sttsBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=4+8*this.sample_counts.length;this.writeHeader(e);e.writeUint32(this.sample_counts.length);for(t=0;t<this.sample_counts.length;t++){e.writeUint32(this.sample_counts[t]);e.writeUint32(this.sample_deltas[t])}};o.stssBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4+4*this.sample_numbers.length;this.writeHeader(e);e.writeUint32(this.sample_numbers.length);e.writeUint32Array(this.sample_numbers)};o.stshBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=4+8*this.shadowed_sample_numbers.length;this.writeHeader(e);e.writeUint32(this.shadowed_sample_numbers.length);for(t=0;t<this.shadowed_sample_numbers.length;t++){e.writeUint32(this.shadowed_sample_numbers[t]);e.writeUint32(this.sync_sample_numbers[t])}};o.stcoBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4+4*this.chunk_offsets.length;this.writeHeader(e);e.writeUint32(this.chunk_offsets.length);e.writeUint32Array(this.chunk_offsets)};o.co64Box.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=4+8*this.chunk_offsets.length;this.writeHeader(e);e.writeUint32(this.chunk_offsets.length);for(t=0;t<this.chunk_offsets.length;t++){e.writeUint64(this.chunk_offsets[t])}};o.stscBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=4+12*this.first_chunk.length;this.writeHeader(e);e.writeUint32(this.first_chunk.length);for(t=0;t<this.first_chunk.length;t++){e.writeUint32(this.first_chunk[t]);e.writeUint32(this.samples_per_chunk[t]);e.writeUint32(this.sample_description_index[t])}};o.stszBox.prototype.write=function(e){var t;this.version=0;this.flags=0;this.size=8+12*this.sample_sizes.length;this.writeHeader(e);e.writeUint32(0);e.writeUint32(this.sample_sizes.length);e.writeUint32Array(this.sample_sizes)};o.mehdBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4;this.writeHeader(e);e.writeUint32(this.fragment_duration)};o.trexBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4*5;this.writeHeader(e);e.writeUint32(this.track_id);e.writeUint32(this.default_sample_description_index);e.writeUint32(this.default_sample_duration);e.writeUint32(this.default_sample_size);e.writeUint32(this.default_sample_flags)};o.mfhdBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4;this.writeHeader(e);e.writeUint32(this.sequence_number)};o.tfhdBox.prototype.write=function(e){this.version=0;this.size=4;if(this.flags&o.TFHD_FLAG_BASE_OFFSET){this.size+=8}if(this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.size+=4}if(this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.size+=4}if(this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.size+=4}if(this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.size+=4}this.writeHeader(e);e.writeUint32(this.track_id);if(this.flags&o.TFHD_FLAG_BASE_OFFSET){e.writeUint64(this.base_data_offset)}if(this.flags&o.TFHD_FLAG_SAMPLE_DESC){e.writeUint32(this.default_sample_description_index)}if(this.flags&o.TFHD_FLAG_SAMPLE_DUR){e.writeUint32(this.default_sample_duration)}if(this.flags&o.TFHD_FLAG_SAMPLE_SIZE){e.writeUint32(this.default_sample_size)}if(this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){e.writeUint32(this.default_sample_flags)}};o.trunBox.prototype.write=function(e){this.version=0;this.size=4;if(this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.size+=4}if(this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.size+=4}if(this.flags&o.TRUN_FLAGS_DURATION){this.size+=4*this.sample_duration.length}if(this.flags&o.TRUN_FLAGS_SIZE){this.size+=4*this.sample_size.length}if(this.flags&o.TRUN_FLAGS_FLAGS){this.size+=4*this.sample_flags.length}if(this.flags&o.TRUN_FLAGS_CTS_OFFSET){this.size+=4*this.sample_composition_time_offset.length}this.writeHeader(e);e.writeUint32(this.sample_count);if(this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset_position=e.position;e.writeInt32(this.data_offset)}if(this.flags&o.TRUN_FLAGS_FIRST_FLAG){e.writeUint32(this.first_sample_flags)}for(var t=0;t<this.sample_count;t++){if(this.flags&o.TRUN_FLAGS_DURATION){e.writeUint32(this.sample_duration[t])}if(this.flags&o.TRUN_FLAGS_SIZE){e.writeUint32(this.sample_size[t])}if(this.flags&o.TRUN_FLAGS_FLAGS){e.writeUint32(this.sample_flags[t])}if(this.flags&o.TRUN_FLAGS_CTS_OFFSET){if(this.version===0){e.writeUint32(this.sample_composition_time_offset[t])}else{e.writeInt32(this.sample_composition_time_offset[t])}}}};o.tfdtBox.prototype.write=function(e){this.version=0;this.flags=0;this.size=4;this.writeHeader(e);if(this.version==1){e.writeUint64(this.baseMediaDecodeTime)}else{e.writeUint32(this.baseMediaDecodeTime)}}},{"./DataStream":231,"./descriptor":233,"./log":235}],233:[function(e,t,r){var i=e("./log");var n=function(){var e=3;var t=4;var r=5;var n=6;var a=[];a[e]="ES_Descriptor";a[t]="DecoderConfigDescriptor";a[r]="DecoderSpecificInfo";a[n]="SLConfigDescriptor";var s=this;var o={};this.parseOneDescriptor=function(e){var t=0;var r=0;var n;var s;var f;n=e.readUint8();t++;f=e.readUint8();t++;while(f&128){r=(f&127)<<7;f=e.readUint8();t++}r+=f&127;i.d("MPEG4DescriptorParser","Found "+(a[n]|"Descriptor "+n)+", size "+r+" at position "+e.position);if(a[n]){s=new o[a[n]](r)}else{s=new o.Descriptor(r)}s.parse(e);return s};o.Descriptor=function(e,t){this.tag=e;this.size=t;this.descs=[]};o.Descriptor.prototype.parse=function(e){this.data=e.readUint8Array(this.size)};o.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++){if(this.descs[t].tag==e){return this.descs[t]}}return null};o.Descriptor.prototype.parseRemainingDescriptors=function(e){var t=e.position;while(e.position<t+this.size){var r=s.parseOneDescriptor(e);this.descs.push(r)}};o.ES_Descriptor=function(t){o.Descriptor.call(this,e,t)};o.ES_Descriptor.prototype=new o.Descriptor;o.ES_Descriptor.prototype.parse=function(e){this.ES_ID=e.readUint16();this.flags=e.readUint8();this.size-=3;if(this.flags&128){this.dependsOn_ES_ID=e.readUint16();this.size-=2}else{this.dependsOn_ES_ID=0}if(this.flags&64){var t=e.readUint8();this.URL=e.readString(t);this.size-=t+1}else{this.URL=null}if(this.flags&32){this.OCR_ES_ID=e.readUint16();this.size-=2}else{this.OCR_ES_ID=0}this.parseRemainingDescriptors(e)};o.ES_Descriptor.prototype.getOTI=function(e){var r=this.findDescriptor(t);if(r){return r.oti}else{return 0}};o.ES_Descriptor.prototype.getAudioConfig=function(e){var i=this.findDescriptor(t);if(!i)return null;var n=i.findDescriptor(r);if(n&&n.data){return(n.data[0]&248)>>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":235}],234:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1<this.stream.nextBuffers.length){e=this.stream.nextBuffers[this.stream.bufferIndex+1];if(e.fileStart===this.stream.buffer.fileStart+this.stream.buffer.byteLength){var t=this.stream.buffer.byteLength;var r=this.stream.buffer.usedBytes;var i=this.stream.buffer.fileStart;this.stream.nextBuffers[this.stream.bufferIndex]=ArrayBuffer.concat(this.stream.buffer,e);this.stream.buffer=this.stream.nextBuffers[this.stream.bufferIndex];this.stream.nextBuffers.splice(this.stream.bufferIndex+1,1);this.stream.buffer.usedBytes=r;this.stream.buffer.fileStart=i;a.d("ISOFile","Concatenating buffer for box parsing (length: "+t+"->"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r<this.stream.nextBuffers.length){i=this.stream.nextBuffers[r];if(i.fileStart<=t){n=r}else{break}r++}if(n!==-1){i=this.stream.nextBuffers[n];if(i.fileStart+i.byteLength>=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t<this.stream.nextBuffers.length;t++){i=this.stream.nextBuffers[t];if(i.fileStart===r.fileStart+r.byteLength){r=i}else{break}}}return r.fileStart+r.byteLength};s.prototype.write=function(e){for(var t=0;t<this.boxes.length;t++){this.boxes[t].write(e)}};s.prototype.writeInitializationSegment=function(e){var t;var r;var n;var s;var o;a.d("ISOFile","Generating initialization segment");this.ftyp.write(e);if(this.moov.mvex){this.initial_duration=this.moov.mvex.mehd.fragment_duration;r=-1;for(t=0;t<this.moov.boxes.length;t++){o=this.moov.boxes[t];if(o===this.moov.mvex){r=t}}if(r>-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;
+this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t<this.moov.traks.length;t++){if(this.moov.traks[t].ignore)continue;s=new i.trexBox;this.moov.mvex.boxes.push(s);s.track_id=this.moov.traks[t].tkhd.track_id;s.default_sample_description_index=1;s.default_sample_duration=this.moov.traks[t].samples.length>0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;e<this.moov.traks.length;e++){t=this.moov.traks[e];t.tkhd.duration=0;t.mdia.mdhd.duration=0;r=t.mdia.minf.stbl.stco||t.mdia.minf.stbl.co64;r.chunk_offsets=[];i=t.mdia.minf.stbl.stsc;i.first_chunk=[];i.samples_per_chunk=[];i.sample_description_index=[];n=t.mdia.minf.stbl.stsz;n.sample_sizes=[];a=t.mdia.minf.stbl.stts;a.sample_counts=[];a.sample_deltas=[];s=t.mdia.minf.stbl.ctts;if(s){s.sample_counts=[];s.sample_offsets=[]}o=t.mdia.minf.stbl.stss;if(o){o.sample_numbers=new Uint32Array(0)}f=t.mdia.minf.stbl.sdtp;var l=t.mdia.minf.stbl.boxes.indexOf(f);if(l!=-1)t.mdia.minf.stbl.boxes[l]=null}};s.prototype.buildSampleLists=function(){var e,t,r;var i,n,a,s,o,f,l,u,c;var p,d,h,m,v;var g,_,y,b,w,x;this.originalMvex=this.moov.mvex;for(e=0;e<this.moov.traks.length;e++){i=this.moov.traks[e];i.samples=[];n=i.mdia.minf.stbl.stco||i.mdia.minf.stbl.co64;a=i.mdia.minf.stbl.stsc;s=i.mdia.minf.stbl.stsz;o=i.mdia.minf.stbl.stts;f=i.mdia.minf.stbl.ctts;l=i.mdia.minf.stbl.stss;u=i.mdia.minf.stbl.stsd;c=i.mdia.minf.stbl.subs;g=-1;_=-1;y=-1;b=-1;w=0;subs_entry_index=0;last_subs_sample_index=0;for(t=0;t<s.sample_sizes.length;t++){var k={};k.number=t;k.track_id=i.tkhd.track_id;k.timescale=i.mdia.mdhd.timescale;i.samples[t]=k;k.size=s.sample_sizes[t];if(t===0){d=1;p=0;k.chunk_index=d;k.chunk_run_index=p;v=a.samples_per_chunk[p];m=0;if(p+1<a.first_chunk.length){h=a.first_chunk[p+1]-1}else{h=Infinity}}else{if(t<v){k.chunk_index=d;k.chunk_run_index=p}else{d++;k.chunk_index=d;m=0;if(d<=h){}else{p++;if(p+1<a.first_chunk.length){h=a.first_chunk[p+1]-1}else{h=Infinity}}k.chunk_run_index=p;v+=a.samples_per_chunk[p]}}k.description=u.entries[a.sample_description_index[k.chunk_run_index]-1];k.offset=n.chunk_offsets[k.chunk_index-1]+m;m+=k.size;if(t>g){_++;if(g<0){g=0}g+=o.sample_counts[_]}if(t>0){i.samples[t-1].duration=o.sample_deltas[_];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>y){b++;y+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(l){if(t==l.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var l,u,c,p,d;var h;while(this.lastMoofIndex<this.moofs.length){l=this.moofs[this.lastMoofIndex];this.lastMoofIndex++;if(l.type=="moof"){u=l;for(e=0;e<u.trafs.length;e++){c=u.trafs[e];p=this.getTrackById(c.tfhd.track_id);d=this.getTrexById(c.tfhd.track_id);if(c.tfhd.flags&i.TFHD_FLAG_SAMPLE_DESC){n=c.tfhd.default_sample_description_index}else{n=d.default_sample_description_index}if(c.tfhd.flags&i.TFHD_FLAG_SAMPLE_DUR){a=c.tfhd.default_sample_duration}else{a=d.default_sample_duration}if(c.tfhd.flags&i.TFHD_FLAG_SAMPLE_SIZE){s=c.tfhd.default_sample_size}else{s=d.default_sample_size}if(c.tfhd.flags&i.TFHD_FLAG_SAMPLE_FLAGS){o=c.tfhd.default_sample_flags}else{o=d.default_sample_flags}for(t=0;t<c.truns.length;t++){var m=c.truns[t];for(r=0;r<m.sample_count;r++){h={};c.first_sample_index=p.samples.length;p.samples.push(h);h.track_id=p.tkhd.track_id;h.timescale=p.mdia.mdhd.timescale;h.description=p.mdia.minf.stbl.stsd.entries[n-1];h.size=s;if(m.flags&i.TRUN_FLAGS_SIZE){h.size=m.sample_size[r]}h.duration=a;if(m.flags&i.TRUN_FLAGS_DURATION){h.duration=m.sample_duration[r]}if(p.first_traf_merged||r>0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var _=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var y=0;if(!v){if(!g){if(t===0){y=u.fileStart}else{y=f}}else{y=u.fileStart}}else{y=c.tfhd.base_data_offset}if(t===0&&r===0){if(_){h.offset=y+m.data_offset}else{h.offset=y}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t<c.subs.samples.length;t++){b+=c.subs.samples[t].sample_delta;h=p.samples[b-1];h.subsamples=c.subs.samples[t].subsamples}}}}}};s.prototype.getCodecs=function(){var e;var t="";for(e=0;e<this.moov.traks.length;e++){var r=this.moov.traks[e];if(e>0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t<this.originalMvex.trexs.length;t++){var r=this.originalMvex.trexs[t];if(r.track_id==e)return r}return null};s.prototype.getTrackById=function(e){for(var t=0;t<this.moov.traks.length;t++){var r=this.moov.traks[t];if(r.tkhd.track_id==e)return r}return null};s.prototype.getSample=function(e,t){var r;var i;var s=e.samples[t];if(!this.moov){return null}if(!s.data){s.data=new Uint8Array(s.size);s.alreadyRead=0;this.samplesDataSize+=s.size;a.d("ISOFile","Allocating sample #"+t+" on track #"+e.tkhd.track_id+" of size "+s.size+" (total: "+this.samplesDataSize+")")}else if(s.alreadyRead==s.size){return s}for(i=0;i<this.stream.nextBuffers.length;i++){r=this.stream.nextBuffers[i];if(s.offset+s.alreadyRead>=r.fileStart&&s.offset+s.alreadyRead<r.fileStart+r.byteLength){var o=r.byteLength-(s.offset+s.alreadyRead-r.fileStart);if(s.size-s.alreadyRead<=o){a.d("ISOFile","Getting sample #"+t+" data (alreadyRead: "+s.alreadyRead+" offset: "+(s.offset+s.alreadyRead-r.fileStart)+" size: "+(s.size-s.alreadyRead)+")");n.memcpy(s.data.buffer,s.alreadyRead,r,s.offset+s.alreadyRead-r.fileStart,s.size-s.alreadyRead);s.alreadyRead=s.size;r.usedBytes+=s.size-s.alreadyRead;if(r.usedBytes===r.byteLength){this.stream.nextBuffers.splice(i,1);i--}return s}else{a.d("ISOFile","Getting sample data (alreadyRead: "+s.alreadyRead+" offset: "+(s.offset+s.alreadyRead-r.fileStart)+" size: "+o+")");n.memcpy(s.data.buffer,s.alreadyRead,r,s.offset+s.alreadyRead-r.fileStart,o);s.alreadyRead+=o;r.usedBytes+=o;if(r.usedBytes===r.byteLength){this.stream.nextBuffers.splice(i,1);i--}}}}return null};s.prototype.releaseSample=function(e,t){var r=e.samples[t];r.data=null;this.samplesDataSize-=r.size;return r.size}},{"./DataStream":231,"./box":232,"./log":235}],235:[function(e,t,r){var i=function(){var e=new Date;var t=4;var r=3;var n=2;var a=1;var s=t;var o={setLogLevel:function(e){if(e==this.d)s=a;else if(e==this.i)s=n;else if(e==this.w)s=r;else if(e==this.e)s=t;else s=t},d:function(t,r){if(a>=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length<t){i[0]="0"+i[0]}return i.join(".")}var i=t||1;var n=e/i;var a=Math.floor(n/3600);n-=a*3600;var s=Math.floor(n/60);n-=s*60;var o=n*1e3;n=Math.floor(n);o-=n*1e3;o=Math.floor(o);return""+a+":"+r(s,2)+":"+r(n,2)+"."+r(o,3)};i.printRanges=function(e){var t=e.length;if(t>0){var r="";for(var n=0;n<t;n++){if(n>0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],236:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r<this.fragmentedTracks.length;r++){var i=this.fragmentedTracks[r];if(i.id==e){t=r}}if(t>-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r<this.extractedTracks.length;r++){var i=this.extractedTracks[r];if(i.id==e){t=r}}if(t>-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var l=i||new a;l.endianness=a.BIG_ENDIAN;var u=this.createSingleSampleMoof(f);u.write(l);u.trun.data_offset=u.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+u.trun.data_offset);l.adjustUint32(u.trun.data_offset_position,u.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(l);return l};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;r<this.nextBuffers.length;r++){var i=this.nextBuffers[r];if(e.fileStart<=i.fileStart){if(e.fileStart===i.fileStart){if(e.byteLength>i.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart<i.fileStart+i.byteLength){var n=i.fileStart+i.byteLength-e.fileStart;var a=e.byteLength-n;if(a>0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e<this.fragmentedTracks.length;e++){var r=this.fragmentedTracks[e];t=r.trak;while(t.nextSample<t.samples.length){o.d("MP4Box","Creating media fragment on track #"+r.id+" for sample "+t.nextSample);var i=this.createFragment(this.inputIsoFile,r.id,t.nextSample,r.segmentStream);if(i){r.segmentStream=i;t.nextSample++}else{break}if(t.nextSample%r.nb_samples===0||t.nextSample>=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e<this.extractedTracks.length;e++){var n=this.extractedTracks[e];t=n.trak;while(t.nextSample<t.samples.length){o.d("MP4Box","Exporting on track #"+n.id+" sample #"+t.nextSample);var a=this.inputIsoFile.getSample(t,t.nextSample);if(a){t.nextSample++;n.samples.push(a)}else{return}if(t.nextSample%n.nb_samples===0||t.nextSample>=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;i<this.inputIsoFile.moov.traks.length;i++){t=this.inputIsoFile.moov.traks[i];n=t.mdia.minf.stbl.stsd.entries[0];r={};e.tracks.push(r);r.id=t.tkhd.track_id;r.references=[];if(t.tref){for(j=0;j<t.tref.boxes.length;j++){ref={};r.references.push(ref);ref.type=t.tref.boxes[j].type;ref.track_ids=t.tref.boxes[j].track_ids}}r.created=new Date(a+t.tkhd.creation_time*1e3);r.modified=new Date(a+t.tkhd.modification_time*1e3);r.movie_duration=t.tkhd.duration;r.layer=t.tkhd.layer;r.alternate_group=t.tkhd.alternate_group;r.volume=t.tkhd.volume;r.matrix=t.tkhd.matrix;r.track_width=t.tkhd.width/(1<<16);r.track_height=t.tkhd.height/(1<<16);r.timescale=t.mdia.mdhd.timescale;r.duration=t.mdia.mdhd.duration;r.codec=n.getCodec();r.language=t.mdia.mdhd.languageString;r.nb_samples=t.samples.length;r.size=0;for(j=0;j<r.nb_samples;j++){r.size+=t.samples[j].size}r.bitrate=r.size*8*r.timescale/r.duration;if(n.isAudio()){e.audioTracks.push(r);r.audio={};r.audio.sample_rate=n.getSampleRate();r.audio.channel_count=n.getChannelCount();r.audio.sample_size=n.getSampleSize()}else if(n.isVideo()){e.videoTracks.push(r);r.video={};r.video.width=n.getWidth();r.video.height=n.getHeight()}else if(n.isSubtitle()){e.subtitleTracks.push(r)}else if(n.isHint()){e.hintTracks.push(r)}else if(n.isMetadata()){e.metadataTracks.push(r)}else{e.otherTracks.push(r)}}return e};f.prototype.getInitializationSegment=function(){var e=new a;e.endianness=a.BIG_ENDIAN;this.inputIsoFile.writeInitializationSegment(e);return e.buffer};f.prototype.writeFile=function(){var e=new a;e.endianness=a.BIG_ENDIAN;this.inputIsoFile.write(e);return e.buffer};f.prototype.initializeSegmentation=function(){var e;var t;var r;var i;var n;if(this.onSegment===null){o.w("MP4Box","No segmentation callback set!")}if(!this.isFragmentationStarted){this.isFragmentationStarted=true;this.nextMoofNumber=0;this.inputIsoFile.resetTables()}i=[];for(e=0;e<this.fragmentedTracks.length;e++){for(t=0;t<this.inputIsoFile.moov.boxes.length;t++){r=this.inputIsoFile.moov.boxes[t];if(r&&r.type==="trak"){this.inputIsoFile.moov.boxes[t].ignore=true;this.inputIsoFile.moov.boxes[t]=null}}n=this.inputIsoFile.getTrackById(this.fragmentedTracks[e].id);delete n.ignore;for(t=0;t<this.inputIsoFile.moov.boxes.length;t++){r=this.inputIsoFile.moov.boxes[t];if(r==null){this.inputIsoFile.moov.boxes[t]=n;break}}seg={};seg.id=n.tkhd.track_id;seg.user=this.fragmentedTracks[e].user;seg.buffer=this.getInitializationSegment();i.push(seg)}return i};f.prototype.releaseUsedSamples=function(e,t){var r=0;var i=this.inputIsoFile.getTrackById(e);if(!i.lastValidSample)i.lastValidSample=0;for(var n=i.lastValidSample;n<t;n++){r+=this.inputIsoFile.releaseSample(i,n)}o.d("MP4Box","Track #"+e+" released samples up to "+t+" (total size: "+r+", remaining: "+this.inputIsoFile.samplesDataSize+")");i.lastValidSample=t};f.prototype.flush=function(){o.i("MP4Box","Flushing remaining samples");this.inputIsoFile.updateSampleLists();this.processSamples()};f.prototype.seekTrack=function(e,t,r){var i;var n;var a=Infinity;var s=0;var f=Infinity;var l=0;var u=0;var c;for(i=0;i<r.samples.length;i++){n=r.samples[i];if(i===0){f=n.offset;u=0;c=n.timescale}else if(n.cts>e*n.timescale){f=r.samples[i-1].offset;u=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;l=i}}if(t){r.nextSample=l;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=u;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;a<r.traks.length;a++){i=r.traks[a];n=this.seekTrack(e,t,i);if(n.offset<s.offset){s.offset=n.offset}if(n.time<s.time){s.time=n.time}}if(s.offset===Infinity){s={offset:this.inputIsoFile.nextParsePosition,time:0}}else{var f=this.inputIsoFile.findPosition(true,s.offset);if(f!==-1){s.offset=this.inputIsoFile.findEndContiguousBuf(f)}}o.i("MP4Box","Seeking at time "+o.getDurationString(s.time,1)+" needs a buffer with a fileStart position of "+s.offset);return s}}},{"./DataStream":231,"./box":232,"./isofile":234,"./log":235}],237:[function(e,t,r){var i=e("debug")();var n=e("mp4box");var a=1e7;var s=1e6;var o=5e3;t.exports=function(e,t,r){r=r||{};var l=r.debugTrack||-1;var u=[];t.addEventListener("waiting",function(){if(d){b(t.currentTime)}});var c=new MediaSource;c.addEventListener("sourceopen",function(){y(0)});t.src=window.URL.createObjectURL(c);var p=new n;p.onError=function(e){i("MP4Box error: %s",e.message);if(_){_()}if(c.readyState==="open"){c.endOfStream("decode")}};var d=false;var h=0;var m={};p.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=c.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",x.bind(null,i));p.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});m[e.id]=i}});if(Object.keys(m).length===0){c.endOfStream("decode");return}var t=p.initializeSegmentation();t.forEach(function(e){w(m[e.id],e.buffer);if(e.id===l){f("init-track-"+l+".mp4",[e.buffer]);u.push(e.buffer)}});d=true};p.onSegment=function(e,t,r,i){var n=m[e];w(n,r,i===n.meta.nb_samples);if(e===l&&u){u.push(r);if(i>1e3){f("track-"+l+".mp4",u);u=null}}};var v;var g=null;var _=null;function y(t){if(t===e.length){p.flush();return}if(g&&t===v){return}if(g){g.destroy();_()}v=t;var r={start:v,end:e.length-1};g=e.createReadStream(r);function n(e){g.pause();if(h<=a){k()}var t=e.toArrayBuffer();t.fileStart=v;v+=t.byteLength;var r;try{r=p.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(c.readyState==="open"){c.endOfStream("decode")}g.destroy();_();return}y(r)}g.on("data",n);function s(){_();y(v)}g.on("end",s);function o(e){i("Stream error: %s",e.message);if(c.readyState==="open"){c.endOfStream("network")}}g.on("error",o);_=function(){g.removeListener("data",n);g.removeListener("end",s);g.removeListener("error",o);g=null;_=null}}function b(e){var t=p.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);y(t.offset);k()}function w(e,t,r){h+=t.byteLength;e.arrayBuffers.push({buffer:t,ended:r||false});x(e)}function x(e){if(e.buffer.updating||e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);e.arrayBuffers.unshift(t);setTimeout(function(){x(e)},o)}if(r){h-=t.buffer.byteLength;if(h<=s){k()}S()}}function k(){setTimeout(function(){if(g){if(g.isPaused?g.isPaused():!g._readableState.flowing){g.resume()}}})}function S(){if(c.readyState!=="open"){return}var e=Object.keys(m).every(function(e){var t=m[e];return t.ended&&!t.buffer.updating});if(e&&c.readyState==="open"){c.endOfStream()}}};function f(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:138,mp4box:236}],238:[function(e,t,r){arguments[4][27][0].apply(r,arguments)},{dup:27}],239:[function(e,t,r){t.exports=function i(e,t,r){if(t===undefined){return function(t,r){return i(e,t,r)}}if(r===undefined)r="0";e-=t.toString().length;if(e>0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],240:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.52.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^5.0.0",brfs:"^1.2.0",browserify:"^10.0.0",finalhandler:"^0.3.6","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],241:[function(e,t,r){(function(r,i,n){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var l=e("xtend");var u=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var _=e("./lib/fs-storage");var y=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof _==="function"?_:y;t.peerId=e.peerId===undefined?new n("-WW"+x+"-"+u(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(u(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(l({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(i){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n<a;n++){var s=t.torrents[n];if(s.infoHash===r.infoHash)return s}return null};k.prototype.add=k.prototype.download=function(e,t,i){var n=this;if(n.destroyed)throw new Error("client is destroyed");s("add");if(typeof t==="function"){i=t;t={}}if(!t)t={};if(!t.storage)t.storage=n.storage;t.client=n;var a=n.get(e);function o(){s("on torrent");if(typeof i==="function")i(a)}if(a){if(a.ready)r.nextTick(o);else a.on("ready",o)}else{a=new b(e,t);n.torrents.push(a);a.on("error",function(e){n.emit("error",e,a);n.remove(a)});a.on("listening",function(e){n.emit("listening",e,a)});a.on("ready",function(){o();n.emit("torrent",a)})}return a};k.prototype.seed=function(e,t,r){var i=this;if(i.destroyed)throw new Error("client is destroyed");s("seed");if(typeof t==="function"){r=t;t={}}if(!t)t={};t.noVerify=true;t.createdBy="WebTorrent/"+w;if(typeof e==="string"&&!t.path)t.path=g.dirname(e);var n;var o=i.add(undefined,t,function(e){var t=[function(t){e.storage.load(n,t)}];if(i.dht){t.push(function(t){e.on("dhtAnnounce",t)})}d(t,function(t){if(t)return i.emit("error",t);f();i.emit("seed",e)})});a.parseInput(e,t,function(r,s){if(r)return i.emit("error",r);n=s.map(function(e){return e.getStream});a(e,t,function(e,t){if(e)return i.emit("error",e);if(i.destroyed)return;var r=i.get(t);if(r){o.destroy();f();return}else{o._onTorrentId(t)}})});function f(){s("on seed");if(typeof r==="function")r(o)}return o};k.prototype.remove=function(e,t){var r=this;var i=r.get(e);if(!i)throw new Error("No torrent with id "+e);s("remove");r.torrents.splice(r.torrents.indexOf(i),1);i.destroy(t)};k.prototype.address=function(){var e=this;return{address:"0.0.0.0",family:"IPv4",port:e.torrentPort}};k.prototype.destroy=function(e){var t=this;t.destroyed=true;s("destroy");var r=t.torrents.map(function(e){return function(r){t.remove(e,r)}});if(t.dht){r.push(function(e){t.dht.destroy(e)})}d(r,e)}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{"./lib/fs-storage":52,"./lib/storage":7,"./lib/torrent":8,"./package.json":240,_process:78,"bittorrent-dht/client":52,buffer:66,"create-torrent":99,debug:138,events:70,hat:146,inherits:147,"load-ip-set":52,"parse-torrent":154,path:77,"run-parallel":175,speedometer:181,xtend:238,"zero-fill":239}]},{},[241])(241)});