From 91cd02a5745139de8409d8db3ab05f1ea55166f6 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 21 Nov 2016 01:56:34 +0000 Subject: [PATCH] Webpack build: 049ab42eb44085b13c31973ce62d96234fcb4b20 --- discord.indev.js | 2 +- discord.indev.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord.indev.js b/discord.indev.js index e7b69a0e..68dd6adc 100644 --- a/discord.indev.js +++ b/discord.indev.js @@ -16127,7 +16127,7 @@ module.exports = { "docs": "node docs/generator", "test-docs": "node docs/generator test", "lint": "eslint src", - "web-dist": "npm install && node ./node_modules/parallel-webpack/bin/run.js" + "web-dist": "node ./node_modules/parallel-webpack/bin/run.js" }, "repository": { "type": "git", diff --git a/discord.indev.min.js b/discord.indev.min.js index da15dc13..9003379e 100644 --- a/discord.indev.min.js +++ b/discord.indev.min.js @@ -10,7 +10,7 @@ ${t} `),i.split.append||(i.split.append="\n```")),t=n(this.client.resolver.resolveString(t),!0),this.sendMessage(`\`\`\`${e||""} ${t} \`\`\``,i)}edit(e=this.name,t){return t?this.client.resolver.resolveBuffer(t).then(t=>{const i=this.client.resolver.resolveBase64(t);return this.client.rest.methods.editWebhook(this,e,i)}):this.client.rest.methods.editWebhook(this,e).then(e=>{return this.setup(e),this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}e.exports=s},function(e,t,i){function r(){return Object.keys(a)}var n=i(152);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv;var s=i(151);t.createDecipher=t.Decipher=s.createDecipher,t.createDecipheriv=t.Decipheriv=s.createDecipheriv;var a=i(38);t.listCiphers=t.getCiphers=r},function(e,t,i){(function(t){function r(e){var t=s(e),i=t.toRed(a.mont(e.modulus)).redPow(new a(e.publicExponent)).fromRed();return{blinder:i,unblinder:t.invm(e.modulus)}}function n(e,i){var n=r(i),s=i.modulus.byteLength(),o=(a.mont(i.modulus),new a(e).mul(n.blinder).umod(i.modulus)),f=o.toRed(a.mont(i.prime1)),h=o.toRed(a.mont(i.prime2)),c=i.coefficient,l=i.prime1,u=i.prime2,d=f.redPow(i.exponent1),p=h.redPow(i.exponent2);d=d.fromRed(),p=p.fromRed();var b=d.isub(p).imul(c).umod(l);return b.imul(u),p.iadd(b),new t(p.imul(n.unblinder).umod(i.modulus).toArray(!1,s))}function s(e){for(var t=e.modulus.byteLength(),i=new a(o(t));i.cmp(e.modulus)>=0||!i.umod(e.prime1)||!i.umod(e.prime2);)i=new a(o(t));return i}var a=i(7),o=i(30);e.exports=n,n.getr=s}).call(t,i(0).Buffer)},function(e,t,i){"use strict";(function(e){var r=i(0),n=r.Buffer,s=r.SlowBuffer,a=r.kMaxLength||2147483647;t.alloc=function(e,t,i){if("function"==typeof n.alloc)return n.alloc(e,t,i);if("number"==typeof i)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>a)throw new RangeError("size is too large");var r=i,s=t;void 0===s&&(r=void 0,s=0);var o=new n(e);if("string"==typeof s)for(var f=new n(s,r),h=f.length,c=-1;++ca)throw new RangeError("size is too large");return new n(e)},t.from=function(t,i,r){if("function"==typeof n.from&&(!e.Uint8Array||Uint8Array.from!==n.from))return n.from(t,i,r);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new n(t,i);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var s=i;if(1===arguments.length)return new n(t);"undefined"==typeof s&&(s=0);var a=r;if("undefined"==typeof a&&(a=t.byteLength-s),s>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(a>t.byteLength-s)throw new RangeError("'length' is out of bounds");return new n(t.slice(s,s+a))}if(n.isBuffer(t)){var o=new n(t.length);return t.copy(o,0,0,t.length),o}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new n(t);if("Buffer"===t.type&&Array.isArray(t.data))return new n(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof n.allocUnsafeSlow)return n.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=a)throw new RangeError("size is too large");return new s(e)}}).call(t,i(19))},function(e,t,i){"use strict";(function(t){function r(e,i){a.call(this),e=e.toLowerCase(),"string"==typeof i&&(i=new t(i));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=i,i.length>r?i=n(e).update(i).digest():i.length-1?r:A;o.WritableState=a;var M=i(28);M.inherits=i(2);var T,x={deprecate:i(234)};!function(){try{T=i(11)}catch(e){}finally{T||(T=i(5).EventEmitter)}}();var R=i(0).Buffer,I=i(52);M.inherits(o,T);var C;a.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(a.prototype,"buffer",{get:x.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var C;o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},o.prototype.write=function(e,t,i){var r=this._writableState,s=!1;return"function"==typeof t&&(i=t,t=null),R.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof i&&(i=n),r.ended?f(this,i):h(this,r,e,i)&&(r.pendingcb++,s=l(this,r,e,t,i)),s},o.prototype.cork=function(){var e=this._writableState;e.corked++},o.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},o.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},o.prototype._write=function(e,t,i){i(new Error("not implemented"))},o.prototype._writev=null,o.prototype.end=function(e,t,i){var r=this._writableState;"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||k(this,r,i)}}).call(t,i(8),i(61).setImmediate)},function(e,t,i){function r(e){if(e&&!f(e))throw new Error("Unknown encoding: "+e)}function n(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function a(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var o=i(0).Buffer,f=o.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},h=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return void(this.write=n)}this.charBuffer=new o(6),this.charReceived=0,this.charLength=0};h.prototype.write=function(e){for(var t="";this.charLength;){var i=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,i),this.charReceived+=i,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived),t+=e.toString(this.encoding,0,n);var n=t.length-1,r=t.charCodeAt(n);if(r>=55296&&r<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,n)}return t},h.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var i=e[e.length-t];if(1==t&&i>>5==6){this.charLength=2;break}if(t<=2&&i>>4==14){this.charLength=3;break}if(t<=3&&i>>3==30){this.charLength=4;break}}this.charReceived=t},h.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var i=this.charReceived,r=this.charBuffer,n=this.encoding;t+=r.slice(0,i).toString(n)}return t}},function(e,t,i){function r(){}function n(e){if(!w(e))return e;var t=[];for(var i in e)s(t,i,e[i]);return t.join("&")}function s(e,t,i){if(null!=i)if(Array.isArray(i))i.forEach(function(i){s(e,t,i)});else if(w(i))for(var r in i)s(e,t+"["+r+"]",i[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));else null===i&&e.push(encodeURIComponent(t))}function a(e){for(var t,i,r={},n=e.split("&"),s=0,a=n.length;s=300)&&(r=new Error(t.statusText||"Unsuccessful HTTP response"),r.original=e,r.response=t,r.status=t.status)}catch(e){r=e}r?i.callback(r,t):i.callback(null,t)})}function d(e,t){var i=g("DELETE",e);return t&&i.end(t),i}var p;"undefined"!=typeof window?p=window:"undefined"!=typeof self?p=self:(console.warn("Using browser-only version of superagent in non-browser environment"),p=this);var b=i(163),m=i(229),w=i(119),g=e.exports=i(230).bind(null,u);g.getXHR=function(){if(!(!p.XMLHttpRequest||p.location&&"file:"==p.location.protocol&&p.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only verison of superagent could not find XHR")};var v="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};g.serializeObject=n,g.parseString=a,g.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},g.serialize={"application/x-www-form-urlencoded":n,"application/json":JSON.stringify},g.parse={"application/x-www-form-urlencoded":a,"application/json":JSON.parse},l.prototype.get=function(e){return this.header[e.toLowerCase()]},l.prototype._setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=h(t);var i=c(t);for(var r in i)this[r]=i[r]},l.prototype._parseBody=function(e){var t=g.parse[this.type];return!t&&f(this.type)&&(t=g.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},l.prototype._setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},l.prototype.toError=function(){var e=this.req,t=e.method,i=e.url,r="cannot "+t+" "+i+" ("+this.status+")",n=new Error(r);return n.status=this.status,n.method=t,n.url=i,n},g.Response=l,b(u.prototype),m(u.prototype),u.prototype.type=function(e){return this.set("Content-Type",g.types[e]||e),this},u.prototype.responseType=function(e){return this._responseType=e,this},u.prototype.accept=function(e){return this.set("Accept",g.types[e]||e),this},u.prototype.auth=function(e,t,i){switch(i||(i={type:"basic"}),i.type){case"basic":var r=btoa(e+":"+t);this.set("Authorization","Basic "+r);break;case"auto":this.username=e,this.password=t}return this},u.prototype.query=function(e){return"string"!=typeof e&&(e=n(e)),e&&this._query.push(e),this},u.prototype.attach=function(e,t,i){if(this._data)throw Error("superagent can't mix .send() and .attach()");return this._getFormData().append(e,t,i||t.name),this},u.prototype._getFormData=function(){return this._formData||(this._formData=new p.FormData),this._formData},u.prototype.callback=function(e,t){var i=this._callback;this.clearTimeout(),e&&this.emit("error",e),i(e,t)},u.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},u.prototype.buffer=u.prototype.ca=u.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},u.prototype.pipe=u.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},u.prototype._timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},u.prototype._appendQueryString=function(){var e=this._query.join("&");e&&(this.url+=~this.url.indexOf("?")?"&"+e:"?"+e)},u.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},u.prototype.end=function(e){var t=this,i=this.xhr=g.getXHR(),n=this._timeout,s=this._formData||this._data;this._callback=e||r,i.onreadystatechange=function(){if(4==i.readyState){var e;try{e=i.status}catch(t){e=0}if(0==e){if(t.timedout)return t._timeoutError();if(t._aborted)return;return t.crossDomainError()}t.emit("end")}};var a=function(e,i){i.total>0&&(i.percent=i.loaded/i.total*100),i.direction=e,t.emit("progress",i)};if(this.hasListeners("progress"))try{i.onprogress=a.bind(null,"download"),i.upload&&(i.upload.onprogress=a.bind(null,"upload"))}catch(e){}if(n&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},n)),this._appendQueryString(),this.username&&this.password?i.open(this.method,this.url,!0,this.username,this.password):i.open(this.method,this.url,!0),this._withCredentials&&(i.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!this._isHost(s)){var o=this._header["content-type"],h=this._serializer||g.serialize[o?o.split(";")[0]:""];!h&&f(o)&&(h=g.serialize["application/json"]),h&&(s=h(s))}for(var c in this.header)null!=this.header[c]&&i.setRequestHeader(c,this.header[c]);return this._responseType&&(i.responseType=this._responseType),this.emit("request",this),i.send("undefined"!=typeof s?s:null),this},g.Request=u,g.get=function(e,t,i){var r=g("GET",e);return"function"==typeof t&&(i=t,t=null),t&&r.query(t),i&&r.end(i),r},g.head=function(e,t,i){var r=g("HEAD",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},g.options=function(e,t,i){var r=g("OPTIONS",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},g.del=d,g.delete=d,g.patch=function(e,t,i){var r=g("PATCH",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},g.post=function(e,t,i){var r=g("POST",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},g.put=function(e,t,i){var r=g("PUT",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r}},function(e,t,i){(function(e,r){function n(e,t){this._id=e,this._clearFn=t}var s=i(8).nextTick,a=Function.prototype.apply,o=Array.prototype.slice,f={},h=0;t.setTimeout=function(){return new n(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var i=h++,r=!(arguments.length<2)&&o.call(arguments,1);return f[i]=!0,s(function(){f[i]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(i))}),i},t.clearImmediate="function"==typeof r?r:function(e){delete f[e]}}).call(t,i(61).setImmediate,i(61).clearImmediate)},function(e,t,i){"use strict";function r(){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}function n(e,t,i){if(e&&h.isObject(e)&&e instanceof r)return e;var n=new r;return n.parse(e,t,i),n}function s(e){return h.isString(e)&&(e=n(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return n(e,!1,!0).resolve(t)}function o(e,t){return e?n(e,!1,!0).resolveObject(t):t}var f=i(220),h=i(241);t.parse=n,t.resolve=a,t.resolveObject=o,t.format=s,t.Url=r;var c=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),b=["'"].concat(p),m=["%","/","?",";","#"].concat(b),w=["/","?","#"],g=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=i(223);r.prototype.parse=function(e,t,i){if(!h.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=r!==-1&&r127?"x":N[L];if(!D.match(v)){var U=P.slice(0,T),j=P.slice(T+1),F=N.match(_);F&&(U.push(F[1]),j.unshift(F[2])),j.length&&(o="/"+j.join(".")+o),this.hostname=U.join(".");break}}}this.hostname.length>g?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=f.toASCII(this.hostname));var z=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+z,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!y[p])for(var T=0,O=b.length;T0)&&i.host.split("@");S&&(i.auth=S.shift(),i.host=i.hostname=S.shift())}return i.search=e.search,i.query=e.query,h.isNull(i.pathname)&&h.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!y.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var M=y.slice(-1)[0],T=(i.host||e.host||y.length>1)&&("."===M||".."===M)||""===M,x=0,R=y.length;R>=0;R--)M=y[R],"."===M?y.splice(R,1):".."===M?(y.splice(R,1),x++):x&&(y.splice(R,1),x--);if(!v&&!_)for(;x--;x)y.unshift("..");!v||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),T&&"/"!==y.join("/").substr(-1)&&y.push("");var I=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(A){i.hostname=i.host=I?"":y.length?y.shift():"";var S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");S&&(i.auth=S.shift(),i.host=i.hostname=S.shift())}return v=v||i.host&&y.length,v&&!I&&y.unshift(""),y.length?i.pathname=y.join("/"):(i.pathname=null,i.path=null),h.isNull(i.pathname)&&h.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},r.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(const i in e){const r=e[i],n=t.indexOf(r);n&&t.splice(n,1)}return 0===t.length}},function(e,t){e.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",scripts:{test:"eslint src && node docs/generator test",docs:"node docs/generator","test-docs":"node docs/generator test",lint:"eslint src","web-dist":"npm install && node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",dependencies:{superagent:"^3.0.0",tweetnacl:"^0.14.3",ws:"^1.1.1"},peerDependencies:{"node-opus":"^0.2.0",opusscript:"^0.0.1"},devDependencies:{bufferutil:"^1.2.1",eslint:"^3.10.0","jsdoc-to-markdown":"^2.0.0","json-loader":"^0.5.4","parallel-webpack":"^1.5.0","uglify-js":"github:mishoo/UglifyJS2#harmony","utf-8-validate":"^1.2.1",webpack:"2.1.0-beta.27",zlibjs:"github:imaya/zlib.js"},engines:{node:">=6.0.0"}}},function(e,t,i){(function(t){const r=i(12),n=i(17),s=i(135),a=i(136);class o{constructor(e,i,s=[]){this.manager=e,this.id=i,this.env=Object.assign({},t.env,{SHARD_ID:this.id,SHARD_COUNT:this.manager.totalShards,CLIENT_TOKEN:this.manager.token}),this.process=r.fork(n.resolve(this.manager.file),s,{env:this.env}),this.process.on("message",this._handleMessage.bind(this)),this.process.once("exit",()=>{this.manager.respawn&&this.manager.createShard(this.id)}),this._evals=new Map,this._fetches=new Map}send(e){return new Promise((t,i)=>{const r=this.process.send(e,e=>{e?i(e):t(this)});if(!r)throw new Error("Failed to send message to shard's process.")})}fetchClientValue(e){if(this._fetches.has(e))return this._fetches.get(e);const t=new Promise((t,i)=>{const r=i=>{i&&i._fetchProp===e&&(this.process.removeListener("message",r),this._fetches.delete(e),t(i._result))};this.process.on("message",r),this.send({_fetchProp:e}).catch(t=>{this.process.removeListener("message",r),this._fetches.delete(e),i(t)})});return this._fetches.set(e,t),t}eval(e){if(this._evals.has(e))return this._evals.get(e);const t=new Promise((t,i)=>{const r=n=>{n&&n._eval===e&&(this.process.removeListener("message",r),this._evals.delete(e),n._error?i(s(n._error)):t(n._result))};this.process.on("message",r),this.send({_eval:e}).catch(t=>{this.process.removeListener("message",r),this._evals.delete(e),i(t)})});return this._evals.set(e,t),t}_handleMessage(e){if(e){if(e._sFetchProp)return void this.manager.fetchClientValues(e._sFetchProp).then(t=>this.send({_sFetchProp:e._sFetchProp,_result:t}),t=>this.send({_sFetchProp:e._sFetchProp,_error:a(t)}));if(e._sEval)return void this.manager.broadcastEval(e._sEval).then(t=>this.send({_sEval:e._sEval,_result:t}),t=>this.send({_sEval:e._sEval,_error:a(t)}))}this.manager.emit("message",this,e)}}e.exports=o}).call(t,i(8))},function(e,t,i){(function(t){const r=i(135),n=i(136);class s{constructor(e){this.client=e,t.on("message",this._handleMessage.bind(this))}get id(){return this.client.options.shardId}get count(){return this.client.options.shardCount}send(e){return new Promise((i,r)=>{const n=t.send(e,e=>{e?r(e):i()});if(!n)throw new Error("Failed to send message to master process.")})}fetchClientValues(e){return new Promise((i,n)=>{const s=a=>{a&&a._sFetchProp===e&&(t.removeListener("message",s),a._error?n(r(a._error)):i(a._result))};t.on("message",s),this.send({_sFetchProp:e}).catch(e=>{t.removeListener("message",s),n(e)})})}broadcastEval(e){return new Promise((i,n)=>{const s=a=>{a&&a._sEval===e&&(t.removeListener("message",s),a._error?n(r(a._error)):i(a._result))};t.on("message",s),this.send({_sEval:e}).catch(e=>{t.removeListener("message",s),n(e)})})}_handleMessage(e){if(e)if(e._fetchProp){const t=e._fetchProp.split(".");let i=this.client;for(const r of t)i=i[r];this._respond("fetchProp",{_fetchProp:e._fetchProp,_result:i})}else if(e._eval)try{this._respond("eval",{_eval:e._eval,_result:this.client._eval(e._eval)})}catch(t){this._respond("eval",{_eval:e._eval,_error:n(t)})}}_respond(e,t){this.send(t).catch(t=>this.client.emit("error",`Error when sending ${e} response to master process: ${t}`))}static singleton(e){return this._singleton?e.emit("error","Multiple clients created in child process; only the first will handle sharding helpers."):this._singleton=new this(e),this._singleton}}e.exports=s}).call(t,i(8))},function(e,t,i){const r=i(14),n=i(76);class s extends n{setup(e){super.setup(e),this.flags=e.flags,this.owner=new r(this.client,e.owner)}}e.exports=s},function(e,t,i){const r=i(14),n=i(6);class s extends r{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new n,this.blocked=new n,this.notes=new n}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e){return this.client.rest.methods.updateCurrentUser({username:e})}setEmail(e){return this.client.rest.methods.updateCurrentUser({email:e})}setPassword(e){return this.client.rest.methods.updateCurrentUser({password:e})}setAvatar(e){return e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return this.setPresence({game:{name:e,url:t}})}setAFK(e){return this.setPresence({afk:e})}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,i=null){return i?i.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:i,region:t}):this.client.resolver.resolveBuffer(i).then(i=>this.client.rest.methods.createGuild({name:e,icon:i,region:t})):this.client.rest.methods.createGuild({name:e,icon:i,region:t})}setPresence(e){return new Promise(t=>{let i=this.localPresence.status||this.presence.status,r=this.localPresence.game,n=this.localPresence.afk||this.presence.afk;if(!r&&this.presence.game&&(r={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");i=e.status}e.game&&(r=e.game,r.url&&(r.type=1)),"undefined"!=typeof e.afk&&(n=e.afk),n=Boolean(n),this.localPresence={status:i,game:r,afk:n},this.localPresence.since=0,this.localPresence.game=this.localPresence.game||null,this.client.ws.send({op:3,d:this.localPresence}),this.client._setPresence(this.id,this.localPresence),t(this)})}}e.exports=s},function(e,t,i){const r=i(24),n=i(31),s=i(6);class a extends r{constructor(e,t){super(e,t),this.type="dm",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(a,!0),e.exports=a},function(e,t,i){const r=i(24),n=i(31),s=i(6),a=i(63);class o extends r{constructor(e,t){super(e,t),this.type="group",this.messages=new s,this._typing=new Map}setup(e){if(super.setup(e),this.name=e.name,this.icon=e.icon,this.ownerID=e.owner_id,this.recipients||(this.recipients=new s),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;if(t){const t=this.recipients.keyArray(),i=e.recipients.keyArray();return a(t,i)}return t}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(o,!0),e.exports=o},function(e,t,i){const r=i(77),n=i(78),s=i(1);class a{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new r(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new n(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return s.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=a},function(e,t){class i{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=i},function(e,t,i){const r=i(5).EventEmitter,n=i(6);class s extends r{constructor(e,t,i={}){super(),this.channel=e,this.filter=t,this.options=i,this.ended=!1,this.collected=new n,this.listener=(e=>this.verify(e)),this.channel.client.on("message",this.listener),i.time&&this.channel.client.setTimeout(()=>this.stop("time"),i.time)}verify(e){return(!this.channel||this.channel.id===e.channel.id)&&(!!this.filter(e,this)&&(this.collected.set(e.id,e),this.emit("message",e,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const i=()=>{this.removeListener("message",r),this.removeListener("end",n)},r=(...t)=>{i(),e(...t)},n=(...e)=>{i(),t(...e)};this.once("message",r),this.once("end",n)})}stop(e="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,e))}}e.exports=s},function(e,t){class i{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){if(this.title=e.title,this.type=e.type,this.description=e.description,this.url=e.url,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new a(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new r(this,e.thumbnail):null,this.author=e.author?new s(this,e.author):null,this.provider=e.provider?new n(this,e.provider):null,this.footer=e.footer?new o(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class n{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconUrl=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}i.Thumbnail=r,i.Provider=n,i.Author=s,i.Field=a,i.Footer=o,e.exports=i},function(e,t,i){const r=i(6),n=i(25),s=i(48);class a{constructor(e,t,i,n){this.message=e,this.me=n,this.count=i||0,this.users=new r,this._emoji=new s(this,t.name,t.id)}get emoji(){if(this._emoji instanceof n)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message;return e=this.message.client.resolver.resolveUserID(e),e?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,e):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new r;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}return this.count=this.users.size,e})}}e.exports=a},function(e,t){class i{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}e.exports=i},function(e,t){class i{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=i},function(e,t,i){const r=i(1);class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=r.ChannelTypes.text===e.type?"text":"voice"}}e.exports=n},function(e,t){class i{constructor(e,t){this.channel=e,t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.denyData=e.deny,this.allowData=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=i},function(e,t,i){const r=i(32),n=i(31),s=i(6);class a extends r{constructor(e,t){super(e,t),this.type="text",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new s;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(i=>{t.startsWith("data:")?i(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>i(this.client.rest.methods.createWebhook(this,e,t)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(a,!0),e.exports=a},function(e,t,i){const r=i(32),n=i(6);class s extends r{constructor(e,t){super(e,t),this.members=new n,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get joinable(){return this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.voice.joinChannel(this)}leave(){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}e.exports=s},function(e,t,i){const r=i(60),n=i(1).Endpoints.botGateway;e.exports=function(e){return new Promise((t,i)=>{if(!e)throw new Error("A token must be provided.");r.get(n).set("Authorization",`Bot ${e.replace(/^Bot\s*/i,"")}`).end((e,r)=>{e&&i(e),t(r.body.shards)})})}},function(e,t){e.exports=function(e,{maxLength=1950,char="\n",prepend="",append=""}={}){if(e.length<=maxLength)return e;const t=e.split(char);if(1===t.length)throw new Error("Message exceeds the max length and contains no split characters.");const i=[""];let r=0;for(let n=0;nmaxLength&&(i[r]+=append,i.push(prepend),r++),i[r]+=(i[r].length>0&&i[r]!==prepend?char:"")+t[n];return i}},function(e,t,i){function r(e,t){return a.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,void(this.length=e.length)):void this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var s=i(2),a=i(26).Reporter,o=i(0).Buffer;s(r,a),t.DecoderBuffer=r,r.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},r.prototype.restore=function(e){var t=new r(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,a.prototype.restore.call(this,e.reporter),t},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var i=new r(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=n,n.prototype.join=function(e,t){return e||(e=new o(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,t),t+=i.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,i){var r=t;r._reverse=function(e){var t={};return Object.keys(e).forEach(function(i){(0|i)==i&&(i|=0);var r=e[i];t[r]=i}),t},r.der=i(144)},function(e,t,i){function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new n,this.tree._init(e.body)}function n(e){h.Node.call(this,"der",e)}function s(e,t){var i=e.readUInt8(t);if(e.isError(i))return i;var r=l.tagClass[i>>6],n=0===(32&i);if(31===(31&i)){var s=i;for(i=0;128===(128&s);){if(s=e.readUInt8(t),e.isError(s))return s;i<<=7,i|=127&s}}else i&=31;var a=l.tag[i];return{cls:r,primitive:n,tag:i,tagStr:a}}function a(e,t,i){var r=e.readUInt8(i);if(e.isError(r))return r;if(!t&&128===r)return null;if(0===(128&r))return r;var n=127&r;if(n>=4)return e.error("length octect is too long");r=0;for(var s=0;s=31?r.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=l.tagClassByName[i||"universal"]<<6)}var o=i(2),f=i(0).Buffer,h=i(36),c=h.base,l=h.constants.der;e.exports=r,r.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},o(n,c.Node),n.prototype._encodeComposite=function(e,t,i,r){var n=a(e,t,i,this.reporter);if(r.length<128){var s=new f(2);return s[0]=n,s[1]=r.length,this._createEncoderBuffer([s,r])}for(var o=1,h=r.length;h>=256;h>>=8)o++;var s=new f(2+o);s[0]=n,s[1]=128|o;for(var h=1+o,c=r.length;c>0;h--,c>>=8)s[h]=255&c;return this._createEncoderBuffer([s,r])},n.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var i=new f(2*e.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var n=0,r=0;r=128;s>>=7)n++}for(var a=new f(n),o=a.length-1,r=e.length-1;r>=0;r--){var s=e[r];for(a[o--]=127&s;(s>>=7)>0;)a[o--]=128|127&s}return this._createEncoderBuffer(a)},n.prototype._encodeTime=function(e,t){var i,r=new Date(e);return"gentime"===t?i=[s(r.getFullYear()),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[s(r.getFullYear()%100),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},n.prototype._encodeNull=function(){return this._createEncoderBuffer("")},n.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!f.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new f(i)}if(f.isBuffer(e)){var r=e.length;0===e.length&&r++;var n=new f(r);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var r=1,s=e;s>=256;s>>=8)r++;for(var n=new Array(r),s=n.length-1;s>=0;s--)n[s]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new f(n))},n.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},n.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},n.prototype._skipDefault=function(e,t,i){var r,n=this._baseState;if(null===n.default)return!1;var s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r0)&&i.host.split("@");S&&(i.auth=S.shift(),i.host=i.hostname=S.shift())}return i.search=e.search,i.query=e.query,h.isNull(i.pathname)&&h.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!y.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var M=y.slice(-1)[0],T=(i.host||e.host||y.length>1)&&("."===M||".."===M)||""===M,x=0,R=y.length;R>=0;R--)M=y[R],"."===M?y.splice(R,1):".."===M?(y.splice(R,1),x++):x&&(y.splice(R,1),x--);if(!v&&!_)for(;x--;x)y.unshift("..");!v||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),T&&"/"!==y.join("/").substr(-1)&&y.push("");var I=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(A){i.hostname=i.host=I?"":y.length?y.shift():"";var S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");S&&(i.auth=S.shift(),i.host=i.hostname=S.shift())}return v=v||i.host&&y.length,v&&!I&&y.unshift(""),y.length?i.pathname=y.join("/"):(i.pathname=null,i.path=null),h.isNull(i.pathname)&&h.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},r.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(const i in e){const r=e[i],n=t.indexOf(r);n&&t.splice(n,1)}return 0===t.length}},function(e,t){e.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",scripts:{test:"eslint src && node docs/generator test",docs:"node docs/generator","test-docs":"node docs/generator test",lint:"eslint src","web-dist":"node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",dependencies:{superagent:"^3.0.0",tweetnacl:"^0.14.3",ws:"^1.1.1"},peerDependencies:{"node-opus":"^0.2.0",opusscript:"^0.0.1"},devDependencies:{bufferutil:"^1.2.1",eslint:"^3.10.0","jsdoc-to-markdown":"^2.0.0","json-loader":"^0.5.4","parallel-webpack":"^1.5.0","uglify-js":"github:mishoo/UglifyJS2#harmony","utf-8-validate":"^1.2.1",webpack:"2.1.0-beta.27",zlibjs:"github:imaya/zlib.js"},engines:{node:">=6.0.0"}}},function(e,t,i){(function(t){const r=i(12),n=i(17),s=i(135),a=i(136);class o{constructor(e,i,s=[]){this.manager=e,this.id=i,this.env=Object.assign({},t.env,{SHARD_ID:this.id,SHARD_COUNT:this.manager.totalShards,CLIENT_TOKEN:this.manager.token}),this.process=r.fork(n.resolve(this.manager.file),s,{env:this.env}),this.process.on("message",this._handleMessage.bind(this)),this.process.once("exit",()=>{this.manager.respawn&&this.manager.createShard(this.id)}),this._evals=new Map,this._fetches=new Map}send(e){return new Promise((t,i)=>{const r=this.process.send(e,e=>{e?i(e):t(this)});if(!r)throw new Error("Failed to send message to shard's process.")})}fetchClientValue(e){if(this._fetches.has(e))return this._fetches.get(e);const t=new Promise((t,i)=>{const r=i=>{i&&i._fetchProp===e&&(this.process.removeListener("message",r),this._fetches.delete(e),t(i._result))};this.process.on("message",r),this.send({_fetchProp:e}).catch(t=>{this.process.removeListener("message",r),this._fetches.delete(e),i(t)})});return this._fetches.set(e,t),t}eval(e){if(this._evals.has(e))return this._evals.get(e);const t=new Promise((t,i)=>{const r=n=>{n&&n._eval===e&&(this.process.removeListener("message",r),this._evals.delete(e),n._error?i(s(n._error)):t(n._result))};this.process.on("message",r),this.send({_eval:e}).catch(t=>{this.process.removeListener("message",r),this._evals.delete(e),i(t)})});return this._evals.set(e,t),t}_handleMessage(e){if(e){if(e._sFetchProp)return void this.manager.fetchClientValues(e._sFetchProp).then(t=>this.send({_sFetchProp:e._sFetchProp,_result:t}),t=>this.send({_sFetchProp:e._sFetchProp,_error:a(t)}));if(e._sEval)return void this.manager.broadcastEval(e._sEval).then(t=>this.send({_sEval:e._sEval,_result:t}),t=>this.send({_sEval:e._sEval,_error:a(t)}))}this.manager.emit("message",this,e)}}e.exports=o}).call(t,i(8))},function(e,t,i){(function(t){const r=i(135),n=i(136);class s{constructor(e){this.client=e,t.on("message",this._handleMessage.bind(this))}get id(){return this.client.options.shardId}get count(){return this.client.options.shardCount}send(e){return new Promise((i,r)=>{const n=t.send(e,e=>{e?r(e):i()});if(!n)throw new Error("Failed to send message to master process.")})}fetchClientValues(e){return new Promise((i,n)=>{const s=a=>{a&&a._sFetchProp===e&&(t.removeListener("message",s),a._error?n(r(a._error)):i(a._result))};t.on("message",s),this.send({_sFetchProp:e}).catch(e=>{t.removeListener("message",s),n(e)})})}broadcastEval(e){return new Promise((i,n)=>{const s=a=>{a&&a._sEval===e&&(t.removeListener("message",s),a._error?n(r(a._error)):i(a._result))};t.on("message",s),this.send({_sEval:e}).catch(e=>{t.removeListener("message",s),n(e)})})}_handleMessage(e){if(e)if(e._fetchProp){const t=e._fetchProp.split(".");let i=this.client;for(const r of t)i=i[r];this._respond("fetchProp",{_fetchProp:e._fetchProp,_result:i})}else if(e._eval)try{this._respond("eval",{_eval:e._eval,_result:this.client._eval(e._eval)})}catch(t){this._respond("eval",{_eval:e._eval,_error:n(t)})}}_respond(e,t){this.send(t).catch(t=>this.client.emit("error",`Error when sending ${e} response to master process: ${t}`))}static singleton(e){return this._singleton?e.emit("error","Multiple clients created in child process; only the first will handle sharding helpers."):this._singleton=new this(e),this._singleton}}e.exports=s}).call(t,i(8))},function(e,t,i){const r=i(14),n=i(76);class s extends n{setup(e){super.setup(e),this.flags=e.flags,this.owner=new r(this.client,e.owner)}}e.exports=s},function(e,t,i){const r=i(14),n=i(6);class s extends r{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new n,this.blocked=new n,this.notes=new n}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e){return this.client.rest.methods.updateCurrentUser({username:e})}setEmail(e){return this.client.rest.methods.updateCurrentUser({email:e})}setPassword(e){return this.client.rest.methods.updateCurrentUser({password:e})}setAvatar(e){return e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return this.setPresence({game:{name:e,url:t}})}setAFK(e){return this.setPresence({afk:e})}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,i=null){return i?i.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:i,region:t}):this.client.resolver.resolveBuffer(i).then(i=>this.client.rest.methods.createGuild({name:e,icon:i,region:t})):this.client.rest.methods.createGuild({name:e,icon:i,region:t})}setPresence(e){return new Promise(t=>{let i=this.localPresence.status||this.presence.status,r=this.localPresence.game,n=this.localPresence.afk||this.presence.afk;if(!r&&this.presence.game&&(r={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");i=e.status}e.game&&(r=e.game,r.url&&(r.type=1)),"undefined"!=typeof e.afk&&(n=e.afk),n=Boolean(n),this.localPresence={status:i,game:r,afk:n},this.localPresence.since=0,this.localPresence.game=this.localPresence.game||null,this.client.ws.send({op:3,d:this.localPresence}),this.client._setPresence(this.id,this.localPresence),t(this)})}}e.exports=s},function(e,t,i){const r=i(24),n=i(31),s=i(6);class a extends r{constructor(e,t){super(e,t),this.type="dm",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(a,!0),e.exports=a},function(e,t,i){const r=i(24),n=i(31),s=i(6),a=i(63);class o extends r{constructor(e,t){super(e,t),this.type="group",this.messages=new s,this._typing=new Map}setup(e){if(super.setup(e),this.name=e.name,this.icon=e.icon,this.ownerID=e.owner_id,this.recipients||(this.recipients=new s),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;if(t){const t=this.recipients.keyArray(),i=e.recipients.keyArray();return a(t,i)}return t}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(o,!0),e.exports=o},function(e,t,i){const r=i(77),n=i(78),s=i(1);class a{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new r(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new n(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return s.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=a},function(e,t){class i{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=i},function(e,t,i){const r=i(5).EventEmitter,n=i(6);class s extends r{constructor(e,t,i={}){super(),this.channel=e,this.filter=t,this.options=i,this.ended=!1,this.collected=new n,this.listener=(e=>this.verify(e)),this.channel.client.on("message",this.listener),i.time&&this.channel.client.setTimeout(()=>this.stop("time"),i.time)}verify(e){return(!this.channel||this.channel.id===e.channel.id)&&(!!this.filter(e,this)&&(this.collected.set(e.id,e),this.emit("message",e,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const i=()=>{this.removeListener("message",r),this.removeListener("end",n)},r=(...t)=>{i(),e(...t)},n=(...e)=>{i(),t(...e)};this.once("message",r),this.once("end",n)})}stop(e="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,e))}}e.exports=s},function(e,t){class i{constructor(e,t){this.client=e.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=e,this.setup(t)}setup(e){if(this.title=e.title,this.type=e.type,this.description=e.description,this.url=e.url,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new a(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new r(this,e.thumbnail):null,this.author=e.author?new s(this,e.author):null,this.provider=e.provider?new n(this,e.provider):null,this.footer=e.footer?new o(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class n{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconUrl=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}i.Thumbnail=r,i.Provider=n,i.Author=s,i.Field=a,i.Footer=o,e.exports=i},function(e,t,i){const r=i(6),n=i(25),s=i(48);class a{constructor(e,t,i,n){this.message=e,this.me=n,this.count=i||0,this.users=new r,this._emoji=new s(this,t.name,t.id)}get emoji(){if(this._emoji instanceof n)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message;return e=this.message.client.resolver.resolveUserID(e),e?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,e):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new r;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}return this.count=this.users.size,e})}}e.exports=a},function(e,t){class i{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}e.exports=i},function(e,t){class i{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=i},function(e,t,i){const r=i(1);class n{constructor(e,t){this.client=e,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=r.ChannelTypes.text===e.type?"text":"voice"}}e.exports=n},function(e,t){class i{constructor(e,t){this.channel=e,t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.denyData=e.deny,this.allowData=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=i},function(e,t,i){const r=i(32),n=i(31),s=i(6);class a extends r{constructor(e,t){super(e,t),this.type="text",this.messages=new s,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new s;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(i=>{t.startsWith("data:")?i(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>i(this.client.rest.methods.createWebhook(this,e,t)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}n.applyToClass(a,!0),e.exports=a},function(e,t,i){const r=i(32),n=i(6);class s extends r{constructor(e,t){super(e,t),this.members=new n,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get joinable(){return this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.voice.joinChannel(this)}leave(){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}e.exports=s},function(e,t,i){const r=i(60),n=i(1).Endpoints.botGateway;e.exports=function(e){return new Promise((t,i)=>{if(!e)throw new Error("A token must be provided.");r.get(n).set("Authorization",`Bot ${e.replace(/^Bot\s*/i,"")}`).end((e,r)=>{e&&i(e),t(r.body.shards)})})}},function(e,t){e.exports=function(e,{maxLength=1950,char="\n",prepend="",append=""}={}){if(e.length<=maxLength)return e;const t=e.split(char);if(1===t.length)throw new Error("Message exceeds the max length and contains no split characters.");const i=[""];let r=0;for(let n=0;nmaxLength&&(i[r]+=append,i.push(prepend),r++),i[r]+=(i[r].length>0&&i[r]!==prepend?char:"")+t[n];return i}},function(e,t,i){function r(e,t){return a.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,void(this.length=e.length)):void this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}var s=i(2),a=i(26).Reporter,o=i(0).Buffer;s(r,a),t.DecoderBuffer=r,r.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},r.prototype.restore=function(e){var t=new r(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,a.prototype.restore.call(this,e.reporter),t},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var i=new r(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=n,n.prototype.join=function(e,t){return e||(e=new o(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(i){i.join(e,t),t+=i.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,i){var r=t;r._reverse=function(e){var t={};return Object.keys(e).forEach(function(i){(0|i)==i&&(i|=0);var r=e[i];t[r]=i}),t},r.der=i(144)},function(e,t,i){function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new n,this.tree._init(e.body)}function n(e){h.Node.call(this,"der",e)}function s(e,t){var i=e.readUInt8(t);if(e.isError(i))return i;var r=l.tagClass[i>>6],n=0===(32&i);if(31===(31&i)){var s=i;for(i=0;128===(128&s);){if(s=e.readUInt8(t),e.isError(s))return s;i<<=7,i|=127&s}}else i&=31;var a=l.tag[i];return{cls:r,primitive:n,tag:i,tagStr:a}}function a(e,t,i){var r=e.readUInt8(i);if(e.isError(r))return r;if(!t&&128===r)return null;if(0===(128&r))return r;var n=127&r;if(n>=4)return e.error("length octect is too long");r=0;for(var s=0;s=31?r.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=l.tagClassByName[i||"universal"]<<6)}var o=i(2),f=i(0).Buffer,h=i(36),c=h.base,l=h.constants.der;e.exports=r,r.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},o(n,c.Node),n.prototype._encodeComposite=function(e,t,i,r){var n=a(e,t,i,this.reporter);if(r.length<128){var s=new f(2);return s[0]=n,s[1]=r.length,this._createEncoderBuffer([s,r])}for(var o=1,h=r.length;h>=256;h>>=8)o++;var s=new f(2+o);s[0]=n,s[1]=128|o;for(var h=1+o,c=r.length;c>0;h--,c>>=8)s[h]=255&c;return this._createEncoderBuffer([s,r])},n.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var i=new f(2*e.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var n=0,r=0;r=128;s>>=7)n++}for(var a=new f(n),o=a.length-1,r=e.length-1;r>=0;r--){var s=e[r];for(a[o--]=127&s;(s>>=7)>0;)a[o--]=128|127&s}return this._createEncoderBuffer(a)},n.prototype._encodeTime=function(e,t){var i,r=new Date(e);return"gentime"===t?i=[s(r.getFullYear()),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[s(r.getFullYear()%100),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},n.prototype._encodeNull=function(){return this._createEncoderBuffer("")},n.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!f.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new f(i)}if(f.isBuffer(e)){var r=e.length;0===e.length&&r++;var n=new f(r);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var r=1,s=e;s>=256;s>>=8)r++;for(var n=new Array(r),s=n.length-1;s>=0;s--)n[s]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new f(n))},n.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},n.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},n.prototype._skipDefault=function(e,t,i){var r,n=this._baseState;if(null===n.default)return!1;var s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r>o%8,e._prev=r(e._prev,i?s:a);return h}function r(t,i){var r=t.length,n=-1,s=new e(t.length);for(t=e.concat([t,new e([i])]);++n>7;return s}t.encrypt=function(t,r,n){for(var s=r.length,a=new e(s),o=-1;++ot.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+i.chunkSize);if(i.windowBits&&(i.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+i.windowBits);if(i.level&&(i.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+i.level);if(i.memLevel&&(i.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+i.memLevel);if(i.strategy&&i.strategy!=t.Z_FILTERED&&i.strategy!=t.Z_HUFFMAN_ONLY&&i.strategy!=t.Z_RLE&&i.strategy!=t.Z_FIXED&&i.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+i.strategy);if(i.dictionary&&!e.isBuffer(i.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new b.Zlib(r);var n=this;this._hadError=!1,this._binding.onerror=function(e,i){n._binding=null,n._hadError=!0;var r=new Error(e);r.errno=i,r.code=t.codes[i],n.emit("error",r)};var s=t.Z_DEFAULT_COMPRESSION;"number"==typeof i.level&&(s=i.level);var a=t.Z_DEFAULT_STRATEGY;"number"==typeof i.strategy&&(a=i.strategy),this._binding.init(i.windowBits||t.Z_DEFAULT_WINDOWBITS,s,i.memLevel||t.Z_DEFAULT_MEMLEVEL,a,i.dictionary),this._buffer=new e(this._chunkSize),this._offset=0,this._closed=!1,this._level=s,this._strategy=a,this.once("end",this.close)}var p=i(118),b=i(160),m=i(10),w=i(149).ok;b.Z_MIN_WINDOWBITS=8,b.Z_MAX_WINDOWBITS=15,b.Z_DEFAULT_WINDOWBITS=15,b.Z_MIN_CHUNK=64,b.Z_MAX_CHUNK=1/0,b.Z_DEFAULT_CHUNK=16384,b.Z_MIN_MEMLEVEL=1,b.Z_MAX_MEMLEVEL=9,b.Z_DEFAULT_MEMLEVEL=8,b.Z_MIN_LEVEL=-1,b.Z_MAX_LEVEL=9,b.Z_DEFAULT_LEVEL=b.Z_DEFAULT_COMPRESSION,Object.keys(b).forEach(function(e){e.match(/^Z/)&&(t[e]=b[e])}),t.codes={Z_OK:b.Z_OK,Z_STREAM_END:b.Z_STREAM_END,Z_NEED_DICT:b.Z_NEED_DICT,Z_ERRNO:b.Z_ERRNO,Z_STREAM_ERROR:b.Z_STREAM_ERROR,Z_DATA_ERROR:b.Z_DATA_ERROR,Z_MEM_ERROR:b.Z_MEM_ERROR,Z_BUF_ERROR:b.Z_BUF_ERROR,Z_VERSION_ERROR:b.Z_VERSION_ERROR},Object.keys(t.codes).forEach(function(e){t.codes[t.codes[e]]=e}),t.Deflate=a,t.Inflate=o,t.Gzip=f,t.Gunzip=h,t.DeflateRaw=c,t.InflateRaw=l,t.Unzip=u,t.createDeflate=function(e){return new a(e)},t.createInflate=function(e){return new o(e)},t.createDeflateRaw=function(e){return new c(e)},t.createInflateRaw=function(e){return new l(e)},t.createGzip=function(e){return new f(e)},t.createGunzip=function(e){return new h(e)},t.createUnzip=function(e){return new u(e)},t.deflate=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new a(t),e,i)},t.deflateSync=function(e,t){return s(new a(t),e)},t.gzip=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new f(t),e,i)},t.gzipSync=function(e,t){return s(new f(t),e)},t.deflateRaw=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new c(t),e,i)},t.deflateRawSync=function(e,t){return s(new c(t),e)},t.unzip=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new u(t),e,i)},t.unzipSync=function(e,t){return s(new u(t),e)},t.inflate=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new o(t),e,i)},t.inflateSync=function(e,t){return s(new o(t),e)},t.gunzip=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new h(t),e,i)},t.gunzipSync=function(e,t){return s(new h(t),e)},t.inflateRaw=function(e,t,i){return"function"==typeof t&&(i=t,t={}),n(new l(t),e,i)},t.inflateRawSync=function(e,t){return s(new l(t),e)},m.inherits(d,p),d.prototype.params=function(e,i,n){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(i!=t.Z_FILTERED&&i!=t.Z_HUFFMAN_ONLY&&i!=t.Z_RLE&&i!=t.Z_FIXED&&i!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+i);if(this._level!==e||this._strategy!==i){var s=this;this.flush(b.Z_SYNC_FLUSH,function(){s._binding.params(e,i),s._hadError||(s._level=e,s._strategy=i,n&&n())})}else r.nextTick(n)},d.prototype.reset=function(){return this._binding.reset()},d.prototype._flush=function(t){this._transform(new e(0),"",t)},d.prototype.flush=function(t,i){var n=this._writableState;if(("function"==typeof t||void 0===t&&!i)&&(i=t,t=b.Z_FULL_FLUSH),n.ended)i&&r.nextTick(i);else if(n.ending)i&&this.once("end",i);else if(n.needDrain){var s=this;this.once("drain",function(){s.flush(i)})}else this._flushFlag=t,this.write(new e(0),"",i)},d.prototype.close=function(e){if(e&&r.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;r.nextTick(function(){t.emit("close")})}},d.prototype._transform=function(t,i,r){var n,s=this._writableState,a=s.ending||s.ended,o=a&&(!t||s.length===t.length);if(null===!t&&!e.isBuffer(t))return r(new Error("invalid input"));o?n=b.Z_FINISH:(n=this._flushFlag,t.length>=s.length&&(this._flushFlag=this._opts.flush||b.Z_NO_FLUSH));this._processChunk(t,n,r)},d.prototype._processChunk=function(t,i,r){function n(c,d){if(!f._hadError){var p=a-d;if(w(p>=0,"have should not go down"),p>0){var b=f._buffer.slice(f._offset,f._offset+p);f._offset+=p,h?f.push(b):(l.push(b),u+=b.length)}if((0===d||f._offset>=f._chunkSize)&&(a=f._chunkSize,f._offset=0,f._buffer=new e(f._chunkSize)),0===d){if(o+=s-c,s=c,!h)return!0;var m=f._binding.write(i,t,o,s,f._buffer,f._offset,f._chunkSize);return m.callback=n,void(m.buffer=t)}return!!h&&void r()}}var s=t&&t.length,a=this._chunkSize-this._offset,o=0,f=this,h="function"==typeof r;if(!h){var c,l=[],u=0;this.on("error",function(e){c=e});do var d=this._binding.writeSync(i,t,o,s,this._buffer,this._offset,a);while(!this._hadError&&n(d[0],d[1]));if(this._hadError)throw c;var p=e.concat(l,u);return this.close(),p}var b=this._binding.write(i,t,o,s,this._buffer,this._offset,a);b.buffer=t,b.callback=n},m.inherits(a,d),m.inherits(o,d),m.inherits(f,d),m.inherits(h,d),m.inherits(c,d),m.inherits(l,d),m.inherits(u,d)}).call(t,i(0).Buffer,i(8))},function(e,t,i){"use strict";function r(e,t){e[t>>5]|=128<>>9<<4)+14]=t;for(var i=1732584193,r=-271733879,n=-1732584194,c=271733878,l=0;l>16)+(t>>16)+(i>>16);return r<<16|65535&i}function c(e,t){return e<>>32-t}var l=i(165);e.exports=function(e){return l.hash(e,r,16)}},function(e,t,i){(function(t){function r(){this.init(),this._w=d,l.call(this,64,56)}function n(e,t,i){return i^e&(t^i)}function s(e,t,i){return e&t|i&(e|t)}function a(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function o(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function h(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=i(2),l=i(23),u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=new Array(64);c(r,l),r.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},r.prototype._update=function(e){for(var t=this._w,i=0|this._a,r=0|this._b,c=0|this._c,l=0|this._d,d=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,w=0;w<16;++w)t[w]=e.readInt32BE(4*w);for(;w<64;++w)t[w]=h(t[w-2])+t[w-7]+f(t[w-15])+t[w-16]|0;for(var g=0;g<64;++g){var v=m+o(d)+n(d,p,b)+u[g]+t[g]|0,_=a(i)+s(i,r,c)|0;m=b,b=p,p=d,d=l+v|0,l=c,c=r,r=i,i=v+_|0}this._a=i+this._a|0,this._b=r+this._b|0,this._c=c+this._c|0,this._d=l+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},r.prototype._hash=function(){var e=new t(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=r}).call(t,i(0).Buffer)},function(e,t,i){(function(t){function r(){this.init(),this._w=m,p.call(this,128,112)}function n(e,t,i){return i^e&(t^i)}function s(e,t,i){return e&t|i&(e|t)}function a(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function o(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function u(e,t){return e>>>0>>0?1:0}var d=i(2),p=i(23),b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=new Array(160);d(r,p),r.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},r.prototype._update=function(e){for(var t=this._w,i=0|this._ah,r=0|this._bh,d=0|this._ch,p=0|this._dh,m=0|this._eh,w=0|this._fh,g=0|this._gh,v=0|this._hh,_=0|this._al,y=0|this._bl,k=0|this._cl,E=0|this._dl,A=0|this._el,S=0|this._fl,M=0|this._gl,T=0|this._hl,x=0;x<32;x+=2)t[x]=e.readInt32BE(4*x),t[x+1]=e.readInt32BE(4*x+4);for(;x<160;x+=2){var R=t[x-30],I=t[x-30+1],C=f(R,I),P=h(I,R);R=t[x-4],I=t[x-4+1];var O=c(R,I),N=l(I,R),D=t[x-14],L=t[x-14+1],B=t[x-32],U=t[x-32+1],j=P+L|0,F=C+D+u(j,P)|0;j=j+N|0,F=F+O+u(j,N)|0,j=j+U|0,F=F+B+u(j,U)|0,t[x]=F,t[x+1]=j}for(var z=0;z<160;z+=2){F=t[z],j=t[z+1];var q=s(i,r,d),H=s(_,y,k),G=a(i,_),V=a(_,i),W=o(m,A),K=o(A,m),Y=b[z],Z=b[z+1],$=n(m,w,g),X=n(A,S,M),J=T+K|0,Q=v+W+u(J,T)|0;J=J+X|0,Q=Q+$+u(J,X)|0,J=J+Z|0,Q=Q+Y+u(J,Z)|0,J=J+j|0,Q=Q+F+u(J,j)|0;var ee=V+H|0,te=G+q+u(ee,V)|0;v=g,T=M,g=w,M=S,w=m,S=A,A=E+J|0,m=p+Q+u(A,E)|0,p=d,E=k,d=r,k=y,r=i,y=_,_=J+ee|0,i=Q+te+u(_,J)|0}this._al=this._al+_|0,this._bl=this._bl+y|0,this._cl=this._cl+k|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+S|0,this._gl=this._gl+M|0,this._hl=this._hl+T|0,this._ah=this._ah+i+u(this._al,_)|0,this._bh=this._bh+r+u(this._bl,y)|0,this._ch=this._ch+d+u(this._cl,k)|0,this._dh=this._dh+p+u(this._dl,E)|0,this._eh=this._eh+m+u(this._el,A)|0,this._fh=this._fh+w+u(this._fl,S)|0,this._gh=this._gh+g+u(this._gl,M)|0,this._hh=this._hh+v+u(this._hl,T)|0},r.prototype._hash=function(){function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}var i=new t(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},e.exports=r}).call(t,i(0).Buffer)},function(e,t,i){function r(){if(null!==v)return v;var e=1048576,t=[];t[0]=2;for(var i=1,r=3;re;)i.ishrn(1);if(i.isEven()&&i.iadd(u),i.testn(1)||i.iadd(d),t.cmp(d)){if(!t.cmp(p))for(;i.mod(b).cmp(m);)i.iadd(g)}else for(;i.mod(h).cmp(w);)i.iadd(g);if(r=i.shrn(1),n(r)&&n(i)&&s(r)&&s(i)&&l.test(r)&&l.test(i))return i}}var o=i(30);e.exports=a,a.simpleSieve=n,a.fermatTest=s;var f=i(7),h=new f(24),c=i(107),l=new c,u=new f(1),d=new f(2),p=new f(5),b=(new f(16),new f(8),new f(10)),m=new f(3),w=(new f(7),new f(11)),g=new f(4),v=(new f(12),null)},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){function r(e){this.rand=e||new s.Rand}var n=i(7),s=i(90);e.exports=r,r.create=function(e){return new r(e)},r.prototype._rand=function(e){var t=e.bitLength(),i=this.rand.generate(Math.ceil(t/8));i[0]|=3;var r=7&t;return 0!==r&&(i[i.length-1]>>=7-r),new n(i)},r.prototype.test=function(e,t,i){var r=e.bitLength(),s=n.mont(e),a=new n(1).toRed(s);t||(t=Math.max(1,r/48|0));for(var o=e.subn(1),f=o.subn(1),h=0;!o.testn(h);h++);for(var c=e.shrn(h),l=o.toRed(s),u=!0;t>0;t--){var d=this._rand(f);i&&i(d);var p=d.toRed(s).redPow(c);if(0!==p.cmp(a)&&0!==p.cmp(l)){for(var b=1;b0;t--){var l=this._rand(o),u=e.gcd(l);if(0!==u.cmpn(1))return u;var d=l.toRed(r).redPow(h);if(0!==d.cmp(s)&&0!==d.cmp(c)){for(var p=1;p0)throw r.length>1?new Error("options "+r.slice(0,r.length-1).join(", ")+" and "+r[r.length-1]+" must be defined"):new Error("option "+r[0]+" must be defined")}return Object.keys(e).forEach(function(i){i in t&&(t[i]=e[i])}),this},this.copy=function(t){var r={};return Object.keys(e).forEach(function(e){t.indexOf(e)!==-1&&(r[e]=i[e])}),r},this.read=function(e,t){if("function"==typeof t){var i=this;n.readFile(e,function(e,r){if(e)return t(e);var n=JSON.parse(r);i.merge(n),t()})}else{var r=JSON.parse(n.readFileSync(e));this.merge(r)}return this},this.isDefined=function(e){return"undefined"!=typeof i[e]},this.isDefinedAndNonNull=function(e){return"undefined"!=typeof i[e]&&null!==i[e]},Object.freeze(i),Object.freeze(this)}/*! * Copyright(c) 2011 Einar Otto Stangvik * MIT Licensed