Update Dependencies

This commit is contained in:
Leo authored and GitHub committed 2021-10-29 18:03:52 +00:00
1 parent 8813e819c4
commit 92f5abdb96
4 files changed
+2331 -1507

No files matched your search

+2276 -1459
View File
File diff suppressed because it is too large. Load diff
+43 -36
View File
@@ -1,102 +1,109 @@
!function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return r(t[o][1][e]||e)}),l,l.exports,e,t,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t,n){(function(e){(function(){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function i(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function s(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(n,"__esModule",{value:!0});var o=Math.round;function a(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;return r(e)&&t&&(i=n.width/e.offsetWidth||1,s=n.height/e.offsetHeight||1),{width:o(n.width/i),height:o(n.height/s),top:o(n.top/s),right:o(n.right/i),bottom:o(n.bottom/s),left:o(n.left/i),x:o(n.left/i),y:o(n.top/s)}}function c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function u(e){return e?(e.nodeName||"").toLowerCase():null}function l(e){return((i(e)?e.ownerDocument:e.document)||window.document).documentElement}function d(e){return a(l(e)).left+c(e).scrollLeft}function f(e){return t(e).getComputedStyle(e)}function p(e){var t=f(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function h(e,n,i){void 0===i&&(i=!1);var s,o,f=r(n),h=r(n)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return 1!==n||1!==i}(n),m=l(n),b=a(e,h),g={scrollLeft:0,scrollTop:0},v={x:0,y:0};return(f||!f&&!i)&&(("body"!==u(n)||p(m))&&(g=(s=n)!==t(s)&&r(s)?{scrollLeft:(o=s).scrollLeft,scrollTop:o.scrollTop}:c(s)),r(n)?((v=a(n,!0)).x+=n.clientLeft,v.y+=n.clientTop):m&&(v.x=d(m))),{x:b.left+g.scrollLeft-v.x,y:b.top+g.scrollTop-v.y,width:b.width,height:b.height}}function m(e){var t=a(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function b(e){return"html"===u(e)?e:e.assignedSlot||e.parentNode||(s(e)?e.host:null)||l(e)}function g(e){return["html","body","#document"].indexOf(u(e))>=0?e.ownerDocument.body:r(e)&&p(e)?e:g(b(e))}function v(e,n){var i;void 0===n&&(n=[]);var r=g(e),s=r===(null==(i=e.ownerDocument)?void 0:i.body),o=t(r),a=s?[o].concat(o.visualViewport||[],p(r)?r:[]):r,c=n.concat(a);return s?c:c.concat(v(b(a)))}function y(e){return["table","td","th"].indexOf(u(e))>=0}function _(e){return r(e)&&"fixed"!==f(e).position?e.offsetParent:null}function w(e){for(var n=t(e),i=_(e);i&&y(i)&&"static"===f(i).position;)i=_(i);return i&&("html"===u(i)||"body"===u(i)&&"static"===f(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===f(e).position)return null;for(var n=b(e);r(n)&&["html","body"].indexOf(u(n))<0;){var i=f(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var x="top",k="bottom",E="right",S="left",M="auto",A=[x,k,E,S],I="start",T="end",j="viewport",C="popper",B=A.reduce((function(e,t){return e.concat([t+"-"+I,t+"-"+T])}),[]),R=[].concat(A,[M]).reduce((function(e,t){return e.concat([t,t+"-"+I,t+"-"+T])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function O(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return[].concat(n).reduce((function(e,t){return e.replace(/%s/,t)}),e)}var U='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',q=["name","enabled","phase","fn","effect","requires","options"];function N(e){return e.split("-")[0]}var D=Math.max,z=Math.min,H=Math.round;function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&s(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function W(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function V(e,n){return n===j?W(function(e){var n=t(e),i=l(e),r=n.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,c=0;return r&&(s=r.width,o=r.height,/^((?!chrome|android)Line truncated !function e(t,i,n){function r(a,o){if(!i[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[a]={exports:{}};t[a][0].call(u.exports,(function(e){return r(t[a][1][e]||e)}),u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,i){(function(e){(function(){"use strict";function t(e,t){var i=e.getBoundingClientRect();return{width:i.width/1,height:i.height/1,top:i.top/1,right:i.right/1,bottom:i.bottom/1,left:i.left/1,x:i.left/1,y:i.top/1}}function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function s(e){return e instanceof n(e).Element||e instanceof Element}function a(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}function c(e){return e?(e.nodeName||"").toLowerCase():null}function l(e){return((s(e)?e.ownerDocument:e.document)||window.document).documentElement}function u(e){return t(l(e)).left+r(e).scrollLeft}function p(e){return n(e).getComputedStyle(e)}function d(e){var t=p(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function f(e,i,s){void 0===s&&(s=!1);var o=a(i);a(i)&&function(e){var t=e.getBoundingClientRect(),i=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1}(i);var p,f,h=l(i),m=t(e),b={scrollLeft:0,scrollTop:0},v={x:0,y:0};return(o||!o&&!s)&&(("body"!==c(i)||d(h))&&(b=(p=i)!==n(p)&&a(p)?{scrollLeft:(f=p).scrollLeft,scrollTop:f.scrollTop}:r(p)),a(i)?((v=t(i)).x+=i.clientLeft,v.y+=i.clientTop):h&&(v.x=u(h))),{x:m.left+b.scrollLeft-v.x,y:m.top+b.scrollTop-v.y,width:m.width,height:m.height}}function h(e){var i=t(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(i.width-n)<=1&&(n=i.width),Math.abs(i.height-r)<=1&&(r=i.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function m(e){return"html"===c(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||l(e)}function b(e){return["html","body","#document"].indexOf(c(e))>=0?e.ownerDocument.body:a(e)&&d(e)?e:b(m(e))}function v(e,t){var i;void 0===t&&(t=[]);var r=b(e),s=r===(null==(i=e.ownerDocument)?void 0:i.body),a=n(r),o=s?[a].concat(a.visualViewport||[],d(r)?r:[]):r,c=t.concat(o);return s?c:c.concat(v(m(o)))}function g(e){return["table","td","th"].indexOf(c(e))>=0}function y(e){return a(e)&&"fixed"!==p(e).position?e.offsetParent:null}function _(e){for(var t=n(e),i=y(e);i&&g(i)&&"static"===p(i).position;)i=y(i);return i&&("html"===c(i)||"body"===c(i)&&"static"===p(i).position)?t:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&a(e)&&"fixed"===p(e).position)return null;for(var i=m(e);a(i)&&["html","body"].indexOf(c(i))<0;){var n=p(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}Object.defineProperty(i,"__esModule",{value:!0});var x="top",w="bottom",k="right",E="left",S="auto",M=[x,w,k,E],A="start",j="end",I="viewport",T="popper",C=M.reduce((function(e,t){return e.concat([t+"-"+A,t+"-"+j])}),[]),B=[].concat(M,[S]).reduce((function(e,t){return e.concat([t,t+"-"+A,t+"-"+j])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function L(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||r(e)})),n}function O(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return[].concat(i).reduce((function(e,t){return e.replace(/%s/,t)}),e)}var P='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',U=["name","enabled","phase","fn","effect","requires","options"];function q(e){return e.split("-")[0]}var N=Math.max,D=Math.min,z=Math.round;function H(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&o(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function F(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function W(e,i){return i===I?F(function(e){var t=n(e),i=l(e),r=t.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,c=0;return r&&(s=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,c=r.offsetTop)),{width:s,height:a,x:o+u(e),y:c}}(e)):a(i)?function(e){var i=t(e);return i.top=i.top+e.clLine truncated
/*! bittorrent-protocol. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! bittorrent-protocol. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("unordered-array-remove"),r=e("bencode"),s=e("bitfield").default,o=e("crypto"),a=e("debug")("bittorrent-protocol"),c=e("randombytes"),u=e("simple-sha1"),l=e("speedometer"),d=e("readable-stream"),f=e("rc4"),p=n.from("BitTorrent protocol"),h=n.from([0,0,0,0]),m=n.from([0,0,0,1,0]),b=n.from([0,0,0,1,1]),g=n.from([0,0,0,1,2]),v=n.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],_=[0,0,0,3,9,0,0],w=n.from([0,0,0,0,0,0,0,0]),x=n.from([0,0,1,2]),k=n.from([0,0,0,2]);function E(e,t){for(let n=e.length;n--;)e[n]^=t[n];return e}class S{constructor(e,t,n,i){this.piece=e,this.offset=t,this.length=n,this.callback=i}}class M extends d.Duplex{constructor(e=null,t=0,n=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new s(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=l(),this.downloadSpeed=l(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=n,n?(this._dh=o.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}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._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}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 r(){}"function"!=typeof i.onHandshake&&(i.onHandshake=r),"function"!=typeof i.onExtendedHandshake&&(i.onExtendedHandshake=r),"function"!=typeof i.onMessage&&(i.onMessage=r),this.extendedMapping[n]=t,this._ext[t]=i,this[t]=i,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=n.from(u.sync(n.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),i=E(n.from(u.sync(n.from(this._utfToHex("req2")+e,"hex")),"hex"),n.from(u.sync(n.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,s=c(r);let o=n.alloc(14+r+2);w.copy(o),x.copy(o,8),o.writeInt16BE(r,12),s.copy(o,14),o.writeInt16BE(0,14+r),o=this._encryptHandshake(o),this._push(n.concat([t,i,o]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,i=c(t);let r=n.alloc(14+t);w.copy(r),k.copy(r,8),r.writeInt16BE(t,12),i.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,i){let r,s;if("string"==typeof e?(e=e.toLowerCase(),r=n.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?s=n.from(t,"hex"):(s=t,t=s.toString("hex")),this._infoHash=r,20!==r.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,i);const o=n.from(y);o[5]|=16,i&&i.dht&&(o[7]|=1),this._push(n.concat([p,o,r,s])),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,r.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking){for(this.amChoking=!0,this._dLine truncated const n=e("unordered-array-remove"),r=e("bencode"),s=e("bitfield").default,a=e("crypto"),o=e("debug")("bittorrent-protocol"),c=e("randombytes"),l=e("simple-sha1"),u=e("speedometer"),p=e("readable-stream"),d=e("rc4"),f=i.from("BitTorrent protocol"),h=i.from([0,0,0,0]),m=i.from([0,0,0,1,0]),b=i.from([0,0,0,1,1]),v=i.from([0,0,0,1,2]),g=i.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],_=[0,0,0,3,9,0,0],x=i.from([0,0,0,0,0,0,0,0]),w=i.from([0,0,1,2]),k=i.from([0,0,0,2]);function E(e,t){for(let i=e.length;i--;)e[i]^=t[i];return e}class S{constructor(e,t,i,n){this.piece=e,this.offset=t,this.length=i,this.callback=n}}class M extends p.Duplex{constructor(e=null,t=0,i=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new s(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=u(),this.downloadSpeed=u(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=i,i?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}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._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}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 i=this._nextExt,n=new e(this);function r(){}"function"!=typeof n.onHandshake&&(n.onHandshake=r),"function"!=typeof n.onExtendedHandshake&&(n.onExtendedHandshake=r),"function"!=typeof n.onMessage&&(n.onMessage=r),this.extendedMapping[i]=t,this._ext[t]=n,this[t]=n,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),n=E(i.from(l.sync(i.from(this._utfToHex("req2")+e,"hex")),"hex"),i.from(l.sync(i.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,s=c(r);let a=i.alloc(14+r+2);x.copy(a),w.copy(a,8),a.writeInt16BE(r,12),s.copy(a,14),a.writeInt16BE(0,14+r),a=this._encryptHandshake(a),this._push(i.concat([t,n,a]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,n=c(t);let r=i.alloc(14+t);x.copy(r),k.copy(r,8),r.writeInt16BE(t,12),n.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,n){let r,s;if("string"==typeof e?(e=e.toLowerCase(),r=i.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?s=i.from(t,"hex"):(s=t,t=s.toString("hex")),this._infoHash=r,20!==r.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,n);const a=i.from(y);a[5]|=16,n&&n.dht&&(a[7]|=1),this._push(i.concat([f,a,r,s])),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 i=this.extendedMapping[t];e.m[i]=Number(t)}this.extended(0,r.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking){for(this.amChoking=!0,this._dLine truncated
/*! blob-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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(r){i.removeEventListener("loadend",t,!1),r.error?n(r.error):n(null,e.from(i.result))}),!1),i.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],55:[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;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t<this.size;){const n=this._buffered.shift();if(t+n.length<=this.size)e.push(n),t+=n.length;else{const i=this.size-t;e.push(n.slice(0,i)),t+=i,this._buffered.unshift(n.slice(i))}}this.push(n.concat(e,this.size))}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:116,"readable-stream":70}],56:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],57:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":59,"./_stream_writable":61,_process:342,dup:33,inherits:249}],58:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":60,dup:34,inherits:249}],59:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":56,"./_stream_duplex":57,"./internal/streams/async_iterator":62,"./internal/streams/buffer_list":63,"./internal/streams/destroy":64,"./internal/streams/from":66,"./internal/streams/state":68,"./internal/streams/stream":69,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],60:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":56,"./_stream_duplex":57,dup:36,inherits:249}],61:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":56,"./_stream_duplex":57,"./internal/streams/destroy":64,"./internal/streams/state":68,"./internal/streams/stream":69,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],62:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":65,_process:342,dup:38}],63:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],64:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],65:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":56,dup:41}],66:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],67:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":56,"./end-of-stream":65,dup:43}],68:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":56,dup:44}],69:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],70:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":57,"./lib/_stream_passthrough.js":58,"./lib/_stream_readable.js":59,"./lib/_stream_transform.js":60,"./lib/_stream_writable.js":61,"./lib/internal/streams/end-of-stream.js":65,"./lib/internal/streams/pipeline.js":67,dup:46}],71:[function(e,t,n){!function(t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function s(e,t,n){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof t?t.exports=s:n.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void i(!1,"Invalid character in "+e)}function c(e,t,n){var i=a(e,n);return n-1>=t&&(i|=a(e,n-1)<<4),i}function u(e,t,n,r){for(var s=0,o=0,a=Math.min(e.length,n),c=t;c<a;c++){var u=e.charCodeAt(c)-48;s*=r,o=u>=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&o<r,"Invalid character"),s+=o}return s}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),i(t=Line truncated t.exports=function(t,i){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof i)throw new Error("second argument must be a function");const n=new FileReader;n.addEventListener("loadend",(function t(r){n.removeEventListener("loadend",t,!1),r.error?i(r.error):i(null,e.from(n.result))}),!1),n.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],49:[function(e,t,i){(function(i){(function(){const{Transform:n}=e("readable-stream");t.exports=class extends n{constructor(e,t={}){super(t),"object"==typeof e&&(e=(t=e).size),this.size=e||512;const{nopad:i,zeroPadding:n=!0}=t;this._zeroPadding=!i&&!!n,this._buffered=[],this._bufferedBytes=0}_transform(e,t,n){for(this._bufferedBytes+=e.length,this._buffered.push(e);this._bufferedBytes>=this.size;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t<this.size;){const i=this._buffered.shift();if(t+i.length<=this.size)e.push(i),t+=i.length;else{const n=this.size-t;e.push(i.slice(0,n)),t+=n,this._buffered.unshift(i.slice(n))}}this.push(i.concat(e,this.size))}n()}_flush(){if(this._bufferedBytes&&this._zeroPadding){const e=i.alloc(this.size-this._bufferedBytes);this._buffered.push(e),this.push(i.concat(this._buffered)),this._buffered=null}else this._bufferedBytes&&(this.push(i.concat(this._buffered)),this._buffered=null);this.push(null)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"readable-stream":64}],50:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],51:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":53,"./_stream_writable":55,_process:341,dup:30,inherits:246}],52:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":54,dup:31,inherits:246}],53:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/async_iterator":56,"./internal/streams/buffer_list":57,"./internal/streams/destroy":58,"./internal/streams/from":60,"./internal/streams/state":62,"./internal/streams/stream":63,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],54:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,dup:33,inherits:246}],55:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/destroy":58,"./internal/streams/state":62,"./internal/streams/stream":63,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],56:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":59,_process:341,dup:35}],57:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],58:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],59:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":50,dup:38}],60:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],61:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":50,"./end-of-stream":59,dup:40}],62:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":50,dup:41}],63:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],64:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":51,"./lib/_stream_passthrough.js":52,"./lib/_stream_readable.js":53,"./lib/_stream_transform.js":54,"./lib/_stream_writable.js":55,"./lib/internal/streams/end-of-stream.js":59,"./lib/internal/streams/pipeline.js":61,dup:43}],65:[function(e,t,i){!function(t,i){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function s(e,t,i){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var a;"object"==typeof t?t.exports=s:i.BN=s,s.BN=s,s.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function o(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void n(!1,"Invalid character in "+e)}function c(e,t,i){var n=o(e,i);return i-1>=t&&(n|=o(e,i-1)<<4),n}function l(e,t,i,r){for(var s=0,a=0,o=Math.min(e.length,i),c=t;c<o;c++){var l=e.charCodeAt(c)-48;s*=r,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<r,"Invalid character"),s+=a}return s}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t=Line truncated
/*! /*!
* The buffer module from node.js, for the browser. * The buffer module from node.js, for the browser.
* *
* @author Feross Aboukhadijeh <https://feross.org> * @author Feross Aboukhadijeh <https://feross.org>
* @license MIT * @license MIT
*/ */
"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=o,n.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(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 u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),i=s(n),r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(ArrayBuffer.isView(e))return l(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(D(e,ArrayBuffer)||e&&D(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__=o.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 o.from(i,t,n);var r=function(e){if(o.isBuffer(e)){var t=0|d(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?s(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.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 u(e){return c(e),s(e<0?0:0|d(e))}function l(e){for(var t=e.length<0?0:0|d(e.length),n=s(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function d(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(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 r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return i?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function p(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 I(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function h(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=o.from(t,i)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){var s,o=1,a=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;o=2,a/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var l=-1;for(s=n;s<a;s++)if(u(e,s)===u(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===c)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(n+c>a&&(n=a-c),s=n;s>=0;s--){for(var d=!0,f=0;f<c;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return-1}function g(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var s=t.length;i>s/2&&(i=s/2);for(var o=0;o<i;++o){var a=parseInt(t.substr(2*o,2),16);if(z(a))return o;e[n+o]=a}return o}funcLine truncated "use strict";var t=e("base64-js"),n=e("ieee754");i.Buffer=a,i.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},i.INSPECT_MAX_BYTES=50;var r=2147483647;function s(e){if(e>r)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,i){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,i)}function o(e,t,i){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 i=0|d(e,t),n=s(i),r=n.write(e,t);r!==i&&(n=n.slice(0,r));return n}(e,t);if(ArrayBuffer.isView(e))return u(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(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i);return n.__proto__=a.prototype,n}(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,i);var r=function(e){if(a.isBuffer(e)){var t=0|p(e.length),i=s(t);return 0===i.length||e.copy(i,0,0,t),i}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?s(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,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),s(e<0?0:0|p(e))}function u(e){for(var t=e.length<0?0:0|p(e.length),i=s(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function p(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,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(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,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return U(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 n?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,i);case"utf8":case"utf-8":return E(this,t,i);case"ascii":return M(this,t,i);case"latin1":case"binary":return A(this,t,i);case"base64":return k(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function m(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(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 t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,i,n,r){var s,a=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,i/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(s=i;s<o;s++)if(l(e,s)===l(t,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===c)return u*a}else-1!==u&&(s-=s-u),u=-1}else for(i+c>o&&(i=o-c),s=i;s>=0;s--){for(var p=!0,d=0;d<c;d++)if(l(e,s+d)!==l(t,d)){p=!1;break}if(p)return s}return-1}function v(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o=parseInt(t.substr(2*a,2),16);if(z(o))return a;e[i+a]=o}return a}funcLine truncated
/*! /*!
* bytes * bytes
* Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson * Copyright(c) 2015 Jed Watson
* MIT Licensed * MIT Licensed
*/ */
"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return a(e,t);return null},t.exports.format=a,t.exports.parse=c;var i=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,s={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},o=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function a(e,t){if(!Number.isFinite(e))return null;var n=Math.abs(e),o=t&&t.thousandsSeparator||"",a=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,u=Boolean(t&&t.fixedDecimals),l=t&&t.unit||"";l&&s[l.toLowerCase()]||(l=n>=s.pb?"PB":n>=s.tb?"TB":n>=s.gb?"GB":n>=s.mb?"MB":n>=s.kb?"KB":"B");var d=(e/s[l.toLowerCase()]).toFixed(c);return u||(d=d.replace(r,"$1")),o&&(d=d.replace(i,o)),d+a+l}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=o.exec(e),i="b";return n?(t=parseFloat(n[1]),i=n[4].toLowerCase()):(t=parseInt(e,10),i="b"),Math.floor(s[i]*t)}},{}],123:[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 n=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,s={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 i=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),u=t&&t.unit||"";u&&s[u.toLowerCase()]||(u=i>=s.pb?"PB":i>=s.tb?"TB":i>=s.gb?"GB":i>=s.mb?"MB":i>=s.kb?"KB":"B");var p=(e/s[u.toLowerCase()]).toFixed(c);return l||(p=p.replace(r,"$1")),a&&(p=p.replace(n,a)),p+o+u}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,i=a.exec(e),n="b";return i?(t=parseFloat(i[1]),n=i[4].toLowerCase()):(t=parseInt(e,10),n="b"),Math.floor(s[n]*t)}},{}],117:[function(e,t,i){
/*! cache-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! cache-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const i=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new i(t)}put(e,t,n=(()=>{})){if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,n)}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));t||(t={});let i=this.cache.get(e);if(i){const e=t.offset||0,s=t.length||i.length-e;return 0===e&&s===i.length||(i=i.slice(e,s+e)),r((()=>n(null,i)))}let s=this.inProgressGets.get(e);const o=!!s;s||(s=[],this.inProgressGets.set(e,s)),s.push({opts:t,cb:n}),o||this.store.get(e,((t,n)=>{t||null==this.cache||this.cache.set(e,n);const i=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of i)if(t)r(t);else{const t=e.offset||0,i=e.length||n.length-t;let s=n;0===t&&i===n.length||(s=n.slice(t,i+t)),r(null,s)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:258,"queue-microtask":355}],124:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],125:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":127,"./_stream_writable":129,_process:342,dup:33,inherits:249}],126:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":128,dup:34,inherits:249}],127:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/async_iterator":130,"./internal/streams/buffer_list":131,"./internal/streams/destroy":132,"./internal/streams/from":134,"./internal/streams/state":136,"./internal/streams/stream":137,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],128:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,dup:36,inherits:249}],129:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/destroy":132,"./internal/streams/state":136,"./internal/streams/stream":137,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],130:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":133,_process:342,dup:38}],131:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],132:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],133:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":124,dup:41}],134:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],135:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":124,"./end-of-stream":133,dup:43}],136:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":124,dup:44}],137:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],138:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":125,"./lib/_stream_passthrough.js":126,"./lib/_stream_readable.js":127,"./lib/_stream_transform.js":128,"./lib/_stream_writable.js":129,"./lib/internal/streams/end-of-stream.js":133,"./lib/internal/streams/pipeline.js":135,dup:46}],139:[function(e,t,n){const i=e("block-stream2"),r=e("readable-stream");class s extends r.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");const r=void 0!==n.zeroPadding&&n.zeroPadding;this._blockstream=new i(t,{...n,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=n.storeMaxOutstandingPuts||16;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&this._blockstream.pause(),e.put(s,t,(e=>{if(e)return this.destroy(e);this._outstandingPuts-=1,this._outstandingPuts<this._storeMaxOutstandingPuts&&this._blockstream.resume(),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=s},{"block-stream2":55,"readable-stream":138}],140:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("stream").Transform,s=e("string_decoder").StringDecoder;function o(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigestLine truncated const n=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new n(t)}put(e,t,i=(()=>{})){if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,i)}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));t||(t={});let n=this.cache.get(e);if(n){const e=t.offset||0,s=t.length||n.length-e;return 0===e&&s===n.length||(n=n.slice(e,s+e)),r((()=>i(null,n)))}let s=this.inProgressGets.get(e);const a=!!s;s||(s=[],this.inProgressGets.set(e,s)),s.push({opts:t,cb:i}),a||this.store.get(e,((t,i)=>{t||null==this.cache||this.cache.set(e,i);const n=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of n)if(t)r(t);else{const t=e.offset||0,n=e.length||i.length-t;let s=i;0===t&&n===i.length||(s=i.slice(t,n+t)),r(null,s)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:255,"queue-microtask":354}],118:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],119:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":121,"./_stream_writable":123,_process:341,dup:30,inherits:246}],120:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":122,dup:31,inherits:246}],121:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,"./internal/streams/async_iterator":124,"./internal/streams/buffer_list":125,"./internal/streams/destroy":126,"./internal/streams/from":128,"./internal/streams/state":130,"./internal/streams/stream":131,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],122:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,dup:33,inherits:246}],123:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,"./internal/streams/destroy":126,"./internal/streams/state":130,"./internal/streams/stream":131,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],124:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":127,_process:341,dup:35}],125:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],126:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],127:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":118,dup:38}],128:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],129:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":118,"./end-of-stream":127,dup:40}],130:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":118,dup:41}],131:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],132:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123,"./lib/internal/streams/end-of-stream.js":127,"./lib/internal/streams/pipeline.js":129,dup:43}],133:[function(e,t,i){const n=e("block-stream2"),r=e("readable-stream");class s extends r.Writable{constructor(e,t,i={}){if(super(i),!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");const r=void 0!==i.zeroPadding&&i.zeroPadding;this._blockstream=new n(t,{...i,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=i.storeMaxOutstandingPuts||16;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&this._blockstream.pause(),e.put(s,t,(e=>{if(e)return this.destroy(e);this._outstandingPuts-=1,this._outstandingPuts<this._storeMaxOutstandingPuts&&this._blockstream.resume(),0===this._outstandingPuts&&"function"==typeof this._finalCb&&(this._finalCb(null),this._finalCb=null)})),s+=1)})).on("error",(e=>{this.destroy(e)}))}_write(e,t,i){this._blockstream.write(e,t,i)}_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=s},{"block-stream2":49,"readable-stream":132}],134:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("stream").Transform,s=e("string_decoder").StringDecoder;function a(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigestLine truncated
/*! /*!
* clipboard.js v2.0.8 * clipboard.js v2.0.8
* https://clipboardjs.com/ * https://clipboardjs.com/
* *
* Licensed MIT © Zeno Rocha * Licensed MIT © Zeno Rocha
*/ */
var i,r;i=this,r=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return y}});var i=n(279),r=n.n(i),s=n(370),o=n.n(s),a=n(817),c=n.n(a);function u(e){return(u="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})(e)}function l(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)}}var d=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()}var t,n,i;return t=e,(n=[{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=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=c()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=c()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==u(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}])&&l(t.prototype,n),i&&l(t,i),e}();function f(e){return(f="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})(e)}function p(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)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){var n="data-clipboard-".concat(e);iLine truncated var n,r;n=this,r=function(){return function(){var e={134:function(e,t,i){"use strict";i.d(t,{default:function(){return x}});var n=i(279),r=i.n(n),s=i(370),a=i.n(s),o=i(817),c=i.n(o);function l(e){return l="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},l(e)}function u(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var p=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()}var t,i,n;return t=e,i=[{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=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=c()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=c()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}],i&&u(t.prototype,i),n&&u(t,n),e}(),d=p;function f(e){return f="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},f(e)}function h(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=g(e);if(t){var r=g(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return v(this,i)}}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function y(e,t){var i="data-clipboard-".conLine truncated
/*! create-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! create-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("bencode"),r=e("block-stream2"),s=e("piece-length"),o=e("path"),a=e("filestream/read"),c=e("is-file"),u=e("junk"),l=e("multistream"),d=e("once"),f=e("run-parallel"),p=e("queue-microtask"),h=e("simple-sha1"),m=e("readable-stream"),b=e("./get-files");function g(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=>_(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 s=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?s=null:0===n&&e.length>1?s=t.path[0]:t.path[0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e.path)))),s&&e.forEach((e=>{const t=(n.isBuffer(e)||w(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=o.basename(e),!0):!e.unknownName&&(t.name=e.path[e.path.length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const u=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=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");c(e[0],((e,t)=>{if(e)return i(e);l=t,d()}))}else p(d);function d(){f(e.map((e=>t=>{const i={};if(_(e))i.getStream=function(e){return()=>new a(e)}(e),i.length=e.size;else if(n.isBuffer(e))i.getStream=(r=e,()=>{const e=new m.PassThrough;return e.end(r),e}),i.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,u>1||l,t)}throw new Error("invalid input type")}i.getStream=function(e,t){return()=>{const n=new m.Transform;return n._transform=function(e,n,i){t.length+=e.length,this.push(e),i()},e.pipe(n),n}}(e,i),i.length=0}var r;i.path=e.path,t(null,i)})),((e,t)=>{if(e)return i(e);t=t.flat(),i(null,t,l)}))}}function v(e){const t=e[e.length-1];return"."===t[0]&&u.is(t)}function y(e,t){return e+t.length}function _(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,o,a){"function"==typeof o&&([o,a]=[a,o]),g(e,o=o?Object.assign({},o):{},((e,c,u)=>{if(e)return a(e);o.singleFileTorrent=u,function(e,o,a){let c=o.announceList;c||("string"==typeof o.announce?c=[[o.announce]]:Array.isArray(o.announce)&&(c=o.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===o.announce&&void 0===o.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof o.urlList&&(o.urlList=[o.urlList]);const u={info:{name:o.name},"creation date":Math.ceil((Number(o.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==o.comment&&(u.comment=o.comment);void 0!==o.createdBy&&(u["created by"]=o.createdBy);void 0!==o.private&&(u.info.private=Number(o.private));void 0!==o.info&&Object.assign(u.info,o.info);void 0!==o.sslCert&&(u.info["ssl-cert"]=o.sslCert);void 0!==o.urlList&&(u["url-list"]=o.urlList);const f=e.reduce(y,0),p=o.pieceLength||s(f);u.info["piece length"]=p,function(e,t,i,s,o){o=d(o);const a=[];let c=0,u=0;const f=e.map((e=>e.getStream));let p=0,m=0,b=!1;const g=new l(f),v=new r(t,{zeroPadding:!1});function y(e){c+=e.length;const t=m;h(e,(n=>{a[t]=n,p-=1,p<5&&v.resume(),u+=e.length,s.onProgress&&s.onProgress(u,i),k()})),p+=1,p>=5&&v.pause(),m+=1}function _(){b=!0,k()}function w(e){x(),o(e)}function x(){g.removeListener("error",w),v.removeListener("data",y),v.removeListener("end",_),v.removeListener("error",w)}function k(){b&&0===p&&(x(),o(null,n.from(a.join(""),"hex"),c))}g.on("error",w),g.pipe(v).on("data",y).on("end",_).on("error",w)}(e,p,f,o,((t,n,r)=>{if(t)return a(t);u.info.pieces=n,e.forEach((e=>{delete e.getStream})),o.singleFileTorrent?u.info.length=r:u.info.files=e,a(null,i.encode(u))}))}(c,o,a)}))},t.exports.parseInput=function(e,t,n){"function"==typeof t&&([t,n]=[n,t]),g(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"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":73,bencode:23,"block-stream2":55,buffer:116,"filestream/read":215,"is-file":73,junk:253,multistream:310,once:327,path:334,Line truncated const n=e("bencode"),r=e("block-stream2"),s=e("piece-length"),a=e("path"),o=e("filestream/read"),c=e("is-file"),l=e("junk"),u=e("multistream"),p=e("once"),d=e("run-parallel"),f=e("queue-microtask"),h=e("simple-sha1"),m=e("readable-stream"),b=e("./get-files");function v(e,t,n){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=>_(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 s=null;e.forEach(((t,i)=>{if("string"==typeof t)return;let n=t.fullPath||t.name;n||(n=`Unknown File ${i+1}`,t.unknownName=!0),t.path=n.split("/"),t.path[0]||t.path.shift(),t.path.length<2?s=null:0===i&&e.length>1?s=t.path[0]:t.path[0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!g(e.path)))),s&&e.forEach((e=>{const t=(i.isBuffer(e)||x(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e.path[e.path.length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const l=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let u=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");c(e[0],((e,t)=>{if(e)return n(e);u=t,p()}))}else f(p);function p(){d(e.map((e=>t=>{const n={};if(_(e))n.getStream=function(e){return()=>new o(e)}(e),n.length=e.size;else if(i.isBuffer(e))n.getStream=(r=e,()=>{const e=new m.PassThrough;return e.end(r),e}),n.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");return void b(e,l>1||u,t)}throw new Error("invalid input type")}n.getStream=function(e,t){return()=>{const i=new m.Transform;return i._transform=function(e,i,n){t.length+=e.length,this.push(e),n()},e.pipe(i),i}}(e,n),n.length=0}var r;n.path=e.path,t(null,n)})),((e,t)=>{if(e)return n(e);t=t.flat(),n(null,t,u)}))}}function g(e){const t=e[e.length-1];return"."===t[0]&&l.is(t)}function y(e,t){return e+t.length}function _(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,o){"function"==typeof a&&([a,o]=[o,a]),v(e,a=a?Object.assign({},a):{},((e,c,l)=>{if(e)return o(e);a.singleFileTorrent=l,function(e,a,o){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const l={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(l.announce=c[0][0],l["announce-list"]=c);void 0!==a.comment&&(l.comment=a.comment);void 0!==a.createdBy&&(l["created by"]=a.createdBy);void 0!==a.private&&(l.info.private=Number(a.private));void 0!==a.info&&Object.assign(l.info,a.info);void 0!==a.sslCert&&(l.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(l["url-list"]=a.urlList);const d=e.reduce(y,0),f=a.pieceLength||s(d);l.info["piece length"]=f,function(e,t,n,s,a){a=p(a);const o=[];let c=0,l=0;const d=e.map((e=>e.getStream));let f=0,m=0,b=!1;const v=new u(d),g=new r(t,{zeroPadding:!1});function y(e){c+=e.length;const t=m;h(e,(i=>{o[t]=i,f-=1,f<5&&g.resume(),l+=e.length,s.onProgress&&s.onProgress(l,n),k()})),f+=1,f>=5&&g.pause(),m+=1}function _(){b=!0,k()}function x(e){w(),a(e)}function w(){v.removeListener("error",x),g.removeListener("data",y),g.removeListener("end",_),g.removeListener("error",x)}function k(){b&&0===f&&(w(),a(null,i.from(o.join(""),"hex"),c))}v.on("error",x),v.pipe(g).on("data",y).on("end",_).on("error",x)}(e,f,d,a,((t,i,r)=>{if(t)return o(t);l.info.pieces=i,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?l.info.length=r:l.info.files=e,o(null,n.encode(l))}))}(c,a,o)}))},t.exports.parseInput=function(e,t,i){"function"==typeof t&&([t,i]=[i,t]),v(e,t=t?Object.assign({},t):{},i)},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"]],t.exports.isJunkPath=g}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:23,"block-stream2":49,buffer:110,"filestream/read":212,"is-file":67,junk:250,multistream:309,once:326,path:333,Line truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
n.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,c=(1<<a)-1,u=c>>1,l=-7,d=n?r-1:0,f=n?-1:1,p=e[t+d];for(d+=f,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(e,t,n,i,r,s){var o,a,c,u=8*s-r-1,l=(1<<u)-1,d=l>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,h=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=h,a/=256,r-=8);for(o=o<<r|a,u+=r;u>0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*m}},{}],248:[function(e,t,n){ i.read=function(e,t,i,n,r){var s,a,o=8*r-n-1,c=(1<<o)-1,l=c>>1,u=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,s=f&(1<<-u)-1,f>>=-u,u+=o;u>0;s=256*s+e[t+p],p+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===s)s=1-l;else{if(s===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},i.write=function(e,t,i,n,r,s){var a,o,c,l=8*s-r-1,u=(1<<l)-1,p=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,h=n?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=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(a++,c/=2),a+p>=u?(o=0,a=u):a+p>=1?(o=(t*c-1)*Math.pow(2,r),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&o,f+=h,o/=256,r-=8);for(a=a<<r|o,l+=r;l>0;e[i+f]=255&a,f+=h,a/=256,l-=8);e[i+f-h]|=128*m}},{}],245:[function(e,t,i){
/*! immediate-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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(t)}))}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,n);t||(t={});const s=t.offset||0,o=t.length||r.length-s;0===s&&o===r.length||(r=r.slice(s,o+s)),i((()=>n(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":355}],249:[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}}},{}],250:[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}},{}],251:[function(e,t,n){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} const n=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,i=(()=>{})){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,i(t)}))}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,i);t||(t={});const s=t.offset||0,a=t.length||r.length-s;0===s&&a===r.length||(r=r.slice(s,a+s)),n((()=>i(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":354}],246:[function(e,t,i){"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 i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],247:[function(e,t,i){t.exports=function(e){for(var t=0,i=e.length;t<i;++t)if(e.charCodeAt(t)>127)return!1;return!0}},{}],248:[function(e,t,i){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*! /*!
* Determine if an object is a Buffer * Determine if an object is a Buffer
* *
* @author Feross Aboukhadijeh <https://feross.org> * @author Feross Aboukhadijeh <https://feross.org>
* @license MIT * @license MIT
*/ */
t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],252:[function(e,t,n){t.exports=s,s.strict=o,s.loose=a;var i=Object.prototype.toString,r={"[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 s(e){return o(e)||a(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function a(e){return r[i.call(e)]}},{}],253:[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},{}],254:[function(e,t,n){n.RateLimiter=e("./lib/rateLimiter"),n.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":256,"./lib/tokenBucket":257}],255:[function(e,t,n){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),n=t[0],i=t[1];return 1e3*n+Math.floor(i/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:342}],256:[function(e,t,n){(function(n){(function(){var i=e("./tokenBucket"),r=e("./clock"),s=function(e,t,n){this.tokenBucket=new i(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=n};s.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return n.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var i=this,s=r();if((s<this.curIntervalStart||s-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=s,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)n.nextTick(t.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-s);setTimeout((function(){i.tokenBucket.removeTokens(e,a)}),o)}return!1}return this.tokenBucket.removeTokens(e,a);function a(n,r){if(n)return t(n,null);i.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=s}).call(this)}).call(this,e("_process"))},{"./clock":255,"./tokenBucket":257,_process:342}],257:[function(e,t,n){(function(e){(function(){var n=function(e,t,n,i){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=i,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,n){var i=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(n.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,s){return e?n(e,null):t>i.content?r():(i.content-=t,void n(null,Math.min(s,i.content)))})):(this.content-=t,e.nextTick(n.bind(null,null,this.content)),!0)):(e.nextTick(n.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-i.content)*(i.interval/i.tokensPerInterval));return setTimeout((function(){i.removeTokens(t,n)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},t.exports=n}).call(this)}).call(this,e("_process"))},{_process:342}],258:[function(e,t,n){var i=e("events"),r=e("inherits");function s(e){if(!(Line truncated t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],249:[function(e,t,i){t.exports=s,s.strict=a,s.loose=o;var n=Object.prototype.toString,r={"[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 s(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 r[n.call(e)]}},{}],250:[function(e,t,i){"use strict";i.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},i.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("|")),i.is=e=>i.regex.test(e),i.not=e=>!i.is(e),i.default=t.exports},{}],251:[function(e,t,i){i.RateLimiter=e("./lib/rateLimiter"),i.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":253,"./lib/tokenBucket":254}],252:[function(e,t,i){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),i=t[0],n=t[1];return 1e3*i+Math.floor(n/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:341}],253:[function(e,t,i){(function(i){(function(){var n=e("./tokenBucket"),r=e("./clock"),s=function(e,t,i){this.tokenBucket=new n(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=i};s.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return i.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var n=this,s=r();if((s<this.curIntervalStart||s-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=s,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)i.nextTick(t.bind(null,null,-1));else{var a=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-s);setTimeout((function(){n.tokenBucket.removeTokens(e,o)}),a)}return!1}return this.tokenBucket.removeTokens(e,o);function o(i,r){if(i)return t(i,null);n.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var i=this.tokenBucket.tryRemoveTokens(e);return i&&(this.tokensThisInterval+=e),i},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=s}).call(this)}).call(this,e("_process"))},{"./clock":252,"./tokenBucket":254,_process:341}],254:[function(e,t,i){(function(e){(function(){var i=function(e,t,i,n){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof i)switch(i){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+i)}else this.interval=i;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};i.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,i){var n=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(i.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,s){return e?i(e,null):t>n.content?r():(n.content-=t,void i(null,Math.min(s,n.content)))})):(this.content-=t,e.nextTick(i.bind(null,null,this.content)),!0)):(e.nextTick(i.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-n.content)*(n.interval/n.tokensPerInterval));return setTimeout((function(){n.removeTokens(t,i)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var i=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+i,this.bucketSize)}else this.content=this.bucketSize}},t.exports=i}).call(this)}).call(this,e("_process"))},{_process:341}],255:[function(e,t,i){var n=e("events"),r=e("inherits");function s(e){if(!(Line truncated
/*! lt_donthave. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! lt_donthave. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("unordered-array-remove"),{EventEmitter:r}=e("events"),s=e("debug")("lt_donthave");t.exports=()=>{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(s("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;s("donthave %d",e);const t=n.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let n=0;n<t.length;n++){const r=t[n];r.piece===e&&(i(t,n),n-=1,this._wire._callback(r,new Error("peer sent donthave"),null))}}}return e.prototype.name="lt_donthave",e}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,debug:260,events:196,"unordered-array-remove":493}],260:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":261,_process:342,dup:29}],261:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:262}],262:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],263:[function(e,t,n){(function(n){(function(){ const n=e("unordered-array-remove"),{EventEmitter:r}=e("events"),s=e("debug")("lt_donthave");t.exports=()=>{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(s("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;s("donthave %d",e);const t=i.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let i=0;i<t.length;i++){const r=t[i];r.piece===e&&(n(t,i),i-=1,this._wire._callback(r,new Error("peer sent donthave"),null))}}}return e.prototype.name="lt_donthave",e}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:161,events:193,"unordered-array-remove":481}],257:[function(e,t,i){(function(i){(function(){
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! 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);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const n=Array.from(t);1===n.length&&(e.xt=n[0]);n.length>1&&(e.xt=n);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);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 i="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,n)=>{const s=Array.isArray(e[t])?e[t]:[e[t]];s.forEach(((e,r)=>{(n>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(i+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(i+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(i+=`${t}=${r.compose(s)}`)})),i};const i=e("thirty-two"),r=e("bep53-range");function s(e){const t={},s=e.split("magnet:?")[1];let o;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)),"so"===i&&(s=r.parse(decodeURIComponent(s).split(","))),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(o=e.match(/^urn:btih:(.{40})/))t.infoHash=o[1].toLowerCase();else if(o=e.match(/^urn:btih:(.{32})/)){const e=i.decode(o[1]);t.infoHash=n.from(e,"binary").toString("hex")}else(o=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=o[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(o=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=o[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=n.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=n.from(t.publicKey,"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":25,buffer:116,"thirty-two":482}],264:[function(e,t,n){"use strict";var i=e("inherits"),r=e("hash-base"),s=e("safe-buffer").Buffer,o=new Array(16);function a(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function u(e,t,n,i,r,s,o){return c(e+(t&n|~t&i)+r+s|0,o)+t|0}function l(e,t,n,i,r,s,o){return c(e+(t&i|n&~i)+r+s|0,o)+t|0}function d(e,t,n,i,r,s,o){return c(e+(t^n^i)+r+s|0,o)+t|0}function f(e,t,n,i,r,s,o){return c(e+(n^(t|~i))+r+s|0,o)+t|0}i(a,r),a.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,i=this._b,r=this._c,s=this._d;n=u(n,i,r,s,e[0],3614090360,7),s=u(s,n,i,r,e[1],3905402710,12),r=u(r,s,n,i,e[2],606105819,17),i=u(i,r,s,n,e[3],3250441966,22),n=u(n,i,r,s,e[4],4118548399,7),s=u(s,n,i,r,e[5],1200080426,12),r=u(r,s,n,i,e[6],2821735955,17),i=u(i,r,s,n,e[7],4249261313,22),n=u(n,i,r,s,e[8],1770035416,7),s=u(s,n,i,r,e[9],2336552879,12),r=u(r,s,n,i,e[10],4294925233,17),i=u(i,r,s,n,e[11],2304563134,22),n=u(n,i,r,s,e[12],1804603682,7),s=u(s,n,i,r,e[13],4254626195,12),r=u(r,s,n,i,e[14],2792965006,17),n=l(n,i=u(i,r,s,n,e[15],1236535329,22),r,s,e[1],4129170786,5),s=l(s,n,i,r,e[6],3225465664,9),r=l(r,s,n,i,e[11],643717713,14),i=l(i,r,s,n,e[0],3921069994,20),n=l(n,i,r,s,e[5],3593408605,5),s=l(s,n,i,r,e[10],38016083,9),r=l(r,s,n,i,e[15],3634488961,14),i=l(i,r,s,n,e[4],3889429448,20),n=l(n,i,r,s,e[9],568446438,5),s=l(s,n,i,r,e[14],3275163606,9),r=l(r,s,n,i,e[3],4107603335,14),i=l(i,r,s,n,e[8],1163531501,20),n=l(n,i,r,s,e[13],2850285829,5),s=l(s,n,i,r,e[2],4243563512,9),r=l(r,s,n,i,e[7],1735328473,14),n=d(n,i=l(i,r,s,n,e[12],2368359562,20),r,s,e[5],4294588738,4),s=d(s,n,i,r,e[8],2272392833,11),r=d(r,s,n,i,e[11],1839030562,16),i=d(i,r,s,n,e[14],4259657740,23),n=d(n,i,r,s,e[1],2763975236,4),s=d(s,n,i,r,e[4],1272893353,11),r=d(r,s,n,i,e[7],4139469664,16),i=Line truncated t.exports=s,t.exports.decode=s,t.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const i=Array.from(t);1===i.length&&(e.xt=i[0]);i.length>1&&(e.xt=i);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);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 n="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,i)=>{const s=Array.isArray(e[t])?e[t]:[e[t]];s.forEach(((e,r)=>{(i>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(n+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(n+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(n+=`${t}=${r.compose(s)}`)})),n};const n=e("thirty-two"),r=e("bep53-range");function s(e){const t={},s=e.split("magnet:?")[1];let a;if((s&&s.length>=0?s.split("&"):[]).forEach((e=>{const i=e.split("=");if(2!==i.length)return;const n=i[0];let s=i[1];"dn"===n&&(s=decodeURIComponent(s).replace(/\+/g," ")),"tr"!==n&&"xs"!==n&&"as"!==n&&"ws"!==n||(s=decodeURIComponent(s)),"kt"===n&&(s=decodeURIComponent(s).split("+")),"ix"===n&&(s=Number(s)),"so"===n&&(s=r.parse(decodeURIComponent(s).split(","))),t[n]?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(s)):t[n]=s})),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=n.decode(a[1]);t.infoHash=i.from(e,"binary").toString("hex")}else(a=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=a[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(a=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=a[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=i.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=i.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=i.from(t.publicKey,"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":25,buffer:110,"thirty-two":473}],258:[function(e,t,i){"use strict";var n=e("inherits"),r=e("hash-base"),s=e("safe-buffer").Buffer,a=new Array(16);function o(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function l(e,t,i,n,r,s,a){return c(e+(t&i|~t&n)+r+s|0,a)+t|0}function u(e,t,i,n,r,s,a){return c(e+(t&n|i&~n)+r+s|0,a)+t|0}function p(e,t,i,n,r,s,a){return c(e+(t^i^n)+r+s|0,a)+t|0}function d(e,t,i,n,r,s,a){return c(e+(i^(t|~n))+r+s|0,a)+t|0}n(o,r),o.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var i=this._a,n=this._b,r=this._c,s=this._d;i=l(i,n,r,s,e[0],3614090360,7),s=l(s,i,n,r,e[1],3905402710,12),r=l(r,s,i,n,e[2],606105819,17),n=l(n,r,s,i,e[3],3250441966,22),i=l(i,n,r,s,e[4],4118548399,7),s=l(s,i,n,r,e[5],1200080426,12),r=l(r,s,i,n,e[6],2821735955,17),n=l(n,r,s,i,e[7],4249261313,22),i=l(i,n,r,s,e[8],1770035416,7),s=l(s,i,n,r,e[9],2336552879,12),r=l(r,s,i,n,e[10],4294925233,17),n=l(n,r,s,i,e[11],2304563134,22),i=l(i,n,r,s,e[12],1804603682,7),s=l(s,i,n,r,e[13],4254626195,12),r=l(r,s,i,n,e[14],2792965006,17),i=u(i,n=l(n,r,s,i,e[15],1236535329,22),r,s,e[1],4129170786,5),s=u(s,i,n,r,e[6],3225465664,9),r=u(r,s,i,n,e[11],643717713,14),n=u(n,r,s,i,e[0],3921069994,20),i=u(i,n,r,s,e[5],3593408605,5),s=u(s,i,n,r,e[10],38016083,9),r=u(r,s,i,n,e[15],3634488961,14),n=u(n,r,s,i,e[4],3889429448,20),i=u(i,n,r,s,e[9],568446438,5),s=u(s,i,n,r,e[14],3275163606,9),r=u(r,s,i,n,e[3],4107603335,14),n=u(n,r,s,i,e[8],1163531501,20),i=u(i,n,r,s,e[13],2850285829,5),s=u(s,i,n,r,e[2],4243563512,9),r=u(r,s,i,n,e[7],1735328473,14),i=p(i,n=u(n,r,s,i,e[12],2368359562,20),r,s,e[5],4294588738,4),s=p(s,i,n,r,e[8],2272392833,11),r=p(r,s,i,n,e[11],1839030562,16),n=p(n,r,s,i,e[14],4259657740,23),i=p(i,n,r,s,e[1],2763975236,4),s=p(s,i,n,r,e[4],1272893353,11),r=p(r,s,i,n,e[7],4139469664,16),n=Line truncated
/*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=a;var i=e("inherits"),r=e("readable-stream"),s=e("to-arraybuffer"),o="undefined"!=typeof window&&window.MediaSource;function a(e,t){var n=this;if(!(n instanceof a))return new a(e,t);if(!o)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 o,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(r.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){}}}))}a.prototype.createWriteStream=function(e){return new c(this,e)},a.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){}},a.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,r;n=e._debugBuffers,i="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),r.download=i,r.click()})))},i(c,r.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(o.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 r=s(e);i._wrapper._debug&&i._debugBuffers.push(r);try{i._sourceBuffer.appendBuffer(r)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(r){if(r)return n(r);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 r=e.start(i),s=e.end(i)+0;if(r>t)break;(n>=0||t<=s)&&(n=s)}var o=n-t;return o<0&&(o=0),o}},{inherits:249,"readable-stream":280,"to-arraybuffer":485}],266:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],267:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":269,"./_stream_writable":271,_process:342,dup:33,inherits:249}],268:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":270,dup:34,inherits:249}],269:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":266,"./_stream_duplex":267,"./internal/streams/async_iterator":272,"./internal/streams/buffer_list":273,"./internal/streams/destroy":274,"./internal/streams/from":276,"./internal/streams/state":278Line truncated t.exports=o;var n=e("inherits"),r=e("readable-stream"),s=e("to-arraybuffer"),a="undefined"!=typeof window&&window.MediaSource;function o(e,t){var i=this;if(!(i instanceof o))return new o(e,t);if(!a)throw new Error("web browser lacks MediaSource support");t||(t={}),i._debug=t.debug,i._bufferDuration=t.bufferDuration||60,i._elem=e,i._mediaSource=new a,i._streams=[],i.detailedError=null,i._errorHandler=function(){i._elem.removeEventListener("error",i._errorHandler),i._streams.slice().forEach((function(e){e.destroy(i._elem.error)}))},i._elem.addEventListener("error",i._errorHandler),i._elem.src=window.URL.createObjectURL(i._mediaSource)}function c(e,t){var i=this;if(r.Writable.call(i),i._wrapper=e,i._elem=e._elem,i._mediaSource=e._mediaSource,i._allStreams=e._streams,i._allStreams.push(i),i._bufferDuration=e._bufferDuration,i._sourceBuffer=null,i._debugBuffers=[],i._openHandler=function(){i._onSourceOpen()},i._flowHandler=function(){i._flow()},i._errorHandler=function(e){i.destroyed||i.emit("error",e)},"string"==typeof t)i._type=t,"open"===i._mediaSource.readyState?i._createSourceBuffer():i._mediaSource.addEventListener("sourceopen",i._openHandler);else if(null===t._sourceBuffer)t.destroy(),i._type=t._type,i._mediaSource.addEventListener("sourceopen",i._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(),i._type=t._type,i._sourceBuffer=t._sourceBuffer,i._debugBuffers=t._debugBuffers,i._sourceBuffer.addEventListener("updateend",i._flowHandler),i._sourceBuffer.addEventListener("error",i._errorHandler)}i._elem.addEventListener("timeupdate",i._flowHandler),i.on("error",(function(e){i._wrapper.error(e)})),i.on("finish",(function(){if(!i.destroyed&&(i._finished=!0,i._allStreams.every((function(e){return e._finished})))){i._wrapper._dumpDebugData();try{i._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 i,n,r;i=e._debugBuffers,n="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(i)),r.download=n,r.click()})))},n(c,r.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,i){var n=this;if(!n.destroyed)if(n._sourceBuffer){if(n._sourceBuffer.updating)return i(new Error("Cannot append buffer while source buffer updating"));var r=s(e);n._wrapper._debug&&n._debugBuffers.push(r);try{n._sourceBuffer.appendBuffer(r)}catch(e){return void n.destroy(e)}n._cb=i}else n._cb=function(r){if(r)return i(r);n._write(e,t,i)}},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,i=-1,n=0;n<e.length;n++){var r=e.start(n),s=e.end(n)+0;if(r>t)break;(i>=0||t<=s)&&(i=s)}var a=i-t;return a<0&&(a=0),a}},{inherits:246,"readable-stream":274,"to-arraybuffer":476}],260:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],261:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":263,"./_stream_writable":265,_process:341,dup:30,inherits:246}],262:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":264,dup:31,inherits:246}],263:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":260,"./_stream_duplex":261,"./internal/streams/async_iterator":266,"./internal/streams/buffer_list":267,"./internal/streams/destroy":268,"./internal/streams/from":270,"./internal/streams/state":272Line truncated
/*! /*!
* mime-db * mime-db
* Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014 Jonathan Ong
* MIT Licensed * MIT Licensed
*/ */
t.exports=e("./db.json")},{"./db.json":284}],286:[function(e,t,n){ t.exports=e("./db.json")},{"./db.json":278}],280:[function(e,t,i){
/*! /*!
* mime-types * mime-types
* Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson * Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
"use strict";var i,r,s,o=e("mime-db"),a=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&o[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}n.charset=l,n.charsets={lookup:l},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=a("x."+e).toLowerCase().substr(1);if(!t)return!1;return n.types[t]||!1},n.types=Object.create(null),i=n.extensions,r=n.types,s=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var t=o[e],n=t.extensions;if(n&&n.length){i[e]=n;for(var a=0;a<n.length;a++){var c=n[a];if(r[c]){var u=s.indexOf(o[r[c]].source),l=s.indexOf(t.source);if("application/octet-stream"!==r[c]&&(u>l||u===l&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":285,path:334}],287:[function(e,t,n){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=i,i.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},{}],288:[function(e,t,n){"use strict";var i=n;function r(e){return 1===e.length?"0"+e:e}function s(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)n[i]=0|e[i];return n}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var r=e.charCodeAt(i),s=r>>8,o=255&r;s?n.push(s,o):n.push(o)}return n},i.zero2=r,i.toHex=s,i.encode=function(e,t){return"hex"===t?s(e):e}},{}],289:[function(e,t,n){(function(t){(function(){var i=e("./index"),r=e("./descriptor"),s=e("uint64be"),o=20828448e5;n.fullBoxes={};function a(e,t,n){for(var i=t;i<n;i++)e[i]=0}function c(e,t,n){t.writeUInt32BE(Math.floor((e.getTime()+o)/1e3),n)}function u(e,t,n){t.writeUIntBE(Math.floor((e.getTime()+o)/1e3),n,6)}function l(e,t,n){t.writeUInt16BE(Math.floor(e)%65536,n),t.writeUInt16BE(Math.floor(256*e*256)%65536,n+2)}function d(e,t,n){e||(e=[0,0,0,0,0,0,0,0,0]);for(var i=0;i<e.length;i++)l(e[i],t,n+4*i)}function f(e){for(var t=new Array(e.length/4),n=0;n<t.length;n++)t[n]=m(e,4*n);return t}function p(e,t){return new Date(1e3*e.readUIntBE(t,6)-o)}function h(e,t){return new Date(1e3*e.readUInt32BE(t)-o)}function m(e,t){return e.readUInt16BE(t)+e.readUInt16BE(t+2)/65536}function b(e,t){return e[t]+e[t+1]/256}function g(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,r){i=i?i.slice(r):t.alloc(n.ftyp.encodingLength(e));var s=e.compatibleBrands||[];i.write(e.brand,0,4,"ascii"),i.writeUInt32BE(e.brandVersion,4);for(var o=0;o<s.length;o++)i.write(s[o],8+4*o,4,"ascii");return n.ftyp.encode.bytes=8+4*s.length,i},n.ftyp.decode=function(e,t){for(var n=(e=e.slice(t)).toString("ascii",0,4),i=e.readUInt32BE(4),r=[],s=8;s<e.length;s+=4)r.push(e.toString("ascii",s,s+4));return{brand:n,brandVersion:i,compatibleBrands:r}},n.ftyp.encodingLength=function(e){return 8+4*(e.compatibleBrands||[]).length},n.mvhd={},n.mvhd.encode=function(e,i,r){return i=i?i.slice(r):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),l(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),a(i,22,32),d(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:h(e=e.slice(t),0),mtime:h(e,4),timeScale:e.readUInt32BE(8),duration:e.readUInt32BE(12),preferredRate:m(e,16),preferredVolume:b(e,20),matrix:f(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,r){return i=i?i.slice(r):t.alloc(80),c(e.ctime||new Date,i,0),c(e.mtime||new Date,i,4),i.writeUInt32BE(e.trackId||0,8),a(i,12,16),i.writeUInt32BE(e.duratLine truncated "use strict";var n,r,s,a=e("mime-db"),o=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function u(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&a[t[1].toLowerCase()];return i&&i.charset?i.charset:!(!t||!l.test(t[1]))&&"UTF-8"}i.charset=u,i.charsets={lookup:u},i.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?i.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var n=i.charset(t);n&&(t+="; charset="+n.toLowerCase())}return t},i.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&i.extensions[t[1].toLowerCase()];if(!n||!n.length)return!1;return n[0]},i.extensions=Object.create(null),i.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=o("x."+e).toLowerCase().substr(1);if(!t)return!1;return i.types[t]||!1},i.types=Object.create(null),n=i.extensions,r=i.types,s=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],i=t.extensions;if(i&&i.length){n[e]=i;for(var o=0;o<i.length;o++){var c=i[o];if(r[c]){var l=s.indexOf(a[r[c]].source),u=s.indexOf(t.source);if("application/octet-stream"!==r[c]&&(l>u||l===u&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":279,path:333}],281:[function(e,t,i){"use strict";function n(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}n.prototype.define=function(e,t){for(let i in e){let n=e[i].map((function(e){return e.toLowerCase()}));i=i.toLowerCase();for(let e=0;e<n.length;e++){const r=n[e];if("*"!==r[0]){if(!t&&r in this._types)throw new Error('Attempt to change mapping for "'+r+'" extension from "'+this._types[r]+'" to "'+i+'". Pass `force=true` to allow this, otherwise remove "'+r+'" from the list of extensions for "'+i+'".');this._types[r]=i}}if(t||!this._extensions[i]){const e=n[0];this._extensions[i]="*"!==e[0]?e:e.substr(1)}}},n.prototype.getType=function(e){let t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),i=t.replace(/^.*\./,"").toLowerCase(),n=t.length<e.length;return(i.length<t.length-1||!n)&&this._types[i]||null},n.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},t.exports=n},{}],282:[function(e,t,i){"use strict";let n=e("./Mime");t.exports=new n(e("./types/standard"),e("./types/other"))},{"./Mime":281,"./types/other":283,"./types/standard":284}],283:[function(e,t,i){t.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkpLine truncated
/*! multistream. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! multistream. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const i=e("readable-stream"),r=e("once");function s(e){return a(e,{objectMode:!0,highWaterMark:16})}function o(e){return a(e)}function a(e,t){if(!e||"function"==typeof e||e._readableState)return e;const n=new i.Readable(t).wrap(e);return e.destroy&&(n.destroy=e.destroy.bind(e)),n}class c extends i.Readable{constructor(e,t){super({...t,autoDestroy:!0}),this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=t&&t.objectMode?s:o,"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)return;let e;for(this._forwarding=!0;this._drained&&null!==(e=this._current.read());)this._drained=this.push(e);this._forwarding=!1}_destroy(e,t){let n=[];if(this._current&&n.push(this._current),"function"!=typeof this._queue&&(n=n.concat(this._queue)),0===n.length)t(e);else{let i=n.length,s=e;n.forEach((n=>{!function(e,t,n){if(!e.destroy||e.destroyed)n(t);else{const i=r((e=>n(e||t)));e.on("error",i).on("close",(()=>i())).destroy(t,i)}}(n,e,(e=>{s=s||e,0==--i&&t(s)}))}))}}_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{let e=this._queue.shift();"function"==typeof e&&(e=this._toStreams2(e()),this._attachErrorListener(e)),this._gotNextStream(e)}}_gotNextStream(e){if(!e)return void this.push(null);this._current=e,this._forward();const t=()=>{this._forward()},n=()=>{if(!e._readableState.ended&&!e.destroyed){const e=new Error("ERR_STREAM_PREMATURE_CLOSE");e.code="ERR_STREAM_PREMATURE_CLOSE",this.destroy(e)}},i=()=>{this._current=null,e.removeListener("readable",t),e.removeListener("end",i),e.removeListener("close",n),e.destroy(),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)}}c.obj=e=>new c(e,{objectMode:!0,highWaterMark:16}),t.exports=c},{once:327,"readable-stream":325}],311:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],312:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":314,"./_stream_writable":316,_process:342,dup:33,inherits:249}],313:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":315,dup:34,inherits:249}],314:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,"./internal/streams/async_iterator":317,"./internal/streams/buffer_list":318,"./internal/streams/destroy":319,"./internal/streams/from":321,"./internal/streams/state":323,"./internal/streams/stream":324,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],315:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,dup:36,inherits:249}],316:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,"./internal/streams/destroy":319,"./internal/streams/state":323,"./internal/streams/stream":324,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],317:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":320,_process:342,dup:38}],318:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],319:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],320:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":311,dup:41}],321:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],322:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":311,"./end-of-stream":320,dup:43}],323:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":311,dup:44}],324:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],325:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":312,"./lib/_stream_passthrough.js":313,"./lib/_stream_readable.js":314,"./lib/_stream_transform.js":315,"./lib/_stream_writable.js":316,"./lib/internal/streams/end-of-stream.js":320,"./lib/internal/streams/pipeline.js":322,dup:46}],326:[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}}},{}],327:[function(e,t,n){var i=e("wrappy");function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(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(r),t.exports.strict=i(s),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){Line truncated const n=e("readable-stream"),r=e("once");function s(e){return o(e,{objectMode:!0,highWaterMark:16})}function a(e){return o(e)}function o(e,t){if(!e||"function"==typeof e||e._readableState)return e;const i=new n.Readable(t).wrap(e);return e.destroy&&(i.destroy=e.destroy.bind(e)),i}class c extends n.Readable{constructor(e,t){super({...t,autoDestroy:!0}),this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=t&&t.objectMode?s:a,"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)return;let e;for(this._forwarding=!0;this._drained&&null!==(e=this._current.read());)this._drained=this.push(e);this._forwarding=!1}_destroy(e,t){let i=[];if(this._current&&i.push(this._current),"function"!=typeof this._queue&&(i=i.concat(this._queue)),0===i.length)t(e);else{let n=i.length,s=e;i.forEach((i=>{!function(e,t,i){if(!e.destroy||e.destroyed)i(t);else{const n=r((e=>i(e||t)));e.on("error",n).on("close",(()=>n())).destroy(t,n)}}(i,e,(e=>{s=s||e,0==--n&&t(s)}))}))}}_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{let e=this._queue.shift();"function"==typeof e&&(e=this._toStreams2(e()),this._attachErrorListener(e)),this._gotNextStream(e)}}_gotNextStream(e){if(!e)return void this.push(null);this._current=e,this._forward();const t=()=>{this._forward()},i=()=>{if(!e._readableState.ended&&!e.destroyed){const e=new Error("ERR_STREAM_PREMATURE_CLOSE");e.code="ERR_STREAM_PREMATURE_CLOSE",this.destroy(e)}},n=()=>{this._current=null,e.removeListener("readable",t),e.removeListener("end",n),e.removeListener("close",i),e.destroy(),this._next()};e.on("readable",t),e.once("end",n),e.once("close",i)}_attachErrorListener(e){if(!e)return;const t=i=>{e.removeListener("error",t),this.destroy(i)};e.once("error",t)}}c.obj=e=>new c(e,{objectMode:!0,highWaterMark:16}),t.exports=c},{once:326,"readable-stream":324}],310:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],311:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":313,"./_stream_writable":315,_process:341,dup:30,inherits:246}],312:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":314,dup:31,inherits:246}],313:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,"./internal/streams/async_iterator":316,"./internal/streams/buffer_list":317,"./internal/streams/destroy":318,"./internal/streams/from":320,"./internal/streams/state":322,"./internal/streams/stream":323,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],314:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,dup:33,inherits:246}],315:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,"./internal/streams/destroy":318,"./internal/streams/state":322,"./internal/streams/stream":323,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],316:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":319,_process:341,dup:35}],317:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],318:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],319:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":310,dup:38}],320:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],321:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":310,"./end-of-stream":319,dup:40}],322:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":310,dup:41}],323:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],324:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":311,"./lib/_stream_passthrough.js":312,"./lib/_stream_readable.js":313,"./lib/_stream_transform.js":314,"./lib/_stream_writable.js":315,"./lib/internal/streams/end-of-stream.js":319,"./lib/internal/streams/pipeline.js":321,dup:43}],325:[function(e,t,i){t.exports=function(e,t){var i=null;return e.on(t,(function(e){if(i){var t=i;i=null,t(e)}})),function(e){i=e}}},{}],326:[function(e,t,i){var n=e("wrappy");function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}t.exports=n(r),t.exports.strict=n(s),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){Line truncated
/*! parse-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! parse-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("bencode"),r=e("blob-to-buffer"),s=e("fs"),o=e("simple-get"),a=e("magnet-uri"),c=e("path"),u=e("simple-sha1"),l=e("queue-microtask");function d(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=a(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 a(`magnet:?xt=urn:btih:${e}`);if(n.isBuffer(e)&&20===e.length)return a(`magnet:?xt=urn:btih:${e.toString("hex")}`);if(n.isBuffer(e))return function(e){n.isBuffer(e)&&(e=i.decode(e));p(e.info,"info"),p(e.info["name.utf-8"]||e.info.name,"info.name"),p(e.info["piece length"],"info['piece length']"),p(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{p("number"==typeof e.length,"info.files[0].length"),p(e["path.utf-8"]||e.path,"info.files[0].path")})):p("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:i.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=u.sync(t.infoBuffer),t.infoHashBuffer=n.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());n.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());n.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 r=e.info.files||[e.info];t.files=r.map(((e,n)=>{const i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:r.slice(0,n).reduce(f,0)}})),t.length=r.reduce(f,0);const s=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(s.offset+s.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 f(e,t){return e+t.length}function p(e,t){if(!e)throw new Error(`Torrent is missing required field: ${t}`)}t.exports=d,t.exports.remote=function e(t,n,i){if("function"==typeof n)return e(t,{},n);if("function"!=typeof i)throw new Error("second argument must be a Function");let a;try{a=d(t)}catch(e){}a&&a.infoHash?l((()=>{i(null,a)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return i(new Error(`Error converting Blob: ${e.message}`));u(t)})):"function"==typeof o&&/^https?:/.test(t)?(n=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},n),o.concat(n,((e,t,n)=>{if(e)return i(new Error(`Error downloading torrent: ${e.message}`));u(n)}))):"function"==typeof s.readFile&&"string"==typeof t?s.readFile(t,((e,t)=>{if(e)return i(new Error("Invalid torrent identifier"));u(t)})):l((()=>{i(new Error("Invalid torrent identifier"))})));var c;function u(e){try{a=d(e)}catch(e){return i(e)}a&&a.infoHash?i(null,a):i(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=a.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=n.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 i.encode(t)},n.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,"blob-to-buffer":54,buffer:116,fs:73,"magnet-uri":263,path:334,"queue-microtask":355,"simple-get":397,"simple-sha1":417}],334:[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="",r=0,s=-1,o=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(s===a-1||1===o);else if(s!==a-1&&2===o){if(i.length<2||2!==r||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="",r=0):r=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),s=a,o=0;continue}}else if(2===i.length||1===i.length){i="",r=0,s=a,o=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(s+1,a):i=e.slice(s+1,a),r=a-s-1;s=a,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var r={resolve:function(){for(var t,r="",s=!1,o=arguments.length-1;o>=-1Line truncated const n=e("bencode"),r=e("blob-to-buffer"),s=e("fs"),a=e("simple-get"),o=e("magnet-uri"),c=e("path"),l=e("simple-sha1"),u=e("queue-microtask");function p(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=o(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 o(`magnet:?xt=urn:btih:${e}`);if(i.isBuffer(e)&&20===e.length)return o(`magnet:?xt=urn:btih:${e.toString("hex")}`);if(i.isBuffer(e))return function(e){i.isBuffer(e)&&(e=n.decode(e));f(e.info,"info"),f(e.info["name.utf-8"]||e.info.name,"info.name"),f(e.info["piece length"],"info['piece length']"),f(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{f("number"==typeof e.length,"info.files[0].length"),f(e["path.utf-8"]||e.path,"info.files[0].path")})):f("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:n.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=l.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 r=e.info.files||[e.info];t.files=r.map(((e,i)=>{const n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:r.slice(0,i).reduce(d,0)}})),t.length=r.reduce(d,0);const s=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(s.offset+s.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let i=0;i<e.length;i+=20)t.push(e.slice(i,i+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 f(e,t){if(!e)throw new Error(`Torrent is missing required field: ${t}`)}t.exports=p,t.exports.remote=function e(t,i,n){if("function"==typeof i)return e(t,{},i);if("function"!=typeof n)throw new Error("second argument must be a Function");let o;try{o=p(t)}catch(e){}o&&o.infoHash?u((()=>{n(null,o)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return n(new Error(`Error converting Blob: ${e.message}`));l(t)})):"function"==typeof a&&/^https?:/.test(t)?(i=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},i),a.concat(i,((e,t,i)=>{if(e)return n(new Error(`Error downloading torrent: ${e.message}`));l(i)}))):"function"==typeof s.readFile&&"string"==typeof t?s.readFile(t,((e,t)=>{if(e)return n(new Error("Invalid torrent identifier"));l(t)})):u((()=>{n(new Error("Invalid torrent identifier"))})));var c;function l(e){try{o=p(e)}catch(e){return n(e)}o&&o.infoHash?n(null,o):n(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=o.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 n.encode(t)},i.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,"blob-to-buffer":48,buffer:110,fs:67,"magnet-uri":257,path:333,"queue-microtask":354,"simple-get":394,"simple-sha1":411}],333:[function(e,t,i){(function(e){(function(){"use strict";function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var i,n="",r=0,s=-1,a=0,o=0;o<=e.length;++o){if(o<e.length)i=e.charCodeAt(o);else{if(47===i)break;i=47}if(47===i){if(s===o-1||1===a);else if(s!==o-1&&2===a){if(n.length<2||2!==r||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",r=0):r=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),s=o,a=0;continue}}else if(2===n.length||1===n.length){n="",r=0,s=o,a=0;continue}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var r={resolve:function(){for(var t,r="",s=!1,a=arguments.length-1;a>=-1Line truncated
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],356:[function(e,t,n){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],357:[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,r=e[t+i],s=e[t];return e[t]=r,e[t+i]=s,t++,r}}},{}],358:[function(e,t,n){(function(n,i){(function(){"use strict";var r=65536,s=4294967295;var o=e("safe-buffer").Buffer,a=i.crypto||i.msCrypto;a&&a.getRandomValues?t.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var i=o.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;c<e;c+=r)a.getRandomValues(i.slice(c,c+r));else a.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:342,"safe-buffer":386}],359:[function(e,t,n){(function(t,i){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var s=e("safe-buffer"),o=e("randombytes"),a=s.Buffer,c=s.kMaxLength,u=i.crypto||i.msCrypto,l=Math.pow(2,32)-1;function d(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>l||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function f(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>c)throw new RangeError("buffer too small")}function p(e,n,i,r){if(t.browser){var s=e.buffer,a=new Uint8Array(s,n,i);return u.getRandomValues(a),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return o(i).copy(e,n),e;o(i,(function(t,i){if(t)return r(t);i.copy(e,n),r(null,e)}))}u&&u.getRandomValues||!t.browser?(n.randomFill=function(e,t,n,r){if(!(a.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,n=e.length;else if("function"==typeof n)r=n,n=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return d(t,e.length),f(n,t,e.length),p(e,t,n,r)},n.randomFillSync=function(e,t,n){void 0===t&&(t=0);if(!(a.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');d(t,e.length),void 0===n&&(n=e.length-t);return f(n,t,e.length),p(e,t,n)}):(n.randomFill=r,n.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:342,randombytes:358,"safe-buffer":386}],360:[function(e,t,n){const{Writable:i,PassThrough:r}=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 r=this._queue[0];const t=Math.max(r.start-this._position,0),s=r.end-this._position;if(t>=e.length)return this._position+=e.length,n(null);let o;if(s>e.length){this._position+=e.length,o=0===t?e:e.slice(t),i=r.stream.write(o)&&i;break}this._position+=s,o=0===t&&s===e.length?e:e.slice(t,s),i=r.stream.write(o)&&i,r.last&&r.stream.end(),e=e.slice(s),this._queue.shift()}i?n(null):r.stream.once("drain",n.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;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":375}],361:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],362:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":364,"./_stream_writable":366,_process:342,dup:33,inherits:249}],363:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":365,dup:34,inherits:249}],364:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,_process:342,buffer:1Line truncated let i;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):e=>(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],355:[function(e,t,i){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],356:[function(e,t,i){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var i=e.length-t,n=Math.random()*i|0,r=e[t+n],s=e[t];return e[t]=r,e[t+n]=s,t++,r}}},{}],357:[function(e,t,i){(function(i,n){(function(){"use strict";var r=65536,s=4294967295;var a=e("safe-buffer").Buffer,o=n.crypto||n.msCrypto;o&&o.getRandomValues?t.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;c<e;c+=r)o.getRandomValues(n.slice(c,c+r));else o.getRandomValues(n);if("function"==typeof t)return i.nextTick((function(){t(null,n)}));return n}: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:341,"safe-buffer":383}],358:[function(e,t,i){(function(t,n){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var s=e("safe-buffer"),a=e("randombytes"),o=s.Buffer,c=s.kMaxLength,l=n.crypto||n.msCrypto,u=Math.pow(2,32)-1;function p(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>u||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function d(e,t,i){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>u||e<0)throw new TypeError("size must be a uint32");if(e+t>i||e>c)throw new RangeError("buffer too small")}function f(e,i,n,r){if(t.browser){var s=e.buffer,o=new Uint8Array(s,i,n);return l.getRandomValues(o),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return a(n).copy(e,i),e;a(n,(function(t,n){if(t)return r(t);n.copy(e,i),r(null,e)}))}l&&l.getRandomValues||!t.browser?(i.randomFill=function(e,t,i,r){if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,i=e.length;else if("function"==typeof i)r=i,i=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return p(t,e.length),d(i,t,e.length),f(e,t,i,r)},i.randomFillSync=function(e,t,i){void 0===t&&(t=0);if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');p(t,e.length),void 0===i&&(i=e.length-t);return d(i,t,e.length),f(e,t,i)}):(i.randomFill=r,i.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:341,randombytes:357,"safe-buffer":383}],359:[function(e,t,i){
/*!
* range-parser
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*/
"use strict";function n(e,t){return{start:e.start,end:e.end,index:t}}function r(e){return{start:e.start,end:e.end}}function s(e,t){return e.index-t.index}function a(e,t){return e.start-t.start}t.exports=function(e,t,i){if("string"!=typeof t)throw new TypeError("argument str must be a string");var o=t.indexOf("=");if(-1===o)return-2;var c=t.slice(o+1).split(","),l=[];l.type=t.slice(0,o);for(var u=0;u<c.length;u++){var p=c[u].split("-"),d=parseInt(p[0],10),f=parseInt(p[1],10);isNaN(d)?(d=e-f,f=e-1):isNaN(f)&&(f=e-1),f>e-1&&(f=e-1),isNaN(d)||isNaN(f)||d>f||d<0||l.push({start:d,end:f})}if(l.length<1)return-1;return i&&i.combine?function(e){for(var t=e.map(n).sort(a),i=0,o=1;o<t.length;o++){var c=t[o],l=t[i];c.start>l.end+1?t[++i]=c:c.end>l.end&&(l.end=c.end,l.index=Math.min(l.index,c.index))}t.length=i+1;var u=t.sort(s).map(r);return u.type=e.type,u}(l):l}},{}],360:[function(e,t,i){const{Writable:n,PassThrough:r}=e("readable-stream");t.exports=class extends n{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,i){let n=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=i);this._buffer=null;var r=this._queue[0];const t=Math.max(r.start-this._position,0),s=r.end-this._position;if(t>=e.length)return this._position+=e.length,i(null);let a;if(s>e.length){this._position+=e.length,a=0===t?e:e.slice(t),n=r.stream.write(a)&&n;break}this._position+=s,a=0===t&&s===e.length?e:e.slice(t,s),n=r.stream.write(a)&&n,r.last&&r.stream.end(),e=e.slice(s),this._queue.shift()}n?i(null):r.stream.once("drain",i.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;return e.forEach(((i,n)=>{this._queue.push({start:i.start,end:i.end,stream:t,last:n===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":375}],361:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],362:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":364,"./_stream_writable":366,_process:341,dup:30,inherits:246}],363:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":365,dup:31,inherits:246}],364:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],365:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,dup:33,inherits:246}],366:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/destroy":369,"./internal/streams/state":373,"./internal/streams/stream":374,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],367:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":370,_process:341,dup:35}],368:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],369:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],370:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":361,dup:38}],371:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],372:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":361,"./end-of-stream":370,dup:40}],373:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":361,dup:41}],374:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],375:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":362,"./lib/_stream_passthrough.js":363,"./lib/_stream_readable.js":364,"./lib/_stream_transform.js":365,"./lib/_stream_writable.js":366,"./lib/internal/streams/end-of-stream.js":370,"./lib/internal/streams/pipeline.js":372,dup:43}],376:[function(e,t,i){"use strict";function n(e){return parseInt(e,10)===e}function r(e){function t(t){if(void 0===t){t=new Array(e);for(var i=0;i<e;i++)t[i]=Math.floor(Math.random()*e)}else if("string"==typeof t)t=(t=""+t).split("").map((function(t){return t.charCodeAt(0)%e}));else{if(!Array.isArray(t))throw new TypeError("invalid seed key specified");if(!t.every((function(e){return"number"==typeof e&&e===(0|e)})))throw new TypeError("invalid seed key specified: not array of integers")}for(var n=t.length,r=function(){for(var t=new Array(e),i=0;i<e;i++)t[i]=i;return t}(),s=0,a=0;a<e;a++){s=(s+r[a]+t[a%n])%e;var o=r[a];r[a]=r[s],r[s]=o}return r}function i(e){this.s=t(e),this.i=0,this.j=0}return i.prototype.randomNative=function(){this.i=(this.i+1)%e,this.j=(this.j+this.s[this.i])%e;var t=this.s[this.i];return this.s[this.i]=this.s[tLine truncated
/*! render-media. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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=()=>{});y(e),_(n),"string"==typeof t&&(t=document.querySelector(t));g(e,(i=>{if(t.nodeName!==i.toUpperCase()){const n=o.extname(e.name).toLowerCase();throw new Error(`Cannot render "${n}" inside a "${t.nodeName.toLowerCase()}" element, expected "${i}"`)}return"video"!==i&&"audio"!==i||w(t,n),t}),n,i)},n.append=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=()=>{});y(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 r(e){const n=document.createElement(e);return t.appendChild(n),n}g(e,(function(e){return"video"===e||"audio"===e?function(e){const i=r(e);return w(i,n),t.appendChild(i),i}(e):r(e)}),n,(function(e,t){e&&t&&t.remove(),i(e,t)}))},n.mime=e("./lib/mime.json");const i=e("debug")("render-media"),r=e("is-ascii"),s=e("mediasource"),o=e("path"),a=e("stream-to-blob-url"),c=e("videostream"),u=[".m4a",".m4b",".m4p",".m4v",".mp4"],l=[".m4v",".mkv",".mp4",".webm"],d=[].concat(l,[".m4a",".m4b",".m4p",".mp3"]),f=[".mov",".ogv"],p=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b="undefined"!=typeof window&&window.MediaSource;function g(e,t,n,a){const g=o.extname(e.name).toLowerCase();let y,_=0;function w(){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),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${n.maxBlobLength})`)),!1)}function x(n){w()&&(y=t(n),v(e,((e,t)=>{if(e)return M(e);y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),y.src=t})))}function k(){if(y.removeEventListener("loadstart",k),n.autoplay){const e=y.play();void 0!==e&&e.catch(M)}}function E(){y.removeEventListener("loadedmetadata",E),a(null,y)}function S(){v(e,((e,n)=>{if(e)return M(e);".pdf"!==g?(y=t("iframe"),y.sandbox="allow-forms allow-scripts",y.src=n):(y=t("object"),y.setAttribute("typemustmatch",!0),y.setAttribute("type","application/pdf"),y.setAttribute("data",n)),a(null,y)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,i(t.message),a(t)}d.includes(g)?function(){const n=l.includes(g)?"video":"audio";b?u.includes(g)?r():a():d();function r(){i(`Use \`videostream\` package for ${e.name}`),h(),y.addEventListener("error",f),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),new c(e,y)}function a(){i(`Use MediaSource API for ${e.name}`),h(),y.addEventListener("error",p),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E);const t=new s(y).createWriteStream((n=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"'}[o.extname(n).toLowerCase()]));var n;e.createReadStream().pipe(t),_&&(y.currentTime=_)}function d(){i(`Use Blob URL for ${e.name}`),h(),y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),v(e,((e,t)=>{if(e)return M(e);y.src=t,_&&(y.currentTime=_)}))}function f(e){i("videostream error: fallback to MediaSource API: %o",e.message||e),y.removeEventListener("error",f),y.removeEventListener("loadedmetadata",E),a()}function p(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e),w()&&(y.removeEventListener("error",p),y.removeEventListener("loadedmetadata",E),d())}function h(){y||(y=t(n),y.addEventListener("progress",(()=>{_=y.currentTime})))}}():f.includes(g)?x("video"):p.includes(g)?x("audio"):h.includes(g)?(y=t("img"),v(e,((t,n)=>{if(t)return M(t);y.src=n,y.alt=e.name,a(null,y)}))):m.includes(g)?S():function(){i('Unknown file extension "%s" - will attempt to render into iframe',g);let t="";function n(){r(t)?(i('File extension "%s" appears ascii, so will render.',g),S()):(i('File extension "%s" appears non-ascii, will not render.',g),a(new Error(`Unsupported file type "${g}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",n).on("error",a)}()}function v(e,t){const i=o.extname(e.name).toLowerCase();a(e.createReadStream(),n.mime[i]).then((e=>t(null,e)),(e=>t(e)))}function y(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),nLine truncated i.render=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});y(e),_(i),"string"==typeof t&&(t=document.querySelector(t));v(e,(n=>{if(t.nodeName!==n.toUpperCase()){const i=a.extname(e.name).toLowerCase();throw new Error(`Cannot render "${i}" inside a "${t.nodeName.toLowerCase()}" element, expected "${n}"`)}return"video"!==n&&"audio"!==n||x(t,i),t}),i,n)},i.append=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});y(e),_(i),"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 r(e){const i=document.createElement(e);return t.appendChild(i),i}v(e,(function(e){return"video"===e||"audio"===e?function(e){const n=r(e);return x(n,i),t.appendChild(n),n}(e):r(e)}),i,(function(e,t){e&&t&&t.remove(),n(e,t)}))},i.mime=e("./lib/mime.json");const n=e("debug")("render-media"),r=e("is-ascii"),s=e("mediasource"),a=e("path"),o=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],u=[".m4v",".mkv",".mp4",".webm"],p=[].concat(u,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],f=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b="undefined"!=typeof window&&window.MediaSource;function v(e,t,i,o){const v=a.extname(e.name).toLowerCase();let y,_=0;function x(){return!("number"==typeof e.length&&e.length>i.maxBlobLength)||(n("File length too large for Blob URL approach: %d (max: %d)",e.length,i.maxBlobLength),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${i.maxBlobLength})`)),!1)}function w(i){x()&&(y=t(i),g(e,((e,t)=>{if(e)return M(e);y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),y.src=t})))}function k(){if(y.removeEventListener("loadstart",k),i.autoplay){const e=y.play();void 0!==e&&e.catch(M)}}function E(){y.removeEventListener("loadedmetadata",E),o(null,y)}function S(){g(e,((e,i)=>{if(e)return M(e);".pdf"!==v?(y=t("iframe"),y.sandbox="allow-forms allow-scripts",y.src=i):(y=t("object"),y.setAttribute("typemustmatch",!0),y.setAttribute("type","application/pdf"),y.setAttribute("data",i)),o(null,y)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,n(t.message),o(t)}p.includes(v)?function(){const i=u.includes(v)?"video":"audio";b?l.includes(v)?r():o():p();function r(){n(`Use \`videostream\` package for ${e.name}`),h(),y.addEventListener("error",d),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),new c(e,y)}function o(){n(`Use MediaSource API for ${e.name}`),h(),y.addEventListener("error",f),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E);const t=new s(y).createWriteStream((i=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(i).toLowerCase()]));var i;e.createReadStream().pipe(t),_&&(y.currentTime=_)}function p(){n(`Use Blob URL for ${e.name}`),h(),y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),g(e,((e,t)=>{if(e)return M(e);y.src=t,_&&(y.currentTime=_)}))}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e),y.removeEventListener("error",d),y.removeEventListener("loadedmetadata",E),o()}function f(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e),x()&&(y.removeEventListener("error",f),y.removeEventListener("loadedmetadata",E),p())}function h(){y||(y=t(i),y.addEventListener("progress",(()=>{_=y.currentTime})))}}():d.includes(v)?w("video"):f.includes(v)?w("audio"):h.includes(v)?(y=t("img"),g(e,((t,i)=>{if(t)return M(t);y.src=i,y.alt=e.name,o(null,y)}))):m.includes(v)?S():function(){n('Unknown file extension "%s" - will attempt to render into iframe',v);let t="";function i(){r(t)?(n('File extension "%s" appears ascii, so will render.',v),S()):(n('File extension "%s" appears non-ascii, will not render.',v),o(new Error(`Unsupported file type "${v}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",i).on("error",o)}()}function g(e,t){const n=a.extname(e.name).toLowerCase();o(e.createReadStream(),i.mime[n]).then((e=>t(null,e)),(e=>t(e)))}function y(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),nLine truncated
/*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t,n){if("number"!=typeof t)throw new Error("second argument must be a Number");let r,s,o,a,c,u,l=!0;Array.isArray(e)?(r=[],o=s=e.length):(a=Object.keys(e),r={},o=s=a.length);function d(e){function t(){n&&n(e,r),n=null}l?i(t):t()}function f(t,n,i){if(r[t]=i,n&&(c=!0),0==--o||n)d(n);else if(!c&&u<s){let t;a?(t=a[u],u+=1,e[t]((function(e,n){f(t,e,n)}))):(t=u,u+=1,e[t]((function(e,n){f(t,e,n)})))}}u=t,o?a?a.some((function(n,i){return e[n]((function(e,t){f(n,e,t)})),i===t-1})):e.some((function(e,n){return e((function(e,t){f(n,e,t)})),n===t-1})):d(null);l=!1};const i=e("queue-microtask")},{"queue-microtask":355}],384:[function(e,t,n){ t.exports=function(e,t,i){if("number"!=typeof t)throw new Error("second argument must be a Number");let r,s,a,o,c,l,u=!0;Array.isArray(e)?(r=[],a=s=e.length):(o=Object.keys(e),r={},a=s=o.length);function p(e){function t(){i&&i(e,r),i=null}u?n(t):t()}function d(t,i,n){if(r[t]=n,i&&(c=!0),0==--a||i)p(i);else if(!c&&l<s){let t;o?(t=o[l],l+=1,e[t]((function(e,i){d(t,e,i)}))):(t=l,l+=1,e[t]((function(e,i){d(t,e,i)})))}}l=t,a?o?o.some((function(i,n){return e[i]((function(e,t){d(i,e,t)})),n===t-1})):e.some((function(e,i){return e((function(e,t){d(i,e,t)})),i===t-1})):p(null);u=!1};const n=e("queue-microtask")},{"queue-microtask":354}],381:[function(e,t,i){
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t){let n,r,s,o=!0;Array.isArray(e)?(n=[],r=e.length):(s=Object.keys(e),n={},r=s.length);function a(e){function r(){t&&t(e,n),t=null}o?i(r):r()}function c(e,t,i){n[e]=i,(0==--r||t)&&a(t)}r?s?s.forEach((function(t){e[t]((function(e,n){c(t,e,n)}))})):e.forEach((function(e,t){e((function(e,n){c(t,e,n)}))})):a(null);o=!1};const i=e("queue-microtask")},{"queue-microtask":355}],385:[function(e,t,n){var i,r;i="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.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),r=n(1),s=r.toHex,o=r.ceilHeapSize,a=n(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},u=function(e,t){var n=new Int32Array(e,t+320,5),i=new Int32Array(5),r=new DataView(i.buffer);return r.setInt32(0,n[0],!1),r.setInt32(4,n[1],!1),r.setInt32(8,n[2],!1),r.setInt32(12,n[3],!1),r.setInt32(16,n[4],!1),i},l=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(o(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,r=t-i;switch(i){case 0:n[r+3]=0;case 1:n[r+2]=0;case 2:n[r+1]=0;case 3:n[r+0]=0}for(var s=1+(t>>2);s<e.length;s++)e[s]=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){a(e,this._h8,this._h32,t,n,i||0)},e.prototype._coreCall=function(e,t,n,i,r){var s=n;this._write(e,t,n),r&&(s=this._padChunk(n,i)),this._core.hash(s,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),u(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return s(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,r=void 0;for(this._offset+=n;t<n;)r=Math.min(n-t,this._maxChunkLen-i),this._write(e,t,r,i),t+=r,(i+=r)===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=u(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),i},e.prototype.end=function(){return s(this.rawEnd().buffer)},e}();e.exports=l,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),r=0;r<i.length;r++)i[r]=n[t[r]];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,r,s){var o=new self.FileReader;o.onloadend=function(){if(o.erroLine truncated t.exports=function(e,t){let i,r,s,a=!0;Array.isArray(e)?(i=[],r=e.length):(s=Object.keys(e),i={},r=s.length);function o(e){function r(){t&&t(e,i),t=null}a?n(r):r()}function c(e,t,n){i[e]=n,(0==--r||t)&&o(t)}r?s?s.forEach((function(t){e[t]((function(e,i){c(t,e,i)}))})):e.forEach((function(e,t){e((function(e,i){c(t,e,i)}))})):o(null);a=!1};const n=e("queue-microtask")},{"queue-microtask":354}],382:[function(e,t,i){var n,r;n="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=3)}([function(e,t,i){var n=i(5),r=i(1),s=r.toHex,a=r.ceilHeapSize,o=i(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},l=function(e,t){var i=new Int32Array(e,t+320,5),n=new Int32Array(5),r=new DataView(n.buffer);return r.setInt32(0,i[0],!1),r.setInt32(4,i[1],!1),r.setInt32(8,i[2],!1),r.setInt32(12,i[3],!1),r.setInt32(16,i[4],!1),n},u=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 n({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var i=new Int32Array(e,t+320,5);i[0]=1732584193,i[1]=-271733879,i[2]=-1732584194,i[3]=271733878,i[4]=-1009589776},e.prototype._padChunk=function(e,t){var i=c(e),n=new Int32Array(this._heap,0,i>>2);return function(e,t){var i=new Uint8Array(e.buffer),n=t%4,r=t-n;switch(n){case 0:i[r+3]=0;case 1:i[r+2]=0;case 2:i[r+1]=0;case 3:i[r+0]=0}for(var s=1+(t>>2);s<e.length;s++)e[s]=0}(n,e),function(e,t,i){e[t>>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=i/(1<<29)|0,e[15+(2+(t>>2)&-16)]=i<<3}(n,e,t),i},e.prototype._write=function(e,t,i,n){o(e,this._h8,this._h32,t,i,n||0)},e.prototype._coreCall=function(e,t,i,n,r){var s=i;this._write(e,t,i),r&&(s=this._padChunk(i,n)),this._core.hash(s,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var i=0,n=this._maxChunkLen;for(i=0;t>i+n;i+=n)this._coreCall(e,i,n,t,!1);return this._coreCall(e,i,t-i,t,!0),l(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return s(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,i=e.byteLength||e.length||e.size||0,n=this._offset%this._maxChunkLen,r=void 0;for(this._offset+=i;t<i;)r=Math.min(i-t,this._maxChunkLen-n),this._write(e,t,r,n),t+=r,(n+=r)===this._maxChunkLen&&(this._core.hash(this._maxChunkLen,this._padMaxChunkLen),n=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,i=this._padChunk(t,e);this._core.hash(i,this._padMaxChunkLen);var n=l(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),n},e.prototype.end=function(){return s(this.rawEnd().buffer)},e}();e.exports=u,e.exports._core=n},function(e,t){for(var i=new Array(256),n=0;n<256;n++)i[n]=(n<16?"0":"")+n.toString(16);e.exports.toHex=function(e){for(var t=new Uint8Array(e),n=new Array(e.byteLength),r=0;r<n.length;r++)n[r]=i[t[r]];return n.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,i="SharedWorkerGlobalScope"in e&&e instanceof e.SharedWorkerGlobalScope,n="ServiceWorkerGlobalScope"in e&&e instanceof e.ServiceWorkerGlobalScope;return t&&!i&&!n}},function(e,t,i){e.exports=function(){var e=i(0),t=function(e,i,n,r,s){var a=new self.FileReader;a.onloadend=function(){if(a.erroLine truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("buffer"),r=i.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=i:(s(i,n),n.Buffer=o),o.prototype=Object.create(r.prototype),s(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:116}],387:[function(e,t,n){(function(n){(function(){"use strict";var i,r=e("buffer"),s=r.Buffer,o={};for(i in r)r.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=r[i]);var a=o.Buffer={};for(i in s)s.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=s[i]);if(o.Buffer.prototype=s.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,n)}),a.alloc||(a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=s(e);return t&&0!==t.length?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o}).call(this)}).call(this,e("_process"))},{_process:342,buffer:116}],388:[function(e,t,n){var i=e("safe-buffer").Buffer;function r(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var n=this._block,r=this._blockSize,s=e.length,o=this._len,a=0;a<s;){for(var c=o%r,u=Math.min(s-a,r-c),l=0;l<u;l++)n[c+l]=e[a+l];a+=u,(o+=u)%r==0&&this._update(n)}return this._len+=s,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var i=(4294967295&n)>>>0,r=(n-i)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":386}],389:[function(e,t,n){(n=t.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":390,"./sha1":391,"./sha224":392,"./sha256":393,"./sha384":394,"./sha512":395}],390:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,i=0|this._a,r=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=n[d-3]^n[d-8]^n[d-14]^n[d-16];for(var f=0;f<80;++f){var p=~~(f/20),h=0|((t=i)<<5|t>>>27)+l(p,r,s,a)+c+n[f]+o[p];c=a,a=s,s=u(r),r=i,i=h}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":388,inherits:249,"safe-buffer":386}],391:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function d(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._dLine truncated var n=e("buffer"),r=n.Buffer;function s(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(s(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),s(r,a),a.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:110}],384:[function(e,t,i){(function(i){(function(){"use strict";var n,r=e("buffer"),s=r.Buffer,a={};for(n in r)r.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=r[n]);var o=a.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(o[n]=s[n]);if(a.Buffer.prototype=s.prototype,o.from&&o.from!==Uint8Array.from||(o.from=function(e,t,i){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,i)}),o.alloc||(o.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=s(e);return t&&0!==t.length?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this)}).call(this,e("_process"))},{_process:341,buffer:110}],385:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var i=this._block,r=this._blockSize,s=e.length,a=this._len,o=0;o<s;){for(var c=a%r,l=Math.min(s-o,r-c),u=0;u<l;u++)i[c+u]=e[o+u];o+=l,(a+=l)%r==0&&this._update(i)}return this._len+=s,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var n=(4294967295&i)>>>0,r=(i-n)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":383}],386:[function(e,t,i){(i=t.exports=function(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),i.sha1=e("./sha1"),i.sha224=e("./sha224"),i.sha256=e("./sha256"),i.sha384=e("./sha384"),i.sha512=e("./sha512")},{"./sha":387,"./sha1":388,"./sha224":389,"./sha256":390,"./sha384":391,"./sha512":392}],387:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,r.call(this,64,56)}function l(e){return e<<30|e>>>2}function u(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,c=0|this._e,p=0;p<16;++p)i[p]=e.readInt32BE(4*p);for(;p<80;++p)i[p]=i[p-3]^i[p-8]^i[p-14]^i[p-16];for(var d=0;d<80;++d){var f=~~(d/20),h=0|((t=n)<<5|t>>>27)+u(f,r,s,o)+c+i[d]+a[f];c=o,o=s,s=l(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":385,inherits:246,"safe-buffer":383}],388:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,r.call(this,64,56)}function l(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function p(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._dLine truncated
/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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)}).call(this,e("buffer").Buffer)},{buffer:116}],397:[function(e,t,n){(function(n){(function(){ t.exports=function(t,i){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){i&&i(null,e.concat(n)),i=null})),t.once("error",(function(e){i&&i(e),i=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],394:[function(e,t,i){(function(i){(function(){
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=d;const i=e("simple-concat"),r=e("decompress-response"),s=e("http"),o=e("https"),a=e("once"),c=e("querystring"),u=e("url"),l=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function d(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=a(t),e.url){const{hostname:t,port:n,protocol:i,auth:r,path:s}=u.parse(e.url);delete e.url,t||n||i||r?Object.assign(e,{hostname:t,port:n,protocol:i,auth:r,path:s}):e.path=s}const i={"accept-encoding":"gzip, deflate"};let f;e.headers&&Object.keys(e.headers).forEach((t=>i[t.toLowerCase()]=e.headers[t])),e.headers=i,e.body?f=e.json&&!l(e.body)?JSON.stringify(e.body):e.body:e.form&&(f="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),f&&(e.method||(e.method="POST"),l(f)||(e.headers["content-length"]=n.byteLength(f)),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 p=("https:"===e.protocol?o:s).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")):d(e,t);const i="function"==typeof r&&"HEAD"!==e.method;t(null,i?r(n):n)}));return p.on("timeout",(()=>{p.abort(),t(new Error("Request timed out"))})),p.on("error",t),l(f)?f.on("error",t).pipe(p):p.end(f),p}d.concat=(e,t)=>d(e,((n,r)=>{if(n)return t(n);i(r,((n,i)=>{if(n)return t(n);if(e.json)try{i=JSON.parse(i.toString())}catch(n){return t(n,r,i)}t(null,r,i)}))})),["get","post","put","patch","head","delete"].forEach((e=>{d[e]=(t,n)=>("string"==typeof t&&(t={url:t}),d(Object.assign({method:e.toUpperCase()},t),n))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"decompress-response":73,http:458,https:246,once:327,querystring:354,"simple-concat":396,url:494}],398:[function(e,t,n){ t.exports=p;const n=e("simple-concat"),r=e("decompress-response"),s=e("http"),a=e("https"),o=e("once"),c=e("querystring"),l=e("url"),u=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function p(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=o(t),e.url){const{hostname:t,port:i,protocol:n,auth:r,path:s}=l.parse(e.url);delete e.url,t||i||n||r?Object.assign(e,{hostname:t,port:i,protocol:n,auth:r,path:s}):e.path=s}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>n[t.toLowerCase()]=e.headers[t])),e.headers=n,e.body?d=e.json&&!u(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"),u(d)||(e.headers["content-length"]=i.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 f=("https:"===e.protocol?a:s).request(e,(i=>{if(!1!==e.followRedirects&&i.statusCode>=300&&i.statusCode<400&&i.headers.location)return e.url=i.headers.location,delete e.headers.host,i.resume(),"POST"===e.method&&[301,302].includes(i.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):p(e,t);const n="function"==typeof r&&"HEAD"!==e.method;t(null,n?r(i):i)}));return f.on("timeout",(()=>{f.abort(),t(new Error("Request timed out"))})),f.on("error",t),u(d)?d.on("error",t).pipe(f):f.end(d),f}p.concat=(e,t)=>p(e,((i,r)=>{if(i)return t(i);n(r,((i,n)=>{if(i)return t(i);if(e.json)try{n=JSON.parse(n.toString())}catch(i){return t(i,r,n)}t(null,r,n)}))})),["get","post","put","patch","head","delete"].forEach((e=>{p[e]=(t,i)=>("string"==typeof t&&(t={url:t}),p(Object.assign({method:e.toUpperCase()},t),i))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"decompress-response":67,http:449,https:243,once:326,querystring:353,"simple-concat":393,url:482}],395:[function(e,t,i){
/*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const i=e("debug")("simple-peer"),r=e("get-browser-rtc"),s=e("randombytes"),o=e("readable-stream"),a=e("queue-microtask"),c=e("err-code"),{Buffer:u}=e("buffer"),l=65536;function d(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class f extends o.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=s(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||s(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||f.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},f.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.destroying=!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:r(),!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 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)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),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.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");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){const 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){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");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",{type:"transceiverRequest",transLine truncated const n=e("debug")("simple-peer"),r=e("get-browser-rtc"),s=e("randombytes"),a=e("readable-stream"),o=e("queue-microtask"),c=e("err-code"),{Buffer:l}=e("buffer"),u=65536;function p(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class d extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=s(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||s(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.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.destroying=!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:r(),!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 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)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),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.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");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){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var i;!t.address||t.address.endsWith(".local")?(i="Ignoring unsupported ICE candidate.",console.warn(i)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");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",{type:"transceiverRequest",transLine truncated
/*! simple-websocket. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! simple-websocket. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const i=e("debug")("simple-websocket"),r=e("randombytes"),s=e("readable-stream"),o=e("queue-microtask"),a=e("ws"),c="function"!=typeof a?WebSocket:a;class u extends s.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof a?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void o((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?o((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,n=()=>{t.onclose=null};if(t.readyState===c.CLOSED)n();else try{t.onclose=n,t.close()}catch(e){n()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,n){if(this.destroyed)return n(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof a&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof a&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=n.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],i.apply(null,e)}}u.WEBSOCKET_SUPPORT=!!c,t.exports=u}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,debug:420,"queue-microtask":355,randombytes:358,"readable-stream":437,ws:73}],420:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":421,_process:342,dup:29}],421:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:422}],422:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],423:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],424:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":426,"./_stream_writable":428,_process:342,dup:33,inherits:249}],425:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":427,dup:34,inherits:249}],426:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,"./internal/streams/async_iterator":429,"./internal/streams/buffer_list":430,"./internal/streams/destroy":431,"./internal/streams/from":433,"./internal/streams/state":435,"./internal/streams/stream":436,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],427:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,dup:36,inherits:249}],428:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,"./internal/streams/destroy":431,"./internal/streams/state":435,"./internal/streams/stream":436,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],429:[function(e,t,n){arguments[4][38][Line truncated const n=e("debug")("simple-websocket"),r=e("randombytes"),s=e("readable-stream"),a=e("queue-microtask"),o=e("ws"),c="function"!=typeof o?WebSocket:o;class l extends s.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof o?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void a((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?a((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,i=()=>{t.onclose=null};if(t.readyState===c.CLOSED)i();else try{t.onclose=i,t.close()}catch(e){i()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,i){if(this.destroyed)return i(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof o&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=e,this._cb=i}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof o&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=i.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}l.WEBSOCKET_SUPPORT=!!c,t.exports=l}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:161,"queue-microtask":354,randombytes:357,"readable-stream":428,ws:67}],414:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],415:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":417,"./_stream_writable":419,_process:341,dup:30,inherits:246}],416:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":418,dup:31,inherits:246}],417:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,"./internal/streams/async_iterator":420,"./internal/streams/buffer_list":421,"./internal/streams/destroy":422,"./internal/streams/from":424,"./internal/streams/state":426,"./internal/streams/stream":427,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],418:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,dup:33,inherits:246}],419:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,"./internal/streams/destroy":422,"./internal/streams/state":426,"./internal/streams/stream":427,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],420:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":423,_process:341,dup:35}],421:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],422:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],423:[fLine truncated
/*! stream-to-blob-url. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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":478}],478:[function(e,t,n){ t.exports=async function(e,t){const i=await n(e,t);return URL.createObjectURL(i)};const n=e("stream-to-blob")},{"stream-to-blob":469}],469:[function(e,t,i){
/*! stream-to-blob. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! 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 r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);n(e)})).once("error",i)}))}},{}],479:[function(e,t,n){(function(n){(function(){ t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((i,n)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);i(e)})).once("error",n)}))}},{}],470:[function(e,t,i){(function(i){(function(){
/*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=e("once");t.exports=function(e,t,r){r=i(r);var s=n.alloc(t),o=0;e.on("data",(function(e){e.copy(s,o),o+=e.length})).on("end",(function(){r(null,s)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,once:327}],480:[function(e,t,n){const{EventEmitter:i}=e("events"),r=new Error("Stream was destroyed"),s=new Error("Premature close"),o=e("queue-tick"),a=e("fast-fifo"),c=33554431,u=1^c,l=64,d=128,f=256,p=512,h=1024,m=2048,b=4096,g=8192,v=16392,y=384^c,_=65536,w=2<<16,x=4<<16,k=8<<16,E=16<<16,S=32<<16,M=64<<16,A=8454144,I=256<<16,T=33488895,j=33423359,C=65544,B=33488887,R=2105344,L=6|R,O=8470536,P=8404999,U=589831,q=Symbol.asyncIterator||Symbol("asyncIterator");class N{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:r,byteLengthWritable:s}={}){this.stream=e,this.queue=new a,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||oe,this.map=i||n,this.afterWrite=K.bind(this),this.afterUpdateNextTick=X.bind(this)}get ended(){return 0!=(this.stream._duplexState&S)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=k,!0):(this.stream._duplexState|=1572864,!1)}shift(){const e=this.queue.shift(),t=this.stream;return this.buffered-=this.byteLength(e),0===this.buffered&&(t._duplexState&=33030143),e}end(e){"function"==typeof e?this.stream.once("finish",e):null!=e&&this.push(e),this.stream._duplexState=(this.stream._duplexState|I)&j}autoBatch(e,t){const n=[],i=this.stream;for(n.push(e);589824==(i._duplexState&U);)n.push(i._writableState.shift());if(0!=(7&i._duplexState))return t(null);i._writev(n,t)}update(){const e=this.stream;for(;(e._duplexState&U)===k;){const t=this.shift();e._duplexState|=327680,e._write(t,this.afterWrite),e._duplexState&=33292287}0==(196608&e._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const e=this.stream;if((17301511&e._duplexState)===I)return e._duplexState=16777215&(e._duplexState|_),void e._final(W.bind(this));2!=(6&e._duplexState)?1==(e._duplexState&P)&&(e._duplexState=(e._duplexState|C)&u,e._open(Y.bind(this))):0==(e._duplexState&O)&&(e._duplexState|=C,e._destroy(V.bind(this)))}updateNextTick(){0==(this.stream._duplexState&A)&&(this.stream._duplexState|=A,o(this.afterUpdateNextTick))}}class D{constructor(e,{highWaterMark:t=16384,map:n=null,mapReadable:i,byteLength:r,byteLengthReadable:s}={}){this.stream=e,this.queue=new a,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||oe,this.map=i||n,this.pipeTo=null,this.afterRead=$.bind(this),this.afterUpdateNextTick=G.bind(this)}get ended(){return 0!=(this.stream._duplexState&g)}pipe(e,t){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if(this.stream._duplexState|=f,this.pipeTo=e,this.pipeline=new H(this.stream,e,t||null),t&&this.stream.on("error",ae),se(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",ae),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{const t=this.pipeline.done.bind(this.pipeline,e),n=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",t),e.on("close",n),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",F.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){const t=this.stream;return null===e?(this.highWaterMark=0,t._duplexState=33521647&(t._duplexState|p),!1):(null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=33521663&(t._duplexState|l),this.buffered<this.highWaterMark)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=33550271),e}unshift(e){let t;const n=[];for(;void 0!==(t=this.queue.shift());)n.push(t);this.push(e);for(let e=0;e<n.length;e++)this.queue.push(n[e])}read(){const e=this.stream;if((8263&e._duplexState)===l){const t=this.shift();return 0!=(e._duplexState&h)&&e.emit("data",t),null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),t}return null}drain(){const e=this.stream;for(;(8263&e._duplexState)===l&&0!=(384&e._duplexState);){const t=this.shift();0!=(e._duplexState&h)&&e.emit("data",t),null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y)}}update(){const e=this.stream;for(this.drain();this.buffered<this.highWaterMark&&0==(41487&e._duplexState);)e._duplexState|=32808,e._read(this.afterRead),e._duplexState&=33554399,0==(8&e._duplexState)&&this.drain();2112==(6215&e._duplexState)&&(e._duplexState|=b,e.emit("readable")),0==(24&e._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const e=this.stream;(583&e._duplexState)===p&&(e._duplexState=33553919&(e._duplexState|g),e.emit("end"),(e._duplexState&L)===R&&(e._duplexState|=2),null!==this.pipeTo&&this.pipeTo.end()),2!=(6&e._duplexState)?1==(e._duplexState&P)&&(e._duplexState=(e._duplexState|C)&u,e._open(Y.bind(this))):0==(e._duplexState&O)&&(e._duplexState|=C,e._destrLine truncated var n=e("once");t.exports=function(e,t,r){r=n(r);var s=i.alloc(t),a=0;e.on("data",(function(e){e.copy(s,a),a+=e.length})).on("end",(function(){r(null,s)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,once:326}],471:[function(e,t,i){const{EventEmitter:n}=e("events"),r=new Error("Stream was destroyed"),s=new Error("Premature close"),a=e("queue-tick"),o=e("fast-fifo"),c=33554431,l=1^c,u=64,p=128,d=256,f=512,h=1024,m=2048,b=4096,v=8192,g=16392,y=384^c,_=65536,x=2<<16,w=4<<16,k=8<<16,E=16<<16,S=32<<16,M=64<<16,A=8454144,j=256<<16,I=33488895,T=33423359,C=65544,B=33488887,R=2105344,L=6|R,O=8470536,P=8404999,U=589831,q=Symbol.asyncIterator||Symbol("asyncIterator");class N{constructor(e,{highWaterMark:t=16384,map:i=null,mapWritable:n,byteLength:r,byteLengthWritable:s}={}){this.stream=e,this.queue=new o,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||ae,this.map=n||i,this.afterWrite=V.bind(this),this.afterUpdateNextTick=X.bind(this)}get ended(){return 0!=(this.stream._duplexState&S)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=k,!0):(this.stream._duplexState|=1572864,!1)}shift(){const e=this.queue.shift(),t=this.stream;return this.buffered-=this.byteLength(e),0===this.buffered&&(t._duplexState&=33030143),e}end(e){"function"==typeof e?this.stream.once("finish",e):null!=e&&this.push(e),this.stream._duplexState=(this.stream._duplexState|j)&T}autoBatch(e,t){const i=[],n=this.stream;for(i.push(e);589824==(n._duplexState&U);)i.push(n._writableState.shift());if(0!=(7&n._duplexState))return t(null);n._writev(i,t)}update(){const e=this.stream;for(;(e._duplexState&U)===k;){const t=this.shift();e._duplexState|=327680,e._write(t,this.afterWrite),e._duplexState&=33292287}0==(196608&e._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const e=this.stream;if((17301511&e._duplexState)===j)return e._duplexState=16777215&(e._duplexState|_),void e._final(W.bind(this));2!=(6&e._duplexState)?1==(e._duplexState&P)&&(e._duplexState=(e._duplexState|C)&l,e._open(Y.bind(this))):0==(e._duplexState&O)&&(e._duplexState|=C,e._destroy(K.bind(this)))}updateNextTick(){0==(this.stream._duplexState&A)&&(this.stream._duplexState|=A,a(this.afterUpdateNextTick))}}class D{constructor(e,{highWaterMark:t=16384,map:i=null,mapReadable:n,byteLength:r,byteLengthReadable:s}={}){this.stream=e,this.queue=new o,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||ae,this.map=n||i,this.pipeTo=null,this.afterRead=$.bind(this),this.afterUpdateNextTick=G.bind(this)}get ended(){return 0!=(this.stream._duplexState&v)}pipe(e,t){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if(this.stream._duplexState|=d,this.pipeTo=e,this.pipeline=new H(this.stream,e,t||null),t&&this.stream.on("error",oe),se(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",oe),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{const t=this.pipeline.done.bind(this.pipeline,e),i=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",t),e.on("close",i),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",F.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){const t=this.stream;return null===e?(this.highWaterMark=0,t._duplexState=33521647&(t._duplexState|f),!1):(null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=33521663&(t._duplexState|u),this.buffered<this.highWaterMark)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=33550271),e}unshift(e){let t;const i=[];for(;void 0!==(t=this.queue.shift());)i.push(t);this.push(e);for(let e=0;e<i.length;e++)this.queue.push(i[e])}read(){const e=this.stream;if((8263&e._duplexState)===u){const t=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t),t}return null}drain(){const e=this.stream;for(;(8263&e._duplexState)===u&&0!=(384&e._duplexState);){const t=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t)}}update(){const e=this.stream;for(this.drain();this.buffered<this.highWaterMark&&0==(41487&e._duplexState);)e._duplexState|=32808,e._read(this.afterRead),e._duplexState&=33554399,0==(8&e._duplexState)&&this.drain();2112==(6215&e._duplexState)&&(e._duplexState|=b,e.emit("readable")),0==(24&e._duplexState)&&this.updateNonPrimary()}updateNonPrimary(){const e=this.stream;(583&e._duplexState)===f&&(e._duplexState=33553919&(e._duplexState|v),e.emit("end"),(e._duplexState&L)===R&&(e._duplexState|=2),null!==this.pipeTo&&this.pipeTo.end()),2!=(6&e._duplexState)?1==(e._duplexState&P)&&(e._duplexState=(e._duplexState|C)&l,e._open(Y.bind(this))):0==(e._duplexState&O)&&(e._duplexState|=C,e._destrLine truncated
/**! /**!
* tippy.js v6.3.1 * tippy.js v6.3.3
* (c) 2017-2021 atomiks * (c) 2017-2021 atomiks
* MIT License * MIT License
*/ */
"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("@popperjs/core"),r="tippy-content",s="tippy-backdrop",o="tippy-arrow",a="tippy-svg-arrow",c={passive:!0,capture:!0};function u(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function l(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function p(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function h(e){return[].concat(e)}function m(e,t){-1===e.indexOf(t)&&e.push(t)}function b(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function v(){return document.createElement("div")}function y(e){return["Element","Fragment"].some((function(t){return l(e,t)}))}function _(e){return l(e,"MouseEvent")}function w(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function x(e){return y(e)?[e]:function(e){return l(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function k(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function E(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function S(e){var t,n=h(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function M(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}var A={isTouch:!1},I=0;function T(){A.isTouch||(A.isTouch=!0,window.performance&&document.addEventListener("mousemove",j))}function j(){var e=performance.now();e-I<20&&(A.isTouch=!1,document.removeEventListener("mousemove",j)),I=e}function C(){var e=document.activeElement;if(w(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var B,R="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",L=/MSIE |Trident\//.test(R);function O(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function P(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function U(e){return P("\n %ctippy.js\n\n %c"+P(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function q(e){return[U(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function N(e,t){var n;e&&!B.has(t)&&(B.add(t),(n=console).warn.apply(n,q(t)))}function D(e,t){var n;e&&!B.has(t)&&(B.add(t),(n=console).error.apply(n,q(t)))}"production"!==t.env.NODE_ENV&&(B=new Set);var z={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},H=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},z,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),F=Object.keys(H);function W(e){var t=(e.plugins||[]).reduce((function(t,n){var i=n.name,r=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:r),t}),{});return Object.assign({},e,{},t)}function V(e,t){var n=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(W(Object.assign({},H,{plugins:t}))):F).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},H.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function K(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var n,i,r=p(H,Object.keys(z)),s=(n=r,i=e,!{}.hasOwnProperty.call(n,i));s&&(s=0===t.filter((function(t){return t.name===e})).length),N(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function $(e,t){e.innerHTML=t}function G(e){var t=v();return!0===e?t.className=o:(t.className=a,y(e)?t.appendChild(e):$(t,e)),t}function X(e,t){y(t.content)?($(e,""),e.appendChild(t.content)):Line truncated "use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("@popperjs/core"),r="tippy-content",s="tippy-backdrop",a="tippy-arrow",o="tippy-svg-arrow",c={passive:!0,capture:!0},l=function(){return document.body};function u(e,t,i){if(Array.isArray(e)){var n=e[t];return null==n?Array.isArray(i)?i[t]:i:n}return e}function p(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function h(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function m(e){return[].concat(e)}function b(e,t){-1===e.indexOf(t)&&e.push(t)}function v(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function _(){return document.createElement("div")}function x(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function w(e){return p(e,"MouseEvent")}function k(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function E(e){return x(e)?[e]:function(e){return p(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function S(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function M(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function A(e){var t,i=m(e)[0];return(null==i||null==(t=i.ownerDocument)?void 0:t.body)?i.ownerDocument:document}function j(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function I(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==(n=null==i.getRootNode?void 0:i.getRootNode())?void 0:n.host}return!1}var T={isTouch:!1},C=0;function B(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",R))}function R(){var e=performance.now();e-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",R)),C=e}function L(){var e=document.activeElement;if(k(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var O,P=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function U(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function q(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function N(e){return q("\n %ctippy.js\n\n %c"+q(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function D(e){return[N(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function z(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).warn.apply(i,D(t)))}function H(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).error.apply(i,D(t)))}"production"!==t.env.NODE_ENV&&(O=new Set);var F={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},W=Object.assign({appendTo:l,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},F,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),K=Object.keys(W);function V(e){var t=(e.plugins||[]).reduce((function(t,i){var n,r=i.name,s=i.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(n=W[r])?n:s);return t}),{});return Object.assign({},e,{},t)}function $(e,t){var i=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(V(Object.assign({},W,{plugins:t}))):K).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},W.aria,{},i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function G(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,r=h(W,Object.keys(F)),s=(i=r,n=e,!{}.hasOwnProperty.call(i,n));s&&(s=0===t.filter((function(t){return t.name===e})).length),z(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.g Line truncated
/*! torrent-discovery. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! torrent-discovery. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),s=e("events").EventEmitter,o=e("run-parallel"),a=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends s{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 r(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 r?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)}))),o(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 a(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:342,"bittorrent-dht/client":73,"bittorrent-lsd":73,"bittorrent-tracker/client":47,debug:487,events:196,"run-parallel":384}],487:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":488,_process:342,dup:29}],488:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:489}],489:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],490:[function(e,t,n){(function(e){(function(){ const n=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),s=e("events").EventEmitter,a=e("run-parallel"),o=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends s{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!i.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 i=new r(t);return i.on("warning",this._onWarning),i.on("error",this._onError),i.listen(e),this._internalDHT=!0,i};!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 r?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||(n("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,n("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:341,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":44,debug:161,events:193,"run-parallel":381}],478:[function(e,t,i){(function(e){(function(){
/*! torrent-piece. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! torrent-piece. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
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._cancellations.length||this._reservations<this._chunks){let e=this._reservations;for(;this._cancellations.length;)e=Math.min(e,this._cancellations.pop());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 r=t.length,s=Math.ceil(r/n);for(let r=0;r<s;r++)if(!this._buffer[e+r]){const s=r*n,o=t.slice(s,s+n);this._buffered++,this._buffer[e+r]=o,this.missing-=o.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",{value:n}),t.exports=i}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],491:[function(e,t,n){(function(n){(function(){var i=e("is-typedarray").strict;t.exports=function(e){if(i(e)){var t=n.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return n.from(e)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"is-typedarray":252}],492:[function(e,t,n){var i=e("buffer-alloc"),r=Math.pow(2,32);n.encodingLength=function(){return 8},n.encode=function(e,t,n){t||(t=i(8)),n||(n=0);var s=Math.floor(e/r),o=e-s*r;return t.writeUInt32BE(s,n),t.writeUInt32BE(o,n+4),t},n.decode=function(e,t){t||(t=0);var n=e.readUInt32BE(t),i=e.readUInt32BE(t+4);return n*r+i},n.encode.bytes=8,n.decode.bytes=8},{"buffer-alloc":118}],493:[function(e,t,n){t.exports=function(e,t){if(t>=e.length||t<0)return;var n=e.pop();if(t<e.length){var i=e[t];return e[t]=n,i}return n}},{}],494:[function(e,t,n){"use strict";var i=e("punycode"),r=e("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=y,n.resolve=function(e,t){return y(e,!1,!0).resolve(t)},n.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},n.format=function(e){r.isString(e)&&(e=y(e));return e instanceof s?e.format():s.prototype.format.call(e)},n.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");function y(e,t,n){if(e&&r.isObject(e)&&e instanceof s)return e;var i=new s;return i.parse(e,t,n),i}s.prototype.parse=function(e,t,n){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s<e.indexOf("#")?"?":"#",u=e.split(a);u[0]=u[0].replace(/\\/g,"/");var y=e=u.join(a);if(y=y.trim(),!n&&1===e.split("#").length){var _=c.exec(y);if(_)return this.path=y,this.href=y,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(y);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,y=y.substr(w.length)}if(n||w||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===y.substr(0,2);!k||w&&b[w]||(y=y.substr(2),this.slashes=!0)}if(!b[w]&&(k||w&&!g[w])){for(var E,S,M=-1,A=0;A<f.length;A++){-1!==(I=y.indexOf(f[A]))&&(-1===M||I<M)&&(M=I)}-1!==(S=-1===M?y.lastIndexOf("@"):y.lastIndexOf("@",M))&&(E=y.slice(0,S),y=y.slice(S+1),this.auth=decodeURIComponent(E)),M=-1;for(A=0;A<d.length;A++){var I;-1!==(I=y.indexOf(d[A]))&&(-1===M||I<M)&&(M=I)}-1===M&&(M=y.length),this.host=y.slice(0,M),y=y.slice(M),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var j=this.hostname.split(/\./),C=(A=0,j.length);A<C;A++){var B=j[A];if(B&&!B.match(p)){for(var R="",L=0,O=B.length;L<O;L++)B.charCodeAt(L)>127?R+="x":R+=B[L];if(!R.match(p)){var P=j.slice(0,A),U=j.slice(A+1),q=B.matchLine truncated const i=16384;class n{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/i),this._remainder=e%i||i,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:i}chunkLengthRemaining(e){return this.length-e*i}chunkOffset(e){return e*i}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._cancellations.length||this._reservations<this._chunks){let e=this._reservations;for(;this._cancellations.length;)e=Math.min(e,this._cancellations.pop());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,n){if(!this.init())return!1;const r=t.length,s=Math.ceil(r/i);for(let r=0;r<s;r++)if(!this._buffer[e+r]){const s=r*i,a=t.slice(s,s+i);this._buffered++,this._buffer[e+r]=a,this.missing-=a.length,this.sources.includes(n)||this.sources.push(n)}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(n,"BLOCK_LENGTH",{value:i}),t.exports=n}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],479:[function(e,t,i){(function(i){(function(){var n=e("is-typedarray").strict;t.exports=function(e){if(n(e)){var t=i.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return i.from(e)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"is-typedarray":249}],480:[function(e,t,i){var n=e("buffer-alloc"),r=Math.pow(2,32);i.encodingLength=function(){return 8},i.encode=function(e,t,i){t||(t=n(8)),i||(i=0);var s=Math.floor(e/r),a=e-s*r;return t.writeUInt32BE(s,i),t.writeUInt32BE(a,i+4),t},i.decode=function(e,t){t||(t=0);var i=e.readUInt32BE(t),n=e.readUInt32BE(t+4);return i*r+n},i.encode.bytes=8,i.decode.bytes=8},{"buffer-alloc":112}],481:[function(e,t,i){t.exports=function(e,t){if(t>=e.length||t<0)return;var i=e.pop();if(t<e.length){var n=e[t];return e[t]=i,n}return i}},{}],482:[function(e,t,i){"use strict";var n=e("punycode"),r=e("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}i.parse=y,i.resolve=function(e,t){return y(e,!1,!0).resolve(t)},i.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},i.format=function(e){r.isString(e)&&(e=y(e));return e instanceof s?e.format():s.prototype.format.call(e)},i.Url=s;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(l),p=["%","/","?",";","#"].concat(u),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=e("querystring");function y(e,t,i){if(e&&r.isObject(e)&&e instanceof s)return e;var n=new s;return n.parse(e,t,i),n}s.prototype.parse=function(e,t,i){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),o=-1!==s&&s<e.indexOf("#")?"?":"#",l=e.split(o);l[0]=l[0].replace(/\\/g,"/");var y=e=l.join(o);if(y=y.trim(),!i&&1===e.split("#").length){var _=c.exec(y);if(_)return this.path=y,this.href=y,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?g.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(y);if(x){var w=(x=x[0]).toLowerCase();this.protocol=w,y=y.substr(x.length)}if(i||x||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===y.substr(0,2);!k||x&&b[x]||(y=y.substr(2),this.slashes=!0)}if(!b[x]&&(k||x&&!v[x])){for(var E,S,M=-1,A=0;A<d.length;A++){-1!==(j=y.indexOf(d[A]))&&(-1===M||j<M)&&(M=j)}-1!==(S=-1===M?y.lastIndexOf("@"):y.lastIndexOf("@",M))&&(E=y.slice(0,S),y=y.slice(S+1),this.auth=decodeURIComponent(E)),M=-1;for(A=0;A<p.length;A++){var j;-1!==(j=y.indexOf(p[A]))&&(-1===M||j<M)&&(M=j)}-1===M&&(M=y.length),this.host=y.slice(0,M),y=y.slice(M),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var T=this.hostname.split(/\./),C=(A=0,T.length);A<C;A++){var B=T[A];if(B&&!B.match(f)){for(var R="",L=0,O=B.length;L<O;L++)B.charCodeAt(L)>127?R+="x":R+=B[L];if(!R.match(f)){var P=T.slice(0,A),U=T.slice(A+1),q=B.matchLine truncated
/*! ut_metadata. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! ut_metadata. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const{EventEmitter:i}=e("events"),r=e("bencode"),s=e("bitfield").default,o=e("debug")("ut_metadata"),a=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 s(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(),s=i.indexOf("ee")+2;t=r.decode(i.substring(0,s)),n=e.slice(s)}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;o("set metadata");try{const t=r.decode(e).info;t&&(e=r.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===a.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",r.encode({info:r.decode(this.metadata)})),!0)}_send(e,t){let i=r.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 s(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:23,bitfield:27,buffer:116,debug:497,events:196,"simple-sha1":417}],497:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":498,_process:342,dup:29}],498:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:499}],499:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],500:[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:{})},{}],501:[function(e,t,n){(function(n){(function(){const i=e("binary-search"),r=e("events"),s=e("mp4-stream"),o=e("mp4-box-encoding"),a=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 u=1;t.exports=class extends r{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=s.decode();const n=this._file.createReadStream({start:e});n.pipe(this._decoder);const i=r=>{"moov"===r.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)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",i),t+=r.length,n.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",i)}_procLine truncated const{EventEmitter:n}=e("events"),r=e("bencode"),s=e("bitfield").default,a=e("debug")("ut_metadata"),o=e("simple-sha1"),c=16384;t.exports=e=>{class t extends n{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new s(0,{grow:1e3}),i.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,i){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,i;try{const n=e.toString(),s=n.indexOf("ee")+2;t=r.decode(n.substring(0,s)),i=e.slice(s)}catch(e){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,i,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=r.decode(e).info;t&&(e=r.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",r.encode({info:r.decode(this.metadata)})),!0)}_send(e,t){let n=r.encode(e);i.isBuffer(t)&&(n=i.concat([n,t])),this._wire.extended("ut_metadata",n)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,i){const n={msg_type:1,piece:e};"number"==typeof i&&(n.total_size=i),this._send(n,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 i=t+c;i>this._metadataSize&&(i=this._metadataSize);const n=this.metadata.slice(t,i);this._data(e,n,this._metadataSize)}_onData(e,t,i){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=i.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 s(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:23,bitfield:27,buffer:110,debug:161,events:193,"simple-sha1":411}],485:[function(e,t,i){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],486:[function(e,t,i){(function(i){(function(){const n=e("binary-search"),r=e("events"),s=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 r{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=s.decode();const i=this._file.createReadStream({start:e});i.pipe(this._decoder);const n=r=>{"moov"===r.type?(this._decoder.removeListener("box",n),this._decoder.decode((e=>{i.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",n),t+=r.length,i.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",n)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let i=0;i<t.length;i++){const r=t[i],s=r.mdia.minf.stbl,a=s.stsd.entries[0],o=r.mdia.hdlr.handlerType;let l,u;if("vide"===o&&"avc1"===a.type){if(this._hasVideo)contiLine truncated
/*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */ /*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const{EventEmitter:i}=e("events"),r=e("simple-concat"),s=e("create-torrent"),o=e("debug")("webtorrent"),a=e("bittorrent-dht/client"),c=e("load-ip-set"),u=e("run-parallel"),l=e("parse-torrent"),d=e("path"),f=e("simple-peer"),p=e("queue-microtask"),h=e("randombytes"),m=e("speedometer"),{ThrottleGroup:b}=e("speed-limiter"),g=e("./lib/conn-pool"),v=e("./lib/torrent"),y=e("./package.json").version,_=y.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),w=`-WW${_}-`;class x extends i{constructor(e={}){super(),"string"==typeof e.peerId?this.peerId=e.peerId:n.isBuffer(e.peerId)?this.peerId=e.peerId.toString("hex"):this.peerId=n.from(w+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=n.from(this.peerId,"hex"),"string"==typeof e.nodeId?this.nodeId=e.nodeId:n.isBuffer(e.nodeId)?this.nodeId=e.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=n.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.lsd=!1!==e.lsd,this.torrents=[],this.maxConns=Number(e.maxConns)||55,this.utp=x.UTP_SUPPORT&&!1!==e.utp,this._downloadLimit=Math.max("number"==typeof e.downloadLimit?e.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof e.uploadLimit?e.uploadLimit:-1,-1),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new b({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new b({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):p((()=>{this._onListening()})),this._downloadSpeed=m(),this._uploadSpeed=m(),!1!==e.dht&&"function"==typeof a?(this.dht=new a(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 c&&null!=e.blocklist?c(e.blocklist,{headers:{"user-agent":`WebTorrent/${y} (https://webtorrent.io)`}},((e,n)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=n,t()})):p(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=l(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}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===s.infoHash&&e!==s)return void s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`))},r=()=>{this.destroyed||(n(s),this.emit("torrent",s))};this._debug("add"),t=t?Object.assign({},t):{};const s=new v(e,this,t);return this.torrents.push(s),s.once("_infoHash",i),s.once("ready",r),s.once("close",(function e(){s.removeListener("_infoHash",i),s.removeListener("ready",r),s.removeListener("close",e)})),s}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=d.dirname(e)),t.createdBy||(t.createdBy=`WebTorrent/${_}`);const o=e=>{this._debug("on seed"),"function"==typeof n&&n(e),e.emit("seed"),this.emit("seed",e)},a=this.add(null,t,(e=>{const n=[n=>{if(i||t.preloadedStore)return n();e.load(c,n)}];this.dht&&n.push((t=>{e.once("dhtAnnounce",t)})),u(n,(t=>{if(!this.destroyed)return t?e._destroy(t):void o(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=>n=>{!t.preloadedStore&&function(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}(e)?r(e,((t,i)=>{if(t)return n(t);i.name=e.name,n(null,i)})):n(null,e)})),((e,n)=>{if(!this.destroyed)return e?a._destroy(e):void s.parseInput(n,t,((e,i)=>{if(!this.destroyed){if(e)return a._destroy(e);c=i.map((e=>e.getStream)),s(n,t,((e,t)=>{if(this.destroyed)return;if(e)return a._destroy(e);const n=this.get(t);n?a._destroy(new Error(`Cannot add duplicate torrent ${n.infoHash}`)):a._onTorrentId(t)}))}}))})),a}remove(e,t,n){if("function"Line truncated const n=e("events"),r=e("path"),s=e("simple-concat"),a=e("create-torrent"),o=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("speedometer"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:_}=e("./package.json"),x=o("webtorrent"),w=_.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class E extends n{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:i.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=i.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=i.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:i.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=i.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=E.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.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!==t.webSeeds;const n=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${_} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,n()})):f(n)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[i,...n]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(n=decodeURI(n.join("/")),!i||!n)return null;const[r]=e.ports,s=this.get(i)&&this.get(i).files.find((e=>e.path===n));if(!s)return null;const[a,o,c]=s._serve(t),l=o&&o[Symbol.asyncIterator](),u=()=>{r.onmessage=null,o&&o.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.substr(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),t(this.serviceWorker)}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 y){if(this.torrents.includes(e))return e}else{let t;try{t=p(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}add(e,t={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]);const n=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===s.infoHash&&e!==s)return void s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`))},r=()=>{this.destroyed||(i(s),this.emit("torrent",s))};this._debug("add"),t=t?Object.assign({},t):{};const s=new y(e,this,t);return this.torrents.push(s),s.once("_infoHash",n),s.once("ready",r),s.onceLine truncated
+10 -10
View File
@@ -6,19 +6,19 @@
"dependencies": { "dependencies": {
"browserify": "^17.0.0", "browserify": "^17.0.0",
"bytes": "^3.1.0", "bytes": "^3.1.0",
"clipboard": "^2.0.6", "clipboard": "^2.0.8",
"magnet-uri": "^6.2.0", "magnet-uri": "^6.2.0",
"mime-types": "^2.1.27", "mime-types": "^2.1.33",
"parse-torrent": "^9.0.0", "parse-torrent": "^9.1.4",
"tippy.js": "^6.2.7", "tippy.js": "^6.3.3",
"webtorrent": "^1.0.0" "webtorrent": "^1.5.8"
}, },
"devDependencies": { "devDependencies": {
"buffer": "^5.2.1", "Buffer": "0.0.0",
"Buffer": "^0.0.0", "buffer": "^6.0.3",
"notyf": "^3.9.0", "notyf": "^3.10.0",
"terser": "^5.3.8", "terser": "^5.9.0",
"watchify": "^3.11.1" "watchify": "^4.0.0"
}, },
"scripts": { "scripts": {
"watch": "watchify src/parse.js -o bin/bundle.js", "watch": "watchify src/parse.js -o bin/bundle.js",
+2 -2
View File
@@ -1,8 +1,8 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
/*! Tippy v6.3.1 | MIT License | github.com/atomiks/tippyjs */ /*! Tippy v6.3.3 | MIT License | github.com/atomiks/tippyjs */
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}
/* Tippy shift-away-subtle theme */ /* Tippy shift-away-subtle theme */
.tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)} .tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}