Continuing to Organize into Two Columns

This commit is contained in:
Leo Herzog committed 2020-11-08 13:21:52 -05:00
1 parent 239021266d
commit b111fc3fe9
5 files changed
+2262 -1743

No files matched your search

+2186 -1710
View File
File diff suppressed because it is too large. Load diff
+38 -20
View File
@@ -1,63 +1,81 @@
!function e(t,n,i){function s(a,o){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[a]={exports:{}};t[a][0].call(p.exports,(function(e){return s(t[a][1][e]||e)}),p,p.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)s(i[a]);return s}({1:[function(e,t,n){(function(e){void 0===e&&(e=void 0),function(){"use strict";void 0===e&&(e=Array),t.exports=e}()}).call(this,e("buffer").Buffer)},{buffer:51}],2:[function(e,t,n){const i=/^\[?([^\]]+)\]?:(\d+)$/;let s={},r=0;t.exports=function(e){if(1e5===r&&t.exports.reset(),!s[e]){const t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);s[e]=[t[1],Number(t[2])],r+=1}return s[e]},t.exports.reset=function(){s={},r=0}},{}],3:[function(e,t,n){"use strict";n.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){var t,n,i=l(e),a=i[0],o=i[1],c=new r(function(e,t,n){return 3*(t+n)/4-n}(0,a,o)),p=0,u=o>0?a-4:a;for(n=0;n<u;n+=4)t=s[e.charCodeAt(n)]<<18|s[e.charCodeAt(n+1)]<<12|s[e.charCodeAt(n+2)]<<6|s[e.charCodeAt(n+3)],c[p++]=t>>16&255,c[p++]=t>>8&255,c[p++]=255&t;2===o&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,c[p++]=255&t);1===o&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t);return c},n.fromByteArray=function(e){for(var t,n=e.length,s=n%3,r=[],a=16383,o=0,c=n-s;o<c;o+=a)r.push(p(e,o,o+a>c?c:o+a));1===s?(t=e[n-1],r.push(i[t>>2]+i[t<<4&63]+"==")):2===s&&(t=(e[n-2]<<8)+e[n-1],r.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return r.join("")};for(var i=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=a.length;o<c;++o)i[o]=a[o],s[a.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function p(e,t,n){for(var s,r,a=[],o=t;o<n;o+=3)s=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(i[(r=s)>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return a.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],4:[function(e,t,n){var i=e("safe-buffer").Buffer;function s(e,t,n){for(var i=0,s=1,r=t;r<n;r++){var a=e[r];if(a<58&&a>=48)i=10*i+(a-48);else if(r!==t||43!==a){if(r!==t||45!==a){if(46===a)break;throw new Error("not a number: buffer["+r+"] = "+a)}s=-1}}return i*s}function r(e,t,n,s){return null==e||0===e.length?null:("number"!=typeof t&&null==s&&(s=t,t=void 0),"number"!=typeof n&&null==s&&(s=n,n=void 0),r.position=0,r.encoding=s||null,r.data=i.isBuffer(e)?e.slice(t,n):i.from(e),r.bytes=r.data.length,r.next())}r.bytes=0,r.position=0,r.data=null,r.encoding=null,r.next=function(){switch(r.data[r.position]){case 100:return r.dictionary();case 108:return r.list();case 105:return r.integer();default:return r.buffer()}},r.find=function(e){for(var t=r.position,n=r.data.length,i=r.data;t<n;){if(i[t]===e)return t;t++}throw new Error('Invalid data: Missing delimiter "'+String.fromCharCode(e)+'" [0x'+e.toString(16)+"]")},r.dictionary=function(){r.position++;for(var e={};101!==r.data[r.position];)e[r.buffer()]=r.next();return r.position++,e},r.list=function(){r.position++;for(var e=[];101!==r.data[r.position];)e.push(r.next());return r.position++,e},r.integer=function(){var e=r.find(101),t=s(r.data,r.position+1,e);return r.position+=e+1-r.position,t},r.buffer=function(){var e=r.find(58),t=s(r.data,r.position,e),n=++e+t;return r.position=n,r.encoding?r.data.toString(r.encoding,e,n):r.data.slice(e,n)},t.exports=r},{"safe-buffer":211}],5:[function(e,t,n){var i=e("safe-buffer").Buffer;function s(e,t,n){var r=[],a=null;return s._encode(r,e),a=i.concat(r),s.bytes=a.length,i.isBuffer(t)?(a.copy(t,n),t):a}s.bytes=-1,s._floatConversionDetected=!1,s.getType=function(e){return i.isBuffer(e)?"buffer":Array.isArray(e)?"array":ArrayBuffer.isView(e)?"arraybufferview":e instanceof Number?"number":e instanceof Boolean?"boolean":e instanceof ArrayBuffer?"arraybuffer":typeof e},s._encode=function(e,t){if(null!=t)switch(s.getType(t)){case"buffer":s.buffer(e,t);break;case"object":s.dict(e,t);break;case"array":s.list(e,t);break;case"string":s.string(e,t);break;case"number":case"boolean":s.number(e,t);break;case"arraybufferview":s.buffer(e,i.from(t.buffer,t.byteOffset,t.byteLength));break;case"arraybuffer":s.buffer(e,i.from(t))}};var r=i.from("e"),a=i.from("d"),o=i.from("l");s.buffer=function(e,t){e.push(i.from(t.length+":"),t)},s.string=function(e,t){e.push(i.from(i.byteLength(t)+":"+t))},s.number=function(e,t){var n=2147483648,r=(t/n<<0)*n+(t%n<<0);e.push(i.from("i"+r+"e")),r===t||s._floatConversionDetected||(s._floatConversionDetected=!0,console.warn('WARNING: Possible data corruption detected with value "'+t+'":','Bencoding only defines support for integers, value was converted to "'+r+'"'),console.trace())},s.Line truncated
!function e(t,n,i){function s(a,o){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[a]={exports:{}};t[a][0].call(p.exports,(function(e){return s(t[a][1][e]||e)}),p,p.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)s(i[a]);return s}({1:[function(e,t,n){(function(e){(function(){void 0===e&&(e=void 0),function(){"use strict";void 0===e&&(e=Array),t.exports=e}()}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59}],2:[function(e,t,n){const i=/^\[?([^\]]+)\]?:(\d+)$/;let s={},r=0;t.exports=function(e){if(1e5===r&&t.exports.reset(),!s[e]){const t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);s[e]=[t[1],Number(t[2])],r+=1}return s[e]},t.exports.reset=function(){s={},r=0}},{}],3:[function(e,t,n){"use strict";n.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){var t,n,i=l(e),a=i[0],o=i[1],c=new r(function(e,t,n){return 3*(t+n)/4-n}(0,a,o)),p=0,u=o>0?a-4:a;for(n=0;n<u;n+=4)t=s[e.charCodeAt(n)]<<18|s[e.charCodeAt(n+1)]<<12|s[e.charCodeAt(n+2)]<<6|s[e.charCodeAt(n+3)],c[p++]=t>>16&255,c[p++]=t>>8&255,c[p++]=255&t;2===o&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,c[p++]=255&t);1===o&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t);return c},n.fromByteArray=function(e){for(var t,n=e.length,s=n%3,r=[],a=16383,o=0,c=n-s;o<c;o+=a)r.push(p(e,o,o+a>c?c:o+a));1===s?(t=e[n-1],r.push(i[t>>2]+i[t<<4&63]+"==")):2===s&&(t=(e[n-2]<<8)+e[n-1],r.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return r.join("")};for(var i=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=a.length;o<c;++o)i[o]=a[o],s[a.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function p(e,t,n){for(var s,r,a=[],o=t;o<n;o+=3)s=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(i[(r=s)>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return a.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],4:[function(e,t,n){var i=e("safe-buffer").Buffer;function s(e,t,n){for(var i=0,s=1,r=t;r<n;r++){var a=e[r];if(a<58&&a>=48)i=10*i+(a-48);else if(r!==t||43!==a){if(r!==t||45!==a){if(46===a)break;throw new Error("not a number: buffer["+r+"] = "+a)}s=-1}}return i*s}function r(e,t,n,s){return null==e||0===e.length?null:("number"!=typeof t&&null==s&&(s=t,t=void 0),"number"!=typeof n&&null==s&&(s=n,n=void 0),r.position=0,r.encoding=s||null,r.data=i.isBuffer(e)?e.slice(t,n):i.from(e),r.bytes=r.data.length,r.next())}r.bytes=0,r.position=0,r.data=null,r.encoding=null,r.next=function(){switch(r.data[r.position]){case 100:return r.dictionary();case 108:return r.list();case 105:return r.integer();default:return r.buffer()}},r.find=function(e){for(var t=r.position,n=r.data.length,i=r.data;t<n;){if(i[t]===e)return t;t++}throw new Error('Invalid data: Missing delimiter "'+String.fromCharCode(e)+'" [0x'+e.toString(16)+"]")},r.dictionary=function(){r.position++;for(var e={};101!==r.data[r.position];)e[r.buffer()]=r.next();return r.position++,e},r.list=function(){r.position++;for(var e=[];101!==r.data[r.position];)e.push(r.next());return r.position++,e},r.integer=function(){var e=r.find(101),t=s(r.data,r.position+1,e);return r.position+=e+1-r.position,t},r.buffer=function(){var e=r.find(58),t=s(r.data,r.position,e),n=++e+t;return r.position=n,r.encoding?r.data.toString(r.encoding,e,n):r.data.slice(e,n)},t.exports=r},{"safe-buffer":219}],5:[function(e,t,n){var i=e("safe-buffer").Buffer;function s(e,t,n){var r=[],a=null;return s._encode(r,e),a=i.concat(r),s.bytes=a.length,i.isBuffer(t)?(a.copy(t,n),t):a}s.bytes=-1,s._floatConversionDetected=!1,s.getType=function(e){return i.isBuffer(e)?"buffer":Array.isArray(e)?"array":ArrayBuffer.isView(e)?"arraybufferview":e instanceof Number?"number":e instanceof Boolean?"boolean":e instanceof ArrayBuffer?"arraybuffer":typeof e},s._encode=function(e,t){if(null!=t)switch(s.getType(t)){case"buffer":s.buffer(e,t);break;case"object":s.dict(e,t);break;case"array":s.list(e,t);break;case"string":s.string(e,t);break;case"number":case"boolean":s.number(e,t);break;case"arraybufferview":s.buffer(e,i.from(t.buffer,t.byteOffset,t.byteLength));break;case"arraybuffer":s.buffer(e,i.from(t))}};var r=i.from("e"),a=i.from("d"),o=i.from("l");s.buffer=function(e,t){e.push(i.from(t.length+":"),t)},s.string=function(e,t){e.push(i.from(i.byteLength(t)+":"+t))},s.number=function(e,t){var n=2147483648,r=(t/n<<0)*n+(t%n<<0);e.push(i.from("i"+r+"e")),r===t||s._floatConversionDetected||(s._floatConversionDetected=!0,console.warn('WARNING: Possible data corruption detected with value "'+t+'":','Bencoding only defines support for integers, value was converted to "'+r+Line truncated
/*! bittorrent-protocol. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("unordered-array-remove"),s=e("bencode"),r=e("bitfield").default,a=e("debug")("bittorrent-protocol"),o=e("randombytes"),c=e("speedometer"),l=e("readable-stream"),p=n.from("BitTorrent protocol"),u=n.from([0,0,0,0]),d=n.from([0,0,0,1,0]),h=n.from([0,0,0,1,1]),f=n.from([0,0,0,1,2]),m=n.from([0,0,0,1,3]),g=[0,0,0,0,0,0,0,0],v=[0,0,0,3,9,0,0];class b{constructor(e,t,n,i){this.piece=e,this.offset=t,this.length=n,this.callback=i}}class x extends l.Duplex{constructor(){super(),this._debugId=o(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=null,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new r(0,{grow:4e5}),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=c(),this.downloadSpeed=c(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this.once("finish",(()=>this._onFinish())),this._parseHandshake()}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._clearTimeout(),this._timeoutMs=e,this._timeoutUnref=!!t,this._updateTimeout()}destroy(){this.destroyed||(this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end())}end(...e){this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const n=this._nextExt,i=new e(this);function s(){}"function"!=typeof i.onHandshake&&(i.onHandshake=s),"function"!=typeof i.onExtendedHandshake&&(i.onExtendedHandshake=s),"function"!=typeof i.onMessage&&(i.onMessage=s),this.extendedMapping[n]=t,this._ext[t]=i,this[t]=i,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(u)}handshake(e,t,i){let s,r;if("string"==typeof e?(e=e.toLowerCase(),s=n.from(e,"hex")):(s=e,e=s.toString("hex")),"string"==typeof t?r=n.from(t,"hex"):(r=t,t=r.toString("hex")),20!==s.length||20!==r.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,i);const a=n.from(g);a[5]|=16,i&&i.dht&&(a[7]|=1),this._push(n.concat([p,a,s,r])),this._handshakeSent=!0,this.peerExtensions.extended&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_sendExtendedHandshake(){const e=Object.assign({},this.extendedHandshake);e.m={};for(const t in this.extendedMapping){const n=this.extendedMapping[t];e.m[n]=Number(t)}this.extended(0,s.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking){for(this.amChoking=!0,this._debug("choke");this.peerRequests.length;)this.peerRequests.pop();this._push(d)}}unchoke(){this.amChoking&&(this.amChoking=!1,this._debug("unchoke"),this._push(h))}interested(){this.amInterested||(this.amInterested=!0,this._debug("interested"),this._push(f))}uninterested(){this.amInterested&&(this.amInterested=!1,this._debug("uninterested"),this._push(m))}have(e){this._debug("have %d",e),this._message(4,[e],null)}bitfield(e){this._debug("bitfield"),n.isBuffer(e)||(e=e.buffer),this._message(5,[],e)}request(e,t,n,i){return i||(i=()=>{}),this._finished?i(new Error("wire is closed")):this.peerChoking?i(new Error("peer is choking")):(this._debug("request index=%d offset=%d length=%d",e,t,n),this.requests.push(new b(e,t,n,i)),this._updateTimeout(),void this._message(6,[e,t,n],null))}piece(e,t,n){this._debug("piece index=%d offset=%d",e,t),this.uploaded+=n.length,this.uploadSpeed(n.length),this.emit("upload",n.length),this._message(7,[e,t],n)}cancel(e,t,n){this._debug("cancel index=%d offset=%d length=%d",e,t,n),this._callback(this._pull(this.requests,e,t,n),new Error("request was cancelled"),null),this._message(8,[e,t,n],null)}port(e){this._debug("port %d",e);const t=n.from(v);t.writeUInt16BE(e,5),this._push(t)}extended(e,t){if(this._debug("extended ext=%s",e),"string"==typeof e&&this.peerExtendedMapping[e]&&(e=this.peerExtendedMapping[e]),"number"!=typeof e)throw new Error("Unrecognized extension: "+e);{const i=n.from([e]),r=n.isBuffer(t)?t:s.encode(t);this._message(20,[],n.concat([i,r]))}}_read(){}_message(e,t,i){const s=i?i.length:0,r=n.allocUnsafe(5+4*t.length);r.writeUInt32BE(r.length+s-4,0),r[4]=e;for(let e=0;e<t.length;e++)r.writeUInt32BE(t[e],5+4*e);this._push(r),i&&this._push(i)}_push(e){if(!this._finished)return this.push(e)}_onKeepAlive(){this._debug("got keep-alive"),this.emit("keep-alive")}_onHandshake(e,t,n){const i=e.toString("hex"),s=t.toString("hex");let r;for(r in this._debug("got handshake i=%s p=%s exts=%o",i,s,n),this.peerId=s,this.peerIdBuffer=Line truncated
/*! blob-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,n){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof n)throw new Error("second argument must be a function");const i=new FileReader;i.addEventListener("loadend",(function t(s){i.removeEventListener("loadend",t,!1),s.error?n(s.error):n(null,e.from(i.result))}),!1),i.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59}],38:[function(e,t,n){(function(n){(function(){const{Transform:i}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),"object"==typeof e&&(e=(t=e).size),this.size=e||512;const{nopad:n,zeroPadding:i=!0}=t;this._zeroPadding=!n&&!!i,this._buffered=[],this._bufferedBytes=0}_transform(e,t,i){for(this._bufferedBytes+=e.length,this._buffered.push(e);this._bufferedBytes>=this.size;){const e=n.concat(this._buffered);this._bufferedBytes-=this.size,this.push(e.slice(0,this.size)),this._buffered=[e.slice(this.size,e.length)]}i()}_flush(){if(this._bufferedBytes&&this._zeroPadding){const e=n.alloc(this.size-this._bufferedBytes);this._buffered.push(e),this.push(n.concat(this._buffered)),this._buffered=null}else this._bufferedBytes&&(this.push(n.concat(this._buffered)),this._buffered=null);this.push(null)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59,"readable-stream":53}],39:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],40:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_readable":42,"./_stream_writable":44,_process:186,dup:16,inherits:118}],41:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_transform":43,dup:17,inherits:118}],42:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"../errors":39,"./_stream_duplex":40,"./internal/streams/async_iterator":45,"./internal/streams/buffer_list":46,"./internal/streams/destroy":47,"./internal/streams/from":49,"./internal/streams/state":51,"./internal/streams/stream":52,_process:186,buffer:59,dup:18,events:97,inherits:118,"string_decoder/":285,util:54}],43:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":39,"./_stream_duplex":40,dup:19,inherits:118}],44:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{"../errors":39,"./_stream_duplex":40,"./internal/streams/destroy":47,"./internal/streams/state":51,"./internal/streams/stream":52,_process:186,buffer:59,dup:20,inherits:118,"util-deprecate":304}],45:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./end-of-stream":48,_process:186,dup:21}],46:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{buffer:59,dup:22,util:54}],47:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{_process:186,dup:23}],48:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"../../../errors":39,dup:24}],49:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],50:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{"../../../errors":39,"./end-of-stream":48,dup:26}],51:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{"../../../errors":39,dup:27}],52:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28,events:97}],53:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./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,"./lib/internal/streams/end-of-stream.js":48,"./lib/internal/streams/pipeline.js":50,dup:29}],54:[function(e,t,n){},{}],55:[function(e,t,n){arguments[4][54][0].apply(n,arguments)},{dup:54}],56:[function(e,t,n){(function(e){(function(){t.exports=function(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');return e.allocUnsafe?e.allocUnsafe(t):new e(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59}],57:[function(e,t,n){(function(n){(function(){var i=e("buffer-fill"),s=e("buffer-alloc-unsafe");t.exports=function(e,t,r){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');if(n.alloc)return n.alloc(e,t,r);var a=s(e);return 0===e?a:void 0===t?i(a,0):("string"!=typeof r&&(r=void 0),i(a,t,r))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59,"buffer-alloc-unsafe":56,"buffer-fill":58}],58:[function(e,t,n){(function(e){(function(){var n=function(){try{if(!e.isEncoding("latin1"))return!1;var t=e.alloc?e.alloc(4):new e(4);return t.fill("ab","ucs2"),"61006200"===t.toString("hex")}catch(e){return!1}}();function i(e,t,n,i){if(n<0||i>e.length)throw new RangeError("Out of range index");return n>>>=0,(i=void 0===i?e.length:i>>>0)>n&&e.fill(t,n,i),e}t.exports=function(t,s,r,a,o){if(n)return t.fill(s,r,a,o);if("number"==typeof s)return i(t,s,r,a);if("string"==typeof s){if("string"==typeof r?(o=r,r=0,a=t.length):"string"==typeof a&&(o=a,a=t.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string")Line truncated
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var i=e("base64-js"),s=e("ieee754");n.Buffer=t,n.SlowBuffer=function(e){+e!=e&&(e=0);return t.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return n.__proto__=t.prototype,n}function t(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,n)}function o(e,n,i){if("string"==typeof e)return function(e,n){"string"==typeof n&&""!==n||(n="utf8");if(!t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|d(e,n),s=a(i),r=s.write(e,n);r!==i&&(s=s.slice(0,r));return s}(e,n);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return function(e,n,i){if(n<0||e.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');var s;s=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i);return s.__proto__=t.prototype,s}(e,n,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return t.from(s,n,i);var r=function(e){if(t.isBuffer(e)){var n=0|u(e.length),i=a(n);return 0===i.length||e.copy(i,0,0,n),i}if(void 0!==e.length)return"number"!=typeof e.length||D(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return t.from(e[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),a(e<0?0:0|u(e))}function p(e){for(var t=e.length<0?0:0|u(e.length),n=a(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function u(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function d(e,n){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===i)return 0;for(var r=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(r)return s?-1:P(e).length;n=(""+n).toLowerCase(),r=!0}}function h(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function f(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,n,i,s,r){if(0===e.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),D(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof n&&(n=t.from(n,s)),t.isBuffer(n))return 0===n.length?-1:g(e,n,i,s,r);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,n,i):Uint8Array.prototype.lastIndexOf.call(e,n,i):g(e,[n],i,s,r);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,i,s){var r,a=1,o=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var p=-1;for(r=n;r<o;r++)if(l(e,r)===l(t,-1===p?0:r-p)){if(-1===p&&(p=r),r-p+1===c)return p*a}else-1!==p&&(r-=r-p),p=-1}else for(n+c>o&&(n=o-c),r=n;r>=0;r--){for(var u=!0,d=0;d<c;d++)if(l(e,r+d)!==l(t,d)){u=!1;break}if(u)return r}return-1}function b(e,t,n,i){n=Number(n)||0;var s=e.length-n;i?(i=Number(i))>s&&(i=s):i=s;var r=t.length;i>r/2&&(i=r/2);for(var a=0;a<i;++a){var o=parseInt(t.substr(2*a,2),16);if(D(o))return a;e[n+a]=o}return a}funcLine truncated
"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var s=2147483647;function r(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,n)}function o(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),i=r(n),s=i.write(e,t);s!==n&&(i=i.slice(0,s));return i}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n);return i.__proto__=a.prototype,i}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return a.from(i,t,n);var s=function(e){if(a.isBuffer(e)){var t=0|u(e.length),n=r(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||D(e.length)?r(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),r(e<0?0:0|u(e))}function p(e){for(var t=e.length<0?0:0|u(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function u(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return N(e).length;default:if(s)return i?-1:P(e).length;t=(""+t).toLowerCase(),s=!0}}function h(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function f(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,s){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),D(n=+n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,i,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,i,s);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,i,s){var r,a=1,o=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var p=-1;for(r=n;r<o;r++)if(l(e,r)===l(t,-1===p?0:r-p)){if(-1===p&&(p=r),r-p+1===c)return p*a}else-1!==p&&(r-=r-p),p=-1}else for(n+c>o&&(n=o-c),r=n;r>=0;r--){for(var u=!0,d=0;d<c;d++)if(l(e,r+d)!==l(t,d)){u=!1;break}if(u)return r}return-1}function v(e,t,n,i){n=Number(n)||0;var s=e.length-n;i?(i=Number(i))>s&&(i=s):i=s;var r=t.length;i>r/2&&(i=r/2);for(var a=0;a<i;++a){var o=parseInt(t.substr(2*a,2),16);if(D(o))return a;e[n+a]=o}return a}funcLine truncated
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return o(e,t);return null},t.exports.format=o,t.exports.parse=c;var i=/\B(?=(\d{3})+(?!\d))/g,s=/(?:\.0*|(\.[^0]+)0+)$/,r={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,t){if(!Number.isFinite(e))return null;var n=Math.abs(e),a=t&&t.thousandsSeparator||"",o=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,l=Boolean(t&&t.fixedDecimals),p=t&&t.unit||"";p&&r[p.toLowerCase()]||(p=n>=r.pb?"PB":n>=r.tb?"TB":n>=r.gb?"GB":n>=r.mb?"MB":n>=r.kb?"KB":"B");var u=(e/r[p.toLowerCase()]).toFixed(c);return l||(u=u.replace(s,"$1")),a&&(u=u.replace(i,a)),u+o+p}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=a.exec(e),i="b";return n?(t=parseFloat(n[1]),i=n[4].toLowerCase()):(t=parseInt(e,10),i="b"),Math.floor(r[i]*t)}},{}],54:[function(e,t,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],55:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{"./_stream_readable":57,"./_stream_writable":59,_process:181,dup:11,inherits:111}],56:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"./_stream_transform":58,dup:12,inherits:111}],57:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{"../errors":54,"./_stream_duplex":55,"./internal/streams/async_iterator":60,"./internal/streams/buffer_list":61,"./internal/streams/destroy":62,"./internal/streams/from":64,"./internal/streams/state":66,"./internal/streams/stream":67,_process:181,buffer:51,dup:13,events:90,inherits:111,"string_decoder/":271,util:46}],58:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{"../errors":54,"./_stream_duplex":55,dup:14,inherits:111}],59:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{"../errors":54,"./_stream_duplex":55,"./internal/streams/destroy":62,"./internal/streams/state":66,"./internal/streams/stream":67,_process:181,buffer:51,dup:15,inherits:111,"util-deprecate":283}],60:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./end-of-stream":63,_process:181,dup:16}],61:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{buffer:51,dup:17,util:46}],62:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{_process:181,dup:18}],63:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../../../errors":54,dup:19}],64:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],65:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"../../../errors":54,"./end-of-stream":63,dup:21}],66:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{"../../../errors":54,dup:22}],67:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23,events:90}],68:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"./lib/_stream_duplex.js":55,"./lib/_stream_passthrough.js":56,"./lib/_stream_readable.js":57,"./lib/_stream_transform.js":58,"./lib/_stream_writable.js":59,"./lib/internal/streams/end-of-stream.js":63,"./lib/internal/streams/pipeline.js":65,dup:24}],69:[function(e,t,n){const i=e("block-stream2"),s=e("readable-stream");class r extends s.Writable{constructor(e,t,n={}){if(super(n),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");this._blockstream=new i(t,{zeroPadding:!1}),this._outstandingPuts=0;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,e.put(s,t,(()=>{this._outstandingPuts-=1,0===this._outstandingPuts&&"function"==typeof this._finalCb&&(this._finalCb(null),this._finalCb=null)})),s+=1)})).on("error",(e=>{this.destroy(e)}))}_write(e,t,n){this._blockstream.write(e,t,n)}_final(e){this._blockstream.end(),this._blockstream.once("end",(()=>{0===this._outstandingPuts?e(null):this._finalCb=e}))}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}}t.exports=r},{"block-stream2":30,"readable-stream":68}],70:[function(e,t,n){
"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return o(e,t);return null},t.exports.format=o,t.exports.parse=c;var i=/\B(?=(\d{3})+(?!\d))/g,s=/(?:\.0*|(\.[^0]+)0+)$/,r={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,t){if(!Number.isFinite(e))return null;var n=Math.abs(e),a=t&&t.thousandsSeparator||"",o=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,l=Boolean(t&&t.fixedDecimals),p=t&&t.unit||"";p&&r[p.toLowerCase()]||(p=n>=r.pb?"PB":n>=r.tb?"TB":n>=r.gb?"GB":n>=r.mb?"MB":n>=r.kb?"KB":"B");var u=(e/r[p.toLowerCase()]).toFixed(c);return l||(u=u.replace(s,"$1")),a&&(u=u.replace(i,a)),u+o+p}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=a.exec(e),i="b";return n?(t=parseFloat(n[1]),i=n[4].toLowerCase()):(t=parseInt(e,10),i="b"),Math.floor(r[i]*t)}},{}],62:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],63:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_readable":65,"./_stream_writable":67,_process:186,dup:16,inherits:118}],64:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_transform":66,dup:17,inherits:118}],65:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"../errors":62,"./_stream_duplex":63,"./internal/streams/async_iterator":68,"./internal/streams/buffer_list":69,"./internal/streams/destroy":70,"./internal/streams/from":72,"./internal/streams/state":74,"./internal/streams/stream":75,_process:186,buffer:59,dup:18,events:97,inherits:118,"string_decoder/":285,util:54}],66:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":62,"./_stream_duplex":63,dup:19,inherits:118}],67:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{"../errors":62,"./_stream_duplex":63,"./internal/streams/destroy":70,"./internal/streams/state":74,"./internal/streams/stream":75,_process:186,buffer:59,dup:20,inherits:118,"util-deprecate":304}],68:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./end-of-stream":71,_process:186,dup:21}],69:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{buffer:59,dup:22,util:54}],70:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{_process:186,dup:23}],71:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"../../../errors":62,dup:24}],72:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],73:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{"../../../errors":62,"./end-of-stream":71,dup:26}],74:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{"../../../errors":62,dup:27}],75:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28,events:97}],76:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./lib/_stream_duplex.js":63,"./lib/_stream_passthrough.js":64,"./lib/_stream_readable.js":65,"./lib/_stream_transform.js":66,"./lib/_stream_writable.js":67,"./lib/internal/streams/end-of-stream.js":71,"./lib/internal/streams/pipeline.js":73,dup:29}],77:[function(e,t,n){const i=e("block-stream2"),s=e("readable-stream");class r extends s.Writable{constructor(e,t,n={}){if(super(n),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");this._blockstream=new i(t,{zeroPadding:!1}),this._outstandingPuts=0;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,e.put(s,t,(()=>{this._outstandingPuts-=1,0===this._outstandingPuts&&"function"==typeof this._finalCb&&(this._finalCb(null),this._finalCb=null)})),s+=1)})).on("error",(e=>{this.destroy(e)}))}_write(e,t,n){this._blockstream.write(e,t,n)}_final(e){this._blockstream.end(),this._blockstream.once("end",(()=>{0===this._outstandingPuts?e(null):this._finalCb=e}))}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}}t.exports=r},{"block-stream2":38,"readable-stream":76}],78:[function(e,t,n){
/*!
* clipboard.js v2.0.6
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
var i,s;i=this,s=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),s=document.createRange();s.selectNodeContents(e),i.removeAllRanges(),i.addRange(s),t=i.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var i=this;function s(){i.off(e,s),t.apply(n,arguments)}return s._=t,this.on(e,s,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,s=n.length;i<s;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],s=[];if(i&&t)for(var r=0,a=i.length;r<a;r++)i[r].fn!==t&&i[r].fn._!==t&&s.push(i[r]);return s.length?n[e]=s:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},function(e,t,n){var i=n(3),s=n(4);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(i.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(i.string(e))return function(e,t,n){return s(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){var i=n(5);function s(e,t,n,i,s){var a=r.apply(this,arguments);return e.addEventListener(n,a,s),{destroy:function(){e.removeEventListener(n,a,s)}}}function r(e,t,n,s){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&s.call(e,n)}}e.exports=function(e,t,n,i,r){return"function"==typeof e.addEventListener?s.apply(null,arguments):"function"==typeof n?s.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return s(e,t,n,i,r)})))}},function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},function(e,t,n){"use strict";n.r(t);var i=n(0),s=n.n(i),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return a(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=Line truncated
var i,s;i=this,s=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),s=document.createRange();s.selectNodeContents(e),i.removeAllRanges(),i.addRange(s),t=i.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var i=this;function s(){i.off(e,s),t.apply(n,arguments)}return s._=t,this.on(e,s,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,s=n.length;i<s;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],s=[];if(i&&t)for(var r=0,a=i.length;r<a;r++)i[r].fn!==t&&i[r].fn._!==t&&s.push(i[r]);return s.length?n[e]=s:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},function(e,t,n){var i=n(3),s=n(4);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(i.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(i.string(e))return function(e,t,n){return s(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){var i=n(5);function s(e,t,n,i,s){var a=r.apply(this,arguments);return e.addEventListener(n,a,s),{destroy:function(){e.removeEventListener(n,a,s)}}}function r(e,t,n,s){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&s.call(e,n)}}e.exports=function(e,t,n,i,r){return"function"==typeof e.addEventListener?s.apply(null,arguments):"function"==typeof n?s.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return s(e,t,n,i,r)})))}},function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},function(e,t,n){"use strict";n.r(t);var i=n(0),s=n.n(i),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return a(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=Line truncated
/*! create-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const r=e("bencode"),a=e("block-stream2"),o=e("piece-length"),c=e("path"),l=e("filestream/read"),p=e("is-file"),u=e("junk"),d=e("multistream"),h=e("once"),f=e("run-parallel"),m=e("simple-sha1"),g=e("readable-stream"),b=e("./get-files");function v(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(v(t)):e.concat(t)),[])}function x(e,t,i){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error("invalid input type: "+e)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof b?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let a=null;e.forEach(((t,n)=>{if("string"==typeof t)return;let i=t.fullPath||t.name;i||(i="Unknown File "+(n+1),t.unknownName=!0),t.path=i.split("/"),t.path[0]||t.path.shift(),t.path.length<2?a=null:0===n&&e.length>1?a=t.path[0]:t.path[0]!==a&&(a=null)})),e=e.filter((e=>{if("string"==typeof e)return!0;const t=e.path[e.path.length-1];return"."!==t[0]&&u.not(t)})),a&&e.forEach((e=>{const t=(s.isBuffer(e)||w(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&a&&(t.name=a),t.name||e.some((e=>"string"==typeof e?(t.name=c.basename(e),!0):e.unknownName?void 0:(t.name=e.path[e.path.length-1],!0))),t.name||(t.name="Unnamed Torrent "+Date.now());const o=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let d=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");p(e[0],((e,t)=>{if(e)return i(e);d=t,h()}))}else n.nextTick((()=>{h()}));function h(){f(e.map((e=>t=>{const n={};if(y(e))n.getStream=function(e){return()=>new l(e)}(e),n.length=e.size;else if(s.isBuffer(e))n.getStream=(i=e,()=>{const e=new g.PassThrough;return e.end(i),e}),n.length=e.length;else{if(!w(e)){if("string"==typeof e){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");return void b(e,o>1||d,t)}throw new Error("invalid input type")}n.getStream=function(e,t){return()=>{const n=new g.Transform;return n._transform=function(e,n,i){t.length+=e.length,this.push(e),i()},e.pipe(n),n}}(e,n),n.length=0}var i;n.path=e.path,t(null,n)})),((e,t)=>{if(e)return i(e);t=v(t),i(null,t,d)}))}}function _(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function w(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,n,c){"function"==typeof n&&([n,c]=[c,n]),x(e,n=n?Object.assign({},n):{},((e,l,p)=>{if(e)return c(e);n.singleFileTorrent=p,function(e,n,c){let l=n.announceList;l||("string"==typeof n.announce?l=[[n.announce]]:Array.isArray(n.announce)&&(l=n.announce.map((e=>[e]))));l||(l=[]);i.WEBTORRENT_ANNOUNCE&&("string"==typeof i.WEBTORRENT_ANNOUNCE?l.push([[i.WEBTORRENT_ANNOUNCE]]):Array.isArray(i.WEBTORRENT_ANNOUNCE)&&(l=l.concat(i.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===n.announce&&void 0===n.announceList&&(l=l.concat(t.exports.announceList));"string"==typeof n.urlList&&(n.urlList=[n.urlList]);const p={info:{name:n.name},"creation date":Math.ceil((Number(n.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==l.length&&(p.announce=l[0][0],p["announce-list"]=l);void 0!==n.comment&&(p.comment=n.comment);void 0!==n.createdBy&&(p["created by"]=n.createdBy);void 0!==n.private&&(p.info.private=Number(n.private));void 0!==n.info&&Object.assign(p.info,n.info);void 0!==n.sslCert&&(p.info["ssl-cert"]=n.sslCert);void 0!==n.urlList&&(p["url-list"]=n.urlList);const u=n.pieceLength||o(e.reduce(_,0));p.info["piece length"]=u,function(e,t,n){n=h(n);const i=[];let r=0;const o=e.map((e=>e.getStream));let c=0,l=0,p=!1;const u=new d(o),f=new a(t,{zeroPadding:!1});function g(e){r+=e.length;const t=l;m(e,(e=>{i[t]=e,c-=1,_()})),c+=1,l+=1}function b(){p=!0,_()}function v(e){x(),n(e)}function x(){u.removeListener("error",v),f.removeListener("data",g),f.removeListener("end",b),f.removeListener("error",v)}function _(){p&&0===c&&(x(),n(null,s.from(i.join(""),"hex"),r))}u.on("error",v),u.pipe(f).on("data",g).on("end",b).on("error",v)}(e,u,((t,i,s)=>{if(t)return c(t);p.info.pieces=i,e.forEach((e=>{delete e.getStream})),n.singleFileTorrent?p.info.length=s:p.info.files=e,c(null,r.encode(p))}))}(l,n,c)}))},t.exports.parseInput=function(e,t,n){"function"==typeof t&&([t,n]=[n,t]),x(e,t=t?Object.assign({},t):{},n)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]]}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./get-files":46,_process:181,bencode:6,"block-stream2":30,buffer:51,"filestream/read":106,"is-file":113,junk:115,multistream:159,once:176,path:179,"piece-length":180Line truncated
const r=e("bencode"),a=e("block-stream2"),o=e("piece-length"),c=e("path"),l=e("filestream/read"),p=e("is-file"),u=e("junk"),d=e("multistream"),h=e("once"),f=e("run-parallel"),m=e("simple-sha1"),g=e("readable-stream"),v=e("./get-files");function b(e){return e.reduce(((e,t)=>Array.isArray(t)?e.concat(b(t)):e.concat(t)),[])}function x(e,t,i){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error("invalid input type: "+e)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof v?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let a=null;e.forEach(((t,n)=>{if("string"==typeof t)return;let i=t.fullPath||t.name;i||(i="Unknown File "+(n+1),t.unknownName=!0),t.path=i.split("/"),t.path[0]||t.path.shift(),t.path.length<2?a=null:0===n&&e.length>1?a=t.path[0]:t.path[0]!==a&&(a=null)})),e=e.filter((e=>{if("string"==typeof e)return!0;const t=e.path[e.path.length-1];return"."!==t[0]&&u.not(t)})),a&&e.forEach((e=>{const t=(s.isBuffer(e)||w(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&a&&(t.name=a),t.name||e.some((e=>"string"==typeof e?(t.name=c.basename(e),!0):e.unknownName?void 0:(t.name=e.path[e.path.length-1],!0))),t.name||(t.name="Unnamed Torrent "+Date.now());const o=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let d=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof v)throw new Error("filesystem paths do not work in the browser");p(e[0],((e,t)=>{if(e)return i(e);d=t,h()}))}else n.nextTick((()=>{h()}));function h(){f(e.map((e=>t=>{const n={};if(y(e))n.getStream=function(e){return()=>new l(e)}(e),n.length=e.size;else if(s.isBuffer(e))n.getStream=(i=e,()=>{const e=new g.PassThrough;return e.end(i),e}),n.length=e.length;else{if(!w(e)){if("string"==typeof e){if("function"!=typeof v)throw new Error("filesystem paths do not work in the browser");return void v(e,o>1||d,t)}throw new Error("invalid input type")}n.getStream=function(e,t){return()=>{const n=new g.Transform;return n._transform=function(e,n,i){t.length+=e.length,this.push(e),i()},e.pipe(n),n}}(e,n),n.length=0}var i;n.path=e.path,t(null,n)})),((e,t)=>{if(e)return i(e);t=b(t),i(null,t,d)}))}}function _(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function w(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,n,c){"function"==typeof n&&([n,c]=[c,n]),x(e,n=n?Object.assign({},n):{},((e,l,p)=>{if(e)return c(e);n.singleFileTorrent=p,function(e,n,c){let l=n.announceList;l||("string"==typeof n.announce?l=[[n.announce]]:Array.isArray(n.announce)&&(l=n.announce.map((e=>[e]))));l||(l=[]);i.WEBTORRENT_ANNOUNCE&&("string"==typeof i.WEBTORRENT_ANNOUNCE?l.push([[i.WEBTORRENT_ANNOUNCE]]):Array.isArray(i.WEBTORRENT_ANNOUNCE)&&(l=l.concat(i.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===n.announce&&void 0===n.announceList&&(l=l.concat(t.exports.announceList));"string"==typeof n.urlList&&(n.urlList=[n.urlList]);const p={info:{name:n.name},"creation date":Math.ceil((Number(n.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==l.length&&(p.announce=l[0][0],p["announce-list"]=l);void 0!==n.comment&&(p.comment=n.comment);void 0!==n.createdBy&&(p["created by"]=n.createdBy);void 0!==n.private&&(p.info.private=Number(n.private));void 0!==n.info&&Object.assign(p.info,n.info);void 0!==n.sslCert&&(p.info["ssl-cert"]=n.sslCert);void 0!==n.urlList&&(p["url-list"]=n.urlList);const u=n.pieceLength||o(e.reduce(_,0));p.info["piece length"]=u,function(e,t,n){n=h(n);const i=[];let r=0;const o=e.map((e=>e.getStream));let c=0,l=0,p=!1;const u=new d(o),f=new a(t,{zeroPadding:!1});function g(e){r+=e.length;const t=l;m(e,(e=>{i[t]=e,c-=1,_()})),c+=1,l+=1}function v(){p=!0,_()}function b(e){x(),n(e)}function x(){u.removeListener("error",b),f.removeListener("data",g),f.removeListener("end",v),f.removeListener("error",b)}function _(){p&&0===c&&(x(),n(null,s.from(i.join(""),"hex"),r))}u.on("error",b),u.pipe(f).on("data",g).on("end",v).on("error",b)}(e,u,((t,i,s)=>{if(t)return c(t);p.info.pieces=i,e.forEach((e=>{delete e.getStream})),n.singleFileTorrent?p.info.length=s:p.info.files=e,c(null,r.encode(p))}))}(l,n,c)}))},t.exports.parseInput=function(e,t,n){"function"==typeof t&&([t,n]=[n,t]),x(e,t=t?Object.assign({},t):{},n)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./get-files":54,_process:186,bencode:6,"block-stream2":38,buffer:59,"filestream/read":113,"is-file":120,junk:122,multistream:165,once:182,path:184,"piecLine truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
n.read=function(e,t,n,i,s){var r,a,o=8*s-i-1,c=(1<<o)-1,l=c>>1,p=-7,u=n?s-1:0,d=n?-1:1,h=e[t+u];for(u+=d,r=h&(1<<-p)-1,h>>=-p,p+=o;p>0;r=256*r+e[t+u],u+=d,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=i;p>0;a=256*a+e[t+u],u+=d,p-=8);if(0===r)r=1-l;else{if(r===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,i),r-=l}return(h?-1:1)*a*Math.pow(2,r-i)},n.write=function(e,t,n,i,s,r){var a,o,c,l=8*r-s-1,p=(1<<l)-1,u=p>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:r-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=p):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(a++,c/=2),a+u>=p?(o=0,a=p):a+u>=1?(o=(t*c-1)*Math.pow(2,s),a+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,s),a=0));s>=8;e[n+h]=255&o,h+=f,o/=256,s-=8);for(a=a<<s|o,l+=s;l>0;e[n+h]=255&a,h+=f,a/=256,l-=8);e[n+h-f]|=128*m}},{}],117:[function(e,t,n){
/*! immediate-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const i=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this.chunkLength=e.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(e,t,n){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,n&&n(t)}))}get(e,t,n){if("function"==typeof t)return this.get(e,null,t);let s=this.mem[e];if(!s)return this.store.get(e,t,n);if(t){const e=t.offset||0,n=t.length?e+t.length:s.length;s=s.slice(e,n)}i((()=>{n&&n(null,s)}))}close(e){this.store.close(e)}destroy(e){this.store.destroy(e)}}},{"queue-microtask":192}],118:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],119:[function(e,t,n){t.exports=function(e){for(var t=0,n=e.length;t<n;++t)if(e.charCodeAt(t)>127)return!1;return!0}},{}],120:[function(e,t,n){"use strict";var i=e("fs");function s(e){return i.existsSync(e)&&i.statSync(e).isFile()}t.exports=function(e,t){if(!t)return s(e);i.stat(e,(function(e,n){return e?t(e):t(null,n.isFile())}))},t.exports.sync=s},{fs:55}],121:[function(e,t,n){t.exports=r,r.strict=a,r.loose=o;var i=Object.prototype.toString,s={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function r(e){return a(e)||o(e)}function a(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return s[i.call(e)]}},{}],122:[function(e,t,n){"use strict";n.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},n.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),n.is=e=>n.regex.test(e),n.not=e=>!n.is(e),n.default=t.exports},{}],123:[function(e,t,n){(function(n){(function(){
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
t.exports=s,t.exports.decode=s,t.exports.encode=function(e){(e=Object.assign({},e)).infoHashBuffer&&(e.xt="urn:btih:"+e.infoHashBuffer.toString("hex"));e.infoHash&&(e.xt="urn:btih:"+e.infoHash);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);let t="magnet:?";return Object.keys(e).filter((e=>2===e.length)).forEach(((n,i)=>{(Array.isArray(e[n])?e[n]:[e[n]]).forEach(((e,s)=>{!(i>0||s>0)||"kt"===n&&0!==s||(t+="&"),"dn"===n&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==n&&"xs"!==n&&"as"!==n&&"ws"!==n||(e=encodeURIComponent(e)),"kt"===n&&(e=encodeURIComponent(e)),t+="kt"===n&&s>0?"+"+e:`${n}=${e}`}))})),t};const i=e("thirty-two");function s(e){const t={},s=e.split("magnet:?")[1];let r;if((s&&s.length>=0?s.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let s=n[1];"dn"===i&&(s=decodeURIComponent(s).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(s=decodeURIComponent(s)),"kt"===i&&(s=decodeURIComponent(s).split("+")),"ix"===i&&(s=Number(s)),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(r=e.match(/^urn:btih:(.{40})/))t.infoHash=r[1].toLowerCase();else if(r=e.match(/^urn:btih:(.{32})/)){const e=i.decode(r[1]);t.infoHash=n.from(e,"binary").toString("hex")}}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),"string"==typeof t.tr?t.announce=[t.tr]:Array.isArray(t.tr)?t.announce=t.tr:t.announce=[],t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t}}).call(this,e("buffer").Buffer)},{buffer:51,"thirty-two":272}],117:[function(e,t,n){t.exports=o;var i=e("inherits"),s=e("readable-stream"),r=e("to-arraybuffer"),a="undefined"!=typeof window&&window.MediaSource;function o(e,t){var n=this;if(!(n instanceof o))return new o(e,t);if(!a)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||60,n._elem=e,n._mediaSource=new a,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function c(e,t){var n=this;if(s.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}o.prototype.createWriteStream=function(e){return new c(this,e)},o.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},o.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,s;n=e._debugBuffers,i="mediasource-stream-"+t,(s=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),s.download=i,s.click()})))},i(c,s.Writable),c.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},c.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&Line truncated
t.exports=r,t.exports.decode=r,t.exports.encode=function(e){(e=Object.assign({},e)).infoHashBuffer&&(e.xt="urn:btih:"+e.infoHashBuffer.toString("hex"));e.infoHash&&(e.xt="urn:btih:"+e.infoHash);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let t="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((n,i)=>{const r=Array.isArray(e[n])?e[n]:[e[n]];r.forEach(((e,s)=>{(i>0||s>0)&&("kt"!==n&&"so"!==n||0===s)&&(t+="&"),"dn"===n&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==n&&"xs"!==n&&"as"!==n&&"ws"!==n||(e=encodeURIComponent(e)),"kt"===n&&(e=encodeURIComponent(e)),"so"!==n&&(t+="kt"===n&&s>0?"+"+e:`${n}=${e}`)})),"so"===n&&(t+=`${n}=${s.compose(r)}`)})),t};const i=e("thirty-two"),s=e("bep53-range");function r(e){const t={},r=e.split("magnet:?")[1];let a;if((r&&r.length>=0?r.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let r=n[1];"dn"===i&&(r=decodeURIComponent(r).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(r=decodeURIComponent(r)),"kt"===i&&(r=decodeURIComponent(r).split("+")),"ix"===i&&(r=Number(r)),"so"===i&&(r=s.parse(decodeURIComponent(r).split(","))),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(r)):t[i]=r})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(a=e.match(/^urn:btih:(.{40})/))t.infoHash=a[1].toLowerCase();else if(a=e.match(/^urn:btih:(.{32})/)){const e=i.decode(a[1]);t.infoHash=n.from(e,"binary").toString("hex")}}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":7,buffer:59,"thirty-two":286}],124:[function(e,t,n){
/*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=o;var i=e("inherits"),s=e("readable-stream"),r=e("to-arraybuffer"),a="undefined"!=typeof window&&window.MediaSource;function o(e,t){var n=this;if(!(n instanceof o))return new o(e,t);if(!a)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||60,n._elem=e,n._mediaSource=new a,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function c(e,t){var n=this;if(s.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}o.prototype.createWriteStream=function(e){return new c(this,e)},o.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},o.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,s;n=e._debugBuffers,i="mediasource-stream-"+t,(s=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),s.download=i,s.click()})))},i(c,s.Writable),c.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},c.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},c.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(a.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},c.prototype._write=function(e,t,n){var i=this;if(!i.destroyed)if(i._sourceBuffer){if(i._sourceBuffer.updating)return n(new Error("Cannot append buffer while source buffer updating"));var s=r(e);i._wrapper._debug&&i._debugBuffers.push(s);try{i._sourceBuffer.appendBuffer(s)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(s){if(s)return n(s);i._write(e,t,n)}},c.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};c.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,n=-1,i=0;i<e.length;i++){var s=e.start(i),r=e.end(i)+0;if(s>t)break;(n>=0||t<=r)&&(n=r)}var a=n-t;return a<0&&(a=0),a}},{inherits:118,"readable-stream":139,"to-arraybuffer":288}],125:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],126:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_readable":128,"./_stream_writable":130,_process:186,dup:16,inherits:118}],127:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_transform":129,dup:17,inherits:118}],128:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"../errors":125,"./_stream_duplex":126,"./internal/streams/async_iterator":131,"./internal/streams/buffer_list":132,"./internal/streams/destroy":133,"./internal/streams/from":135,"./internal/streams/state":137Line truncated
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* MIT Licensed
*/
t.exports=e("./db.json")},{"./db.json":134}],136:[function(e,t,n){
t.exports=e("./db.json")},{"./db.json":141}],143:[function(e,t,n){
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
"use strict";var i,s,r,a=e("mime-db"),o=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!l.test(t[1]))&&"UTF-8"}n.charset=p,n.charsets={lookup:p},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var i=n.charset(t);i&&(t+="; charset="+i.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&n.extensions[t[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=o("x."+e).toLowerCase().substr(1);if(!t)return!1;return n.types[t]||!1},n.types=Object.create(null),i=n.extensions,s=n.types,r=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){i[e]=n;for(var o=0;o<n.length;o++){var c=n[o];if(s[c]){var l=r.indexOf(a[s[c]].source),p=r.indexOf(t.source);if("application/octet-stream"!==s[c]&&(l>p||l===p&&"application/"===s[c].substr(0,12)))continue}s[c]=e}}}))},{"mime-db":135,path:179}],137:[function(e,t,n){(function(t){var i=e("./index"),s=e("./descriptor"),r=e("uint64be"),a=20828448e5;n.fullBoxes={};function o(e,t,n){for(var i=t;i<n;i++)e[i]=0}function c(e,t,n){t.writeUInt32BE(Math.floor((e.getTime()+a)/1e3),n)}function l(e,t,n){t.writeUIntBE(Math.floor((e.getTime()+a)/1e3),n,6)}function p(e,t,n){t.writeUInt16BE(Math.floor(e)%65536,n),t.writeUInt16BE(Math.floor(256*e*256)%65536,n+2)}function u(e,t,n){e||(e=[0,0,0,0,0,0,0,0,0]);for(var i=0;i<e.length;i++)p(e[i],t,n+4*i)}function d(e){for(var t=new Array(e.length/4),n=0;n<t.length;n++)t[n]=m(e,4*n);return t}function h(e,t){return new Date(1e3*e.readUIntBE(t,6)-a)}function f(e,t){return new Date(1e3*e.readUInt32BE(t)-a)}function m(e,t){return e.readUInt16BE(t)+e.readUInt16BE(t+2)/65536}function g(e,t){return e[t]+e[t+1]/256}function b(e,t,n){var i;for(i=0;i<n&&0!==e[t+i];i++);return e.toString("utf8",t,t+i)}["mvhd","tkhd","mdhd","vmhd","smhd","stsd","esds","stsz","stco","co64","stss","stts","ctts","stsc","dref","elst","hdlr","mehd","trex","mfhd","tfhd","tfdt","trun"].forEach((function(e){n.fullBoxes[e]=!0})),n.ftyp={},n.ftyp.encode=function(e,i,s){i=i?i.slice(s):t.alloc(n.ftyp.encodingLength(e));var r=e.compatibleBrands||[];i.write(e.brand,0,4,"ascii"),i.writeUInt32BE(e.brandVersion,4);for(var a=0;a<r.length;a++)i.write(r[a],8+4*a,4,"ascii");return n.ftyp.encode.bytes=8+4*r.length,i},n.ftyp.decode=function(e,t){for(var n=(e=e.slice(t)).toString("ascii",0,4),i=e.readUInt32BE(4),s=[],r=8;r<e.length;r+=4)s.push(e.toString("ascii",r,r+4));return{brand:n,brandVersion:i,compatibleBrands:s}},n.ftyp.encodingLength=function(e){return 8+4*(e.compatibleBrands||[]).length},n.mvhd={},n.mvhd.encode=function(e,i,s){return i=i?i.slice(s):t.alloc(96),c(e.ctime||new Date,i,0),c(e.mtime||new Date,i,4),i.writeUInt32BE(e.timeScale||0,8),i.writeUInt32BE(e.duration||0,12),p(e.preferredRate||0,i,16),function(e,t,n){t[n]=Math.floor(e)%256,t[n+1]=Math.floor(256*e)%256}(e.preferredVolume||0,i,20),o(i,22,32),u(e.matrix,i,32),i.writeUInt32BE(e.previewTime||0,68),i.writeUInt32BE(e.previewDuration||0,72),i.writeUInt32BE(e.posterTime||0,76),i.writeUInt32BE(e.selectionTime||0,80),i.writeUInt32BE(e.selectionDuration||0,84),i.writeUInt32BE(e.currentTime||0,88),i.writeUInt32BE(e.nextTrackId||0,92),n.mvhd.encode.bytes=96,i},n.mvhd.decode=function(e,t){return{ctime:f(e=e.slice(t),0),mtime:f(e,4),timeScale:e.readUInt32BE(8),duration:e.readUInt32BE(12),preferredRate:m(e,16),preferredVolume:g(e,20),matrix:d(e.slice(32,68)),previewTime:e.readUInt32BE(68),previewDuration:e.readUInt32BE(72),posterTime:e.readUInt32BE(76),selectionTime:e.readUInt32BE(80),selectionDuration:e.readUInt32BE(84),currentTime:e.readUInt32BE(88),nextTrackId:e.readUInt32BE(92)}},n.mvhd.encodingLength=function(e){return 96},n.tkhd={},n.tkhd.encode=function(e,i,s){return i=i?i.slice(s):t.alloc(80),c(e.ctime||new Date,i,0),c(e.mtime||new Date,i,4),i.writeUInt32BE(e.trackId||0,8),o(i,12,16),i.writeUInt32BE(e.duration||0,16),o(i,20,28),i.writeUInt16BE(e.layer||0,28),i.writeUInt16BE(e.alternateGroup||0,30),i.writeUInt16BE(e.volume||0,32),u(e.matrix,i,36),i.writeUInt32BE(e.trackWidth||0,72),i.writeUInt32BE(e.trackHeight||0,76),n.tkhd.encode.bytes=80,i},n.tkhd.decode=function(e,t){return{ctime:f(e=e.slice(t),0),mtime:f(e,4),trackId:e.readUInt32BE(8),duration:e.readUInt32BE(16),layer:e.readUInt16BE(28),alternateGroup:e.readUInt16BE(30),volume:e.readUInt16BE(32),matrix:d(e.slice(36,72)),trackWidth:e.readUInt32BE(72),trackHeight:e.readUInt32BE(76)}},n.tkhd.encodingLength=function(e){return 80},n.mdhd={},n.mdhd.encode=function(e,i,s){return 1===e.version?(i=i?i.slice(s):t.alloc(32),l(e.ctime||new Date,i,0),l(e.mtime||new Date,i,8),i.writeUInt32BE(e.timeScale||0,16),i.writeUIntBE(e.duration||0,20,6),i.writeUInt16BE(e.lanLine truncated
"use strict";var i,s,r,a=e("mime-db"),o=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!l.test(t[1]))&&"UTF-8"}n.charset=p,n.charsets={lookup:p},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var i=n.charset(t);i&&(t+="; charset="+i.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&n.extensions[t[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=o("x."+e).toLowerCase().substr(1);if(!t)return!1;return n.types[t]||!1},n.types=Object.create(null),i=n.extensions,s=n.types,r=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){i[e]=n;for(var o=0;o<n.length;o++){var c=n[o];if(s[c]){var l=r.indexOf(a[s[c]].source),p=r.indexOf(t.source);if("application/octet-stream"!==s[c]&&(l>p||l===p&&"application/"===s[c].substr(0,12)))continue}s[c]=e}}}))},{"mime-db":142,path:184}],144:[function(e,t,n){(function(t){(function(){var i=e("./index"),s=e("./descriptor"),r=e("uint64be"),a=20828448e5;n.fullBoxes={};function o(e,t,n){for(var i=t;i<n;i++)e[i]=0}function c(e,t,n){t.writeUInt32BE(Math.floor((e.getTime()+a)/1e3),n)}function l(e,t,n){t.writeUIntBE(Math.floor((e.getTime()+a)/1e3),n,6)}function p(e,t,n){t.writeUInt16BE(Math.floor(e)%65536,n),t.writeUInt16BE(Math.floor(256*e*256)%65536,n+2)}function u(e,t,n){e||(e=[0,0,0,0,0,0,0,0,0]);for(var i=0;i<e.length;i++)p(e[i],t,n+4*i)}function d(e){for(var t=new Array(e.length/4),n=0;n<t.length;n++)t[n]=m(e,4*n);return t}function h(e,t){return new Date(1e3*e.readUIntBE(t,6)-a)}function f(e,t){return new Date(1e3*e.readUInt32BE(t)-a)}function m(e,t){return e.readUInt16BE(t)+e.readUInt16BE(t+2)/65536}function g(e,t){return e[t]+e[t+1]/256}function v(e,t,n){var i;for(i=0;i<n&&0!==e[t+i];i++);return e.toString("utf8",t,t+i)}["mvhd","tkhd","mdhd","vmhd","smhd","stsd","esds","stsz","stco","co64","stss","stts","ctts","stsc","dref","elst","hdlr","mehd","trex","mfhd","tfhd","tfdt","trun"].forEach((function(e){n.fullBoxes[e]=!0})),n.ftyp={},n.ftyp.encode=function(e,i,s){i=i?i.slice(s):t.alloc(n.ftyp.encodingLength(e));var r=e.compatibleBrands||[];i.write(e.brand,0,4,"ascii"),i.writeUInt32BE(e.brandVersion,4);for(var a=0;a<r.length;a++)i.write(r[a],8+4*a,4,"ascii");return n.ftyp.encode.bytes=8+4*r.length,i},n.ftyp.decode=function(e,t){for(var n=(e=e.slice(t)).toString("ascii",0,4),i=e.readUInt32BE(4),s=[],r=8;r<e.length;r+=4)s.push(e.toString("ascii",r,r+4));return{brand:n,brandVersion:i,compatibleBrands:s}},n.ftyp.encodingLength=function(e){return 8+4*(e.compatibleBrands||[]).length},n.mvhd={},n.mvhd.encode=function(e,i,s){return i=i?i.slice(s):t.alloc(96),c(e.ctime||new Date,i,0),c(e.mtime||new Date,i,4),i.writeUInt32BE(e.timeScale||0,8),i.writeUInt32BE(e.duration||0,12),p(e.preferredRate||0,i,16),function(e,t,n){t[n]=Math.floor(e)%256,t[n+1]=Math.floor(256*e)%256}(e.preferredVolume||0,i,20),o(i,22,32),u(e.matrix,i,32),i.writeUInt32BE(e.previewTime||0,68),i.writeUInt32BE(e.previewDuration||0,72),i.writeUInt32BE(e.posterTime||0,76),i.writeUInt32BE(e.selectionTime||0,80),i.writeUInt32BE(e.selectionDuration||0,84),i.writeUInt32BE(e.currentTime||0,88),i.writeUInt32BE(e.nextTrackId||0,92),n.mvhd.encode.bytes=96,i},n.mvhd.decode=function(e,t){return{ctime:f(e=e.slice(t),0),mtime:f(e,4),timeScale:e.readUInt32BE(8),duration:e.readUInt32BE(12),preferredRate:m(e,16),preferredVolume:g(e,20),matrix:d(e.slice(32,68)),previewTime:e.readUInt32BE(68),previewDuration:e.readUInt32BE(72),posterTime:e.readUInt32BE(76),selectionTime:e.readUInt32BE(80),selectionDuration:e.readUInt32BE(84),currentTime:e.readUInt32BE(88),nextTrackId:e.readUInt32BE(92)}},n.mvhd.encodingLength=function(e){return 96},n.tkhd={},n.tkhd.encode=function(e,i,s){return i=i?i.slice(s):t.alloc(80),c(e.ctime||new Date,i,0),c(e.mtime||new Date,i,4),i.writeUInt32BE(e.trackId||0,8),o(i,12,16),i.writeUInt32BE(e.duration||0,16),o(i,20,28),i.writeUInt16BE(e.layer||0,28),i.writeUInt16BE(e.alternateGroup||0,30),i.writeUInt16BE(e.volume||0,32),u(e.matrix,i,36),i.writeUInt32BE(e.trackWidth||0,72),i.writeUInt32BE(e.trackHeight||0,76),n.tkhd.encode.bytes=80,i},n.tkhd.decode=function(e,t){return{ctime:f(e=e.slice(t),0),mtime:f(e,4),trackId:e.readUInt32BE(8),duration:e.readUInt32BE(16),layer:e.readUInt16BE(28),alternateGroup:e.readUInt16BE(30),volume:e.readUInt16BE(32),matrix:d(e.slice(36,72)),trackWidth:e.readUInt32BE(72),trackHeight:e.readUInt32BE(76)}},n.tkhd.encodingLength=function(e){return 80},n.mdhd={},n.mdhd.encode=function(e,i,s){return 1===e.version?(i=i?i.slice(s):t.alloc(32),l(e.ctime||new Date,i,0),l(e.mtime||new Date,i,8),i.writeUInt32BE(e.timeScale||0,16),i.writeUIntBE(e.duration||0,20,6),i.writeUILine truncated
/*! multistream. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("readable-stream");function s(e){return a(e,{objectMode:!0,highWaterMark:16})}function r(e){return a(e)}function a(e,t){if(!e||"function"==typeof e||e._readableState)return e;var n=new i.Readable(t).wrap(e);return e.destroy&&(n.destroy=e.destroy.bind(e)),n}class o extends i.Readable{constructor(e,t){super(t),this.destroyed=!1,this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=t&&t.objectMode?s:r,"function"==typeof e?this._queue=e:(this._queue=e.map(this._toStreams2),this._queue.forEach((e=>{"function"!=typeof e&&this._attachErrorListener(e)}))),this._next()}_read(){this._drained=!0,this._forward()}_forward(){if(!this._forwarding&&this._drained&&this._current){var e;for(this._forwarding=!0;this._drained&&null!==(e=this._current.read());)this._drained=this.push(e);this._forwarding=!1}}destroy(e){this.destroyed||(this.destroyed=!0,this._current&&this._current.destroy&&this._current.destroy(),"function"!=typeof this._queue&&this._queue.forEach((e=>{e.destroy&&e.destroy()})),e&&this.emit("error",e),this.emit("close"))}_next(){if(this._current=null,"function"==typeof this._queue)this._queue(((e,t)=>{if(e)return this.destroy(e);t=this._toStreams2(t),this._attachErrorListener(t),this._gotNextStream(t)}));else{var e=this._queue.shift();"function"==typeof e&&(e=this._toStreams2(e()),this._attachErrorListener(e)),this._gotNextStream(e)}}_gotNextStream(e){if(!e)return this.push(null),void this.destroy();this._current=e,this._forward();const t=()=>{this._forward()},n=()=>{e._readableState.ended||this.destroy()},i=()=>{this._current=null,e.removeListener("readable",t),e.removeListener("end",i),e.removeListener("close",n),this._next()};e.on("readable",t),e.once("end",i),e.once("close",n)}_attachErrorListener(e){if(!e)return;const t=n=>{e.removeListener("error",t),this.destroy(n)};e.once("error",t)}}o.obj=e=>new o(e,{objectMode:!0,highWaterMark:16}),t.exports=o},{"readable-stream":180}],166:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],167:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_readable":169,"./_stream_writable":171,_process:186,dup:16,inherits:118}],168:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_transform":170,dup:17,inherits:118}],169:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"../errors":166,"./_stream_duplex":167,"./internal/streams/async_iterator":172,"./internal/streams/buffer_list":173,"./internal/streams/destroy":174,"./internal/streams/from":176,"./internal/streams/state":178,"./internal/streams/stream":179,_process:186,buffer:59,dup:18,events:97,inherits:118,"string_decoder/":285,util:54}],170:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":166,"./_stream_duplex":167,dup:19,inherits:118}],171:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{"../errors":166,"./_stream_duplex":167,"./internal/streams/destroy":174,"./internal/streams/state":178,"./internal/streams/stream":179,_process:186,buffer:59,dup:20,inherits:118,"util-deprecate":304}],172:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./end-of-stream":175,_process:186,dup:21}],173:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{buffer:59,dup:22,util:54}],174:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{_process:186,dup:23}],175:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"../../../errors":166,dup:24}],176:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],177:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{"../../../errors":166,"./end-of-stream":175,dup:26}],178:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{"../../../errors":166,dup:27}],179:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28,events:97}],180:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./lib/_stream_duplex.js":167,"./lib/_stream_passthrough.js":168,"./lib/_stream_readable.js":169,"./lib/_stream_transform.js":170,"./lib/_stream_writable.js":171,"./lib/internal/streams/end-of-stream.js":175,"./lib/internal/streams/pipeline.js":177,dup:29}],181:[function(e,t,n){t.exports=function(e,t){var n=null;return e.on(t,(function(e){if(n){var t=n;n=null,t(e)}})),function(e){n=e}}},{}],182:[function(e,t,n){var i=e("wrappy");function s(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}t.exports=i(s),t.exports.strict=i(r),s.proto=s((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}))},{wrappy:333}],183:[function(e,t,n){(function(n,i){(function(){
/*! parse-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const s=e("bencode"),r=e("blob-to-buffer"),a=e("fs"),o=e("simple-get"),c=e("magnet-uri"),l=e("path"),p=e("simple-sha1");function u(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=c(e);if(!t.infoHash)throw new Error("Invalid torrent identifier");return t}if("string"==typeof e&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e)))return c("magnet:?xt=urn:btih:"+e);if(i.isBuffer(e)&&20===e.length)return c("magnet:?xt=urn:btih:"+e.toString("hex"));if(i.isBuffer(e))return function(e){i.isBuffer(e)&&(e=s.decode(e));h(e.info,"info"),h(e.info["name.utf-8"]||e.info.name,"info.name"),h(e.info["piece length"],"info['piece length']"),h(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{h("number"==typeof e.length,"info.files[0].length"),h(e["path.utf-8"]||e.path,"info.files[0].path")})):h("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:s.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=p.sync(t.infoBuffer),t.infoHashBuffer=i.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());i.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());i.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const n=e.info.files||[e.info];t.files=n.map(((e,i)=>{const s=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:l.join.apply(null,[l.sep].concat(s)).slice(1),name:s[s.length-1],length:e.length,offset:n.slice(0,i).reduce(d,0)}})),t.length=n.reduce(d,0);const r=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(r.offset+r.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let n=0;n<e.length;n+=20)t.push(e.slice(n,n+20).toString("hex"));return t}(e.info.pieces),t}(e);if(e&&e.infoHash)return e.infoHash=e.infoHash.toLowerCase(),e.announce||(e.announce=[]),"string"==typeof e.announce&&(e.announce=[e.announce]),e.urlList||(e.urlList=[]),e;throw new Error("Invalid torrent identifier")}function d(e,t){return e+t.length}function h(e,t){if(!e)throw new Error("Torrent is missing required field: "+t)}t.exports=u,t.exports.remote=function(e,t){let i;if("function"!=typeof t)throw new Error("second argument must be a Function");try{i=u(e)}catch(e){}i&&i.infoHash?n.nextTick((()=>{t(null,i)})):(s=e,"undefined"!=typeof Blob&&s instanceof Blob?r(e,((e,n)=>{if(e)return t(new Error("Error converting Blob: "+e.message));c(n)})):"function"==typeof o&&/^https?:/.test(e)?o.concat({url:e,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},((e,n,i)=>{if(e)return t(new Error("Error downloading torrent: "+e.message));c(i)})):"function"==typeof a.readFile&&"string"==typeof e?a.readFile(e,((e,n)=>{if(e)return t(new Error("Invalid torrent identifier"));c(n)})):n.nextTick((()=>{t(new Error("Invalid torrent identifier"))})));var s;function c(e){try{i=u(e)}catch(e){return t(e)}i&&i.infoHash?t(null,i):t(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=c.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=i.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return s.encode(t)},i.alloc(0)}).call(this,e("_process"),e("buffer").Buffer)},{_process:181,bencode:6,"blob-to-buffer":29,buffer:51,fs:47,"magnet-uri":116,path:179,"simple-get":213,"simple-sha1":230}],179:[function(e,t,n){(function(e){function t(e,t){for(var n=0,i=e.length-1;i>=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i<e.length;i++)t(e[i],i,e)&&n.push(e[i]);return n}n.resolve=function(){for(var n="",s=!1,r=arguments.length-1;r>=-1&&!s;r--){var a=r>=0?arguments[r]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,s="/"===a.charAt(0))}return(s?"/":"")+(n=t(i(n.split("/"),(function(e){return!!e})),!s).join("/"))||"."},n.normalize=function(e){var r=n.isAbsolute(e),a="/"===s(e,-1);return(e=t(i(e.split("/"),(function(e){return!!e})),!r).join("/"))||r||(e="."),e&&a&&(e+="/"),(r?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(Line truncated
const s=e("bencode"),r=e("blob-to-buffer"),a=e("fs"),o=e("simple-get"),c=e("magnet-uri"),l=e("path"),p=e("simple-sha1");function u(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=c(e);if(!t.infoHash)throw new Error("Invalid torrent identifier");return t}if("string"==typeof e&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e)))return c("magnet:?xt=urn:btih:"+e);if(i.isBuffer(e)&&20===e.length)return c("magnet:?xt=urn:btih:"+e.toString("hex"));if(i.isBuffer(e))return function(e){i.isBuffer(e)&&(e=s.decode(e));h(e.info,"info"),h(e.info["name.utf-8"]||e.info.name,"info.name"),h(e.info["piece length"],"info['piece length']"),h(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{h("number"==typeof e.length,"info.files[0].length"),h(e["path.utf-8"]||e.path,"info.files[0].path")})):h("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:s.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=p.sync(t.infoBuffer),t.infoHashBuffer=i.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());i.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());i.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const n=e.info.files||[e.info];t.files=n.map(((e,i)=>{const s=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:l.join.apply(null,[l.sep].concat(s)).slice(1),name:s[s.length-1],length:e.length,offset:n.slice(0,i).reduce(d,0)}})),t.length=n.reduce(d,0);const r=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(r.offset+r.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let n=0;n<e.length;n+=20)t.push(e.slice(n,n+20).toString("hex"));return t}(e.info.pieces),t}(e);if(e&&e.infoHash)return e.infoHash=e.infoHash.toLowerCase(),e.announce||(e.announce=[]),"string"==typeof e.announce&&(e.announce=[e.announce]),e.urlList||(e.urlList=[]),e;throw new Error("Invalid torrent identifier")}function d(e,t){return e+t.length}function h(e,t){if(!e)throw new Error("Torrent is missing required field: "+t)}t.exports=u,t.exports.remote=function(e,t){let i;if("function"!=typeof t)throw new Error("second argument must be a Function");try{i=u(e)}catch(e){}i&&i.infoHash?n.nextTick((()=>{t(null,i)})):(s=e,"undefined"!=typeof Blob&&s instanceof Blob?r(e,((e,n)=>{if(e)return t(new Error("Error converting Blob: "+e.message));c(n)})):"function"==typeof o&&/^https?:/.test(e)?o.concat({url:e,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},((e,n,i)=>{if(e)return t(new Error("Error downloading torrent: "+e.message));c(i)})):"function"==typeof a.readFile&&"string"==typeof e?a.readFile(e,((e,n)=>{if(e)return t(new Error("Invalid torrent identifier"));c(n)})):n.nextTick((()=>{t(new Error("Invalid torrent identifier"))})));var s;function c(e){try{i=u(e)}catch(e){return t(e)}i&&i.infoHash?t(null,i):t(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=c.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=i.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return s.encode(t)},i.alloc(0)}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:186,bencode:6,"blob-to-buffer":37,buffer:59,fs:55,"magnet-uri":123,path:184,"simple-get":221,"simple-sha1":241}],184:[function(e,t,n){(function(e){(function(){"use strict";function n(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,i="",s=0,r=-1,a=0,o=0;o<=e.length;++o){if(o<e.length)n=e.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(r===o-1||1===a);else if(r!==o-1&&2===a){if(i.length<2||2!==s||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",s=0):s=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),r=o,a=0;continue}}else if(2===i.length||1===i.length){i="",s=0,r=o,a=0;continue}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+e.slice(r+1,o):i=e.slice(r+1,o),s=o-r-1;r=o,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var s={resolve:function(){for(var t,s="",r=!1,a=arguments.length-1;a>=-1&&!r;a--){var o;a>=0?o=arguments[a]:(void 0===t&&(t=e.cwd()),o=t),n(o),0!==o.lenLine truncated
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
let i;t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},{}],188:[function(e,t,n){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var n=e.length-t,i=Math.random()*n|0,s=e[t+i],r=e[t];return e[t]=s,e[t+i]=r,t++,s}}},{}],189:[function(e,t,n){(function(n,i){"use strict";var s=65536,r=4294967295;var a=e("safe-buffer").Buffer,o=i.crypto||i.msCrypto;o&&o.getRandomValues?t.exports=function(e,t){if(e>r)throw new RangeError("requested too many random bytes");var i=a.allocUnsafe(e);if(e>0)if(e>s)for(var c=0;c<e;c+=s)o.getRandomValues(i.slice(c,c+s));else o.getRandomValues(i);if("function"==typeof t)return n.nextTick((function(){t(null,i)}));return i}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:181,"safe-buffer":211}],190:[function(e,t,n){const{Writable:i,PassThrough:s}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,n){let i=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=n);this._buffer=null;var s=this._queue[0];const t=Math.max(s.start-this._position,0),r=s.end-this._position;if(t>=e.length)return this._position+=e.length,n(null);let a;if(r>e.length){this._position+=e.length,a=0===t?e:e.slice(t),i=s.stream.write(a)&&i;break}this._position+=r,a=0===t&&r===e.length?e:e.slice(t,r),i=s.stream.write(a)&&i,s.last&&s.stream.end(),e=e.slice(r),this._queue.shift()}i?n(null):s.stream.once("drain",n.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new s;return e.forEach(((n,i)=>{this._queue.push({start:n.start,end:n.end,stream:t,last:i===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":205}],191:[function(e,t,n){arguments[4][10][0].apply(n,arguments)},{dup:10}],192:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{"./_stream_readable":194,"./_stream_writable":196,_process:181,dup:11,inherits:111}],193:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"./_stream_transform":195,dup:12,inherits:111}],194:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{"../errors":191,"./_stream_duplex":192,"./internal/streams/async_iterator":197,"./internal/streams/buffer_list":198,"./internal/streams/destroy":199,"./internal/streams/from":201,"./internal/streams/state":203,"./internal/streams/stream":204,_process:181,buffer:51,dup:13,events:90,inherits:111,"string_decoder/":271,util:46}],195:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{"../errors":191,"./_stream_duplex":192,dup:14,inherits:111}],196:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{"../errors":191,"./_stream_duplex":192,"./internal/streams/destroy":199,"./internal/streams/state":203,"./internal/streams/stream":204,_process:181,buffer:51,dup:15,inherits:111,"util-deprecate":283}],197:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./end-of-stream":200,_process:181,dup:16}],198:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{buffer:51,dup:17,util:46}],199:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{_process:181,dup:18}],200:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../../../errors":191,dup:19}],201:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{dup:20}],202:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"../../../errors":191,"./end-of-stream":200,dup:21}],203:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{"../../../errors":191,dup:22}],204:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{dup:23,events:90}],205:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"./lib/_stream_duplex.js":192,"./lib/_stream_passthrough.js":193,"./lib/_stream_readable.js":194,"./lib/_stream_transform.js":195,"./lib/_stream_writable.js":196,"./lib/internal/streams/end-of-stream.js":200,"./lib/internal/streams/pipeline.js":202,dup:24}],206:[function(e,t,n){
let i;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind(globalThis):e=>(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},{}],193:[function(e,t,n){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var n=e.length-t,i=Math.random()*n|0,s=e[t+i],r=e[t];return e[t]=s,e[t+i]=r,t++,s}}},{}],194:[function(e,t,n){(function(n,i){(function(){"use strict";var s=65536,r=4294967295;var a=e("safe-buffer").Buffer,o=i.crypto||i.msCrypto;o&&o.getRandomValues?t.exports=function(e,t){if(e>r)throw new RangeError("requested too many random bytes");var i=a.allocUnsafe(e);if(e>0)if(e>s)for(var c=0;c<e;c+=s)o.getRandomValues(i.slice(c,c+s));else o.getRandomValues(i);if("function"==typeof t)return n.nextTick((function(){t(null,i)}));return i}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:186,"safe-buffer":219}],195:[function(e,t,n){const{Writable:i,PassThrough:s}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,n){let i=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=n);this._buffer=null;var s=this._queue[0];const t=Math.max(s.start-this._position,0),r=s.end-this._position;if(t>=e.length)return this._position+=e.length,n(null);let a;if(r>e.length){this._position+=e.length,a=0===t?e:e.slice(t),i=s.stream.write(a)&&i;break}this._position+=r,a=0===t&&r===e.length?e:e.slice(t,r),i=s.stream.write(a)&&i,s.last&&s.stream.end(),e=e.slice(r),this._queue.shift()}i?n(null):s.stream.once("drain",n.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new s;return e.forEach(((n,i)=>{this._queue.push({start:n.start,end:n.end,stream:t,last:i===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":210}],196:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],197:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_readable":199,"./_stream_writable":201,_process:186,dup:16,inherits:118}],198:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_transform":200,dup:17,inherits:118}],199:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"../errors":196,"./_stream_duplex":197,"./internal/streams/async_iterator":202,"./internal/streams/buffer_list":203,"./internal/streams/destroy":204,"./internal/streams/from":206,"./internal/streams/state":208,"./internal/streams/stream":209,_process:186,buffer:59,dup:18,events:97,inherits:118,"string_decoder/":285,util:54}],200:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":196,"./_stream_duplex":197,dup:19,inherits:118}],201:[function(e,t,n){arguments[4][20][0].apply(n,arguments)},{"../errors":196,"./_stream_duplex":197,"./internal/streams/destroy":204,"./internal/streams/state":208,"./internal/streams/stream":209,_process:186,buffer:59,dup:20,inherits:118,"util-deprecate":304}],202:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./end-of-stream":205,_process:186,dup:21}],203:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{buffer:59,dup:22,util:54}],204:[function(e,t,n){arguments[4][23][0].apply(n,arguments)},{_process:186,dup:23}],205:[function(e,t,n){arguments[4][24][0].apply(n,arguments)},{"../../../errors":196,dup:24}],206:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{dup:25}],207:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{"../../../errors":196,"./end-of-stream":205,dup:26}],208:[function(e,t,n){arguments[4][27][0].apply(n,arguments)},{"../../../errors":196,dup:27}],209:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28,events:97}],210:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./lib/_stream_duplex.js":197,"./lib/_stream_passthrough.js":198,"./lib/_stream_readable.js":199,"./lib/_stream_transform.js":200,"./lib/_stream_writable.js":201,"./lib/internal/streams/end-of-stream.js":205,"./lib/internal/streams/pipeline.js":207,dup:29}],211:[function(e,t,n){
/*! render-media. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
n.render=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=function(){});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));b(e,(function(i){if(t.nodeName!==i.toUpperCase()){var s=a.extname(e.name).toLowerCase();throw new Error('Cannot render "'+s+'" inside a "'+t.nodeName.toLowerCase()+'" element, expected "'+i+'"')}return"video"!==i&&"audio"!==i||y(t,n),t}),n,i)},n.append=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=function(){});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function s(e){var n=document.createElement(e);return t.appendChild(n),n}b(e,(function(e){return"video"===e||"audio"===e?function(e){var i=s(e);return y(i,n),t.appendChild(i),i}(e):s(e)}),n,(function(e,t){e&&t&&t.remove(),i(e,t)}))},n.mime=e("./lib/mime.json");var i=e("debug")("render-media"),s=e("is-ascii"),r=e("mediasource"),a=e("path"),o=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],p=[".m4v",".mkv",".mp4",".webm"],u=[].concat(p,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],h=[".aac",".oga",".ogg",".wav",".flac"],f=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],g="undefined"!=typeof window&&window.MediaSource;function b(e,t,n,o){var b,x=a.extname(e.name).toLowerCase(),_=0;function y(){return!("number"==typeof e.length&&e.length>n.maxBlobLength)||(i("File length too large for Blob URL approach: %d (max: %d)",e.length,n.maxBlobLength),C(new Error("File length too large for Blob URL approach: "+e.length+" (max: "+n.maxBlobLength+")")),!1)}function w(n){y()&&(b=t(n),v(e,(function(e,t){if(e)return C(e);b.addEventListener("error",C),b.addEventListener("loadstart",k),b.addEventListener("canplay",E),b.src=t})))}function k(){b.removeEventListener("loadstart",k),n.autoplay&&b.play()}function E(){b.removeEventListener("canplay",E),o(null,b)}function S(){v(e,(function(e,n){if(e)return C(e);".pdf"!==x?((b=t("iframe")).sandbox="allow-forms allow-scripts",b.src=n):((b=t("object")).setAttribute("typemustmatch",!0),b.setAttribute("type","application/pdf"),b.setAttribute("data",n)),o(null,b)}))}function C(t){t.message='Error rendering file "'+e.name+'": '+t.message,i(t.message),o(t)}u.indexOf(x)>=0?function(){var n=p.indexOf(x)>=0?"video":"audio";g?l.indexOf(x)>=0?s():o():u();function s(){i("Use `videostream` package for "+e.name),f(),b.addEventListener("error",d),b.addEventListener("loadstart",k),b.addEventListener("canplay",E),new c(e,b)}function o(){i("Use MediaSource API for "+e.name),f(),b.addEventListener("error",h),b.addEventListener("loadstart",k),b.addEventListener("canplay",E);var t,n=new r(b).createWriteStream((t=e.name,{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[a.extname(t).toLowerCase()]));e.createReadStream().pipe(n),_&&(b.currentTime=_)}function u(){i("Use Blob URL for "+e.name),f(),b.addEventListener("error",C),b.addEventListener("loadstart",k),b.addEventListener("canplay",E),v(e,(function(e,t){if(e)return C(e);b.src=t,_&&(b.currentTime=_)}))}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e),b.removeEventListener("error",d),b.removeEventListener("canplay",E),o()}function h(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e),y()&&(b.removeEventListener("error",h),b.removeEventListener("canplay",E),u())}function f(){b||(b=t(n)).addEventListener("progress",(function(){_=b.currentTime}))}}():d.indexOf(x)>=0?w("video"):h.indexOf(x)>=0?w("audio"):f.indexOf(x)>=0?(b=t("img"),v(e,(function(t,n){if(t)return C(t);b.src=n,b.alt=e.name,o(null,b)}))):m.indexOf(x)>=0?S():function(){i('Unknown file extension "%s" - will attempt to render into iframe',x);var t="";function n(){s(t)?(i('File extension "%s" appears ascii, so will render.',x),S()):(i('File extension "%s" appears non-ascii, will not render.',x),o(new Error('Unsupported file type "'+x+'": Cannot append to DOM')))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(function(e){t+=e})).on("end",n).on("error",o)}()}function v(e,t){var i=a.extname(e.name).toLowerCase();o(e.createReadStream(),n.mime[i]).then((e=>t(null,e)),(e=>t(e)))}function x(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),null==e.muted&&(e.muted=!1),null==e.controls&&(e.controls=!0),null==e.Line truncated
n.render=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=function(){});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));v(e,(function(i){if(t.nodeName!==i.toUpperCase()){var s=a.extname(e.name).toLowerCase();throw new Error('Cannot render "'+s+'" inside a "'+t.nodeName.toLowerCase()+'" element, expected "'+i+'"')}return"video"!==i&&"audio"!==i||y(t,n),t}),n,i)},n.append=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=function(){});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function s(e){var n=document.createElement(e);return t.appendChild(n),n}v(e,(function(e){return"video"===e||"audio"===e?function(e){var i=s(e);return y(i,n),t.appendChild(i),i}(e):s(e)}),n,(function(e,t){e&&t&&t.remove(),i(e,t)}))},n.mime=e("./lib/mime.json");var i=e("debug")("render-media"),s=e("is-ascii"),r=e("mediasource"),a=e("path"),o=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],p=[".m4v",".mkv",".mp4",".webm"],u=[].concat(p,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],h=[".aac",".oga",".ogg",".wav",".flac"],f=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],g="undefined"!=typeof window&&window.MediaSource;function v(e,t,n,o){var v,x=a.extname(e.name).toLowerCase(),_=0;function y(){return!("number"==typeof e.length&&e.length>n.maxBlobLength)||(i("File length too large for Blob URL approach: %d (max: %d)",e.length,n.maxBlobLength),C(new Error("File length too large for Blob URL approach: "+e.length+" (max: "+n.maxBlobLength+")")),!1)}function w(n){y()&&(v=t(n),b(e,(function(e,t){if(e)return C(e);v.addEventListener("error",C),v.addEventListener("loadstart",k),v.addEventListener("canplay",E),v.src=t})))}function k(){v.removeEventListener("loadstart",k),n.autoplay&&v.play()}function E(){v.removeEventListener("canplay",E),o(null,v)}function S(){b(e,(function(e,n){if(e)return C(e);".pdf"!==x?((v=t("iframe")).sandbox="allow-forms allow-scripts",v.src=n):((v=t("object")).setAttribute("typemustmatch",!0),v.setAttribute("type","application/pdf"),v.setAttribute("data",n)),o(null,v)}))}function C(t){t.message='Error rendering file "'+e.name+'": '+t.message,i(t.message),o(t)}u.indexOf(x)>=0?function(){var n=p.indexOf(x)>=0?"video":"audio";g?l.indexOf(x)>=0?s():o():u();function s(){i("Use `videostream` package for "+e.name),f(),v.addEventListener("error",d),v.addEventListener("loadstart",k),v.addEventListener("canplay",E),new c(e,v)}function o(){i("Use MediaSource API for "+e.name),f(),v.addEventListener("error",h),v.addEventListener("loadstart",k),v.addEventListener("canplay",E);var t,n=new r(v).createWriteStream((t=e.name,{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[a.extname(t).toLowerCase()]));e.createReadStream().pipe(n),_&&(v.currentTime=_)}function u(){i("Use Blob URL for "+e.name),f(),v.addEventListener("error",C),v.addEventListener("loadstart",k),v.addEventListener("canplay",E),b(e,(function(e,t){if(e)return C(e);v.src=t,_&&(v.currentTime=_)}))}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e),v.removeEventListener("error",d),v.removeEventListener("canplay",E),o()}function h(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e),y()&&(v.removeEventListener("error",h),v.removeEventListener("canplay",E),u())}function f(){v||(v=t(n)).addEventListener("progress",(function(){_=v.currentTime}))}}():d.indexOf(x)>=0?w("video"):h.indexOf(x)>=0?w("audio"):f.indexOf(x)>=0?(v=t("img"),b(e,(function(t,n){if(t)return C(t);v.src=n,v.alt=e.name,o(null,v)}))):m.indexOf(x)>=0?S():function(){i('Unknown file extension "%s" - will attempt to render into iframe',x);var t="";function n(){s(t)?(i('File extension "%s" appears ascii, so will render.',x),S()):(i('File extension "%s" appears non-ascii, will not render.',x),o(new Error('Unsupported file type "'+x+'": Cannot append to DOM')))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(function(e){t+=e})).on("end",n).on("error",o)}()}function b(e,t){var i=a.extname(e.name).toLowerCase();o(e.createReadStream(),n.mime[i]).then((e=>t(null,e)),(e=>t(e)))}function x(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),null==e.muted&&(e.muted=!1),null==e.controls&&(e.controls=!0),null==e.Line truncated
/*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,n,i){if("number"!=typeof n)throw new Error("second argument must be a Number");var s,r,a,o,c,l=!0;Array.isArray(t)?(s=[],a=r=t.length):(o=Object.keys(t),s={},a=r=o.length);function p(t){function n(){i&&i(t,s),i=null}l?e.nextTick(n):n()}function u(e,n,i){if(s[e]=i,n&&(c=!0),0==--a||n)p(n);else if(!c&&d<r){var l;o?(l=o[d],d+=1,t[l]((function(e,t){u(l,e,t)}))):(l=d,d+=1,t[l]((function(e,t){u(l,e,t)})))}}var d=n;a?o?o.some((function(e,i){if(t[e]((function(t,n){u(e,t,n)})),i===n-1)return!0})):t.some((function(e,t){if(e((function(e,n){u(t,e,n)})),t===n-1)return!0})):p(null);l=!1}}).call(this)}).call(this,e("_process"))},{_process:186}],217:[function(e,t,n){(function(e){(function(){
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,n){var i,s,r,a=!0;Array.isArray(t)?(i=[],s=t.length):(r=Object.keys(t),i={},s=r.length);function o(t){function s(){n&&n(t,i),n=null}a?e.nextTick(s):s()}function c(e,t,n){i[e]=n,(0==--s||t)&&o(t)}s?r?r.forEach((function(e){t[e]((function(t,n){c(e,t,n)}))})):t.forEach((function(e,t){e((function(e,n){c(t,e,n)}))})):o(null);a=!1}}).call(this)}).call(this,e("_process"))},{_process:186}],218:[function(e,t,n){var i,s;i="undefined"!=typeof self?self:this,s=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var i=n(5),s=n(1),r=s.toHex,a=s.ceilHeapSize,o=n(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},l=function(e,t){var n=new Int32Array(e,t+320,5),i=new Int32Array(5),s=new DataView(i.buffer);return s.setInt32(0,n[0],!1),s.setInt32(4,n[1],!1),s.setInt32(8,n[2],!1),s.setInt32(12,n[3],!1),s.setInt32(16,n[4],!1),i},p=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=t||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=t,this._padMaxChunkLen=c(t),this._heap=new ArrayBuffer(a(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new i({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var n=new Int32Array(e,t+320,5);n[0]=1732584193,n[1]=-271733879,n[2]=-1732584194,n[3]=271733878,n[4]=-1009589776},e.prototype._padChunk=function(e,t){var n=c(e),i=new Int32Array(this._heap,0,n>>2);return function(e,t){var n=new Uint8Array(e.buffer),i=t%4,s=t-i;switch(i){case 0:n[s+3]=0;case 1:n[s+2]=0;case 2:n[s+1]=0;case 3:n[s+0]=0}for(var r=1+(t>>2);r<e.length;r++)e[r]=0}(i,e),function(e,t,n){e[t>>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=n/(1<<29)|0,e[15+(2+(t>>2)&-16)]=n<<3}(i,e,t),n},e.prototype._write=function(e,t,n,i){o(e,this._h8,this._h32,t,n,i||0)},e.prototype._coreCall=function(e,t,n,i,s){var r=n;this._write(e,t,n),s&&(r=this._padChunk(n,i)),this._core.hash(r,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var n=0,i=this._maxChunkLen;for(n=0;t>n+i;n+=i)this._coreCall(e,n,i,t,!1);return this._coreCall(e,n,t-n,t,!0),l(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return r(this.rawDigest(e).buffer)},e.prototype.digestFromString=function(e){return this.digest(e)},e.prototype.digestFromBuffer=function(e){return this.digest(e)},e.prototype.digestFromArrayBuffer=function(e){return this.digest(e)},e.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},e.prototype.append=function(e){var t=0,n=e.byteLength||e.length||e.size||0,i=this._offset%this._maxChunkLen,s=void 0;for(this._offset+=n;t<n;)s=Math.min(n-t,this._maxChunkLen-i),this._write(e,t,s,i),t+=s,(i+=s)===this._maxChunkLen&&(this._core.hash(this._maxChunkLen,this._padMaxChunkLen),i=0);return this},e.prototype.getState=function(){var e=void 0;if(this._offset%this._maxChunkLen)e=this._heap.slice(0);else{var t=new Int32Array(this._heap,this._padMaxChunkLen+320,5);e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return{offset:this._offset,heap:e}},e.prototype.setState=function(e){return this._offset=e.offset,20===e.heap.byteLength?new Int32Array(this._heap,this._padMaxChunkLen+320,5).set(new Int32Array(e.heap)):this._h32.set(new Int32Array(e.heap)),this},e.prototype.rawEnd=function(){var e=this._offset,t=e%this._maxChunkLen,n=this._padChunk(t,e);this._core.hash(n,this._padMaxChunkLen);var i=l(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),i},e.prototype.end=function(){return r(this.rawEnd().buffer)},e}();e.exports=p,e.exports._core=i},function(e,t){for(var n=new Array(256),i=0;i<256;i++)n[i]=(i<16?"0":"")+i.toString(16);e.exports.toHex=function(e){for(var t=new Uint8Array(e),i=new Array(e.byteLength),s=0;s<i.length;s++)i[s]=n[t[s]];return i.join("")},e.exports.ceilHeapSize=function(e){var t=0;if(e<=65536)return 65536;if(e<16777216)for(t=1;t<e;t<<=1);else for(t=16777216;t<e;t+=16777216);return t},e.exports.isDedicatedWorkerScope=function(e){var t="WorkerGlobalScope"in e&&e instanceof e.WorkerGlobalScope,n="SharedWorkerGlobalScope"in e&&e instanceof e.SharedWorkerGlobalScope,i="ServiceWorkerGlobalScope"in e&&e instanceof e.ServiceWorkerGlobalScope;return t&&!n&&!i}},function(e,t,n){e.exports=function(){var e=n(0),t=function(e,n,i,s,r){var a=new self.FileReader;a.onloadend=function(Line truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("buffer"),s=i.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return s(e,t,n)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(r(i,n),n.Buffer=a),a.prototype=Object.create(s.prototype),r(s,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=s(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:51}],212:[function(e,t,n){(function(e){
var i=e("buffer"),s=i.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return s(e,t,n)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(r(i,n),n.Buffer=a),a.prototype=Object.create(s.prototype),r(s,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=s(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:59}],220:[function(e,t,n){(function(e){(function(){
/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,n){var i=[];t.on("data",(function(e){i.push(e)})),t.once("end",(function(){n&&n(null,e.concat(i)),n=null})),t.once("error",(function(e){n&&n(e),n=null}))}}).call(this,e("buffer").Buffer)},{buffer:51}],213:[function(e,t,n){(function(n){t.exports=u;const i=e("simple-concat"),s=e("decompress-response"),r=e("http"),a=e("https"),o=e("once"),c=e("querystring"),l=e("url"),p=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function u(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=o(t),e.url){const{hostname:t,port:n,protocol:i,auth:s,path:r}=l.parse(e.url);delete e.url,t||n||i||s?Object.assign(e,{hostname:t,port:n,protocol:i,auth:s,path:r}):e.path=r}const i={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>i[t.toLowerCase()]=e.headers[t])),e.headers=i,e.body?d=e.json&&!p(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),p(d)||(e.headers["content-length"]=n.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const h=("https:"===e.protocol?a:r).request(e,(n=>{if(!1!==e.followRedirects&&n.statusCode>=300&&n.statusCode<400&&n.headers.location)return e.url=n.headers.location,delete e.headers.host,n.resume(),"POST"===e.method&&[301,302].includes(n.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):u(e,t);const i="function"==typeof s&&"HEAD"!==e.method;t(null,i?s(n):n)}));return h.on("timeout",(()=>{h.abort(),t(new Error("Request timed out"))})),h.on("error",t),p(d)?d.on("error",t).pipe(h):h.end(d),h}u.concat=(e,t)=>u(e,((n,s)=>{if(n)return t(n);i(s,((n,i)=>{if(n)return t(n);if(e.json)try{i=JSON.parse(i.toString())}catch(n){return t(n,s,i)}t(null,s,i)}))})),["get","post","put","patch","head","delete"].forEach((e=>{u[e]=(t,n)=>("string"==typeof t&&(t={url:t}),u(Object.assign({method:e.toUpperCase()},t),n))}))}).call(this,e("buffer").Buffer)},{buffer:51,"decompress-response":46,http:249,https:108,once:176,querystring:186,"simple-concat":212,url:280}],214:[function(e,t,n){(function(n){
t.exports=function(t,n){var i=[];t.on("data",(function(e){i.push(e)})),t.once("end",(function(){n&&n(null,e.concat(i)),n=null})),t.once("error",(function(e){n&&n(e),n=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59}],221:[function(e,t,n){(function(n){(function(){
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=u;const i=e("simple-concat"),s=e("decompress-response"),r=e("http"),a=e("https"),o=e("once"),c=e("querystring"),l=e("url"),p=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function u(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=o(t),e.url){const{hostname:t,port:n,protocol:i,auth:s,path:r}=l.parse(e.url);delete e.url,t||n||i||s?Object.assign(e,{hostname:t,port:n,protocol:i,auth:s,path:r}):e.path=r}const i={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>i[t.toLowerCase()]=e.headers[t])),e.headers=i,e.body?d=e.json&&!p(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),p(d)||(e.headers["content-length"]=n.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const h=("https:"===e.protocol?a:r).request(e,(n=>{if(!1!==e.followRedirects&&n.statusCode>=300&&n.statusCode<400&&n.headers.location)return e.url=n.headers.location,delete e.headers.host,n.resume(),"POST"===e.method&&[301,302].includes(n.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):u(e,t);const i="function"==typeof s&&"HEAD"!==e.method;t(null,i?s(n):n)}));return h.on("timeout",(()=>{h.abort(),t(new Error("Request timed out"))})),h.on("error",t),p(d)?d.on("error",t).pipe(h):h.end(d),h}u.concat=(e,t)=>u(e,((n,s)=>{if(n)return t(n);i(s,((n,i)=>{if(n)return t(n);if(e.json)try{i=JSON.parse(i.toString())}catch(n){return t(n,s,i)}t(null,s,i)}))})),["get","post","put","patch","head","delete"].forEach((e=>{u[e]=(t,n)=>("string"==typeof t&&(t={url:t}),u(Object.assign({method:e.toUpperCase()},t),n))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59,"decompress-response":54,http:263,https:115,once:182,querystring:191,"simple-concat":220,url:297}],222:[function(e,t,n){(function(n){(function(){
/*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("debug")("simple-peer"),s=e("get-browser-rtc"),r=e("randombytes"),a=e("readable-stream"),o=e("queue-microtask"),c=65536;function l(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}function p(e,t){return"string"==typeof e&&(e=new Error(e)),e.error instanceof Error&&(e=e.error),e.code=t,e}class u extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=r(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||r(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||u.channelConfig,this.negotiated=this.channelConfig.negotiated,this.config=Object.assign({},u.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:s(),!this._wrtc)throw"undefined"==typeof window?p("No WebRTC support: Specify `opts.wrtc` option in this environment","ERR_WEBRTC_SUPPORT"):p("No WebRTC support: Not a supported browser","ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!this.negotiated&&!this.initiator,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._firstStable=!0,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void o((()=>this.destroy(p(e,"ERR_PC_CONSTRUCTOR"))))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},this.initiator||this.negotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this.initiator&&this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(this.destroyed)throw p("cannot signal after peer is destroyed","ERR_SIGNALING");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(p(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(p("signal() called with invalid signal data","ERR_SIGNALING"))}_addIceCandidate(e){var t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var n;!t.address||t.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(p(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){this._channel.send(e)}addTransceiver(e,t){if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(p(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{transceiverRequest:{kind:e,init:t}})}addStream(e){this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}addTrack(e,t){this._debug("addTrack()");var n=this._senderMap.get(e)||new Map,i=n.get(t);if(i)throw i.removed?p("Track has been removed. You should enable/disable tracks that you want to re-add.","ERR_SENDER_REMOVED"):p("Track has already been added to that stream.","ERR_SENDERLine truncated
var i=e("debug")("simple-peer"),s=e("get-browser-rtc"),r=e("randombytes"),a=e("readable-stream"),o=e("queue-microtask"),c=e("err-code"),l=65536;function p(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class u extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=r(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||r(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||u.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},u.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:s(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void o((()=>this.destroy(c(e,"ERR_PC_CONSTRUCTOR"))))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_SIGNALING");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}_addIceCandidate(e){var t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var n;!t.address||t.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){this._channel.send(e)}addTransceiver(e,t){if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{transceiverRequest:{kind:e,init:t}})}addStream(e){this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}addTrack(e,t){this._debug("addTrack()");var n=this._senderMap.get(e)||new Map,i=n.get(t);if(i)throw i.removed?c(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):c(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");i=Line truncated
/*! stream-to-blob-url. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=async function(e,t){const n=await i(e,t);return URL.createObjectURL(n)};const i=e("stream-to-blob")},{"stream-to-blob":269}],269:[function(e,t,n){
t.exports=async function(e,t){const n=await i(e,t);return URL.createObjectURL(n)};const i=e("stream-to-blob")},{"stream-to-blob":283}],283:[function(e,t,n){
/*! stream-to-blob. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((n,i)=>{const s=[];e.on("data",(e=>s.push(e))).once("end",(()=>{const e=null!=t?new Blob(s,{type:t}):new Blob(s);n(e)})).once("error",i)}))}},{}],270:[function(e,t,n){(function(n){
t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((n,i)=>{const s=[];e.on("data",(e=>s.push(e))).once("end",(()=>{const e=null!=t?new Blob(s,{type:t}):new Blob(s);n(e)})).once("error",i)}))}},{}],284:[function(e,t,n){(function(n){(function(){
/*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("once");t.exports=function(e,t,s){s=i(s);var r=n.alloc(t),a=0;e.on("data",(function(e){e.copy(r,a),a+=e.length})).on("end",(function(){s(null,r)})).on("error",s)}}).call(this,e("buffer").Buffer)},{buffer:51,once:176}],271:[function(e,t,n){"use strict";var i=e("safe-buffer").Buffer,s=i.isEncoding||function(e){switch((e=""+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!0;default:return!1}};function r(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=p,this.end=u,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var s=a(t[i]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--i<n||-2===s)return 0;if((s=a(t[i]))>=0)return s>0&&(e.lastNeed=s-2),s;if(--i<n||-2===s)return 0;if((s=a(t[i]))>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":211}],272:[function(e,t,n){var i=e("./thirty-two");n.encode=i.encode,n.decode=i.decode},{"./thirty-two":273}],273:[function(e,t,n){(function(e){"use strict";var t=[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];n.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var n,i,s=0,r=0,a=0,o=0,c=new e(8*(n=t,i=Math.floor(n.length/5),n.length%5==0?i:i+1));s<t.length;){var l=t[s];a>3?(o=(o=l&255>>a)<<(a=(a+5)%8)|(s+1<t.length?t[s+1]:0)>>8-a,s++):(o=l>>8-(a+5)&31,0===(a=(a+5)%8)&&s++),c[r]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(o),r++}for(s=r;s<c.length;s++)c[s]=61;return c},n.decode=function(n){var i,s=0,r=0,a=0;e.isBuffer(n)||(n=new e(n));for(var o=new e(Math.ceil(5*n.length/8)),c=0;c<n.length&&61!==n[c];c++){var l=n[c]-48;if(!(l<t.length))throw new Error("Invalid input - it is not base32 encoded string");r=t[l],s<=3?0===(s=(s+5)%8)?(i|=r,o[a]=i,a++,i=0):i|=255&r<<8-s:(i|=255&r>>>(s=(s+5)%8),o[a]=i,a++,i=255&r<<8-s)}return o.sliceLine truncated
var i=e("once");t.exports=function(e,t,s){s=i(s);var r=n.alloc(t),a=0;e.on("data",(function(e){e.copy(r,a),a+=e.length})).on("end",(function(){s(null,r)})).on("error",s)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:59,once:182}],285:[function(e,t,n){"use strict";var i=e("safe-buffer").Buffer,s=i.isEncoding||function(e){switch((e=""+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!0;default:return!1}};function r(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===s||!s(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=p,this.end=u,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}n.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var s=a(t[i]);if(s>=0)return s>0&&(e.lastNeed=s-1),s;if(--i<n||-2===s)return 0;if((s=a(t[i]))>=0)return s>0&&(e.lastNeed=s-2),s;if(--i<n||-2===s)return 0;if((s=a(t[i]))>=0)return s>0&&(2===s?s=0:e.lastNeed=s-3),s;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":219}],286:[function(e,t,n){var i=e("./thirty-two");n.encode=i.encode,n.decode=i.decode},{"./thirty-two":287}],287:[function(e,t,n){(function(e){(function(){"use strict";var t=[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];n.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var n,i,s=0,r=0,a=0,o=0,c=new e(8*(n=t,i=Math.floor(n.length/5),n.length%5==0?i:i+1));s<t.length;){var l=t[s];a>3?(o=(o=l&255>>a)<<(a=(a+5)%8)|(s+1<t.length?t[s+1]:0)>>8-a,s++):(o=l>>8-(a+5)&31,0===(a=(a+5)%8)&&s++),c[r]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(o),r++}for(s=r;s<c.length;s++)c[s]=61;return c},n.decode=function(n){var i,s=0,r=0,a=0;e.isBuffer(n)||(n=new e(n));for(var o=new e(Math.ceil(5*n.length/8)),c=0;c<n.length&&61!==n[c];c++){var l=n[c]-48;if(!(l<t.length))throw new Error("Invalid input - it is not base32 encoded string");r=t[l],s<=3?0===(s=(s+5)%8)?(i|=r,o[a]=i,a++,i=0):i|=255&r<<8-s:(i|=255&r>>>(s=(s+5)%8),o[a]=i,a++,i=2Line truncated
/*! torrent-discovery. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("debug")("torrent-discovery"),s=e("bittorrent-dht/client"),r=e("events").EventEmitter,a=e("run-parallel"),o=e("bittorrent-tracker/client");t.exports=class extends r{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")};const t=(e,t)=>{const n=new s(t);return n.on("warning",this._onWarning),n.on("error",this._onError),n.listen(e),this._internalDHT=!0,n};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof s?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce())}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new o(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(i("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,i("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}}}).call(this,e("_process"))},{_process:181,"bittorrent-dht/client":46,"bittorrent-tracker/client":25,debug:87,events:90,"run-parallel":209}],276:[function(e,t,n){(function(e){const n=16384;class i{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/n),this._remainder=e%n||n,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:n}chunkLengthRemaining(e){return this.length-e*n}chunkOffset(e){return e*n}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations<this._chunks?this._reservations++:-1:-1}reserveRemaining(){if(!this.init())return-1;if(this._reservations<this._chunks){const e=this._reservations;return this._reservations=this._chunks,e}return-1}cancel(e){this.init()&&this._cancellations.push(e)}cancelRemaining(e){this.init()&&(this._reservations=e)}get(e){return this.init()?this._buffer[e]:null}set(e,t,i){if(!this.init())return!1;const s=t.length,r=Math.ceil(s/n);for(let s=0;s<r;s++)if(!this._buffer[e+s]){const r=s*n,a=t.slice(r,r+n);this._buffered++,this._buffer[e+s]=a,this.missing-=a.length,this.sources.includes(i)||this.sources.push(i)}return this._buffered===this._chunks}flush(){if(!this._buffer||this._chunks!==this._buffered)return null;const t=e.concat(this._buffer,this.length);return this._buffer=null,this._cancellations=null,this.sources=null,this._flushed=!0,t}init(){return!this._flushed&&(this._buffer||(this._buffer=new Array(this._chunks),this._cancellations=[],this.sources=[]),!0)}}Object.defineProperty(i,"BLOCK_LENGTH",Line truncated
const i=e("debug")("torrent-discovery"),s=e("bittorrent-dht/client"),r=e("events").EventEmitter,a=e("run-parallel"),o=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends r{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const n=new s(t);return n.on("warning",this._onWarning),n.on("error",this._onError),n.listen(e),this._internalDHT=!0,n};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof s?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new o(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(i("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,i("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:186,"bittorrent-dht/client":54,"bittorrent-lsd":54,"bittorrent-tracker/client":30,debug:290,events:97,"run-parallel":217}],290:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"./common":291,_process:186,dup:12}],291:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{dup:13,ms:292}],292:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],293:[function(e,t,n){(function(e){(function(){const n=16384;class i{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/n),this._remainder=e%n||n,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:n}chunkLengthRemaining(e){return this.length-e*n}chunkOffset(e){return e*n}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations<this._chunks?this._reservations++:-1:-1}reserveRemaining(){if(!this.init())return-1;if(this._reservations<this._chunks){const e=this._Line truncated
/*! ut_metadata. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const{EventEmitter:i}=e("events"),s=e("bencode"),r=e("bitfield"),a=e("debug")("ut_metadata"),o=e("simple-sha1"),c=16384;t.exports=e=>{class t extends i{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new r(0,{grow:1e3}),n.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,n){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7<e.metadata_size||e.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=e.metadata_size,this._numPieces=Math.ceil(this._metadataSize/c),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(e){let t,n;try{const i=e.toString(),r=i.indexOf("ee")+2;t=s.decode(i.substring(0,r)),n=e.slice(r)}catch(e){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)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(e){if(this._metadataComplete)return!0;a("set metadata");try{const t=s.decode(e).info;t&&(e=s.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===o.sync(e))&&(this.cancel(),this.metadata=e,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",s.encode({info:s.decode(this.metadata)})),!0)}_send(e,t){let i=s.encode(e);n.isBuffer(t)&&(i=n.concat([i,t])),this._wire.extended("ut_metadata",i)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,n){const i={msg_type:1,piece:e};"number"==typeof n&&(i.total_size=n),this._send(i,t)}_reject(e){this._send({msg_type:2,piece:e})}_onRequest(e){if(!this._metadataComplete)return void this._reject(e);const t=e*c;let n=t+c;n>this._metadataSize&&(n=this._metadataSize);const i=this.metadata.slice(t,n);this._data(e,i,this._metadataSize)}_onData(e,t,n){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=n.alloc(this._metadataSize);for(let e=0;e<this._numPieces;e++)this._request(e)}}_checkDone(){let e=!0;for(let t=0;t<this._numPieces;t++)if(!this._bitfield.get(t)){e=!1;break}if(!e)return;this.setMetadata(this.metadata)||this._failedMetadata()}_failedMetadata(){this._bitfield=new r(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this,e("buffer").Buffer)},{bencode:6,bitfield:8,buffer:51,debug:87,events:90,"simple-sha1":230}],283:[function(e,t,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],284:[function(e,t,n){(function(n){const i=e("binary-search"),s=e("events"),r=e("mp4-stream"),a=e("mp4-box-encoding"),o=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends s{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=r.decode();const n=this._file.createReadStream({start:e});n.pipe(this._decoder);const i=s=>{"moov"===s.type?(this._decoder.removeListener("box",i),this._decoder.decode((e=>{n.destroy();try{this._processMoov(e)}catch(e){e.message="Cannot parse mp4 file: "+e.message,this.emit("error",e)}}))):s.length<4096?(t+=s.length,this._decoder.ignore()):(this._decoder.removeListener("box",i),t+=s.length,n.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",i)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let n=0;n<t.length;n++){const s=t[n],r=s.mdia.minf.stbl,a=r.stsd.entries[0],o=s.mdia.hdlr.handlerType;let l,p;if("vide"===o&&"avc1"===a.type){if(this._hasVideo)continue;this._hasVideo=!0,l="avc1",a.avcC&&(l+="."+a.avcC.mimeCodec),Line truncated
const{EventEmitter:i}=e("events"),s=e("bencode"),r=e("bitfield").default,a=e("debug")("ut_metadata"),o=e("simple-sha1"),c=16384;t.exports=e=>{class t extends i{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new r(0,{grow:1e3}),n.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,n){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7<e.metadata_size||e.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=e.metadata_size,this._numPieces=Math.ceil(this._metadataSize/c),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(e){let t,n;try{const i=e.toString(),r=i.indexOf("ee")+2;t=s.decode(i.substring(0,r)),n=e.slice(r)}catch(e){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)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(e){if(this._metadataComplete)return!0;a("set metadata");try{const t=s.decode(e).info;t&&(e=s.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===o.sync(e))&&(this.cancel(),this.metadata=e,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",s.encode({info:s.decode(this.metadata)})),!0)}_send(e,t){let i=s.encode(e);n.isBuffer(t)&&(i=n.concat([i,t])),this._wire.extended("ut_metadata",i)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,n){const i={msg_type:1,piece:e};"number"==typeof n&&(i.total_size=n),this._send(i,t)}_reject(e){this._send({msg_type:2,piece:e})}_onRequest(e){if(!this._metadataComplete)return void this._reject(e);const t=e*c;let n=t+c;n>this._metadataSize&&(n=this._metadataSize);const i=this.metadata.slice(t,n);this._data(e,i,this._metadataSize)}_onData(e,t,n){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=n.alloc(this._metadataSize);for(let e=0;e<this._numPieces;e++)this._request(e)}}_checkDone(){let e=!0;for(let t=0;t<this._numPieces;t++)if(!this._bitfield.get(t)){e=!1;break}if(!e)return;this.setMetadata(this.metadata)||this._failedMetadata()}_failedMetadata(){this._bitfield=new r(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:6,bitfield:300,buffer:59,debug:301,events:97,"simple-sha1":241}],300:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],301:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{"./common":302,_process:186,dup:12}],302:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{dup:13,ms:303}],303:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],304:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],305:[function(e,t,n){(function(n){(function(){const i=e("binary-search"),s=e("events"),r=e("mp4-stream"),a=e("mp4-box-encoding"),o=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends s{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=r.decode();const n=this._file.createReadStream({start:e});n.pipe(this._decoder);const i=s=>{"moov"===s.type?(this._decoder.removeListener("box",i),this._decoder.decode((e=>{n.destroy();try{this._processMoov(e)}catch(e){e.message="Cannot parse mp4 file: "+e.message,this.emit("error",e)}}))):s.length<4096?(t+=s.length,this._decoder.ignore()):(this._decoder.removeListener("box",i),t+=s.length,n.destroy(),this._decoLine truncated
/*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const{EventEmitter:r}=e("events"),a=e("simple-concat"),o=e("create-torrent"),c=e("debug")("webtorrent"),l=e("bittorrent-dht/client"),p=e("load-ip-set"),u=e("run-parallel"),d=e("parse-torrent"),h=e("path"),f=e("simple-peer"),m=e("randombytes"),g=e("speedometer"),b=e("./lib/tcp-pool"),v=e("./lib/torrent"),x=e("./package.json").version,_=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),y=`-WW${_}-`;class w extends r{constructor(e={}){super(),"string"==typeof e.peerId?this.peerId=e.peerId:s.isBuffer(e.peerId)?this.peerId=e.peerId.toString("hex"):this.peerId=s.from(y+m(9).toString("base64")).toString("hex"),this.peerIdBuffer=s.from(this.peerId,"hex"),"string"==typeof e.nodeId?this.nodeId=e.nodeId:s.isBuffer(e.nodeId)?this.nodeId=e.nodeId.toString("hex"):this.nodeId=m(20).toString("hex"),this.nodeIdBuffer=s.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=e.torrentPort||0,this.dhtPort=e.dhtPort||0,this.tracker=void 0!==e.tracker?e.tracker:{},this.torrents=[],this.maxConns=Number(e.maxConns)||55,this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),e.rtcConfig&&(console.warn("WebTorrent: opts.rtcConfig is deprecated. Use opts.tracker.rtcConfig instead"),this.tracker.rtcConfig=e.rtcConfig),e.wrtc&&(console.warn("WebTorrent: opts.wrtc is deprecated. Use opts.tracker.wrtc instead"),this.tracker.wrtc=e.wrtc),i.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=i.WRTC)),"function"==typeof b?this._tcpPool=new b(this):n.nextTick((()=>{this._onListening()})),this._downloadSpeed=g(),this._uploadSpeed=g(),!1!==e.dht&&"function"==typeof l?(this.dht=new l(Object.assign({},{nodeId:this.nodeId},e.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==e.webSeeds;const t=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof p&&null!=e.blocklist?p(e.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,n)=>{if(e)return this.error("Failed to load blocklist: "+e.message);this.blocked=n,t()})):n.nextTick(t)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof v){if(this.torrents.includes(e))return e}else{let t;try{t=d(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}download(e,t,n){return console.warn("WebTorrent: client.download() is deprecated. Use client.add() instead"),this.add(e,t,n)}add(e,t={},n){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]);const i=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===r.infoHash&&e!==r)return void r._destroy(new Error("Cannot add duplicate torrent "+r.infoHash))},s=()=>{this.destroyed||("function"==typeof n&&n(r),this.emit("torrent",r))};this._debug("add"),t=t?Object.assign({},t):{};const r=new v(e,this,t);return this.torrents.push(r),r.once("_infoHash",i),r.once("ready",s),r.once("close",(function e(){r.removeListener("_infoHash",i),r.removeListener("ready",s),r.removeListener("close",e)})),r}seed(e,t,n){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]),this._debug("seed"),(t=t?Object.assign({},t):{}).skipVerify=!0;const i="string"==typeof e;i&&(t.path=h.dirname(e)),t.createdBy||(t.createdBy="WebTorrent/"+_);const s=e=>{this._debug("on seed"),"function"==typeof n&&n(e),e.emit("seed"),this.emit("seed",e)},r=this.add(null,t,(e=>{const t=[t=>{if(i)return t();e.load(c,t)}];this.dht&&t.push((t=>{e.once("dhtAnnounce",t)})),u(t,(t=>{if(!this.destroyed)return t?e._destroy(t):void s(e)}))}));let c;var l;return l=e,"undefined"!=typeof FileList&&l instanceof FileList?e=Array.from(e):Array.isArray(e)||(e=[e]),u(e.map((e=>t=>{!function(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}(e)?t(null,e):a(e,t)})),((e,n)=>{if(!this.destroyed)return e?r._destroy(e):void o.parseInput(n,t,((e,i)=>{if(!this.destroyed){if(e)return r._destroy(e);c=i.map((e=>e.getStream)),o(n,t,((e,t)=>{if(this.destroyed)return;if(e)return r._destroy(e);const n=this.get(t);n?r._destroy(new Error("Cannot add duplicate torrent "+n.infoHash)):r._onTorrentId(t)}))}}))})),r}remove(e,t){this._debug("remove");if(!this.get(e))throw new Error("No torrent with id "+e);this._remove(e,t)}_remove(e,t){const n=this.get(e);n&&(this.torrents.splice(this.torrents.indexLine truncated
const{EventEmitter:r}=e("events"),a=e("simple-concat"),o=e("create-torrent"),c=e("debug")("webtorrent"),l=e("bittorrent-dht/client"),p=e("load-ip-set"),u=e("run-parallel"),d=e("parse-torrent"),h=e("path"),f=e("simple-peer"),m=e("randombytes"),g=e("speedometer"),v=e("./lib/conn-pool"),b=e("./lib/torrent"),x=e("./package.json").version,_=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),y=`-WW${_}-`;class w extends r{constructor(e={}){super(),"string"==typeof e.peerId?this.peerId=e.peerId:s.isBuffer(e.peerId)?this.peerId=e.peerId.toString("hex"):this.peerId=s.from(y+m(9).toString("base64")).toString("hex"),this.peerIdBuffer=s.from(this.peerId,"hex"),"string"==typeof e.nodeId?this.nodeId=e.nodeId:s.isBuffer(e.nodeId)?this.nodeId=e.nodeId.toString("hex"):this.nodeId=m(20).toString("hex"),this.nodeIdBuffer=s.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=e.torrentPort||0,this.dhtPort=e.dhtPort||0,this.tracker=void 0!==e.tracker?e.tracker:{},this.torrents=[],this.maxConns=Number(e.maxConns)||55,this.utp=!0===e.utp,this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),e.rtcConfig&&(console.warn("WebTorrent: opts.rtcConfig is deprecated. Use opts.tracker.rtcConfig instead"),this.tracker.rtcConfig=e.rtcConfig),e.wrtc&&(console.warn("WebTorrent: opts.wrtc is deprecated. Use opts.tracker.wrtc instead"),this.tracker.wrtc=e.wrtc),i.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=i.WRTC)),"function"==typeof v?this._connPool=new v(this):n.nextTick((()=>{this._onListening()})),this._downloadSpeed=g(),this._uploadSpeed=g(),!1!==e.dht&&"function"==typeof l?(this.dht=new l(Object.assign({},{nodeId:this.nodeId},e.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==e.webSeeds;const t=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof p&&null!=e.blocklist?p(e.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,n)=>{if(e)return this.error("Failed to load blocklist: "+e.message);this.blocked=n,t()})):n.nextTick(t)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof b){if(this.torrents.includes(e))return e}else{let t;try{t=d(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}download(e,t,n){return console.warn("WebTorrent: client.download() is deprecated. Use client.add() instead"),this.add(e,t,n)}add(e,t={},n=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]);const i=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===r.infoHash&&e!==r)return void r._destroy(new Error("Cannot add duplicate torrent "+r.infoHash))},s=()=>{this.destroyed||(n(r),this.emit("torrent",r))};this._debug("add"),t=t?Object.assign({},t):{};const r=new b(e,this,t);return this.torrents.push(r),r.once("_infoHash",i),r.once("ready",s),r.once("close",(function e(){r.removeListener("_infoHash",i),r.removeListener("ready",s),r.removeListener("close",e)})),r}seed(e,t,n){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]),this._debug("seed"),(t=t?Object.assign({},t):{}).skipVerify=!0;const i="string"==typeof e;i&&(t.path=h.dirname(e)),t.createdBy||(t.createdBy="WebTorrent/"+_);const s=e=>{this._debug("on seed"),"function"==typeof n&&n(e),e.emit("seed"),this.emit("seed",e)},r=this.add(null,t,(e=>{const t=[t=>{if(i)return t();e.load(c,t)}];this.dht&&t.push((t=>{e.once("dhtAnnounce",t)})),u(t,(t=>{if(!this.destroyed)return t?e._destroy(t):void s(e)}))}));let c;var l;return l=e,"undefined"!=typeof FileList&&l instanceof FileList?e=Array.from(e):Array.isArray(e)||(e=[e]),u(e.map((e=>t=>{!function(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}(e)?t(null,e):a(e,t)})),((e,n)=>{if(!this.destroyed)return e?r._destroy(e):void o.parseInput(n,t,((e,i)=>{if(!this.destroyed){if(e)return r._destroy(e);c=i.map((e=>e.getStream)),o(n,t,((e,t)=>{if(this.destroyed)return;if(e)return r._destroy(e);const n=this.get(t);n?r._destroy(new Error("Cannot add duplicate torrent "+n.infoHash)):r._onTorrentId(t)}))}}))})),r}remove(e,t,n){if("function"==typeof t)return this.remove(e,null,t);this._debug("remove");if(!this.get(e))throw new Error("No torrent with id "+e);this._remove(e,t,n)}_remove(e,tLine truncated
+20 -12
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, user-scalable=no" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Inspect and edit what's in your Torrent file or Magnet link" />
<meta name="keywords" content="torrent, webtorrent, magnet, p2p, peer to peer, filesharing, announce, tracker, webseed" />
@@ -83,28 +83,36 @@
<br />
<a id="removeTrackers">Remove All</a>
</div>
<div>
<button id="addTracker" data-type="announce">
<span class="fas fa-plus"></span>
<span class="far fa-plus-circle"></span> Add Tracker
</button>
<div id="announce"></div>
</div>
<div class="property">
<label for="urlList">Webseed URLs</label>
<button id="addWebseed" data-type="urlList">
<span class="fas fa-plus"></span>
</button>
<button id="removeWebseeds">
<span class="fas fa-eraser"></span>
</button>
<div id="urlList"></div>
</div>
<div class="property">
<div>
<label for="urlList">Webseed URLs</label>
<button id="removeWebseeds">
<span class="fas fa-eraser"></span>
</button>
</div>
<div>
<button id="addWebseed" data-type="urlList">
<span class="far fa-plus-circle"></span> Add Tracker
</button>
<div id="urlList"></div>
</div>
</div>
<div class="property">
<div>
<label for="files">Files</label>
<button id="getFiles">
<span class="fad fa-chart-network"></span>
</button>
</div>
<table id="files">
<tbody id="filesBody"></tbody>
</table>
+1 -1
View File
@@ -327,7 +327,7 @@ async function addCurrentTrackers() {
}
function addRow() {
parsed[this.dataset.type].push("");
parsed[this.dataset.type].unshift("");
display();
}
+17
View File
@@ -61,6 +61,10 @@ button:disabled {
filter: brightness(0.6);
}
a {
cursor: pointer;
}
header {
width: 100%;
height: 80px;
@@ -104,6 +108,7 @@ label[for="torrent"] {
box-sizing: border-box;
border-radius: 900px;
text-align: center;
text-transform: none;
cursor: pointer;
}
@@ -157,6 +162,18 @@ input {
width: 440px;
}
#addTracker, #addWebseed {
width: 440px;
color: var(--light-blue);
background: var(--dark-blue);
border: 1px solid var(--light-blue);
padding: 8px;
box-sizing: border-box;
border-radius: 900px;
text-align: left;
cursor: pointer;
}
@media (max-width: 1080px) {
#reset {