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-05 03:25:45 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-07-05 03:25:45 +0300
commitd26fe7650744f2c04afca727ede7624277b6ae85 (patch)
tree15be05e90536eae52d776738776eb801957af556 /webtorrent.min.js
parent4dceff4a1562a7d3661f56f58d8a961303c764a3 (diff)
build
Diffstat (limited to 'webtorrent.min.js')
-rw-r--r--webtorrent.min.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/webtorrent.min.js b/webtorrent.min.js
index d194a95..fb67ea2 100644
--- a/webtorrent.min.js
+++ b/webtorrent.min.js
@@ -1,11 +1,11 @@
-(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,n;return function r(e,t,n){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 u=t[o]={exports:{}};e[o][0].call(u.exports,function(t){var n=e[o][1][t];return i(n?n:t)},u,u.exports,r,e,t,n)}return t[o].exports}var a=typeof require=="function"&&require;for(var o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){t.exports=f;var r=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 n=this;if(!(n instanceof f))return new f(e,t);o.Readable.call(n,t);r("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;n.destroyed=false;n.length=t.end-t.start+1;var i=t.start+e.offset;var s=t.pieceLength;n.startPiece=i/s|0;n.endPiece=(t.end+e.offset)/s|0;n._extname=a.extname(e.name).toLowerCase();n._storage=e.storage;n._piece=n.startPiece;n._missing=n.length;n._reading=false;n._notifying=false;n._criticalLength=Math.min(1024*1024/s|0,2);n._offset=i-n.startPiece*s}f.prototype._read=function(){var e=this;r("_read");if(e._reading)return;e._reading=true;e.notify()};f.prototype.notify=function(){var e=this;r("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;r("before read %s",t);e._storage.read(e._piece++,function(n,i){r("after read %s (length %s) (err %s)",t,i.length,n&&n.message);e._notifying=false;if(e.destroyed)return;if(n){e._storage.emit("error",n);return e.destroy(n)}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;r("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 n=o.Readable.prototype.pipe;if(e&&(e.nodeName==="VIDEO"||e.nodeName==="AUDIO")){var r={".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 n.call(t,new s(e,{type:r}))}else{return n.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,n){t.exports=s;var r=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 n=this;if(!(n instanceof s))return new s(e,t);a.Writable.call(n,t);if(!o)throw new Error("web browser lacks MediaSource support");if(!t)t={};r("new mediastream %s %s",e,JSON.stringify(t));n.media=e;n._mediaSource=new o;n._sourceBuffer=null;n._cb=null;n.media.src=window.URL.createObjectURL(n._mediaSource);n._mediaSource.addEventListener("sourceopen",function(){if(o.isTypeSupported(t.type)){n._sourceBuffer=n._mediaSource.addSourceBuffer(t.type);n._sourceBuffer.addEventListener("updateend",n._flow.bind(n));n._flow()}else{n._mediaSource.endOfStream("decode")}});n.on("finish",function(){r("finish");n._mediaSource.endOfStream()});window.vs=n}s.prototype._write=function(e,t,n){var i=this;if(!i._sourceBuffer){i._cb=function(r){if(r)return n(r);i._write(e,t,n)};return}if(i._sourceBuffer.updating){return n(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);r("appendBuffer %s",e.length);i._cb=n};s.prototype._flow=function(){var e=this;r("flow");if(e._cb){e._cb(null)}}},{debug:137,inherits:146,stream:93}],3:[function(e,t,n){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,n){t.exports=r;function r(e,t){var n=this;n.swarm=e;n.numPieces=t;function r(e){e.on("have",function(e){n.pieces[e]++});e.on("bitfield",n.recalculate.bind(n));e.on("close",function(){for(var t=0;t<n.numPieces;++t){n.pieces[t]-=e.peerPieces.get(t)}})}n.swarm.wires.forEach(r);n.swarm.on("wire",function(e){n.recalculate();r(e)});n.recalculate()}r.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 n=0;n<e.numPieces;++n){e.pieces[n]+=t.peerPieces.get(n)}})};r.prototype.getRarestPiece=function(e){var t=this;var n=[];var r=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===r){n.push(i)}else if(a<r){n=[i];r=a}}if(n.length>0){return n[Math.random()*n.length|0]}else{return-1}}},{}],5:[function(e,t,n){var r=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 n=i.createServer(t);n.on("connection",function(e){e.setTimeout(36e6)});n.on("request",function(t,n){r("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){n.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");n.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);n.setHeader("Access-Control-Max-Age","1728000");return n.end()}if(t.headers.origin){n.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return n.end();if(e.ready)c();else e.once("ready",c);function c(){if(i==="/"){n.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 n.end("<h1>WebTorrent</h1><ol>"+f+"</ol>")}var c=Number(i.slice(1));if(Number.isNaN(c)||c>=e.files.length){n.statusCode=404;return n.end("404 Not Found")}var u=e.files[c];n.setHeader("Accept-Ranges","bytes");n.setHeader("Content-Type",a.lookup(u.name));n.statusCode=200;n.setHeader("transferMode.dlna.org","Streaming");n.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var l;if(t.headers.range){n.statusCode=206;l=s(u.length,t.headers.range)[0];r("range %s",JSON.stringify(l));n.setHeader("Content-Range","bytes "+l.start+"-"+l.end+"/"+u.length);n.setHeader("Content-Length",l.end-l.start+1)}else{n.setHeader("Content-Length",u.length)}if(t.method==="HEAD")n.end();o(u.createReadStream(l),n)}});return n}},{debug:137,http:70,mime:147,pump:171,"range-parser":172,url:95}],6:[function(e,t,n){(function(n,r){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 u=e("./file-stream");var l=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(){}l(x,c);function x(e,t,n,r){var i=this;c.call(i);if(!o.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!r;if(typeof n==="number"){i.buffer=null;i.length=n}else{i.buffer=n;i.length=n.length}i._reset()}x.prototype.readBlock=function(e,t,n){var r=this;n=s(n);if(!r.buffer||!r._verifyOffset(e)){return n(new Error("invalid block offset "+e))}n(null,r.buffer.slice(e,e+t))};x.prototype.writeBlock=function(e,t,n){var r=this;n=s(n);if(!r._verifyOffset(e)||!r._verifyBlock(e,t)){return n(new Error("invalid block "+e+":"+t.length))}r._lazyAllocBuffer();var i=e/g;if(r.blocks[i]===b){return n(null)}t.copy(r.buffer,e);r.blocks[i]=b;r.blocksWritten+=1;if(r.blocksWritten===r.blocks.length){r.verify()}n(null)};x.prototype.reserveBlock=function(e){var t=this;var n=t.blocks.length;for(var r=0;r<n;r++){if(t.blocks[r]&&!e||t.blocks[r]===b){continue}t.blocks[r]=w;return{offset:r*g,length:r===n-1?t.length-r*g:g}}return null};x.prototype.cancelBlock=function(e){var t=this;if(!t._verifyOffset(e)){return false}var n=e/g;if(t.blocks[n]===w){t.blocks[n]=_}return true};x.prototype._reset=function(){var e=this;e.verified=false;e.blocks=new r(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;n();return}m(e,function(e){t.verified=e===t.hash;n()});function n(){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 n=this;if(t.length===g){return true}else if(t.length===n.length-e&&n.length-e<g){return true}else{n.emit("warning",new Error("invalid block size "+t.length));return false}};x.prototype._lazyAllocBuffer=function(){var e=this;if(!e.buffer){e.buffer=new r(e.length)}};l(k,c);function k(e,t,n,r){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=n;i.pieceLength=r;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 n=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,n,false)}};k.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var n=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,n,false)}};k.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var n=new u(t,e);t.storage.emit("select",n.startPiece,n.endPiece,true,n.notify.bind(n));f(n,function(){t.storage.emit("deselect",n.startPiece,n.endPiece,true)});return n};k.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");t.getBuffer(function(n,r){if(n)return e(n);var i=d[v.extname(t.name).toLowerCase()];var a=i?new window.Blob([r],{type:i}):new window.Blob([r]);var o=window.URL.createObjectURL(a);e(null,o)})};k.prototype.getBuffer=function(e){var t=this;e=s(h(e));var n;if(t.storage.buffer){var i=function(){n=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,n)};if(t.done)i();else t.once("done",i)}else{n=new r(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(n,a);a+=e.length}).on("end",function(){e(null,n)}).on("error",e)}};k.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};l(E,c);function E(e,t){var n=this;c.call(n);if(!o.enabled)n.setMaxListeners(0);if(!t)t={};n.bitfield=new i(e.pieces.length);n.done=false;n.closed=false;n.readonly=true;if(!t.nobuffer){n.buffer=new r(e.length)}var a=n.pieceLength=e.pieceLength;var s=e.lastPieceLength;var f=e.pieces.length;n.pieces=e.pieces.map(function(e,r){var i=r*a;var o=i+(r===f-1?s:a);var c=n.buffer?n.buffer.slice(i,o):o-i;var u=new x(r,e,c,!!t.noVerify);u.on("done",n._onPieceDone.bind(n,u));return u});n.files=e.files.map(function(e){var t=e.offset;var r=t+e.length-1;var i=t/a|0;var o=r/a|0;var s=n.pieces.slice(i,o+1);var f=new k(n,e,s,a);f.on("done",n._onFileDone.bind(n,f));return f})}E.BLOCK_LENGTH=g;E.prototype.load=function(e,t){var n=this;if(!Array.isArray(e))e=[e];t=h(t||function(){});var r=0;var i=new p(e);var o=new a(n.pieceLength,{zeroPadding:false});i.on("error",f);n.once("done",c);i.pipe(o).on("data",s).on("error",f);function s(e){var t=r;r+=1;var i=0;var o=new a(g,{zeroPadding:false});o.on("data",s);o.on("end",f);function s(e){var r=i*g;i+=1;n.writeBlock(t,r,e)}function f(){c()}function c(){o.removeListener("data",s);o.removeListener("end",f)}o.end(e)}function f(e){u();t(e)}function c(){u();t(null)}function u(){i.removeListener("error",f);o.removeListener("data",s);o.removeListener("error",f);n.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 n=0,r=e.pieces.length;n<r;n++){t-=e.bitfield.get(n)}return t}});E.prototype.readBlock=function(e,t,n,r){var i=this;r=s(r);var a=i.pieces[e];if(!a)return r(new Error("invalid piece index "+e));a.readBlock(t,n,r)};E.prototype.writeBlock=function(e,t,n,r){var i=this;if(!r)r=y;r=s(r);if(i.readonly)return r(new Error("cannot write to readonly storage"));var a=i.pieces[e];if(!a)return r(new Error("invalid piece index "+e));a.writeBlock(t,n,r)};E.prototype.read=function(e,t,n,i){var a=this;if(typeof t==="function"){i=n;n=t;t=null}n=s(n);var o=a.pieces[e];if(!o){return n(new Error("invalid piece index "+e))}if(!o.verified&&!i){return n(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 n(null,o.buffer.slice(f,f+c))}var u=[];function l(){if(c<=0)return n(null,r.concat(u));var t=f;var i=Math.min(g,c);f+=i;c-=i;a.readBlock(e,t,i,function(e,t){if(e)return n(e);u.push(t);l()})}l()};E.prototype.reserveBlock=function(e,t){var n=this;var r=n.pieces[e];if(!r)return null;return r.reserveBlock(t)};E.prototype.cancelBlock=function(e,t){var n=this;var r=n.pieces[e];if(!r)return false;return r.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,n){(function(n,r){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 u=e("run-parallel");var l=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 n=this;f.call(n);if(!o.enabled)n.setMaxListeners(0);o("new torrent");n.opts=t;n.client=t.client;n.hotswapEnabled="hotswap"in t?t.hotswap:true;n.verify=t.verify;n.chokeTimeout=t.chokeTimeout||x;n.pieceTimeout=t.pieceTimeout||y;n.strategy=t.strategy||"sequential";n._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;n._rechokeOptimisticWire=null;n._rechokeOptimisticTime=0;n._rechokeIntervalId=null;n.ready=false;n.destroyed=false;n.files=[];n.metadata=null;n.parsedTorrent=null;n.storage=null;n.numBlockedPeers=0;n._amInterested=false;n._selections=[];n._critical=[];n._storageImpl=t.storage||w;this._torrentFileURL=null;if(e)n._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 l.toMagnetURI(this.parsedTorrent)}});Object.defineProperty(L.prototype,"torrentFile",{get:function(){return l.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 n=e&&e.parsedTorrent;if(n){t._onParsedTorrent(n)}else{l.remote(e,function(e,n){if(t.destroyed)return;if(e)return t._onError(e);t._onParsedTorrent(n)})}};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(r.WEBTORRENT_ANNOUNCE){t.parsedTorrent.announce=t.parsedTorrent.announce.concat(r.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));n.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);if(e.parsedTorrent.urlList){e.parsedTorrent.urlList.forEach(e.addWebSeed.bind(e))}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=l.toTorrentFile(e);t.parsedTorrent=e}else{t.metadata=e;var r=t.parsedTorrent.announce;try{t.parsedTorrent=l(t.metadata)}catch(i){return t._onError(i)}t.parsedTorrent.announce=r}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){n.nextTick(function(){o("verifying existing torrent data");var e=0;var n=0;u(t.storage.pieces.map(function(r){return function(i){t.storage.read(r.index,function(a,s){e+=1;t.emit("verifying",{percentDone:100*e/t.storage.pieces.length,percentVerified:100*n/t.storage.pieces.length});if(!a&&s){r.verify(s);n+=r.verified;o("piece "+(r.verified?"verified":"invalid")+" "+r.index)}i()},true)}}),t._onStorage.bind(t))})}else{n.nextTick(t._onStorage.bind(t))}n.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 n=[];if(t.swarm)n.push(function(e){t.swarm.destroy(e)});if(t.discovery)n.push(function(e){t.discovery.stop(e)});if(t.storage)n.push(function(e){t.storage.close(e)});u(n,e)};L.prototype.addPeer=function(e){var t=this;function n(){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)n();else t.on("listening",n);return true}};L.prototype.addWebSeed=function(e){var t=this;t.swarm.addWebSeed(e,t.parsedTorrent)};L.prototype.select=function(e,t,n,r){var i=this;if(e>t||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}n=Number(n)||0;o("select %s-%s (priority %s)",e,t,n);i._selections.push({from:e,to:t,offset:0,priority:n,notify:r||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,n){var r=this;n=Number(n)||0;o("deselect %s-%s (priority %s)",e,t,n);for(var i=0;i<r._selections.length;++i){var a=r._selections[i];if(a.from===e&&a.to===t&&a.priority===n){r._selections.splice(i--,1);break}}r._updateSelections()};L.prototype.critical=function(e,t){var n=this;o("critical %s-%s",e,t);for(var r=e;r<=t;++r){n._critical[r]=true}n._updateSelections()};L.prototype._onWire=function(e,t){var n=this;o("got wire (%s)",t||"Unknown");if(t){var r=i(t);e.remoteAddress=r[0];e.remotePort=r[1]}if(e.peerExtensions.dht&&n.client.dht&&n.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);n.client.dht.addNode(e.remoteAddress+":"+t)});e.port(n.client.dht.address().port)}e.on("timeout",function(){o("wire timeout (%s)",t);e.destroy()});e.setTimeout(n.pieceTimeout,true);e.setKeepAlive(true);e.use(v(n.metadata));if(!n.metadata){e.ut_metadata.on("metadata",function(e){o("got metadata via ut_metadata");n._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);n.addPeer(e)});e.ut_pex.on("dropped",function(e){o("ut_pex: dropped peer: %s (from %s)",e,t);var r=n.swarm._peers[e];if(!r||!r.conn)n.swarm.removePeer(e)})}n.emit("wire",e);if(n.metadata){n._onWireWithMetadata(e)}};L.prototype._onWireWithMetadata=function(e){var t=this;var n=null;var r=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{n=setTimeout(i,r);if(n.unref)n.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(n)});e.on("choke",function(){clearTimeout(n);n=setTimeout(i,r);if(n.unref)n.unref()});e.on("unchoke",function(){clearTimeout(n);t._update()});e.on("request",function(n,r,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(n,r,i,a)});e.bitfield(t.storage.bitfield);e.interested();n=setTimeout(i,r);if(n.unref)n.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();n.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));n.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 n=e._selections[t];var r=n.offset;while(e.storage.bitfield.get(n.from+n.offset)&&n.from+n.offset<n.to){n.offset++}if(r!==n.offset)n.notify();if(n.to!==n.from+n.offset)continue;if(!e.storage.bitfield.get(n.from+n.offset))continue;e._selections.splice(t--,1);n.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 n=C(e,E);if(e.requests.length>=n)return;var r=C(e,S);f(false)||f(true);function i(t,n,r,i){return function(a){return a>=t&&a<=n&&!(a in r)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var n=t._selections.length;n--;){var r=t._selections[n];var a;if(t.strategy==="rarest"){var o=r.from+r.offset;var s=r.to;var f=s-o+1;var c={};var u=0;var l=i(o,s,c);while(u<f){a=t.rarityMap.getRarestPiece(l);if(a<0)break;if(t._request(e,a,false))return;c[a]=true;u+=1}}else{for(a=r.to;a>=r.from+r.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function o(){var n=e.downloadSpeed()||1;if(n>k)return function(){return true};var r=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/n;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<=n)continue;if(!f.peerPieces.get(e))continue;if((s-=c*r)>0)continue;i--;return false}return true}}function s(e){var n=e;for(var r=e;r<t._selections.length&&t._selections[r].priority;r++){n=r}var i=t._selections[e];t._selections[e]=t._selections[n];t._selections[n]=i}function f(n){if(e.requests.length>=r)return true;var a=o();for(var f=0;f<t._selections.length;f++){var c=t._selections[f];var u;if(t.strategy==="rarest"){var l=c.from+c.offset;var d=c.to;var p=d-l+1;var h={};var v=0;var m=i(l,d,h,a);while(v<p){u=t.rarityMap.getRarestPiece(m);if(u<0)break;while(t._request(e,u,t._critical[u]||n)){}if(e.requests.length<r){h[u]=true;v++;continue}if(c.priority)s(f);return true}}else{for(u=c.from+c.offset;u<=c.to;u++){if(!e.peerPieces.get(u)||!a(u))continue;while(t._request(e,u,t._critical[u]||n)){}if(e.requests.length<r)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(n){if(!n.isSeeder&&n!==e._rechokeOptimisticWire){t.push({wire:n,downloadSpeed:n.downloadSpeed(),uploadSpeed:n.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(o);var n=0;var r=0;for(;r<t.length&&n<e._rechokeNumSlots;++r){t[r].isChoked=false;if(t[r].wire.peerInterested)n+=1}if(!e._rechokeOptimisticWire&&r<t.length&&e._rechokeNumSlots){var i=t.slice(r).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 n=this;if(!n.hotswapEnabled)return false;var r=e.downloadSpeed();if(r<w.BLOCK_LENGTH)return false;if(!n._reservations[t])return false;var i=n._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>r||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 u=o.requests[s];if(u.piece!==t)continue;n.storage.cancelBlock(t,u.offset)}n.emit("hotswap",o,e,t);return true};L.prototype._request=function(e,t,r){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&&r&&i._hotswap(e,t)){c=i.storage.reserveBlock(t,false)}if(!c)return false;var u=i._reservations[t];if(!u){u=i._reservations[t]=[]}var l=u.indexOf(null);if(l===-1)l=u.length;u[l]=e;function d(r,a){if(!i.ready){i.once("ready",function(){d(r,a)});return}if(u[l]===e)u[l]=null;if(r){o("error getting piece %s (offset: %s length: %s) from %s: %s",t,c.offset,c.length,e.remoteAddress+":"+e.remotePort,r.message);i.storage.cancelBlock(t,c.offset);n.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)}n.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 n=e.map(function(e,t){return t});for(var r=n.length-1;r>0;--r){var i=R(r+1);var a=n[r];n[r]=n[i];n[i]=a}n.forEach(function(n){t(e[n],n,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:220,ut_metadata:221,ut_pex:51}],8:[function(e,t,n){var r=/^\[?([^\]]+)\]?:(\d+)$/;var i={};var a=0;t.exports=function o(e){if(a===1e5)i={};if(!i[e]){var t=r.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,n){(function(e){var n=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var n=0;n<e;n++)t[n]=0};function r(e,t){if(!(this instanceof r)){return new r(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 n(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}r.prototype.get=function(e){var t=e>>3;return t<this.buffer.length&&!!(this.buffer[t]&128>>e%8)};r.prototype.set=function(e,t){var n=e>>3;if(t||arguments.length===1){if(this.buffer.length<n+1)this._grow(Math.max(n+1,Math.min(2*this.buffer.length,this.grow)));this.buffer[n]|=128>>e%8}else if(n<this.buffer.length){this.buffer[n]&=~(128>>e%8)}};r.prototype._grow=function(e){if(this.buffer.length<e&&e<=this.grow){var t=new n(e);if(t.fill)t.fill(0);if(this.buffer.copy)this.buffer.copy(t,0);else{for(var r=0;r<this.buffer.length;r++){t[r]=this.buffer[r]}}this.buffer=t}};if(typeof t!=="undefined")t.exports=r}).call(this,e("buffer").Buffer)},{buffer:65}],10:[function(e,t,n){(function(n,r){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 u=e("./lib/peer");var l=e("speedometer");var d=e("./lib/tcp-pool");var p=55;var h=[1e3,5e3,15e3];f(v,s);function v(e,t,n){var i=this;if(!(i instanceof v))return new v(e,t,n);s.call(i);i.infoHash=typeof e==="string"?new r(e,"hex"):e;i.infoHashHex=i.infoHash.toString("hex");i.peerId=typeof t==="string"?new r(t,"hex"):t;i.peerIdHex=i.peerId.toString("hex");if(!n)n={};a("new swarm (i %s p %s)",i.infoHashHex,i.peerIdHex);i.handshakeOpts=n.handshake;i.maxConns=n.maxConns!==undefined?n.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=l();i.uploadSpeed=l()}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 n in e._peers){var r=e._peers[n];if(r&&r.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 n=e&&e.id||e;if(t._peers[n])return;a("addPeer %s",n);var r;if(typeof e==="string"){r=u.createOutgoingTCPPeer(e,t);t._queue.push(r);t._drain()}else{r=u.createWebRTCPeer(e,t)}t._peers[r.id]=r;t._peersLength+=1};v.prototype.addWebSeed=function(e,t){var n=this;if(n.destroyed)return;if(!/^https?:\/\/.+/.test(e)){a("ignoring invalid web seed %s (from swarm.addWebSeed)",e);return}if(n._peers[e])return;a("addWebSeed %s",e);n._peers[e]=u.createWebPeer(e,t,n);n._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 n=t._peers[e];if(!n)return;a("removePeer %s",e);t._peers[e]=null;t._peersLength-=1;n.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,r){var i=this;if(typeof t==="function"){r=t;t=undefined}if(r)r=o(r);if(i.listening)throw new Error("swarm already listening");if(n.browser){r()}else{i._port=e||d.getDefaultListenPort(i.infoHashHex);i._hostname=t;if(r)i.once("listening",r);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 n in t._peers){t.removePeer(n)}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 n=i(t.addr);var r=n[0];var o=n[1];var s=t.conn=c.connect({host:r,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 n(){var n=u.createOutgoingTCPPeer(t.addr,e);n.retries=t.retries+1;e._queue.push(n);e._drain()}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(n,r);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 n=i(e);var r=n[0];var a=n[1];return a>0&&a<65535&&!(r==="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,n){var r=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var o=25e3;var s=25e3;n.createWebRTCPeer=function(e,t){var n=new f(e.id);n.conn=e;n.swarm=t;if(n.conn.connected){n.onConnect()}else{n.conn.once("connect",function(){n.onConnect()});n.conn.once("error",function(e){n.destroy(e)});n.setConnectTimeout()}return n};n.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var n=new f(t);n.conn=e;n.addr=t;n.onConnect();return n};n.createOutgoingTCPPeer=function(e,t){var n=new f(e);n.addr=e;n.swarm=t;return n};n.createWebPeer=function(e,t,n){var r=new f(e);r.swarm=n;r.conn=new i(e,t);r.onConnect();return r};function f(e){var t=this;t.id=e;r("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;r("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 n=e.wire=new a;n.once("end",function(){e.destroy()});n.once("finish",function(){e.destroy()});n.once("error",function(t){e.destroy(t)});n.once("handshake",function(t,n){e.onHandshake(t,n)});e.setHandshakeTimeout();t.pipe(n).pipe(t);if(e.swarm)e.handshake()};f.prototype.onHandshake=function(e,t){var n=this;if(!n.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(n.swarm.destroyed)return n.destroy(new Error("swarm already destroyed"));if(i!==n.swarm.infoHashHex){return n.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===n.swarm.peerIdHex){return n.destroy(new Error("refusing to handshake with self"))}r("Peer %s got handshake %s",n.id,i);clearTimeout(n.handshakeTimeout);n.retries=0;n.wire.on("download",function(e){if(n.destroyed)return;n.swarm.downloaded+=e;n.swarm.downloadSpeed(e);n.swarm.emit("download",e)});n.wire.on("upload",function(e){if(n.destroyed)return;n.swarm.uploaded+=e;n.swarm.uploadSpeed(e);n.swarm.emit("upload",e)});if(!n.sentHandshake)n.handshake();n.swarm.wires.push(n.wire);var o=n.addr;if(!o&&n.conn.remoteAddress){o=n.conn.remoteAddress+":"+n.conn.remotePort}n.swarm.emit("wire",n.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;r("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,n){(function(n){t.exports=f;var r=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 n=this;n.port=e;n.listening=false;n.swarms={};r("new TCPPool (port: %s, hostname: %s)",e,t);n.pendingConns=[];n.server=a.createServer();n.server.on("connection",function(e){n._onConnection(e)});n.server.on("error",function(e){n._onError(e)});n.server.on("listening",function(){n._onListening()});n.server.listen(n.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 r=s[e._port];if(!r)return t();r.removeSwarm(e);var i=0;for(var a in r.swarms){var o=r.swarms[a];if(o)i+=1}if(i===0)r.destroy(t);else n.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in s){var n=s[t];if(n&&!n.swarms[e])return n.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){n.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){n.nextTick(function(){e._onListening(t.port)})}r("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;r("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);r("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(n){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var n=t.port;r("tcp pool listening on %s",n);if(n!==e.port){s[e.port]=null;e.port=n;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",n);function n(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var r=o.createIncomingTCPPeer(e);r.wire.once("handshake",function(i,a){var o=i.toString("hex");n();e.removeListener("close",n);var s=t.swarms[o];if(s){r.swarm=s;s._addIncomingPeer(r);r.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+o+" from incoming peer "+r.id+": destroying peer");r.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var n in t.swarms){var r=t.swarms[n];if(r){t.removeSwarm(r);r._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:77,debug:27,dezalgo:30,net:51}],13:[function(e,t,n){(function(n){t.exports=f;var r=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 n(20).fill(e));var o=a.parsedTorrent.pieces.length;var s=new r(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,n,r){i("request pieceIndex=%d offset=%d length=%d",e,t,n);a.httpRequest(e,t,n,r)})}f.prototype.httpRequest=function(e,t,n,r){var o=this;var s=e*o.parsedTorrent.pieceLength;var f=s+t;var c=f+n-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,n,f,c);var u={url:o.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+c}};a.concat(u,function(e,t,n){if(e)return r(e);if(n.statusCode<200||n.statusCode>=300){return r(new Error("Unexpected HTTP status code "+n.statusCode))}i("Got data of length %d",t.length);r(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,n){arguments[4][9][0].apply(n,arguments)},{buffer:65,dup:9}],15:[function(e,t,n){(function(n){t.exports=b;var r=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 u=4e5;var l=new n("BitTorrent protocol");var d=new n([0,0,0,0]);var p=new n([0,0,0,1,0]);var h=new n([0,0,0,1,1]);var v=new n([0,0,0,1,2]);var m=new n([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,n,r){this.piece=e;this.offset=t;this.length=n;this.callback=r}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 r(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,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 n=this._nextExt;var r=new e(this);function i(){}if(typeof r.onHandshake!=="function"){r.onHandshake=i}if(typeof r.onExtendedHandshake!=="function"){r.onExtendedHandshake=i}if(typeof r.onMessage!=="function"){r.onMessage=i}this.extendedMapping[n]=t;this._ext[t]=r;this[t]=r;this._nextExt+=1};b.prototype.handshake=function(e,t,r){if(typeof e==="string")e=new n(e,"hex");if(typeof t==="string")t=new n(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}var i=new n(g);i[5]|=16;if(r&&r.dht)i[7]|=1;this._push(n.concat([l,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 n=this.extendedMapping[t];e.m[n]=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(!n.isBuffer(e))e=e.buffer;this._message(5,[],e)};b.prototype.request=function(e,t,n,r){if(!r)r=function(){};if(this._finished)return r(new Error("wire is closed"));if(this.peerChoking)return r(new Error("peer is choking"));this.requests.push(new w(e,t,n,r));this._updateTimeout();this._message(6,[e,t,n],null)};b.prototype.piece=function(e,t,n){this.uploaded+=n.length;this.uploadSpeed(n.length);this.emit("upload",n.length);this._message(7,[e,t],n)};b.prototype.cancel=function(e,t,n){this._callback(y(this.requests,e,t,n),new Error("request was cancelled"),null);this._message(8,[e,t,n],null)};b.prototype.port=function(e){var t=new n(_);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 r=new n([e]);var a=n.isBuffer(t)?t:i.encode(t);this._message(20,[],n.concat([r,a]))}else{throw new Error("Unrecognized extension: "+e)}};b.prototype._onKeepAlive=function(){this.emit("keep-alive")};b.prototype._onHandshake=function(e,t,n){this.peerId=t;this.peerExtensions=n;this.emit("handshake",e,t,n);var r;for(r in this._ext){this._ext[r].onHandshake(e,t,n)}if(n.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 r(e);this.emit("bitfield",this.peerPieces)};b.prototype._onRequest=function(e,t,n){if(this.amChoking)return;var r=function(r,a){if(i!==y(this.peerRequests,e,t,n))return;if(r)return;this.piece(e,t,a)}.bind(this);var i=new w(e,t,n,r);this.peerRequests.push(i);this.emit("request",e,t,n,r)};b.prototype._onPiece=function(e,t,n){this._callback(y(this.requests,e,t,n.length),null,n);this.downloaded+=n.length;this.downloadSpeed(n.length);this.emit("download",n.length);this.emit("piece",e,t,n)};b.prototype._onCancel=function(e,t,n){y(this.peerRequests,e,t,n);this.emit("cancel",e,t,n)};b.prototype._onPort=function(e){this.emit("port",e)};b.prototype._onExtended=function(e,t){var n,r;if(e===0&&(n=x(t))){this.peerExtendedHandshake=n;if(typeof n.m==="object"){for(r in n.m){this.peerExtendedMapping[r]=Number(n.m[r].toString())}}for(r in this._ext){if(this.peerExtendedMapping[r]){this._ext[r].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,r){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:n.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}r(null)};b.prototype._read=function(){};b.prototype._callback=function(e,t,n){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,n)};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,r){var i=r?r.length:0;var a=new n(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(r)this._push(r)};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 n=e.slice(0,t);if(n.toString()!=="BitTorrent protocol"){a("Error: wire not speaking BitTorrent protocol (%s)",n.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,n,r){for(var i=0;i<e.length;i++){var a=e[i];if(a.piece!==t||a.offset!==n||a.length!==r)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,n){t.exports={encode:e("./lib/encode"),decode:e("./lib/decode")}},{"./lib/decode":17,"./lib/encode":19}],17:[function(e,t,n){(function(n){var r=e("./dict");function i(e,t){i.position=0;i.encoding=t||null;i.data=!n.isBuffer(e)?new n(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 n=i.data.length;var r=i.data;while(t<n){if(r[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 r;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 n=++e+t;i.position=n;return i.encoding?i.data.toString(i.encoding,e,n):i.data.slice(e,n)};t.exports=i}).call(this,e("buffer").Buffer)},{"./dict":18,buffer:65}],18:[function(e,t,n){var r=t.exports=function i(){Object.defineProperty(this,"_keys",{enumerable:false,value:[]})};r.prototype.binaryKeys=function a(){return this._keys.slice()};r.prototype.binarySet=function o(e,t){this._keys.push(e);this[e]=t}},{}],19:[function(e,t,n){(function(e){function n(t){var r=[];n._encode(r,t);return e.concat(r)}n._floatConversionDetected=false;n._encode=function(t,r){if(e.isBuffer(r)){t.push(new e(r.length+":"));t.push(r);return}switch(typeof r){case"string":n.bytes(t,r);break;case"number":n.number(t,r);break;case"object":r.constructor===Array?n.list(t,r):n.dict(t,r);break}};var r=new e("e"),i=new e("d"),a=new e("l");n.bytes=function(t,n){t.push(new e(e.byteLength(n)+":"+n))};n.number=function(t,r){var i=2147483648;var a=r/i<<0;var o=r%i<<0;var s=a*i+o;t.push(new e("i"+s+"e"));if(s!==r&&!n._floatConversionDetected){n._floatConversionDetected=true;console.warn('WARNING: Possible data corruption detected with value "'+r+'":','Bencoding only defines support for integers, value was converted to "'+s+'"');console.trace()}};n.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];n.bytes(e,o);n._encode(e,t[o])}e.push(r)};n.list=function(e,t){var i=0,o=1;var s=t.length;e.push(a);for(;i<s;i++){n._encode(e,t[i])}e.push(r)};t.exports=n}).call(this,e("buffer").Buffer)},{buffer:65}],20:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{buffer:65,dup:9}],21:[function(e,t,n){n=t.exports=e("./debug");n.log=o;n.formatArgs=a;n.save=s;n.load=f;n.useColors=i;var r;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")r=chrome.storage.local;else r=c();n.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}n.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 ":" ")+"+"+n.humanize(this.diff);if(!t)return e;var r="color: "+this.color;e=[e[0],r,"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,r);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){r.removeItem("debug")}else{r.debug=e}}catch(t){}}function f(){var e;try{e=r.debug}catch(t){}return e}n.enable(f());function c(){try{return window.localStorage}catch(e){}}},{"./debug":22}],22:[function(e,t,n){n=t.exports=o;n.coerce=u;n.disable=f;n.enable=s;n.enabled=c;n.humanize=e("ms");n.names=[];n.skips=[];n.formatters={};var r=0;var i;function a(){return n.colors[r++%n.colors.length]}function o(e){function t(){}t.enabled=false;function r(){var e=r;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=n.useColors();if(null==e.color&&e.useColors)e.color=a();var s=Array.prototype.slice.call(arguments);s[0]=n.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,r){if(t==="%%")return t;f++;var i=n.formatters[r];if("function"===typeof i){var a=s[f];t=i.call(e,a);s.splice(f,1);f--}return t});if("function"===typeof n.formatArgs){s=n.formatArgs.apply(e,s)}var c=r.log||n.log||console.log.bind(console);c.apply(e,s)}r.enabled=true;var o=n.enabled(e)?r:t;o.namespace=e;return o}function s(e){n.save(e);var t=(e||"").split(/[\s,]+/);var r=t.length;for(var i=0;i<r;i++){if(!t[i])continue;e=t[i].replace(/\*/g,".*?");if(e[0]==="-"){n.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{n.names.push(new RegExp("^"+e+"$"))}}}function f(){n.enable("")}function c(e){var t,r;for(t=0,r=n.skips.length;t<r;t++){if(n.skips[t].test(e)){return false}}for(t=0,r=n.names.length;t<r;t++){if(n.names[t].test(e)){return true}}return false}function u(e){if(e instanceof Error)return e.stack||e.message;return e}},{ms:23}],23:[function(e,t,n){var r=1e3;var i=r*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?u(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 n=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}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>=r)return Math.round(e/r)+"s";return e+"ms"}function u(e){return l(e,o,"day")||l(e,a,"hour")||l(e,i,"minute")||l(e,r,"second")||e+" ms"}function l(e,t,n){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+n;return Math.ceil(e/t)+" "+n+"s"}},{}],24:[function(e,t,n){if(typeof Object.create==="function"){t.exports=function r(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 n=function(){};n.prototype=t.prototype;e.prototype=new n;e.prototype.constructor=e}}},{}],25:[function(e,t,n){var r=1;var i=65535;var a=4;var o=function(){r=r+1&i};var s=setInterval(o,1e3/a|0);if(s.unref)s.unref();t.exports=function(e){var t=a*(e||5);var n=[0];var o=1;var s=r-1&i;return function(e){var f=r-s&i;if(f>t)f=t;s=r;while(f--){if(o===t)o=0;n[o]=n[o===0?t-1:o-1];o++}if(e)n[o-1]+=e;var c=n[o-1];var u=n.length<t?0:n[o===t?0:o];return n.length<a?c:(c-u)*a/n.length}}},{}],26:[function(e,t,n){t.exports=r;function r(){var e={};for(var t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n){if(n.hasOwnProperty(r)){e[r]=n[r]}}}return e}},{}],27:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./debug":28,dup:21}],28:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:29}],29:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],30:[function(e,t,n){var r=e("wrappy");t.exports=r(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function n(){var n=arguments;var r=this;if(t)i(function(){e.apply(r,n)});else e.apply(r,n)}}},{asap:31,wrappy:32}],31:[function(e,t,n){(function(e){var n={task:void 0,next:null};var r=n;var i=false;var a=void 0;var o=false;function s(){while(n.next){n=n.next;var e=n.task;n.task=void 0;var t=n.domain;if(t){n.domain=void 0;t.enter()}try{e()}catch(r){if(o){if(t){t.exit()}setTimeout(s,0);if(t){t.enter()}throw r}else{setTimeout(function(){throw r},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){r=r.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,n){t.exports=r;function r(e,t){if(e&&t)return r(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){n[t]=e[t]});return n;function n(){var t=new Array(arguments.length);for(var n=0;n<t.length;n++){t[n]=arguments[n]}var r=e.apply(this,t);var i=t[t.length-1];if(typeof r==="function"&&r!==i){Object.keys(i).forEach(function(e){r[e]=i[e]})}return r}}},{}],33:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],34:[function(e,t,n){(function(n){t.exports=f;var r=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 n=e.body;e.body=undefined;if(n&&!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 u=e.protocol==="https:"?i:r;var l=u.request(e,function(n){if(n.statusCode>=300&&n.statusCode<400&&"location"in n.headers){e.url=n.headers.location;c(e);n.resume();e.maxRedirects-=1;return f(e,t)}if(["gzip","deflate"].indexOf(n.headers["content-encoding"])!==-1){var r=s.createUnzip();n.pipe(r);n.on("close",function(){r.emit("close")});r.httpVersion=n.httpVersion;r.headers=n.headers;r.trailers=n.trailers;r.setTimeout=n.setTimeout.bind(n);r.method=n.method;r.url=n.url;r.statusCode=n.statusCode;r.socket=n.socket;t(null,r)}else{t(null,n)}});l.on("error",t);l.end(n);return l}t.exports.concat=function(e,t){return f(e,function(e,r){if(e)return t(e);var i=[];r.on("data",function(e){i.push(e)});r.on("end",function(){t(null,n.concat(i),r)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,n){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return f(t,n)}});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,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],36:[function(e,t,n){var r=e("wrappy");t.exports=r(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,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],38:[function(e,t,n){(function(n){var r=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=o;r(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,r){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=n.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}r()};o.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new n(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(n.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(n.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,n){t.exports=function(){for(var e=0;e<arguments.length;e++){if(arguments[e]!==undefined)return arguments[e]}}},{}],40:[function(e,t,n){(function(n){t.exports=s;var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);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(r(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;n.nextTick(this.end.bind(this))}function c(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}}}).call(this,e("_process"))},{"./_stream_readable":42,"./_stream_writable":44,_process:77,"core-util-is":45,inherits:146}],41:[function(e,t,n){t.exports=a;var r=e("./_stream_transform");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(a,r);function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}a.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":43,"core-util-is":45,inherits:146}],42:[function(e,t,n){(function(n){t.exports=l;var r=e("isarray");var i=e("buffer").Buffer;l.ReadableState=u;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(l,o);function u(t,n){var r=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(n instanceof r)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 l(t){var n=e("./_stream_duplex");if(!(this instanceof l))return new l(t);this._readableState=new u(t,this);this.readable=true;o.call(this)}l.prototype.push=function(e,t){var n=this._readableState;if(s.isString(e)&&!n.objectMode){t=t||n.defaultEncoding;if(t!==n.encoding){e=new i(e,t);t=""}}return d(this,n,e,t,false)};l.prototype.unshift=function(e){var t=this._readableState;return d(this,t,e,"",true)};function d(e,t,n,r,i){var a=g(t,n);if(a){e.emit("error",a)}else if(s.isNullOrUndefined(n)){t.reading=false;if(!t.ended)_(e,t)}else if(t.objectMode||n&&n.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&&!r)n=t.decoder.write(n);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",n);e.read(0)}else{t.length+=t.objectMode?1:n.length;if(i)t.buffer.unshift(n);else t.buffer.push(n);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)}l.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}l.prototype.read=function(e){c("read",e);var t=this._readableState;var n=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 r=t.needReadable;c("need readable",r);if(t.length===0||t.length-e<t.highWaterMark){r=true;c("length less than watermark",r)}if(t.ended||t.reading){r=false;c("reading or ended",r)}if(r){c("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false}if(r&&!t.reading)e=m(n,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(n!==e&&t.ended&&t.length===0)I(this);if(!s.isNull(i))this.emit("data",i);return i};function g(e,t){var n=null;if(!s.isBuffer(t)&&!s.isString(t)&&!s.isNullOrUndefined(t)&&!e.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function _(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.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)n.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;n.nextTick(function(){x(e,t)})}}function x(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){c("maybeReadMore read 0");e.read(0);if(n===t.length)break;else n=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;c("pipe count=%d opts=%j",o.pipesCount,t);var s=(!t||t.end!==false)&&e!==n.stdout&&e!==n.stderr;var f=s?l:p;if(o.endEmitted)n.nextTick(f);else i.once("end",f);e.on("unpipe",u);function u(e){c("onunpipe");if(e===i){p()}}function l(){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",u);i.removeListener("end",l);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 n=e.write(t);if(false===n){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(r(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)}}}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;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var n=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var i=0;i<r;i++)n[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};l.prototype.on=function(e,t){var r=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;n.nextTick(function(){c("readable nexttick read 0");a.read(0)})}else if(i.length){w(this,i)}}}return r};l.prototype.addListener=l.prototype.on;l.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;n.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)}l.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 n=e.read()}while(null!==n&&t.flowing)}}l.prototype.wrap=function(e){var t=this._readableState;var n=false;var r=this;e.on("end",function(){c("wrapped end");if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)r.push(e)}r.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=r.push(i);if(!a){n=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,r.emit.bind(r,t))});r._read=function(t){c("wrapped _read",t);if(n){n=false;e.resume()}};return r};l._fromList=T;function T(e,t){var n=t.buffer;var r=t.length;var a=!!t.decoder;var o=!!t.objectMode;var s;if(n.length===0)return null;if(r===0)s=null;else if(o)s=n.shift();else if(!e||e>=r){if(a)s=n.join("");else s=i.concat(n,r);n.length=0}else{if(e<n[0].length){var f=n[0];s=f.slice(0,e);n[0]=f.slice(e)}else if(e===n[0].length){s=n.shift()}else{if(a)s="";else s=new i(e);var c=0;for(var u=0,l=n.length;u<l&&c<e;u++){var f=n[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)n[0]=f.slice(d);else n.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;n.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function L(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}}function C(e,t){for(var n=0,r=e.length;n<r;n++){if(e[n]===t)return n}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,n){t.exports=s;var r=e("./_stream_duplex");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(s,r);function a(e,t){this.afterTransform=function(e,n){return o(t,e,n)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function o(e,t,n){var r=e._transformState;r.transforming=false;var a=r.writecb;if(!a)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null;r.writecb=null;if(!i.isNullOrUndefined(n))e.push(n);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);r.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 r.prototype.push.call(this,e,t)};s.prototype._transform=function(e,t,n){throw new Error("not implemented")};s.prototype._write=function(e,t,n){var r=this._transformState;r.writecb=n;r.writechunk=e;r.writeencoding=t;if(!r.transforming){var i=this._readableState;if(r.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 n=e._writableState;var r=e._transformState;if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.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,n){(function(n){t.exports=f;var r=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,n){this.chunk=e;this.encoding=t;this.callback=n}function s(t,n){var r=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(n instanceof r)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(n,e)};this.writecb=null;this.writelen=0;this.buffer=[];this.pendingcb=0;this.prefinished=false;this.errorEmitted=false}function f(t){var n=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof n))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,r){var i=new Error("write after end");e.emit("error",i);n.nextTick(function(){r(i)})}function u(e,t,r,a){var o=true;if(!i.isBuffer(r)&&!i.isString(r)&&!i.isNullOrUndefined(r)&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s);n.nextTick(function(){a(s)});o=false}return o}f.prototype.write=function(e,t,n){var r=this._writableState;var a=false;if(i.isFunction(t)){n=t;t=null}if(i.isBuffer(e))t="buffer";else if(!t)t=r.defaultEncoding;if(!i.isFunction(n))n=function(){};if(r.ended)c(this,r,n);else if(u(this,r,e,n)){r.pendingcb++;a=d(this,r,e,t,n)}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 l(e,t,n){if(!e.objectMode&&e.decodeStrings!==false&&i.isString(t)){t=new r(t,n)}return t}function d(e,t,n,r,a){n=l(t,n,r);if(i.isBuffer(n))r="buffer";var s=t.objectMode?1:n.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(n,r,a));else p(e,t,false,s,n,r,a);return f}function p(e,t,n,r,i,a,o){t.writelen=r;t.writecb=o;t.writing=true;t.sync=true;if(n)e._writev(i,t.onwrite);else e._write(i,a,t.onwrite);t.sync=false}function h(e,t,r,i,a){if(r)n.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 r=e._writableState;var i=r.sync;var a=r.writecb;v(r);if(t)h(e,r,i,t,a);else{var o=b(e,r);if(!o&&!r.corked&&!r.bufferProcessing&&r.buffer.length){w(e,r)}if(i){n.nextTick(function(){g(e,r,o,a)})}else{g(e,r,o,a)}}}function g(e,t,n,r){if(!n)_(e,t);t.pendingcb--;r();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 n=[];for(var r=0;r<t.buffer.length;r++)n.push(t.buffer[r].callback);t.pendingcb++;p(e,t,true,t.length,t.buffer,"",function(e){for(var r=0;r<n.length;r++){t.pendingcb--;n[r](e)}});t.buffer=[]}else{for(var r=0;r<t.buffer.length;r++){var i=t.buffer[r];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){r++;break}}if(r<t.buffer.length)t.buffer=t.buffer.slice(r);else t.buffer.length=0}t.bufferProcessing=false}f.prototype._write=function(e,t,n){n(new Error("not implemented"))};f.prototype._writev=null;f.prototype.end=function(e,t,n){var r=this._writableState;if(i.isFunction(e)){n=e;e=null;t=null}else if(i.isFunction(t)){n=t;t=null}if(!i.isNullOrUndefined(e))this.write(e,t);if(r.corked){r.corked=1;this.uncork()}if(!r.ending&&!r.finished)k(this,r,n)};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 n=b(e,t);if(n){if(t.pendingcb===0){y(e,t);t.finished=true;e.emit("finish")}else y(e,t)}return n}function k(e,t,r){t.ending=true;x(e,t);if(r){if(t.finished)n.nextTick(r);else e.once("finish",r)}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,n){(function(e){function t(e){return Array.isArray(e)}n.isArray=t;function r(e){return typeof e==="boolean"}n.isBoolean=r;function i(e){return e===null}n.isNull=i;function a(e){return e==null}n.isNullOrUndefined=a;function o(e){return typeof e==="number"}n.isNumber=o;function s(e){return typeof e==="string"}n.isString=s;function f(e){return typeof e==="symbol"}n.isSymbol=f;function c(e){return e===void 0}n.isUndefined=c;function u(e){return l(e)&&g(e)==="[object RegExp]"}n.isRegExp=u;function l(e){return typeof e==="object"&&e!==null}n.isObject=l;function d(e){return l(e)&&g(e)==="[object Date]"}n.isDate=d;function p(e){return l(e)&&(g(e)==="[object Error]"||e instanceof Error)}n.isError=p;function h(e){return typeof e==="function"}n.isFunction=h;function v(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}n.isPrimitive=v;function m(t){return e.isBuffer(t)}n.isBuffer=m;function g(e){return Object.prototype.toString.call(e)}}).call(this,e("buffer").Buffer)},{buffer:65}],46:[function(e,t,n){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,n){var r=e("buffer").Buffer;var i=r.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=n.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 r(6);this.charReceived=0;this.charLength=0};o.prototype.write=function(e){var t="";while(this.charLength){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,n);this.charReceived+=n;if(this.charReceived<this.charLength){return""}e=e.slice(n,e.length);t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=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 r=t.charCodeAt(i);if(r>=55296&&r<=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 n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>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 n=this.charReceived;var r=this.charBuffer;var i=this.encoding;t+=r.slice(0,n).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,n){n=t.exports=e("./lib/_stream_readable.js");n.Stream=e("stream");n.Readable=n;n.Writable=e("./lib/_stream_writable.js");n.Duplex=e("./lib/_stream_duplex.js");n.Transform=e("./lib/_stream_transform.js");n.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,n){},{}],50:[function(e,t,n){var r=e("util/");var i=Array.prototype.slice;var a=Object.prototype.hasOwnProperty;var o=t.exports=l;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||u;if(Error.captureStackTrace){Error.captureStackTrace(this,t)}else{var n=new Error;if(n.stack){var r=n.stack;var i=t.name;var a=r.indexOf("\n"+i);if(a>=0){var o=r.indexOf("\n",a+1);r=r.substring(o+1)}this.stack=r}}};r.inherits(o.AssertionError,Error);function s(e,t){if(r.isUndefined(t)){return""+t}if(r.isNumber(t)&&!isFinite(t)){return t.toString()}if(r.isFunction(t)||r.isRegExp(t)){return t.toString()}return t}function f(e,t){if(r.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 u(e,t,n,r,i){throw new o.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}o.fail=u;function l(e,t){if(!e)u(e,true,t,"==",o.ok)}o.ok=l;o.equal=function w(e,t,n){if(e!=t)u(e,t,n,"==",o.equal)};o.notEqual=function b(e,t,n){if(e==t){u(e,t,n,"!=",o.notEqual)}};o.deepEqual=function y(e,t,n){if(!d(e,t)){u(e,t,n,"deepEqual",o.deepEqual)}};function d(e,t){if(e===t){return true}else if(r.isBuffer(e)&&r.isBuffer(t)){if(e.length!=t.length)return false;for(var n=0;n<e.length;n++){if(e[n]!==t[n])return false}return true}else if(r.isDate(e)&&r.isDate(t)){return e.getTime()===t.getTime()}else if(r.isRegExp(e)&&r.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(!r.isObject(e)&&!r.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(r.isNullOrUndefined(e)||r.isNullOrUndefined(t))return false;if(e.prototype!==t.prototype)return false;if(r.isPrimitive(e)||r.isPrimitive(t)){return e===t}var n=p(e),a=p(t);if(n&&!a||!n&&a)return false;if(n){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,n){if(d(e,t)){u(e,t,n,"notDeepEqual",o.notDeepEqual)}};o.strictEqual=function k(e,t,n){if(e!==t){u(e,t,n,"===",o.strictEqual)}};o.notStrictEqual=function E(e,t,n){if(e===t){u(e,t,n,"!==",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,n,i){var a;if(r.isString(n)){i=n;n=null}try{t()}catch(o){a=o}i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:".");if(e&&!a){u(a,n,"Missing expected exception"+i)}if(!e&&v(a,n)){u(a,n,"Got unwanted exception"+i)}if(e&&a&&n&&!v(a,n)||!e&&a){throw a}}o.throws=function(e,t,n){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 n in e){if(a.call(e,n))t.push(n)}return t}},{"util/":97}],51:[function(e,t,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],52:[function(e,t,n){"use strict";var r=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";n.assign=function(e){var t=Array.prototype.slice.call(arguments,1);while(t.length){var n=t.shift();if(!n){continue}if(typeof n!=="object"){throw new TypeError(n+"must be non-object")}for(var r in n){if(n.hasOwnProperty(r)){e[r]=n[r]}}}return e};n.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,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++){e[i+a]=t[n+a]}},flattenChunks:function(e){var t,n,r,i,a,o;r=0;for(t=0,n=e.length;t<n;t++){r+=e[t].length}o=new Uint8Array(r);i=0;for(t=0,n=e.length;t<n;t++){a=e[t];o.set(a,i);i+=a.length}return o}};var a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++){e[i+a]=t[n+a]}},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){if(e){n.Buf8=Uint8Array;n.Buf16=Uint16Array;n.Buf32=Int32Array;n.assign(n,i)}else{n.Buf8=Array;n.Buf16=Array;n.Buf32=Array;n.assign(n,a)}};n.setTyped(r)},{}],53:[function(e,t,n){"use strict";function r(e,t,n,r){var i=e&65535|0,a=e>>>16&65535|0,o=0;while(n!==0){o=n>2e3?2e3:n;n-=o;do{i=i+t[r++]|0;a=a+i|0}while(--o);i%=65521;a%=65521}return i|a<<16|0}t.exports=r},{}],54:[function(e,t,n){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,n){"use strict";function r(){var e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++){e=e&1?3988292384^e>>>1:e>>>1}t[n]=e}return t}var i=r();function a(e,t,n,r){var a=i,o=r+n;e=e^-1;for(var s=r;s<o;s++){e=e>>>8^a[(e^t[s])&255]}return e^-1}t.exports=a},{}],56:[function(e,t,n){"use strict";var r=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 u=3;var l=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 n=t.pending;if(n>e.avail_out){n=e.avail_out}if(n===0){return}r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out);e.next_out+=n;t.pending_out+=n;e.total_out+=n;e.avail_out-=n;t.pending-=n;if(t.pending===0){t.pending_out=0}}function ne(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 re(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,n,i){var s=e.avail_in;if(s>i){s=i}if(s===0){return 0}e.avail_in-=s;r.arraySet(t,e.input,e.next_in,s,n);if(e.state.wrap===1){e.adler=a(e.adler,t,s,n)}else if(e.state.wrap===2){e.adler=o(e.adler,t,s,n)}e.next_in+=s;e.total_in+=s;return s}function oe(e,t){var n=e.max_chain_length;var r=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 u=e.w_mask;var l=e.prev;var d=e.strstart+U;var p=c[r+o-1];var h=c[r+o];if(e.prev_length>=e.good_match){n>>=2}if(s>e.lookahead){s=e.lookahead}do{i=t;if(c[i+o]!==h||c[i+o-1]!==p||c[i]!==c[r]||c[++i]!==c[r+1]){continue}r+=2;i++;do{}while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<d);
-a=U-(d-r);r=d-U;if(a>o){e.match_start=t;o=a;if(a>=s){break}p=c[r+o-1];h=c[r+o]}}while((t=l[t&u])>f&&--n!==0);if(o<=e.lookahead){return o}return e.lookahead}function se(e){var t=e.w_size;var n,i,a,o,s;do{o=e.window_size-e.lookahead-e.strstart;if(e.strstart>=t+(t-P)){r.arraySet(e.window,e.window,t,t,0);e.match_start-=t;e.strstart-=t;e.block_start-=t;i=e.hash_size;n=i;do{a=e.head[--n];e.head[n]=a>=t?a-t:0}while(--i);i=t;n=i;do{a=e.prev[--n];e.prev[n]=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 n=65535;if(n>e.pending_buf_size-5){n=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 r=e.block_start+n;if(e.strstart===0||e.strstart>=r){e.lookahead=e.strstart-r;e.strstart=r;ne(e,false);if(e.strm.avail_out===0){return G}}if(e.strstart-e.block_start>=e.w_size-P){ne(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===l){ne(e,true);if(e.strm.avail_out===0){return K}return $}if(e.strstart>e.block_start){ne(e,false);if(e.strm.avail_out===0){return G}}return G}function ce(e,t){var n;var r;for(;;){if(e.lookahead<P){se(e);if(e.lookahead<P&&t===f){return G}if(e.lookahead===0){break}}n=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}if(n!==0&&e.strstart-n<=e.w_size-P){e.match_length=oe(e,n)}if(e.match_length>=O){r=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;n=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{r=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(r){ne(e,false);if(e.strm.avail_out===0){return G}}}e.insert=e.strstart<O-1?e.strstart:O-1;if(t===l){ne(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){ne(e,false);if(e.strm.avail_out===0){return G}}return V}function ue(e,t){var n;var r;var a;for(;;){if(e.lookahead<P){se(e);if(e.lookahead<P&&t===f){return G}if(e.lookahead===0){break}}n=0;if(e.lookahead>=O){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+O-1])&e.hash_mask;n=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(n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-P){e.match_length=oe(e,n);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;r=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;n=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(r){ne(e,false);if(e.strm.avail_out===0){return G}}}else if(e.match_available){r=i._tr_tally(e,0,e.window[e.strstart-1]);if(r){ne(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){r=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===l){ne(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){ne(e,false);if(e.strm.avail_out===0){return G}}return V}function le(e,t){var n;var r;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;r=s[a];if(r===s[++a]&&r===s[++a]&&r===s[++a]){o=e.strstart+U;do{}while(r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===s[++a]&&r===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){n=i._tr_tally(e,1,e.match_length-O);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{n=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(n){ne(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===l){ne(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){ne(e,false);if(e.strm.avail_out===0){return G}}return V}function de(e,t){var n;for(;;){if(e.lookahead===0){se(e);if(e.lookahead===0){if(t===f){return G}break}}e.match_length=0;n=i._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(n){ne(e,false);if(e.strm.avail_out===0){return G}}}e.insert=0;if(t===l){ne(e,true);if(e.strm.avail_out===0){return K}return $}if(e.last_lit){ne(e,false);if(e.strm.avail_out===0){return G}}return V}var pe=function(e,t,n,r,i){this.good_length=e;this.max_lazy=t;this.nice_length=n;this.max_chain=r;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,ue),new pe(8,16,32,32,ue),new pe(8,16,128,128,ue),new pe(8,32,128,256,ue),new pe(32,128,258,1024,ue),new pe(32,258,258,4096,ue)];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 r.Buf16(z*2);this.dyn_dtree=new r.Buf16((2*B+1)*2);this.bl_tree=new r.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 r.Buf16(M+1);this.heap=new r.Buf16(2*R+1);ee(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new r.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,n,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||n!==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 r.Buf8(f.w_size*2);f.head=new r.Buf16(f.hash_size);f.prev=new r.Buf16(f.w_size);f.lit_bufsize=1<<a+6;f.pending_buf_size=f.lit_bufsize*4;f.pending_buf=new r.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=n;return _e(e)}function ye(e,t){return be(e,t,S,T,I,k)}function xe(e,t){var n,r;var a,s;if(!e||!e.state||t>d||t<0){return e?J(e,v):v}r=e.state;if(!e.output||!e.input&&e.avail_in!==0||r.status===Y&&t!==l){return J(e,e.avail_out===0?g:v)}r.strm=e;n=r.last_flush;r.last_flush=t;if(r.status===D){if(r.wrap===2){e.adler=0;re(r,31);re(r,139);re(r,8);if(!r.gzhead){re(r,0);re(r,0);re(r,0);re(r,0);re(r,0);re(r,r.level===9?2:r.strategy>=b||r.level<2?4:0);re(r,X);r.status=Z}else{re(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(!r.gzhead.extra?0:4)+(!r.gzhead.name?0:8)+(!r.gzhead.comment?0:16));re(r,r.gzhead.time&255);re(r,r.gzhead.time>>8&255);re(r,r.gzhead.time>>16&255);re(r,r.gzhead.time>>24&255);re(r,r.level===9?2:r.strategy>=b||r.level<2?4:0);re(r,r.gzhead.os&255);if(r.gzhead.extra&&r.gzhead.extra.length){re(r,r.gzhead.extra.length&255);re(r,r.gzhead.extra.length>>8&255)}if(r.gzhead.hcrc){e.adler=o(e.adler,r.pending_buf,r.pending,0)}r.gzindex=0;r.status=H}}else{var m=S+(r.w_bits-8<<4)<<8;var _=-1;if(r.strategy>=b||r.level<2){_=0}else if(r.level<6){_=1}else if(r.level===6){_=2}else{_=3}m|=_<<6;if(r.strstart!==0){m|=N}m+=31-m%31;r.status=Z;ie(r,m);if(r.strstart!==0){ie(r,e.adler>>>16);ie(r,e.adler&65535)}e.adler=1}}if(r.status===H){if(r.gzhead.extra){a=r.pending;while(r.gzindex<(r.gzhead.extra.length&65535)){if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}te(e);a=r.pending;if(r.pending===r.pending_buf_size){break}}re(r,r.gzhead.extra[r.gzindex]&255);r.gzindex++}if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}if(r.gzindex===r.gzhead.extra.length){r.gzindex=0;r.status=q}}else{r.status=q}}if(r.status===q){if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}te(e);a=r.pending;if(r.pending===r.pending_buf_size){s=1;break}}if(r.gzindex<r.gzhead.name.length){s=r.gzhead.name.charCodeAt(r.gzindex++)&255}else{s=0}re(r,s)}while(s!==0);if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}if(s===0){r.gzindex=0;r.status=F}}else{r.status=F}}if(r.status===F){if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}te(e);a=r.pending;if(r.pending===r.pending_buf_size){s=1;break}}if(r.gzindex<r.gzhead.comment.length){s=r.gzhead.comment.charCodeAt(r.gzindex++)&255}else{s=0}re(r,s)}while(s!==0);if(r.gzhead.hcrc&&r.pending>a){e.adler=o(e.adler,r.pending_buf,r.pending-a,a)}if(s===0){r.status=W}}else{r.status=W}}if(r.status===W){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size){te(e)}if(r.pending+2<=r.pending_buf_size){re(r,e.adler&255);re(r,e.adler>>8&255);e.adler=0;r.status=Z}}else{r.status=Z}}if(r.pending!==0){te(e);if(e.avail_out===0){r.last_flush=-1;return p}}else if(e.avail_in===0&&Q(t)<=Q(n)&&t!==l){return J(e,g)}if(r.status===Y&&e.avail_in!==0){return J(e,g)}if(e.avail_in!==0||r.lookahead!==0||t!==f&&r.status!==Y){var w=r.strategy===b?de(r,t):r.strategy===y?le(r,t):he[r.level].func(r,t);if(w===K||w===$){r.status=Y}if(w===G||w===K){if(e.avail_out===0){r.last_flush=-1}return p}if(w===V){if(t===c){i._tr_align(r)}else if(t!==d){i._tr_stored_block(r,0,0,false);if(t===u){ee(r.head);if(r.lookahead===0){r.strstart=0;r.block_start=0;r.insert=0}}}te(e);if(e.avail_out===0){r.last_flush=-1;return p}}}if(t!==l){return p}if(r.wrap<=0){return h}if(r.wrap===2){re(r,e.adler&255);re(r,e.adler>>8&255);re(r,e.adler>>16&255);re(r,e.adler>>24&255);re(r,e.total_in&255);re(r,e.total_in>>8&255);re(r,e.total_in>>16&255);re(r,e.total_in>>24&255)}else{ie(r,e.adler>>>16);ie(r,e.adler&65535)}te(e);if(r.wrap>0){r.wrap=-r.wrap}return r.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}n.deflateInit=ye;n.deflateInit2=be;n.deflateReset=_e;n.deflateResetKeep=ge;n.deflateSetHeader=we;n.deflate=xe;n.deflateEnd=ke;n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":52,"./adler32":53,"./crc32":55,"./messages":60,"./trees":61}],57:[function(e,t,n){"use strict";var r=30;var i=12;t.exports=function a(e,t){var n;var a;var o;var s;var f;var c;var u;var l;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;n=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);u=n.dmax;l=n.wsize;d=n.whave;p=n.wnext;h=n.window;v=n.hold;m=n.bits;g=n.lencode;_=n.distcode;w=(1<<n.lenbits)-1;b=(1<<n.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];n: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>u){e.msg="invalid distance too far back";n.mode=r;break e}v>>>=x;m-=x;x=s-f;if(E>x){x=E-x;if(x>d){if(n.sane){e.msg="invalid distance too far back";n.mode=r;break e}}S=0;A=h;if(p===0){S+=l-x;if(x<k){k-=x;do{I[s++]=h[S++]}while(--x);S=s-E;A=I}}else if(p<x){S+=l+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 n}else{e.msg="invalid distance code";n.mode=r;break e}break}}else if((x&64)===0){y=g[(y&65535)+(v&(1<<x)-1)];continue t}else if(x&32){n.mode=i;break e}else{e.msg="invalid literal/length code";n.mode=r;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);n.hold=v;n.bits=m;return}},{}],58:[function(e,t,n){"use strict";var r=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 u=2;var l=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 ne=15;var re=ne;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 r.Buf16(320);this.work=new r.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 r.Buf32(ee);t.distcode=t.distdyn=new r.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 n;var r;if(!e||!e.state){return g}r=e.state;if(t<0){n=0;t=-t}else{n=(t>>4)+1;if(t<48){t&=15}}if(t&&(t<8||t>15)){return g}if(r.window!==null&&r.wbits!==t){r.window=null}r.wrap=n;r.wbits=t;return se(e)}function ce(e,t){var n;var r;if(!e){return g}r=new ae;e.state=r;r.window=null;n=fe(e,t);if(n!==h){e.state=null}return n}function ue(e){return ce(e,re)}var le=true;var de,pe;function he(e){if(le){var t;de=new r.Buf32(512);pe=new r.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(u,e.lens,0,32,pe,0,e.work,{bits:5});le=false}e.lencode=de;e.lenbits=9;e.distcode=pe;e.distbits=5}function ve(e,t,n,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 r.Buf8(o.wsize)}if(i>=o.wsize){r.arraySet(o.window,t,n-o.wsize,o.wsize,0);o.wnext=0;o.whave=o.wsize}else{a=o.wsize-o.wnext;if(a>i){a=i}r.arraySet(o.window,t,n-i,a,o.wnext);i-=a;if(i){r.arraySet(o.window,t,n-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 n;var ee,te;var ne;var re;var ae,oe;var se;var fe;var ce,ue;var le;var de;var pe;var me=0;var ge,_e,we;var be,ye,xe;var ke;var Ee;var Se=new r.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}n=e.state;if(n.mode===j){n.mode=z}re=e.next_out;te=e.output;oe=e.avail_out;ne=e.next_in;ee=e.input;ae=e.avail_in;se=n.hold;fe=n.bits;ce=ae;ue=oe;Ee=h;e:for(;;){switch(n.mode){case x:if(n.wrap===0){n.mode=z;break}while(fe<16){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(n.wrap&2&&se===35615){n.check=0;Se[0]=se&255;Se[1]=se>>>8&255;n.check=a(n.check,Se,2,0);se=0;fe=0;n.mode=k;break}n.flags=0;if(n.head){n.head.done=false}if(!(n.wrap&1)||(((se&255)<<8)+(se>>8))%31){e.msg="incorrect header check";n.mode=X;break}if((se&15)!==y){e.msg="unknown compression method";n.mode=X;break}se>>>=4;fe-=4;ke=(se&15)+8;if(n.wbits===0){n.wbits=ke}else if(ke>n.wbits){e.msg="invalid window size";n.mode=X;break}n.dmax=1<<ke;e.adler=n.check=1;n.mode=se&512?R:j;se=0;fe=0;break;case k:while(fe<16){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.flags=se;if((n.flags&255)!==y){e.msg="unknown compression method";n.mode=X;break}if(n.flags&57344){e.msg="unknown header flags set";n.mode=X;break}if(n.head){n.head.text=se>>8&1}if(n.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;n.check=a(n.check,Se,2,0)}se=0;fe=0;n.mode=E;case E:while(fe<32){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(n.head){n.head.time=se}if(n.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;Se[2]=se>>>16&255;Se[3]=se>>>24&255;n.check=a(n.check,Se,4,0)}se=0;fe=0;n.mode=S;case S:while(fe<16){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(n.head){n.head.xflags=se&255;n.head.os=se>>8}if(n.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;n.check=a(n.check,Se,2,0)}se=0;fe=0;n.mode=A;case A:if(n.flags&1024){while(fe<16){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.length=se;if(n.head){n.head.extra_len=se}if(n.flags&512){Se[0]=se&255;Se[1]=se>>>8&255;n.check=a(n.check,Se,2,0)}se=0;fe=0}else if(n.head){n.head.extra=null}n.mode=T;case T:if(n.flags&1024){le=n.length;if(le>ae){le=ae}if(le){if(n.head){ke=n.head.extra_len-n.length;if(!n.head.extra){n.head.extra=new Array(n.head.extra_len)}r.arraySet(n.head.extra,ee,ne,le,ke)}if(n.flags&512){n.check=a(n.check,ee,le,ne)}ae-=le;ne+=le;n.length-=le}if(n.length){break e}}n.length=0;n.mode=I;case I:if(n.flags&2048){if(ae===0){break e}le=0;do{ke=ee[ne+le++];if(n.head&&ke&&n.length<65536){n.head.name+=String.fromCharCode(ke)}}while(ke&&le<ae);if(n.flags&512){n.check=a(n.check,ee,le,ne)}ae-=le;ne+=le;if(ke){break e}}else if(n.head){n.head.name=null}n.length=0;n.mode=L;case L:if(n.flags&4096){if(ae===0){break e}le=0;do{ke=ee[ne+le++];if(n.head&&ke&&n.length<65536){n.head.comment+=String.fromCharCode(ke)}}while(ke&&le<ae);if(n.flags&512){n.check=a(n.check,ee,le,ne)}ae-=le;ne+=le;if(ke){break e}}else if(n.head){n.head.comment=null}n.mode=C;case C:if(n.flags&512){while(fe<16){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(se!==(n.check&65535)){e.msg="header crc mismatch";n.mode=X;break}se=0;fe=0}if(n.head){n.head.hcrc=n.flags>>9&1;n.head.done=true}e.adler=n.check=0;n.mode=j;break;case R:while(fe<32){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}e.adler=n.check=ie(se);se=0;fe=0;n.mode=B;case B:if(n.havedict===0){e.next_out=re;e.avail_out=oe;e.next_in=ne;e.avail_in=ae;n.hold=se;n.bits=fe;return m}e.adler=n.check=1;n.mode=j;case j:if(t===d||t===p){break e}case z:if(n.last){se>>>=fe&7;fe-=fe&7;n.mode=V;break}while(fe<3){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.last=se&1;se>>>=1;fe-=1;switch(se&3){case 0:n.mode=M;break;case 1:he(n);n.mode=H;if(t===p){se>>>=2;fe-=2;break e}break;case 2:n.mode=P;break;case 3:e.msg="invalid block type";n.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[ne++]<<fe;fe+=8}if((se&65535)!==(se>>>16^65535)){e.msg="invalid stored block lengths";n.mode=X;break}n.length=se&65535;se=0;fe=0;n.mode=O;if(t===p){break e}case O:n.mode=U;case U:le=n.length;if(le){if(le>ae){le=ae}if(le>oe){le=oe}if(le===0){break e}r.arraySet(te,ee,ne,le,re);ae-=le;ne+=le;oe-=le;re+=le;n.length-=le;break}n.mode=j;break;case P:while(fe<14){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.nlen=(se&31)+257;se>>>=5;fe-=5;n.ndist=(se&31)+1;se>>>=5;fe-=5;n.ncode=(se&15)+4;se>>>=4;fe-=4;if(n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols";n.mode=X;break}n.have=0;n.mode=N;case N:while(n.have<n.ncode){while(fe<3){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.lens[Ie[n.have++]]=se&7;se>>>=3;fe-=3}while(n.have<19){n.lens[Ie[n.have++]]=0}n.lencode=n.lendyn;n.lenbits=7;Ae={bits:n.lenbits};Ee=s(f,n.lens,0,19,n.lencode,0,n.work,Ae);n.lenbits=Ae.bits;if(Ee){e.msg="invalid code lengths set";n.mode=X;break}n.have=0;n.mode=D;case D:while(n.have<n.nlen+n.ndist){for(;;){me=n.lencode[se&(1<<n.lenbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(we<16){se>>>=ge;fe-=ge;n.lens[n.have++]=we}else{if(we===16){Te=ge+2;while(fe<Te){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}se>>>=ge;fe-=ge;if(n.have===0){e.msg="invalid bit length repeat";n.mode=X;break}ke=n.lens[n.have-1];le=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[ne++]<<fe;fe+=8}se>>>=ge;fe-=ge;ke=0;le=3+(se&7);se>>>=3;fe-=3}else{Te=ge+7;while(fe<Te){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}se>>>=ge;fe-=ge;ke=0;le=11+(se&127);se>>>=7;fe-=7}if(n.have+le>n.nlen+n.ndist){e.msg="invalid bit length repeat";n.mode=X;break}while(le--){n.lens[n.have++]=ke}}}if(n.mode===X){break}if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block";n.mode=X;break}n.lenbits=9;Ae={bits:n.lenbits};Ee=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,Ae);n.lenbits=Ae.bits;if(Ee){e.msg="invalid literal/lengths set";n.mode=X;break}n.distbits=6;n.distcode=n.distdyn;Ae={bits:n.distbits};Ee=s(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ae);n.distbits=Ae.bits;if(Ee){e.msg="invalid distances set";n.mode=X;break}n.mode=H;if(t===p){break e}case H:n.mode=q;case q:if(ae>=6&&oe>=258){e.next_out=re;e.avail_out=oe;e.next_in=ne;e.avail_in=ae;n.hold=se;n.bits=fe;o(e,ue);re=e.next_out;te=e.output;oe=e.avail_out;ne=e.next_in;ee=e.input;ae=e.avail_in;se=n.hold;fe=n.bits;if(n.mode===j){n.back=-1}break}n.back=0;for(;;){me=n.lencode[se&(1<<n.lenbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(_e&&(_e&240)===0){be=ge;ye=_e;xe=we;for(;;){me=n.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[ne++]<<fe;fe+=8}se>>>=be;fe-=be;n.back+=be}se>>>=ge;fe-=ge;n.back+=ge;n.length=we;if(_e===0){n.mode=G;break}if(_e&32){n.back=-1;n.mode=j;break}if(_e&64){e.msg="invalid literal/length code";n.mode=X;break}n.extra=_e&15;n.mode=F;case F:if(n.extra){Te=n.extra;while(fe<Te){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.length+=se&(1<<n.extra)-1;se>>>=n.extra;fe-=n.extra;n.back+=n.extra}n.was=n.length;n.mode=W;case W:for(;;){me=n.distcode[se&(1<<n.distbits)-1];ge=me>>>24;_e=me>>>16&255;we=me&65535;if(ge<=fe){break}if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if((_e&240)===0){be=ge;ye=_e;xe=we;for(;;){me=n.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[ne++]<<fe;fe+=8}se>>>=be;fe-=be;n.back+=be}se>>>=ge;fe-=ge;n.back+=ge;if(_e&64){e.msg="invalid distance code";n.mode=X;break}n.offset=we;n.extra=_e&15;n.mode=Z;case Z:if(n.extra){Te=n.extra;while(fe<Te){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}n.offset+=se&(1<<n.extra)-1;se>>>=n.extra;fe-=n.extra;n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back";n.mode=X;break}n.mode=Y;case Y:if(oe===0){break e}le=ue-oe;if(n.offset>le){le=n.offset-le;if(le>n.whave){if(n.sane){e.msg="invalid distance too far back";n.mode=X;break}}if(le>n.wnext){le-=n.wnext;de=n.wsize-le}else{de=n.wnext-le}if(le>n.length){le=n.length}pe=n.window}else{pe=te;de=re-n.offset;le=n.length}if(le>oe){le=oe}oe-=le;n.length-=le;do{te[re++]=pe[de++]}while(--le);if(n.length===0){n.mode=q}break;case G:if(oe===0){break e}te[re++]=n.length;oe--;n.mode=q;break;case V:if(n.wrap){while(fe<32){if(ae===0){break e}ae--;se|=ee[ne++]<<fe;fe+=8}ue-=oe;e.total_out+=ue;n.total+=ue;if(ue){e.adler=n.check=n.flags?a(n.check,te,ue,re-ue):i(n.check,te,ue,re-ue)}ue=oe;if((n.flags?se:ie(se))!==n.check){e.msg="incorrect data check";n.mode=X;break}se=0;fe=0}n.mode=K;case K:if(n.wrap&&n.flags){while(fe<32){if(ae===0){break e}ae--;se+=ee[ne++]<<fe;fe+=8}if(se!==(n.total&4294967295)){e.msg="incorrect length check";n.mode=X;break}se=0;fe=0}n.mode=$;case $:Ee=v;break e;case X:Ee=_;break e;case J:return w;case Q:default:return g}}e.next_out=re;e.avail_out=oe;e.next_in=ne;e.avail_in=ae;n.hold=se;n.bits=fe;if(n.wsize||ue!==e.avail_out&&n.mode<X&&(n.mode<V||t!==l)){if(ve(e,e.output,e.next_out,ue-e.avail_out)){n.mode=J;return w}}ce-=e.avail_in;ue-=e.avail_out;e.total_in+=ce;e.total_out+=ue;n.total+=ue;if(n.wrap&&ue){e.adler=n.check=n.flags?a(n.check,te,ue,e.next_out-ue):i(n.check,te,ue,e.next_out-ue)}e.data_type=n.bits+(n.last?64:0)+(n.mode===j?128:0)+(n.mode===H||n.mode===O?256:0);if((ce===0&&ue===0||t===l)&&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 n;if(!e||!e.state){return g}n=e.state;if((n.wrap&2)===0){return g}n.head=t;t.done=false;return h}n.inflateReset=se;n.inflateReset2=fe;n.inflateResetKeep=oe;n.inflateInit=ue;n.inflateInit2=ce;n.inflate=me;n.inflateEnd=ge;n.inflateGetHeader=_e;n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":52,"./adler32":53,"./crc32":55,"./inffast":57,"./inftrees":59}],59:[function(e,t,n){"use strict";var r=e("../utils/common");var i=15;var a=852;var o=592;var s=0;var f=1;var c=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 l=[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,n,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 r.Buf16(i+1);var D=new r.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[n+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[n+x]!==0){_[D[t[n+x]]++]=x}}if(e===s){O=H=_;P=19}else if(e===f){O=u;U-=257;H=l;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[n+_[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,n){"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,n){"use strict";var r=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 u=1;var l=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,n,r,i){this.static_tree=e;this.extra_bits=t;this.extra_base=n;this.elems=r;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,n){if(e.bi_valid>y-n){e.bi_buf|=t<<e.bi_valid&65535;W(e,e.bi_buf);e.bi_buf=t>>y-e.bi_valid;e.bi_valid+=n-y}else{e.bi_buf|=t<<e.bi_valid&65535;e.bi_valid+=n}}function Y(e,t,n){Z(e,n[t*2],n[t*2+1])}function G(e,t){var n=0;do{n|=e&1;e>>>=1;n<<=1}while(--t>0);return n>>>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 n=t.dyn_tree;var r=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 u,l;var d;var p;var h;var v=0;for(d=0;d<=b;d++){e.bl_count[d]=0}n[e.heap[e.heap_max]*2+1]=0;for(c=e.heap_max+1;c<w;c++){u=e.heap[c];d=n[n[u*2+1]*2+1]+1;if(d>f){d=f;v++}n[u*2+1]=d;if(u>r){continue}e.bl_count[d]++;p=0;if(u>=s){p=o[u-s]}h=n[u*2];e.opt_len+=h*(d+p);if(a){e.static_len+=h*(i[u*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--){u=e.bl_count[d];while(u!==0){l=e.heap[--c];if(l>r){continue}if(n[l*2+1]!==d){e.opt_len+=(d-n[l*2+1])*n[l*2];n[l*2+1]=d}u--}}}function $(e,t,n){var r=new Array(b+1);var i=0;var a;var o;for(a=1;a<=b;a++){r[a]=i=i+n[a-1]<<1}for(o=0;o<=t;o++){var s=e[o*2+1];if(s===0){continue}e[o*2]=G(r[s]++,s)}}function X(){var e;var t;var n;var r;var i;var a=new Array(b+1);n=0;for(r=0;r<h-1;r++){O[r]=n;for(e=0;e<1<<T[r];e++){M[n++]=r}}M[n-1]=r;i=0;for(r=0;r<16;r++){U[r]=i;for(e=0;e<1<<I[r];e++){z[i++]=r}}i>>=7;for(;r<g;r++){U[r]=i<<7;for(e=0;e<1<<I[r]-7;e++){z[256+i++]=r}}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,n,i){Q(e);if(i){W(e,n);W(e,~n)}r.arraySet(e.pending_buf,e.window,t,n,e.pending);e.pending+=n}function te(e,t,n,r){var i=t*2;var a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ne(e,t,n){var r=e.heap[n];var i=n<<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,r,e.heap[i],e.depth)){break}e.heap[n]=e.heap[i];n=i;i<<=1}e.heap[n]=r}function re(e,t,n){var r;var i;var a=0;var o;var s;if(e.last_lit!==0){do{r=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(r===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)}r--;o=F(r);Y(e,o,n);s=I[o];if(s!==0){r-=U[o];Z(e,r,s)}}}while(a<e.last_lit)}Y(e,k,t)}function ie(e,t){var n=t.dyn_tree;var r=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(n[o*2]!==0){e.heap[++e.heap_len]=f=o;e.depth[o]=0}else{n[o*2+1]=0}}while(e.heap_len<2){c=e.heap[++e.heap_len]=f<2?++f:0;n[c*2]=1;e.depth[c]=0;e.opt_len--;if(i){e.static_len-=r[c*2+1]}}t.max_code=f;for(o=e.heap_len>>1;o>=1;o--){ne(e,n,o)}c=a;do{o=e.heap[1];e.heap[1]=e.heap[e.heap_len--];ne(e,n,1);s=e.heap[1];e.heap[--e.heap_max]=o;e.heap[--e.heap_max]=s;n[c*2]=n[o*2]+n[s*2];e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1;n[o*2+1]=n[s*2+1]=c;e.heap[1]=c++;ne(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];K(e,t);$(n,f,e.bl_count)}function ae(e,t,n){var r;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[(n+1)*2+1]=65535;for(r=0;r<=n;r++){a=o;o=t[(r+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,n){var r;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(r=0;r<=n;r++){a=o;o=t[(r+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,n,r){var i;Z(e,t-257,5);Z(e,n-1,5);Z(e,r-4,4);for(i=0;i<r;i++){Z(e,e.bl_tree[C[i]*2+1],3)}oe(e,e.dyn_ltree,t-1);oe(e,e.dyn_dtree,n-1)}function ce(e){var t=4093624447;var n;for(n=0;n<=31;n++,t>>>=1){if(t&1&&e.dyn_ltree[n*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(n=32;n<v;n++){if(e.dyn_ltree[n*2]!==0){return o}}return a}var ue=false;function le(e){if(!ue){X();ue=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,n,r){Z(e,(c<<1)+(r?1:0),3);ee(e,t,n,true)}function pe(e){Z(e,u<<1,3);Y(e,k,B);V(e)}function he(e,t,n,r){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=n+5}if(n+4<=a&&t!==-1){de(e,t,n,r)}else if(e.strategy===i||o===a){Z(e,(u<<1)+(r?1:0),3);re(e,B,j)}else{Z(e,(l<<1)+(r?1:0),3);fe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1);re(e,e.dyn_ltree,e.dyn_dtree)}J(e);if(r){Q(e)}}function ve(e,t,n){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]=n&255;e.last_lit++;if(t===0){e.dyn_ltree[n*2]++}else{e.matches++;t--;e.dyn_ltree[(M[n]+v+1)*2]++;e.dyn_dtree[F(t)*2]++}return e.last_lit===e.lit_bufsize-1}n._tr_init=le;n._tr_stored_block=de;n._tr_flush_block=he;n._tr_tally=ve;n._tr_align=pe},{"../utils/common":52}],62:[function(e,t,n){"use strict";function r(){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=r},{}],63:[function(e,t,n){(function(t,r){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){n[c]=f[c]}n.NONE=0;n.DEFLATE=1;n.INFLATE=2;n.GZIP=3;n.GUNZIP=4;n.DEFLATERAW=5;n.INFLATERAW=6;n.UNZIP=7;function u(e){if(e<n.DEFLATE||e>n.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,r,i,f){this.windowBits=e;this.level=t;this.memLevel=r;this.strategy=i;if(this.mode===n.GZIP||this.mode===n.GUNZIP)this.windowBits+=16;if(this.mode===n.UNZIP)this.windowBits+=32;if(this.mode===n.DEFLATERAW||this.mode===n.INFLATERAW)this.windowBits=-this.windowBits;this.strm=new a;switch(this.mode){case n.DEFLATE:case n.GZIP:case n.DEFLATERAW:var c=o.deflateInit2(this.strm,this.level,n.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case n.INFLATE:case n.GUNZIP:case n.INFLATERAW:case n.UNZIP:var c=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(c!==n.Z_OK){this._error(c);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===n.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,n,r,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,n,r,i,a,o,s);f.callback(t[0],t[1]);if(f.pending_close)f.close()});return this};function l(e,t){for(var n=0;n<e.length;n++){this[t+n]=e[n]}}u.prototype.writeSync=function(e,t,n,r,i,a,o){this._writeCheck();return this._write(e,t,n,r,i,a,o)};u.prototype._write=function(e,t,i,a,f,c,u){this.write_in_progress=true;if(e!==n.Z_NO_FLUSH&&e!==n.Z_PARTIAL_FLUSH&&e!==n.Z_SYNC_FLUSH&&e!==n.Z_FULL_FLUSH&&e!==n.Z_FINISH&&e!==n.Z_BLOCK){throw new Error("Invalid flush value")}if(t==null){t=new r(0);a=0;i=0}if(f._set)f.set=f._set;else f.set=l;var d=this.strm;d.avail_in=a;d.input=t;d.next_in=i;d.avail_out=u;d.output=f;d.next_out=c;switch(this.mode){case n.DEFLATE:case n.GZIP:case n.DEFLATERAW:var p=o.deflate(d,e);break;case n.UNZIP:case n.INFLATE:case n.GUNZIP:case n.INFLATERAW:var p=s.inflate(d,e);break;default:throw new Error("Unknown mode "+this.mode)}if(p!==n.Z_STREAM_END&&p!==n.Z_OK){this._error(p)}this.write_in_progress=false;return[d.avail_in,d.avail_out]};u.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;if(this.mode===n.DEFLATE||this.mode===n.GZIP||this.mode===n.DEFLATERAW){o.deflateEnd(this.strm)}else{s.inflateEnd(this.strm)}this.mode=n.NONE};u.prototype.reset=function(){switch(this.mode){case n.DEFLATE:case n.DEFLATERAW:var e=o.deflateReset(this.strm);break;case n.INFLATE:case n.INFLATERAW:var e=s.inflateReset(this.strm);break}if(e!==n.Z_OK){this._error(e)}};u.prototype._error=function(e){this.onerror(i[e]+": "+this.strm.msg,e);this.write_in_progress=false;if(this.pending_close)this.close()};n.Zlib=u}).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,n){(function(t,r){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/))n[e]=a[e]});n.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(n.codes).forEach(function(e){n.codes[n.codes[e]]=e});n.Deflate=u;n.Inflate=l;n.Gzip=d;n.Gunzip=p;n.DeflateRaw=h;n.InflateRaw=v;n.Unzip=m;n.createDeflate=function(e){return new u(e)};n.createInflate=function(e){return new l(e)};n.createDeflateRaw=function(e){return new h(e)};n.createInflateRaw=function(e){return new v(e)};n.createGzip=function(e){return new d(e)};n.createGunzip=function(e){return new p(e)};n.createUnzip=function(e){return new m(e)};n.deflate=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new u(t),e,n)};n.deflateSync=function(e,t){return c(new u(t),e)};n.gzip=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new d(t),e,n)};n.gzipSync=function(e,t){return c(new d(t),e)};n.deflateRaw=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new h(t),e,n)};n.deflateRawSync=function(e,t){return c(new h(t),e)};n.unzip=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new m(t),e,n)};n.unzipSync=function(e,t){return c(new m(t),e)};n.inflate=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new l(t),e,n)};n.inflateSync=function(e,t){return c(new l(t),e)};n.gunzip=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new p(t),e,n)};n.gunzipSync=function(e,t){return c(new p(t),e)};n.inflateRaw=function(e,t,n){if(typeof t==="function"){n=t;t={}}return f(new v(t),e,n)};n.inflateRawSync=function(e,t){return c(new v(t),e)};function f(e,t,n){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);n(t)}function f(){var t=r.concat(i,a);i=[];n(null,t);e.close()}}function c(e,t){if(typeof t==="string")t=new r(t);if(!r.isBuffer(t))throw new TypeError("Not a string or buffer");var n=a.Z_FINISH;return e._processChunk(t,n)}function u(e){if(!(this instanceof u))return new u(e);g.call(this,e,a.DEFLATE)}function l(e){if(!(this instanceof l))return new l(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||n.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<n.Z_MIN_CHUNK||e.chunkSize>n.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+e.chunkSize)}}if(e.windowBits){if(e.windowBits<n.Z_MIN_WINDOWBITS||e.windowBits>n.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+e.windowBits)}}if(e.level){if(e.level<n.Z_MIN_LEVEL||e.level>n.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+e.level)}}if(e.memLevel){if(e.memLevel<n.Z_MIN_MEMLEVEL||e.memLevel>n.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+e.memLevel)}}if(e.strategy){if(e.strategy!=n.Z_FILTERED&&e.strategy!=n.Z_HUFFMAN_ONLY&&e.strategy!=n.Z_RLE&&e.strategy!=n.Z_FIXED&&e.strategy!=n.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+e.strategy)}}if(e.dictionary){if(!r.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 r=new Error(e);r.errno=t;r.code=n.codes[t];o.emit("error",r)};var s=n.Z_DEFAULT_COMPRESSION;if(typeof e.level==="number")s=e.level;var f=n.Z_DEFAULT_STRATEGY;if(typeof e.strategy==="number")f=e.strategy;this._binding.init(e.windowBits||n.Z_DEFAULT_WINDOWBITS,s,e.memLevel||n.Z_DEFAULT_MEMLEVEL,f,e.dictionary);this._buffer=new r(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,r,i){if(e<n.Z_MIN_LEVEL||e>n.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+e)}if(r!=n.Z_FILTERED&&r!=n.Z_HUFFMAN_ONLY&&r!=n.Z_RLE&&r!=n.Z_FIXED&&r!=n.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+r)}if(this._level!==e||this._strategy!==r){var o=this;this.flush(a.Z_SYNC_FLUSH,function(){o._binding.params(e,r);if(!o._hadError){o._level=e;o._strategy=r;if(i)i()}})}else{t.nextTick(i)}};g.prototype.reset=function(){return this._binding.reset()};g.prototype._flush=function(e){this._transform(new r(0),"",e)};g.prototype.flush=function(e,n){var i=this._writableState;if(typeof e==="function"||e===void 0&&!n){n=e;e=a.Z_FULL_FLUSH}if(i.ended){if(n)t.nextTick(n)}else if(i.ending){if(n)this.once("end",n)}else if(i.needDrain){var o=this;this.once("drain",function(){o.flush(n)})}else{this._flushFlag=e;this.write(new r(0),"",n)}};g.prototype.close=function(e){if(e)t.nextTick(e);if(this._closed)return;this._closed=true;this._binding.close();var n=this;t.nextTick(function(){n.emit("close")})};g.prototype._transform=function(e,t,n){var i;var o=this._writableState;var s=o.ending||o.ended;var f=s&&(!e||o.length===e.length);if(!e===null&&!r.isBuffer(e))return n(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,n)};g.prototype._processChunk=function(e,t,n){var i=e&&e.length;var a=this._chunkSize-this._offset;var o=0;var f=this;var c=typeof n==="function";if(!c){var u=[];var l=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=r.concat(u,l);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{u.push(v);l+=v.length}}if(p===0||f._offset>=f._chunkSize){a=f._chunkSize;f._offset=0;f._buffer=new r(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;n()}};o.inherits(u,g);o.inherits(l,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,n){var r=e("base64-js");var i=e("ieee754");var a=e("is-array");n.Buffer=f;n.SlowBuffer=w;n.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(n){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 u(this,e,arguments.length>1?arguments[1]:"utf8")}return l(this,e)}function c(e,t){e=g(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var n=0;n<t;n++){e[n]=0}}return e}function u(e,t,n){if(typeof n!=="string"||n==="")n="utf8";var r=b(t,n)|0;e=g(e,r);e.write(t,n);return e}function l(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 n=_(t.length)|0;e=g(e,n);t.copy(e,0,0,n);return e}function p(e,t){var n=_(t.length)|0;e=g(e,n);for(var r=0;r<n;r+=1){e[r]=t[r]&255}return e}function h(e,t){var n=_(t.length)|0;e=g(e,n);for(var r=0;r<n;r+=1){e[r]=t[r]&255}return e}function v(e,t){var n=_(t.length)|0;e=g(e,n);for(var r=0;r<n;r+=1){e[r]=t[r]&255}return e}function m(e,t){var n;var r=0;if(t.type==="Buffer"&&a(t.data)){n=t.data;r=_(n.length)|0}e=g(e,r);for(var i=0;i<r;i+=1){e[i]=n[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 n=t!==0&&t<=f.poolSize>>>1;if(n)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 n=new f(e,t);delete n.parent;return n}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 n=e.length;var r=t.length;var i=0;var a=Math.min(n,r);while(i<a){if(e[i]!==t[i])break;++i}if(i!==a){n=e[i];r=t[i]}if(n<r)return-1;if(r<n)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 n;if(t===undefined){t=0;for(n=0;n<e.length;n++){t+=e[n].length}}var r=new f(t);var i=0;for(n=0;n<e.length;n++){var o=e[n];o.copy(r,i);i+=o.length}return r};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,n){var r=false;t=t|0;n=n===undefined||n===Infinity?this.length:n|0;if(!e)e="utf8";if(t<0)t=0;if(n>this.length)n=this.length;if(n<=t)return"";while(true){switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return L(this,t,n);case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();r=true}}};f.prototype.equals=function ne(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 re(){var e="";var t=n.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 n(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 n(this,[e],t)}function n(e,t,n){var r=-1;for(var i=0;n+i<e.length;i++){if(e[n+i]===t[r===-1?0:i-r]){if(r===-1)r=i;if(i-r+1===t.length)return n+r}else{r=-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,n,r){n=Number(n)||0;var i=e.length-n;if(!r){r=i}else{r=Number(r);if(r>i){r=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(r>a/2){r=a/2}for(var o=0;o<r;o++){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[n+o]=s}return o}function x(e,t,n,r){return K(Z(t,e.length-n),e,n,r)}function k(e,t,n,r){return K(Y(t),e,n,r)}function E(e,t,n,r){return k(e,t,n,r)}function S(e,t,n,r){return K(V(t),e,n,r)}function A(e,t,n,r){return K(G(t,e.length-n),e,n,r)}f.prototype.write=function fe(e,t,n,r){if(t===undefined){r="utf8";n=this.length;t=0}else if(n===undefined&&typeof t==="string"){r=t;n=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(n)){n=n|0;if(r===undefined)r="utf8"}else{r=n;n=undefined}}else{var i=r;r=t;t=n|0;n=i}var a=this.length-t;if(n===undefined||n>a)n=a;if(e.length>0&&(n<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!r)r="utf8";var o=false;for(;;){switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return k(this,e,t,n);case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();o=true}}};f.prototype.toJSON=function ce(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){if(t===0&&n===e.length){return r.fromByteArray(e)}else{return r.fromByteArray(e.slice(t,n))}}function I(e,t,n){var r="";var i="";n=Math.min(e.length,n);for(var a=t;a<n;a++){if(e[a]<=127){r+=$(i)+String.fromCharCode(e[a]);i=""}else{i+="%"+e[a].toString(16)}}return r+$(i)}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++){r+=String.fromCharCode(e[i]&127)}return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++){r+=String.fromCharCode(e[i])}return r}function R(e,t,n){var r=e.length;if(!t||t<0)t=0;if(!n||n<0||n>r)n=r;var i="";for(var a=t;a<n;a++){i+=W(e[a])}return i}function B(e,t,n){var r=e.slice(t,n);var i="";for(var a=0;a<r.length;a+=2){i+=String.fromCharCode(r[a]+r[a+1]*256)}return i}f.prototype.slice=function ue(e,t){var n=this.length;e=~~e;t=t===undefined?n:~~t;if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(t<e)t=e;var r;if(f.TYPED_ARRAY_SUPPORT){r=f._augment(this.subarray(e,t))}else{var i=t-e;r=new f(i,undefined);for(var a=0;a<i;a++){r[a]=this[a+e]}}if(r.length)r.parent=this.parent||this;return r};function j(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function le(e,t,n){e=e|0;t=t|0;if(!n)j(e,t,this.length);var r=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){r+=this[e+a]*i}return r};f.prototype.readUIntBE=function de(e,t,n){e=e|0;t=t|0;if(!n){j(e,t,this.length)}var r=this[e+--t];var i=1;while(t>0&&(i*=256)){r+=this[e+--t]*i}return r};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,n){e=e|0;t=t|0;if(!n)j(e,t,this.length);var r=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){r+=this[e+a]*i}i*=128;if(r>=i)r-=Math.pow(2,8*t);return r};f.prototype.readIntBE=function we(e,t,n){e=e|0;t=t|0;if(!n)j(e,t,this.length);var r=t;var i=1;var a=this[e+--r];while(r>0&&(i*=256)){a+=this[e+--r]*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 n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function xe(e,t){if(!t)j(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};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,n,r,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(n+r>e.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,n,r){e=+e;t=t|0;n=n|0;if(!r)z(this,e,t,n,Math.pow(2,8*n),0);var i=1;var a=0;this[t]=e&255;while(++a<n&&(i*=256)){this[t+a]=e/i&255}return t+n};f.prototype.writeUIntBE=function Ce(e,t,n,r){e=+e;t=t|0;n=n|0;if(!r)z(this,e,t,n,Math.pow(2,8*n),0);var i=n-1;var a=1;this[t+i]=e&255;while(--i>=0&&(a*=256)){this[t+i]=e/a&255}return t+n};f.prototype.writeUInt8=function Re(e,t,n){e=+e;t=t|0;if(!n)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,n,r){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-n,2);i<a;i++){e[n+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}}f.prototype.writeUInt16LE=function Be(e,t,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n,r){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-n,4);i<a;i++){e[n+i]=t>>>(r?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);z(this,e,t,n,i-1,-i)}var a=0;var o=1;var s=e<0?1:0;this[t]=e&255;while(++a<n&&(o*=256)){this[t+a]=(e/o>>0)-s&255}return t+n};f.prototype.writeIntBE=function Ue(e,t,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);z(this,e,t,n,i-1,-i)}var a=n-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+n};f.prototype.writeInt8=function Pe(e,t,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n){e=+e;t=t|0;if(!n)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,n,r,i,a){if(t>i||t<a)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function P(e,t,n,r,a){if(!a){U(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,n,r,23,4);return n+4}f.prototype.writeFloatLE=function Fe(e,t,n){return P(this,e,t,true,n)};f.prototype.writeFloatBE=function We(e,t,n){return P(this,e,t,false,n)};function N(e,t,n,r,a){if(!a){U(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,n,r,52,8);return n+8}f.prototype.writeDoubleLE=function Ze(e,t,n){return N(this,e,t,true,n)};f.prototype.writeDoubleBE=function Ye(e,t,n){return N(this,e,t,false,n)};f.prototype.copy=function Ge(e,t,n,r){if(!n)n=0;if(!r&&r!==0)r=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(r>0&&r<n)r=n;if(r===n)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");if(r>this.length)r=this.length;if(e.length-t<r-n){r=e.length-t+n}var i=r-n;if(i<1e3||!f.TYPED_ARRAY_SUPPORT){for(var a=0;a<i;a++){e[a+t]=this[a+n]}}else{e._set(this.subarray(n,n+i),t)}return i};f.prototype.fill=function Ve(e,t,n){if(!e)e=0;if(!t)t=0;if(!n)n=this.length;if(n<t)throw new RangeError("end < start");if(n===t)return;if(this.length===0)return;if(t<0||t>=this.length)throw new RangeError("start out of bounds");if(n<0||n>this.length)throw new RangeError("end out of bounds");var r;if(typeof e==="number"){for(r=t;r<n;r++){this[r]=e}}else{var i=Z(e.toString());var a=i.length;for(r=t;r<n;r++){this[r]=i[r%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,n=e.length;t<n;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 n;var r=e.length;var i=null;var a=[];var o=0;for(;o<r;o++){n=e.charCodeAt(o);if(n>55295&&n<57344){if(i){if(n<56320){if((t-=3)>-1)a.push(239,191,189);i=n;continue}else{n=i-55296<<10|n-56320|65536;i=null}}else{if(n>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(o+1===r){if((t-=3)>-1)a.push(239,191,189);continue}else{i=n;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<2097152){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var n=0;n<e.length;n++){t.push(e.charCodeAt(n)&255)}return t}function G(e,t){var n,r,i;var a=[];for(var o=0;o<e.length;o++){if((t-=2)<0)break;n=e.charCodeAt(o);r=n>>8;i=n%256;a.push(i);a.push(r)}return a}function V(e){return r.toByteArray(q(e))}function K(e,t,n,r){for(var i=0;i<r;i++){if(i+n>=t.length||i>=e.length)break;t[i+n]=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,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var n="+".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 u(e){var t=e.charCodeAt(0);if(t===n||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 l(e){var n,r,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 l(e){s[c++]=e}for(n=0,r=0;n<i;n+=4,r+=3){a=u(e.charAt(n))<<18|u(e.charAt(n+1))<<12|u(e.charAt(n+2))<<6|u(e.charAt(n+3));l((a&16711680)>>16);l((a&65280)>>8);l(a&255)}if(o===2){a=u(e.charAt(n))<<2|u(e.charAt(n+1))>>4;l(a&255)}else if(o===1){a=u(e.charAt(n))<<10|u(e.charAt(n+1))<<4|u(e.charAt(n+2))>>2;l(a>>8&255);l(a&255)}return s}function d(e){var t,n=e.length%3,i="",a,o;function s(e){return r.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-n;t<o;t+=3){a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];i+=f(a)}switch(n){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=l;e.fromByteArray=d})(typeof n==="undefined"?this.base64js={}:n)},{}],67:[function(e,t,n){n.read=function(e,t,n,r,i){var a,o;var s=i*8-r-1;var f=(1<<s)-1;var c=f>>1;var u=-7;var l=n?i-1:0;var d=n?-1:1;var p=e[t+l];l+=d;a=p&(1<<-u)-1;p>>=-u;u+=s;for(;u>0;a=a*256+e[t+l],l+=d,u-=8){}o=a&(1<<-u)-1;a>>=-u;u+=r;for(;u>0;o=o*256+e[t+l],l+=d,u-=8){}if(a===0){a=1-c}else if(a===f){return o?NaN:(p?-1:1)*Infinity}else{o=o+Math.pow(2,r);a=a-c}return(p?-1:1)*o*Math.pow(2,a-r)};n.write=function(e,t,n,r,i,a){var o,s,f;var c=a*8-i-1;var u=(1<<c)-1;var l=u>>1;var d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=r?0:a-1;var h=r?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=u}else{o=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-o))<1){o--;f*=2}if(o+l>=1){t+=d/f}else{t+=d*Math.pow(2,1-l)}if(t*f>=2){o++;f/=2}if(o+l>=u){s=0;o=u}else if(o+l>=1){s=(t*f-1)*Math.pow(2,i);o=o+l}else{s=t*Math.pow(2,l-1)*Math.pow(2,i);o=0}}for(;i>=8;e[n+p]=s&255,p+=h,s/=256,i-=8){}o=o<<i|s;c+=i;for(;c>0;e[n+p]=o&255,p+=h,o/=256,c-=8){}e[n+p-h]|=v*128}},{}],68:[function(e,t,n){var r=Array.isArray;var i=Object.prototype.toString;t.exports=r||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],69:[function(e,t,n){function r(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=r;r.EventEmitter=r;r.prototype._events=undefined;r.prototype._maxListeners=undefined;r.defaultMaxListeners=10;r.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};r.prototype.emit=function(e){var t,n,r,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.')}}n=this._events[e];if(s(n))return false;if(i(n)){switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=arguments.length;a=new Array(r-1);for(f=1;f<r;f++)a[f-1]=arguments[f];n.apply(this,a)}}else if(o(n)){r=arguments.length;a=new Array(r-1);for(f=1;f<r;f++)a[f-1]=arguments[f];c=n.slice();r=c.length;for(f=0;f<r;f++)c[f].apply(this,a)}return true};r.prototype.addListener=function(e,t){var n;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 n;if(!s(this._maxListeners)){n=this._maxListeners}else{n=r.defaultMaxListeners}if(n&&n>0&&this._events[e].length>n){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};r.prototype.on=r.prototype.addListener;r.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var n=false;function r(){this.removeListener(e,r);if(!n){n=true;t.apply(this,arguments)}}r.listener=t;this.on(e,r);return this};r.prototype.removeListener=function(e,t){var n,r,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e];a=n.length;r=-1;if(n===t||i(n.listener)&&n.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(o(n)){for(s=a;s-->0;){if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}}if(r<0)return this;if(n.length===1){n.length=0;delete this._events[e]}else{n.splice(r,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};r.prototype.removeAllListeners=function(e){var t,n;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}n=this._events[e];if(i(n)){this.removeListener(e,n)}else{while(n.length)this.removeListener(e,n[n.length-1])}delete this._events[e];return this};r.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};r.listenerCount=function(e,t){var n;if(!e._events||!e._events[t])n=0;else if(i(e._events[t]))n=1;else n=e._events[t].length;return n};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,n){var r=t.exports;var i=e("events").EventEmitter;var a=e("./lib/request");var o=e("url");r.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 n=new a(new s,e);if(t)n.on("response",t);return n};r.get=function(e,t){e.method="GET";var n=r.request(e,t);n.end();return n};r.Agent=function(){};r.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 n=new window.ActiveXObject(e[t]);return function(){if(n){var r=n;n=null;return r}else{return new window.ActiveXObject(e[t])}}}catch(r){}}throw new Error("ajax not supported in this browser")}else{throw new Error("ajax not supported in this browser")}}();r.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,n){var r=e("stream");var i=e("./response");var a=e("Base64");var o=e("inherits");var s=t.exports=function(e,t){var n=this;n.writable=true;n.xhr=e;n.body=[];n.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(r){}if(t.responseType)try{e.responseType=t.responseType}catch(r){}e.open(t.method||"GET",n.uri,true);e.onerror=function(e){n.emit("error",new Error("Network error"))};n._headers={};if(t.headers){var o=f(t.headers);for(var s=0;s<o.length;s++){var c=o[s];if(!n.isSafeRequestHeader(c))continue;var u=t.headers[c];n.setHeader(c,u)}}if(t.auth){this.setHeader("Authorization","Basic "+a.btoa(t.auth))}var l=new i;l.on("close",function(){n.emit("close")});l.on("ready",function(){n.emit("response",l)});l.on("error",function(e){n.emit("error",e)});e.onreadystatechange=function(){if(e.__aborted)return;l.handle(e)}};o(s,r);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 n=0;n<t.length;n++){var r=t[n];var i=this._headers[r];if(c(i)){for(var a=0;a<i.length;a++){this.xhr.setRequestHeader(r,i[a])}}else this.xhr.setRequestHeader(r,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 n=0;n<this.body.length;n++){o.push.apply(o,this.body[n])}this.xhr.send(o)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){var s=0;for(var n=0;n<this.body.length;n++){s+=this.body[n].length}var o=new this.body[0].constructor(s);var u=0;for(var n=0;n<this.body.length;n++){var d=this.body[n];for(var a=0;a<d.length;a++){o[u++]=d[a]}}this.xhr.send(o)}else if(l(this.body[0])){this.xhr.send(this.body[0])}else{var o="";for(var n=0;n<this.body.length;n++){o+=this.body[n].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 u(s.unsafeHeaders,e.toLowerCase())===-1};var f=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};var c=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 n=0;n<e.length;n++){if(e[n]===t)return n}return-1};var l=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,n){var r=e("stream");var i=e("util");var a=t.exports=function(e){this.offset=0;this.readable=true};i.inherits(a,r);var o={streaming:true,status2:true};function s(e){var t=e.getAllResponseHeaders().split(/\r?\n/);var n={};for(var r=0;r<t.length;r++){var i=t[r];if(i==="")continue;var a=i.match(/^([^:]+):\s*(.*)/);if(a){var o=a[1].toLowerCase(),s=a[2];if(n[o]!==undefined){if(f(n[o])){n[o].push(s)}else{n[o]=[n[o],s]}}else{n[o]=s}}else{n[i]=true}}return n}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,n){(function(){var e=typeof n!="undefined"?n:this;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(e){this.message=e}r.prototype=new Error;r.prototype.name="InvalidCharacterError";e.btoa||(e.btoa=function(e){for(var n,i,a=0,o=t,s="";e.charAt(a|0)||(o="=",a%1);s+=o.charAt(63&n>>8-a%1*8)){i=e.charCodeAt(a+=3/4);if(i>255){throw new r("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.")}n=n<<8|i}return s});e.atob||(e.atob=function(e){e=e.replace(/=+$/,"");if(e.length%4==1){throw new r("'atob' failed: The string to be decoded is not correctly encoded.")}for(var n=0,i,a,o=0,s="";a=e.charAt(o++);~a&&(i=n%4?i*64+a:a,n++%4)?s+=String.fromCharCode(255&i>>(-2*n&6)):0){a=t.indexOf(a)}return s})})()},{}],74:[function(e,t,n){var r=e("http");var i=t.exports;for(var a in r){if(r.hasOwnProperty(a))i[a]=r[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return r.request.call(this,e,t)}},{http:70}],75:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],76:[function(e,t,n){(function(e){function t(e,t){var n=0;for(var r=e.length-1;r>=0;r--){var i=e[r];if(i==="."){e.splice(r,1)}else if(i===".."){e.splice(r,1);n++}else if(n){e.splice(r,1);n--}}if(t){for(;n--;n){e.unshift("..")}}return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return r.exec(e).slice(1)};n.resolve=function(){var n="",r=false;for(var i=arguments.length-1;i>=-1&&!r;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}n=o+"/"+n;r=o.charAt(0)==="/"}n=t(a(n.split("/"),function(e){return!!e}),!r).join("/");return(r?"/":"")+n||"."};n.normalize=function(e){var r=n.isAbsolute(e),i=o(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!r).join("/");if(!e&&!r){e="."}if(e&&i){e+="/"}return(r?"/":"")+e};n.isAbsolute=function(e){return e.charAt(0)==="/"};n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};n.relative=function(e,t){e=n.resolve(e).substr(1);t=n.resolve(t).substr(1);function r(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var n=e.length-1;for(;n>=0;n--){if(e[n]!=="")break}if(t>n)return[];return e.slice(t,n-t+1)}var i=r(e.split("/"));var a=r(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("/")};n.sep="/";n.delimiter=":";n.dirname=function(e){var t=i(e),n=t[0],r=t[1];if(!n&&!r){return"."}if(r){r=r.substr(0,r.length-1)}return n+r};n.basename=function(e,t){var n=i(e)[2];if(t&&n.substr(-1*t.length)===t){n=n.substr(0,n.length-t.length)}return n};n.extname=function(e){return i(e)[3]};function a(e,t){if(e.filter)return e.filter(t);var n=[];for(var r=0;r<e.length;r++){if(t(e[r],r,e))n.push(e[r])}return n}var o="ab".substr(-1)==="b"?function(e,t,n){return e.substr(t,n)}:function(e,t,n){if(t<0)t=e.length+t;return e.substr(t,n)}}).call(this,e("_process"))},{_process:77}],77:[function(e,t,n){var r=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)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}i.push(new u(e,t));if(i.length===1&&!a){setTimeout(c,0)}};function u(e,t){this.fun=e;this.array=t}u.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function l(){}r.on=l;r.addListener=l;r.once=l;r.off=l;r.removeListener=l;r.removeAllListeners=l;r.emit=l;r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},{}],78:[function(t,n,r){(function(t){(function(i){var a=typeof r=="object"&&r&&!r.nodeType&&r;var o=typeof n=="object"&&n&&!n.nodeType&&n;var s=typeof t=="object"&&t;if(s.global===s||s.window===s||s.self===s){i=s}var f,c=2147483647,u=36,l=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=u-l,k=Math.floor,E=String.fromCharCode,S;function A(e){throw RangeError(y[e])}function T(e,t){var n=e.length;var r=[];while(n--){r[n]=t(e[n])}return r}function I(e,t){var n=e.split("@");var r="";if(n.length>1){r=n[0]+"@";e=n[1]}e=e.replace(b,".");var i=e.split(".");var a=T(i,t).join(".");return r+a}function L(e){var t=[],n=0,r=e.length,i,a;while(n<r){i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){a=e.charCodeAt(n++);if((a&64512)==56320){t.push(((i&1023)<<10)+(a&1023)+65536)}else{t.push(i);n--}}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 u}function B(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;e=n?k(e/h):e>>1;e+=k(e/t);for(;e>x*d>>1;r+=u){e=k(e/x)}return k(r+(x+1)*e/(e+p))}function z(e){var t=[],n=e.length,r,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<n;){for(h=i,_=1,w=u;;w+=u){if(p>=n){A("invalid-input")}b=R(e.charCodeAt(p++));if(b>=u||b>k((c-i)/_)){A("overflow")}i+=b*_;y=w<=o?l:w>=o+d?d:w-o;if(b<y){break}x=u-y;if(_>k(c/x)){A("overflow")}_*=x}r=t.length+1;o=j(i-h,r,h==0);if(k(i/r)>c-a){A("overflow")}a+=k(i/r);i%=r;t.splice(i++,0,a)}return C(t)}function M(e){var t,n,r,i,a,o,s,f,p,h,_,w=[],b,y,x,S;e=L(e);b=e.length;t=m;n=0;a=v;for(o=0;o<b;++o){_=e[o];if(_<128){w.push(E(_))}}r=i=w.length;if(i){w.push(g)}while(r<b){for(s=c,o=0;o<b;++o){_=e[o];if(_>=t&&_<s){s=_}}y=r+1;if(s-t>k((c-n)/y)){A("overflow")}n+=(s-t)*y;t=s;for(o=0;o<b;++o){_=e[o];if(_<t&&++n>c){A("overflow")}if(_==t){for(f=n,p=u;;p+=u){h=p<=a?l:p>=a+d?d:p-a;if(f<h){break}S=f-h;x=u-h;w.push(E(B(h+S%x,0)));f=k(S/x)}w.push(E(B(f,0)));a=j(n,y,r==i);n=0;++r}}++n;++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(n.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,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,a){t=t||"&";n=n||"=";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 u=0;u<c;++u){var l=e[u].replace(s,"%20"),d=l.indexOf(n),p,h,v,m;if(d>=0){p=l.substr(0,d);h=l.substr(d+1)}else{p=l;h=""}v=decodeURIComponent(p);m=decodeURIComponent(h);if(!r(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,n){"use strict";var r=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,n,s){t=t||"&";n=n||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(o(e),function(o){var s=encodeURIComponent(r(o))+n;if(i(e[o])){return a(e[o],function(e){return s+encodeURIComponent(r(e))}).join(t)}else{return s+encodeURIComponent(r(e[o]))}}).join(t)}if(!s)return"";return encodeURIComponent(r(s))+n+encodeURIComponent(r(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 n=[];for(var r=0;r<e.length;r++){n.push(t(e[r],r))}return n}var o=Object.keys||function(e){var t=[];for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n))t.push(n)}return t}},{}],81:[function(e,t,n){"use strict";n.decode=n.parse=e("./decode");n.encode=n.stringify=e("./encode")},{"./decode":79,"./encode":80}],82:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":83}],83:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{"./_stream_readable":85,"./_stream_writable":87,_process:77,"core-util-is":88,dup:40,inherits:146}],84:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"./_stream_transform":86,"core-util-is":88,dup:41,inherits:146}],85:[function(e,t,n){arguments[4][42][0].apply(n,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,n){arguments[4][43][0].apply(n,arguments)},{"./_stream_duplex":83,"core-util-is":88,dup:43,inherits:146}],87:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"./_stream_duplex":83,_process:77,buffer:65,"core-util-is":88,dup:44,inherits:146,stream:93}],88:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{buffer:65,dup:45}],89:[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":84}],90:[function(e,t,n){arguments[4][48][0].apply(n,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,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":86}],92:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":87}],93:[function(e,t,n){t.exports=a;var r=e("events").EventEmitter;var i=e("inherits");i(a,r);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(){r.call(this)}a.prototype.pipe=function(e,t){var n=this;function i(t){if(e.writable){if(false===e.write(t)&&n.pause){n.pause()}}}n.on("data",i);function a(){if(n.readable&&n.resume){n.resume()}}e.on("drain",a);if(!e._isStdio&&(!t||t.end!==false)){n.on("end",s);n.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){u();if(r.listenerCount(this,"error")===0){throw e}}n.on("error",c);e.on("error",c);function u(){n.removeListener("data",i);e.removeListener("drain",a);n.removeListener("end",s);n.removeListener("close",f);n.removeListener("error",c);e.removeListener("error",c);n.removeListener("end",u);n.removeListener("close",u);e.removeListener("close",u)}n.on("end",u);n.on("close",u);e.on("close",u);e.emit("pipe",n);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,n){arguments[4][47][0].apply(n,arguments)},{buffer:65,dup:47}],95:[function(e,t,n){var r=e("punycode");n.parse=w;n.resolve=y;n.resolveObject=x;n.format=b;n.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),u=["%","/","?",";","#"].concat(c),l=["/","?","#"],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,n){if(e&&E(e)&&e instanceof i)return e;var r=new i;r.parse(e,t,n);return r}i.prototype.parse=function(e,t,n){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(n||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<l.length;b++){var y=i.indexOf(l[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<u.length;b++){var y=i.indexOf(u[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--"+r.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||"",n=this.pathname||"",r=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(n&&n.charAt(0)!=="/")n="/"+n}else if(!i){i=""}if(r&&r.charAt(0)!=="#")r="#"+r;if(o&&o.charAt(0)!=="?")o="?"+o;n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)});o=o.replace("#","%23");return t+i+n+o+r};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 n=new i;Object.keys(this).forEach(function(e){n[e]=this[e]},this);n.hash=e.hash;if(e.href===""){n.href=n.format();return n}if(e.slashes&&!e.protocol){Object.keys(e).forEach(function(t){if(t!=="protocol")n[t]=e[t]});if(g[n.protocol]&&n.hostname&&!n.pathname){n.path=n.pathname="/"}n.href=n.format();return n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){Object.keys(e).forEach(function(t){n[t]=e[t]});n.href=n.format();return n}n.protocol=e.protocol;if(!e.host&&!m[e.protocol]){var r=(e.pathname||"").split("/");while(r.length&&!(e.host=r.shift()));if(!e.host)e.host="";if(!e.hostname)e.hostname="";if(r[0]!=="")r.unshift("");if(r.length<2)r.unshift("");n.pathname=r.join("/")}else{n.pathname=e.pathname}n.search=e.search;n.query=e.query;n.host=e.host||"";n.auth=e.auth;n.hostname=e.hostname||e.host;n.port=e.port;if(n.pathname||n.search){var a=n.pathname||"";var o=n.search||"";n.path=a+o}n.slashes=n.slashes||e.slashes;n.href=n.format();return n}var s=n.pathname&&n.pathname.charAt(0)==="/",f=e.host||e.pathname&&e.pathname.charAt(0)==="/",c=f||s||n.host&&e.pathname,u=c,l=n.pathname&&n.pathname.split("/")||[],r=e.pathname&&e.pathname.split("/")||[],d=n.protocol&&!g[n.protocol];if(d){n.hostname="";n.port=null;if(n.host){if(l[0]==="")l[0]=n.host;else l.unshift(n.host)}n.host="";if(e.protocol){e.hostname=null;e.port=null;if(e.host){if(r[0]==="")r[0]=e.host;else r.unshift(e.host)}e.host=null}c=c&&(r[0]===""||l[0]==="")}if(f){n.host=e.host||e.host===""?e.host:n.host;n.hostname=e.hostname||e.hostname===""?e.hostname:n.hostname;n.search=e.search;n.query=e.query;l=r}else if(r.length){if(!l)l=[];l.pop();l=l.concat(r);n.search=e.search;n.query=e.query}else if(!A(e.search)){if(d){n.hostname=n.host=l.shift();var p=n.host&&n.host.indexOf("@")>0?n.host.split("@"):false;if(p){n.auth=p.shift();n.host=n.hostname=p.shift()}}n.search=e.search;n.query=e.query;if(!S(n.pathname)||!S(n.search)){n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")}n.href=n.format();return n}if(!l.length){n.pathname=null;if(n.search){n.path="/"+n.search}else{n.path=null}n.href=n.format();return n}var h=l.slice(-1)[0];var v=(n.host||e.host)&&(h==="."||h==="..")||h==="";var _=0;for(var w=l.length;w>=0;w--){h=l[w];if(h=="."){l.splice(w,1)}else if(h===".."){l.splice(w,1);_++}else if(_){l.splice(w,1);_--}}if(!c&&!u){for(;_--;_){l.unshift("..")}}if(c&&l[0]!==""&&(!l[0]||l[0].charAt(0)!=="/")){l.unshift("")}if(v&&l.join("/").substr(-1)!=="/"){l.push("")}var b=l[0]===""||l[0]&&l[0].charAt(0)==="/";if(d){n.hostname=n.host=b?"":l.length?l.shift():"";var p=n.host&&n.host.indexOf("@")>0?n.host.split("@"):false;if(p){n.auth=p.shift();n.host=n.hostname=p.shift()}}c=c||n.host&&l.length;if(c&&!b){l.unshift("")}if(!l.length){n.pathname=null;n.path=null}else{n.pathname=l.join("/")}if(!S(n.pathname)||!S(n.search)){n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")}n.auth=e.auth||n.auth;n.slashes=n.slashes||e.slashes;n.href=n.format();return n};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,n){t.exports=function r(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],97:[function(e,t,n){(function(t,r){var i=/%[sdj%]/g;n.format=function(e){if(!x(e)){var t=[];for(var n=0;n<arguments.length;n++){t.push(s(arguments[n]))}return t.join(" ")}var n=1;var r=arguments;var a=r.length;var o=String(e).replace(i,function(e){if(e==="%%")return"%";if(n>=a)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}});for(var f=r[n];n<a;f=r[++n]){if(w(f)||!A(f)){o+=" "+f}else{o+=" "+s(f)}}return o};n.deprecate=function(e,i){if(E(r.process)){return function(){return n.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;n.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 r=t.pid;a[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else{a[e]=function(){}}}return a[e]};function s(e,t){var r={seen:[],stylize:c};if(arguments.length>=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(_(t)){r.showHidden=t}else if(t){n._extend(r,t)}if(E(r.showHidden))r.showHidden=false;if(E(r.depth))r.depth=2;if(E(r.colors))r.colors=false;if(E(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=f;return l(r,e,r.depth)}n.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 n=s.styles[t];if(n){return"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m"}else{return e}}function c(e,t){return e}function u(e){var t={};e.forEach(function(e,n){t[e]=true});return t}function l(e,t,r){if(e.customInspect&&t&&L(t.inspect)&&t.inspect!==n.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);if(!x(i)){i=l(e,i,r)}return i}var a=d(e,t);if(a){return a}var o=Object.keys(t);var s=u(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(r<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,r,s,o)}else{y=o.map(function(n){return v(e,t,r,s,n,_)})}e.seen.pop();return m(y,c,w)}function d(e,t){if(E(t))return e.stylize("undefined","undefined");if(x(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"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,n,r,i){var a=[];for(var o=0,s=t.length;o<s;++o){if(M(t,String(o))){a.push(v(e,t,n,r,String(o),true))}else{a.push("")}}i.forEach(function(i){if(!i.match(/^\d+$/)){a.push(v(e,t,n,r,i,true))}});return a}function v(e,t,n,r,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(r,i)){o="["+i+"]"}if(!s){if(e.seen.indexOf(f.value)<0){if(w(n)){s=l(e,f.value,null)}else{s=l(e,f.value,n-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,n){var r=0;var i=e.reduce(function(e,t){r++;if(t.indexOf("\n")>=0)r++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60){return n[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]}return n[0]+t+" "+e.join(", ")+" "+n[1]}function g(e){return Array.isArray(e)}n.isArray=g;function _(e){return typeof e==="boolean"}n.isBoolean=_;function w(e){return e===null}n.isNull=w;function b(e){return e==null}n.isNullOrUndefined=b;function y(e){return typeof e==="number"}n.isNumber=y;function x(e){return typeof e==="string"}n.isString=x;function k(e){return typeof e==="symbol"}n.isSymbol=k;function E(e){return e===void 0}n.isUndefined=E;function S(e){return A(e)&&R(e)==="[object RegExp]"}n.isRegExp=S;function A(e){return typeof e==="object"&&e!==null}n.isObject=A;function T(e){return A(e)&&R(e)==="[object Date]"}n.isDate=T;function I(e){return A(e)&&(R(e)==="[object Error]"||e instanceof Error)}n.isError=I;function L(e){return typeof e==="function"}n.isFunction=L;function C(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}n.isPrimitive=C;n.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(" ")}n.log=function(){console.log("%s - %s",z(),n.format.apply(n,arguments))};n.inherits=e("inherits");n._extend=function(e,t){if(!t||!A(t))return e;var n=Object.keys(t);var r=n.length;while(r--){e[n[r]]=t[n[r]]}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,n){(function(n,r){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 u=e("flatten");var l=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,n){if(typeof t==="function"){n=t;t={}}if(!t)t={};b(e,t,function(e,r,i){if(e)return n(e);t.singleFileTorrent=i;A(r,t,n)})}function b(e,t,n){if(typeof t==="function"){n=t;t={}}if(!t)t={};n=f(n);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 n(e);a=t;o()})}else{o()}function o(){m(e.map(function(e){return function(n){var o={};if(I(e)){o.getStream=R(e);o.length=e.size}else if(r.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 l.readdir!=="function"){throw new Error("filesystem paths do not work in the browser")}var f=i>1||a;y(e,f,n);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);n(null,o)}}),function(e,t){if(e)return n(e);t=u(t);n(null,t,a)})}}function y(e,t,n){k(e,x,function(r,i){if(r)return n(r);if(Array.isArray(i))i=u(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)});n(null,i)})}function x(e,t){t=v(t);l.stat(e,function(n,r){if(n)return t(n);var i={length:r.size,path:e};t(null,i)})}function k(e,t,n){l.readdir(e,function(r,i){if(r&&r.code==="ENOTDIR"){t(e,n)}else if(r){n(r)}else{m(i.filter(E).filter(p.not).map(function(n){return function(r){k(s.join(e,n),t,r)}}),n)}})}function E(e){return e[0]!=="."}function S(e,t,n){n=v(n);var i=[];var o=0;var s=e.map(function(e){return e.getStream});var f=0;var c=0;var u=false;var l=new h(s);var d=new a(t,{zeroPadding:false});l.on("error",_);l.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(){u=true;b()}function _(e){w();n(e)}function w(){l.removeListener("error",_);d.removeListener("data",p);d.removeListener("end",m);d.removeListener("error",_)}function b(){if(u&&f===0){w();n(null,new r(i.join(""),"hex"),o)}}}function A(e,r,a){var s=r.announceList;if(!s){if(typeof r.announce==="string")s=[[r.announce]];else if(Array.isArray(r.announce)){s=r.announce.map(function(e){return[e]})}}if(!s)s=[];if(n.WEBTORRENT_ANNOUNCE){if(typeof n.WEBTORRENT_ANNOUNCE==="string"){s.push([[n.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(n.WEBTORRENT_ANNOUNCE)){s=s.concat(n.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(s.length===0){s=s.concat(t.exports.announceList)}var f={info:{name:r.name},announce:s[0][0],"announce-list":s,"creation date":Number(r.creationDate)||Date.now(),encoding:"UTF-8"};if(r.comment!==undefined)f.comment=r.comment;if(r.createdBy!==undefined)f["created by"]=r.createdBy;if(r.private!==undefined)f.info.private=Number(r.private);if(r.sslCert!==undefined)f.info["ssl-cert"]=r.sslCert;if(r.urlList!==undefined)f["url-list"]=r.urlList;var c=r.pieceLength||o(e.reduce(T,0));f.info["piece length"]=c;S(e,c,function(t,n,o){if(t)return a(t);f.info.pieces=n;e.forEach(function(e){delete e.getStream});if(r.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 l.createReadStream(e)}}function z(e,t){return function(){var n=new _.Transform;n._transform=function(e,n,r){t.length+=e.length;this.push(e);r()};e.pipe(n);return n}}}).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,n){arguments[4][16][0].apply(n,arguments)},{"./lib/decode":100,"./lib/encode":102,dup:16}],100:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./dict":101,buffer:65,dup:17}],101:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],102:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{buffer:65,dup:19}],103:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{buffer:65,defined:104,dup:38,inherits:105,"readable-stream":114}],104:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],105:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],106:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{"./_stream_readable":108,"./_stream_writable":110,_process:77,"core-util-is":111,dup:40,inherits:105}],107:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"./_stream_transform":109,"core-util-is":111,dup:41,inherits:105}],108:[function(e,t,n){(function(n){t.exports=u;var r=e("isarray");var i=e("buffer").Buffer;u.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(u,o);function c(t,n){t=t||{};var r=t.highWaterMark;this.highWaterMark=r||r===0?r: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 c(e,this);this.readable=true;o.call(this)}u.prototype.push=function(e,t){var n=this._readableState;if(typeof e==="string"&&!n.objectMode){t=t||n.defaultEncoding;if(t!==n.encoding){e=new i(e,t);t=""}}return l(this,n,e,t,false)};u.prototype.unshift=function(e){var t=this._readableState;return l(this,t,e,"",true)};function l(e,t,n,r,i){var a=m(t,n);if(a){e.emit("error",a)}else if(n===null||n===undefined){t.reading=false;if(!t.ended)g(e,t)}else if(t.objectMode||n&&n.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&&!r)n=t.decoder.write(n);t.length+=t.objectMode?1:n.length;if(i){t.buffer.unshift(n)}else{t.reading=false;t.buffer.push(n)}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)}u.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}u.prototype.read=function(e){var t=this._readableState;t.calledRead=true;var n=e;var r;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){r=null;if(t.length>0&&t.decoder){r=A(e,t);t.length-=r.length}if(t.length===0)T(this);return r}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(n,t);if(e>0)r=A(e,t);else r=null;if(r===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 r};function m(e,t){var n=null;if(!i.isBuffer(t)&&"string"!==typeof t&&t!==null&&t!==undefined&&!e.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function g(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.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)n.nextTick(function(){w(e)});else w(e)}function w(e){e.emit("readable")}function b(e,t){if(!t.readingMore){t.readingMore=true;n.nextTick(function(){y(e,t)})}}function y(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){e.read(0);if(n===t.length)break;else n=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;var s=(!t||t.end!==false)&&e!==n.stdout&&e!==n.stderr;var f=s?u:d;if(o.endEmitted)n.nextTick(f);else i.once("end",f);e.on("unpipe",c);function c(e){if(e!==i)return;d()}function u(){e.end()}var l=x(i);e.on("drain",l);function d(){e.removeListener("close",h);e.removeListener("finish",v);e.removeListener("drain",l);e.removeListener("error",p);e.removeListener("unpipe",c);i.removeListener("end",u);i.removeListener("end",d);if(!e._writableState||e._writableState.needDrain)l()}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(r(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;n.nextTick(function(){k(i)})}return e};function x(e){return function(){var t=this;var n=e._readableState;n.awaitDrain--;if(n.awaitDrain===0)k(e)}}function k(e){var t=e._readableState;var n;t.awaitDrain=0;function r(e,r,i){var a=e.write(n);if(false===a){t.awaitDrain++}}while(t.pipesCount&&null!==(n=e.read())){if(t.pipesCount===1)r(t.pipes,0,null);else I(t.pipes,r);e.emit("data",n);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)}}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",E);t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var n=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;this.removeListener("readable",E);t.flowing=false;for(var i=0;i<r;i++)n[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};u.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t);if(e==="data"&&!this._readableState.flowing)S(this);if(e==="readable"&&this.readable){var r=this._readableState;if(!r.readableListening){r.readableListening=true;r.emittedReadable=false;r.needReadable=true;if(!r.reading){this.read(0)}else if(r.length){_(this,r)}}}return n};u.prototype.addListener=u.prototype.on;u.prototype.resume=function(){S(this);this.read(0);this.emit("resume")};u.prototype.pause=function(){S(this,true);this.emit("pause")};function S(e,t){var r=e._readableState;if(r.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)n.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 n=false;var r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)r.push(e)}r.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=r.push(i);if(!a){n=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,r.emit.bind(r,t))});r._read=function(t){if(n){n=false;e.resume()}};return r};u._fromList=A;function A(e,t){var n=t.buffer;var r=t.length;var a=!!t.decoder;var o=!!t.objectMode;var s;if(n.length===0)return null;if(r===0)s=null;else if(o)s=n.shift();else if(!e||e>=r){if(a)s=n.join("");else s=i.concat(n,r);n.length=0}else{if(e<n[0].length){var f=n[0];s=f.slice(0,e);n[0]=f.slice(e)}else if(e===n[0].length){s=n.shift()}else{if(a)s="";else s=new i(e);var c=0;for(var u=0,l=n.length;u<l&&c<e;u++){var f=n[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)n[0]=f.slice(d);else n.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;n.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}}function L(e,t){for(var n=0,r=e.length;n<r;n++){if(e[n]===t)return n}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,n){t.exports=s;var r=e("./_stream_duplex");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(s,r);function a(e,t){this.afterTransform=function(e,n){return o(t,e,n)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function o(e,t,n){var r=e._transformState;r.transforming=false;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null;r.writecb=null;if(n!==null&&n!==undefined)e.push(n);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);r.call(this,e);var t=this._transformState=new a(e,this);var n=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(e){f(n,e)});else f(n)})}s.prototype.push=function(e,t){this._transformState.needTransform=false;return r.prototype.push.call(this,e,t)};s.prototype._transform=function(e,t,n){throw new Error("not implemented")};s.prototype._write=function(e,t,n){var r=this._transformState;r.writecb=n;r.writechunk=e;r.writeencoding=t;if(!r.transforming){var i=this._readableState;if(r.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 n=e._writableState;var r=e._readableState;var i=e._transformState;if(n.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,n){(function(n){t.exports=f;var r=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,n){this.chunk=e;this.encoding=t;this.callback=n}function s(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||n===0?n:16*1024;this.objectMode=!!e.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var r=e.decodeStrings===false;this.decodeStrings=!r;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 n=e("./_stream_duplex");if(!(this instanceof f)&&!(this instanceof n))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,r){var i=new Error("write after end");e.emit("error",i);n.nextTick(function(){r(i)})}function u(e,t,i,a){var o=true;if(!r.isBuffer(i)&&"string"!==typeof i&&i!==null&&i!==undefined&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s);n.nextTick(function(){a(s)});o=false}return o}f.prototype.write=function(e,t,n){var i=this._writableState;var a=false;if(typeof t==="function"){n=t;t=null}if(r.isBuffer(e))t="buffer";else if(!t)t=i.defaultEncoding;if(typeof n!=="function")n=function(){};if(i.ended)c(this,i,n);else if(u(this,i,e,n))a=d(this,i,e,t,n);return a};function l(e,t,n){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new r(t,n)}return t}function d(e,t,n,i,a){n=l(t,n,i);if(r.isBuffer(n))i="buffer";var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing)t.buffer.push(new o(n,i,a));else p(e,t,s,n,i,a);return f}function p(e,t,n,r,i,a){t.writelen=n;t.writecb=a;t.writing=true;t.sync=true;e._write(r,i,t.onwrite);t.sync=false}function h(e,t,r,i,a){if(r)n.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 r=e._writableState;var i=r.sync;var a=r.writecb;v(r);if(t)h(e,r,i,t,a);else{var o=b(e,r);if(!o&&!r.bufferProcessing&&r.buffer.length)w(e,r);if(i){n.nextTick(function(){g(e,r,o,a)})}else{g(e,r,o,a)}}}function g(e,t,n,r){if(!n)_(e,t);r();if(n)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 n=0;n<t.buffer.length;n++){var r=t.buffer[n];var i=r.chunk;var a=r.encoding;var o=r.callback;var s=t.objectMode?1:i.length;p(e,t,s,i,a,o);if(t.writing){n++;break}}t.bufferProcessing=false;if(n<t.buffer.length)t.buffer=t.buffer.slice(n);else t.buffer.length=0}f.prototype._write=function(e,t,n){n(new Error("not implemented"))};f.prototype.end=function(e,t,n){var r=this._writableState;if(typeof e==="function"){n=e;e=null;t=null}else if(typeof t==="function"){n=t;t=null}if(typeof e!=="undefined"&&e!==null)this.write(e,t);if(!r.ending&&!r.finished)x(this,r,n)};function b(e,t){return t.ending&&t.length===0&&!t.finished&&!t.writing}function y(e,t){var n=b(e,t);if(n){t.finished=true;e.emit("finish")}return n}function x(e,t,r){t.ending=true;y(e,t);if(r){if(t.finished)n.nextTick(r);else e.once("finish",r)}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,n){arguments[4][45][0].apply(n,arguments)},{buffer:65,dup:45}],112:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{dup:46}],113:[function(e,t,n){arguments[4][47][0].apply(n,arguments)},{buffer:65,dup:47}],114:[function(e,t,n){var r=e("stream");n=t.exports=e("./lib/_stream_readable.js");n.Stream=r;n.Readable=n;n.Writable=e("./lib/_stream_writable.js");n.Duplex=e("./lib/_stream_duplex.js");n.Transform=e("./lib/_stream_transform.js");n.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,n){arguments[4][30][0].apply(n,arguments);
-},{asap:116,dup:30,wrappy:117}],116:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{_process:77,dup:31}],117:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],118:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],119:[function(e,t,n){(function(n){var r=e("is-typedarray").strict;t.exports=function(e){var t=n.TYPED_ARRAY_SUPPORT?n._augment:function(e){return new n(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(r(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new n(e)}}}).call(this,e("buffer").Buffer)},{buffer:65,"is-typedarray":120}],120:[function(e,t,n){t.exports=a;a.strict=o;a.loose=s;var r=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[r.call(e)]}},{}],121:[function(e,t,n){var r=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var o=e("typedarray-to-buffer");function s(e,t){var n=this;if(!(this instanceof s)){return new s(e,t)}t=t||{};r.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 n.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){n.push(e)})}n._ready=true;n.emit("_ready")})}i(s,r);t.exports=s;s.prototype._generateHeaderBlocks=function(e,t,n){n(null,[])};s.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var n=this._offset;var r=this._offset+this._chunkSize;if(r>this._size)r=this._size;if(n===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=r;e.push(o(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(n,r))};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,n){t.exports=function r(e,t){t=typeof t=="number"?t:Infinity;return n(e,1);function n(e,r){return e.reduce(function(e,i){if(Array.isArray(i)&&r<t){return e.concat(n(i,r+1))}else{return e.concat(i)}},[])}}},{}],123:[function(e,t,n){"use strict";var r=e("fs");t.exports=function a(e,t){if(!t)return i(e);r.stat(e,function(e,n){if(e)return t(e);return t(null,n.isFile())})};t.exports.sync=i;function i(e){return r.existsSync(e)&&r.statSync(e).isFile()}},{fs:49}],124:[function(e,t,n){"use strict";n.re=/^npm-debug\.log$|^\..*\.swp$|^\.DS_Store$|^\.AppleDouble$|^\.LSOverride$|^Icon[\r\?]?|^\._.*|^.Spotlight-V100$|\.Trashes|^__MACOSX$|~$|^Thumbs\.db$|^ehthumbs\.db$|^Desktop\.ini$/;n.is=function(e){return n.re.test(e)};n.not=n.isnt=function(e){return!n.is(e)}},{}],125:[function(e,t,n){t.exports=a;var r=e("inherits");var i=e("stream");r(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",n);t.on("end",i);t.on("error",a);t.on("close",r);function n(){e._forward()}function r(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",n);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",r);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,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],127:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],128:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{dup:36,wrappy:127}],129:[function(e,t,n){var r=e("closest-to");var i=[];for(var a=14;a<=22;a++){i.push(Math.pow(2,a))}t.exports=function(e){return r(e/Math.pow(2,10),i)}},{"closest-to":130}],130:[function(e,t,n){t.exports=function(e,t){var n=Infinity;var r=0;var i=null;t.sort(function(e,t){return e-t});for(var a=0,o=t.length;a<o;a++){r=Math.abs(e-t[a]);if(r>=n){break}n=r;i=t[a]}return i}},{}],131:[function(e,t,n){var r=e("dezalgo");t.exports=function(e,t){if(t)t=r(t);var n,i,a;if(Array.isArray(e)){n=[];i=e.length}else{a=Object.keys(e);n={};i=a.length}function o(e,r,a){n[e]=a;if(--i===0||r){if(t)t(r,n);t=null}}if(!i){if(t)t(null,n);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,n){arguments[4][30][0].apply(n,arguments)},{asap:133,dup:30,wrappy:134}],133:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{_process:77,dup:31}],134:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],135:[function(e,t,n){var r=e("rusha");var i=new r;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=u(e)}o.digest({name:"sha-1"},e).then(function n(e){t(l(new Uint8Array(e)))},function r(n){t(s(e))})}function u(e){var t=e.length;var n=new Uint8Array(t);for(var r=0;r<t;r++){n[r]=e.charCodeAt(r)}return n}function l(e){var t=e.length;var n=[];for(var r=0;r<t;r++){var i=e[r];n.push((i>>>4).toString(16));n.push((i&15).toString(16))}return n.join("")}t.exports=c;t.exports.sync=s},{rusha:136}],136:[function(e,t,n){(function(e){(function(){if(typeof t!=="undefined"){t.exports=a}else if(typeof window!=="undefined"){window.Rusha=a}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,r=new a(4*1024*1024);self.onmessage=function s(e){var t,n=e.data.data;try{t=r.digest(n);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 r=function(e){for(e+=9;e%64>0;e+=1);return e};var a=function(e,t){for(var n=t>>2;n<e.length;n++)e[n]=0};var s=function(e,t,n){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=n>>29;e[((t>>2)+2&~15)+15]=n<<3};var f=function(e,t,n,r,i){var a=this,o,s=i%4,f=r%4,c=r-f;if(c>0){switch(s){case 0:e[i+3|0]=a.charCodeAt(n);case 1:e[i+2|0]=a.charCodeAt(n+1);case 2:e[i+1|0]=a.charCodeAt(n+2);case 3:e[i|0]=a.charCodeAt(n+3)}}for(o=s;o<c;o=o+4|0){t[i+o>>2]=a.charCodeAt(n+o)<<24|a.charCodeAt(n+o+1)<<16|a.charCodeAt(n+o+2)<<8|a.charCodeAt(n+o+3)}switch(f){case 3:e[i+c+1|0]=a.charCodeAt(n+c+2);case 2:e[i+c+2|0]=a.charCodeAt(n+c+1);case 1:e[i+c+3|0]=a.charCodeAt(n+c)}};var c=function(e,t,n,r,i){var a=this,o,s=i%4,f=r%4,c=r-f;if(c>0){switch(s){case 0:e[i+3|0]=a[n];case 1:e[i+2|0]=a[n+1];case 2:e[i+1|0]=a[n+2];case 3:e[i|0]=a[n+3]}}for(o=4-s;o<c;o=o+=4|0){t[i+o>>2]=a[n+o]<<24|a[n+o+1]<<16|a[n+o+2]<<8|a[n+o+3]}switch(f){case 3:e[i+c+1|0]=a[n+c+2];case 2:e[i+c+2|0]=a[n+c+1];case 1:e[i+c+3|0]=a[n+c]}};var u=function(e,t,r,i,a){var o=this,s,f=a%4,c=i%4,u=i-c;var l=new Uint8Array(n.readAsArrayBuffer(o.slice(r,r+i)));if(u>0){switch(f){case 0:e[a+3|0]=l[0];case 1:e[a+2|0]=l[1];case 2:e[a+1|0]=l[2];case 3:e[a|0]=l[3]}}for(s=4-f;s<u;s=s+=4|0){t[a+s>>2]=l[s]<<24|l[s+1]<<16|l[s+2]<<8|l[s+3]}switch(c){case 3:e[a+u+1|0]=l[u+2];case 2:e[a+u+2|0]=l[u+1];case 1:e[a+u+3|0]=l[u]}};var l=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 u.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,n,r="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){n=a[t];i[t]=r.charAt(n>>4&15)+r.charAt(n>>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=r(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 n=new Int32Array(e,t+320,5);n[0]=1732584193;n[1]=-271733879;n[2]=-1732584194;n[3]=271733878;n[4]=-1009589776};var g=function(e,n){var i=r(e);var o=new Int32Array(t.heap,0,i>>2);a(o,e);s(o,e,n);return i};var _=function(e,n,r){l(e)(t.h8,t.h32,n,r,0)};var w=function(e,n,r,i,a){var o=r;if(a){o=g(r,i)}_(e,n,r);t.core.hash(o,t.padMaxChunkLen)};var b=function(e,t){var n=new Int32Array(e,t+320,5);var r=new Int32Array(5);var i=new DataView(r.buffer);i.setInt32(0,n[0],false);i.setInt32(4,n[1],false);i.setInt32(8,n[2],false);i.setInt32(12,n[3],false);i.setInt32(16,n[4],false);return r};var y=this.rawDigest=function(e){var n=e.byteLength||e.length||e.size||0;m(t.heap,t.padMaxChunkLen);var r=0,i=t.maxChunkLen,a;for(r=0;n>r+i;r+=i){w(e,r,i,n,false)}w(e,r,n-r,n,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,n){"use asm";var r=new e.Int32Array(n);function i(e,t){e=e|0;t=t|0;var n=0,i=0,a=0,o=0,s=0,f=0,c=0,u=0,l=0,d=0,p=0,h=0,v=0,m=0;a=r[t+320>>2]|0;s=r[t+324>>2]|0;c=r[t+328>>2]|0;l=r[t+332>>2]|0;p=r[t+336>>2]|0;for(n=0;(n|0)<(e|0);n=n+64|0){o=a;f=s;u=c;d=l;h=p;for(i=0;(i|0)<64;i=i+4|0){m=r[n+i>>2]|0;v=((a<<5|a>>>27)+(s&c|~s&l)|0)+((m+p|0)+1518500249|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[e+i>>2]=m}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|~s&l)|0)+((m+p|0)+1518500249|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^l)|0)+((m+p|0)+1859775393|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|s&l|c&l)|0)+((m+p|0)-1894007588|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^l)|0)+((m+p|0)-899497514|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}a=a+o|0;s=s+f|0;c=c+u|0;l=l+d|0;p=p+h|0}r[t+320>>2]=a;r[t+324>>2]=s;r[t+328>>2]=c;r[t+332>>2]=l;r[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,n){n=t.exports=e("./debug");n.log=a;n.formatArgs=i;n.save=o;n.load=s;n.useColors=r;n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function r(){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}n.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 ":" ")+"+"+n.humanize(this.diff);if(!t)return e;var r="color: "+this.color;e=[e[0],r,"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,r);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){n.storage.removeItem("debug")}else{n.storage.debug=e}}catch(t){}}function s(){var e;try{e=n.storage.debug}catch(t){}return e}n.enable(s());function f(){try{return window.localStorage}catch(e){}}},{"./debug":138}],138:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:139}],139:[function(e,t,n){var r=1e3;var i=r*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?u(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 n=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}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>=r)return Math.round(e/r)+"s";return e+"ms"}function u(e){return l(e,o,"day")||l(e,a,"hour")||l(e,i,"minute")||l(e,r,"second")||e+" ms"}function l(e,t,n){if(e<t)return;if(e<t*1.5)return Math.floor(e/t)+" "+n;return Math.ceil(e/t)+" "+n+"s"}},{}],140:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{asap:141,dup:30,wrappy:143}],141:[function(e,t,n){"use strict";var r=e("./raw");var i=[];var a=[];var o=r.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;r(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,n){(function(e){"use strict";t.exports=n;function n(e){if(!r.length){a();i=true}r[r.length]=e}var r=[];var i=false;var a;var o=0;var s=1024;function f(){while(o<r.length){var e=o;o=o+1;r[e].call();if(o>s){for(var t=0,n=r.length-o;t<n;t++){r[t]=r[t+o]}r.length-=o;o=0}}r.length=0;o=0;i=false}var c=e.MutationObserver||e.WebKitMutationObserver;if(typeof c==="function"){a=u(f)}else{a=l(f)}n.requestFlush=a;function u(e){var t=1;var n=new c(e);var r=document.createTextNode("");n.observe(r,{characterData:true});return function i(){t=-t;r.data=t}}function l(e){return function t(){var t=setTimeout(r,0);var n=setInterval(r,50);function r(){clearTimeout(t);clearInterval(n);e()}}}n.makeRequestCallFromTimer=l}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],143:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],144:[function(e,t,n){var r=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,n){if(typeof t==="function")return s(e,null,t);if(!t)t={};n=r(n||i);var f=e._writableState;var c=e._readableState;var u=t.readable||t.readable!==false&&e.readable;var l=t.writable||t.writable!==false&&e.writable;var d=function(){if(!e.writable)p()};var p=function(){l=false;if(!u)n()};var h=function(){u=false;if(!l)n()};var v=function(e){n(e?new Error("exited with error code: "+e):null)};var m=function(){if(u&&!(c&&c.ended))return n(new Error("premature close"));if(l&&!(f&&f.ended))return n(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(l&&!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",n);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",n);e.removeListener("close",m)}};t.exports=s},{once:152}],145:[function(e,t,n){var r=t.exports=function(e,t){if(!t)t=16;if(e===undefined)e=128;if(e<=0)return"0";var n=Math.log(Math.pow(2,e))/Math.log(t);for(var i=2;n===Infinity;i*=2){n=Math.log(Math.pow(2,e/i))/Math.log(t)*i}var a=n-Math.floor(n);var o="";for(var i=0;i<Math.floor(n);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 r(e,t)}else return o};r.rack=function(e,t,n){var i=function(i){var o=0;do{if(o++>10){if(n)e+=n;else throw new Error("too many ID collisions, use more bits")}var s=r(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,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],147:[function(e,t,n){(function(n){var r=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 r=e[t];for(var i=0;i<r.length;i++){if(n.env.DEBUG_MIME&&this.types[r]){console.warn(this._loading.replace(/.*\//,""),'changes "'+r[i]+'" extension type from '+this.types[r]+" to "+t)}this.types[r[i]]=t}if(!this.extensions[t]){this.extensions[t]=r[0]}}};a.prototype.load=function(e){this._loading=e;var t={},n=i.readFileSync(e,"ascii"),r=n.split(/[\r\n]+/);r.forEach(function(e){var n=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);t[n.shift()]=n});this.define(t);this._loading=null};a.prototype.lookup=function(e,t){var n=e.replace(/.*[\.\/\\]/,"").toLowerCase();return this.types[n]||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,n){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,n){arguments[4][125][0].apply(n,arguments)},{dup:125,inherits:150,stream:93}],150:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],151:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],152:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{dup:36,wrappy:151}],153:[function(e,t,n){(function(n){t.exports=f;t.exports.remote=c;var r=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(n.isBuffer(e)&&t===20){return o("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(n.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 n;if(typeof t!=="function")throw new Error("second argument must be a Function");t=r(t);try{n=f(e)}catch(o){}if(n&&n.infoHash){t(null,n)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,n){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}s(n)})}else if(typeof i.readFile==="function"&&typeof e==="string"){i.readFile(e,function(e,n){if(e)return t(new Error("Invalid torrent identifier"));s(n)})}else{t(new Error("Invalid torrent identifier"))}function s(e){try{n=f(e)}catch(r){return t(r)}if(n&&n.infoHash)t(null,n);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,n){arguments[4][30][0].apply(n,arguments)},{asap:155,dup:30,wrappy:157}],155:[function(e,t,n){arguments[4][141][0].apply(n,arguments)},{"./raw":156,dup:141}],156:[function(e,t,n){arguments[4][142][0].apply(n,arguments)},{dup:142}],157:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],158:[function(e,t,n){(function(n){t.exports=o;t.exports.decode=o;t.exports.encode=s;var r=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 n=e.split("=");if(n.length!==2)return;var r=n[0];var i=n[1];if(r==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){i=decodeURIComponent(i)}if(r==="kt")i=decodeURIComponent(i).split("+");if(t[r]){if(Array.isArray(t[r])){t[r].push(i)}else{var a=t[r];t[r]=[a,i]}}else{t[r]=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 n(s[1],"hex").toString("hex")}else if(s=e.match(/^urn:btih:(.{32})/)){var i=r.decode(s[1]);t.infoHash=new n(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(n,r){var i=Array.isArray(e[n])?e[n]:[e[n]];i.forEach(function(e,i){if((r>0||i>0)&&(n!=="kt"||i===0))t+="&";if(n==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){e=encodeURIComponent(e)}if(n==="kt")e=encodeURIComponent(e);if(n==="kt"&&i>0)t+="+"+e;else t+=n+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:65,"thirty-two":159,uniq:161,xtend:162}],159:[function(e,t,n){var r=e("./thirty-two");n.encode=r.encode;n.decode=r.decode},{"./thirty-two":160}],160:[function(e,t,n){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var r=[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}n.encode=function(n){var r=0;var a=0;var o=0;var s=0;var f=new e(i(n)*8);if(!e.isBuffer(n)){n=new e(n)}while(r<n.length){var c=n[r];if(o>3){s=c&255>>o;o=(o+5)%8;s=s<<o|(r+1<n.length?n[r+1]:0)>>8-o;r++}else{s=c>>8-(o+5)&31;o=(o+5)%8;if(o==0)r++}f[a]=t.charCodeAt(s);a++}for(r=a;r<f.length;r++)f[r]=61;return f};n.decode=function(t){var n=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<r.length){i=r[c];if(n<=3){n=(n+5)%8;if(n==0){a|=i;s[o]=a;o++;a=0}else{a|=255&i<<8-n}}else{n=(n+5)%8;a|=255&i>>>n;s[o]=a;o++;a=255&i<<8-n}}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,n){"use strict";function r(e,t){var n=1,r=e.length,i=e[0],a=e[0];for(var o=1;o<r;++o){a=i;i=e[o];if(t(i,a)){if(o===n){n++;continue}e[n++]=i}}e.length=n;return e}function i(e){var t=1,n=e.length,r=e[0],i=e[0];for(var a=1;a<n;++a,i=r){i=r;r=e[a];if(r!==i){if(a===t){t++;continue}e[t++]=r}}e.length=t;return e}function a(e,t,n){if(e.length===0){return e}if(t){if(!n){e.sort(t)}return r(e,t)}if(!n){e.sort()}return i(e)}t.exports=a},{}],162:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],163:[function(e,t,n){(function(n){t.exports=s;t.exports.decode=s;t.exports.encode=f;var r=e("bencode");var i=e("path");var a=e("simple-sha1");var o=e("uniq");function s(e){if(n.isBuffer(e)){e=r.decode(e)}l(e.info,"info");l(e.info["name.utf-8"]||e.info.name,"info.name");l(e.info["piece length"],"info['piece length']");l(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){l(typeof e.length==="number","info.files[0].length");l(e["path.utf-8"]||e.path,"info.files[0].path")})}else{l(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=r.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(n.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(n.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,n){var r=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(r)).slice(1),name:r[r.length-1],length:e.length,offset:s.slice(0,n).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=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 n(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return r.encode(t)}function c(e,t){return e+t.length}function u(e){var t=[];for(var n=0;n<e.length;n+=20){t.push(e.slice(n,n+20).toString("hex"))}return t}function l(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,n){arguments[4][16][0].apply(n,arguments)},{"./lib/decode":165,"./lib/encode":167,dup:16}],165:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./dict":166,buffer:65,dup:17}],166:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],167:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{buffer:65,dup:19}],168:[function(e,t,n){arguments[4][135][0].apply(n,arguments)},{dup:135,rusha:169}],169:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{dup:136}],170:[function(e,t,n){arguments[4][161][0].apply(n,arguments)},{dup:161}],171:[function(e,t,n){var r=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 u=function(e,t,n,a){a=r(a);var o=false;e.on("close",function(){o=true});i(e,{readable:t,writable:n},function(e){if(e)return a(e);o=true;a()});var u=false;return function(t){if(o)return;if(u)return;u=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 l=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 n;var r=e.map(function(i,a){var o=a<e.length-1;var s=a>0;return u(i,o,s,function(e){if(!n)n=e;if(e)r.forEach(l);if(o)return;r.forEach(l);t(n)})});return e.reduce(d)};t.exports=p},{"end-of-stream":144,fs:49,once:152}],172:[function(e,t,n){t.exports=function(e,t){var n=true;var r=t.indexOf("=");if(-1==r)return-2;var i=t.slice(r+1).split(",").map(function(t){var t=t.split("-"),r=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(r)){r=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(r)||isNaN(i)||r>i||r<0)n=false;return{start:r,end:i}});i.type=t.slice(0,r);return n?i:-1}},{}],173:[function(e,t,n){t.exports=i;t.exports.filter=a;var r=e("events").EventEmitter;function i(e,t,n){if(!Array.isArray(n))n=[n];var r=[];n.forEach(function(n){var i=function(){var e=[].slice.call(arguments);e.unshift(n);t.emit.apply(t,e)};r.push(i);e.on(n,i)});return function i(){n.forEach(function(t,n){e.removeListener(t,r[n])})}}function a(e,t){var n=new r;i(e,n,t);return n}},{events:69}],174:[function(e,t,n){arguments[4][131][0].apply(n,arguments)},{dezalgo:175,dup:131}],175:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{asap:176,dup:30,wrappy:177}],176:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{_process:77,dup:31}],177:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],178:[function(e,t,n){arguments[4][135][0].apply(n,arguments)},{dup:135,rusha:179}],179:[function(e,t,n){(function(e){(function(){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 r(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 n=t>>2;n<e.length;n++)e[n]=0};var s=function(e,t,n){e[t>>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=n>>29;e[((t>>2)+2&~15)+15]=n<<3};var f=function(e,t,n,r,i){var a=this,o,s=i%4,f=r%4,c=r-f;if(c>0){switch(s){case 0:e[i+3|0]=a.charCodeAt(n);case 1:e[i+2|0]=a.charCodeAt(n+1);case 2:e[i+1|0]=a.charCodeAt(n+2);case 3:e[i|0]=a.charCodeAt(n+3)}}for(o=s;o<c;o=o+4|0){t[i+o>>2]=a.charCodeAt(n+o)<<24|a.charCodeAt(n+o+1)<<16|a.charCodeAt(n+o+2)<<8|a.charCodeAt(n+o+3)}switch(f){case 3:e[i+c+1|0]=a.charCodeAt(n+c+2);case 2:e[i+c+2|0]=a.charCodeAt(n+c+1);case 1:e[i+c+3|0]=a.charCodeAt(n+c)}};var c=function(e,t,n,r,i){var a=this,o,s=i%4,f=r%4,c=r-f;if(c>0){switch(s){case 0:e[i+3|0]=a[n];case 1:e[i+2|0]=a[n+1];case 2:e[i+1|0]=a[n+2];case 3:e[i|0]=a[n+3]}}for(o=4-s;o<c;o=o+=4|0){t[i+o>>2]=a[n+o]<<24|a[n+o+1]<<16|a[n+o+2]<<8|a[n+o+3]}switch(f){case 3:e[i+c+1|0]=a[n+c+2];case 2:e[i+c+2|0]=a[n+c+1];case 1:e[i+c+3|0]=a[n+c]}};var u=function(e,t,n,r,a){var o=this,s,f=a%4,c=r%4,u=r-c;var l=new Uint8Array(i.readAsArrayBuffer(o.slice(n,n+r)));if(u>0){switch(f){case 0:e[a+3|0]=l[0];case 1:e[a+2|0]=l[1];case 2:e[a+1|0]=l[2];case 3:e[a|0]=l[3]}}for(s=4-f;s<u;s=s+=4|0){t[a+s>>2]=l[s]<<24|l[s+1]<<16|l[s+2]<<8|l[s+3]}switch(c){case 3:e[a+u+1|0]=l[u+2];case 2:e[a+u+2|0]=l[u+1];case 1:e[a+u+3|0]=l[u]}};var l=function(e){switch(n.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 u.bind(e)}};var d=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 p=function(e){var t,n,r="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t<a.length;t++){n=a[t];i[t]=r.charAt(n>>4&15)+r.charAt(n>>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 r._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};v(e||64*1024);var m=function(e,t){var n=new Int32Array(e,t+320,5);n[0]=1732584193;n[1]=-271733879;n[2]=-1732584194;n[3]=271733878;n[4]=-1009589776};var g=function(e,n){var r=a(e);var i=new Int32Array(t.heap,0,r>>2);o(i,e);s(i,e,n);return r};var _=function(e,n,r){l(e)(t.h8,t.h32,n,r,0)};var w=function(e,n,r,i,a){var o=r;if(a){o=g(r,i)}_(e,n,r);t.core.hash(o,t.padMaxChunkLen)};var b=function(e,t){var n=new Int32Array(e,t+320,5);var r=new Int32Array(5);var i=new DataView(r.buffer);i.setInt32(0,n[0],false);
-i.setInt32(4,n[1],false);i.setInt32(8,n[2],false);i.setInt32(12,n[3],false);i.setInt32(16,n[4],false);return r};var y=this.rawDigest=function(e){var n=e.byteLength||e.length||e.size||0;m(t.heap,t.padMaxChunkLen);var r=0,i=t.maxChunkLen,a;for(r=0;n>r+i;r+=i){w(e,r,i,n,false)}w(e,r,n-r,n,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return p(y(e).buffer)}}r._core=function o(e,t,n){"use asm";var r=new e.Int32Array(n);function i(e,t){e=e|0;t=t|0;var n=0,i=0,a=0,o=0,s=0,f=0,c=0,u=0,l=0,d=0,p=0,h=0,v=0,m=0;a=r[t+320>>2]|0;s=r[t+324>>2]|0;c=r[t+328>>2]|0;l=r[t+332>>2]|0;p=r[t+336>>2]|0;for(n=0;(n|0)<(e|0);n=n+64|0){o=a;f=s;u=c;d=l;h=p;for(i=0;(i|0)<64;i=i+4|0){m=r[n+i>>2]|0;v=((a<<5|a>>>27)+(s&c|~s&l)|0)+((m+p|0)+1518500249|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[e+i>>2]=m}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|~s&l)|0)+((m+p|0)+1518500249|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^l)|0)+((m+p|0)+1859775393|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s&c|s&l|c&l)|0)+((m+p|0)-1894007588|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){m=(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])<<1|(r[i-12>>2]^r[i-32>>2]^r[i-56>>2]^r[i-64>>2])>>>31;v=((a<<5|a>>>27)+(s^c^l)|0)+((m+p|0)-899497514|0)|0;p=l;l=c;c=s<<30|s>>>2;s=a;a=v;r[i>>2]=m}a=a+o|0;s=s+f|0;c=c+u|0;l=l+d|0;p=p+h|0}r[t+320>>2]=a;r[t+324>>2]=s;r[t+328>>2]=c;r[t+332>>2]=l;r[t+336>>2]=p}return{hash:i}};if(typeof t!=="undefined"){t.exports=r}else if(typeof window!=="undefined"){window.Rusha=r}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new r(4*1024*1024);self.onmessage=function s(e){var t,n=e.data.data;try{t=a.digest(n);self.postMessage({id:e.data.id,hash:t})}catch(r){self.postMessage({id:e.data.id,error:r.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],180:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],181:[function(e,t,n){(function(n){t.exports=u;var r=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(u,a);function u(e){var t=this;if(!(t instanceof u))return new u(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(!n.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}r("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 n.nextTick(function(){e(null)})};u.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,n){if(n===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 n={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,n);f(e.tracker,e,["peer","warning","error"]);e.tracker.start()};u.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;r("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;r("dht announce");e.dht.announce(e.infoHash,e.port,function(){r("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"))},{_process:77,"bittorrent-dht/client":51,"bittorrent-tracker/client":182,debug:214,events:69,inherits:217,"re-emitter":218,"xtend/mutable":219}],182:[function(e,t,n){(function(n,r){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 u=e("./lib/http-tracker");var l=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=r.isBuffer(e)?e:new r(e,"hex");h._peerIdHex=h._peerId.toString("hex");h._peerIdBinary=h._peerId.toString("binary");h._infoHash=r.isBuffer(o.infoHash)?o.infoHash:new r(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 u==="function"){return new u(h,e,v)}else if(t==="udp:"&&typeof l==="function"){return new l(h,e,v)}else if((t==="ws:"||t==="wss:")&&m){return new d(h,e,v)}else{n.nextTick(function(){var t=new Error("unsupported tracker protocol for "+e);h.emit("warning",t)})}return null}).filter(Boolean)}p.scrape=function(e,t,n){n=s(n);var i=new r("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",n);var c=Array.isArray(t)?t.length:1;var u={};f.on("scrape",function(e){c-=1;u[e.infoHash]=e;if(c===0){f.destroy();var t=Object.keys(u);if(t.length===1){n(null,u[t[0]])}else{n(null,u)}}});t=Array.isArray(t)?t.map(function(e){return new r(e,"hex")}):new r(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:186,events:69,inherits:190,once:192,url:95}],183:[function(e,t,n){(function(t){var r=e("querystring");n.IPV4_RE=/^[\d\.]+$/;n.IPV6_RE=/^[\da-fA-F:]+$/;n.CONNECTION_ID=t.concat([i(1047),i(655366528)]);n.ACTIONS={CONNECT:0,ANNOUNCE:1,SCRAPE:2,ERROR:3};n.EVENTS={update:0,completed:1,started:2,stopped:3};n.EVENT_IDS={0:"update",1:"completed",2:"started",3:"stopped"};n.EVENT_NAMES={update:"update",completed:"complete",started:"start",stopped:"stop"};function i(e){var n=new t(4);n.writeUInt32BE(e,0);return n}n.toUInt32=i;n.querystringParse=function(e){var t=r.unescape;r.unescape=unescape;var n=r.parse(e);r.unescape=t;return n};n.querystringStringify=function(e){var t=r.escape;r.escape=escape;var n=r.stringify(e);n=n.replace(/[\@\*\/\+]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});r.escape=t;return n}}).call(this,e("buffer").Buffer)},{buffer:65,querystring:81}],184:[function(e,t,n){(function(t){var r=e("xtend/mutable");n.DEFAULT_ANNOUNCE_INTERVAL=30*60*1e3;n.DEFAULT_ANNOUNCE_PEERS=50;n.MAX_ANNOUNCE_PEERS=82;n.binaryToHex=function(e){return new t(e,"binary").toString("hex")};n.hexToBinary=function(e){return new t(e,"hex").toString("binary")};var i=e("./common-node");r(n,i)}).call(this,e("buffer").Buffer)},{"./common-node":183,buffer:65,"xtend/mutable":213}],185:[function(e,t,n){t.exports=p;var r=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 u={};var l=30*1e3;var d=5*1e3;o(p,i);function p(e,t,n){var a=this;i.call(a);r("new websocket tracker %s",t);a.client=e;a.destroyed=false;a._opts=n;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(n){e.offers=n;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 n=t.announce.bind(t,t.client._defaultAnnounceOpts());t._interval=setInterval(n,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=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)};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){r("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}r("received %s from %s for %s",JSON.stringify(e),t._announceUrl,t.client._infoHashHex);var n=e["failure reason"];if(n)return t.client.emit("warning",new Error(n));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(n){var r={info_hash:t.client._infoHashBinary,peer_id:t.client._peerIdBinary,to_peer_id:e.peer_id,answer:n,offer_id:e.offer_id};if(t._trackerId)r.trackerid=t._trackerId;t._send(r)});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{r("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()*l)+d;setTimeout(function(){e.destroyed=false;e._openSocket()},t);r("reconnecting socket in %s ms",t)};p.prototype._send=function(e){var t=this;if(t.destroyed)return;var n=JSON.stringify(e);r("send %s",n);t._socket.send(n)};p.prototype._generateOffers=function(e,t){var n=this;var i=[];r("generating %s offers",e);for(var o=0;o<e;++o){f()}function f(){var e=a(160);var t=n._peers[e]=new s({initiator:true,trickle:false,config:n.client._rtcConfig,wrtc:n.client._wrtc});t.once("signal",function(t){i.push({offer:t,offer_id:c.hexToBinary(e)});u()})}function u(){if(i.length===e){r("generated %s offers",e);t(i)}}};function h(){}},{"./common":184,debug:186,events:69,hat:189,inherits:190,"simple-peer":193,"simple-websocket":205}],186:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"./debug":187,dup:137}],187:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:188}],188:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],189:[function(e,t,n){arguments[4][145][0].apply(n,arguments)},{dup:145}],190:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],191:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],192:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{dup:36,wrappy:191}],193:[function(e,t,n){(function(n){t.exports=l;var r=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 u=e("typedarray-to-buffer");o(l,c.Duplex);function l(e){var t=this;if(!(t instanceof l))return new l(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||l.channelConfig;t.channelName=e.channelName||a(160);if(!e.initiator)t.channelName=null;t.config=e.config||l.config;t.constraints=e.constraints||l.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)})}})}l.WEBRTC_SUPPORT=!!i();l.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]};l.constraints={};l.channelConfig={};Object.defineProperty(l.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}});l.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}};l.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(n){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(n){t._destroy(new Error("error adding candidate: "+n.message))}}if(!e.sdp&&!e.candidate){t._destroy(new Error("signal() called with invalid signal data"))}};l.prototype.send=function(e){var t=this;if(!s.strict(e)&&!(e instanceof ArrayBuffer)&&!n.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}if(n.isBuffer(e)&&!s.strict(e)){e=new Uint8Array(e)}var r=e.length||e.byteLength||e.size;t._channel.send(e);t._debug("write: %d bytes",r)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var n=this;if(n.destroyed)return;if(t)n.once("close",t);n._debug("destroy (error: %s)",e&&e.message);n.readable=n.writable=false;if(!n._readableState.ended)n.push(null);if(!n._writableState.finished)n.end();n.destroyed=true;n.connected=false;n._pcReady=false;n._channelReady=false;n._chunk=null;n._cb=null;clearInterval(n._interval);clearTimeout(n._reconnectTimeout);if(n._pc){try{n._pc.close()}catch(e){}n._pc.oniceconnectionstatechange=null;n._pc.onsignalingstatechange=null;n._pc.onicecandidate=null}if(n._channel){try{n._channel.close()}catch(e){}n._channel.onmessage=null;n._channel.onopen=null;n._channel.onclose=null}n._pc=null;n._channel=null;if(e)n.emit("error",e);n.emit("close")};l.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)};l.prototype._read=function(){};l.prototype._write=function(e,t,n){var r=this;if(r.destroyed)return n(new Error("cannot write after peer is destroyed"));if(r.connected){try{r.send(e)}catch(i){return r._onError(i)}if(r._channel.bufferedAmount>r._maxBufferedAmount){r._debug("start backpressure: bufferedAmount %d",r._channel.bufferedAmount);r._cb=n}else{n(null)}}else{r._debug("write before connect");r._chunk=e;r._cb=n}};l.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 n=function(){var n=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:n.type,sdp:n.sdp})};if(e.trickle||e._iceComplete)n();else e.once("_iceComplete",n)},e._onError.bind(e),e.offerConstraints)};l.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 n=function(){var n=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:n.type,sdp:n.sdp})};if(e.trickle||e._iceComplete)n();else e.once("_iceComplete",n)},e._onError.bind(e),e.answerConstraints)};l.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var n=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,n);e.emit("iceConnectionStateChange",t,n);if(n==="connected"||n==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(n==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(n==="closed"){e._destroy()}};l.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 n=[];e.forEach(function(e){n.push(e)});t(n)},e._onError.bind(e))}else{e._pc.getStats(function(e){var n=[];e.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;n.push(t)});t(n)})}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(n){return e._onError(n)}e._chunk=null;e._debug('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(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")}};l.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};l.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")}};l.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;t._debug("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=u(new Uint8Array(n));t.push(n)}else{try{n=JSON.parse(n)}catch(r){}t.emit("data",n)}};l.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};l.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};l.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};l.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var n=e.channelName&&e.channelName.substring(0,7);t[0]="["+n+"] "+t[0];r.apply(null,t)};function d(){}}).call(this,e("buffer").Buffer)},{buffer:65,debug:194,"get-browser-rtc":197,hat:198,inherits:199,"is-typedarray":200,once:202,stream:93,"typedarray-to-buffer":203}],194:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"./debug":195,dup:137}],195:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:196}],196:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],197:[function(e,t,n){t.exports=function r(){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}},{}],198:[function(e,t,n){arguments[4][145][0].apply(n,arguments)},{dup:145}],199:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],200:[function(e,t,n){t.exports=a;a.strict=o;a.loose=s;var r=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[r.call(e)]}},{}],201:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],202:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{dup:36,wrappy:201}],203:[function(e,t,n){arguments[4][119][0].apply(n,arguments)},{buffer:65,dup:119,"is-typedarray":204}],204:[function(e,t,n){arguments[4][200][0].apply(n,arguments)},{dup:200}],205:[function(e,t,n){(function(n){t.exports=u;var r=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(u,o.Duplex);function u(e,t){var n=this;if(!(n instanceof u))return new u(e,t);if(!t)t={};r("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;o.Duplex.call(n,t);n.url=e;n.connected=false;n.destroyed=false;n._maxBufferedAmount=t.highWaterMark;n._chunk=null;n._cb=null;n._interval=null;n._ws=new c(n.url);n._ws.binaryType="arraybuffer";n._ws.onopen=n._onOpen.bind(n);n._ws.onmessage=n._onMessage.bind(n);n._ws.onclose=n._onClose.bind(n);n._ws.onerror=function(){n._onError(new Error("connection error to "+n.url))};n.on("finish",function(){if(n.connected){setTimeout(function(){n._destroy()},100)}else{n.once("connect",function(){setTimeout(function(){n._destroy()},100)})}})}u.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!n.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);r("write: %d bytes",i)};u.prototype.destroy=function(e){var t=this;t._destroy(null,e)};u.prototype._destroy=function(e,t){var n=this;if(n.destroyed)return;if(t)n.once("close",t);r("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!n._readableState.ended)n.push(null);if(!n._writableState.finished)n.end();n.connected=false;n.destroyed=true;clearInterval(n._interval);n._interval=null;n._chunk=null;n._cb=null;if(n._ws){try{n._ws.close()}catch(e){}n._ws.onopen=null;n._ws.onmessage=null;n._ws.onclose=null;n._ws.onerror=null}n._ws=null;if(e)n.emit("error",e);n.emit("close")};u.prototype._read=function(){};u.prototype._write=function(e,t,n){var i=this;if(i.destroyed)return n(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){r("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=n}else{n(null)}}else{r("write before connect");i._chunk=e;i._cb=n}};u.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;r("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=s(new Uint8Array(i));t.push(i)}else if(n.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};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;r('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}r("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}r("connect");e.emit("connect")};u.prototype._onClose=function(){var e=this;if(e.destroyed)return;r("on close");e._destroy()};u.prototype._onError=function(e){var t=this;if(t.destroyed)return;r("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:65,debug:206,inherits:209,"is-typedarray":210,stream:93,"typedarray-to-buffer":211,ws:51}],206:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"./debug":207,dup:137}],207:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:208}],208:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{dup:139}],209:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],210:[function(e,t,n){arguments[4][200][0].apply(n,arguments)},{dup:200}],211:[function(e,t,n){arguments[4][119][0].apply(n,arguments)},{buffer:65,dup:119,"is-typedarray":212}],212:[function(e,t,n){arguments[4][200][0].apply(n,arguments)},{dup:200}],213:[function(e,t,n){t.exports=r;function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n){if(n.hasOwnProperty(r)){e[r]=n[r]}}}return e}},{}],214:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./debug":215,dup:21}],215:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{dup:22,ms:216}],216:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23}],217:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],218:[function(e,t,n){arguments[4][173][0].apply(n,arguments)},{dup:173,events:69}],219:[function(e,t,n){arguments[4][213][0].apply(n,arguments)},{dup:213}],220:[function(e,t,n){arguments[4][161][0].apply(n,arguments)},{dup:161}],221:[function(e,t,n){(function(n){var r=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 u=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(n.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,n){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,n;try{var i=e.toString();var a=i.indexOf("ee")+2;t=r.decode(i.substring(0,a));n=e.slice(a)}catch(o){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,n,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=r.decode(e).info;if(t){e=r.encode(t)}}catch(n){}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",r.encode({info:r.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=r.encode(e);if(n.isBuffer(t)){i=n.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,n){var r={msg_type:1,piece:e};if(typeof n==="number"){r.total_size=n}this._send(r,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 n=t+u;if(n>this._metadataSize){n=this._metadataSize}var r=this.metadata.slice(t,n);this._data(e,r,this._metadataSize)};t.prototype._onData=function(e,t,n){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 n(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 n=this.setMetadata(this.metadata);if(!n){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:222,bitfield:226,buffer:65,events:69,inherits:227,"simple-sha1":228}],222:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./lib/decode":223,"./lib/encode":225,dup:16}],223:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./dict":224,buffer:65,dup:17}],224:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],225:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{buffer:65,dup:19}],226:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{buffer:65,dup:9}],227:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{dup:24}],228:[function(e,t,n){arguments[4][135][0].apply(n,arguments)},{dup:135,rusha:229}],229:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{dup:136}],230:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],231:[function(e,t,n){t.exports=function r(e,t,n){if(t===undefined){return function(t,n){return r(e,t,n)}}if(n===undefined)n="0";e-=t.toString().length;if(e>0)return new Array(e+(/\./.test(t)?2:1)).join(n)+t;return t+""}},{}],232:[function(e,t,n){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.51.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","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^4.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"}}},{}],233:[function(e,t,n){(function(n,r,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 u=e("hat");var l=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");l(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||r.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+"-"+u(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(u(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,n){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=n;a()})}else n.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 n=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/n}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var n;try{n=h(e)}catch(r){return null}if(!n.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===n.infoHash)return o}return null};k.prototype.add=k.prototype.download=function(e,t,r){var i=this;if(i.destroyed)throw new Error("client is destroyed");o("add");if(typeof t==="function"){r=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 r==="function")r(a)}if(a){if(a.ready)n.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,n){var r=this;if(r.destroyed)throw new Error("client is destroyed");o("seed");if(typeof t==="function"){n=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=r.add(undefined,t,function(e){var t=[function(t){e.storage.load(i,t)}];if(r.dht){t.push(function(t){e.on("dhtAnnounce",t)})}p(t,function(t){if(t)return r.emit("error",t);f();r.emit("seed",e)})});a.parseInput(e,t,function(n,o){if(n)return r.emit("error",n);i=o.map(function(e){return e.getStream});a(e,t,function(e,t){if(e)return r.emit("error",e);if(r.destroyed)return;var n=r.get(t);if(n){s.destroy();f();return}else{s._onTorrentId(t)}})});function f(){o("on seed");if(typeof n==="function")n(s)}return s};k.prototype.remove=function(e,t){var n=this;var r=n.get(e);if(!r)throw new Error("No torrent with id "+e);o("remove");n.torrents.splice(n.torrents.indexOf(r),1);r.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 n=t.torrents.map(function(e){return function(n){t.remove(e,n)}});if(t.dht){n.push(function(e){t.dht.destroy(e)})}p(n,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":232,_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:230,"zero-fill":231}]},{},[233])(233)});
+(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)});