From f933ff4d5d2e1a764c97e547d73f73cb9fd243b9 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 23 Nov 2016 00:55:42 +0000 Subject: [PATCH] Webpack build: c4b207766661a3b73a60d5d3d7704124d0ae0ccd --- discord.indev.js | 4 ++-- discord.indev.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/discord.indev.js b/discord.indev.js index 2af4a7b9..4817a35e 100644 --- a/discord.indev.js +++ b/discord.indev.js @@ -8023,8 +8023,8 @@ module.exports = { "description": "A powerful library for interacting with the Discord API", "main": "./src/index", "scripts": { - "test": "eslint src && docgen --source src --custom docs", - "docs": "docgen --source src --custom docs --output docs/docs.json", + "test": "eslint src && docgen --source src --custom docs/index.yml", + "docs": "docgen --source src --custom docs/index.yml --output docs/docs.json", "test-docs": "docgen --source src --custom docs", "lint": "eslint src", "web-dist": "node ./node_modules/parallel-webpack/bin/run.js" diff --git a/discord.indev.min.js b/discord.indev.min.js index b27f5104..c16ad8fc 100644 --- a/discord.indev.min.js +++ b/discord.indev.min.js @@ -7,7 +7,7 @@ ${e} file:t,name:e}))}sendCode(t,e,n={}){return n.split&&("object"!=typeof n.split&&(n.split={}),n.split.prepend||(n.split.prepend=`\`\`\`${t||""} `),n.split.append||(n.split.append="\n```")),e=s(this.client.resolver.resolveString(e),!0),this.sendMessage(`\`\`\`${t||""} ${e} -\`\`\``,n)}edit(t=this.name,e){return e?this.client.resolver.resolveBuffer(e).then(e=>{const n=this.client.resolver.resolveBase64(e);return this.client.rest.methods.editWebhook(this,t,n)}):this.client.rest.methods.editWebhook(this,t).then(t=>{return this.setup(t),this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}t.exports=r},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,u,h,a;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(n=this._events[t],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(r(n))for(u=Array.prototype.slice.call(arguments,1),a=n.slice(),s=a.length,h=0;h0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,u;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(u=o;u-- >0;)if(n[u]===e||n[u].listener&&n[u].listener===e){s=u;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),u=o,h=0;h=300)&&(i=new Error(e.statusText||"Unsuccessful HTTP response"),i.original=t,i.response=e,i.status=e.status)}catch(t){i=t}i?n.callback(i,e):n.callback(null,e)})}function d(t,e){var n=_("DELETE",t);return e&&n.end(e),n}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 m=n(56),g=n(59),E=n(42),_=t.exports=n(60).bind(null,f);_.getXHR=function(){if(!(!p.XMLHttpRequest||p.location&&"file:"==p.location.protocol&&p.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only verison of superagent could not find XHR")};var y="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=s,_.parseString=o,_.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"},_.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},l.prototype.get=function(t){return this.header[t.toLowerCase()]},l.prototype._setHeaderProperties=function(t){var e=this.header["content-type"]||"";this.type=a(e);var n=c(e);for(var i in n)this[i]=n[i]},l.prototype._parseBody=function(t){var e=_.parse[this.type];return!e&&h(this.type)&&(e=_.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null},l.prototype._setStatusProperties=function(t){1223===t&&(t=204);var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.notFound=404==t,this.forbidden=403==t},l.prototype.toError=function(){var t=this.req,e=t.method,n=t.url,i="cannot "+e+" "+n+" ("+this.status+")",s=new Error(i);return s.status=this.status,s.method=e,s.url=n,s},_.Response=l,m(f.prototype),g(f.prototype),f.prototype.type=function(t){return this.set("Content-Type",_.types[t]||t),this},f.prototype.responseType=function(t){return this._responseType=t,this},f.prototype.accept=function(t){return this.set("Accept",_.types[t]||t),this},f.prototype.auth=function(t,e,n){switch(n||(n={type:"basic"}),n.type){case"basic":var i=btoa(t+":"+e);this.set("Authorization","Basic "+i);break;case"auto":this.username=t,this.password=e}return this},f.prototype.query=function(t){return"string"!=typeof t&&(t=s(t)),t&&this._query.push(t),this},f.prototype.attach=function(t,e,n){if(this._data)throw Error("superagent can't mix .send() and .attach()");return this._getFormData().append(t,e,n||e.name),this},f.prototype._getFormData=function(){return this._formData||(this._formData=new p.FormData),this._formData},f.prototype.callback=function(t,e){var n=this._callback;this.clearTimeout(),t&&this.emit("error",t),n(t,e)},f.prototype.crossDomainError=function(){var t=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.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},f.prototype.buffer=f.prototype.ca=f.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},f.prototype.pipe=f.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},f.prototype._timeoutError=function(){var t=this._timeout,e=new Error("timeout of "+t+"ms exceeded");e.timeout=t,this.callback(e)},f.prototype._appendQueryString=function(){var t=this._query.join("&");t&&(this.url+=~this.url.indexOf("?")?"&"+t:"?"+t)},f.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},f.prototype.end=function(t){var e=this,n=this.xhr=_.getXHR(),s=this._timeout,r=this._formData||this._data;this._callback=t||i,n.onreadystatechange=function(){if(4==n.readyState){var t;try{t=n.status}catch(e){t=0}if(0==t){if(e.timedout)return e._timeoutError();if(e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=o.bind(null,"download"),n.upload&&(n.upload.onprogress=o.bind(null,"upload"))}catch(t){}if(s&&!this._timer&&(this._timer=setTimeout(function(){e.timedout=!0,e.abort()},s)),this._appendQueryString(),this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var u=this._header["content-type"],a=this._serializer||_.serialize[u?u.split(";")[0]:""];!a&&h(u)&&(a=_.serialize["application/json"]),a&&(r=a(r))}for(var c in this.header)null!=this.header[c]&&n.setRequestHeader(c,this.header[c]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof r?r:null),this},_.Request=f,_.get=function(t,e,n){var i=_("GET",t);return"function"==typeof e&&(n=e,e=null),e&&i.query(e),n&&i.end(n),i},_.head=function(t,e,n){var i=_("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.options=function(t,e,n){var i=_("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.del=d,_.delete=d,_.patch=function(t,e,n){var i=_("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.post=function(t,e,n){var i=_("POST",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.put=function(t,e,n){var i=_("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i}},function(t,e){t.exports=function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n in t){const i=t[n],s=e.indexOf(i);s&&e.splice(s,1)}return 0===e.length}},function(t,e){t.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 && docgen --source src --custom docs",docs:"docgen --source src --custom docs --output docs/docs.json","test-docs":"docgen --source src --custom docs",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","discord.js-docgen":"github:Gawdl3y/discord.js-docgen",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:"^0.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,opusscript:!1,"node-opus":!1,"tweet-nacl":!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/player/BasePlayer.js":!1,"src/client/voice/player/DefaultPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){const i=n(5),s=n(35);class r extends s{setup(t){super.setup(t),this.flags=t.flags,this.owner=new i(this.client,t.owner)}}t.exports=r},function(t,e,n){const i=n(5),s=n(3);class r extends i{setup(t){super.setup(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s}edit(t){return this.client.rest.methods.updateCurrentUser(t)}setUsername(t){return this.client.rest.methods.updateCurrentUser({username:t})}setEmail(t){return this.client.rest.methods.updateCurrentUser({email:t})}setPassword(t){return this.client.rest.methods.updateCurrentUser({password:t})}setAvatar(t){return t.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:t}):this.client.resolver.resolveBuffer(t).then(t=>this.client.rest.methods.updateCurrentUser({avatar:t}))}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return this.setPresence({game:{name:t,url:e}})}setAFK(t){return this.setPresence({afk:t})}addFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.addFriend(t)}removeFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.removeFriend(t)}createGuild(t,e,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:t,icon:n,region:e}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:t,icon:n,region:e})):this.client.rest.methods.createGuild({name:t,icon:n,region:e})}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,s=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),t.status){if("string"!=typeof t.status)throw new TypeError("Status must be a string");n=t.status}t.game&&(i=t.game,i.url&&(i.type=1)),"undefined"!=typeof t.afk&&(s=t.afk),s=Boolean(s),this.localPresence={status:n,game:i,afk:s},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),e(this)})}}t.exports=r},function(t,e,n){const i=n(8),s=n(10),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.recipient=this.client.dataManager.newUser(t.recipients[0]),this.lastMessageID=t.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(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(8),s=n(10),r=n(3),o=n(24);class u extends i{constructor(t,e){super(t,e),this.type="group",this.messages=new r,this._typing=new Map}setup(t){if(super.setup(t),this.name=t.name,this.icon=t.icon,this.ownerID=t.owner_id,this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.dataManager.newUser(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID;if(e){const e=this.recipients.keyArray(),n=t.recipients.keyArray();return o(e,n)}return e}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(u,!0),t.exports=u},function(t,e,n){const i=n(36),s=n(37),r=n(0);class o{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.dataManager.newUser(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.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 r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}t.exports=o},function(t,e){class n{constructor(t,e){this.client=t.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(21).EventEmitter,s=n(3);class r extends i{constructor(t,e,n={}){super(),this.channel=t,this.filter=e,this.options=n,this.ended=!1,this.collected=new s,this.listener=(t=>this.verify(t)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(t){return(!this.channel||this.channel.id===t.channel.id)&&(!!this.filter(t,this)&&(this.collected.set(t.id,t),this.emit("message",t,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((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",s)},i=(...e)=>{n(),t(...e)},s=(...t)=>{n(),e(...t)};this.once("message",i),this.once("end",s)})}stop(t="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,t))}}t.exports=r},function(t,e){class n{constructor(t,e){this.client=t.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=t,this.setup(e)}setup(t){if(this.title=t.title,this.type=t.type,this.description=t.description,this.url=t.url,this.fields=[],t.fields)for(const e of t.fields)this.fields.push(new o(this,e));this.createdTimestamp=t.timestamp,this.thumbnail=t.thumbnail?new i(this,t.thumbnail):null,this.author=t.author?new r(this,t.author):null,this.provider=t.provider?new s(this,t.provider):null,this.footer=t.footer?new u(this,t.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class i{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}class s{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class r{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class o{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.value=t.value,this.inline=t.inline}}class u{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.text=t.text,this.iconUrl=t.icon_url,this.proxyIconUrl=t.proxy_icon_url}}n.Thumbnail=i,n.Provider=s,n.Author=r,n.Field=o,n.Footer=u,t.exports=n},function(t,e,n){const i=n(3),s=n(9),r=n(19);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message;return t=this.message.client.resolver.resolveUserID(t),t?e.client.rest.methods.removeMessageReaction(e,this.emoji.identifier,t):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(t=100){const e=this.message;return e.client.rest.methods.getMessageReactionUsers(e,this.emoji.identifier,t).then(t=>{this.users=new i;for(const e of t){const t=this.message.client.dataManager.newUser(e);this.users.set(t.id,t)}return this.count=this.users.size,t})}}t.exports=o},function(t,e){class n{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=t.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}t.exports=n},function(t,e){class n{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=n},function(t,e,n){const i=n(0);class s{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.text===t.type?"text":"voice"}}t.exports=s},function(t,e){class n{constructor(t,e){this.channel=t,e&&this.setup(e)}setup(t){this.id=t.id,this.type=t.type,this.denyData=t.deny,this.allowData=t.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}t.exports=n},function(t,e,n){const i=n(11),s=n(10),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new r;for(const e of this.guild.members.values())this.permissionsFor(e).hasPermission("READ_MESSAGES")&&t.set(e.id,e);return t}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(t,e){return new Promise(n=>{e.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,t,e)):this.client.resolver.resolveBuffer(e).then(e=>n(this.client.rest.methods.createWebhook(this,t,e)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(11),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}setup(t){super.setup(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get joinable(){return!this.client.browser&&this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){t.exports=function(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}},function(t,e){function n(t){return null!==t&&"object"==typeof t}t.exports=n},function(t,e){},function(t,e,n){(function(e){const i=n(22),s=n(43),r=n(23),o=n(0),u=n(47),h=n(5),a=n(13),c=n(18),l=n(8),f=n(12),d=n(9),p=n(19);class m{constructor(t){this.client=t}resolveUser(t){return t instanceof h?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof f?t.user:t instanceof a?t.author:t instanceof c?t.owner:null}resolveUserID(t){return t instanceof h||t instanceof f?t.id:"string"==typeof t?t||null:t instanceof a?t.author.id:t instanceof c?t.ownerID:null}resolveGuild(t){return t instanceof c?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof f?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:t instanceof a?t.channel:t instanceof c?t.channels.get(t.id)||null:"string"==typeof t?this.client.channels.get(t)||null:null}resolveInviteCode(t){const e=/discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolvePermission(t){if("string"==typeof t&&(t=o.PermissionFlags[t]),"number"!=typeof t||t<1)throw new Error(o.Errors.NOT_A_PERMISSION);return t}resolveString(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(u(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t)){const i=r.get(t).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((t,i)=>{return t?o(t):this.client.browser?n(u(i.xhr.response)):i.body instanceof e?n(i.body):o(new TypeError("Body is not a Buffer"))})}else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t&&o(t),!i||!i.isFile())throw new Error(`The file could not be found: ${e}`);s.readFile(e,(t,e)=>{t?o(t):n(e)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(t){return t instanceof d||t instanceof p?t.identifier:"string"!=typeof t||t.includes("%")?null:encodeURIComponent(t)}}t.exports=m}).call(e,n(15).Buffer)},function(t,e,n){const i=n(96),s=n(93),r=n(95),o=n(94),u=n(92),h=n(0);class a{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(h.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(t,e,n,i,s){const r=new u(this,t,e,n,i,s);if(!this.handlers[r.route]){const t=this.getRequestHandler();this.handlers[r.route]=new t(this,r.route)}return this.push(this.handlers[r.route],r)}}t.exports=a},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}}t.exports=n},function(t,e,n){(function(e){function n(t){const n=new e(t.byteLength),i=new Uint8Array(t);for(var s=0;s{const n=this.client.resolver.resolveBase64(e);return this.client.rest.methods.editWebhook(this,t,n)}):this.client.rest.methods.editWebhook(this,t).then(t=>{return this.setup(t),this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}t.exports=r},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function s(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!s(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,u,h,a;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(n=this._events[t],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(r(n))for(u=Array.prototype.slice.call(arguments,1),a=n.slice(),s=a.length,h=0;h0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,u;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(u=o;u-- >0;)if(n[u]===e||n[u].listener&&n[u].listener===e){s=u;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),u=o,h=0;h=300)&&(i=new Error(e.statusText||"Unsuccessful HTTP response"),i.original=t,i.response=e,i.status=e.status)}catch(t){i=t}i?n.callback(i,e):n.callback(null,e)})}function d(t,e){var n=_("DELETE",t);return e&&n.end(e),n}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 m=n(56),g=n(59),E=n(42),_=t.exports=n(60).bind(null,f);_.getXHR=function(){if(!(!p.XMLHttpRequest||p.location&&"file:"==p.location.protocol&&p.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only verison of superagent could not find XHR")};var y="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=s,_.parseString=o,_.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"},_.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},l.prototype.get=function(t){return this.header[t.toLowerCase()]},l.prototype._setHeaderProperties=function(t){var e=this.header["content-type"]||"";this.type=a(e);var n=c(e);for(var i in n)this[i]=n[i]},l.prototype._parseBody=function(t){var e=_.parse[this.type];return!e&&h(this.type)&&(e=_.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null},l.prototype._setStatusProperties=function(t){1223===t&&(t=204);var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.notFound=404==t,this.forbidden=403==t},l.prototype.toError=function(){var t=this.req,e=t.method,n=t.url,i="cannot "+e+" "+n+" ("+this.status+")",s=new Error(i);return s.status=this.status,s.method=e,s.url=n,s},_.Response=l,m(f.prototype),g(f.prototype),f.prototype.type=function(t){return this.set("Content-Type",_.types[t]||t),this},f.prototype.responseType=function(t){return this._responseType=t,this},f.prototype.accept=function(t){return this.set("Accept",_.types[t]||t),this},f.prototype.auth=function(t,e,n){switch(n||(n={type:"basic"}),n.type){case"basic":var i=btoa(t+":"+e);this.set("Authorization","Basic "+i);break;case"auto":this.username=t,this.password=e}return this},f.prototype.query=function(t){return"string"!=typeof t&&(t=s(t)),t&&this._query.push(t),this},f.prototype.attach=function(t,e,n){if(this._data)throw Error("superagent can't mix .send() and .attach()");return this._getFormData().append(t,e,n||e.name),this},f.prototype._getFormData=function(){return this._formData||(this._formData=new p.FormData),this._formData},f.prototype.callback=function(t,e){var n=this._callback;this.clearTimeout(),t&&this.emit("error",t),n(t,e)},f.prototype.crossDomainError=function(){var t=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.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},f.prototype.buffer=f.prototype.ca=f.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},f.prototype.pipe=f.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},f.prototype._timeoutError=function(){var t=this._timeout,e=new Error("timeout of "+t+"ms exceeded");e.timeout=t,this.callback(e)},f.prototype._appendQueryString=function(){var t=this._query.join("&");t&&(this.url+=~this.url.indexOf("?")?"&"+t:"?"+t)},f.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},f.prototype.end=function(t){var e=this,n=this.xhr=_.getXHR(),s=this._timeout,r=this._formData||this._data;this._callback=t||i,n.onreadystatechange=function(){if(4==n.readyState){var t;try{t=n.status}catch(e){t=0}if(0==t){if(e.timedout)return e._timeoutError();if(e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=o.bind(null,"download"),n.upload&&(n.upload.onprogress=o.bind(null,"upload"))}catch(t){}if(s&&!this._timer&&(this._timer=setTimeout(function(){e.timedout=!0,e.abort()},s)),this._appendQueryString(),this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var u=this._header["content-type"],a=this._serializer||_.serialize[u?u.split(";")[0]:""];!a&&h(u)&&(a=_.serialize["application/json"]),a&&(r=a(r))}for(var c in this.header)null!=this.header[c]&&n.setRequestHeader(c,this.header[c]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof r?r:null),this},_.Request=f,_.get=function(t,e,n){var i=_("GET",t);return"function"==typeof e&&(n=e,e=null),e&&i.query(e),n&&i.end(n),i},_.head=function(t,e,n){var i=_("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.options=function(t,e,n){var i=_("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.del=d,_.delete=d,_.patch=function(t,e,n){var i=_("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.post=function(t,e,n){var i=_("POST",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},_.put=function(t,e,n){var i=_("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i}},function(t,e){t.exports=function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(const n in t){const i=t[n],s=e.indexOf(i);s&&e.splice(s,1)}return 0===e.length}},function(t,e){t.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 && docgen --source src --custom docs/index.yml",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","test-docs":"docgen --source src --custom docs",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","discord.js-docgen":"github:Gawdl3y/discord.js-docgen",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:"^0.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,opusscript:!1,"node-opus":!1,"tweet-nacl":!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/player/BasePlayer.js":!1,"src/client/voice/player/DefaultPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){const i=n(5),s=n(35);class r extends s{setup(t){super.setup(t),this.flags=t.flags,this.owner=new i(this.client,t.owner)}}t.exports=r},function(t,e,n){const i=n(5),s=n(3);class r extends i{setup(t){super.setup(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s}edit(t){return this.client.rest.methods.updateCurrentUser(t)}setUsername(t){return this.client.rest.methods.updateCurrentUser({username:t})}setEmail(t){return this.client.rest.methods.updateCurrentUser({email:t})}setPassword(t){return this.client.rest.methods.updateCurrentUser({password:t})}setAvatar(t){return t.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:t}):this.client.resolver.resolveBuffer(t).then(t=>this.client.rest.methods.updateCurrentUser({avatar:t}))}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return this.setPresence({game:{name:t,url:e}})}setAFK(t){return this.setPresence({afk:t})}addFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.addFriend(t)}removeFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.removeFriend(t)}createGuild(t,e,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:t,icon:n,region:e}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:t,icon:n,region:e})):this.client.rest.methods.createGuild({name:t,icon:n,region:e})}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,s=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),t.status){if("string"!=typeof t.status)throw new TypeError("Status must be a string");n=t.status}t.game&&(i=t.game,i.url&&(i.type=1)),"undefined"!=typeof t.afk&&(s=t.afk),s=Boolean(s),this.localPresence={status:n,game:i,afk:s},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),e(this)})}}t.exports=r},function(t,e,n){const i=n(8),s=n(10),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.recipient=this.client.dataManager.newUser(t.recipients[0]),this.lastMessageID=t.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(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(8),s=n(10),r=n(3),o=n(24);class u extends i{constructor(t,e){super(t,e),this.type="group",this.messages=new r,this._typing=new Map}setup(t){if(super.setup(t),this.name=t.name,this.icon=t.icon,this.ownerID=t.owner_id,this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.dataManager.newUser(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID;if(e){const e=this.recipients.keyArray(),n=t.recipients.keyArray();return o(e,n)}return e}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(u,!0),t.exports=u},function(t,e,n){const i=n(36),s=n(37),r=n(0);class o{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.dataManager.newUser(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.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 r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}t.exports=o},function(t,e){class n{constructor(t,e){this.client=t.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(21).EventEmitter,s=n(3);class r extends i{constructor(t,e,n={}){super(),this.channel=t,this.filter=e,this.options=n,this.ended=!1,this.collected=new s,this.listener=(t=>this.verify(t)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(t){return(!this.channel||this.channel.id===t.channel.id)&&(!!this.filter(t,this)&&(this.collected.set(t.id,t),this.emit("message",t,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((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",s)},i=(...e)=>{n(),t(...e)},s=(...t)=>{n(),e(...t)};this.once("message",i),this.once("end",s)})}stop(t="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,t))}}t.exports=r},function(t,e){class n{constructor(t,e){this.client=t.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.message=t,this.setup(e)}setup(t){if(this.title=t.title,this.type=t.type,this.description=t.description,this.url=t.url,this.fields=[],t.fields)for(const e of t.fields)this.fields.push(new o(this,e));this.createdTimestamp=t.timestamp,this.thumbnail=t.thumbnail?new i(this,t.thumbnail):null,this.author=t.author?new r(this,t.author):null,this.provider=t.provider?new s(this,t.provider):null,this.footer=t.footer?new u(this,t.footer):null}get createdAt(){return new Date(this.createdTimestamp)}}class i{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}class s{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class r{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class o{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.value=t.value,this.inline=t.inline}}class u{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.text=t.text,this.iconUrl=t.icon_url,this.proxyIconUrl=t.proxy_icon_url}}n.Thumbnail=i,n.Provider=s,n.Author=r,n.Field=o,n.Footer=u,t.exports=n},function(t,e,n){const i=n(3),s=n(9),r=n(19);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message;return t=this.message.client.resolver.resolveUserID(t),t?e.client.rest.methods.removeMessageReaction(e,this.emoji.identifier,t):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(t=100){const e=this.message;return e.client.rest.methods.getMessageReactionUsers(e,this.emoji.identifier,t).then(t=>{this.users=new i;for(const e of t){const t=this.message.client.dataManager.newUser(e);this.users.set(t.id,t)}return this.count=this.users.size,t})}}t.exports=o},function(t,e){class n{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=t.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}t.exports=n},function(t,e){class n{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=n},function(t,e,n){const i=n(0);class s{constructor(t,e){this.client=t,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.text===t.type?"text":"voice"}}t.exports=s},function(t,e){class n{constructor(t,e){this.channel=t,e&&this.setup(e)}setup(t){this.id=t.id,this.type=t.type,this.denyData=t.deny,this.allowData=t.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}t.exports=n},function(t,e,n){const i=n(11),s=n(10),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new r;for(const e of this.guild.members.values())this.permissionsFor(e).hasPermission("READ_MESSAGES")&&t.set(e.id,e);return t}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(t,e){return new Promise(n=>{e.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,t,e)):this.client.resolver.resolveBuffer(e).then(e=>n(this.client.rest.methods.createWebhook(this,t,e)))})}sendMessage(){}sendTTSMessage(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(11),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}setup(t){super.setup(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get joinable(){return!this.client.browser&&this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){t.exports=function(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}},function(t,e){function n(t){return null!==t&&"object"==typeof t}t.exports=n},function(t,e){},function(t,e,n){(function(e){const i=n(22),s=n(43),r=n(23),o=n(0),u=n(47),h=n(5),a=n(13),c=n(18),l=n(8),f=n(12),d=n(9),p=n(19);class m{constructor(t){this.client=t}resolveUser(t){return t instanceof h?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof f?t.user:t instanceof a?t.author:t instanceof c?t.owner:null}resolveUserID(t){return t instanceof h||t instanceof f?t.id:"string"==typeof t?t||null:t instanceof a?t.author.id:t instanceof c?t.ownerID:null}resolveGuild(t){return t instanceof c?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof f?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:t instanceof a?t.channel:t instanceof c?t.channels.get(t.id)||null:"string"==typeof t?this.client.channels.get(t)||null:null}resolveInviteCode(t){const e=/discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolvePermission(t){if("string"==typeof t&&(t=o.PermissionFlags[t]),"number"!=typeof t||t<1)throw new Error(o.Errors.NOT_A_PERMISSION);return t}resolveString(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(u(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t)){const i=r.get(t).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((t,i)=>{return t?o(t):this.client.browser?n(u(i.xhr.response)):i.body instanceof e?n(i.body):o(new TypeError("Body is not a Buffer"))})}else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t&&o(t),!i||!i.isFile())throw new Error(`The file could not be found: ${e}`);s.readFile(e,(t,e)=>{t?o(t):n(e)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(t){return t instanceof d||t instanceof p?t.identifier:"string"!=typeof t||t.includes("%")?null:encodeURIComponent(t)}}t.exports=m}).call(e,n(15).Buffer)},function(t,e,n){const i=n(96),s=n(93),r=n(95),o=n(94),u=n(92),h=n(0);class a{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(h.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(t,e,n,i,s){const r=new u(this,t,e,n,i,s);if(!this.handlers[r.route]){const t=this.getRequestHandler();this.handlers[r.route]=new t(this,r.route)}return this.push(this.handlers[r.route],r)}}t.exports=a},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}}t.exports=n},function(t,e,n){(function(e){function n(t){const n=new e(t.byteLength),i=new Uint8Array(t);for(var s=0;s0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const t=new Collection;for(const e of this.guilds.values())for(const n of e.emojis.values())t.set(n.id,n);return t}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"undefined"!=typeof window}login(t,e=null){return e?this.rest.methods.loginEmailPassword(t,e):this.rest.methods.loginToken(t)}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.token=null,this.email=null,this.password=null,this.manager.destroy()}syncGuilds(t=this.guilds){this.user.bot||this.ws.send({op:12,d:t instanceof Collection?t.keyArray():t.map(t=>t.id)})}fetchUser(t){return this.users.has(t)?Promise.resolve(this.users.get(t)):this.rest.methods.getUser(t)}fetchInvite(t){const e=this.resolver.resolveInviteCode(t);return this.rest.methods.getInvite(e)}fetchWebhook(t,e){return this.rest.methods.getWebhook(t,e)}sweepMessages(t=this.options.messageCacheLifetime){if("number"!=typeof t||isNaN(t))throw new TypeError("The lifetime must be a number.");if(t<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const e=1e3*t,n=Date.now();let i=0,s=0;for(const r of this.channels.values())if(r.messages){i++;for(const t of r.messages.values())n-(t.editedTimestamp||t.createdTimestamp)>e&&(r.messages.delete(t.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${t} seconds in ${i} text-based channels`),s}fetchApplication(){if(!this.user.bot)throw new Error(Constants.Errors.NO_BOT_ACCOUNT);return this.rest.methods.getMyApplication()}setTimeout(t,e,...n){const i=setTimeout(()=>{t(),this._timeouts.delete(i)},e,...n);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}_setPresence(t,e){return this.presences.get(t)?void this.presences.get(t).update(e):void this.presences.set(t,new Presence(e))}_eval(script){return eval(script)}_validateOptions(t=this.options){if("number"!=typeof t.shardCount||isNaN(t.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof t.shardId||isNaN(t.shardId))throw new TypeError("The shardId option must be a number.");if(t.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(t.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==t.shardId&&t.shardId>=t.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof t.messageCacheMaxSize||isNaN(t.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof t.messageCacheLifetime||isNaN(t.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof t.messageSweepInterval||isNaN(t.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof t.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof t.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof t.restWsBridgeTimeout||isNaN(t.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(t.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(16))},function(t,e,n){const i=n(20),s=n(45),r=n(44),o=n(48),u=n(0);class h extends i{constructor(t,e,n){super(null,t,e),this.options=o(u.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this)}}t.exports=h},function(t,e,n){const i=n(23),s=n(0).Endpoints.botGateway;t.exports=function(t){return new Promise((e,n)=>{if(!t)throw new Error("A token must be provided.");i.get(s).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&n(t),e(i.body.shards)})})}},function(t,e){},function(t,e){},function(t,e){},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function s(t){var e,i,s,r,o,u,h=t.length;o=n(t),u=new c(3*h/4-o),s=o>0?h-4:h;var l=0;for(e=0,i=0;e>16&255,u[l++]=r>>8&255,u[l++]=255&r;return 2===o?(r=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,u[l++]=255&r):1===o&&(r=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,u[l++]=r>>8&255,u[l++]=255&r),u}function r(t){return h[t>>18&63]+h[t>>12&63]+h[t>>6&63]+h[63&t]}function o(t,e,n){for(var i,s=[],o=e;oc?c:a+u));return 1===i?(e=t[n-1],s+=h[e>>2],s+=h[e<<4&63],s+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],s+=h[e>>10],s+=h[e>>4&63],s+=h[e<<2&63],s+="="),r.push(s),r.join("")}e.byteLength=i,e.toByteArray=s,e.fromByteArray=u;for(var h=[],a=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=l.length;f>1,c=-7,l=n?s-1:0,f=n?-1:1,d=t[e+l];for(l+=f,r=d&(1<<-c)-1,d>>=-c,c+=u;c>0;r=256*r+t[e+l],l+=f,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=i;c>0;o=256*o+t[e+l],l+=f,c-=8);if(0===r)r=1-a;else{if(r===h)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,i),r-=a}return(d?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,u,h,a=8*r-s-1,c=(1<>1,f=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),e+=o+l>=1?f/h:f*Math.pow(2,1-l),e*h>=2&&(o++,h/=2),o+l>=c?(u=0,o=c):o+l>=1?(u=(e*h-1)*Math.pow(2,s),o+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,s),o=0));s>=8;t[n+d]=255&u,d+=p,u/=256,s-=8);for(o=o<0;t[n+d]=255&o,d+=p,o/=256,a-=8);t[n+d-p]|=128*m}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){function i(t){if(t)return s(t)}function s(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}var r=n(42);t.exports=i,i.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){return this._timeout=t,this},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var n=this;this._fullfilledPromise=new Promise(function(t,e){n.end(function(n,i){n?e(n):t(i)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(r(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(r(t)){for(var n in t)this.field(n,t[n]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype.withCredentials=function(){return this._withCredentials=!0,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=r(t),n=this._header["content-type"];if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&r(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(n||this.type("json"),this)}},function(t,e){function n(t,e,n){return"function"==typeof n?new t("GET",e).end(n):2==arguments.length?new t("GET",e):new t(e,n)}t.exports=n},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(t,n){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function(){"use strict";function i(t){throw t}function s(t,e){this.index="number"==typeof e?e:0,this.m=0,this.buffer=t instanceof(O?Uint8Array:Array)?t:new(O?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&i(Error("invalid index")),this.buffer.length<=this.index&&this.f()}function r(t,e,n){var i,s="number"==typeof e?e:e=0,r="number"==typeof n?n:t.length;for(i=-1,s=7&r;s--;++e)i=i>>>8^V[255&(i^t[e])];for(s=r>>3;s--;e+=8)i=i>>>8^V[255&(i^t[e])],i=i>>>8^V[255&(i^t[e+1])],i=i>>>8^V[255&(i^t[e+2])],i=i>>>8^V[255&(i^t[e+3])],i=i>>>8^V[255&(i^t[e+4])],i=i>>>8^V[255&(i^t[e+5])],i=i>>>8^V[255&(i^t[e+6])],i=i>>>8^V[255&(i^t[e+7])];return(4294967295^i)>>>0}function o(){}function u(t){this.buffer=new(O?Uint16Array:Array)(2*t),this.length=0}function h(t){var e,n,i,s,r,o,u,h,a,c,l=t.length,f=0,d=Number.POSITIVE_INFINITY;for(h=0;hf&&(f=t[h]),t[h]>=1;for(c=i<<16|h,a=o;a>16&255,r[o++]=n>>24;var u;switch(N){case 1===s:u=[0,s-1,0];break;case 2===s:u=[1,s-2,0];break;case 3===s:u=[2,s-3,0];break;case 4===s:u=[3,s-4,0];break;case 6>=s:u=[4,s-5,1];break;case 8>=s:u=[5,s-7,1];break;case 12>=s:u=[6,s-9,2];break;case 16>=s:u=[7,s-13,2];break;case 24>=s:u=[8,s-17,3];break;case 32>=s:u=[9,s-25,3];break;case 48>=s:u=[10,s-33,4];break;case 64>=s:u=[11,s-49,4];break;case 96>=s:u=[12,s-65,5];break;case 128>=s:u=[13,s-97,5];break;case 192>=s:u=[14,s-129,6];break;case 256>=s:u=[15,s-193,6];break;case 384>=s:u=[16,s-257,7];break;case 512>=s:u=[17,s-385,7];break;case 768>=s:u=[18,s-513,8];break;case 1024>=s:u=[19,s-769,8];break;case 1536>=s:u=[20,s-1025,9];break;case 2048>=s:u=[21,s-1537,9];break;case 3072>=s:u=[22,s-2049,10];break;case 4096>=s:u=[23,s-3073,10];break;case 6144>=s:u=[24,s-4097,11];break;case 8192>=s:u=[25,s-6145,11];break;case 12288>=s:u=[26,s-8193,12];break;case 16384>=s:u=[27,s-12289,12];break;case 24576>=s:u=[28,s-16385,13];break;case 32768>=s:u=[29,s-24577,13];break;default:i("invalid distance")}n=u,r[o++]=n[0],r[o++]=n[1],r[o++]=n[2];var h,a;for(h=0,a=r.length;h=o;)_[o++]=0;for(o=0;29>=o;)y[o++]=0}for(_[256]=1,s=0,r=e.length;s=r){for(l&&n(l,-1),o=0,u=r-s;or&&e+ra&&(s=i,a=r),258===r)break}return new c(a,e-s)}function d(t,e){var n,i,s,r,o,h=t.length,a=new u(572),c=new(O?Uint8Array:Array)(h);if(!O)for(r=0;r2*a[r-1]+c[r]&&(a[r]=2*a[r-1]+c[r]),f[r]=Array(a[r]),d[r]=Array(a[r]);for(s=0;st[s]?(f[r][o]=u,d[r][o]=e,h+=2):(f[r][o]=t[s],d[r][o]=s,++s);p[r]=0,1===c[r]&&i(r)}return l}function m(t){var e,n,i,s,r=new(O?Uint16Array:Array)(t.length),o=[],u=[],h=0;for(e=0,n=t.length;e>>=1;return r}function g(t,e){this.input=t,this.b=this.c=0,this.g={},e&&(e.flags&&(this.g=e.flags),"string"==typeof e.filename&&(this.filename=e.filename),"string"==typeof e.comment&&(this.w=e.comment),e.deflateOptions&&(this.l=e.deflateOptions)),this.l||(this.l={})}function E(t,e){switch(this.o=[],this.p=32768,this.e=this.j=this.c=this.s=0,this.input=O?new Uint8Array(t):t,this.u=!1,this.q=nt,this.L=!1,!e&&(e={})||(e.index&&(this.c=e.index),e.bufferSize&&(this.p=e.bufferSize),e.bufferType&&(this.q=e.bufferType),e.resize&&(this.L=e.resize)),this.q){case et:this.b=32768,this.a=new(O?Uint8Array:Array)(32768+this.p+258);break;case nt:this.b=0,this.a=new(O?Uint8Array:Array)(this.p),this.f=this.T,this.z=this.P,this.r=this.R;break;default:i(Error("invalid inflate mode"))}}function _(t,e){for(var n,s=t.j,r=t.e,o=t.input,u=t.c,h=o.length;r=h&&i(Error("input buffer is broken")),s|=o[u++]<>>e,t.e=r-e,t.c=u,n}function y(t,e){for(var n,i,s=t.j,r=t.e,o=t.input,u=t.c,h=o.length,a=e[0],c=e[1];r=h);)s|=o[u++]<>>16,t.j=s>>i,t.e=r-i,t.c=u,65535&n}function v(t){function e(t,e,n){var i,s,r,o=this.I;for(r=0;r>>0;t=i}for(var s,r=1,o=0,u=t.length,h=0;0>>0}function A(t,e){var n,s;switch(this.input=t,this.c=0,!e&&(e={})||(e.index&&(this.c=e.index),e.verify&&(this.W=e.verify)),n=t[this.c++],s=t[this.c++],15&n){case wt:this.method=wt;break;default:i(Error("unsupported compression method"))}0!==((n<<8)+s)%31&&i(Error("invalid fcheck flag:"+((n<<8)+s)%31)),32&s&&i(Error("fdict flag is not supported")),this.K=new E(t,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}function T(t,e){this.input=t,this.a=new(O?Uint8Array:Array)(32768),this.k=bt.t;var n,i={};!e&&(e={})||"number"!=typeof e.compressionType||(this.k=e.compressionType);for(n in e)i[n]=e[n];i.outputBuffer=this.a,this.J=new a(this.input,i)}function R(e,n,i){t.nextTick(function(){var t,s;try{s=M(e,i)}catch(e){t=e}n(t,s)})}function M(t,e){var n;return n=new T(t).h(),e||(e={}),e.H?n:L(n)}function D(e,n,i){t.nextTick(function(){var t,s;try{s=S(e,i)}catch(e){t=e}n(t,s)})}function S(t,e){var n;return t.subarray=t.slice,n=new A(t).i(),e||(e={}),e.noBuffer?n:L(n)}function I(e,n,i){t.nextTick(function(){var t,s;try{s=C(e,i)}catch(e){t=e}n(t,s)})}function C(t,e){var n;return t.subarray=t.slice,n=new g(t).h(),e||(e={}),e.H?n:L(n)}function k(e,n,i){t.nextTick(function(){var t,s;try{s=U(e,i)}catch(e){t=e}n(t,s)})}function U(t,e){var n;return t.subarray=t.slice,n=new w(t).i(),e||(e={}),e.H?n:L(n)}function L(t){var e,i,s=new n(t.length);for(e=0,i=t.length;e>>8&255]<<16|W[t>>>16&255]<<8|W[t>>>24&255])>>32-e:W[t]>>8-e),8>e+o)u=u<>e-i-1&1,8===++o&&(o=0,s[r++]=W[u],u=0,r===s.length&&(s=this.f()));s[r]=u,this.buffer=s,this.m=o,this.index=r},s.prototype.finish=function(){var t,e=this.buffer,n=this.index;return 0x;++x){for(var B=x,j=B,q=7,B=B>>>1;B;B>>>=1)j<<=1,j|=1&B,--q;G[x]=(j<>>0}var W=G,H=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],V=O?new Uint32Array(H):H;u.prototype.getParent=function(t){return 2*((t-2)/4|0)},u.prototype.push=function(t,e){var n,i,s,r=this.buffer;for(n=this.length,r[this.length++]=e,r[this.length++]=t;0r[i]);)s=r[n],r[n]=r[i],r[i]=s,s=r[n+1],r[n+1]=r[i+1],r[i+1]=s,n=i;return this.length},u.prototype.pop=function(){var t,e,n,i,s,r=this.buffer;for(e=r[0],t=r[1],this.length-=2,r[0]=r[this.length],r[1]=r[this.length+1],s=0;(i=2*s+2,!(i>=this.length))&&(i+2r[i]&&(i+=2),r[i]>r[s]);)n=r[s],r[s]=r[i],r[i]=n,n=r[s+1],r[s+1]=r[i+1],r[i+1]=n,s=i;return{index:t,value:e,length:this.length}};var Y,F=2,z={NONE:0,M:1,t:F,Y:3},K=[];for(Y=0;288>Y;Y++)switch(N){case 143>=Y:K.push([Y+48,8]);break;case 255>=Y:K.push([Y-144+400,9]);break;case 279>=Y:K.push([Y-256+0,7]);break;case 287>=Y:K.push([Y-280+192,8]);break;default:i("invalid literal: "+Y)}a.prototype.h=function(){var t,e,n,r,o=this.input;switch(this.k){case 0:for(n=0,r=o.length;n>>8&255,E[_++]=255&f,E[_++]=f>>>8&255,O)E.set(u,_),_+=u.length,E=E.subarray(0,_);else{for(p=0,g=u.length;p$)for(;0<$--;)nt[X++]=0,it[0]++;else for(;0<$;)Q=138>$?$:138,Q>$-3&&Q<$&&(Q=$-3),10>=Q?(nt[X++]=17,nt[X++]=Q-3,it[17]++):(nt[X++]=18,nt[X++]=Q-11,it[18]++),$-=Q;else if(nt[X++]=et[Y],it[et[Y]]++,$--,3>$)for(;0<$--;)nt[X++]=et[Y],it[et[Y]]++;else for(;0<$;)Q=6>$?$:6,Q>$-3&&Q<$&&(Q=$-3),nt[X++]=16,nt[X++]=Q-3,it[16]++,$-=Q}for(t=O?nt.subarray(0,X):nt.slice(0,X),L=d(it,7),j=0;19>j;j++)V[j]=L[H[j]];for(S=19;4=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:i("invalid length: "+t)}}var e,n,s=[];for(e=3;258>=e;e++)n=t(e),s[e]=n[2]<<24|n[1]<<16|n[0];return s}(),J=O?new Uint32Array($):$;g.prototype.h=function(){var t,e,n,i,s,o,u,h,c=new(O?Uint8Array:Array)(32768),l=0,f=this.input,d=this.c,p=this.filename,m=this.w;if(c[l++]=31,c[l++]=139,c[l++]=8,t=0,this.g.fname&&(t|=Z),this.g.fcomment&&(t|=tt),this.g.fhcrc&&(t|=Q),c[l++]=t,e=(Date.now?Date.now():+new Date)/1e3|0,c[l++]=255&e,c[l++]=e>>>8&255,c[l++]=e>>>16&255,c[l++]=e>>>24&255,c[l++]=0,c[l++]=X,this.g.fname!==P){for(u=0,h=p.length;u>>8&255),c[l++]=255&o;c[l++]=0}if(this.g.comment){for(u=0,h=m.length;u>>8&255),c[l++]=255&o;c[l++]=0}return this.g.fhcrc&&(n=65535&r(c,0,l),c[l++]=255&n,c[l++]=n>>>8&255),this.l.outputBuffer=c,this.l.outputIndex=l,s=new a(f,this.l),c=s.h(),l=s.b,O&&(l+8>c.buffer.byteLength?(this.a=new Uint8Array(l+8),this.a.set(new Uint8Array(c.buffer)),c=this.a):c=new Uint8Array(c.buffer)),i=r(f,P,P),c[l++]=255&i,c[l++]=i>>>8&255,c[l++]=i>>>16&255,c[l++]=i>>>24&255,h=f.length,c[l++]=255&h,c[l++]=h>>>8&255,c[l++]=h>>>16&255,c[l++]=h>>>24&255,this.c=d,O&&l>>=1){case 0:var e=this.input,n=this.c,s=this.a,r=this.b,o=e.length,u=P,h=P,a=s.length,c=P;switch(this.e=this.j=0,n+1>=o&&i(Error("invalid uncompressed block header: LEN")),u=e[n++]|e[n++]<<8,n+1>=o&&i(Error("invalid uncompressed block header: NLEN")),h=e[n++]|e[n++]<<8,u===~h&&i(Error("invalid uncompressed block header: length verify")),n+u>e.length&&i(Error("input buffer is broken")),this.q){case et:for(;r+u>s.length;){if(c=a-r,u-=c,O)s.set(e.subarray(n,n+c),r),r+=c,n+=c;else for(;c--;)s[r++]=e[n++];this.b=r,s=this.f(),r=this.b}break;case nt:for(;r+u>s.length;)s=this.f({B:2});break;default:i(Error("invalid inflate mode"))}if(O)s.set(e.subarray(n,n+u),r),r+=u,n+=u;else for(;u--;)s[r++]=e[n++];this.c=n,this.b=r,this.a=s;break;case 1:this.r(_t,vt);break;case 2:v(this);break;default:i(Error("unknown BTYPE: "+t))}}return this.z()};var it,st,rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ot=O?new Uint16Array(rt):rt,ut=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],ht=O?new Uint16Array(ut):ut,at=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],ct=O?new Uint8Array(at):at,lt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ft=O?new Uint16Array(lt):lt,dt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],pt=O?new Uint8Array(dt):dt,mt=new(O?Uint8Array:Array)(288);for(it=0,st=mt.length;it=it?8:255>=it?9:279>=it?7:8;var gt,Et,_t=h(mt),yt=new(O?Uint8Array:Array)(30);for(gt=0,Et=yt.length;gts)i>=h&&(this.b=i,n=this.f(),i=this.b),n[i++]=s;else for(r=s-257,u=ht[r],0=h&&(this.b=i,n=this.f(),i=this.b);u--;)n[i]=n[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},E.prototype.R=function(t,e){var n=this.a,i=this.b;this.A=t;for(var s,r,o,u,h=n.length;256!==(s=y(this,t));)if(256>s)i>=h&&(n=this.f(),h=n.length),n[i++]=s;else for(r=s-257,u=ht[r],0h&&(n=this.f(),h=n.length);u--;)n[i]=n[i++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=i},E.prototype.f=function(){var t,e,n=new(O?Uint8Array:Array)(this.b-32768),i=this.b-32768,s=this.a;if(O)n.set(s.subarray(32768,n.length));else for(t=0,e=n.length;tt;++t)s[t]=s[i+t];return this.b=32768,s},E.prototype.T=function(t){var e,n,i,s,r=this.input.length/this.c+1|0,o=this.input,u=this.a;return t&&("number"==typeof t.B&&(r=t.B),"number"==typeof t.N&&(r+=t.N)),2>r?(n=(o.length-this.c)/this.A[2],s=258*(n/2)|0,i=se&&(this.a.length=e),t=this.a),this.buffer=t},w.prototype.i=function(){for(var t=this.input.length;this.c>>0,r(u,P,P)!==d&&i(Error("invalid CRC-32 checksum: 0x"+r(u,P,P).toString(16)+" / 0x"+d.toString(16))),e.$=n=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0,(4294967295&u.length)!==n&&i(Error("invalid input size: "+(4294967295&u.length)+" / "+n)),this.G.push(e),this.c=m}this.S=N;var g,_,y,v=this.G,w=0,b=0;for(g=0,_=v.length;g<_;++g)b+=v[g].data.length;if(O)for(y=new Uint8Array(b),g=0;g<_;++g)y.set(v[g].data,w),w+=v[g].data.length;else{for(y=[],g=0;g<_;++g)y[g]=v[g].data;y=Array.prototype.concat.apply([],y)}return y},A.prototype.i=function(){var t,e,n=this.input;return t=this.K.i(),this.c=this.K.c,this.W&&(e=(n[this.c++]<<24|n[this.c++]<<16|n[this.c++]<<8|n[this.c++])>>>0,e!==b(t)&&i(Error("invalid adler-32 checksum"))),t};var wt=8,bt=z;T.prototype.h=function(){var t,e,n,s,r,o,u,h=0;switch(u=this.a,t=wt){case wt:e=Math.LOG2E*Math.log(32768)-8;break;default:i(Error("invalid compression method"))}switch(n=e<<4|t,u[h++]=n,t){case wt:switch(this.k){case bt.NONE:r=0;break;case bt.M:r=1;break;case bt.t:r=2;break;default:i(Error("unsupported compression type"))}break;default:i(Error("invalid compression method"))}return s=r<<6|0,u[h++]=s|31-(256*n+s)%31,o=b(this.input),this.J.b=h,u=this.J.h(),h=u.length,O&&(u=new Uint8Array(u.buffer),u.length<=h+4&&(this.a=new Uint8Array(u.length+4),this.a.set(u),u=this.a),u=u.subarray(0,h+4)),u[h++]=o>>24&255,u[h++]=o>>16&255,u[h++]=o>>8&255,u[h++]=255&o,u},e.deflate=R,e.deflateSync=M,e.inflate=D,e.inflateSync=S,e.gzip=I,e.gzipSync=C,e.gunzip=k,e.gunzipSync=U}).call(this)}).call(e,n(16),n(15).Buffer)},function(t,e,n){const i=n(0),s=n(4),r=n(18),o=n(5),u=n(28),h=n(9),a=n(39),c=n(40),l=n(11),f=n(29);class d{constructor(t){this.client=t}get pastReady(){return this.client.ws.status===i.Status.READY}newGuild(t){const e=this.client.guilds.has(t.id),n=new r(this.client,t);return this.client.guilds.set(n.id,n),this.pastReady&&!e&&(this.client.options.fetchAllMembers?n.fetchMembers().then(()=>{this.client.emit(i.Events.GUILD_CREATE,n)}):this.client.emit(i.Events.GUILD_CREATE,n)),n}newUser(t){if(this.client.users.has(t.id))return this.client.users.get(t.id);const e=new o(this.client,t);return this.client.users.set(e.id,e),e}newChannel(t,e){const n=this.client.channels.has(t.id);let s;return t.type===i.ChannelTypes.DM?s=new u(this.client,t):t.type===i.ChannelTypes.groupDM?s=new f(this.client,t):(e=e||this.client.guilds.get(t.guild_id),e&&(t.type===i.ChannelTypes.text?(s=new a(e,t),e.channels.set(s.id,s)):t.type===i.ChannelTypes.voice&&(s=new c(e,t),e.channels.set(s.id,s)))),s?(this.pastReady&&!n&&this.client.emit(i.Events.CHANNEL_CREATE,s),this.client.channels.set(s.id,s),s):null}newEmoji(t,e){const n=e.emojis.has(t.id);if(t&&!n){let n=new h(e,t);return this.client.emit(i.Events.EMOJI_CREATE,n),e.emojis.set(n.id,n),n}return n?e.emojis.get(t.id):null}killEmoji(t){t instanceof h&&t.guild&&(this.client.emit(i.Events.EMOJI_DELETE,t),t.guild.emojis.delete(t.id))}killGuild(t){const e=this.client.guilds.has(t.id);this.client.guilds.delete(t.id),e&&this.pastReady&&this.client.emit(i.Events.GUILD_DELETE,t)}killUser(t){this.client.users.delete(t.id)}killChannel(t){this.client.channels.delete(t.id),t instanceof l&&t.guild.channels.delete(t.id)}updateGuild(t,e){const n=s(t);t.setup(e),this.pastReady&&this.client.emit(i.Events.GUILD_UPDATE,n,t)}updateChannel(t,e){t.setup(e)}updateEmoji(t,e){const n=s(t);t.setup(e),this.client.emit(i.Events.GUILD_EMOJI_UPDATE,n,t)}}t.exports=d},function(t,e,n){const i=n(0);class s{constructor(t){this.client=t,this.heartbeatInterval=null}connectToWebSocket(t,e,n){this.client.emit(i.Events.DEBUG,`Authenticated using token ${t}`),this.client.token=t;const s=this.client.setTimeout(()=>n(new Error(i.Errors.TOOK_TOO_LONG)),3e5);this.client.rest.methods.getGateway().then(r=>{this.client.emit(i.Events.DEBUG,`Using gateway ${r}`),this.client.ws.connect(r),this.client.ws.once("close",t=>{4004===t.code&&n(new Error(i.Errors.BAD_LOGIN)),4010===t.code&&n(new Error(i.Errors.INVALID_SHARD))}),this.client.once(i.Events.READY,()=>{e(t),this.client.clearTimeout(s)})},n)}setupKeepAlive(t){this.heartbeatInterval=this.client.setInterval(()=>{this.client.emit("debug","Sending heartbeat"),this.client.ws.send({op:i.OPCodes.HEARTBEAT,d:this.client.ws.sequence},!0)},t)}destroy(){return new Promise(t=>{this.client.ws.destroy(),this.client.user.bot?t():t(this.client.rest.methods.logout())})}}t.exports=s},function(t,e,n){class i{constructor(t){this.client=t,this.register(n(82)),this.register(n(83)),this.register(n(84)),this.register(n(88)),this.register(n(85)),this.register(n(86)),this.register(n(87)),this.register(n(66)),this.register(n(67)),this.register(n(68)),this.register(n(70)),this.register(n(81)),this.register(n(74)),this.register(n(75)),this.register(n(69)),this.register(n(76)),this.register(n(77)),this.register(n(78)),this.register(n(89)),this.register(n(91)),this.register(n(90)),this.register(n(80)),this.register(n(71)),this.register(n(72)),this.register(n(73)),this.register(n(79))}register(t){this[t.name.replace(/Action$/,"")]=new t(this.client)}}t.exports=i},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newChannel(t);return{channel:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.channels.get(t.id);return n?(e.dataManager.killChannel(n),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(t.id)||null,{channel:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id),i=e.dataManager.newUser(t.user);n&&i&&e.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.guilds.get(t.id);if(n){if(n.available&&t.unavailable)return n.available=!1,e.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};e.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(t.id)||null;return{guild:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=this.client,i=n.dataManager.newEmoji(t,e);return{emoji:i}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client;return e.dataManager.killEmoji(t),{data:t}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=this.client;for(let i of t.emojis){const t=e.emojis.has(i.id);t?n.dataManager.updateEmoji(e.emojis.get(i.id),i):i=n.dataManager.newEmoji(i,e)}for(let i of e.emojis)t.emoijs.has(i.id)||n.dataManager.killEmoji(i);return{emojis:t.emojis}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=t._addMember(e,!1);return{member:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.members.get(t.user.id);return i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+t.user.id,i),e.status===s.Status.READY&&e.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,t.user.id)):i=this.deleted.get(n.id+t.user.id)||null,{guild:n,member:i}}return{guild:n,member:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(7);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=n.roles.has(t.role.id),o=new r(n,t.role);return n.roles.set(o.id,o),i||e.emit(s.Events.GUILD_ROLE_CREATE,o),{role:o}}return{role:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.roles.get(t.role_id);return i?(n.roles.delete(t.role_id),this.deleted.set(n.id+t.role_id,i),this.scheduleForDeletion(n.id,t.role_id),e.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+t.role_id)||null,{role:i}}return{role:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=t.role;let o=null;const u=n.roles.get(i.id);return u&&(o=r(u),u.setup(t.role),e.emit(s.Events.GUILD_ROLE_UPDATE,o,u)),{old:o,updated:u}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const i of t.roles){const t=n.roles.get(i.id);t&&(t.position=i.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){t.presences=t.presences||[];for(const e of t.presences)n._setPresence(e.user.id,e);t.members=t.members||[];for(const i of t.members){const t=n.members.get(i.user.id);t?n._updateMember(t,i):n._addMember(i)}}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(13);class r extends i{handle(t){const e=this.client,n=e.channels.get((t instanceof Array?t[0]:t).channel_id);if(n){if(t instanceof Array){const i=new Array(t.length);for(let r=0;rthis.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id),i=t.ids,o=new s;for(const u of i){const t=n.messages.get(u);t&&o.set(t.id,t)}return o.size>0&&e.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._addReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._removeReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.channels.get(t.channel_id);if(!e||"voice"===e.type)return!1;const n=e.messages.get(t.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id);if(n){const i=n.messages.get(t.id);if(i){const n=r(i);return i.patch(t),i._edits.unshift(n),e.emit(s.Events.MESSAGE_UPDATE,n,i),{old:n,updated:i}}return{old:i,updated:i}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newUser(t);return{user:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.user.notes.get(t.id),i=t.note.length?t.note:null;return e.user.notes.set(t.id,i),e.emit(s.Events.USER_NOTE_UPDATE,t.id,n,i),{old:n,updated:i}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client;if(e.user){if(e.user.equals(t))return{old:e.user,updated:e.user};const n=r(e.user);return e.user.patch(t),e.emit(s.Events.USER_UPDATE,n,e.user),{old:n,updated:e.user}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){function i(t){let e=t.split("?")[0];if(e.includes("/channels/")||e.includes("/guilds/")){const t=~e.indexOf("/channels/")?e.indexOf("/channels/"):e.indexOf("/guilds/"),n=e.substring(t).split("/")[2];e=e.replace(/(\d{8,})/g,":id").replace(":id",n)}return e}const s=n(23),r=n(0);class o{constructor(t,e,n,s,r,o){this.rest=t,this.method=e,this.url=n,this.auth=s,this.data=r,this.file=o,this.route=i(this.url)}getAuth(){if(this.rest.client.token&&this.rest.client.user&&this.rest.client.user.bot)return`Bot ${this.rest.client.token}`;if(this.rest.client.token)return this.rest.client.token;throw new Error(r.Errors.NO_TOKEN)}gen(){const t=s[this.method](this.url);if(this.auth&&t.set("authorization",this.getAuth()),this.file&&this.file.file){t.attach("file",this.file.file,this.file.name),this.data=this.data||{};for(const e in this.data)this.data[e]&&t.field(e,this.data[e])}else this.data&&t.send(this.data);return t.set("User-Agent",this.rest.userAgentManager.userAgent),t}}t.exports=o},function(t,e,n){const i=n(0),s=n(3),r=n(41),o=n(134),u=n(5),h=n(12),a=n(7),c=n(30),l=n(20),f=n(133),d=n(26);class p{constructor(t){this.rest=t}loginToken(t=this.rest.client.token){return new Promise((e,n)=>{t=t.replace(/^Bot\s*/i,""),this.rest.client.manager.connectToWebSocket(t,e,n)})}loginEmailPassword(t,e){return this.rest.client.emit("warn","Client launched using email and password - should use token instead"),this.rest.client.email=t,this.rest.client.password=e,this.rest.makeRequest("post",i.Endpoints.login,!1,{email:t,password:e}).then(t=>this.loginToken(t.token))}logout(){return this.rest.makeRequest("post",i.Endpoints.logout,!0,{})}getGateway(){return this.rest.makeRequest("get",i.Endpoints.gateway,!0).then(t=>{return this.rest.client.ws.gateway=`${t.url}/?encoding=json&v=${i.PROTOCOL_VERSION}`,this.rest.client.ws.gateway})}getBotGateway(){return this.rest.makeRequest("get",i.Endpoints.botGateway,!0)}sendMessage(t,e,{tts,nonce,embed,disableEveryone,split}={},n=null){return new Promise((i,s)=>{"undefined"!=typeof e&&(e=this.rest.client.resolver.resolveString(e)),e&&((disableEveryone||"undefined"==typeof disableEveryone&&this.rest.client.options.disableEveryone)&&(e=e.replace(/@(everyone|here)/g,"@​$1")),split&&(e=r(e,"object"==typeof split?split:{}))),t instanceof u||t instanceof h?this.createDM(t).then(t=>{this._sendMessageRequest(t,e,n,tts,nonce,embed,i,s)},s):this._sendMessageRequest(t,e,n,tts,nonce,embed,i,s)})}_sendMessageRequest(t,e,n,s,r,o,u,h){if(e instanceof Array){const a=[];let c=this.rest.makeRequest("post",i.Endpoints.channelMessages(t.id),!0,{content:e[0],tts:s,nonce:r},n).catch(h);for(let l=1;l<=e.length;l++)if(l{return a.push(h),this.rest.makeRequest("post",i.Endpoints.channelMessages(t.id),!0,{content:e[u],tts:s,nonce:r,embed:o},n)},h)}else c.then(t=>{a.push(t),u(this.rest.client.actions.MessageCreate.handle(a).messages)},h)}else this.rest.makeRequest("post",i.Endpoints.channelMessages(t.id),!0,{content:e,tts:s,nonce:r,embed:o},n).then(t=>u(this.rest.client.actions.MessageCreate.handle(t).message),h)}deleteMessage(t){return this.rest.makeRequest("del",i.Endpoints.channelMessage(t.channel.id,t.id),!0).then(()=>this.rest.client.actions.MessageDelete.handle({id:t.id,channel_id:t.channel.id}).message)}bulkDeleteMessages(t,e){return this.rest.makeRequest("post",`${i.Endpoints.channelMessages(t.id)}/bulk_delete`,!0,{messages:e}).then(()=>this.rest.client.actions.MessageDeleteBulk.handle({channel_id:t.id,ids:e}).messages)}updateMessage(t,e,{embed}={}){return e=this.rest.client.resolver.resolveString(e),this.rest.makeRequest("patch",i.Endpoints.channelMessage(t.channel.id,t.id),!0,{content:e,embed:embed}).then(t=>this.rest.client.actions.MessageUpdate.handle(t).updated)}createChannel(t,e,n){return this.rest.makeRequest("post",i.Endpoints.guildChannels(t.id),!0,{name:e,type:n}).then(t=>this.rest.client.actions.ChannelCreate.handle(t).channel)}createDM(t){const e=this.getExistingDM(t);return e?Promise.resolve(e):this.rest.makeRequest("post",i.Endpoints.userChannels(this.rest.client.user.id),!0,{recipient_id:t.id}).then(t=>this.rest.client.actions.ChannelCreate.handle(t).channel)}getExistingDM(t){return this.rest.client.channels.find(e=>e.recipient&&e.recipient.id===t.id)}deleteChannel(t){return(t instanceof u||t instanceof h)&&(t=this.getExistingDM(t)),t?this.rest.makeRequest("del",i.Endpoints.channel(t.id),!0).then(e=>{return e.id=t.id,this.rest.client.actions.ChannelDelete.handle(e).channel}):Promise.reject(new Error("No channel to delete."))}updateChannel(t,e){const n={};return n.name=(e.name||t.name).trim(),n.topic=e.topic||t.topic,n.position=e.position||t.position,n.bitrate=e.bitrate||t.bitrate,n.user_limit=e.userLimit||t.userLimit,this.rest.makeRequest("patch",i.Endpoints.channel(t.id),!0,n).then(t=>this.rest.client.actions.ChannelUpdate.handle(t).updated)}leaveGuild(t){return t.ownerID===this.rest.client.user.id?Promise.reject(new Error("Guild is owned by the client.")):this.rest.makeRequest("del",i.Endpoints.meGuild(t.id),!0).then(()=>this.rest.client.actions.GuildDelete.handle({id:t.id}).guild)}createGuild(t){return t.icon=this.rest.client.resolver.resolveBase64(t.icon)||null,t.region=t.region||"us-central",new Promise((e,n)=>{this.rest.makeRequest("post",i.Endpoints.guilds,!0,t).then(t=>{if(this.rest.client.guilds.has(t.id))return void e(this.rest.client.guilds.get(t.id));const i=n=>{n.id===t.id&&(this.rest.client.removeListener("guildCreate",i),this.rest.client.clearTimeout(s),e(n))};this.rest.client.on("guildCreate",i);const s=this.rest.client.setTimeout(()=>{this.rest.client.removeListener("guildCreate",i),n(new Error("Took too long to receive guild data."))},1e4)},n)})}deleteGuild(t){return this.rest.makeRequest("del",i.Endpoints.guild(t.id),!0).then(()=>this.rest.client.actions.GuildDelete.handle({id:t.id}).guild)}getUser(t){return this.rest.makeRequest("get",i.Endpoints.user(t),!0).then(t=>this.rest.client.actions.UserGet.handle(t).user)}updateCurrentUser(t){const e=this.rest.client.user,n={};return n.username=t.username||e.username,n.avatar=this.rest.client.resolver.resolveBase64(t.avatar)||e.avatar,e.bot||(n.email=t.email||e.email,n.password=this.rest.client.password,t.new_password&&(n.new_password=t.newPassword)),this.rest.makeRequest("patch",i.Endpoints.me,!0,n).then(t=>this.rest.client.actions.UserUpdate.handle(t).updated)}updateGuild(t,e){const n={};return e.name&&(n.name=e.name),e.region&&(n.region=e.region),e.verificationLevel&&(n.verification_level=Number(e.verificationLevel)),e.afkChannel&&(n.afk_channel_id=this.rest.client.resolver.resolveChannel(e.afkChannel).id),e.afkTimeout&&(n.afk_timeout=Number(e.afkTimeout)),e.icon&&(n.icon=this.rest.client.resolver.resolveBase64(e.icon)),e.owner&&(n.owner_id=this.rest.client.resolver.resolveUser(e.owner).id),e.splash&&(n.splash=this.rest.client.resolver.resolveBase64(e.splash)),this.rest.makeRequest("patch",i.Endpoints.guild(t.id),!0,n).then(t=>this.rest.client.actions.GuildUpdate.handle(t).updated)}kickGuildMember(t,e){return this.rest.makeRequest("del",i.Endpoints.guildMember(t.id,e.id),!0).then(()=>this.rest.client.actions.GuildMemberRemove.handle({guild_id:t.id,user:e.user}).member)}createGuildRole(t){return this.rest.makeRequest("post",i.Endpoints.guildRoles(t.id),!0).then(e=>this.rest.client.actions.GuildRoleCreate.handle({guild_id:t.id,role:e}).role)}deleteGuildRole(t){return this.rest.makeRequest("del",i.Endpoints.guildRole(t.guild.id,t.id),!0).then(()=>this.rest.client.actions.GuildRoleDelete.handle({guild_id:t.guild.id,role_id:t.id}).role)}setChannelOverwrite(t,e){return this.rest.makeRequest("put",`${i.Endpoints.channelPermissions(t.id)}/${e.id}`,!0,e)}deletePermissionOverwrites(t){return this.rest.makeRequest("del",`${i.Endpoints.channelPermissions(t.channel.id)}/${t.id}`,!0).then(()=>t)}getChannelMessages(t,e={}){const n=[];e.limit&&n.push(`limit=${e.limit}`),e.around?n.push(`around=${e.around}`):e.before?n.push(`before=${e.before}`):e.after&&n.push(`after=${e.after}`);let s=i.Endpoints.channelMessages(t.id);return n.length>0&&(s+=`?${n.join("&")}`),this.rest.makeRequest("get",s,!0)}getChannelMessage(t,e){const n=t.messages.get(e);return n?Promise.resolve(n):this.rest.makeRequest("get",i.Endpoints.channelMessage(t.id,e),!0)}getGuildMember(t,e){return this.rest.makeRequest("get",i.Endpoints.guildMember(t.id,e.id),!0).then(e=>this.rest.client.actions.GuildMemberGet.handle(t,e).member)}updateGuildMember(t,e){e.channel&&(e.channel_id=this.rest.client.resolver.resolveChannel(e.channel).id),e.roles&&(e.roles=e.roles.map(t=>t instanceof a?t.id:t));let n=i.Endpoints.guildMember(t.guild.id,t.id);if(t.id===this.rest.client.user.id){const s=Object.keys(e);1===s.length&&"nick"===s[0]&&(n=i.Endpoints.stupidInconsistentGuildEndpoint(t.guild.id))}return this.rest.makeRequest("patch",n,!0,e).then(e=>t.guild._updateMember(t,e).mem)}sendTyping(t){return this.rest.makeRequest("post",`${i.Endpoints.channel(t)}/typing`,!0)}banGuildMember(t,e,n=0){const s=this.rest.client.resolver.resolveUserID(e);return s?this.rest.makeRequest("put",`${i.Endpoints.guildBans(t.id)}/${s}?delete-message-days=${n}`,!0,{"delete-message-days":n}).then(()=>{if(e instanceof h)return e;const n=this.rest.client.resolver.resolveUser(s);return n?(e=this.rest.client.resolver.resolveGuildMember(t,n),e||n):s}):Promise.reject(new Error("Couldn't resolve the user ID to ban."))}unbanGuildMember(t,e){return new Promise((n,s)=>{const r=this.rest.client.resolver.resolveUserID(e);if(!r)throw new Error("Couldn't resolve the user ID to unban.");const o=(e,s)=>{e.id===t.id&&s.id===r&&(this.rest.client.removeListener(i.Events.GUILD_BAN_REMOVE,o),this.rest.client.clearTimeout(u),n(s))};this.rest.client.on(i.Events.GUILD_BAN_REMOVE,o);const u=this.rest.client.setTimeout(()=>{this.rest.client.removeListener(i.Events.GUILD_BAN_REMOVE,o),s(new Error("Took too long to receive the ban remove event."))},1e4);this.rest.makeRequest("del",`${i.Endpoints.guildBans(t.id)}/${r}`,!0).catch(t=>{this.rest.client.removeListener(i.Events.GUILD_BAN_REMOVE,o),this.rest.client.clearTimeout(u),s(t)})})}getGuildBans(t){return this.rest.makeRequest("get",i.Endpoints.guildBans(t.id),!0).then(t=>{const e=new s;for(const n of t){const t=this.rest.client.dataManager.newUser(n.user);e.set(t.id,t)}return e})}updateGuildRole(t,e){const n={};if(n.name=e.name||t.name,n.position="undefined"!=typeof e.position?e.position:t.position,n.color=e.color||t.color,"string"==typeof n.color&&n.color.startsWith("#")&&(n.color=parseInt(n.color.replace("#",""),16)),n.hoist="undefined"!=typeof e.hoist?e.hoist:t.hoist,n.mentionable="undefined"!=typeof e.mentionable?e.mentionable:t.mentionable,e.permissions){let t=0;for(let s of e.permissions)"string"==typeof s&&(s=i.PermissionFlags[s]),t|=s;n.permissions=t}else n.permissions=t.permissions;return this.rest.makeRequest("patch",i.Endpoints.guildRole(t.guild.id,t.id),!0,n).then(e=>this.rest.client.actions.GuildRoleUpdate.handle({role:e,guild_id:t.guild.id}).updated)}pinMessage(t){return this.rest.makeRequest("put",`${i.Endpoints.channel(t.channel.id)}/pins/${t.id}`,!0).then(()=>t)}unpinMessage(t){return this.rest.makeRequest("del",`${i.Endpoints.channel(t.channel.id)}/pins/${t.id}`,!0).then(()=>t)}getChannelPinnedMessages(t){return this.rest.makeRequest("get",`${i.Endpoints.channel(t.id)}/pins`,!0)}createChannelInvite(t,e){const n={};return n.temporary=e.temporary,n.max_age=e.maxAge,n.max_uses=e.maxUses,this.rest.makeRequest("post",`${i.Endpoints.channelInvites(t.id)}`,!0,n).then(t=>new c(this.rest.client,t))}deleteInvite(t){return this.rest.makeRequest("del",i.Endpoints.invite(t.code),!0).then(()=>t)}getInvite(t){return this.rest.makeRequest("get",i.Endpoints.invite(t),!0).then(t=>new c(this.rest.client,t))}getGuildInvites(t){return this.rest.makeRequest("get",i.Endpoints.guildInvites(t.id),!0).then(t=>{const e=new s;for(const n of t){const t=new c(this.rest.client,n);e.set(t.code,t)}return e})}pruneGuildMembers(t,e,n){return this.rest.makeRequest(n?"get":"post",`${i.Endpoints.guildPrune(t.id)}?days=${e}`,!0).then(t=>t.pruned)}createEmoji(t,e,n){return this.rest.makeRequest("post",`${i.Endpoints.guildEmojis(t.id)}`,!0,{name:n,image:e}).then(e=>this.rest.client.actions.EmojiCreate.handle(e,t).emoji)}deleteEmoji(t){return this.rest.makeRequest("delete",`${i.Endpoints.guildEmojis(t.guild.id)}/${t.id}`,!0).then(()=>this.rest.client.actions.EmojiDelete.handle(t).data)}getWebhook(t,e){return this.rest.makeRequest("get",i.Endpoints.webhook(t,e),!e).then(t=>new l(this.rest.client,t))}getGuildWebhooks(t){return this.rest.makeRequest("get",i.Endpoints.guildWebhooks(t.id),!0).then(t=>{const e=new s;for(const n of t)e.set(n.id,new l(this.rest.client,n));return e})}getChannelWebhooks(t){return this.rest.makeRequest("get",i.Endpoints.channelWebhooks(t.id),!0).then(t=>{const e=new s;for(const n of t)e.set(n.id,new l(this.rest.client,n));return e})}createWebhook(t,e,n){return this.rest.makeRequest("post",i.Endpoints.channelWebhooks(t.id),!0,{name:e,avatar:n}).then(t=>new l(this.rest.client,t))}editWebhook(t,e,n){return this.rest.makeRequest("patch",i.Endpoints.webhook(t.id,t.token),!1,{name:e,avatar:n}).then(e=>{return t.name=e.name,t.avatar=e.avatar,t})}deleteWebhook(t){return this.rest.makeRequest("delete",i.Endpoints.webhook(t.id,t.token),!1)}sendWebhookMessage(t,e,{avatarURL,tts,disableEveryone,embeds}={},n=null){return"undefined"!=typeof e&&(e=this.rest.client.resolver.resolveString(e)),e&&(disableEveryone||"undefined"==typeof disableEveryone&&this.rest.client.options.disableEveryone)&&(e=e.replace(/@(everyone|here)/g,"@​$1")),this.rest.makeRequest("post",`${i.Endpoints.webhook(t.id,t.token)}?wait=true`,!1,{username:t.name,avatar_url:avatarURL,content:e,tts:tts,file:n,embeds:embeds})}sendSlackWebhookMessage(t,e){return this.rest.makeRequest("post",`${i.Endpoints.webhook(t.id,t.token)}/slack?wait=true`,!1,e)}fetchUserProfile(t){return this.rest.makeRequest("get",i.Endpoints.userProfile(t.id),!0).then(e=>new f(t,e))}addFriend(t){return this.rest.makeRequest("post",i.Endpoints.relationships("@me"),!0,{username:t.username,discriminator:t.discriminator}).then(()=>t)}removeFriend(t){return this.rest.makeRequest("delete",`${i.Endpoints.relationships("@me")}/${t.id}`,!0).then(()=>t)}blockUser(t){return this.rest.makeRequest("put",`${i.Endpoints.relationships("@me")}/${t.id}`,!0,{type:2}).then(()=>t)}unblockUser(t){return this.rest.makeRequest("delete",`${i.Endpoints.relationships("@me")}/${t.id}`,!0).then(()=>t)}setRolePositions(t,e){return this.rest.makeRequest("patch",i.Endpoints.guildRoles(t),!0,e).then(()=>this.rest.client.actions.GuildRolesPositionUpdate.handle({guild_id:t,roles:e}).guild)}addMessageReaction(t,e){return this.rest.makeRequest("put",i.Endpoints.selfMessageReaction(t.channel.id,t.id,e),!0).then(()=>this.rest.client.actions.MessageReactionAdd.handle({user_id:this.rest.client.user.id,message_id:t.id,emoji:o(e),channel_id:t.channel.id}).reaction)}removeMessageReaction(t,e,n){let s=i.Endpoints.selfMessageReaction(t.channel.id,t.id,e);return n.id!==this.rest.client.user.id&&(s=i.Endpoints.userMessageReaction(t.channel.id,t.id,e,null,n.id)),this.rest.makeRequest("delete",s,!0).then(()=>this.rest.client.actions.MessageReactionRemove.handle({user_id:n.id,message_id:t.id,emoji:o(e),channel_id:t.channel.id}).reaction)}removeMessageReactions(t){this.rest.makeRequest("delete",i.Endpoints.messageReactions(t.channel.id,t.id),!0).then(()=>t)}getMessageReactionUsers(t,e,n=100){return this.rest.makeRequest("get",i.Endpoints.messageReaction(t.channel.id,t.id,e,n),!0)}getMyApplication(){return this.rest.makeRequest("get",i.Endpoints.myApplication,!0).then(t=>new d(this.rest.client,t))}setNote(t,e){return this.rest.makeRequest("put",i.Endpoints.note(t.id),!0,{note:e}).then(()=>t)}}t.exports=p},function(t,e,n){const i=n(46);class s extends i{constructor(t,e){super(t,e),this.requestRemaining=1,this.first=!0}push(t){super.push(t),this.handle()}handleNext(t){this.waiting||(this.waiting=!0,this.restManager.client.setTimeout(()=>{this.requestRemaining=this.requestLimit,this.waiting=!1,this.handle()},t))}execute(t){t.request.gen().end((e,n)=>{if(n&&n.headers&&(this.requestLimit=n.headers["x-ratelimit-limit"],this.requestResetTime=1e3*Number(n.headers["x-ratelimit-reset"]),this.requestRemaining=Number(n.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(n.headers.date).getTime(),this.handleNext(this.requestResetTime-Date.now()+this.timeDifference+1e3)),e)429===e.status?(this.requestRemaining=0,this.queue.unshift(t),this.restManager.client.setTimeout(()=>{this.globalLimit=!1,this.handle()},Number(n.headers["retry-after"])+500),n.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):t.reject(e);else{this.globalLimit=!1;const e=n&&n.body?n.body:{};t.resolve(e),this.first&&(this.first=!1,this.handle())}})}handle(){if(super.handle(),!(this.requestRemaining<1||0===this.queue.length||this.globalLimit))for(;this.queue.length>0&&this.requestRemaining>0;)this.execute(this.queue.shift()), this.requestRemaining--}}t.exports=s},function(t,e,n){const i=n(46);class s extends i{constructor(t,e){super(t,e),this.waiting=!1,this.endpoint=e,this.timeDifference=0}push(t){super.push(t),this.handle()}execute(t){return new Promise(e=>{t.request.gen().end((n,i)=>{if(i&&i.headers&&(this.requestLimit=i.headers["x-ratelimit-limit"],this.requestResetTime=1e3*Number(i.headers["x-ratelimit-reset"]),this.requestRemaining=Number(i.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(i.headers.date).getTime()),n)429===n.status?(this.restManager.client.setTimeout(()=>{this.waiting=!1,this.globalLimit=!1,e()},Number(i.headers["retry-after"])+500),i.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):(this.queue.shift(),this.waiting=!1,t.reject(n),e(n));else{this.queue.shift(),this.globalLimit=!1;const n=i&&i.body?i.body:{};t.resolve(n),0===this.requestRemaining?this.restManager.client.setTimeout(()=>{this.waiting=!1,e(n)},this.requestResetTime-Date.now()+this.timeDifference+1e3):(this.waiting=!1,e(n))}})})}handle(){if(super.handle(),!this.waiting&&0!==this.queue.length&&!this.globalLimit){this.waiting=!0;const t=this.queue[0];this.execute(t).then(()=>this.handle())}}}t.exports=s},function(t,e,n){const i=n(0);class s{constructor(t){this.restManager=t,this._userAgent={url:"https://github.com/hydrabolt/discord.js",version:i.Package.version}}set(t){this._userAgent.url=t.url||"https://github.com/hydrabolt/discord.js",this._userAgent.version=t.version||i.Package.version}get userAgent(){return`DiscordBot (${this._userAgent.url}, ${this._userAgent.version})`}}t.exports=s},function(t,e,n){const i="undefined"!=typeof window,s=i?window.WebSocket:n(137),r=n(21).EventEmitter,o=n(0),u=i?n(62).inflateSync:n(43).inflateSync,h=n(98),a=n(47);class c extends r{constructor(t){super(),this.client=t,this.packetManager=new h(this),this.status=o.Status.IDLE,this.sessionID=null,this.sequence=-1,this.gateway=null,this.normalReady=!1,this.ws=null,this.disabledEvents={};for(const e in t.options.disabledEvents)this.disabledEvents[e]=!0;this.first=!0}_connect(t){this.client.emit("debug",`Connecting to gateway ${t}`),this.normalReady=!1,this.status!==o.Status.RECONNECTING&&(this.status=o.Status.CONNECTING),this.ws=new s(t),i&&(this.ws.binaryType="arraybuffer"),this.ws.onopen=(()=>this.eventOpen()),this.ws.onclose=(t=>this.eventClose(t)),this.ws.onmessage=(t=>this.eventMessage(t)),this.ws.onerror=(t=>this.eventError(t)),this._queue=[],this._remaining=3}connect(t){this.first?(this._connect(t),this.first=!1):this.client.setTimeout(()=>this._connect(t),5500)}send(t,e=false){return e?void this._send(JSON.stringify(t)):(this._queue.push(JSON.stringify(t)),void this.doQueue())}destroy(){this.ws.close(1e3),this._queue=[],this.status=o.Status.IDLE}_send(t){this.ws.readyState===s.OPEN&&(this.emit("send",t),this.ws.send(t))}doQueue(){const t=this._queue[0];if(this.ws.readyState===s.OPEN&&t){if(0===this._remaining)return void this.client.setTimeout(this.doQueue.bind(this),1e3);this._remaining--,this._send(t),this._queue.shift(),this.doQueue(),this.client.setTimeout(()=>this._remaining++,1e3)}}eventOpen(){this.client.emit("debug","Connection to gateway opened"),this.status===o.Status.RECONNECTING?this._sendResume():this._sendNewIdentify()}_sendResume(){if(!this.sessionID)return void this._sendNewIdentify();this.client.emit("debug","Identifying as resumed session");const t={token:this.client.token,session_id:this.sessionID,seq:this.sequence};this.send({op:o.OPCodes.RESUME,d:t})}_sendNewIdentify(){this.reconnecting=!1;const t=this.client.options.ws;t.token=this.client.token,this.client.options.shardCount>0&&(t.shard=[Number(this.client.options.shardId),Number(this.client.options.shardCount)]),this.client.emit("debug","Identifying as new session"),this.send({op:o.OPCodes.IDENTIFY,d:t}),this.sequence=-1}eventClose(t){this.emit("close",t),this.client.clearInterval(this.client.manager.heartbeatInterval),this.reconnecting||this.client.emit(o.Events.DISCONNECT),4004!==t.code&&4010!==t.code&&(this.reconnecting||1e3===t.code||this.tryReconnect())}eventMessage(t){const e=this.tryParseEventData(t.data);return null===e?(this.eventError(new Error(o.Errors.BAD_WS_MESSAGE)),!1):(this.client.emit("raw",e),e.op===o.OPCodes.HELLO&&this.client.manager.setupKeepAlive(e.d.heartbeat_interval),this.packetManager.handle(e))}parseEventData(t){return"string"!=typeof t&&(t instanceof ArrayBuffer&&(t=a(t)),t=u(t).toString()),JSON.parse(t)}tryParseEventData(t){try{return this.parseEventData(t)}catch(t){return null}}eventError(t){this.client.listenerCount("error")>0&&this.client.emit("error",t),this.ws.close()}_emitReady(t=true){this.status=o.Status.READY,this.client.emit(o.Events.READY),this.packetManager.handleQueue(),this.normalReady=t}checkIfReady(){if(this.status!==o.Status.READY&&this.status!==o.Status.NEARLY){let t=0;for(const e of this.client.guilds.keys())t+=this.client.guilds.get(e).available?0:1;if(0===t){if(this.status=o.Status.NEARLY,this.client.options.fetchAllMembers){const t=this.client.guilds.map(t=>t.fetchMembers());return void Promise.all(t).then(()=>this._emitReady(),t=>{this.client.emit(o.Events.WARN,"Error in pre-ready guild member fetching"),this.client.emit(o.Events.ERROR,t),this._emitReady()})}this._emitReady()}}}tryReconnect(){this.status=o.Status.RECONNECTING,this.ws.close(),this.packetManager.handleQueue(),this.client.emit(o.Events.RECONNECTING),this.connect(this.client.ws.gateway)}}t.exports=c},function(t,e,n){const i=n(0),s=[i.WSEvents.READY,i.WSEvents.GUILD_CREATE,i.WSEvents.GUILD_DELETE,i.WSEvents.GUILD_MEMBERS_CHUNK,i.WSEvents.GUILD_MEMBER_ADD,i.WSEvents.GUILD_MEMBER_REMOVE];class r{constructor(t){this.ws=t,this.handlers={},this.queue=[],this.register(i.WSEvents.READY,n(124)),this.register(i.WSEvents.GUILD_CREATE,n(105)),this.register(i.WSEvents.GUILD_DELETE,n(106)),this.register(i.WSEvents.GUILD_UPDATE,n(115)),this.register(i.WSEvents.GUILD_BAN_ADD,n(103)),this.register(i.WSEvents.GUILD_BAN_REMOVE,n(104)),this.register(i.WSEvents.GUILD_MEMBER_ADD,n(107)),this.register(i.WSEvents.GUILD_MEMBER_REMOVE,n(108)),this.register(i.WSEvents.GUILD_MEMBER_UPDATE,n(109)),this.register(i.WSEvents.GUILD_ROLE_CREATE,n(111)),this.register(i.WSEvents.GUILD_ROLE_DELETE,n(112)),this.register(i.WSEvents.GUILD_ROLE_UPDATE,n(113)),this.register(i.WSEvents.GUILD_MEMBERS_CHUNK,n(110)),this.register(i.WSEvents.CHANNEL_CREATE,n(99)),this.register(i.WSEvents.CHANNEL_DELETE,n(100)),this.register(i.WSEvents.CHANNEL_UPDATE,n(102)),this.register(i.WSEvents.CHANNEL_PINS_UPDATE,n(101)),this.register(i.WSEvents.PRESENCE_UPDATE,n(123)),this.register(i.WSEvents.USER_UPDATE,n(129)),this.register(i.WSEvents.USER_NOTE_UPDATE,n(128)),this.register(i.WSEvents.VOICE_STATE_UPDATE,n(131)),this.register(i.WSEvents.TYPING_START,n(127)),this.register(i.WSEvents.MESSAGE_CREATE,n(116)),this.register(i.WSEvents.MESSAGE_DELETE,n(117)),this.register(i.WSEvents.MESSAGE_UPDATE,n(122)),this.register(i.WSEvents.MESSAGE_DELETE_BULK,n(118)),this.register(i.WSEvents.VOICE_SERVER_UPDATE,n(130)),this.register(i.WSEvents.GUILD_SYNC,n(114)),this.register(i.WSEvents.RELATIONSHIP_ADD,n(125)),this.register(i.WSEvents.RELATIONSHIP_REMOVE,n(126)),this.register(i.WSEvents.MESSAGE_REACTION_ADD,n(119)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE,n(120)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE_ALL,n(121))}get client(){return this.ws.client}register(t,e){this.handlers[t]=new e(this)}handleQueue(){this.queue.forEach((t,e)=>{this.handle(this.queue[e]),this.queue.splice(e,1)})}setSequence(t){t&&t>this.ws.sequence&&(this.ws.sequence=t)}handle(t){return t.op===i.OPCodes.RECONNECT?(this.setSequence(t.s),this.ws.tryReconnect(),!1):t.op===i.OPCodes.INVALID_SESSION?(this.ws.sessionID=null,this.ws._sendNewIdentify(),!1):(t.op===i.OPCodes.HEARTBEAT_ACK&&this.ws.client.emit("debug","Heartbeat acknowledged"),this.ws.status===i.Status.RECONNECTING&&(this.ws.reconnecting=!1,this.ws.checkIfReady()),this.setSequence(t.s),void 0===this.ws.disabledEvents[t.t]&&(this.ws.status!==i.Status.READY&&s.indexOf(t.t)===-1?(this.queue.push(t),!1):!!this.handlers[t.t]&&this.handlers[t.t].handle(t)))}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.ChannelDelete.handle(n);i.channel&&e.emit(s.Events.CHANNEL_DELETE,i.channel)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.channels.get(n.channel_id),r=new Date(n.last_pin_timestamp);i&&r&&e.emit(s.Events.CHANNEL_PINS_UPDATE,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.ChannelUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id),r=e.users.get(n.user.id);i&&r&&e.emit(s.Events.GUILD_BAN_ADD,i,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildBanRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.id);i?i.available||n.unavailable||(i.setup(n),this.packetManager.ws.checkIfReady()):e.dataManager.newGuild(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.GuildDelete.handle(n);i.guild&&e.emit(s.Events.GUILD_DELETE,i.guild)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);i&&(i.memberCount++,i._addMember(n))}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildMemberRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user.id);t&&i._updateMember(t,n)}}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id),r=[];if(i)for(const o of n.members)r.push(i._addMember(o,!1));i._checkChunks(),e.emit(s.Events.GUILD_MEMBERS_CHUNK,r)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleCreate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleDelete.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildRoleUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildSync.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.GuildUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageCreate.handle(n);i.message&&e.emit(s.Events.MESSAGE_CREATE,i.message)}}t.exports=r},function(t,e,n){const i=n(1),s=n(0);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.actions.MessageDelete.handle(n);i.message&&e.emit(s.Events.MESSAGE_DELETE,i.message)}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageDeleteBulk.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionAdd.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemove.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageReactionRemoveAll.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.MessageUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d;let i=e.users.get(n.user.id);const o=e.guilds.get(n.guild_id);if(!i){if(!n.user.username)return;i=e.dataManager.newUser(n.user)}const u=r(i);if(i.patch(n.user),i.equals(u)||e.emit(s.Events.USER_UPDATE,u,i),o){let t=o.members.get(i.id);if(t||"offline"===n.status||(t=o._addMember({user:i,roles:n.roles,deaf:!1,mute:!1},!1),e.emit(s.Events.GUILD_MEMBER_AVAILABLE,t)),t){const u=r(t);t.presence&&(u.frozenPresence=r(t.presence)),o._setPresence(i.id,n),e.emit(s.Events.PRESENCE_UPDATE,u,t)}else o._setPresence(i.id,n)}}}t.exports=o},function(t,e,n){const i=n(1),s=n(27);class r extends i{handle(t){const e=this.packetManager.client,n=t.d,i=new s(e,n.user);e.user=i,e.readyAt=new Date,e.users.set(i.id,i);for(const r of n.guilds)e.dataManager.newGuild(r);for(const o of n.private_channels)e.dataManager.newChannel(o);for(const u of n.relationships){const t=e.dataManager.newUser(u.user);1===u.type?e.user.friends.set(t.id,t):2===u.type&&e.user.blocked.set(t.id,t)}n.presences=n.presences||[];for(const h of n.presences)e.dataManager.newUser(h.user),e._setPresence(h.user.id,h);if(n.notes)for(const a in n.notes){let t=n.notes[a];t.length||(t=null),e.user.notes.set(a,t)}!e.user.bot&&e.options.sync&&e.setInterval(e.syncGuilds.bind(e),3e4),e.once("ready",e.syncGuilds.bind(e)),e.users.has("1")||e.dataManager.newUser({id:"1",username:"Clyde",discriminator:"0000",avatar:"https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png",bot:!0,status:"online",game:null,verified:!0}),e.setTimeout(()=>{e.ws.normalReady||e.ws._emitReady(!1)},1200*n.guilds.length),this.packetManager.ws.sessionID=n.session_id,this.packetManager.ws.checkIfReady()}}t.exports=r},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;1===n.type?e.fetchUser(n.id).then(t=>{e.user.friends.set(t.id,t)}):2===n.type&&e.fetchUser(n.id).then(t=>{e.user.blocked.set(t.id,t)})}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;2===n.type?e.user.blocked.has(n.id)&&e.user.blocked.delete(n.id):1===n.type&&e.user.friends.has(n.id)&&e.user.friends.delete(n.id)}}t.exports=s},function(t,e,n){function i(t,e){return t.client.setTimeout(()=>{t.client.emit(r.Events.TYPING_STOP,t,e,t._typing.get(e.id)),t._typing.delete(e.id)},6e3)}const s=n(1),r=n(0);class o extends s{handle(t){const e=this.packetManager.client,n=t.d,s=e.channels.get(n.channel_id),o=e.users.get(n.user_id),h=new Date(1e3*n.timestamp);if(s&&o){if("voice"===s.type)return void e.emit(r.Events.WARN,`Discord sent a typing packet to voice channel ${s.id}`);if(s._typing.has(o.id)){const t=s._typing.get(o.id);t.lastTimestamp=h,t.resetTimeout(i(s,o))}else s._typing.set(o.id,new u(e,h,h,i(s,o))),e.emit(r.Events.TYPING_START,s,o)}}}class u{constructor(t,e,n,i){this.client=t,this.since=e,this.lastTimestamp=n,this._timeout=i}resetTimeout(t){this.client.clearTimeout(this._timeout),this._timeout=t}get elapsedTime(){return Date.now()-this.since}}t.exports=o},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserNoteUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.actions.UserUpdate.handle(n)}}t.exports=s},function(t,e,n){const i=n(1);class s extends i{handle(t){const e=this.packetManager.client,n=t.d;e.emit("self.voiceServer",n)}}t.exports=s},function(t,e,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(t){const e=this.packetManager.client,n=t.d,i=e.guilds.get(n.guild_id);if(i){const t=i.members.get(n.user_id);if(t){const i=r(t);t.voiceChannel&&t.voiceChannel.id!==n.channel_id&&t.voiceChannel.members.delete(i.id),n.channel_id||(t.speaking=null),t.user.id===e.user.id&&n.channel_id&&e.emit("self.voiceStateUpdate",n);const o=e.channels.get(n.channel_id);o&&o.members.set(t.user.id,t),t.serverMute=n.mute,t.serverDeaf=n.deaf,t.selfMute=n.self_mute,t.selfDeaf=n.self_deaf,t.voiceSessionID=n.session_id,t.voiceChannelID=n.channel_id,e.emit(s.Events.VOICE_STATE_UPDATE,i,t)}}}}t.exports=o},function(t,e){class n{constructor(t,e){this.user=t,this.setup(e)}setup(t){this.type=t.type,this.name=t.name,this.id=t.id,this.revoked=t.revoked,this.integrations=t.integrations}}t.exports=n},function(t,e,n){const i=n(3),s=n(132);class r{constructor(t,e){this.user=t,this.client=this.user.client,Object.defineProperty(this,"client",{enumerable:!1,configurable:!1}),this.mutualGuilds=new i,this.connections=new i,this.setup(e)}setup(t){for(const e of t.mutual_guilds)this.client.guilds.has(e.id)&&this.mutualGuilds.set(e.id,this.client.guilds.get(e.id));for(const n of t.connected_accounts)this.connections.set(n.id,new s(this.user,n))}}t.exports=r},function(t,e){t.exports=function(t){if(t.includes("%")&&(t=decodeURIComponent(t)),t.includes(":")){const[e,n]=t.split(":");return{name:e,id:n}}return{name:t,id:null}}},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){t.exports={Client:n(49),WebhookClient:n(50),Shard:n(52),ShardClientUtil:n(53),ShardingManager:n(54),Collection:n(3),splitMessage:n(41),escapeMarkdown:n(14),fetchRecommendedShards:n(51),Channel:n(8),ClientOAuth2Application:n(26),ClientUser:n(27),DMChannel:n(28),Emoji:n(9),EvaluatedPermissions:n(17),Game:n(6).Game,GroupDMChannel:n(29),Guild:n(18),GuildChannel:n(11),GuildMember:n(12),Invite:n(30),Message:n(13),MessageAttachment:n(31),MessageCollector:n(32),MessageEmbed:n(33),MessageReaction:n(34),OAuth2Application:n(35),PartialGuild:n(36),PartialGuildChannel:n(37),PermissionOverwrites:n(38),Presence:n(6).Presence,ReactionEmoji:n(19),Role:n(7),TextChannel:n(39),User:n(5),VoiceChannel:n(40),Webhook:n(20),version:n(25).version},"undefined"!=typeof window&&(window.Discord=t.exports)}]); \ No newline at end of file