=g&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=y||u>L((w-v)/a))&&o("overflow"),v+=u*a,p=c<=E?_:c>=E+x?x:c-E,!(uL(w/f)&&o("overflow"),a*=f;t=m.length+1,E=d(v-r,t,0==r),L(v/t)>w-b&&o("overflow"),b+=L(v/t),v%=t,m.splice(v++,0,b)}return l(m)}function m(e){var t,n,i,s,r,a,c,l,h,f,m,g,v,b,E,R=[];for(e=u(e),g=e.length,t=T,n=0,r=k,a=0;a=t&&mL((w-n)/v)&&o("overflow"),n+=(c-t)*v,t=c,a=0;aw&&o("overflow"),m==t){for(l=n,h=y;f=h<=r?_:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=y-_,L=Math.floor,O=String.fromCharCode;E={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},s=function(){return E}.call(t,n,t,e),!(void 0!==s&&(e.exports=s))}(this)}).call(t,n(98)(e),n(9))},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var c=1e3;r&&"number"==typeof r.maxKeys&&(c=r.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l=0?(h=m.substr(0,g),p=m.substr(g+1)):(h=m,p=""),d=decodeURIComponent(h),f=decodeURIComponent(p),i(o,d)?s(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t=s.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},function(e,t,n){e.exports=n(57)},function(e,t,n){e.exports=n(35)},function(e,t,n){e.exports=n(36)},function(e,t,n){(function(e,t){!function(e,n){"use strict";function i(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=3.1.0 <4.0.0",type:"range"},"/home/travis/build/hydrabolt/discord.js"]],_from:"snekfetch@>=3.1.0 <4.0.0",_id:"snekfetch@3.1.1",_inCache:!0,_location:"/snekfetch",_nodeVersion:"7.9.0",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/snekfetch-3.1.1.tgz_1492865526415_0.9978627415839583"},_npmUser:{name:"crawl",email:"icrawltogo@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"snekfetch@^3.1.0",scope:null,escapedName:"snekfetch",name:"snekfetch",rawSpec:"^3.1.0",spec:">=3.1.0 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.1.tgz",_shasum:"dcfee0d0c64b193e8741db168d86bfb200bb8850",_shrinkwrap:null,_spec:"snekfetch@^3.1.0",_where:"/home/travis/build/hydrabolt/discord.js",author:{name:"Gus Caplan",email:"me@gus.host"},bugs:{url:"https://github.com/GusCaplan/snekfetch/issues"},dependencies:{},description:"Just do http requests without all that weird nastiness from other libs",devDependencies:{},directories:{},dist:{shasum:"dcfee0d0c64b193e8741db168d86bfb200bb8850",tarball:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.1.tgz"},gitHead:"8a8b2eba604450363bf80e8e0caac97157f15820",homepage:"https://github.com/GusCaplan/snekfetch#readme",license:"MIT",main:"index.js",maintainers:[{name:"crawl",email:"icrawltogo@gmail.com"},{name:"snek",email:"me@gus.host"}],name:"snekfetch",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/GusCaplan/snekfetch.git"},scripts:{},version:"3.1.1"}},function(e,t,n){(function(t){const i=n(26),s=n(89);class r{constructor(){this.boundary=`--snekfetch--${Math.random().toString().slice(2,7)}`,this.buffer=new t(0)}append(e,n,r){if("undefined"!=typeof n){let o=`
+\`\`\``)}pin(){return this.client.rest.methods.pinMessage(this)}unpin(){return this.client.rest.methods.unpinMessage(this)}react(e){if(!(e=this.client.resolver.resolveEmojiIdentifier(e)))throw new TypeError("Emoji must be a string or Emoji/ReactionEmoji");return this.client.rest.methods.addMessageReaction(this,e)}clearReactions(){return this.client.rest.methods.removeMessageReactions(this)}delete(e=0){return e<=0?this.client.rest.methods.deleteMessage(this):new Promise(t=>{this.client.setTimeout(()=>{t(this.delete())},e)})}reply(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),this.channel.send(e,Object.assign(t,{reply:this.member||this.author}))}acknowledge(){return this.client.rest.methods.ackMessage(this)}fetchWebhook(){return this.webhookID?this.client.fetchWebhook(this.webhookID):Promise.reject(new Error("The message was not sent by a webhook."))}equals(e,t){if(!e)return!1;if(!e.author&&!e.attachments)return this.id===e.id&&this.embeds.length===e.embeds.length;let n=this.id===e.id&&this.author.id===e.author.id&&this.content===e.content&&this.tts===e.tts&&this.nonce===e.nonce&&this.embeds.length===e.embeds.length&&this.attachments.length===e.attachments.length;return n&&t&&(n=this.mentions.everyone===e.mentions.everyone&&this.createdTimestamp===new Date(t.timestamp).getTime()&&this.editedTimestamp===new Date(t.edited_timestamp).getTime()),n}toString(){return this.content}_addReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);let i;return this.reactions.has(n)?(i=this.reactions.get(n),i.me||(i.me=t.id===this.client.user.id)):(i=new o(this,e,0,t.id===this.client.user.id),this.reactions.set(n,i)),i.users.has(t.id)||i.users.set(t.id,t),i.count++,i}_removeReaction(e,t){const n=e.id?`${e.name}:${e.id}`:encodeURIComponent(e.name);if(this.reactions.has(n)){const e=this.reactions.get(n);if(e.users.has(t.id))return e.users.delete(t.id),e.count--,t.id===this.client.user.id&&(e.me=!1),e.count<=0&&this.reactions.delete(n),e}return null}_clearReactions(){this.reactions.clear()}}e.exports=d},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===g(e)}function i(e){return"boolean"==typeof e}function s(e){return null===e}function r(e){return null==e}function o(e){return"number"==typeof e}function a(e){return"string"==typeof e}function c(e){return"symbol"==typeof e}function u(e){return void 0===e}function l(e){return"[object RegExp]"===g(e)}function h(e){return"object"==typeof e&&null!==e}function p(e){return"[object Date]"===g(e)}function d(e){return"[object Error]"===g(e)||e instanceof Error}function f(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function g(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=i,t.isNull=s,t.isNullOrUndefined=r,t.isNumber=o,t.isString=a,t.isSymbol=c,t.isUndefined=u,t.isRegExp=l,t.isObject=h,t.isDate=p,t.isError=d,t.isFunction=f,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(5).Buffer)},function(e,t,n){t=e.exports=n(55),t.Stream=t,t.Readable=t,t.Writable=n(35),t.Duplex=n(13),t.Transform=n(56),t.PassThrough=n(81)},function(e,t,n){const i=n(26),s=n(19),r=n(44),o=n(3);class a{constructor(){this.messages=new o,this.lastMessageID=null,this.lastMessage=null}send(e,t){if(t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),t.embed&&t.embed.file&&(t.file=t.embed.file),t.file&&(t.files?t.files.push(t.file):t.files=[t.file]),t.files){for(const e in t.files){let n=t.files[e];"string"==typeof n&&(n={attachment:n}),n.name||("string"==typeof n.attachment?n.name=i.basename(n.attachment):n.attachment&&n.attachment.path?n.name=i.basename(n.attachment.path):n.name="file.jpg"),t.files[e]=n}return Promise.all(t.files.map(e=>this.client.resolver.resolveBuffer(e.attachment).then(t=>{e.file=t;return e}))).then(n=>this.client.rest.methods.sendMessage(this,e,t,n))}return this.client.rest.methods.sendMessage(this,e,t)}sendMessage(e,t){return this.send(e,t)}sendEmbed(e,t,n){return n||"object"!=typeof t||t instanceof Array?n||(n={}):(n=t,t=""),this.send(t,Object.assign(n,{embed:e}))}sendFiles(e,t,n={}){return this.send(t,Object.assign(n,{files:e}))}sendFile(e,t,n,i={}){return this.sendFiles([{attachment:e,name:t}],n,i)}sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}fetchMessage(e){return this.client.user.bot?this.client.rest.methods.getChannelMessage(this,e).then(e=>{const t=e instanceof s?e:new s(this,e,this.client);this._cacheMessage(t);return t}):this.fetchMessages({limit:1,around:e}).then(t=>{const n=t.first();if(n.id!==e)throw new Error("Message not found.");return n})}fetchMessages(e={}){return this.client.rest.methods.getChannelMessages(this,e).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}fetchPinnedMessages(){return this.client.rest.methods.getChannelPinnedMessages(this).then(e=>{const t=new o;for(const n of e){const e=new s(this,n,this.client);t.set(n.id,e),this._cacheMessage(e)}return t})}search(e){return this.client.rest.methods.search(this,e)}startTyping(e){if(void 0!==e&&e<1)throw new RangeError("Count must be at least 1.");if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count=e||t.count+1}else this.client.user._typing.set(this.id,{count:e||1,interval:this.client.setInterval(()=>{this.client.rest.methods.sendTyping(this.id)},9e3)}),this.client.rest.methods.sendTyping(this.id)}stopTyping(e=!1){if(this.client.user._typing.has(this.id)){const t=this.client.user._typing.get(this.id);t.count--,(t.count<=0||e)&&(this.client.clearInterval(t.interval),this.client.user._typing.delete(this.id))}}get typing(){return this.client.user._typing.has(this.id)}get typingCount(){return this.client.user._typing.has(this.id)?this.client.user._typing.get(this.id).count:0}createCollector(e,t){return this.createMessageCollector(e,t)}createMessageCollector(e,t={}){return new r(this,e,t)}awaitMessages(e,t={}){return new Promise((n,i)=>{const s=this.createCollector(e,t);s.once("end",(e,s)=>{t.errors&&t.errors.includes(s)?i(e):n(e)})})}bulkDelete(e,t=!1){if(!isNaN(e))return this.fetchMessages({limit:e}).then(e=>this.bulkDelete(e,t));if(e instanceof Array||e instanceof o){const n=e instanceof o?e.keyArray():e.map(e=>e.id);return this.client.rest.methods.bulkDeleteMessages(this,n,t)}throw new TypeError("The messages must be an Array, Collection, or number.")}acknowledge(){return this.client.rest.methods.ackTextMessage(this)}_cacheMessage(e){const t=this.client.options.messageCacheMaxSize;return 0===t?null:(this.messages.size>=t&&t>0&&this.messages.delete(this.messages.firstKey()),this.messages.set(e.id,e),e)}}t.applyToClass=((e,t=!1,n=[])=>{const i=["send","sendMessage","sendEmbed","sendFile","sendFiles","sendCode"];t&&i.push("_cacheMessage","fetchMessages","fetchMessage","search","bulkDelete","startTyping","stopTyping","typing","typingCount","fetchPinnedMessages","createCollector","createMessageCollector","awaitMessages");for(const t of i)n.includes(t)||Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(a.prototype,t))})},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n"},function(e,t,n){const i=n(32),s=n(16),r=n(15),o=n(17),a=n(11).Presence,c=n(18),u=n(0),l=n(3),h=n(4),p=n(7);class d{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.members=new l,this.channels=new l,this.roles=new l,this.presences=new l,t&&(t.unavailable?(this.available=!1,this.id=t.id):(this.available=!0,this.setup(t)))}setup(e){if(this.name=e.name,this.icon=e.icon,this.splash=e.splash,this.region=e.region,this.memberCount=e.member_count||this.memberCount,this.large=Boolean("large"in e?e.large:this.large),this.features=e.features,this.applicationID=e.application_id,this.afkTimeout=e.afk_timeout,this.afkChannelID=e.afk_channel_id,this.embedEnabled=e.embed_enabled,this.verificationLevel=e.verification_level,this.explicitContentFilter=e.explicit_content_filter,this.joinedTimestamp=e.joined_at?new Date(e.joined_at).getTime():this.joinedTimestamp,this.id=e.id,this.available=!e.unavailable,this.features=e.features||this.features||[],e.members){this.members.clear();for(const t of e.members)this._addMember(t,!1)}if(e.owner_id&&(this.ownerID=e.owner_id),e.channels){this.channels.clear();for(const t of e.channels)this.client.dataManager.newChannel(t,this)}if(e.roles){this.roles.clear();for(const t of e.roles){const e=new r(this,t);this.roles.set(e.id,e)}}if(e.presences)for(const t of e.presences)this._setPresence(t.user.id,t);if(this._rawVoiceStates=new l,e.voice_states)for(const t of e.voice_states){this._rawVoiceStates.set(t.user_id,t);const e=this.members.get(t.user_id);e&&(e.serverMute=t.mute,e.serverDeaf=t.deaf,e.selfMute=t.self_mute,e.selfDeaf=t.self_deaf,e.voiceSessionID=t.session_id,e.voiceChannelID=t.channel_id,this.channels.get(t.channel_id).members.set(e.user.id,e))}if(this.emojis)this.client.actions.GuildEmojisUpdate.handle({guild_id:this.id,emojis:e.emojis});else{this.emojis=new l;for(const t of e.emojis)this.emojis.set(t.id,new o(this,t))}}get createdTimestamp(){return p.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}get joinedAt(){return new Date(this.joinedTimestamp)}get iconURL(){return this.icon?u.Endpoints.Guild(this).Icon(this.client.options.http.cdn,this.icon):null}get splashURL(){return this.splash?u.Endpoints.Guild(this).Splash(this.client.options.http.cdn,this.splash):null}get owner(){return this.members.get(this.ownerID)}get voiceConnection(){return this.client.browser?null:this.client.voice.connections.get(this.id)||null}get defaultChannel(){return this.channels.get(this.id)}get position(){return this.client.user.bot?null:this.client.user.settings.guildPositions?this.client.user.settings.guildPositions.indexOf(this.id):null}get defaultRole(){return this.roles.get(this.id)}get _sortedRoles(){return this._sortPositionWithID(this.roles)}member(e){return this.client.resolver.resolveGuildMember(this,e)}fetchBans(){return this.client.rest.methods.getGuildBans(this)}fetchInvites(){return this.client.rest.methods.getGuildInvites(this)}fetchWebhooks(){return this.client.rest.methods.getGuildWebhooks(this)}fetchVoiceRegions(){return this.client.rest.methods.fetchVoiceRegions(this.id)}addMember(e,t){return this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.putGuildMember(this,e,t)}fetchMember(e,t=!0){return e=this.client.resolver.resolveUser(e),e?this.members.has(e.id)?Promise.resolve(this.members.get(e.id)):this.client.rest.methods.getGuildMember(this,e,t):Promise.reject(new Error("User is not cached. Use Client.fetchUser first."))}fetchMembers(e="",t=0){return new Promise((n,i)=>{if(this.memberCount===this.members.size)return void n(this);this.client.ws.send({op:u.OPCodes.REQUEST_GUILD_MEMBERS,d:{guild_id:this.id,query:e,limit:t}});const s=(e,t)=>{if(t.id!==this.id)return;(this.memberCount===this.members.size||e.length<1e3)&&(this.client.removeListener(u.Events.GUILD_MEMBERS_CHUNK,s),n(this))};this.client.on(u.Events.GUILD_MEMBERS_CHUNK,s);this.client.setTimeout(()=>i(new Error("Members didn't arrive in time.")),12e4)})}search(e){return this.client.rest.methods.search(this,e)}edit(e){return this.client.rest.methods.updateGuild(this,e)}setName(e){return this.edit({name:e})}setRegion(e){return this.edit({region:e})}setVerificationLevel(e){return this.edit({verificationLevel:e})}setAFKChannel(e){return this.edit({afkChannel:e})}setAFKTimeout(e){return this.edit({afkTimeout:e})}setIcon(e){return this.edit({icon:e})}setOwner(e){return this.edit({owner:e})}setSplash(e){return this.edit({splash:e})}ban(e,t=0){return this.client.rest.methods.banGuildMember(this,e,t)}unban(e){return this.client.rest.methods.unbanGuildMember(this,e)}pruneMembers(e,t=!1){if("number"!=typeof e)throw new TypeError("Days must be a number.");return this.client.rest.methods.pruneGuildMembers(this,e,t)}sync(){this.client.user.bot||this.client.syncGuilds([this])}createChannel(e,t,n){return this.client.rest.methods.createChannel(this,e,t,n)}setChannelPositions(e){return this.client.rest.methods.updateChannelPositions(this.id,e)}createRole(e={}){return this.client.rest.methods.createGuildRole(this,e)}createEmoji(e,t,n){return new Promise(i=>{"string"==typeof e&&e.startsWith("data:")?i(this.client.rest.methods.createEmoji(this,e,t,n)):this.client.resolver.resolveBuffer(e).then(e=>{const s=this.client.resolver.resolveBase64(e);i(this.client.rest.methods.createEmoji(this,s,t,n))})})}deleteEmoji(e){return e instanceof o||(e=this.emojis.get(e)),this.client.rest.methods.deleteEmoji(e)}leave(){return this.client.rest.methods.leaveGuild(this)}delete(){return this.client.rest.methods.deleteGuild(this)}acknowledge(){return this.client.rest.methods.ackGuild(this)}setPosition(e,t){return this.client.user.bot?Promise.reject(new Error("Setting guild position is only available for user accounts")):this.client.user.settings.setGuildPosition(this,e,t)}allowDMs(e){const t=this.client.user.settings;return e?t.removeRestrictedGuild(this):t.addRestrictedGuild(this)}equals(e){let t=e&&this.id===e.id&&this.available===!e.unavailable&&this.splash===e.splash&&this.region===e.region&&this.name===e.name&&this.memberCount===e.member_count&&this.large===e.large&&this.icon===e.icon&&h.arraysEqual(this.features,e.features)&&this.ownerID===e.owner_id&&this.verificationLevel===e.verification_level&&this.embedEnabled===e.embed_enabled;return t&&(this.embedChannel?this.embedChannel.id!==e.embed_channel_id&&(t=!1):e.embed_channel_id&&(t=!1)),t}toString(){return this.name}_addMember(e,t=!0){const n=this.members.has(e.user.id);e.user instanceof s||(e.user=this.client.dataManager.newUser(e.user)),e.joined_at=e.joined_at||0;const i=new c(this,e);if(this.members.set(i.id,i),this._rawVoiceStates&&this._rawVoiceStates.has(i.user.id)){const e=this._rawVoiceStates.get(i.user.id);i.serverMute=e.mute,i.serverDeaf=e.deaf,i.selfMute=e.self_mute,i.selfDeaf=e.self_deaf,i.voiceSessionID=e.session_id,i.voiceChannelID=e.channel_id,this.client.channels.has(e.channel_id)?this.client.channels.get(e.channel_id).members.set(i.user.id,i):this.client.emit("warn",`Member ${i.id} added in guild ${this.id} with an uncached voice channel`)}return this.client.ws.status===u.Status.READY&&t&&!n&&this.client.emit(u.Events.GUILD_MEMBER_ADD,i),i}_updateMember(e,t){const n=h.cloneObject(e);t.roles&&(e._roles=t.roles),void 0!==t.nick&&(e.nickname=t.nick);const i=e.nickname!==n.nickname||!h.arraysEqual(e._roles,n._roles);return this.client.ws.status===u.Status.READY&&i&&this.client.emit(u.Events.GUILD_MEMBER_UPDATE,n,e),{old:n,mem:e}}_removeMember(e){this.members.delete(e.id)}_memberSpeakUpdate(e,t){const n=this.members.get(e);n&&n.speaking!==t&&(n.speaking=t,this.client.emit(u.Events.GUILD_MEMBER_SPEAKING,n,t))}_setPresence(e,t){if(this.presences.get(e))return void this.presences.get(e).update(t);this.presences.set(e,new a(t))}setRolePosition(e,t,n=!1){if("string"==typeof e&&!(e=this.roles.get(e)))return Promise.reject(new Error("Supplied role is not a role or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedRoles.array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setRolePositions(this.id,i)}setChannelPosition(e,t,n=!1){if("string"==typeof e&&!(e=this.channels.get(e)))return Promise.reject(new Error("Supplied channel is not a channel or snowflake."));if(t=Number(t),isNaN(t))return Promise.reject(new Error("Supplied position is not a number."));let i=this._sortedChannels(e.type).array();return h.moveElementInArray(i,e,t,n),i=i.map((e,t)=>({id:e.id,position:t})),this.client.rest.methods.setChannelPositions(this.id,i)}_sortedChannels(e){return this._sortPositionWithID(this.channels.filter(t=>"voice"===e&&"voice"===t.type||("voice"!==e&&"voice"!==t.type||e===t.type)))}_sortPositionWithID(e){return e.sort((e,t)=>e.position!==t.position?e.position-t.position:i.fromString(e.id).sub(i.fromString(t.id)).toNumber())}}e.exports=d},function(e,t,n){const i=n(14),s=n(15),r=n(51),o=n(8),a=n(3);class c extends i{constructor(e,t){super(e.client,t),this.guild=e}setup(e){if(super.setup(e),this.name=e.name,this.position=e.position,this.permissionOverwrites=new a,e.permission_overwrites)for(const t of e.permission_overwrites)this.permissionOverwrites.set(t.id,new r(this,t))}get calculatedPosition(){const e=this.guild._sortedChannels(this.type);return e.array().indexOf(e.get(this.id))}permissionsFor(e){if(!(e=this.client.resolver.resolveGuildMember(this.guild,e)))return null;if(e.id===this.guild.ownerID)return new o(e,o.ALL);let t=0;const n=e.roles;for(const e of n.values())t|=e.permissions;const i=this.overwritesFor(e,!0,n);i.everyone&&(t&=~i.everyone.deny,t|=i.everyone.allow);let s=0;for(const e of i.roles)t&=~e.deny,s|=e.allow;return t|=s,i.member&&(t&=~i.member.deny,t|=i.member.allow),Boolean(t&o.FLAGS.ADMINISTRATOR)&&(t=o.ALL),new o(e,t)}overwritesFor(e,t=!1,n=null){if(t||(e=this.client.resolver.resolveGuildMember(this.guild,e)),!e)return[];n=n||e.roles;const i=[];let s,r;for(const t of this.permissionOverwrites.values())t.id===this.guild.id?r=t:n.has(t.id)?i.push(t):t.id===e.id&&(s=t);return{everyone:r,roles:i,member:s}}overwritePermissions(e,t){const n={allow:0,deny:0};if(e instanceof s)n.type="role";else if(this.guild.roles.has(e))e=this.guild.roles.get(e),n.type="role";else if(e=this.client.resolver.resolveUser(e),n.type="member",!e)return Promise.reject(new TypeError("Supplied parameter was neither a User nor a Role."));n.id=e.id;const i=this.permissionOverwrites.get(e.id);i&&(n.allow=i.allow,n.deny=i.deny);for(const e in t)!0===t[e]?(n.allow|=o.FLAGS[e]||0,n.deny&=~(o.FLAGS[e]||0)):!1===t[e]?(n.allow&=~(o.FLAGS[e]||0),n.deny|=o.FLAGS[e]||0):null===t[e]&&(n.allow&=~(o.FLAGS[e]||0),n.deny&=~(o.FLAGS[e]||0));return this.client.rest.methods.setChannelOverwrite(this,n)}edit(e){return this.client.rest.methods.updateChannel(this,e)}setName(e){return this.edit({name:e})}setPosition(e,t){return this.guild.setChannelPosition(this,e,t).then(()=>this)}setTopic(e){return this.client.rest.methods.updateChannel(this,{topic:e})}createInvite(e={}){return this.client.rest.methods.createChannelInvite(this,e)}clone(e=this.name,t=!0,n=!0){return this.guild.createChannel(e,this.type,t?this.permissionOverwrites:[]).then(e=>n?e.setTopic(this.topic):e)}equals(e){let t=e&&this.id===e.id&&this.type===e.type&&this.topic===e.topic&&this.position===e.position&&this.name===e.name;return t&&(t=this.permissionOverwrites&&e.permissionOverwrites?this.permissionOverwrites.equals(e.permissionOverwrites):!this.permissionOverwrites&&!e.permissionOverwrites),t}get deletable(){return this.id!==this.guild.id&&this.permissionsFor(this.client.user).hasPermission(o.FLAGS.MANAGE_CHANNELS)}toString(){return`<#${this.id}>`}}e.exports=c},function(e,t,n){(function(e){function n(e,t){for(var n=0,i=e.length-1;i>=0;i--){var s=e[i];"."===s?e.splice(i,1):".."===s?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,s="/"===o.charAt(0))}return t=n(i(t.split("/"),function(e){return!!e}),!s).join("/"),(s?"/":"")+t||"."},t.normalize=function(e){var s=t.isAbsolute(e),r="/"===o(e,-1);return e=n(i(e.split("/"),function(e){return!!e}),!s).join("/"),e||s||(e="."),e&&r&&(e+="/"),(s?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var s=i(e.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,c=0;c[e.id,e.nick]))),this.recipients||(this.recipients=new r),e.recipients)for(const t of e.recipients){const e=this.client.dataManager.newUser(t);this.recipients.set(e.id,e)}this.lastMessageID=e.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(e){const t=e&&this.id===e.id&&this.name===e.name&&this.icon===e.icon&&this.ownerID===e.ownerID;return t?this.recipients.equals(e.recipients):t}addUser(e,t){return this.client.rest.methods.addUserToGroupDM(this,{nick:t,id:this.client.resolver.resolveUserID(e),accessToken:e})}toString(){return this.name}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t){class n{constructor(e,t,n){this.reaction=e,this.name=t,this.id=n}get identifier(){return this.id?`${this.name}:${this.id}`:encodeURIComponent(this.name)}toString(){return this.id?`<:${this.name}:${this.id}>`:this.name}}e.exports=n},function(e,t,n){const i=n(26);class s{constructor(e,t,n){e?(Object.defineProperty(this,"client",{value:e}),t&&this.setup(t)):(this.id=t,this.token=n,Object.defineProperty(this,"client",{value:this}))}setup(e){this.name=e.name,this.token=e.token,this.avatar=e.avatar,this.id=e.id,this.guildID=e.guild_id,this.channelID=e.channel_id,e.user?this.owner=this.client.users?this.client.users.get(e.user.id):e.user:this.owner=null}send(e,t){return t||"object"!=typeof e||e instanceof Array?t||(t={}):(t=e,e=""),t.file?("string"==typeof t.file&&(t.file={attachment:t.file}),t.file.name||("string"==typeof t.file.attachment?t.file.name=i.basename(t.file.attachment):t.file.attachment&&t.file.attachment.path?t.file.name=i.basename(t.file.attachment.path):t.file.name="file.jpg"),this.client.resolver.resolveBuffer(t.file.attachment).then(n=>this.client.rest.methods.sendWebhookMessage(this,e,t,{file:n,name:t.file.name}))):this.client.rest.methods.sendWebhookMessage(this,e,t)}sendMessage(e,t={}){return this.send(e,t)}sendFile(e,t,n,i={}){return this.send(n,Object.assign(i,{file:{attachment:e,name:t}}))}sendCode(e,t,n={}){return this.send(t,Object.assign(n,{code:e}))}sendSlackMessage(e){return this.client.rest.methods.sendSlackWebhookMessage(this,e)}edit(e=this.name,t){return t?this.client.resolver.resolveBuffer(t).then(t=>{const n=this.client.resolver.resolveBase64(t);return this.client.rest.methods.editWebhook(this,e,n)}):this.client.rest.methods.editWebhook(this,e).then(e=>{this.setup(e);return this})}delete(){return this.client.rest.methods.deleteWebhook(this)}}e.exports=s},function(e,t,n){"use strict";(function(e){var i=n(5),s=i.Buffer,r=i.SlowBuffer,o=i.kMaxLength||2147483647;t.alloc=function(e,t,n){if("function"==typeof s.alloc)return s.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>o)throw new RangeError("size is too large");var i=n,r=t;void 0===r&&(i=void 0,r=0);var a=new s(e);if("string"==typeof r)for(var c=new s(r,i),u=c.length,l=-1;++lo)throw new RangeError("size is too large");return new s(e)},t.from=function(t,n,i){if("function"==typeof s.from&&(!e.Uint8Array||Uint8Array.from!==s.from))return s.from(t,n,i);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new s(t,n);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var r=n;if(1===arguments.length)return new s(t);void 0===r&&(r=0);var o=i;if(void 0===o&&(o=t.byteLength-r),r>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-r)throw new RangeError("'length' is out of bounds");return new s(t.slice(r,r+o))}if(s.isBuffer(t)){var a=new s(t.length);return t.copy(a,0,0,t.length),a}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new s(t);if("Buffer"===t.type&&Array.isArray(t.data))return new s(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},t.allocUnsafeSlow=function(e){if("function"==typeof s.allocUnsafeSlow)return s.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=o)throw new RangeError("size is too large");return new r(e)}}).call(t,n(9))},function(e,t,n){var i,s,r;/**
+ * @license long.js (c) 2013 Daniel Wirtz
+ * Released under the Apache License, Version 2.0
+ * see: https://github.com/dcodeIO/long.js for details
+ */
+!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(t,s):i)&&(e.exports=r)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=c[e])?i:(n=s(e,(0|e)<0?-1:0,!0),r&&(c[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e])?i:(n=s(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function i(e,t){if(isNaN(e)||!isFinite(e))return t?m:f;if(t){if(e<0)return m;if(e>=h)return w}else{if(e<=-p)return _;if(e+1>=p)return E}return e<0?i(-e,t).neg():s(e%l|0,e/l|0,t)}function s(t,n,i){return new e(t,n,i)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(e.substring(1),t,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},y.toString=function(e){if((e=e||10)<2||36>>0,h=l.toString(e);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},y.isOdd=function(){return 1==(1&this.low)},y.isEven=function(){return 0==(1&this.low)},y.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},y.eq=y.equals,y.notEquals=function(e){return!this.eq(e)},y.neq=y.notEquals,y.lessThan=function(e){return this.comp(e)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(e){return this.comp(e)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(e){return this.comp(e)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(e){return this.comp(e)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(g)},y.neg=y.negate,y.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=65535&e.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},y.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},y.sub=y.subtract,y.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=o(e)),e.isZero())return f;if(this.eq(_))return e.isOdd()?_:f;if(e.eq(_))return this.isOdd()?_:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,m=0,g=0,v=0,b=0;return b+=c*p,v+=b>>>16,b&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|b,m<<16|g,this.unsigned)},y.mul=y.multiply,y.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;r=m}else{if(this.eq(_)){if(e.eq(g)||e.eq(b))return _;if(e.eq(_))return g;return n=this.shr(1).div(e).shl(1),n.eq(f)?e.isNegative()?g:b:(s=this.sub(e.mul(n)),r=n.add(s.div(e)))}if(e.eq(_))return this.unsigned?m:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=f}for(s=this;s.gte(e);){n=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(e);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(e);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},y.div=y.divide,y.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},y.mod=y.modulo,y.not=function(){return s(~this.low,~this.high,this.unsigned)},y.and=function(e){return t(e)||(e=o(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},y.or=function(e){return t(e)||(e=o(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},y.xor=function(e){return t(e)||(e=o(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},y.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<>>32-e,this.unsigned):s(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return s(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?s(n,0,this.unsigned):s(n>>>e-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},y.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},y.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t,n){"use strict";(function(t){function n(e,n,i,s){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:A;a.WritableState=o;var T=n(20);T.inherits=n(10);var S={deprecate:n(98)},D=n(57),M=n(5).Buffer,C=n(31);T.inherits(a,D),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof o}})):I=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,r=!1,o=M.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,e,n))&&(i.pendingcb++,r=h(this,i,o,e,t,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||b(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||y(this,i,n)}}).call(t,n(6),n(95).setImmediate)},function(e,t,n){(function(t,i,s){const r=n(89),o="__SNEKFETCH_SYNC_REQUEST";let a=!0;for(let e of r.METHODS)e="M-SEARCH"===e?"msearch":e.toLowerCase(),r[`${e}Sync`]=((s,r={})=>{a&&(a=!1,console.error("Performing sync requests is a really stupid thing to do. https://www.google.com/search?q=why+sync+requests+are+bad+nodejs"));r.url=s;r.method=e;const c=n(27);const u=JSON.parse(c.execSync(`node ${t}/index.js`,{env:{[o]:JSON.stringify(r)}}).toString(),(e,t)=>{if(null===t)return t;if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data);if(t.__CONVERT_TO_ERROR){const e=new Error;for(const n of Object.keys(t))"__CONVERT_TO_ERROR"!==n&&(e[n]=t[n]);return e}return t});if(u.error)throw u.error;return u});if(s.env[o]){const e=JSON.parse(s.env[o]),t=r[e.method](e.url);e.headers&&t.set(e.headers),e.body&&t.send(e.body),t.end((e,t={})=>{if(e){const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=e[t];t.error=n,t.error.__CONVERT_TO_ERROR=!0}t.request=null;s.stdout.write(JSON.stringify(t))})}e.exports=r}).call(t,"node_modules/snekfetch",n(5).Buffer,n(6))},function(e,t,n){(function(t){const i=n(26),s=n(27),r=n(36),o=n(0),a=n(4).convertToBuffer,c=n(16),u=n(19),l=n(24),h=n(14),p=n(18),d=n(17),f=n(29);class m{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof p?e.user:e instanceof u?e.author:e instanceof l?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof p?e.id:"string"==typeof e?e||null:e instanceof u?e.author.id:e instanceof l?e.ownerID:null}resolveGuild(e){return e instanceof l?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof p?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof h?e:"string"==typeof e?this.client.channels.get(e)||null:e instanceof u?e.channel:e instanceof l?e.channels.get(e.id)||null:null}resolveChannelID(e){return e instanceof h?e.id:"string"==typeof e?e:e instanceof u?e.channel.id:e instanceof l?e.defaultChannel.id:null}resolveInviteCode(e){const t=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e))r.get(e).end((e,i)=>{if(e)return o(e);if(!(i.body instanceof t))return o(new TypeError("The response body isn't a Buffer."));return n(i.body)});else{const t=i.resolve(e);s.stat(t,(e,i)=>{if(e)return o(e);if(!i||!i.isFile())return o(new Error(`The file could not be found: ${t}`));s.readFile(t,(e,t)=>{e?o(e):n(t)});return null})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof f?e.identifier:"string"==typeof e?this.client.emojis.has(e)?this.client.emojis.get(e).identifier:e.includes("%")?e:encodeURIComponent(e):null}static resolveColor(e){if("string"==typeof e){if("RANDOM"===e)return Math.floor(16777216*Math.random());e=o.Colors[e]||parseInt(e.replace("#",""),16)}else e instanceof Array&&(e=(e[0]<<16)+(e[1]<<8)+e[2]);if(e<0||e>16777215)throw new RangeError("Color must be within the range 0 - 16777215 (0xFFFFFF).");if(e&&isNaN(e))throw new TypeError("Unable to convert color to a number.");return e}resolveColor(e){return this.constructor.resolveColor(e)}}e.exports=m}).call(t,n(5).Buffer)},function(e,t){e.exports={name:"discord.js",version:"11.1.0",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"npm run lint && npm run docs:test",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","docs:test":"docgen --source src --custom docs/index.yml",lint:"eslint src","lint:fix":"eslint --fix src",webpack:"parallel-webpack"},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",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^0.14.0",ws:"^2.0.0"},peerDependencies:{bufferutil:"^2.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1",uws:"^0.14.1","libsodium-wrappers":"^0.5.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"^2.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!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/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(e,t,n){const i=n(16),s=n(3),r=n(40);class o extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof e.premium?e.premium:null,this.mfaEnabled="boolean"==typeof e.mfa_enabled?e.mfa_enabled:null,this.mobile="boolean"==typeof e.mobile?e.mobile:null,e.user_settings&&(this.settings=new r(this,e.user_settings))}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e,t){return this.client.rest.methods.updateCurrentUser({username:e},t)}setEmail(e,t){return this.client.rest.methods.updateCurrentUser({email:e},t)}setPassword(e,t){return this.client.rest.methods.updateCurrentUser({password:e},t)}setAvatar(e){return"string"==typeof e&&e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");n=e.status}e.game?(i=e.game,i.url&&(i.type=1)):void 0!==e.game&&(i=null);void 0!==e.afk&&(s=e.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);t(this)})}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return e?this.setPresence({game:{name:e,url:t}}):this.setPresence({game:null})}setAFK(e){return this.setPresence({afk:e})}fetchMentions(e={limit:25,roles:!0,everyone:!0,guild:null}){return this.client.rest.methods.fetchMentions(e)}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?"string"==typeof n&&n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}createGroupDM(e){return this.client.rest.methods.createGroupDM({recipients:e.map(e=>this.client.resolver.resolveUserID(e.user)),accessTokens:e.map(e=>e.accessToken),nicks:e.map(e=>e.nick)})}acceptInvite(e){return this.client.rest.methods.acceptInvite(e)}}e.exports=o},function(e,t,n){const i=n(0),s=n(4);class r{constructor(e,t){this.user=e,this.patch(t)}patch(e){for(const t of Object.keys(i.UserSettingsMap)){const n=i.UserSettingsMap[t];e.hasOwnProperty(t)&&("function"==typeof n?this[n.name]=n(e[t]):this[n]=e[t])}}update(e,t){return this.user.client.rest.methods.patchUserSettings({[e]:t})}setGuildPosition(e,t,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,e.id,t,n),this.update("guild_positions",i).then(()=>e)}addRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds);return t.includes(e.id)?Promise.reject(new Error("Guild is already restricted")):(t.push(e.id),this.update("restricted_guilds",t).then(()=>e))}removeRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds),n=t.indexOf(e.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(t.splice(n,1),this.update("restricted_guilds",t).then(()=>e))}}e.exports=r},function(e,t,n){const i=n(14),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t,n){const i=n(49),s=n(50),r=n(0);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new s(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(66);class s extends i{constructor(e,t,n={}){super(e.client,t,n),this.channel=e,this.received=0,this.client.on("message",this.listener),this.options.max&&(this.options.maxProcessed=this.options.max),this.options.maxMatches&&(this.options.max=this.options.maxMatches),this._reEmitter=(e=>{this.emit("message",e)}),this.on("collect",this._reEmitter)}handle(e){return e.channel.id!==this.channel.id?null:(this.received++,{key:e.id,value:e})}postCheck(){return this.options.maxMatches&&this.collected.size>=this.options.max?"matchesLimit":this.options.max&&this.received>=this.options.maxProcessed?"limit":null}cleanup(){this.removeListener("collect",this._reEmitter),this.client.removeListener("message",this.listener)}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){if(this.type=e.type,this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new c(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.image=e.image?new s(this,e.image):null,this.video=e.video?new r(this,e.video):null,this.author=e.author?new a(this,e.author):null,this.provider=e.provider?new o(this,e.provider):null,this.footer=e.footer?new u(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let e=this.color.toString(16);for(;e.length<6;)e=`0${e}`;return`#${e}`}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.height=e.height,this.width=e.width}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url,this.iconURL=e.icon_url}}class c{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class u{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconURL=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Image=s,n.Video=r,n.Provider=o,n.Author=a,n.Field=c,n.Footer=u,e.exports=n},function(e,t,n){const i=n(3);class s{constructor(e,t,n,s){if(this.everyone=Boolean(s),t)if(t instanceof i)this.users=new i(t);else{this.users=new i;for(const n of t){let t=e.client.users.get(n.id);t||(t=e.client.dataManager.newUser(n)),this.users.set(t.id,t)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const t of n){const n=e.channel.guild.roles.get(t);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=e.content,this._guild=e.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(e=>{const t=this._guild.member(e);t&&this._members.set(t.user.id,t)}),this._members):null}get channels(){if(this._channels)return this._channels;if(!this._guild)return null;this._channels=new i;let e;for(;null!==(e=this.constructor.CHANNELS_PATTERN.exec(this._content));){const t=this._guild.channels.get(e[1]);t&&this._channels.set(t.id,t)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,e.exports=s},function(e,t,n){const i=n(3),s=n(17),r=n(29);class o{constructor(e,t,n,s){this.message=e,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,t.name,t.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message,n=this.message.client.resolver.resolveUserID(e);return n?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,n):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}this.count=this.users.size;return this.users})}}e.exports=o},function(e,t,n){const i=n(7);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins,this.redirectURIs=e.redirect_uris,this.botRequireCodeGrant=e.bot_require_code_grant,this.botPublic=e.bot_public,this.rpcApplicationState=e.rpc_application_state,this.bot=e.bot,this.flags=e.flags,this.secret=e.secret}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}reset(){return this.client.rest.methods.resetApplication(this.id)}toString(){return this.name}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.TEXT===e.type?"text":"voice"}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"channel",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.deny=e.deny,this.allow=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(25),s=n(22),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new r;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{"string"==typeof t&&t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(25),s=n(3);class r extends i{constructor(e,t){super(e,t),this.members=new s,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).hasPermission("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).hasPermission("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}}e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){S=S||n(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof S&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(j||(j=n(62).StringDecoder),this.decoder=new j(e.encoding),this.encoding=e.encoding)}function r(e){if(S=S||n(13),!(this instanceof r))return new r(e);this._readableState=new s(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),I.call(this)}function o(e,t,n,i,s){var r=l(t,n);if(r)e.emit("error",r);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||s||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),s||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e))),f(e,t)}else s||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return U.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){P("emit readable"),e.emit("readable"),w(e)}function f(e,t){t.readingMore||(t.readingMore=!0,D(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=y(e,t.buffer,t.decoder),n}function y(e,t,n){var i;return er.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++i}return t.length-=i,s}function R(e,t){var n=L.allocUnsafe(e),i=t.head,s=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,o),0===(e-=o)){o===r.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++s}return t.length-=s,n}function A(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?A(this):p(this),null;if(0===(e=u(e,t))&&t.ended)return 0===t.length&&A(this),null;var i=t.needReadable;P("need readable",i),(0===t.length||t.length-e0?_(e,t):null,null===s?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&A(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(e,n){function s(e){P("onunpipe"),e===p&&o()}function r(){P("onend"),e.end()}function o(){P("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",c),e.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",o),p.removeListener("data",a),b=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){P("ondata"),E=!1,!1!==e.write(t)||E||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==T(d.pipes,e))&&!b&&(P("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,E=!0),p.pause())}function c(t){P("onerror",t),h(),e.removeListener("error",c),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),h()}function l(){P("onfinish"),e.removeListener("close",u),h()}function h(){P("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,P("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr,m=f?r:o;d.endEmitted?D(m):p.once("end",m),e.on("unpipe",s);var v=g(p);e.on("drain",v);var b=!1,E=!1;return p.on("data",a),i(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(P("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],b={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=n(34);i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?C+="x":C+=M[I];if(!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var L=S.slice(0,x),O=S.slice(x+1),N=M.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);N&&(L.push(N[1]),O.unshift(N[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=c.toASCII(this.hostname));var P=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+P,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!b[d])for(var x=0,D=m.length;x0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=x.slice(-1)[0],T=(n.host||e.host||x.length>1)&&("."===k||".."===k)||""===k,S=0,D=x.length;D>=0;D--)k=x[D],"."===k?x.splice(D,1):".."===k?(x.splice(D,1),S++):S&&(x.splice(D,1),S--);if(!_&&!y)for(;S--;S)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),T&&"/"!==x.join("/").substr(-1)&&x.push("");var M=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(R){n.hostname=n.host=M?"":x.length?x.shift():"";var A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");A&&(n.auth=A.shift(),n.host=n.hostname=A.shift())}return _=_||n.host&&x.length,_&&!M&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function i(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function s(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=n(5).Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;t+=i.slice(0,n).toString(s)}return t}},function(e,t,n){const i=n(136),s=n(133),r=n(135),o=n(134),a=n(132),c=n(0);class u{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(c.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,s){const r=new a(this,e,t,n,i,s);if(!this.handlers[r.route]){const e=this.getRequestHandler();this.handlers[r.route]=new e(this,r.route)}return this.push(this.handlers[r.route],r)}}e.exports=u},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}}e.exports=n},function(e,t,n){(function(t){const i="browser"===n(23).platform(),s=n(12),r=n(27),o=function(){try{const e=n(184);return e.pack?e:null}catch(e){return null}}(),a=function(){if(i)return window.WebSocket;try{return n(185)}catch(e){return n(186)}}();class c extends s{constructor(e){super(e),this.ws=new a(e),i&&(this.ws.binaryType="arraybuffer"),this.ws.onmessage=this.eventMessage.bind(this),this.ws.onopen=this.emit.bind(this,"open"),this.ws.onclose=this.emit.bind(this,"close"),this.ws.onerror=this.emit.bind(this,"error")}eventMessage(e){try{const t=this.unpack(e.data);return this.emit("packet",t),!0}catch(e){return this.listenerCount("decodeError")&&this.emit("decodeError",e),!1}}send(e){this.ws.send(this.pack(e))}pack(e){return o?o.pack(e):JSON.stringify(e)}unpack(e){return o&&"string"!=typeof e?(e instanceof ArrayBuffer&&(e=t.from(new Uint8Array(e))),o.unpack(e)):((e instanceof ArrayBuffer||e instanceof t)&&(e=this.inflate(e)),JSON.parse(e))}inflate(e){return o?e:r.inflateSync(e).toString()}get readyState(){return this.ws.readyState}close(e,t){this.ws.close(e,t)}}c.ENCODING=o?"etf":"json",c.WebSocket=a,e.exports=c}).call(t,n(5).Buffer)},function(e,t,n){const i=n(3),s=n(12).EventEmitter;class r extends s{constructor(e,t,n={}){super(),this.client=e,this.filter=t,this.options=n,this.collected=new i,this.ended=!1,this._timeout=null,this.listener=this._handle.bind(this),n.time&&(this._timeout=this.client.setTimeout(()=>this.stop("time"),n.time))}_handle(...e){const t=this.handle(...e);if(t&&this.filter(...e)){this.collected.set(t.key,t.value),this.emit("collect",t.value,this);const n=this.postCheck(...e);n&&this.stop(n)}}get next(){return new Promise((e,t)=>{if(this.ended)return void t(this.collected);const n=()=>{this.removeListener("collect",i);this.removeListener("end",s)};const i=t=>{n();e(t)};const s=()=>{n();t(this.collected)};this.on("collect",i);this.on("end",s)})}stop(e="user"){this.ended||(this._timeout&&this.client.clearTimeout(this._timeout),this.ended=!0,this.cleanup(),this.emit("end",this.collected,e))}handle(){}postCheck(){}cleanup(){}}e.exports=r},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(23),EventEmitter=__webpack_require__(12).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(8),Util=__webpack_require__(4),RESTManager=__webpack_require__(63),ClientDataManager=__webpack_require__(101),ClientManager=__webpack_require__(102),ClientDataResolver=__webpack_require__(37),ClientVoiceManager=__webpack_require__(182),WebSocketManager=__webpack_require__(137),ActionsManager=__webpack_require__(103),Collection=__webpack_require__(3),Presence=__webpack_require__(11).Presence,ShardClientUtil=__webpack_require__(181),VoiceBroadcast=__webpack_require__(183);class Client extends EventEmitter{constructor(e={}){super(),!e.shardId&&"SHARD_ID"in process.env&&(e.shardId=Number(process.env.SHARD_ID)),!e.shardCount&&"SHARD_COUNT"in process.env&&(e.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,e),this._validateOptions(),this.rest=new RESTManager(this),this.dataManager=new ClientDataManager(this),this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new Collection,this.guilds=new Collection,this.channels=new Collection,this.presences=new Collection,!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._pingTimestamp=0,this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&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 ping(){return this.pings.reduce((e,t)=>e+t,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const e=new VoiceBroadcast(this);return this.broadcasts.push(e),e}login(e){return this.rest.methods.login(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e,t=!0){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e,t)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}fetchVoiceRegions(){return this.rest.methods.fetchVoiceRegions()}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,s=0;for(const e of this.channels.values())if(e.messages){i++;for(const i of e.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>t&&(e.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${e} seconds in ${i} text-based channels`),s}fetchApplication(e="@me"){return this.rest.methods.getApplication(e)}generateInvite(e){return e?e instanceof Array&&(e=Permissions.resolve(e)):e=0,this.fetchApplication().then(t=>`https://discordapp.com/oauth2/authorize?client_id=${t.id}&permissions=${e}&scope=bot`)}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_pong(e){this.pings.unshift(Date.now()-e),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(e,t){if(this.presences.has(e))return void this.presences.get(e).update(t);this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(6))},function(e,t,n){const i=n(30),s=n(63),r=n(37),o=n(0),a=n(4);class c extends i{constructor(e,t,n){super(null,e,t),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);this._timeouts.clear(),this._intervals.clear()}}e.exports=c},function(e,t,n){function i(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}const s=n(37);class r{constructor(e={}){this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.author=e.author,this.timestamp=e.timestamp,this.fields=e.fields||[],this.thumbnail=e.thumbnail,this.image=e.image,this.footer=e.footer,this.file=e.file}setTitle(e){if(e=i(e),e.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=e,this}setDescription(e){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=e,this}setURL(e){return this.url=e,this}setColor(e){return this.color=s.resolveColor(e),this}setAuthor(e,t,n){return this.author={name:i(e),icon_url:t,url:n},this}setTimestamp(e=new Date){return this.timestamp=e,this}addField(e,t,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(e=i(e),e.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field names may not be empty.");if(t=i(t),t.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:e,value:t,inline:n}),this}addBlankField(e=!1){return this.addField("","",e)}setThumbnail(e){return this.thumbnail={url:e},this}setImage(e){return this.image={url:e},this}setFooter(e,t){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:e,icon_url:t},this}attachFile(e){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=e,this}}e.exports=r},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function s(e){return 3*e.length/4-i(e)}function r(e){var t,n,s,r,o,a,c=e.length;o=i(e),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(t=0,n=0;t>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&r):1===o&&(r=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var i,s=[],r=t;rc?c:o+16383));return 1===i?(t=e[n-1],s+=u[t>>2],s+=u[t<<4&63],s+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],s+=u[t>>10],s+=u[t>>4&63],s+=u[t<<2&63],s+="="),r.push(s),r.join("")}t.byteLength=s,t.toByteArray=r,t.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=e[t+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+e[t+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+e[t+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},t.write=function(e,t,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),t+=o+h>=1?p/c:p*Math.pow(2,1-h),t*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*c-1)*Math.pow(2,s),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;e[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;e[n+d]=255&o,d+=f,o/=256,u-=8);e[n+d-f]|=128*m}},function(e,t,n){(function(e,i){var s;!function(r){function o(e){throw new RangeError(I[e])}function a(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function c(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(C,"."),i+a(e.split("."),t).join(".")}function u(e){for(var t,n,i=[],s=0,r=e.length;s=55296&&t<=56319&&s65535&&(e-=65536,t+=O(e>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:_}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?L(e/A):e>>1,e+=L(e/t);e>U*x>>1;i+=_)e=L(e/U);return L(i+(U+1)*e/(e+R))}function f(e){var t,n,i,s,r,a,c,u,p,f,m=[],g=e.length,v=0,b=T,E=k;for(n=e.lastIndexOf(S),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(e.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=_||u>L((w-v)/a))&&o("overflow"),v+=u*a,p=c<=E?y:c>=E+x?x:c-E,!(uL(w/f)&&o("overflow"),a*=f;t=m.length+1,E=d(v-r,t,0==r),L(v/t)>w-b&&o("overflow"),b+=L(v/t),v%=t,m.splice(v++,0,b)}return l(m)}function m(e){var t,n,i,s,r,a,c,l,h,f,m,g,v,b,E,R=[];for(e=u(e),g=e.length,t=T,n=0,r=k,a=0;a=t&&mL((w-n)/v)&&o("overflow"),n+=(c-t)*v,t=c,a=0;aw&&o("overflow"),m==t){for(l=n,h=_;f=h<=r?y:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=_-y,L=Math.floor,O=String.fromCharCode;E={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return E}.call(t,n,t,e))&&(e.exports=s)}()}).call(t,n(99)(e),n(9))},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t=s.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},function(e,t,n){e.exports=n(21).PassThrough},function(e,t,n){e.exports=n(21).Transform},function(e,t,n){e.exports=n(35)},function(e,t,n){(function(e,t){!function(e,n){"use strict";function i(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=3.1.0 <4.0.0",type:"range"},"/home/travis/build/hydrabolt/discord.js"]],_from:"snekfetch@>=3.1.0 <4.0.0",_id:"snekfetch@3.1.2",_inCache:!0,_location:"/snekfetch",_nodeVersion:"7.9.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574"},_npmUser:{name:"crawl",email:"icrawltogo@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"snekfetch@^3.1.0",scope:null,escapedName:"snekfetch",name:"snekfetch",rawSpec:"^3.1.0",spec:">=3.1.0 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz",_shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",_shrinkwrap:null,_spec:"snekfetch@^3.1.0",_where:"/home/travis/build/hydrabolt/discord.js",author:{name:"Gus Caplan",email:"me@gus.host"},bugs:{url:"https://github.com/GusCaplan/snekfetch/issues"},dependencies:{},description:"Just do http requests without all that weird nastiness from other libs",devDependencies:{},directories:{},dist:{shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",tarball:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz"},gitHead:"a79f6867d21ca58ffe6fc59eb77b06f257f8ad29",homepage:"https://github.com/GusCaplan/snekfetch#readme",license:"MIT",main:"index.js",maintainers:[{name:"crawl",email:"icrawltogo@gmail.com"},{name:"snek",email:"me@gus.host"}],name:"snekfetch",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/GusCaplan/snekfetch.git"},scripts:{},version:"3.1.2"}},function(e,t,n){(function(t){const i=n(26),s=n(90);class r{constructor(){this.boundary=`--snekfetch--${Math.random().toString().slice(2,7)}`,this.buffer=new t(0)}append(e,n,r){if(void 0!==n){let o=`
--${this.boundary}
Content-Disposition: form-data; name="${e}"`,a=null;if(r){o+=`; filename="${r}"`,a="application/octet-stream";const e=i.extname(r);e&&(a=s.lookup(e))}n instanceof t?a=s.buffer(n):"object"==typeof n?(a="application/json",n=t.from(JSON.stringify(n))):n=t.from(String(n)),a&&(o+=`
Content-Type: ${a}`),this.buffer=t.concat([this.buffer,t.from(`${o}
`),n])}}end(){return this.buffer=t.concat([this.buffer,t.from(`
---${this.boundary}--`)]),this.buffer}}e.exports=r}).call(t,n(5).Buffer)},function(e,t,n){(function(t){function i(e){return c.format({protocol:e.connection.encrypted?"https:":"http:",hostname:e.getHeader("host"),pathname:e.path.split("?")[0],query:e.query})}n(21);const s=n(27),r=n(34),o=n(59),a=n(75),c=n(62),u=n(86),l=n(21),h=n(87);class p extends l.Readable{constructor(e,t,n={headers:{},data:null}){super();const i=c.parse(t);i.method=e.toUpperCase(),i.headers=n.headers,this.data=n.data,this.request=("https:"===i.protocol?a:o).request(i)}query(e,t){if(this.request.res)throw new Error("Cannot modify query after being sent!");return this.request.query||(this.request.query={}),null!==e&&"object"==typeof e?this.request.query=Object.assign(this.request.query,e):this.request.query[e]=t,this}set(e,t){if(this.request.res)throw new Error("Cannot modify headers after being sent!");if(null!==e&&"object"==typeof e)for(const n of Object.keys(e))this.set(n,e[n]);else this.request.setHeader(e,t);return this}attach(e,t,n){if(this.request.res)throw new Error("Cannot modify data after being sent!");const i=this._getFormData();return this.set("Content-Type",`multipart/form-data; boundary=${i.boundary}`),i.append(e,t,n),this.data=i,this}send(e){if(this.request.res)throw new Error("Cannot modify data after being sent!");if(null!==e&&"object"==typeof e){const t=this.request.getHeader["content-type"];let n;t?t.includes("json")?n=JSON.stringify:t.includes("urlencoded")&&(n=r.stringify):(this.set("Content-Type","application/json"),n=JSON.stringify),this.data=n(e)}else this.data=e;return this}then(e,n){return new Promise((e,n)=>{const a=this.request,u=e=>{e||(e=new Error("Unknown error occured")),e.request=a,n(e)};a.on("abort",u),a.on("aborted",u),a.on("error",u),a.on("response",u=>{const h=new l.PassThrough;this._shouldUnzip(u)?u.pipe(s.createUnzip({flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH})).pipe(h):u.pipe(h);let d=[];h.on("data",e=>{this.push(e)||this.pause(),d.push(e)}),h.on("end",()=>{this.push(null);const s=t.concat(d);if(this._shouldRedirect(u)){[301,302].includes(u.statusCode)?(this.method="HEAD"===this.method?"HEAD":"GET",this.data=null):303===u.statusCode&&(this.method="GET");const t={};if(this.request._headerNames)for(const n of Object.keys(this.request._headerNames))t[this.request._headerNames[n]]=this.request._headers[n];else for(const n of Object.keys(this.request._headers)){const e=this.request._headers[n];t[e.name]=e.value}return void e(new p(this.method,c.resolve(i(a),u.headers.location),{data:this.data,headers:t}))}const l={request:this.request,body:s,text:s.toString(),ok:u.statusCode>=200&&u.statusCode<300,headers:u.headers,status:u.statusCode,statusText:u.statusText||o.STATUS_CODES[u.statusCode]},h=u.headers["content-type"];if(h)if(h.includes("application/json"))try{l.body=JSON.parse(l.text)}catch(e){}else h.includes("application/x-www-form-urlencoded")&&(l.body=r.parse(l.text));if(l.ok)e(l);else{const e=new Error(`${l.status} ${l.statusText}`.trim());Object.assign(e,l),n(e)}})}),this._addFinalHeaders(),this.request.query&&(this.request.path=`${this.request.path}?${r.stringify(this.request.query)}`),a.end(this.data?this.data.end?this.data.end():this.data:null)}).then(e,n)}catch(e){return this.then(null,e)}end(e){return this.then(t=>e?e(null,t):t,t=>e?e(t,t.status?t:null):t)}read(){this.resume(),this.request.res||this.catch(e=>this.emit("error",e))}_shouldUnzip(e){return 204!==e.statusCode&&304!==e.statusCode&&("0"!==e.headers["content-length"]&&/^\s*(?:deflate|gzip)\s*$/.test(e.headers["content-encoding"]))}_shouldRedirect(e){return[301,302,303,307,308].includes(e.statusCode)}_getFormData(){return this._formData||(this._formData=new h),this._formData}_addFinalHeaders(){this.request&&(this.request.getHeader["user-agent"]||this.set("User-Agent",`snekfetch/${p.version} (${u.repository.url.replace(/\.?git/,"")})`),"HEAD"!==this.request.method&&this.set("Accept-Encoding","gzip, deflate"))}}p.version=u.version,p.METHODS=o.METHODS.concat("BREW");for(const d of p.METHODS)p["M-SEARCH"===d?"msearch":d.toLowerCase()]=(e=>new p(d,e));e.exports=p}).call(t,n(5).Buffer)},function(e,t,n){function i(e){return r[e]||r.bin}function s(e){return o(e)||r.bin}const r=n(91),o=n(90);e.exports={buffer:s,lookup:i}},function(e,t){function n(e){const t=new Uint8Array(e);if(!(t&&t.length>1))return null;if(255===t[0]&&216===t[1]&&255===t[2])return{ext:"jpg",mime:"image/jpeg"};if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return{ext:"png",mime:"image/png"};if(71===t[0]&&73===t[1]&&70===t[2])return{ext:"gif",mime:"image/gif"};if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return{ext:"webp",mime:"image/webp"};if(70===t[0]&&76===t[1]&&73===t[2]&&70===t[3])return{ext:"flif",mime:"image/flif"};if((73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])&&67===t[8]&&82===t[9])return{ext:"cr2",mime:"image/x-canon-cr2"};if(73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])return{ext:"tif",mime:"image/tiff"};if(66===t[0]&&77===t[1])return{ext:"bmp",mime:"image/bmp"};if(73===t[0]&&73===t[1]&&188===t[2])return{ext:"jxr",mime:"image/vnd.ms-photo"};if(56===t[0]&&66===t[1]&&80===t[2]&&83===t[3])return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&109===t[30]&&105===t[31]&&109===t[32]&&101===t[33]&&116===t[34]&&121===t[35]&&112===t[36]&&101===t[37]&&97===t[38]&&112===t[39]&&112===t[40]&&108===t[41]&&105===t[42]&&99===t[43]&&97===t[44]&&116===t[45]&&105===t[46]&&111===t[47]&&110===t[48]&&47===t[49]&&101===t[50]&&112===t[51]&&117===t[52]&&98===t[53]&&43===t[54]&&122===t[55]&&105===t[56]&&112===t[57])return{ext:"epub",mime:"application/epub+zip"};if(80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&77===t[30]&&69===t[31]&&84===t[32]&&65===t[33]&&45===t[34]&&73===t[35]&&78===t[36]&&70===t[37]&&47===t[38]&&109===t[39]&&111===t[40]&&122===t[41]&&105===t[42]&&108===t[43]&&108===t[44]&&97===t[45]&&46===t[46]&&114===t[47]&&115===t[48]&&97===t[49])return{ext:"xpi",mime:"application/x-xpinstall"};if(!(80!==t[0]||75!==t[1]||3!==t[2]&&5!==t[2]&&7!==t[2]||4!==t[3]&&6!==t[3]&&8!==t[3]))return{ext:"zip",mime:"application/zip"};if(117===t[257]&&115===t[258]&&116===t[259]&&97===t[260]&&114===t[261])return{ext:"tar",mime:"application/x-tar"};if(82===t[0]&&97===t[1]&&114===t[2]&&33===t[3]&&26===t[4]&&7===t[5]&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(31===t[0]&&139===t[1]&&8===t[2])return{ext:"gz",mime:"application/gzip"};if(66===t[0]&&90===t[1]&&104===t[2])return{ext:"bz2",mime:"application/x-bzip2"};if(55===t[0]&&122===t[1]&&188===t[2]&&175===t[3]&&39===t[4]&&28===t[5])return{ext:"7z",mime:"application/x-7z-compressed"};if(120===t[0]&&1===t[1])return{ext:"dmg",mime:"application/x-apple-diskimage"};if(0===t[0]&&0===t[1]&&0===t[2]&&(24===t[3]||32===t[3])&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]||51===t[0]&&103===t[1]&&112===t[2]&&53===t[3]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&109===t[16]&&112===t[17]&&52===t[18]&&49===t[19]&&109===t[20]&&112===t[21]&&52===t[22]&&50===t[23]&&105===t[24]&&115===t[25]&&111===t[26]&&109===t[27]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&105===t[8]&&115===t[9]&&111===t[10]&&109===t[11]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&0===t[15])return{ext:"mp4",mime:"video/mp4"};if(0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&86===t[10])return{ext:"m4v",mime:"video/x-m4v"};if(77===t[0]&&84===t[1]&&104===t[2]&&100===t[3])return{ext:"mid",mime:"audio/midi"};if(26===t[0]&&69===t[1]&&223===t[2]&&163===t[3]){const e=t.subarray(4,4100),n=e.findIndex((e,t,n)=>66===n[t]&&130===n[t+1]);if(n>=0){const t=n+3,i=n=>Array.from(n).every((n,i)=>e[t+i]===n.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}return 0===t[0]&&0===t[1]&&0===t[2]&&20===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]?{ext:"mov",mime:"video/quicktime"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&65===t[8]&&86===t[9]&&73===t[10]?{ext:"avi",mime:"video/x-msvideo"}:48===t[0]&&38===t[1]&&178===t[2]&&117===t[3]&&142===t[4]&&102===t[5]&&207===t[6]&&17===t[7]&&166===t[8]&&217===t[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===t[0]&&0===t[1]&&1===t[2]&&"b"===t[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===t[0]&&68===t[1]&&51===t[2]||255===t[0]&&251===t[1]?{ext:"mp3",mime:"audio/mpeg"}:102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&65===t[10]||77===t[0]&&52===t[1]&&65===t[2]&&32===t[3]?{ext:"m4a",mime:"audio/m4a"}:79===t[28]&&112===t[29]&&117===t[30]&&115===t[31]&&72===t[32]&&101===t[33]&&97===t[34]&&100===t[35]?{ext:"opus",mime:"audio/opus"}:79===t[0]&&103===t[1]&&103===t[2]&&83===t[3]?{ext:"ogg",mime:"audio/ogg"}:102===t[0]&&76===t[1]&&97===t[2]&&67===t[3]?{ext:"flac",mime:"audio/x-flac"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&65===t[9]&&86===t[10]&&69===t[11]?{ext:"wav",mime:"audio/x-wav"}:35===t[0]&&33===t[1]&&65===t[2]&&77===t[3]&&82===t[4]&&10===t[5]?{ext:"amr",mime:"audio/amr"}:37===t[0]&&80===t[1]&&68===t[2]&&70===t[3]?{ext:"pdf",mime:"application/pdf"}:77===t[0]&&90===t[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==t[0]&&70!==t[0]||87!==t[1]||83!==t[2]?123===t[0]&&92===t[1]&&114===t[2]&&116===t[3]&&102===t[4]?{ext:"rtf",mime:"application/rtf"}:119===t[0]&&79===t[1]&&70===t[2]&&70===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff",mime:"application/font-woff"}:119===t[0]&&79===t[1]&&70===t[2]&&50===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff2",mime:"application/font-woff"}:76===t[34]&&80===t[35]&&(0===t[8]&&0===t[9]&&1===t[10]||1===t[8]&&0===t[9]&&2===t[10]||2===t[8]&&0===t[9]&&2===t[10])?{ext:"eot",mime:"application/octet-stream"}:0===t[0]&&1===t[1]&&0===t[2]&&0===t[3]&&0===t[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===t[0]&&84===t[1]&&84===t[2]&&79===t[3]&&0===t[4]?{ext:"otf",mime:"application/font-sfnt"}:0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?{ext:"ico",mime:"image/x-icon"}:70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]?{ext:"flv",mime:"video/x-flv"}:37===t[0]&&33===t[1]?{ext:"ps",mime:"application/postscript"}:253===t[0]&&55===t[1]&&122===t[2]&&88===t[3]&&90===t[4]&&0===t[5]?{ext:"xz",mime:"application/x-xz"}:83===t[0]&&81===t[1]&&76===t[2]&&105===t[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===t[0]&&69===t[1]&&83===t[2]&&26===t[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===t[0]&&114===t[1]&&50===t[2]&&52===t[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===t[0]&&83===t[1]&&67===t[2]&&70===t[3]||73===t[0]&&83===t[1]&&99===t[2]&&40===t[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]&&10===t[7]&&100===t[8]&&101===t[9]&&98===t[10]&&105===t[11]&&97===t[12]&&110===t[13]&&45===t[14]&&98===t[15]&&105===t[16]&&110===t[17]&&97===t[18]&&114===t[19]&&121===t[20]?{ext:"deb",mime:"application/x-deb"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===t[0]&&171===t[1]&&238===t[2]&&219===t[3]?{ext:"rpm",mime:"application/x-rpm"}:31===t[0]&&160===t[1]||31===t[0]&&157===t[1]?{ext:"Z",mime:"application/x-compress"}:76===t[0]&&90===t[1]&&73===t[2]&&80===t[3]?{ext:"lz",mime:"application/x-lzip"}:208===t[0]&&207===t[1]&&17===t[2]&&224===t[3]&&161===t[4]&&177===t[5]&&26===t[6]&&225===t[7]?{ext:"msi",mime:"application/x-msi"}:6===t[0]&&14===t[1]&&43===t[2]&&52===t[3]&&2===t[4]&&5===t[5]&&1===t[6]&&1===t[7]&&13===t[8]&&1===t[9]&&2===t[10]&&1===t[11]&&1===t[12]&&2===t[13]?{ext:"mxf",mime:"application/mxf"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}}e.exports=n},function(e,t){e.exports={123:"application/vnd.lotus-1-2-3",ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",bdoc:"application/x-bdoc",ccxml:"application/ccxml+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",ecma:"application/ecmascript",emma:"application/emma+xml",epub:"application/epub+zip",exi:"application/exi",pfr:"application/font-tdpfr",woff:"application/font-woff",woff2:"application/font-woff2",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/x-msdownload",dll:"application/x-msdownload",deb:"application/x-debian-package",dmg:"application/x-apple-diskimage",iso:"application/x-iso9660-image",img:"application/octet-stream",msi:"application/x-msdownload",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",cww:"application/prs.cww",pskcxml:"application/pskc+xml",rdf:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"text/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap",pwn:"application/vnd.3m.post-it-notes",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",acutc:"application/vnd.acucorp",air:"application/vnd.adobe.air-application-installer-package+zip",fcdt:"application/vnd.adobe.formscentral.fcdt",fxp:"application/vnd.adobe.fxp",fxpl:"application/vnd.adobe.fxp",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",acc:"application/vnd.americandynamics.acc",ami:"application/vnd.amiga.ami",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",mpkg:"application/vnd.apple.installer+xml",m3u8:"application/vnd.apple.mpegurl",pkpass:"application/vnd.apple.pkpass",swi:"application/vnd.aristanetworks.swi",iota:"application/vnd.astraea-software.iota",aep:"application/vnd.audiograph",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",rep:"application/vnd.businessobjects",cdxml:"application/vnd.chemdraw+xml",mmd:"application/vnd.chipnuts.karaoke-mmd",cdy:"application/vnd.cinderella",cla:"application/vnd.claymore",rp9:"application/vnd.cloanto.rp9",c4g:"application/vnd.clonk.c4group",c4d:"application/vnd.clonk.c4group",c4f:"application/vnd.clonk.c4group",c4p:"application/vnd.clonk.c4group",c4u:"application/vnd.clonk.c4group",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",csp:"application/vnd.commonspace",cdbcmsg:"application/vnd.contact.cmsg",cmc:"application/vnd.cosmocaller",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",pml:"application/vnd.ctc-posml",ppd:"application/vnd.cups-ppd",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",dart:"application/vnd.dart",rdz:"application/vnd.data-vision.rdz",uvf:"application/vnd.dece.data",uvvf:"application/vnd.dece.data",uvd:"application/vnd.dece.data",uvvd:"application/vnd.dece.data",uvt:"application/vnd.dece.ttml+xml",uvvt:"application/vnd.dece.ttml+xml",uvx:"application/vnd.dece.unspecified",uvvx:"application/vnd.dece.unspecified",uvz:"application/vnd.dece.zip",uvvz:"application/vnd.dece.zip",fe_launch:"application/vnd.denovo.fcselayout-link",dna:"application/vnd.dna",mlp:"application/vnd.dolby.mlp",dpg:"application/vnd.dpgraph",dfac:"application/vnd.dreamfactory",kpxx:"application/vnd.ds-keypoint",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",geo:"application/vnd.dynageo",mag:"application/vnd.ecowin.chart",nml:"application/vnd.enliven",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",qam:"application/vnd.epson.quickanime",slt:"application/vnd.epson.salt",ssf:"application/vnd.epson.ssf",es3:"application/vnd.eszigno3+xml",et3:"application/vnd.eszigno3+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fdf:"application/vnd.fdf",mseed:"application/vnd.fdsn.mseed",seed:"application/vnd.fdsn.seed",dataless:"application/vnd.fdsn.seed",gph:"application/vnd.flographit",ftc:"application/vnd.fluxtime.clip",fm:"application/vnd.framemaker",frame:"application/vnd.framemaker",maker:"application/vnd.framemaker",book:"application/vnd.framemaker",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",fsc:"application/vnd.fsc.weblaunch",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",fzs:"application/vnd.fuzzysheet",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gex:"application/vnd.geometry-explorer",gre:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gmx:"application/vnd.gmx",gdoc:"application/vnd.google-apps.document",gslides:"application/vnd.google-apps.presentation",gsheet:"application/vnd.google-apps.spreadsheet",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gqs:"application/vnd.grafeq",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",hal:"application/vnd.hal+xml",zmm:"application/vnd.handheld-entertainment+xml",hbci:"application/vnd.hbci",les:"application/vnd.hhe.lesson-player",hpgl:"application/vnd.hp-hpgl",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",pclxl:"application/vnd.hp-pclxl","sfd-hdstx":"application/vnd.hydrostatix.sof-data",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",listafp:"application/vnd.ibm.modcap",list3820:"application/vnd.ibm.modcap",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",icc:"application/vnd.iccprofile",icm:"application/vnd.iccprofile",igl:"application/vnd.igloader",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",igm:"application/vnd.insors.igm",xpw:"application/vnd.intercon.formnet",xpx:"application/vnd.intercon.formnet",i2g:"application/vnd.intergeo",qbo:"application/vnd.intu.qbo",qfx:"application/vnd.intu.qfx",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",xpr:"application/vnd.is-xpr",fcs:"application/vnd.isac.fcs",jam:"application/vnd.jam",rms:"application/vnd.jcp.javame.midlet-rms",jisp:"application/vnd.jisp",joda:"application/vnd.joost.joda-archive",ktz:"application/vnd.kahootz",ktr:"application/vnd.kahootz",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",kpt:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",kwt:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",knp:"application/vnd.kinar",skp:"application/vnd.koan",skd:"application/vnd.koan",skt:"application/vnd.koan",skm:"application/vnd.koan",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",portpkg:"application/vnd.macports.portpkg",mcd:"application/vnd.mcd",mc1:"application/vnd.medcalcdata",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",mif:"application/vnd.mif",daf:"application/vnd.mobius.daf",dis:"application/vnd.mobius.dis",mbk:"application/vnd.mobius.mbk",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",plc:"application/vnd.mobius.plc",txf:"application/vnd.mobius.txf",mpn:"application/vnd.mophun.application",mpc:"application/vnd.mophun.certificate",xul:"application/vnd.mozilla.xul+xml",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",xls:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xla:"application/vnd.ms-excel",xlc:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",eot:"application/vnd.ms-fontobject",chm:"application/vnd.ms-htmlhelp",ims:"application/vnd.ms-ims",lrm:"application/vnd.ms-lrm",thmx:"application/vnd.ms-officetheme",cat:"application/vnd.ms-pki.seccat",stl:"application/vnd.ms-pki.stl",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",mpt:"application/vnd.ms-project",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wps:"application/vnd.ms-works",wks:"application/vnd.ms-works",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wpl:"application/vnd.ms-wpl",xps:"application/vnd.ms-xpsdocument",mseq:"application/vnd.mseq",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",taglet:"application/vnd.mynfc",nlu:"application/vnd.neurolanguage.nlu",ntf:"application/vnd.nitf",nitf:"application/vnd.nitf",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",oth:"application/vnd.oasis.opendocument.text-web",xo:"application/vnd.olpc-sugar",dd2:"application/vnd.oma.dd2+xml",oxt:"application/vnd.openofficeorg.extension",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mgp:"application/vnd.osgeo.mapguide.package",dp:"application/vnd.osgi.dp",esa:"application/vnd.osgi.subsystem",pdb:"application/x-pilot",pqa:"application/vnd.palm",oprc:"application/vnd.palm",paw:"application/vnd.pawaafile",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",efif:"application/vnd.picsel",wg:"application/vnd.pmi.widget",plf:"application/vnd.pocketlearn",pbd:"application/vnd.powerbuilder6",box:"application/vnd.previewsystems.box",mgz:"application/vnd.proteus.magazine",qps:"application/vnd.publishare-delta-tree",ptid:"application/vnd.pvi.ptid1",qxd:"application/vnd.quark.quarkxpress",qxt:"application/vnd.quark.quarkxpress",qwd:"application/vnd.quark.quarkxpress",qwt:"application/vnd.quark.quarkxpress",qxl:"application/vnd.quark.quarkxpress",qxb:"application/vnd.quark.quarkxpress",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",cryptonote:"application/vnd.rig.cryptonote",cod:"application/vnd.rim.cod",rm:"application/vnd.rn-realmedia",rmvb:"application/vnd.rn-realmedia-vbr",link66:"application/vnd.route66.link66+xml",st:"application/vnd.sailingtracker.track",see:"application/vnd.seemail",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",twd:"application/vnd.simtech-mindmapper",twds:"application/vnd.simtech-mindmapper",mmf:"application/vnd.smaf",teacher:"application/vnd.smart.teacher",sdkm:"application/vnd.solent.sdkm+xml",sdkd:"application/vnd.solent.sdkm+xml",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",vor:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",smzip:"application/vnd.stepmania.package",sm:"application/vnd.stepmania.stepchart",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",sus:"application/vnd.sus-calendar",susp:"application/vnd.sus-calendar",svd:"application/vnd.svd",sis:"application/vnd.symbian.install",sisx:"application/vnd.symbian.install",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",tao:"application/vnd.tao.intent-module-archive",pcap:"application/vnd.tcpdump.pcap",cap:"application/vnd.tcpdump.pcap",dmp:"application/vnd.tcpdump.pcap",tmo:"application/vnd.tmobile-livetv",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",tra:"application/vnd.trueapp",ufd:"application/vnd.ufdl",ufdl:"application/vnd.ufdl",utz:"application/vnd.uiq.theme",umj:"application/vnd.umajin",unityweb:"application/vnd.unity",uoml:"application/vnd.uoml+xml",vcx:"application/vnd.vcx",vsd:"application/vnd.visio",
-vst:"application/vnd.visio",vss:"application/vnd.visio",vsw:"application/vnd.visio",vis:"application/vnd.visionary",vsf:"application/vnd.vsf",wbxml:"application/vnd.wap.wbxml",wmlc:"application/vnd.wap.wmlc",wmlsc:"application/vnd.wap.wmlscriptc",wtb:"application/vnd.webturbo",nbp:"application/vnd.wolfram.player",wpd:"application/vnd.wordperfect",wqd:"application/vnd.wqd",stf:"application/vnd.wt.stf",xar:"application/vnd.xara",xfdl:"application/vnd.xfdl",hvd:"application/vnd.yamaha.hv-dic",hvs:"application/vnd.yamaha.hv-script",hvp:"application/vnd.yamaha.hv-voice",osf:"application/vnd.yamaha.openscoreformat",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",saf:"application/vnd.yamaha.smaf-audio",spf:"application/vnd.yamaha.smaf-phrase",cmp:"application/vnd.yellowriver-custom-menu",zir:"application/vnd.zul",zirz:"application/vnd.zul",zaz:"application/vnd.zzazz.deck+xml",vxml:"application/voicexml+xml",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",aab:"application/x-authorware-bin",x32:"application/x-authorware-bin",u32:"application/x-authorware-bin",vox:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",bcpio:"application/x-bcpio",torrent:"application/x-bittorrent",blb:"application/x-blorb",blorb:"application/x-blorb",bz:"application/x-bzip",bz2:"application/x-bzip2",boz:"application/x-bzip2",cbr:"application/x-cbr",cba:"application/x-cbr",cbt:"application/x-cbr",cbz:"application/x-cbr",cb7:"application/x-cbr",vcd:"application/x-cdlink",cfs:"application/x-cfs-compressed",chat:"application/x-chat",pgn:"application/x-chess-pgn",crx:"application/x-chrome-extension",cco:"application/x-cocoa",nsc:"application/x-conference",cpio:"application/x-cpio",csh:"application/x-csh",udeb:"application/x-debian-package",dgc:"application/x-dgc-compressed",dir:"application/x-director",dcr:"application/x-director",dxr:"application/x-director",cst:"application/x-director",cct:"application/x-director",cxt:"application/x-director",w3d:"application/x-director",fgd:"application/x-director",swa:"application/x-director",wad:"application/x-doom",ncx:"application/x-dtbncx+xml",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",dvi:"application/x-dvi",evy:"application/x-envoy",eva:"application/x-eva",bdf:"application/x-font-bdf",gsf:"application/x-font-ghostscript",psf:"application/x-font-linux-psf",otf:"font/opentype",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",pfa:"application/x-font-type1",pfb:"application/x-font-type1",pfm:"application/x-font-type1",afm:"application/x-font-type1",arc:"application/x-freearc",spl:"application/x-futuresplash",gca:"application/x-gca-compressed",ulx:"application/x-glulx",gnumeric:"application/x-gnumeric",gramps:"application/x-gramps-xml",gtar:"application/x-gtar",hdf:"application/x-hdf",php:"application/x-httpd-php",install:"application/x-install-instructions",jardiff:"application/x-java-archive-diff",jnlp:"application/x-java-jnlp-file",latex:"application/x-latex",luac:"application/x-lua-bytecode",lzh:"application/x-lzh-compressed",lha:"application/x-lzh-compressed",run:"application/x-makeself",mie:"application/x-mie",prc:"application/x-pilot",mobi:"application/x-mobipocket-ebook",application:"application/x-ms-application",lnk:"application/x-ms-shortcut",wmd:"application/x-ms-wmd",wmz:"application/x-msmetafile",xbap:"application/x-ms-xbap",mdb:"application/x-msaccess",obd:"application/x-msbinder",crd:"application/x-mscardfile",clp:"application/x-msclip",com:"application/x-msdownload",bat:"application/x-msdownload",mvb:"application/x-msmediaview",m13:"application/x-msmediaview",m14:"application/x-msmediaview",wmf:"application/x-msmetafile",emf:"application/x-msmetafile",emz:"application/x-msmetafile",mny:"application/x-msmoney",pub:"application/x-mspublisher",scd:"application/x-msschedule",trm:"application/x-msterminal",wri:"application/x-mswrite",nc:"application/x-netcdf",cdf:"application/x-netcdf",pac:"application/x-ns-proxy-autoconfig",nzb:"application/x-nzb",pl:"application/x-perl",pm:"application/x-perl",p12:"application/x-pkcs12",pfx:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",spc:"application/x-pkcs7-certificates",p7r:"application/x-pkcs7-certreqresp",rar:"application/x-rar-compressed",rpm:"application/x-redhat-package-manager",ris:"application/x-research-info-systems",sea:"application/x-sea",sh:"application/x-sh",shar:"application/x-shar",swf:"application/x-shockwave-flash",xap:"application/x-silverlight-app",sql:"application/x-sql",sit:"application/x-stuffit",sitx:"application/x-stuffitx",srt:"application/x-subrip",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",t3:"application/x-t3vm-image",gam:"application/x-tads",tar:"application/x-tar",tcl:"application/x-tcl",tk:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",texinfo:"application/x-texinfo",texi:"application/x-texinfo",obj:"application/x-tgif",ustar:"application/x-ustar",src:"application/x-wais-source",webapp:"application/x-web-app-manifest+json",der:"application/x-x509-ca-cert",crt:"application/x-x509-ca-cert",pem:"application/x-x509-ca-cert",fig:"application/x-xfig",xlf:"application/x-xliff+xml",xpi:"application/x-xpinstall",xz:"application/x-xz",z1:"application/x-zmachine",z2:"application/x-zmachine",z3:"application/x-zmachine",z4:"application/x-zmachine",z5:"application/x-zmachine",z6:"application/x-zmachine",z7:"application/x-zmachine",z8:"application/x-zmachine",xaml:"application/xaml+xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xml:"text/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xslt+xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mp3:"audio/mpeg",m4a:"audio/x-m4a",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",uva:"audio/vnd.dece.audio",uvva:"audio/vnd.dece.audio",eol:"audio/vnd.digital-winds",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",lvp:"audio/vnd.lucent.voice",pya:"audio/vnd.ms-playready.media.pya",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",rip:"audio/vnd.rip",wav:"audio/x-wav",weba:"audio/webm",aac:"audio/x-aac",aif:"audio/x-aiff",aiff:"audio/x-aiff",aifc:"audio/x-aiff",caf:"audio/x-caf",flac:"audio/x-flac",mka:"audio/x-matroska",m3u:"audio/x-mpegurl",wax:"audio/x-ms-wax",wma:"audio/x-ms-wma",ram:"audio/x-pn-realaudio",ra:"audio/x-realaudio",rmp:"audio/x-pn-realaudio-plugin",xm:"audio/xm",cdx:"chemical/x-cdx",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cml:"chemical/x-cml",csml:"chemical/x-csml",xyz:"chemical/x-xyz",bmp:"image/x-ms-bmp",cgm:"image/cgm",g3:"image/g3fax",gif:"image/gif",ief:"image/ief",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",ktx:"image/ktx",png:"image/png",btif:"image/prs.btif",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",tiff:"image/tiff",tif:"image/tiff",psd:"image/vnd.adobe.photoshop",uvi:"image/vnd.dece.graphic",uvvi:"image/vnd.dece.graphic",uvg:"image/vnd.dece.graphic",uvvg:"image/vnd.dece.graphic",djvu:"image/vnd.djvu",djv:"image/vnd.djvu",sub:"text/vnd.dvb.subtitle",dwg:"image/vnd.dwg",dxf:"image/vnd.dxf",fbs:"image/vnd.fastbidsheet",fpx:"image/vnd.fpx",fst:"image/vnd.fst",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",mdi:"image/vnd.ms-modi",wdp:"image/vnd.ms-photo",npx:"image/vnd.net-fpx",wbmp:"image/vnd.wap.wbmp",xif:"image/vnd.xiff",webp:"image/webp","3ds":"image/x-3ds",ras:"image/x-cmu-raster",cmx:"image/x-cmx",fh:"image/x-freehand",fhc:"image/x-freehand",fh4:"image/x-freehand",fh5:"image/x-freehand",fh7:"image/x-freehand",ico:"image/x-icon",jng:"image/x-jng",sid:"image/x-mrsid-image",pcx:"image/x-pcx",pic:"image/x-pict",pct:"image/x-pict",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pgm:"image/x-portable-graymap",ppm:"image/x-portable-pixmap",rgb:"image/x-rgb",tga:"image/x-tga",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",eml:"message/rfc822",mime:"message/rfc822",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",dae:"model/vnd.collada+xml",dwf:"model/vnd.dwf",gdl:"model/vnd.gdl",gtw:"model/vnd.gtw",mts:"model/vnd.mts",vtu:"model/vnd.vtu",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+binary",x3dbz:"model/x3d+binary",x3dv:"model/x3d+vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",hjson:"text/hjson",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",mml:"text/mathml",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",slim:"text/slim",slm:"text/slim",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",fly:"text/vnd.fly",flx:"text/vnd.fmi.flexstor",gv:"text/vnd.graphviz","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",jad:"text/vnd.sun.j2me.app-descriptor",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",vtt:"text/vtt",s:"text/x-asm",asm:"text/x-asm",c:"text/x-c",cc:"text/x-c",cxx:"text/x-c",cpp:"text/x-c",h:"text/x-c",hh:"text/x-c",dic:"text/x-c",htc:"text/x-component",f:"text/x-fortran",for:"text/x-fortran",f77:"text/x-fortran",f90:"text/x-fortran",hbs:"text/x-handlebars-template",java:"text/x-java-source",lua:"text/x-lua",markdown:"text/x-markdown",md:"text/x-markdown",mkd:"text/x-markdown",nfo:"text/x-nfo",opml:"text/x-opml",p:"text/x-pascal",pas:"text/x-pascal",pde:"text/x-processing",sass:"text/x-sass",scss:"text/x-scss",etx:"text/x-setext",sfv:"text/x-sfv",ymp:"text/x-suse-ymp",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpeg",jpm:"video/jpm",jpgm:"video/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",uvh:"video/vnd.dece.hd",uvvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",uvvv:"video/vnd.dece.video",dvb:"video/vnd.dvb.file",fvt:"video/vnd.fvt",mxu:"video/vnd.mpegurl",m4u:"video/vnd.mpegurl",pyv:"video/vnd.ms-playready.media.pyv",uvu:"video/vnd.uvvu.mp4",uvvu:"video/vnd.uvvu.mp4",viv:"video/vnd.vivo",webm:"video/webm",f4v:"video/x-f4v",fli:"video/x-fli",flv:"video/x-flv",m4v:"video/x-m4v",mkv:"video/x-matroska",mk3d:"video/x-matroska",mks:"video/x-matroska",mng:"video/x-mng",asf:"video/x-ms-asf",asx:"video/x-ms-asf",vob:"video/x-ms-vob",wm:"video/x-ms-wm",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",avi:"video/x-msvideo",movie:"video/x-sgi-movie",smv:"video/x-smv",ice:"x-conference/x-cooltalk"}},function(e,t,n){(function(t,i,s){function r(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}function o(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}var a=n(60),c=n(11),u=n(93),l=n(37),h=n(95),p=u.IncomingMessage,d=u.readyStates,f=e.exports=function(e){var n=this;l.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){n.setHeader(t,e.headers[t])});var i,s=!0;if("disable-fetch"===e.mode||"timeout"in e)s=!1,i=!0;else if("prefer-streaming"===e.mode)i=!1;else if("allow-wrong-content-type"===e.mode)i=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");i=!0}n._mode=r(i,s),n.on("finish",function(){n._onFinish()})};c(f,l.Writable),f.prototype.setHeader=function(e,t){var n=this,i=e.toLowerCase();m.indexOf(i)===-1&&(n._headers[i]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value},f.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,r=e._headers,o=null;if("POST"!==n.method&&"PUT"!==n.method&&"PATCH"!==n.method&&"MERGE"!==n.method||(o=a.blobConstructor?new i.Blob(e._body.map(function(e){return h(e)}),{type:(r["content-type"]||{}).value||""}):t.concat(e._body).toString()),"fetch"===e._mode){var c=Object.keys(r).map(function(e){return[r[e].name,r[e].value]});i.fetch(e._opts.url,{method:e._opts.method,headers:c,body:o||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then(function(t){e._fetchResponse=t,e._connect()},function(t){e.emit("error",t)})}else{var u=e._xhr=new i.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void s.nextTick(function(){e.emit("error",t)})}"responseType"in u&&(u.responseType=e._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"timeout"in n&&(u.timeout=n.timeout,u.ontimeout=function(){e.emit("timeout")}),Object.keys(r).forEach(function(e){u.setRequestHeader(r[e].name,r[e].value)}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{u.send(o)}catch(t){return void s.nextTick(function(){e.emit("error",t)})}}}},f.prototype._onXHRProgress=function(){var e=this;o(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new p(e._xhr,e._fetchResponse,e._mode),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},f.prototype._write=function(e,t,n){var i=this;i._body.push(e),n()},f.prototype.abort=f.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},f.prototype.end=function(e,t,n){var i=this;"function"==typeof e&&(n=e,e=void 0),l.Writable.prototype.end.call(i,e,t,n)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(t,n(5).Buffer,n(9),n(6))},function(e,t,n){(function(e,i,s){var r=n(60),o=n(11),a=n(37),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=t.IncomingMessage=function(t,n,s){function o(){u.read().then(function(e){if(!c._destroyed){if(e.done)return void c.push(null);c.push(new i(e.value)),o()}}).catch(function(e){c.emit("error",e)})}var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){e.nextTick(function(){c.emit("close")})}),"fetch"===s){c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach(function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)});var u=n.body.getReader();o()}else{c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText;var l=t.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(t[2])):void 0!==c.headers[n]?c.headers[n]+=", "+t[2]:c.headers[n]=t[2],c.rawHeaders.push(t[1],t[2])}}),c._charset="x-user-defined",!r.overrideMimeType){var h=c.rawHeaders["mime-type"];if(h){var p=h.match(/;\s*charset=([^;])(;|$)/);p&&(c._charset=p[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};o(u,a.Readable),u.prototype._read=function(){},u.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==c.DONE)break;try{n=new s.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new i(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var o=new i(r.length),a=0;ae._pos&&(e.push(new i(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(n)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(t,n(6),n(5).Buffer,n(9))},function(e,t,n){function i(e,t){this._id=e,this._clearFn=t}var s=Function.prototype.apply;t.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(85),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){var i=n(5).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(i.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,s=0;s{this.client.emit(i.Events.GUILD_CREATE,n)}):this.client.emit(i.Events.GUILD_CREATE,n)),n}newUser(e){if(this.client.users.has(e.id))return this.client.users.get(e.id);const t=new o(this.client,e);return this.client.users.set(t.id,t),t}newChannel(e,t){const n=this.client.channels.has(e.id);let s;return e.type===i.ChannelTypes.DM?s=new a(this.client,e):e.type===i.ChannelTypes.GROUP_DM?s=new p(this.client,e):(t=t||this.client.guilds.get(e.guild_id),t&&(e.type===i.ChannelTypes.TEXT?(s=new u(t,e),t.channels.set(s.id,s)):e.type===i.ChannelTypes.VOICE&&(s=new l(t,e),t.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(e,t){const n=t.emojis.has(e.id);if(e&&!n){let n=new c(t,e);return this.client.emit(i.Events.GUILD_EMOJI_CREATE,n),t.emojis.set(n.id,n),n}return n?t.emojis.get(e.id):null}killEmoji(e){e instanceof c&&e.guild&&(this.client.emit(i.Events.GUILD_EMOJI_DELETE,e),e.guild.emojis.delete(e.id))}killGuild(e){const t=this.client.guilds.has(e.id);this.client.guilds.delete(e.id),t&&this.pastReady&&this.client.emit(i.Events.GUILD_DELETE,e)}killUser(e){this.client.users.delete(e.id)}killChannel(e){this.client.channels.delete(e.id),e instanceof h&&e.guild.channels.delete(e.id)}updateGuild(e,t){const n=s.cloneObject(e);e.setup(t),this.pastReady&&this.client.emit(i.Events.GUILD_UPDATE,n,e)}updateChannel(e,t){e.setup(t)}updateEmoji(e,t){const n=s.cloneObject(e);return e.setup(t),this.client.emit(i.Events.GUILD_EMOJI_UPDATE,n,e),e}}e.exports=d},function(e,t,n){const i=n(0),s=n(65);class r{constructor(e){this.client=e,this.heartbeatInterval=null}connectToWebSocket(e,t,n){this.client.emit(i.Events.DEBUG,`Authenticated using token ${e}`),this.client.token=e;const r=this.client.setTimeout(()=>n(new Error(i.Errors.TOOK_TOO_LONG)),3e5);this.client.rest.methods.getGateway().then(o=>{const a=i.DefaultOptions.ws.version,c=`${o.url}/?v=${a}&encoding=${s.ENCODING}`;this.client.emit(i.Events.DEBUG,`Using gateway ${c}`),this.client.ws.connect(c),this.client.ws.once("close",e=>{4004===e.code&&n(new Error(i.Errors.BAD_LOGIN)),4010===e.code&&n(new Error(i.Errors.INVALID_SHARD)),4011===e.code&&n(new Error(i.Errors.SHARDING_REQUIRED))}),this.client.once(i.Events.READY,()=>{t(e),this.client.clearTimeout(r)})},n)}setupKeepAlive(e){this.heartbeatInterval=e,this.client.setInterval(()=>this.client.ws.heartbeat(!0),e)}destroy(){return this.client.ws.destroy(),this.client.user?this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.rest.methods.logout().then(()=>{this.client.token=null}):Promise.resolve()}}e.exports=r},function(e,t,n){class i{constructor(e){this.client=e,this.register(n(121)),this.register(n(122)),this.register(n(123)),this.register(n(127)),this.register(n(124)),this.register(n(125)),this.register(n(126)),this.register(n(103)),this.register(n(104)),this.register(n(105)),this.register(n(108)),this.register(n(120)),this.register(n(113)),this.register(n(114)),this.register(n(106)),this.register(n(115)),this.register(n(116)),this.register(n(117)),this.register(n(128)),this.register(n(130)),this.register(n(129)),this.register(n(119)),this.register(n(109)),this.register(n(110)),this.register(n(111)),this.register(n(112)),this.register(n(118)),this.register(n(107))}register(e){this[e.name.replace(/Action$/,"")]=new e(this.client)}}e.exports=i},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.dataManager.newChannel(e);return{channel:n}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client;let n=t.channels.get(e.id);return n?(t.dataManager.killChannel(n),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(e.id)||null,{channel:n}}scheduleForDeletion(e){this.client.setTimeout(()=>this.deleted.delete(e),this.client.options.restWsBridgeTimeout)}}e.exports=s},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.channels.get(e.id);if(n){const i=r.cloneObject(n);return n.setup(e),t.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id),i=t.dataManager.newUser(e.user);n&&i&&t.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n)for(const i of e.channels){const e=n.channels.get(i.id);e&&(e.position=i.position)}return{guild:n}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client;let n=t.guilds.get(e.id);if(n){for(const i of n.channels.values())"text"===i.type&&i.stopTyping(!0);if(n.available&&e.unavailable)return n.available=!1,t.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};t.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(e.id)||null;return{guild:n}}scheduleForDeletion(e){this.client.setTimeout(()=>this.deleted.delete(e),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e,t){const n=this.client,i=n.dataManager.newEmoji(t,e);return{emoji:i}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client;return t.dataManager.killEmoji(e),{emoji:e}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e,t){const n=this.client.dataManager.updateEmoji(e,t);return{emoji:n}}}e.exports=s},function(e,t,n){function i(e){const t=new Map;for(const n of e)t.set(...n);return t}const s=n(2);class r extends s{handle(e){const t=this.client.guilds.get(e.guild_id);if(t&&t.emojis){const n=i(t.emojis.entries());for(const s of e.emojis){const e=t.emojis.get(s.id);e?(n.delete(s.id),e.equals(s,!0)||this.client.actions.GuildEmojiUpdate.handle(e,s)):this.client.actions.GuildEmojiCreate.handle(t,s)}for(const s of n.values())this.client.actions.GuildEmojiDelete.handle(s)}}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e,t){const n=e._addMember(t,!1);return{member:n}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){let i=n.members.get(e.user.id);return i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+e.user.id,i),t.status===s.Status.READY&&t.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,e.user.id)):i=this.deleted.get(n.id+e.user.id)||null,{guild:n,member:i}}return{guild:n,member:null}}scheduleForDeletion(e,t){this.client.setTimeout(()=>this.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(15);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){const i=n.roles.has(e.role.id),o=new r(n,e.role);return n.roles.set(o.id,o),i||t.emit(s.Events.GUILD_ROLE_CREATE,o),{role:o}}return{role:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){let i=n.roles.get(e.role_id);return i?(n.roles.delete(e.role_id),this.deleted.set(n.id+e.role_id,i),this.scheduleForDeletion(n.id,e.role_id),t.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+e.role_id)||null,{role:i}}return{role:null}}scheduleForDeletion(e,t){this.client.setTimeout(()=>this.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){const i=e.role;let o=null;const a=n.roles.get(i.id);return a&&(o=r.cloneObject(a),a.setup(e.role),t.emit(s.Events.GUILD_ROLE_UPDATE,o,a)),{old:o,updated:a}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n)for(const i of e.roles){const e=n.roles.get(i.id);e&&(e.position=i.position)}return{guild:n}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.id);if(n){if(e.presences)for(const t of e.presences)n._setPresence(t.user.id,t);if(e.members)for(const i of e.members){const e=n.members.get(i.user.id);e?n._updateMember(e,i):n._addMember(i,!1)}"large"in e&&(n.large=e.large)}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.id);if(n){const i=r.cloneObject(n);return n.setup(e),t.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(19);class r extends i{handle(e){const t=this.client,n=t.channels.get((e instanceof Array?e[0]:e).channel_id),i=t.users.get((e instanceof Array?e[0]:e).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(e instanceof Array){const o=new Array(e.length);for(let a=0;athis.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=s},function(e,t,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(e){const t=this.client,n=t.channels.get(e.channel_id),i=e.ids,o=new s;for(const a of i){const e=n.messages.get(a);e&&o.set(e.id,e)}return o.size>0&&t.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.users.get(e.user_id);if(!t)return!1;const n=this.client.channels.get(e.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(e.message_id);if(!i)return!1;if(!e.emoji)return!1;
-const r=i._addReaction(e.emoji,t);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,t),{message:i,reaction:r,user:t}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.users.get(e.user_id);if(!t)return!1;const n=this.client.channels.get(e.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(e.message_id);if(!i)return!1;if(!e.emoji)return!1;const r=i._removeReaction(e.emoji,t);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,t),{message:i,reaction:r,user:t}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.channels.get(e.channel_id);if(!t||"voice"===t.type)return!1;const n=t.messages.get(e.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.channels.get(e.channel_id);if(n){const i=n.messages.get(e.id);return i?(i.patch(e),t.emit(s.Events.MESSAGE_UPDATE,i._edits[0],i),{old:i._edits[0],updated:i}):{old:i,updated:i}}return{old:null,updated:null}}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.dataManager.newUser(e);return{user:n}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.user.notes.get(e.id),i=e.note.length?e.note:null;return t.user.notes.set(e.id,i),t.emit(s.Events.USER_NOTE_UPDATE,e.id,n,i),{old:n,updated:i}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client;if(t.user){if(t.user.equals(e))return{old:t.user,updated:t.user};const n=r.cloneObject(t.user);return t.user.patch(e),t.emit(s.Events.USER_UPDATE,n,t.user),{old:n,updated:t.user}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(38),s=n(0);class r{constructor(e,t,n,i,s,r){this.rest=e,this.client=e.client,this.method=t,this.path=n.toString(),this.auth=i,this.data=s,this.files=r,this.route=this.getRoute(this.path)}getRoute(e){let t=e.split("?")[0];if(t.includes("/channels/")||t.includes("/guilds/")){const e=t.includes("/channels/")?t.indexOf("/channels/"):t.indexOf("/guilds/"),n=t.substring(e).split("/")[2];t=t.replace(/(\d{8,})/g,":id").replace(":id",n)}return t}getAuth(){if(this.client.token&&this.client.user&&this.client.user.bot)return`Bot ${this.client.token}`;if(this.client.token)return this.client.token;throw new Error(s.Errors.NO_TOKEN)}gen(){const e=`${this.client.options.http.host}/api/v${this.client.options.http.version}`,t=i[this.method](`${e}${this.path}`);if(this.auth&&t.set("Authorization",this.getAuth()),this.rest.client.browser||t.set("User-Agent",this.rest.userAgentManager.userAgent),this.files){for(const e of this.files)e&&e.file&&t.attach(e.name,e.file,e.name);"undefined"!=typeof this.data&&t.attach("payload_json",JSON.stringify(this.data))}else this.data&&t.send(this.data);return t}}e.exports=r},function(e,t,n){const i=n(34),s=n(32),r=n(8),o=n(0),a=o.Endpoints,c=n(3),u=n(7),l=n(4),h=n(16),p=n(18),d=n(19),f=n(15),m=n(44),g=n(30),v=n(176),b=n(50),E=n(14),w=n(28),y=n(24),_=n(177);class x{constructor(e){this.rest=e,this.client=e.client,this._ackToken=null}login(e=this.client.token){return new Promise((t,n)=>{if("string"!=typeof e)throw new Error(o.Errors.INVALID_TOKEN);e=e.replace(/^Bot\s*/i,""),this.client.manager.connectToWebSocket(e,t,n)})}logout(){return this.rest.makeRequest("post",a.logout,!0,{})}getGateway(e=false){return this.rest.makeRequest("get",e?a.gateway.bot:a.gateway,!0)}fetchVoiceRegions(e){let t;return t=e?a.Guild(e).voiceRegions:a.voiceRegions,this.rest.makeRequest("get",t,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new _(n));return t})}sendMessage(e,t,{tts,nonce,embed,disableEveryone,split,code,reply}={},n=null){return new Promise((i,s)=>{if("undefined"!=typeof t&&(t=this.client.resolver.resolveString(t)),"undefined"!=typeof nonce&&(nonce=parseInt(nonce),isNaN(nonce)||nonce<0))throw new RangeError("Message nonce must fit in an unsigned 64-bit integer.");if(t){if(split&&"object"!=typeof split&&(split={}),"undefined"==typeof code||"boolean"==typeof code&&code!==!0||(t=l.escapeMarkdown(this.client.resolver.resolveString(t),!0),t=`\`\`\`${"boolean"!=typeof code?code||"":""}
+--${this.boundary}--`)]),this.buffer}}e.exports=r}).call(t,n(5).Buffer)},function(e,t,n){(function(t){function i(e){return c.format({protocol:e.connection.encrypted?"https:":"http:",hostname:e.getHeader("host"),pathname:e.path.split("?")[0],query:e.query})}n(58);const s=n(27),r=n(34),o=n(59),a=n(75),c=n(61),u=n(87),l=n(58),h=n(88);class p extends l.Readable{constructor(e,t,n={headers:{},data:null}){super();const i=c.parse(t);i.method=e.toUpperCase(),i.headers=n.headers,this.data=n.data,this.request=("https:"===i.protocol?a:o).request(i)}query(e,t){if(this.request.res)throw new Error("Cannot modify query after being sent!");return this.request.query||(this.request.query={}),null!==e&&"object"==typeof e?this.request.query=Object.assign(this.request.query,e):this.request.query[e]=t,this}set(e,t){if(this.request.res)throw new Error("Cannot modify headers after being sent!");if(null!==e&&"object"==typeof e)for(const t of Object.keys(e))this.set(t,e[t]);else this.request.setHeader(e,t);return this}attach(e,t,n){if(this.request.res)throw new Error("Cannot modify data after being sent!");const i=this._getFormData();return this.set("Content-Type",`multipart/form-data; boundary=${i.boundary}`),i.append(e,t,n),this.data=i,this}send(e){if(this.request.res)throw new Error("Cannot modify data after being sent!");if(null!==e&&"object"==typeof e){const t=this.request.getHeader("content-type");let n;t?t.includes("json")?n=JSON.stringify:t.includes("urlencoded")&&(n=r.stringify):(this.set("Content-Type","application/json"),n=JSON.stringify),this.data=n(e)}else this.data=e;return this}then(e,n){return new Promise((e,n)=>{const a=this.request;const u=e=>{e||(e=new Error("Unknown error occured"));e.request=a;n(e)};a.on("abort",u);a.on("aborted",u);a.on("error",u);a.on("response",u=>{const h=new l.PassThrough;this._shouldUnzip(u)?u.pipe(s.createUnzip({flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH})).pipe(h):u.pipe(h);let d=[];h.on("data",e=>{this.push(e)||this.pause();d.push(e)});h.on("end",()=>{this.push(null);const s=t.concat(d);if(this._shouldRedirect(u)){[301,302].includes(u.statusCode)?(this.method="HEAD"===this.method?"HEAD":"GET",this.data=null):303===u.statusCode&&(this.method="GET");const t={};if(this.request._headerNames)for(const e of Object.keys(this.request._headerNames))t[this.request._headerNames[e]]=this.request._headers[e];else for(const e of Object.keys(this.request._headers)){const n=this.request._headers[e];t[n.name]=n.value}return void e(new p(this.method,c.resolve(i(a),u.headers.location),{data:this.data,headers:t}))}const l={request:this.request,body:s,text:s.toString(),ok:u.statusCode>=200&&u.statusCode<300,headers:u.headers,status:u.statusCode,statusText:u.statusText||o.STATUS_CODES[u.statusCode]};const h=u.headers["content-type"];if(h)if(h.includes("application/json"))try{l.body=JSON.parse(l.text)}catch(e){}else h.includes("application/x-www-form-urlencoded")&&(l.body=r.parse(l.text));if(l.ok)e(l);else{const e=new Error(`${l.status} ${l.statusText}`.trim());Object.assign(e,l),n(e)}})});this._addFinalHeaders();this.request.query&&(this.request.path=`${this.request.path}?${r.stringify(this.request.query)}`);a.end(this.data?this.data.end?this.data.end():this.data:null)}).then(e,n)}catch(e){return this.then(null,e)}end(e){return this.then(t=>e?e(null,t):t,t=>e?e(t,t.status?t:null):t)}_read(){this.resume(),this.request.res||this.catch(e=>this.emit("error",e))}_shouldUnzip(e){return 204!==e.statusCode&&304!==e.statusCode&&("0"!==e.headers["content-length"]&&/^\s*(?:deflate|gzip)\s*$/.test(e.headers["content-encoding"]))}_shouldRedirect(e){return[301,302,303,307,308].includes(e.statusCode)}_getFormData(){return this._formData||(this._formData=new h),this._formData}_addFinalHeaders(){this.request&&(this.request.getHeader("user-agent")||this.set("User-Agent",`snekfetch/${p.version} (${u.repository.url.replace(/\.?git/,"")})`),"HEAD"!==this.request.method&&this.set("Accept-Encoding","gzip, deflate"))}}p.version=u.version,p.METHODS=o.METHODS.concat("BREW");for(const e of p.METHODS)p["M-SEARCH"===e?"msearch":e.toLowerCase()]=(t=>new p(e,t));e.exports=p}).call(t,n(5).Buffer)},function(e,t,n){function i(e){return r[e]||r.bin}function s(e){return o(e)||r.bin}const r=n(92),o=n(91);e.exports={buffer:s,lookup:i}},function(e,t){function n(e){const t=new Uint8Array(e);if(!(t&&t.length>1))return null;if(255===t[0]&&216===t[1]&&255===t[2])return{ext:"jpg",mime:"image/jpeg"};if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return{ext:"png",mime:"image/png"};if(71===t[0]&&73===t[1]&&70===t[2])return{ext:"gif",mime:"image/gif"};if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return{ext:"webp",mime:"image/webp"};if(70===t[0]&&76===t[1]&&73===t[2]&&70===t[3])return{ext:"flif",mime:"image/flif"};if((73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])&&67===t[8]&&82===t[9])return{ext:"cr2",mime:"image/x-canon-cr2"};if(73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])return{ext:"tif",mime:"image/tiff"};if(66===t[0]&&77===t[1])return{ext:"bmp",mime:"image/bmp"};if(73===t[0]&&73===t[1]&&188===t[2])return{ext:"jxr",mime:"image/vnd.ms-photo"};if(56===t[0]&&66===t[1]&&80===t[2]&&83===t[3])return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&109===t[30]&&105===t[31]&&109===t[32]&&101===t[33]&&116===t[34]&&121===t[35]&&112===t[36]&&101===t[37]&&97===t[38]&&112===t[39]&&112===t[40]&&108===t[41]&&105===t[42]&&99===t[43]&&97===t[44]&&116===t[45]&&105===t[46]&&111===t[47]&&110===t[48]&&47===t[49]&&101===t[50]&&112===t[51]&&117===t[52]&&98===t[53]&&43===t[54]&&122===t[55]&&105===t[56]&&112===t[57])return{ext:"epub",mime:"application/epub+zip"};if(80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&77===t[30]&&69===t[31]&&84===t[32]&&65===t[33]&&45===t[34]&&73===t[35]&&78===t[36]&&70===t[37]&&47===t[38]&&109===t[39]&&111===t[40]&&122===t[41]&&105===t[42]&&108===t[43]&&108===t[44]&&97===t[45]&&46===t[46]&&114===t[47]&&115===t[48]&&97===t[49])return{ext:"xpi",mime:"application/x-xpinstall"};if(!(80!==t[0]||75!==t[1]||3!==t[2]&&5!==t[2]&&7!==t[2]||4!==t[3]&&6!==t[3]&&8!==t[3]))return{ext:"zip",mime:"application/zip"};if(117===t[257]&&115===t[258]&&116===t[259]&&97===t[260]&&114===t[261])return{ext:"tar",mime:"application/x-tar"};if(82===t[0]&&97===t[1]&&114===t[2]&&33===t[3]&&26===t[4]&&7===t[5]&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(31===t[0]&&139===t[1]&&8===t[2])return{ext:"gz",mime:"application/gzip"};if(66===t[0]&&90===t[1]&&104===t[2])return{ext:"bz2",mime:"application/x-bzip2"};if(55===t[0]&&122===t[1]&&188===t[2]&&175===t[3]&&39===t[4]&&28===t[5])return{ext:"7z",mime:"application/x-7z-compressed"};if(120===t[0]&&1===t[1])return{ext:"dmg",mime:"application/x-apple-diskimage"};if(0===t[0]&&0===t[1]&&0===t[2]&&(24===t[3]||32===t[3])&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]||51===t[0]&&103===t[1]&&112===t[2]&&53===t[3]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&109===t[16]&&112===t[17]&&52===t[18]&&49===t[19]&&109===t[20]&&112===t[21]&&52===t[22]&&50===t[23]&&105===t[24]&&115===t[25]&&111===t[26]&&109===t[27]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&105===t[8]&&115===t[9]&&111===t[10]&&109===t[11]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&0===t[15])return{ext:"mp4",mime:"video/mp4"};if(0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&86===t[10])return{ext:"m4v",mime:"video/x-m4v"};if(77===t[0]&&84===t[1]&&104===t[2]&&100===t[3])return{ext:"mid",mime:"audio/midi"};if(26===t[0]&&69===t[1]&&223===t[2]&&163===t[3]){const e=t.subarray(4,4100),n=e.findIndex((e,t,n)=>66===n[t]&&130===n[t+1]);if(n>=0){const t=n+3,i=n=>Array.from(n).every((n,i)=>e[t+i]===n.charCodeAt(0));if(i("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(i("webm"))return{ext:"webm",mime:"video/webm"}}}return 0===t[0]&&0===t[1]&&0===t[2]&&20===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]?{ext:"mov",mime:"video/quicktime"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&65===t[8]&&86===t[9]&&73===t[10]?{ext:"avi",mime:"video/x-msvideo"}:48===t[0]&&38===t[1]&&178===t[2]&&117===t[3]&&142===t[4]&&102===t[5]&&207===t[6]&&17===t[7]&&166===t[8]&&217===t[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===t[0]&&0===t[1]&&1===t[2]&&"b"===t[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===t[0]&&68===t[1]&&51===t[2]||255===t[0]&&251===t[1]?{ext:"mp3",mime:"audio/mpeg"}:102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&65===t[10]||77===t[0]&&52===t[1]&&65===t[2]&&32===t[3]?{ext:"m4a",mime:"audio/m4a"}:79===t[28]&&112===t[29]&&117===t[30]&&115===t[31]&&72===t[32]&&101===t[33]&&97===t[34]&&100===t[35]?{ext:"opus",mime:"audio/opus"}:79===t[0]&&103===t[1]&&103===t[2]&&83===t[3]?{ext:"ogg",mime:"audio/ogg"}:102===t[0]&&76===t[1]&&97===t[2]&&67===t[3]?{ext:"flac",mime:"audio/x-flac"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&65===t[9]&&86===t[10]&&69===t[11]?{ext:"wav",mime:"audio/x-wav"}:35===t[0]&&33===t[1]&&65===t[2]&&77===t[3]&&82===t[4]&&10===t[5]?{ext:"amr",mime:"audio/amr"}:37===t[0]&&80===t[1]&&68===t[2]&&70===t[3]?{ext:"pdf",mime:"application/pdf"}:77===t[0]&&90===t[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==t[0]&&70!==t[0]||87!==t[1]||83!==t[2]?123===t[0]&&92===t[1]&&114===t[2]&&116===t[3]&&102===t[4]?{ext:"rtf",mime:"application/rtf"}:119===t[0]&&79===t[1]&&70===t[2]&&70===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff",mime:"application/font-woff"}:119===t[0]&&79===t[1]&&70===t[2]&&50===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff2",mime:"application/font-woff"}:76===t[34]&&80===t[35]&&(0===t[8]&&0===t[9]&&1===t[10]||1===t[8]&&0===t[9]&&2===t[10]||2===t[8]&&0===t[9]&&2===t[10])?{ext:"eot",mime:"application/octet-stream"}:0===t[0]&&1===t[1]&&0===t[2]&&0===t[3]&&0===t[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===t[0]&&84===t[1]&&84===t[2]&&79===t[3]&&0===t[4]?{ext:"otf",mime:"application/font-sfnt"}:0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?{ext:"ico",mime:"image/x-icon"}:70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]?{ext:"flv",mime:"video/x-flv"}:37===t[0]&&33===t[1]?{ext:"ps",mime:"application/postscript"}:253===t[0]&&55===t[1]&&122===t[2]&&88===t[3]&&90===t[4]&&0===t[5]?{ext:"xz",mime:"application/x-xz"}:83===t[0]&&81===t[1]&&76===t[2]&&105===t[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===t[0]&&69===t[1]&&83===t[2]&&26===t[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===t[0]&&114===t[1]&&50===t[2]&&52===t[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===t[0]&&83===t[1]&&67===t[2]&&70===t[3]||73===t[0]&&83===t[1]&&99===t[2]&&40===t[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]&&10===t[7]&&100===t[8]&&101===t[9]&&98===t[10]&&105===t[11]&&97===t[12]&&110===t[13]&&45===t[14]&&98===t[15]&&105===t[16]&&110===t[17]&&97===t[18]&&114===t[19]&&121===t[20]?{ext:"deb",mime:"application/x-deb"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===t[0]&&171===t[1]&&238===t[2]&&219===t[3]?{ext:"rpm",mime:"application/x-rpm"}:31===t[0]&&160===t[1]||31===t[0]&&157===t[1]?{ext:"Z",mime:"application/x-compress"}:76===t[0]&&90===t[1]&&73===t[2]&&80===t[3]?{ext:"lz",mime:"application/x-lzip"}:208===t[0]&&207===t[1]&&17===t[2]&&224===t[3]&&161===t[4]&&177===t[5]&&26===t[6]&&225===t[7]?{ext:"msi",mime:"application/x-msi"}:6===t[0]&&14===t[1]&&43===t[2]&&52===t[3]&&2===t[4]&&5===t[5]&&1===t[6]&&1===t[7]&&13===t[8]&&1===t[9]&&2===t[10]&&1===t[11]&&1===t[12]&&2===t[13]?{ext:"mxf",mime:"application/mxf"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}}e.exports=n},function(e,t){e.exports={123:"application/vnd.lotus-1-2-3",ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",bdoc:"application/x-bdoc",ccxml:"application/ccxml+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",ecma:"application/ecmascript",emma:"application/emma+xml",epub:"application/epub+zip",exi:"application/exi",pfr:"application/font-tdpfr",woff:"application/font-woff",woff2:"application/font-woff2",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/x-msdownload",dll:"application/x-msdownload",deb:"application/x-debian-package",dmg:"application/x-apple-diskimage",iso:"application/x-iso9660-image",img:"application/octet-stream",msi:"application/x-msdownload",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",cww:"application/prs.cww",pskcxml:"application/pskc+xml",rdf:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"text/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap",pwn:"application/vnd.3m.post-it-notes",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",acutc:"application/vnd.acucorp",air:"application/vnd.adobe.air-application-installer-package+zip",fcdt:"application/vnd.adobe.formscentral.fcdt",fxp:"application/vnd.adobe.fxp",fxpl:"application/vnd.adobe.fxp",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",acc:"application/vnd.americandynamics.acc",ami:"application/vnd.amiga.ami",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",mpkg:"application/vnd.apple.installer+xml",m3u8:"application/vnd.apple.mpegurl",pkpass:"application/vnd.apple.pkpass",swi:"application/vnd.aristanetworks.swi",iota:"application/vnd.astraea-software.iota",aep:"application/vnd.audiograph",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",rep:"application/vnd.businessobjects",cdxml:"application/vnd.chemdraw+xml",mmd:"application/vnd.chipnuts.karaoke-mmd",cdy:"application/vnd.cinderella",cla:"application/vnd.claymore",rp9:"application/vnd.cloanto.rp9",c4g:"application/vnd.clonk.c4group",c4d:"application/vnd.clonk.c4group",c4f:"application/vnd.clonk.c4group",c4p:"application/vnd.clonk.c4group",c4u:"application/vnd.clonk.c4group",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",csp:"application/vnd.commonspace",cdbcmsg:"application/vnd.contact.cmsg",cmc:"application/vnd.cosmocaller",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",pml:"application/vnd.ctc-posml",ppd:"application/vnd.cups-ppd",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",dart:"application/vnd.dart",rdz:"application/vnd.data-vision.rdz",uvf:"application/vnd.dece.data",uvvf:"application/vnd.dece.data",uvd:"application/vnd.dece.data",uvvd:"application/vnd.dece.data",uvt:"application/vnd.dece.ttml+xml",uvvt:"application/vnd.dece.ttml+xml",uvx:"application/vnd.dece.unspecified",uvvx:"application/vnd.dece.unspecified",uvz:"application/vnd.dece.zip",uvvz:"application/vnd.dece.zip",fe_launch:"application/vnd.denovo.fcselayout-link",dna:"application/vnd.dna",mlp:"application/vnd.dolby.mlp",dpg:"application/vnd.dpgraph",dfac:"application/vnd.dreamfactory",kpxx:"application/vnd.ds-keypoint",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",geo:"application/vnd.dynageo",mag:"application/vnd.ecowin.chart",nml:"application/vnd.enliven",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",qam:"application/vnd.epson.quickanime",slt:"application/vnd.epson.salt",ssf:"application/vnd.epson.ssf",es3:"application/vnd.eszigno3+xml",et3:"application/vnd.eszigno3+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fdf:"application/vnd.fdf",mseed:"application/vnd.fdsn.mseed",seed:"application/vnd.fdsn.seed",dataless:"application/vnd.fdsn.seed",gph:"application/vnd.flographit",ftc:"application/vnd.fluxtime.clip",fm:"application/vnd.framemaker",frame:"application/vnd.framemaker",maker:"application/vnd.framemaker",book:"application/vnd.framemaker",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",fsc:"application/vnd.fsc.weblaunch",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",fzs:"application/vnd.fuzzysheet",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gex:"application/vnd.geometry-explorer",gre:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gmx:"application/vnd.gmx",gdoc:"application/vnd.google-apps.document",gslides:"application/vnd.google-apps.presentation",gsheet:"application/vnd.google-apps.spreadsheet",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gqs:"application/vnd.grafeq",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",hal:"application/vnd.hal+xml",zmm:"application/vnd.handheld-entertainment+xml",hbci:"application/vnd.hbci",les:"application/vnd.hhe.lesson-player",hpgl:"application/vnd.hp-hpgl",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",pclxl:"application/vnd.hp-pclxl","sfd-hdstx":"application/vnd.hydrostatix.sof-data",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",listafp:"application/vnd.ibm.modcap",list3820:"application/vnd.ibm.modcap",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",icc:"application/vnd.iccprofile",icm:"application/vnd.iccprofile",igl:"application/vnd.igloader",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",igm:"application/vnd.insors.igm",xpw:"application/vnd.intercon.formnet",xpx:"application/vnd.intercon.formnet",i2g:"application/vnd.intergeo",qbo:"application/vnd.intu.qbo",qfx:"application/vnd.intu.qfx",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",xpr:"application/vnd.is-xpr",fcs:"application/vnd.isac.fcs",jam:"application/vnd.jam",rms:"application/vnd.jcp.javame.midlet-rms",jisp:"application/vnd.jisp",joda:"application/vnd.joost.joda-archive",ktz:"application/vnd.kahootz",ktr:"application/vnd.kahootz",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",kpt:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",kwt:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",knp:"application/vnd.kinar",skp:"application/vnd.koan",skd:"application/vnd.koan",skt:"application/vnd.koan",skm:"application/vnd.koan",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",portpkg:"application/vnd.macports.portpkg",mcd:"application/vnd.mcd",mc1:"application/vnd.medcalcdata",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",mif:"application/vnd.mif",daf:"application/vnd.mobius.daf",dis:"application/vnd.mobius.dis",mbk:"application/vnd.mobius.mbk",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",plc:"application/vnd.mobius.plc",txf:"application/vnd.mobius.txf",mpn:"application/vnd.mophun.application",mpc:"application/vnd.mophun.certificate",xul:"application/vnd.mozilla.xul+xml",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",xls:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xla:"application/vnd.ms-excel",xlc:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",eot:"application/vnd.ms-fontobject",chm:"application/vnd.ms-htmlhelp",ims:"application/vnd.ms-ims",lrm:"application/vnd.ms-lrm",thmx:"application/vnd.ms-officetheme",cat:"application/vnd.ms-pki.seccat",stl:"application/vnd.ms-pki.stl",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",mpt:"application/vnd.ms-project",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wps:"application/vnd.ms-works",wks:"application/vnd.ms-works",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wpl:"application/vnd.ms-wpl",xps:"application/vnd.ms-xpsdocument",mseq:"application/vnd.mseq",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",taglet:"application/vnd.mynfc",nlu:"application/vnd.neurolanguage.nlu",ntf:"application/vnd.nitf",nitf:"application/vnd.nitf",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",oth:"application/vnd.oasis.opendocument.text-web",xo:"application/vnd.olpc-sugar",dd2:"application/vnd.oma.dd2+xml",oxt:"application/vnd.openofficeorg.extension",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",mgp:"application/vnd.osgeo.mapguide.package",dp:"application/vnd.osgi.dp",esa:"application/vnd.osgi.subsystem",pdb:"application/x-pilot",pqa:"application/vnd.palm",oprc:"application/vnd.palm",paw:"application/vnd.pawaafile",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",efif:"application/vnd.picsel",wg:"application/vnd.pmi.widget",plf:"application/vnd.pocketlearn",pbd:"application/vnd.powerbuilder6",box:"application/vnd.previewsystems.box",mgz:"application/vnd.proteus.magazine",qps:"application/vnd.publishare-delta-tree",ptid:"application/vnd.pvi.ptid1",qxd:"application/vnd.quark.quarkxpress",qxt:"application/vnd.quark.quarkxpress",qwd:"application/vnd.quark.quarkxpress",qwt:"application/vnd.quark.quarkxpress",qxl:"application/vnd.quark.quarkxpress",qxb:"application/vnd.quark.quarkxpress",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",cryptonote:"application/vnd.rig.cryptonote",cod:"application/vnd.rim.cod",rm:"application/vnd.rn-realmedia",rmvb:"application/vnd.rn-realmedia-vbr",link66:"application/vnd.route66.link66+xml",st:"application/vnd.sailingtracker.track",see:"application/vnd.seemail",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",twd:"application/vnd.simtech-mindmapper",twds:"application/vnd.simtech-mindmapper",mmf:"application/vnd.smaf",teacher:"application/vnd.smart.teacher",sdkm:"application/vnd.solent.sdkm+xml",sdkd:"application/vnd.solent.sdkm+xml",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",vor:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",smzip:"application/vnd.stepmania.package",sm:"application/vnd.stepmania.stepchart",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",sus:"application/vnd.sus-calendar",susp:"application/vnd.sus-calendar",svd:"application/vnd.svd",sis:"application/vnd.symbian.install",sisx:"application/vnd.symbian.install",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",tao:"application/vnd.tao.intent-module-archive",pcap:"application/vnd.tcpdump.pcap",cap:"application/vnd.tcpdump.pcap",dmp:"application/vnd.tcpdump.pcap",tmo:"application/vnd.tmobile-livetv",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",tra:"application/vnd.trueapp",ufd:"application/vnd.ufdl",ufdl:"application/vnd.ufdl",utz:"application/vnd.uiq.theme",umj:"application/vnd.umajin",unityweb:"application/vnd.unity",uoml:"application/vnd.uoml+xml",vcx:"application/vnd.vcx",vsd:"application/vnd.visio",vst:"application/vnd.visio",vss:"application/vnd.visio",vsw:"application/vnd.visio",vis:"application/vnd.visionary",vsf:"application/vnd.vsf",wbxml:"application/vnd.wap.wbxml",wmlc:"application/vnd.wap.wmlc",wmlsc:"application/vnd.wap.wmlscriptc",wtb:"application/vnd.webturbo",nbp:"application/vnd.wolfram.player",wpd:"application/vnd.wordperfect",wqd:"application/vnd.wqd",stf:"application/vnd.wt.stf",xar:"application/vnd.xara",xfdl:"application/vnd.xfdl",hvd:"application/vnd.yamaha.hv-dic",hvs:"application/vnd.yamaha.hv-script",hvp:"application/vnd.yamaha.hv-voice",osf:"application/vnd.yamaha.openscoreformat",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",saf:"application/vnd.yamaha.smaf-audio",spf:"application/vnd.yamaha.smaf-phrase",cmp:"application/vnd.yellowriver-custom-menu",zir:"application/vnd.zul",zirz:"application/vnd.zul",zaz:"application/vnd.zzazz.deck+xml",vxml:"application/voicexml+xml",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",aab:"application/x-authorware-bin",x32:"application/x-authorware-bin",u32:"application/x-authorware-bin",vox:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",bcpio:"application/x-bcpio",torrent:"application/x-bittorrent",blb:"application/x-blorb",blorb:"application/x-blorb",bz:"application/x-bzip",bz2:"application/x-bzip2",boz:"application/x-bzip2",cbr:"application/x-cbr",cba:"application/x-cbr",cbt:"application/x-cbr",cbz:"application/x-cbr",cb7:"application/x-cbr",vcd:"application/x-cdlink",cfs:"application/x-cfs-compressed",chat:"application/x-chat",pgn:"application/x-chess-pgn",crx:"application/x-chrome-extension",cco:"application/x-cocoa",nsc:"application/x-conference",cpio:"application/x-cpio",csh:"application/x-csh",udeb:"application/x-debian-package",dgc:"application/x-dgc-compressed",dir:"application/x-director",dcr:"application/x-director",dxr:"application/x-director",cst:"application/x-director",cct:"application/x-director",cxt:"application/x-director",w3d:"application/x-director",fgd:"application/x-director",swa:"application/x-director",wad:"application/x-doom",ncx:"application/x-dtbncx+xml",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",dvi:"application/x-dvi",evy:"application/x-envoy",eva:"application/x-eva",bdf:"application/x-font-bdf",gsf:"application/x-font-ghostscript",psf:"application/x-font-linux-psf",otf:"font/opentype",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",pfa:"application/x-font-type1",pfb:"application/x-font-type1",pfm:"application/x-font-type1",afm:"application/x-font-type1",arc:"application/x-freearc",spl:"application/x-futuresplash",gca:"application/x-gca-compressed",ulx:"application/x-glulx",gnumeric:"application/x-gnumeric",gramps:"application/x-gramps-xml",gtar:"application/x-gtar",hdf:"application/x-hdf",php:"application/x-httpd-php",install:"application/x-install-instructions",jardiff:"application/x-java-archive-diff",jnlp:"application/x-java-jnlp-file",latex:"application/x-latex",luac:"application/x-lua-bytecode",lzh:"application/x-lzh-compressed",lha:"application/x-lzh-compressed",run:"application/x-makeself",mie:"application/x-mie",prc:"application/x-pilot",mobi:"application/x-mobipocket-ebook",application:"application/x-ms-application",lnk:"application/x-ms-shortcut",wmd:"application/x-ms-wmd",wmz:"application/x-msmetafile",xbap:"application/x-ms-xbap",mdb:"application/x-msaccess",obd:"application/x-msbinder",crd:"application/x-mscardfile",clp:"application/x-msclip",com:"application/x-msdownload",bat:"application/x-msdownload",mvb:"application/x-msmediaview",m13:"application/x-msmediaview",m14:"application/x-msmediaview",wmf:"application/x-msmetafile",emf:"application/x-msmetafile",emz:"application/x-msmetafile",mny:"application/x-msmoney",pub:"application/x-mspublisher",scd:"application/x-msschedule",trm:"application/x-msterminal",wri:"application/x-mswrite",nc:"application/x-netcdf",cdf:"application/x-netcdf",pac:"application/x-ns-proxy-autoconfig",nzb:"application/x-nzb",pl:"application/x-perl",pm:"application/x-perl",p12:"application/x-pkcs12",pfx:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",spc:"application/x-pkcs7-certificates",p7r:"application/x-pkcs7-certreqresp",rar:"application/x-rar-compressed",rpm:"application/x-redhat-package-manager",ris:"application/x-research-info-systems",sea:"application/x-sea",sh:"application/x-sh",shar:"application/x-shar",swf:"application/x-shockwave-flash",xap:"application/x-silverlight-app",sql:"application/x-sql",sit:"application/x-stuffit",sitx:"application/x-stuffitx",srt:"application/x-subrip",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",t3:"application/x-t3vm-image",gam:"application/x-tads",tar:"application/x-tar",tcl:"application/x-tcl",tk:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",texinfo:"application/x-texinfo",texi:"application/x-texinfo",obj:"application/x-tgif",ustar:"application/x-ustar",src:"application/x-wais-source",webapp:"application/x-web-app-manifest+json",der:"application/x-x509-ca-cert",crt:"application/x-x509-ca-cert",pem:"application/x-x509-ca-cert",fig:"application/x-xfig",xlf:"application/x-xliff+xml",xpi:"application/x-xpinstall",xz:"application/x-xz",z1:"application/x-zmachine",z2:"application/x-zmachine",z3:"application/x-zmachine",z4:"application/x-zmachine",z5:"application/x-zmachine",z6:"application/x-zmachine",z7:"application/x-zmachine",z8:"application/x-zmachine",xaml:"application/xaml+xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xml:"text/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xslt+xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mp3:"audio/mpeg",m4a:"audio/x-m4a",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",uva:"audio/vnd.dece.audio",uvva:"audio/vnd.dece.audio",eol:"audio/vnd.digital-winds",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",lvp:"audio/vnd.lucent.voice",pya:"audio/vnd.ms-playready.media.pya",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",rip:"audio/vnd.rip",wav:"audio/x-wav",weba:"audio/webm",aac:"audio/x-aac",aif:"audio/x-aiff",aiff:"audio/x-aiff",aifc:"audio/x-aiff",caf:"audio/x-caf",flac:"audio/x-flac",mka:"audio/x-matroska",m3u:"audio/x-mpegurl",wax:"audio/x-ms-wax",wma:"audio/x-ms-wma",ram:"audio/x-pn-realaudio",ra:"audio/x-realaudio",rmp:"audio/x-pn-realaudio-plugin",xm:"audio/xm",cdx:"chemical/x-cdx",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cml:"chemical/x-cml",csml:"chemical/x-csml",xyz:"chemical/x-xyz",bmp:"image/x-ms-bmp",cgm:"image/cgm",g3:"image/g3fax",gif:"image/gif",ief:"image/ief",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",ktx:"image/ktx",png:"image/png",btif:"image/prs.btif",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",tiff:"image/tiff",tif:"image/tiff",psd:"image/vnd.adobe.photoshop",uvi:"image/vnd.dece.graphic",uvvi:"image/vnd.dece.graphic",uvg:"image/vnd.dece.graphic",uvvg:"image/vnd.dece.graphic",djvu:"image/vnd.djvu",djv:"image/vnd.djvu",sub:"text/vnd.dvb.subtitle",dwg:"image/vnd.dwg",dxf:"image/vnd.dxf",fbs:"image/vnd.fastbidsheet",fpx:"image/vnd.fpx",fst:"image/vnd.fst",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",mdi:"image/vnd.ms-modi",wdp:"image/vnd.ms-photo",npx:"image/vnd.net-fpx",wbmp:"image/vnd.wap.wbmp",xif:"image/vnd.xiff",webp:"image/webp","3ds":"image/x-3ds",ras:"image/x-cmu-raster",cmx:"image/x-cmx",fh:"image/x-freehand",fhc:"image/x-freehand",fh4:"image/x-freehand",fh5:"image/x-freehand",fh7:"image/x-freehand",ico:"image/x-icon",jng:"image/x-jng",sid:"image/x-mrsid-image",pcx:"image/x-pcx",pic:"image/x-pict",pct:"image/x-pict",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pgm:"image/x-portable-graymap",ppm:"image/x-portable-pixmap",rgb:"image/x-rgb",tga:"image/x-tga",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",eml:"message/rfc822",mime:"message/rfc822",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",dae:"model/vnd.collada+xml",dwf:"model/vnd.dwf",gdl:"model/vnd.gdl",gtw:"model/vnd.gtw",mts:"model/vnd.mts",vtu:"model/vnd.vtu",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+binary",x3dbz:"model/x3d+binary",x3dv:"model/x3d+vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",hjson:"text/hjson",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",mml:"text/mathml",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",slim:"text/slim",slm:"text/slim",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",fly:"text/vnd.fly",flx:"text/vnd.fmi.flexstor",gv:"text/vnd.graphviz","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",jad:"text/vnd.sun.j2me.app-descriptor",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",vtt:"text/vtt",s:"text/x-asm",asm:"text/x-asm",c:"text/x-c",cc:"text/x-c",cxx:"text/x-c",cpp:"text/x-c",h:"text/x-c",hh:"text/x-c",dic:"text/x-c",htc:"text/x-component",f:"text/x-fortran",for:"text/x-fortran",f77:"text/x-fortran",f90:"text/x-fortran",hbs:"text/x-handlebars-template",java:"text/x-java-source",lua:"text/x-lua",markdown:"text/x-markdown",md:"text/x-markdown",mkd:"text/x-markdown",nfo:"text/x-nfo",opml:"text/x-opml",p:"text/x-pascal",pas:"text/x-pascal",pde:"text/x-processing",sass:"text/x-sass",scss:"text/x-scss",etx:"text/x-setext",sfv:"text/x-sfv",ymp:"text/x-suse-ymp",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpeg",jpm:"video/jpm",jpgm:"video/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",uvh:"video/vnd.dece.hd",uvvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",uvvv:"video/vnd.dece.video",dvb:"video/vnd.dvb.file",fvt:"video/vnd.fvt",mxu:"video/vnd.mpegurl",m4u:"video/vnd.mpegurl",pyv:"video/vnd.ms-playready.media.pyv",uvu:"video/vnd.uvvu.mp4",uvvu:"video/vnd.uvvu.mp4",viv:"video/vnd.vivo",webm:"video/webm",f4v:"video/x-f4v",fli:"video/x-fli",flv:"video/x-flv",m4v:"video/x-m4v",mkv:"video/x-matroska",mk3d:"video/x-matroska",mks:"video/x-matroska",mng:"video/x-mng",asf:"video/x-ms-asf",asx:"video/x-ms-asf",vob:"video/x-ms-vob",wm:"video/x-ms-wm",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",avi:"video/x-msvideo",movie:"video/x-sgi-movie",smv:"video/x-smv",ice:"x-conference/x-cooltalk"}},function(e,t,n){(function(t,i,s){function r(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}function o(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}var a=n(60),c=n(10),u=n(94),l=n(21),h=n(96),p=u.IncomingMessage,d=u.readyStates,f=e.exports=function(e){var n=this;l.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){n.setHeader(t,e.headers[t])});var i,s=!0;if("disable-fetch"===e.mode||"timeout"in e)s=!1,i=!0;else if("prefer-streaming"===e.mode)i=!1;else if("allow-wrong-content-type"===e.mode)i=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");i=!0}n._mode=r(i,s),n.on("finish",function(){n._onFinish()})};c(f,l.Writable),f.prototype.setHeader=function(e,t){var n=this,i=e.toLowerCase();-1===m.indexOf(i)&&(n._headers[i]={name:e,value:t})},f.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,r=e._headers,o=null;"GET"!==n.method&&"HEAD"!==n.method&&(o=a.blobConstructor?new i.Blob(e._body.map(function(e){return h(e)}),{type:(r["content-type"]||{}).value||""}):t.concat(e._body).toString());var c=[];if(Object.keys(r).forEach(function(e){var t=r[e].name,n=r[e].value;Array.isArray(n)?n.forEach(function(e){c.push([t,e])}):c.push([t,n])}),"fetch"===e._mode)i.fetch(e._opts.url,{method:e._opts.method,headers:c,body:o||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then(function(t){e._fetchResponse=t,e._connect()},function(t){e.emit("error",t)});else{var u=e._xhr=new i.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){return void s.nextTick(function(){e.emit("error",t)})}"responseType"in u&&(u.responseType=e._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"timeout"in n&&(u.timeout=n.timeout,u.ontimeout=function(){e.emit("timeout")}),c.forEach(function(e){u.setRequestHeader(e[0],e[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{u.send(o)}catch(t){return void s.nextTick(function(){e.emit("error",t)})}}}},f.prototype._onXHRProgress=function(){var e=this;o(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new p(e._xhr,e._fetchResponse,e._mode),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},f.prototype._write=function(e,t,n){this._body.push(e),n()},f.prototype.abort=f.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},f.prototype.end=function(e,t,n){var i=this;"function"==typeof e&&(n=e,e=void 0),l.Writable.prototype.end.call(i,e,t,n)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(t,n(5).Buffer,n(9),n(6))},function(e,t,n){(function(e,i,s){var r=n(60),o=n(10),a=n(21),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=t.IncomingMessage=function(t,n,s){function o(){u.read().then(function(e){if(!c._destroyed){if(e.done)return void c.push(null);c.push(new i(e.value)),o()}}).catch(function(e){c.emit("error",e)})}var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){e.nextTick(function(){c.emit("close")})}),"fetch"===s){c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach(function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)});var u=n.body.getReader();o()}else{c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText;if(t.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(t[2])):void 0!==c.headers[n]?c.headers[n]+=", "+t[2]:c.headers[n]=t[2],c.rawHeaders.push(t[1],t[2])}}),c._charset="x-user-defined",!r.overrideMimeType){var l=c.rawHeaders["mime-type"];if(l){var h=l.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};o(u,a.Readable),u.prototype._read=function(){},u.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==c.DONE)break;try{n=new s.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new i(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var o=new i(r.length),a=0;ae._pos&&(e.push(new i(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(n)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(t,n(6),n(5).Buffer,n(9))},function(e,t,n){function i(e,t){this._id=e,this._clearFn=t}var s=Function.prototype.apply;t.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(86),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){var i=n(5).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(i.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,s=0;s{this.client.emit(i.Events.GUILD_CREATE,n)}):this.client.emit(i.Events.GUILD_CREATE,n)),n}newUser(e){if(this.client.users.has(e.id))return this.client.users.get(e.id);const t=new o(this.client,e);return this.client.users.set(t.id,t),t}newChannel(e,t){const n=this.client.channels.has(e.id);let s;return e.type===i.ChannelTypes.DM?s=new a(this.client,e):e.type===i.ChannelTypes.GROUP_DM?s=new p(this.client,e):(t=t||this.client.guilds.get(e.guild_id))&&(e.type===i.ChannelTypes.TEXT?(s=new u(t,e),t.channels.set(s.id,s)):e.type===i.ChannelTypes.VOICE&&(s=new l(t,e),t.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(e,t){const n=t.emojis.has(e.id);if(e&&!n){let n=new c(t,e);return this.client.emit(i.Events.GUILD_EMOJI_CREATE,n),t.emojis.set(n.id,n),n}return n?t.emojis.get(e.id):null}killEmoji(e){e instanceof c&&e.guild&&(this.client.emit(i.Events.GUILD_EMOJI_DELETE,e),e.guild.emojis.delete(e.id))}killGuild(e){const t=this.client.guilds.has(e.id);this.client.guilds.delete(e.id),t&&this.pastReady&&this.client.emit(i.Events.GUILD_DELETE,e)}killUser(e){this.client.users.delete(e.id)}killChannel(e){this.client.channels.delete(e.id),e instanceof h&&e.guild.channels.delete(e.id)}updateGuild(e,t){const n=s.cloneObject(e);e.setup(t),this.pastReady&&this.client.emit(i.Events.GUILD_UPDATE,n,e)}updateChannel(e,t){e.setup(t)}updateEmoji(e,t){const n=s.cloneObject(e);return e.setup(t),this.client.emit(i.Events.GUILD_EMOJI_UPDATE,n,e),e}}e.exports=d},function(e,t,n){const i=n(0),s=n(65);class r{constructor(e){this.client=e,this.heartbeatInterval=null}connectToWebSocket(e,t,n){this.client.emit(i.Events.DEBUG,`Authenticated using token ${e}`),this.client.token=e;const r=this.client.setTimeout(()=>n(new Error(i.Errors.TOOK_TOO_LONG)),3e5);this.client.rest.methods.getGateway().then(o=>{const a=i.DefaultOptions.ws.version;const c=`${o.url}/?v=${a}&encoding=${s.ENCODING}`;this.client.emit(i.Events.DEBUG,`Using gateway ${c}`);this.client.ws.connect(c);this.client.ws.once("close",e=>{4004===e.code&&n(new Error(i.Errors.BAD_LOGIN));4010===e.code&&n(new Error(i.Errors.INVALID_SHARD));4011===e.code&&n(new Error(i.Errors.SHARDING_REQUIRED))});this.client.once(i.Events.READY,()=>{t(e);this.client.clearTimeout(r)})},n)}setupKeepAlive(e){this.heartbeatInterval=e,this.client.setInterval(()=>this.client.ws.heartbeat(!0),e)}destroy(){return this.client.ws.destroy(),this.client.user?this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.rest.methods.logout().then(()=>{this.client.token=null}):Promise.resolve()}}e.exports=r},function(e,t,n){class i{constructor(e){this.client=e,this.register(n(122)),this.register(n(123)),this.register(n(124)),this.register(n(128)),this.register(n(125)),this.register(n(126)),this.register(n(127)),this.register(n(104)),this.register(n(105)),this.register(n(106)),this.register(n(109)),this.register(n(121)),this.register(n(114)),this.register(n(115)),this.register(n(107)),this.register(n(116)),this.register(n(117)),this.register(n(118)),this.register(n(129)),this.register(n(131)),this.register(n(130)),this.register(n(120)),this.register(n(110)),this.register(n(111)),this.register(n(112)),this.register(n(113)),this.register(n(119)),this.register(n(108))}register(e){this[e.name.replace(/Action$/,"")]=new e(this.client)}}e.exports=i},function(e,t,n){const i=n(2);class s extends i{handle(e){return{channel:this.client.dataManager.newChannel(e)}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client;let n=t.channels.get(e.id);return n?(t.dataManager.killChannel(n),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(e.id)||null,{channel:n}}scheduleForDeletion(e){this.client.setTimeout(()=>this.deleted.delete(e),this.client.options.restWsBridgeTimeout)}}e.exports=s},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.channels.get(e.id);if(n){const i=r.cloneObject(n);return n.setup(e),t.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id),i=t.dataManager.newUser(e.user);n&&i&&t.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n)for(const t of e.channels){const e=n.channels.get(t.id);e&&(e.position=t.position)}return{guild:n}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client;let n=t.guilds.get(e.id);if(n){for(const e of n.channels.values())"text"===e.type&&e.stopTyping(!0);if(n.available&&e.unavailable)return n.available=!1,t.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};t.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(e.id)||null;return{guild:n}}scheduleForDeletion(e){this.client.setTimeout(()=>this.deleted.delete(e),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e,t){return{emoji:this.client.dataManager.newEmoji(t,e)}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e){return this.client.dataManager.killEmoji(e),{emoji:e}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e,t){return{emoji:this.client.dataManager.updateEmoji(e,t)}}}e.exports=s},function(e,t,n){function i(e){const t=new Map;for(const n of e)t.set(...n);return t}const s=n(2);class r extends s{handle(e){const t=this.client.guilds.get(e.guild_id);if(t&&t.emojis){const n=i(t.emojis.entries());for(const i of e.emojis){const e=t.emojis.get(i.id);e?(n.delete(i.id),e.equals(i,!0)||this.client.actions.GuildEmojiUpdate.handle(e,i)):this.client.actions.GuildEmojiCreate.handle(t,i)}for(const e of n.values())this.client.actions.GuildEmojiDelete.handle(e)}}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e,t){return{member:e._addMember(t,!1)}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){let i=n.members.get(e.user.id);return i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+e.user.id,i),t.status===s.Status.READY&&t.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,e.user.id)):i=this.deleted.get(n.id+e.user.id)||null,{guild:n,member:i}}return{guild:n,member:null}}scheduleForDeletion(e,t){this.client.setTimeout(()=>this.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(15);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){const i=n.roles.has(e.role.id),o=new r(n,e.role);return n.roles.set(o.id,o),i||t.emit(s.Events.GUILD_ROLE_CREATE,o),{role:o}}return{role:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{constructor(e){super(e),this.deleted=new Map}handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){let i=n.roles.get(e.role_id);return i?(n.roles.delete(e.role_id),this.deleted.set(n.id+e.role_id,i),this.scheduleForDeletion(n.id,e.role_id),t.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+e.role_id)||null,{role:i}}return{role:null}}scheduleForDeletion(e,t){this.client.setTimeout(()=>this.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n){const i=e.role;let o=null;const a=n.roles.get(i.id);return a&&(o=r.cloneObject(a),a.setup(e.role),t.emit(s.Events.GUILD_ROLE_UPDATE,o,a)),{old:o,updated:a}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.guild_id);if(n)for(const t of e.roles){const e=n.roles.get(t.id);e&&(e.position=t.position)}return{guild:n}}}e.exports=s},function(e,t,n){const i=n(2);class s extends i{handle(e){const t=this.client,n=t.guilds.get(e.id);if(n){if(e.presences)for(const t of e.presences)n._setPresence(t.user.id,t);if(e.members)for(const t of e.members){const e=n.members.get(t.user.id);e?n._updateMember(e,t):n._addMember(t,!1)}"large"in e&&(n.large=e.large)}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client,n=t.guilds.get(e.id);if(n){const i=r.cloneObject(n);return n.setup(e),t.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(2),s=n(19);class r extends i{handle(e){const t=this.client,n=t.channels.get((e instanceof Array?e[0]:e).channel_id),i=t.users.get((e instanceof Array?e[0]:e).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(e instanceof Array){const o=new Array(e.length);for(let i=0;ithis.deleted.delete(e+t),this.client.options.restWsBridgeTimeout)}}e.exports=s},function(e,t,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(e){const t=this.client,n=t.channels.get(e.channel_id),i=e.ids,o=new s;for(const e of i){const t=n.messages.get(e);t&&o.set(t.id,t)}return o.size>0&&t.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}e.exports=o},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.users.get(e.user_id);if(!t)return!1;const n=this.client.channels.get(e.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(e.message_id);if(!i)return!1;if(!e.emoji)return!1;const r=i._addReaction(e.emoji,t);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,t),{message:i,reaction:r,user:t}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.users.get(e.user_id);if(!t)return!1;const n=this.client.channels.get(e.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(e.message_id);if(!i)return!1;if(!e.emoji)return!1;const r=i._removeReaction(e.emoji,t);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,t),{message:i,reaction:r,user:t}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client.channels.get(e.channel_id);if(!t||"voice"===t.type)return!1;const n=t.messages.get(e.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}e.exports=r},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.channels.get(e.channel_id);if(n){const i=n.messages.get(e.id);return i?(i.patch(e),t.emit(s.Events.MESSAGE_UPDATE,i._edits[0],i),{old:i._edits[0],updated:i}):{old:i,updated:i}}return{old:null,updated:null}}}e.exports=r},function(e,t,n){const i=n(2);class s extends i{handle(e){return{user:this.client.dataManager.newUser(e)}}}e.exports=s},function(e,t,n){const i=n(2),s=n(0);class r extends i{handle(e){const t=this.client,n=t.user.notes.get(e.id),i=e.note.length?e.note:null;return t.user.notes.set(e.id,i),t.emit(s.Events.USER_NOTE_UPDATE,e.id,n,i),{old:n,updated:i}}}e.exports=r},function(e,t,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(e){const t=this.client;if(t.user){if(t.user.equals(e))return{old:t.user,updated:t.user};const n=r.cloneObject(t.user);return t.user.patch(e),t.emit(s.Events.USER_UPDATE,n,t.user),{old:n,updated:t.user}}return{old:null,updated:null}}}e.exports=o},function(e,t,n){const i=n(36),s=n(0);class r{constructor(e,t,n,i,s,r){this.rest=e,this.client=e.client,this.method=t,this.path=n.toString(),this.auth=i,this.data=s,this.files=r,this.route=this.getRoute(this.path)}getRoute(e){let t=e.split("?")[0];if(t.includes("/channels/")||t.includes("/guilds/")){const e=t.includes("/channels/")?t.indexOf("/channels/"):t.indexOf("/guilds/"),n=t.substring(e).split("/")[2];t=t.replace(/(\d{8,})/g,":id").replace(":id",n)}return t}getAuth(){if(this.client.token&&this.client.user&&this.client.user.bot)return`Bot ${this.client.token}`;if(this.client.token)return this.client.token;throw new Error(s.Errors.NO_TOKEN)}gen(){const e=`${this.client.options.http.host}/api/v${this.client.options.http.version}`,t=i[this.method](`${e}${this.path}`);if(this.auth&&t.set("Authorization",this.getAuth()),this.rest.client.browser||t.set("User-Agent",this.rest.userAgentManager.userAgent),this.files){for(const e of this.files)e&&e.file&&t.attach(e.name,e.file,e.name);void 0!==this.data&&t.attach("payload_json",JSON.stringify(this.data))}else this.data&&t.send(this.data);return t}}e.exports=r},function(e,t,n){const i=n(34),s=n(32),r=n(8),o=n(0),a=o.Endpoints,c=n(3),u=n(7),l=n(4),h=n(16),p=n(18),d=n(19),f=n(15),m=n(42),g=n(30),v=n(178),b=n(48),E=n(14),w=n(28),_=n(24),y=n(179);class x{constructor(e){this.rest=e,this.client=e.client,this._ackToken=null}login(e=this.client.token){return new Promise((t,n)=>{if("string"!=typeof e)throw new Error(o.Errors.INVALID_TOKEN);e=e.replace(/^Bot\s*/i,"");this.client.manager.connectToWebSocket(e,t,n)})}logout(){return this.rest.makeRequest("post",a.logout,!0,{})}getGateway(e=!1){return this.rest.makeRequest("get",e?a.gateway.bot:a.gateway,!0)}fetchVoiceRegions(e){let t;return t=e?a.Guild(e).voiceRegions:a.voiceRegions,this.rest.makeRequest("get",t,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new y(n));return t})}sendMessage(e,t,{tts:tts,nonce:nonce,embed:embed,disableEveryone:disableEveryone,split:split,code:code,reply:reply}={},n=null){return new Promise((i,s)=>{void 0!==t&&(t=this.client.resolver.resolveString(t));if(void 0!==nonce&&(nonce=parseInt(nonce),isNaN(nonce)||nonce<0))throw new RangeError("Message nonce must fit in an unsigned 64-bit integer.");if(t){if(split&&"object"!=typeof split&&(split={}),void 0===code||"boolean"==typeof code&&!0!==code||(t=l.escapeMarkdown(this.client.resolver.resolveString(t),!0),t=`\`\`\`${"boolean"!=typeof code?code||"":""}
${t}
\`\`\``,split&&(split.prepend=`\`\`\`${"boolean"!=typeof code?code||"":""}
-`,split.append="\n```")),(disableEveryone||"undefined"==typeof disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@$1")),reply&&!(e instanceof h||e instanceof p)&&"dm"!==e.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`,split&&(split.prepend=`${n}, ${split.prepend||""}`)}split&&(t=l.splitMessage(t,split))}else if(reply&&!(e instanceof h||e instanceof p)&&"dm"!==e.type){const e=this.client.resolver.resolveUserID(reply);t=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`}const r=e=>{if(t instanceof Array){const s=[];!function t(r,o){const a=o===r.length?{tts:tts,embed:embed}:{tts:tts};e.send(r[o],a,o===r.length?n:null).then(e=>{return s.push(e),o>=r.length-1?i(s):t(r,++o)})}(t,0)}else this.rest.makeRequest("post",a.Channel(e).messages,!0,{content:t,tts:tts,nonce:nonce,embed:embed},n).then(e=>i(this.client.actions.MessageCreate.handle(e).message),s)};e instanceof h||e instanceof p?this.createDM(e).then(r,s):r(e)})}updateMessage(e,t,{embed,code,reply}={}){if("undefined"!=typeof t&&(t=this.client.resolver.resolveString(t)),"undefined"==typeof code||"boolean"==typeof code&&code!==!0||(t=l.escapeMarkdown(this.client.resolver.resolveString(t),!0),t=`\`\`\`${"boolean"!=typeof code?code||"":""}
+`,split.append="\n```")),(disableEveryone||void 0===disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@$1")),reply&&!(e instanceof h||e instanceof p)&&"dm"!==e.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`,split&&(split.prepend=`${n}, ${split.prepend||""}`)}split&&(t=l.splitMessage(t,split))}else if(reply&&!(e instanceof h||e instanceof p)&&"dm"!==e.type){const e=this.client.resolver.resolveUserID(reply);t=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`}const r=e=>{if(t instanceof Array){const s=[];!function t(r,o){const a=o===r.length?{tts:tts,embed:embed}:{tts:tts};e.send(r[o],a,o===r.length?n:null).then(e=>{s.push(e);if(o>=r.length-1)return i(s);return t(r,++o)})}(t,0)}else this.rest.makeRequest("post",a.Channel(e).messages,!0,{content:t,tts:tts,nonce:nonce,embed:embed},n).then(e=>i(this.client.actions.MessageCreate.handle(e).message),s)};e instanceof h||e instanceof p?this.createDM(e).then(r,s):r(e)})}updateMessage(e,t,{embed:embed,code:code,reply:reply}={}){if(void 0!==t&&(t=this.client.resolver.resolveString(t)),void 0===code||"boolean"==typeof code&&!0!==code||(t=l.escapeMarkdown(this.client.resolver.resolveString(t),!0),t=`\`\`\`${"boolean"!=typeof code?code||"":""}
${t}
-\`\`\``),reply&&"dm"!==e.channel.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`}return this.rest.makeRequest("patch",a.Message(e),!0,{content:t,embed:embed}).then(e=>this.client.actions.MessageUpdate.handle(e).updated)}deleteMessage(e){return this.rest.makeRequest("delete",a.Message(e),!0).then(()=>this.client.actions.MessageDelete.handle({id:e.id,channel_id:e.channel.id}).message)}ackMessage(e){return this.rest.makeRequest("post",a.Message(e).ack,!0,{token:this._ackToken}).then(t=>{return t.token&&(this._ackToken=t.token),e})}ackTextChannel(e){return this.rest.makeRequest("post",a.Channel(e).ack,!0,{token:this._ackToken}).then(t=>{return t.token&&(this._ackToken=t.token),e})}ackGuild(e){return this.rest.makeRequest("post",a.Guild(e).ack,!0).then(()=>e)}bulkDeleteMessages(e,t,n){return n&&(t=t.filter(e=>Date.now()-u.deconstruct(e).date.getTime()<12096e5)),this.rest.makeRequest("post",a.Channel(e).messages.bulkDelete,!0,{messages:t}).then(()=>this.client.actions.MessageDeleteBulk.handle({channel_id:e.id,ids:t}).messages)}search(e,t){if(t.before&&(t.before instanceof Date||(t.before=new Date(t.before)),t.maxID=s.fromNumber(t.before.getTime()-14200704e5).shiftLeft(22).toString()),t.after&&(t.after instanceof Date||(t.after=new Date(t.after)),t.minID=s.fromNumber(t.after.getTime()-14200704e5).shiftLeft(22).toString()),t.during){t.during instanceof Date||(t.during=new Date(t.during));const e=t.during.getTime()-14200704e5;t.minID=s.fromNumber(e).shiftLeft(22).toString(),t.maxID=s.fromNumber(e+864e5).shiftLeft(22).toString()}t.channel&&(t.channel=this.client.resolver.resolveChannelID(t.channel)),t.author&&(t.author=this.client.resolver.resolveUserID(t.author)),t.mentions&&(t.mentions=this.client.resolver.resolveUserID(t.options.mentions)),t={content:t.content,max_id:t.maxID,min_id:t.minID,has:t.has,channel_id:t.channel,author_id:t.author,author_type:t.authorType,context_size:t.contextSize,sort_by:t.sortBy,sort_order:t.sortOrder,limit:t.limit,offset:t.offset,mentions:t.mentions,mentions_everyone:t.mentionsEveryone,link_hostname:t.linkHostname,embed_provider:t.embedProvider,embed_type:t.embedType,attachment_filename:t.attachmentFilename,attachment_extension:t.attachmentExtension};for(const n in t)void 0===t[n]&&delete t[n];const r=(i.stringify(t).match(/[^=&?]+=[^=&?]+/g)||[]).join("&");let o;if(e instanceof E)o=a.Channel(e).search;else{if(!(e instanceof y))throw new TypeError("Target must be a TextChannel, DMChannel, GroupDMChannel, or Guild.");o=a.Guild(e).search}return this.rest.makeRequest("get",`${o}?${r}`,!0).then(e=>{const t=e.messages.map(e=>e.map(e=>new d(this.client.channels.get(e.channel_id),e,this.client)));return{totalResults:e.total_results,messages:t}})}createChannel(e,t,n,i){return i instanceof c&&(i=i.array()),this.rest.makeRequest("post",a.Guild(e).channels,!0,{name:t,type:n,permission_overwrites:i}).then(e=>this.client.actions.ChannelCreate.handle(e).channel)}createDM(e){const t=this.getExistingDM(e);return t?Promise.resolve(t):this.rest.makeRequest("post",a.User(this.client.user).channels,!0,{recipient_id:e.id}).then(e=>this.client.actions.ChannelCreate.handle(e).channel)}createGroupDM(e){const t=this.client.user.bot?{access_tokens:e.accessTokens,nicks:e.nicks}:{recipients:e.recipients};return this.rest.makeRequest("post",a.User("@me").channels,!0,t).then(e=>new w(this.client,e))}addUserToGroupDM(e,t){const n=this.client.user.bot?{nick:t.nick,access_token:t.accessToken}:{recipient:t.id};return this.rest.makeRequest("put",a.Channel(e).Recipient(t.id),!0,n).then(()=>e)}getExistingDM(e){return this.client.channels.find(t=>t.recipient&&t.recipient.id===e.id)}deleteChannel(e){return(e instanceof h||e instanceof p)&&(e=this.getExistingDM(e)),e?this.rest.makeRequest("delete",a.Channel(e),!0).then(t=>{return t.id=e.id,this.client.actions.ChannelDelete.handle(t).channel}):Promise.reject(new Error("No channel to delete."))}updateChannel(e,t){const n={};return n.name=(t.name||e.name).trim(),n.topic=t.topic||e.topic,n.position=t.position||e.position,n.bitrate=t.bitrate||e.bitrate,n.user_limit=t.userLimit||e.userLimit,this.rest.makeRequest("patch",a.Channel(e),!0,n).then(e=>this.client.actions.ChannelUpdate.handle(e).updated)}leaveGuild(e){return e.ownerID===this.client.user.id?Promise.reject(new Error("Guild is owned by the client.")):this.rest.makeRequest("delete",a.User("@me").Guild(e.id),!0).then(()=>this.client.actions.GuildDelete.handle({id:e.id}).guild)}createGuild(e){return e.icon=this.client.resolver.resolveBase64(e.icon)||null,e.region=e.region||"us-central",new Promise((t,n)=>{this.rest.makeRequest("post",a.guilds,!0,e).then(e=>{if(this.client.guilds.has(e.id))return t(this.client.guilds.get(e.id));const i=n=>{n.id===e.id&&(this.client.removeListener(o.Events.GUILD_CREATE,i),this.client.clearTimeout(s),t(n))};this.client.on(o.Events.GUILD_CREATE,i);const s=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,i),n(new Error("Took too long to receive guild data."))},1e4)},n)})}deleteGuild(e){return this.rest.makeRequest("delete",a.Guild(e),!0).then(()=>this.client.actions.GuildDelete.handle({id:e.id}).guild)}getUser(e,t){return this.rest.makeRequest("get",a.User(e),!0).then(e=>{return t?this.client.actions.UserGet.handle(e).user:new h(this.client,e)})}updateCurrentUser(e,t){const n=this.client.user,i={};return i.username=e.username||n.username,i.avatar=this.client.resolver.resolveBase64(e.avatar)||n.avatar,n.bot||(i.email=e.email||n.email,i.password=t,e.new_password&&(i.new_password=e.newPassword)),this.rest.makeRequest("patch",a.User("@me"),!0,i).then(e=>this.client.actions.UserUpdate.handle(e).updated)}updateGuild(e,t){const n={};return t.name&&(n.name=t.name),t.region&&(n.region=t.region),t.verificationLevel&&(n.verification_level=Number(t.verificationLevel)),t.afkChannel&&(n.afk_channel_id=this.client.resolver.resolveChannel(t.afkChannel).id),t.afkTimeout&&(n.afk_timeout=Number(t.afkTimeout)),t.icon&&(n.icon=this.client.resolver.resolveBase64(t.icon)),t.owner&&(n.owner_id=this.client.resolver.resolveUser(t.owner).id),t.splash&&(n.splash=this.client.resolver.resolveBase64(t.splash)),this.rest.makeRequest("patch",a.Guild(e),!0,n).then(e=>this.client.actions.GuildUpdate.handle(e).updated)}kickGuildMember(e,t){return this.rest.makeRequest("delete",a.Guild(e).Member(t),!0).then(()=>this.client.actions.GuildMemberRemove.handle({guild_id:e.id,user:t.user}).member)}createGuildRole(e,t){return t.color&&(t.color=this.client.resolver.resolveColor(t.color)),t.permissions&&(t.permissions=r.resolve(t.permissions)),this.rest.makeRequest("post",a.Guild(e).roles,!0,t).then(t=>this.client.actions.GuildRoleCreate.handle({guild_id:e.id,role:t}).role)}deleteGuildRole(e){return this.rest.makeRequest("delete",a.Guild(e.guild).Role(e.id),!0).then(()=>this.client.actions.GuildRoleDelete.handle({guild_id:e.guild.id,role_id:e.id}).role)}setChannelOverwrite(e,t){return this.rest.makeRequest("put",`${a.Channel(e).permissions}/${t.id}`,!0,t)}deletePermissionOverwrites(e){return this.rest.makeRequest("delete",`${a.Channel(e.channel).permissions}/${e.id}`,!0).then(()=>e)}getChannelMessages(e,t={}){const n=[];t.limit&&n.push(`limit=${t.limit}`),t.around?n.push(`around=${t.around}`):t.before?n.push(`before=${t.before}`):t.after&&n.push(`after=${t.after}`);let i=a.Channel(e).messages;return n.length>0&&(i+=`?${n.join("&")}`),this.rest.makeRequest("get",i,!0)}getChannelMessage(e,t){const n=e.messages.get(t);return n?Promise.resolve(n):this.rest.makeRequest("get",a.Channel(e).Message(t),!0)}putGuildMember(e,t,n){if(n.access_token=n.accessToken,n.roles){const e=n.roles;(e instanceof c||e instanceof Array&&e[0]instanceof f)&&(n.roles=e.map(e=>e.id))}return this.rest.makeRequest("put",a.Guild(e).Member(t.id),!0,n).then(t=>this.client.actions.GuildMemberGet.handle(e,t).member)}getGuildMember(e,t,n){return this.rest.makeRequest("get",a.Guild(e).Member(t.id),!0).then(t=>{return n?this.client.actions.GuildMemberGet.handle(e,t).member:new p(e,t)})}updateGuildMember(e,t){t.channel&&(t.channel_id=this.client.resolver.resolveChannel(t.channel).id),t.roles&&(t.roles=t.roles.map(e=>e instanceof f?e.id:e));let n=a.Member(e);if(e.id===this.client.user.id){const i=Object.keys(t);1===i.length&&"nick"===i[0]&&(n=a.Member(e).nickname)}return this.rest.makeRequest("patch",n,!0,t).then(t=>e.guild._updateMember(e,t).mem)}addMemberRole(e,t){return new Promise((n,i)=>{if(e._roles.includes(t.id))return n(e);const s=(e,i)=>{!e._roles.includes(t.id)&&i._roles.includes(t.id)&&(this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),n(i))};this.client.on(o.Events.GUILD_MEMBER_UPDATE,s);const r=this.client.setTimeout(()=>this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),1e4);return this.rest.makeRequest("put",a.Member(e).Role(t.id),!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,s),this.client.clearTimeout(r),i(e)})})}removeMemberRole(e,t){return new Promise((n,i)=>{if(!e._roles.includes(t.id))return n(e);const s=(e,i)=>{e._roles.includes(t.id)&&!i._roles.includes(t.id)&&(this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),n(i))};this.client.on(o.Events.GUILD_MEMBER_UPDATE,s);const r=this.client.setTimeout(()=>this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),1e4);return this.rest.makeRequest("delete",a.Member(e).Role(t.id),!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,s),this.client.clearTimeout(r),i(e)})})}sendTyping(e){return this.rest.makeRequest("post",a.Channel(e).typing,!0)}banGuildMember(e,t,n=0){const i=this.client.resolver.resolveUserID(t);return i?this.rest.makeRequest("put",`${a.Guild(e).bans}/${i}?delete-message-days=${n}`,!0,{"delete-message-days":n}).then(()=>{if(t instanceof p)return t;const n=this.client.resolver.resolveUser(i);return n?(t=this.client.resolver.resolveGuildMember(e,n),t||n):i}):Promise.reject(new Error("Couldn't resolve the user ID to ban."))}unbanGuildMember(e,t){return new Promise((n,i)=>{const s=this.client.resolver.resolveUserID(t);if(!s)throw new Error("Couldn't resolve the user ID to unban.");const r=(t,i)=>{t.id===e.id&&i.id===s&&(this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r),this.client.clearTimeout(c),n(i))};this.client.on(o.Events.GUILD_BAN_REMOVE,r);const c=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r),i(new Error("Took too long to receive the ban remove event."))},1e4);this.rest.makeRequest("delete",`${a.Guild(e).bans}/${s}`,!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r),this.client.clearTimeout(c),i(e)})})}getGuildBans(e){return this.rest.makeRequest("get",a.Guild(e).bans,!0).then(e=>{const t=new c;for(const n of e){const e=this.client.dataManager.newUser(n.user);t.set(e.id,e)}return t})}updateGuildRole(e,t){const n={};return n.name=t.name||e.name,n.position="undefined"!=typeof t.position?t.position:e.position,n.color=this.client.resolver.resolveColor(t.color||e.color),n.hoist="undefined"!=typeof t.hoist?t.hoist:e.hoist,n.mentionable="undefined"!=typeof t.mentionable?t.mentionable:e.mentionable,t.permissions?n.permissions=r.resolve(t.permissions):n.permissions=e.permissions,this.rest.makeRequest("patch",a.Guild(e.guild).Role(e.id),!0,n).then(t=>this.client.actions.GuildRoleUpdate.handle({role:t,guild_id:e.guild.id}).updated)}pinMessage(e){return this.rest.makeRequest("put",a.Channel(e.channel).Pin(e.id),!0).then(()=>e)}unpinMessage(e){return this.rest.makeRequest("delete",a.Channel(e.channel).Pin(e.id),!0).then(()=>e)}getChannelPinnedMessages(e){return this.rest.makeRequest("get",a.Channel(e).pins,!0)}createChannelInvite(e,t){const n={};return n.temporary=t.temporary,n.max_age=t.maxAge,n.max_uses=t.maxUses,this.rest.makeRequest("post",a.Channel(e).invites,!0,n).then(e=>new m(this.client,e))}deleteInvite(e){return this.rest.makeRequest("delete",a.Invite(e.code),!0).then(()=>e)}getInvite(e){return this.rest.makeRequest("get",a.Invite(e),!0).then(e=>new m(this.client,e))}getGuildInvites(e){return this.rest.makeRequest("get",a.Guild(e).invites,!0).then(e=>{const t=new c;for(const n of e){const e=new m(this.client,n);t.set(e.code,e)}return t})}pruneGuildMembers(e,t,n){return this.rest.makeRequest(n?"get":"post",`${a.Guild(e).prune}?days=${t}`,!0).then(e=>e.pruned)}createEmoji(e,t,n,i){const s={image:t,name:n};return i&&(s.roles=i.map(e=>e.id?e.id:e)),this.rest.makeRequest("post",a.Guild(e).emojis,!0,s).then(t=>this.client.actions.GuildEmojiCreate.handle(e,t).emoji)}updateEmoji(e,t){const n={};return t.name&&(n.name=t.name),t.roles&&(n.roles=t.roles.map(e=>e.id?e.id:e)),this.rest.makeRequest("patch",a.Guild(e.guild).Emoji(e.id),!0,n).then(t=>this.client.actions.GuildEmojiUpdate.handle(e,t).emoji)}deleteEmoji(e){return this.rest.makeRequest("delete",a.Guild(e.guild).Emoji(e.id),!0).then(()=>this.client.actions.GuildEmojiDelete.handle(e).data)}getWebhook(e,t){return this.rest.makeRequest("get",a.Webhook(e,t),!t).then(e=>new g(this.client,e))}getGuildWebhooks(e){return this.rest.makeRequest("get",a.Guild(e).webhooks,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new g(this.client,n));return t})}getChannelWebhooks(e){return this.rest.makeRequest("get",a.Channel(e).webhooks,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new g(this.client,n));return t})}createWebhook(e,t,n){return this.rest.makeRequest("post",a.Channel(e).webhooks,!0,{name:t,avatar:n}).then(e=>new g(this.client,e))}editWebhook(e,t,n){return this.rest.makeRequest("patch",a.Webhook(e.id,e.token),!1,{name:t,avatar:n}).then(t=>{return e.name=t.name,e.avatar=t.avatar,e})}deleteWebhook(e){return this.rest.makeRequest("delete",a.Webhook(e.id,e.token),!1)}sendWebhookMessage(e,t,{avatarURL,tts,disableEveryone,embeds,username}={},n=null){return username=username||e.name,"undefined"!=typeof t&&(t=this.client.resolver.resolveString(t)),t&&(disableEveryone||"undefined"==typeof disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@$1")),this.rest.makeRequest("post",`${a.Webhook(e.id,e.token)}?wait=true`,!1,{username:username,avatar_url:avatarURL,content:t,tts:tts,embeds:embeds},n)}sendSlackWebhookMessage(e,t){return this.rest.makeRequest("post",`${a.Webhook(e.id,e.token)}/slack?wait=true`,!1,t)}fetchUserProfile(e){return this.rest.makeRequest("get",a.User(e).profile,!0).then(t=>new v(e,t))}fetchMeMentions(e){return e.guild&&(e.guild=e.guild.id?e.guild.id:e.guild),this.rest.makeRequest("get",a.User("@me").mentions(e.limit,e.roles,e.everyone,e.guild)).then(e=>e.body.map(e=>new d(this.client.channels.get(e.channel_id),e,this.client)))}addFriend(e){return this.rest.makeRequest("post",a.User("@me"),!0,{username:e.username,discriminator:e.discriminator}).then(()=>e)}removeFriend(e){return this.rest.makeRequest("delete",a.User("@me").Relationship(e.id),!0).then(()=>e)}blockUser(e){return this.rest.makeRequest("put",a.User("@me").Relationship(e.id),!0,{type:2}).then(()=>e)}unblockUser(e){return this.rest.makeRequest("delete",a.User("@me").Relationship(e.id),!0).then(()=>e)}updateChannelPositions(e,t){const n=new Array(t.length);for(let i=0;ithis.client.actions.GuildChannelsPositionUpdate.handle({guild_id:e,channels:t}).guild)}setRolePositions(e,t){return this.rest.makeRequest("patch",a.Guild(e).roles,!0,t).then(()=>this.client.actions.GuildRolesPositionUpdate.handle({guild_id:e,roles:t}).guild)}setChannelPositions(e,t){return this.rest.makeRequest("patch",a.Guild(e).channels,!0,t).then(()=>this.client.actions.GuildChannelsPositionUpdate.handle({guild_id:e,channels:t}).guild)}addMessageReaction(e,t){return this.rest.makeRequest("put",a.Message(e).Reaction(t).User("@me"),!0).then(()=>e._addReaction(l.parseEmoji(t),e.client.user))}removeMessageReaction(e,t,n){const i=a.Message(e).Reaction(t).User(n===this.client.user.id?"@me":n);return this.rest.makeRequest("delete",i,!0).then(()=>this.client.actions.MessageReactionRemove.handle({user_id:n,message_id:e.id,emoji:l.parseEmoji(t),channel_id:e.channel.id}).reaction)}removeMessageReactions(e){return this.rest.makeRequest("delete",a.Message(e).reactions,!0).then(()=>e)}getMessageReactionUsers(e,t,n=100){return this.rest.makeRequest("get",a.Message(e).Reaction(t,n),!0)}getApplication(e){return this.rest.makeRequest("get",a.OAUTH2.Application(e),!0).then(e=>new b(this.client,e))}resetApplication(e){return this.rest.makeRequest("post",a.OAUTH2.Application(e).reset,!0).then(e=>new b(this.client,e))}setNote(e,t){return this.rest.makeRequest("put",a.User(e).note,!0,{note:t}).then(()=>e)}acceptInvite(e){return e.id&&(e=e.id),new Promise((t,n)=>this.rest.makeRequest("post",a.Invite(e),!0).then(e=>{const i=n=>{n.id===e.id&&(t(n),this.client.removeListener(o.Events.GUILD_CREATE,i))};this.client.on(o.Events.GUILD_CREATE,i),this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,i),n(new Error("Accepting invite timed out"))},12e4)}))}patchUserSettings(e){return this.rest.makeRequest("patch",o.Endpoints.User("@me").settings,!0,e)}}e.exports=x},function(e,t,n){const i=n(64);class s extends i{constructor(e,t){super(e,t),this.client=e.client,this.limit=1/0,this.resetTime=null,this.remaining=1,this.timeDifference=0,this.resetTimeout=null}push(e){super.push(e),this.handle()}execute(e){e&&e.request.gen().end((t,n)=>{if(n&&n.headers&&(this.limit=Number(n.headers["x-ratelimit-limit"]),this.resetTime=1e3*Number(n.headers["x-ratelimit-reset"]),this.remaining=Number(n.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(n.headers.date).getTime()),t)if(429===t.status){if(this.queue.unshift(e),n.headers["x-ratelimit-global"]&&(this.globalLimit=!0),this.resetTimeout)return;this.resetTimeout=this.client.setTimeout(()=>{this.remaining=this.limit,this.globalLimit=!1,this.handle(),this.resetTimeout=null},Number(n.headers["retry-after"])+this.client.options.restTimeOffset)}else e.reject(t),this.handle();else{this.globalLimit=!1;const t=n&&n.body?n.body:{};e.resolve(t),this.handle()}})}handle(){super.handle(),this.remaining<=0||0===this.queue.length||this.globalLimit||(this.execute(this.queue.shift()),this.remaining--,this.handle())}}e.exports=s},function(e,t,n){const i=n(64);class s extends i{constructor(e,t){super(e,t),this.endpoint=t,this.timeDifference=0,this.busy=!1}push(e){super.push(e),this.handle()}execute(e){return this.busy=!0,new Promise(t=>{e.request.gen().end((n,i)=>{if(i&&i.headers&&(this.requestLimit=Number(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.queue.unshift(e),this.restManager.client.setTimeout(()=>{this.globalLimit=!1,t()},Number(i.headers["retry-after"])+this.restManager.client.options.restTimeOffset),i.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):(e.reject(n),t(n));else{this.globalLimit=!1;const n=i&&i.body?i.body:{};e.resolve(n),0===this.requestRemaining?this.restManager.client.setTimeout(()=>t(n),this.requestResetTime-Date.now()+this.timeDifference+this.restManager.client.options.restTimeOffset):t(n)}})})}handle(){super.handle(),this.busy||0===this.remaining||0===this.queue.length||this.globalLimit||this.execute(this.queue.shift()).then(()=>{this.busy=!1,this.handle()})}}e.exports=s},function(e,t,n){(function(t){const i=n(0);class s{constructor(){this.build(this.constructor.DEFAULT)}set({url,version}={}){this.build({url:url||this.constructor.DFEAULT.url,version:version||this.constructor.DEFAULT.version})}build(e){this.userAgent=`DiscordBot (${e.url}, ${e.version}) Node.js/${t.version}`}}s.DEFAULT={url:i.Package.homepage.split("#")[0],version:i.Package.version},e.exports=s}).call(t,n(6))},function(e,t,n){const i=n(10).EventEmitter,s=n(0),r=n(137),o=n(65);class a extends i{constructor(e){super(),this.client=e,this.packetManager=new r(this),this.status=s.Status.IDLE,this.sessionID=null,this.sequence=-1,this.gateway=null,this.normalReady=!1,this.ws=null,this.disabledEvents={};for(const t of e.options.disabledEvents)this.disabledEvents[t]=!0;this.first=!0,this.lastHeartbeatAck=!0,this._trace=[],this.resumeStart=-1}_connect(e){this.client.emit("debug",`Connecting to gateway ${e}`),this.normalReady=!1,this.status!==s.Status.RECONNECTING&&(this.status=s.Status.CONNECTING),this.ws=new o(e),this.ws.on("open",this.eventOpen.bind(this)),this.ws.on("packet",this.eventPacket.bind(this)),this.ws.on("close",this.eventClose.bind(this)),this.ws.on("error",this.eventError.bind(this)),this._queue=[],this._remaining=120,this.client.setInterval(()=>{this._remaining=120,this._remainingReset=Date.now()},6e4)}connect(e=this.gateway){this.gateway=e,this.first?(this._connect(e),this.first=!1):this.client.setTimeout(()=>this._connect(e),5500)}heartbeat(e){return e&&!this.lastHeartbeatAck?void this.tryReconnect():(this.client.emit("debug","Sending heartbeat"),this.client._pingTimestamp=Date.now(),this.client.ws.send({op:s.OPCodes.HEARTBEAT,d:this.sequence},!0),void(this.lastHeartbeatAck=!1))}send(e,t=false){return t?void this._send(e):(this._queue.push(e),void this.doQueue())}destroy(){this.ws&&this.ws.close(1e3),this._queue=[],this.status=s.Status.IDLE}_send(e){this.ws.readyState===o.WebSocket.OPEN&&(this.emit("send",e),this.ws.send(e))}doQueue(){const e=this._queue[0];if(this.ws.readyState===o.WebSocket.OPEN&&e){if(0===this.remaining)return void this.client.setTimeout(this.doQueue.bind(this),Date.now()-this.remainingReset);this._remaining--,this._send(e),this._queue.shift(),this.doQueue()}}eventOpen(){this.client.emit("debug","Connection to gateway opened"),this.lastHeartbeatAck=!0,this.sessionID?this._sendResume():this._sendNewIdentify()}_sendResume(){if(!this.sessionID)return void this._sendNewIdentify();this.client.emit("debug","Identifying as resumed session"),this.resumeStart=this.sequence;const e={token:this.client.token,session_id:this.sessionID,seq:this.sequence};this.send({op:s.OPCodes.RESUME,d:e})}_sendNewIdentify(){this.reconnecting=!1;const e=this.client.options.ws;e.token=this.client.token,this.client.options.shardCount>0&&(e.shard=[Number(this.client.options.shardId),Number(this.client.options.shardCount)]),this.client.emit("debug","Identifying as new session"),this.send({op:s.OPCodes.IDENTIFY,d:e}),this.sequence=-1}eventClose(e){this.emit("close",e),this.client.clearInterval(this.client.manager.heartbeatInterval),this.status=s.Status.DISCONNECTED,this._queue=[],this.reconnecting||this.client.emit(s.Events.DISCONNECT,e),[4004,4010,4011].includes(e.code)||this.reconnecting||1e3===e.code||this.tryReconnect()}eventPacket(e){return null===e?(this.eventError(new Error(s.Errors.BAD_WS_MESSAGE)),!1):(this.client.emit("raw",e),e.op===s.OPCodes.HELLO&&this.client.manager.setupKeepAlive(e.d.heartbeat_interval),this.packetManager.handle(e))}eventError(e){this.client.listenerCount("error")>0&&this.client.emit("error",e),this.tryReconnect()}_emitReady(e=true){this.status=s.Status.READY,this.client.emit(s.Events.READY),this.packetManager.handleQueue(),this.normalReady=e}checkIfReady(){if(this.status!==s.Status.READY&&this.status!==s.Status.NEARLY){let e=0;for(const t of this.client.guilds.keys())e+=this.client.guilds.get(t).available?0:1;if(0===e){if(this.status=s.Status.NEARLY,this.client.options.fetchAllMembers){const e=this.client.guilds.map(e=>e.fetchMembers());return void Promise.all(e).then(()=>this._emitReady(),e=>{this.client.emit(s.Events.WARN,"Error in pre-ready guild member fetching"),this.client.emit(s.Events.ERROR,e),this._emitReady()})}this._emitReady()}}}tryReconnect(){this.status!==s.Status.RECONNECTING&&this.status!==s.Status.CONNECTING&&this.client.token&&(this.status=s.Status.RECONNECTING,this.ws.close(),this.packetManager.handleQueue(),this.client.emit(s.Events.RECONNECTING),this.connect(this.client.ws.gateway))}}e.exports=a},function(e,t,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(e){this.ws=e,this.handlers={},this.queue=[],this.register(i.WSEvents.READY,n(164)),this.register(i.WSEvents.RESUMED,n(167)),this.register(i.WSEvents.GUILD_CREATE,n(144)),this.register(i.WSEvents.GUILD_DELETE,n(145)),this.register(i.WSEvents.GUILD_UPDATE,n(155)),this.register(i.WSEvents.GUILD_BAN_ADD,n(142)),this.register(i.WSEvents.GUILD_BAN_REMOVE,n(143)),this.register(i.WSEvents.GUILD_MEMBER_ADD,n(147)),this.register(i.WSEvents.GUILD_MEMBER_REMOVE,n(148)),this.register(i.WSEvents.GUILD_MEMBER_UPDATE,n(149)),this.register(i.WSEvents.GUILD_ROLE_CREATE,n(151)),this.register(i.WSEvents.GUILD_ROLE_DELETE,n(152)),this.register(i.WSEvents.GUILD_ROLE_UPDATE,n(153)),this.register(i.WSEvents.GUILD_EMOJIS_UPDATE,n(146)),this.register(i.WSEvents.GUILD_MEMBERS_CHUNK,n(150)),this.register(i.WSEvents.CHANNEL_CREATE,n(138)),this.register(i.WSEvents.CHANNEL_DELETE,n(139)),this.register(i.WSEvents.CHANNEL_UPDATE,n(141)),this.register(i.WSEvents.CHANNEL_PINS_UPDATE,n(140)),this.register(i.WSEvents.PRESENCE_UPDATE,n(163)),this.register(i.WSEvents.USER_UPDATE,n(171)),this.register(i.WSEvents.USER_NOTE_UPDATE,n(169)),this.register(i.WSEvents.USER_SETTINGS_UPDATE,n(170)),this.register(i.WSEvents.VOICE_STATE_UPDATE,n(173)),this.register(i.WSEvents.TYPING_START,n(168)),this.register(i.WSEvents.MESSAGE_CREATE,n(156)),this.register(i.WSEvents.MESSAGE_DELETE,n(157)),this.register(i.WSEvents.MESSAGE_UPDATE,n(162)),this.register(i.WSEvents.MESSAGE_DELETE_BULK,n(158)),this.register(i.WSEvents.VOICE_SERVER_UPDATE,n(172)),this.register(i.WSEvents.GUILD_SYNC,n(154)),this.register(i.WSEvents.RELATIONSHIP_ADD,n(165)),this.register(i.WSEvents.RELATIONSHIP_REMOVE,n(166)),this.register(i.WSEvents.MESSAGE_REACTION_ADD,n(159)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE,n(160)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE_ALL,n(161))}get client(){return this.ws.client}register(e,t){this.handlers[e]=new t(this)}handleQueue(){this.queue.forEach((e,t)=>{this.handle(this.queue[t]),this.queue.splice(t,1)})}setSequence(e){e&&e>this.ws.sequence&&(this.ws.sequence=e)}handle(e){return e.op===i.OPCodes.RECONNECT?(this.setSequence(e.s),this.ws.tryReconnect(),!1):e.op===i.OPCodes.INVALID_SESSION?(this.client.emit("debug",`SESSION INVALID! Waiting to reconnect: ${e.d}`),e.d?setTimeout(()=>{this.ws._sendResume()},2500):(this.ws.sessionID=null,this.ws._sendNewIdentify()),!1):(e.op===i.OPCodes.HEARTBEAT_ACK?(this.ws.client._pong(this.ws.client._pingTimestamp),this.ws.lastHeartbeatAck=!0,this.ws.client.emit("debug","Heartbeat acknowledged")):e.op===i.OPCodes.HEARTBEAT&&(this.client.ws.send({op:i.OPCodes.HEARTBEAT,d:this.client.ws.sequence}),this.ws.client.emit("debug","Received gateway heartbeat")),this.ws.status===i.Status.RECONNECTING&&(this.ws.reconnecting=!1,this.ws.checkIfReady()),this.setSequence(e.s),void 0===this.ws.disabledEvents[e.t]&&(this.ws.status!==i.Status.READY&&s.indexOf(e.t)===-1?(this.queue.push(e),!1):!!this.handlers[e.t]&&this.handlers[e.t].handle(e)))}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.ChannelCreate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.ChannelDelete.handle(n);i.channel&&t.emit(s.Events.CHANNEL_DELETE,i.channel)}}e.exports=r},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.channels.get(n.channel_id),r=new Date(n.last_pin_timestamp);i&&r&&t.emit(s.Events.CHANNEL_PINS_UPDATE,i,r)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.ChannelUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id),r=t.users.get(n.user.id);i&&r&&t.emit(s.Events.GUILD_BAN_ADD,i,r)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildBanRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.id);i?i.available||n.unavailable||(i.setup(n),this.packetManager.ws.checkIfReady()):t.dataManager.newGuild(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.GuildDelete.handle(n);i.guild&&t.emit(s.Events.GUILD_DELETE,i.guild)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildEmojisUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);i&&(i.memberCount++,i._addMember(n))}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildMemberRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=i.members.get(n.user.id);e&&i._updateMember(e,n)}}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=n.members.map(e=>i._addMember(e,!1));t.emit(s.Events.GUILD_MEMBERS_CHUNK,e,i),t.ws.lastHeartbeatAck=!0}}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleCreate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleDelete.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildSync.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.MessageCreate.handle(n);i.message&&t.emit(s.Events.MESSAGE_CREATE,i.message)}}e.exports=r},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.MessageDelete.handle(n);i.message&&t.emit(s.Events.MESSAGE_DELETE,i.message)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageDeleteBulk.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionAdd.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionRemoveAll.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(e){const t=this.packetManager.client,n=e.d;let i=t.users.get(n.user.id);const o=t.guilds.get(n.guild_id);if(!i){if(!n.user.username)return;i=t.dataManager.newUser(n.user)}const a=r.cloneObject(i);if(i.patch(n.user),i.equals(a)||t.emit(s.Events.USER_UPDATE,a,i),o){let e=o.members.get(i.id);if(e||"offline"===n.status||(e=o._addMember({
-user:i,roles:n.roles,deaf:!1,mute:!1},!1),t.emit(s.Events.GUILD_MEMBER_AVAILABLE,e)),e){if(0===t.listenerCount(s.Events.PRESENCE_UPDATE))return void o._setPresence(i.id,n);const a=r.cloneObject(e);e.presence&&(a.frozenPresence=r.cloneObject(e.presence)),o._setPresence(i.id,n),t.emit(s.Events.PRESENCE_UPDATE,a,e)}else o._setPresence(i.id,n)}}}e.exports=o},function(e,t,n){const i=n(1),s=n(41);class r extends i{handle(e){const t=this.packetManager.client,n=e.d;t.ws.heartbeat(),n.user.user_settings=n.user_settings;const i=new s(t,n.user);t.user=i,t.readyAt=new Date,t.users.set(i.id,i);for(const r of n.guilds)t.dataManager.newGuild(r);for(const o of n.private_channels)t.dataManager.newChannel(o);for(const a of n.relationships){const e=t.dataManager.newUser(a.user);1===a.type?t.user.friends.set(e.id,e):2===a.type&&t.user.blocked.set(e.id,e)}n.presences=n.presences||[];for(const c of n.presences)t.dataManager.newUser(c.user),t._setPresence(c.user.id,c);if(n.notes)for(const u in n.notes){let e=n.notes[u];e.length||(e=null),t.user.notes.set(u,e)}!t.user.bot&&t.options.sync&&t.setInterval(t.syncGuilds.bind(t),3e4),t.once("ready",t.syncGuilds.bind(t)),t.users.has("1")||t.dataManager.newUser({id:"1",username:"Clyde",discriminator:"0000",avatar:"https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png",bot:!0,status:"online",game:null,verified:!0}),t.setTimeout(()=>{t.ws.normalReady||t.ws._emitReady(!1)},1200*n.guilds.length);const l=this.packetManager.ws;l.sessionID=n.session_id,l._trace=n._trace,t.emit("debug",`READY ${l._trace.join(" -> ")} ${l.sessionID}`),l.checkIfReady()}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;1===n.type?t.fetchUser(n.id).then(e=>{t.user.friends.set(e.id,e)}):2===n.type&&t.fetchUser(n.id).then(e=>{t.user.blocked.set(e.id,e)})}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;2===n.type?t.user.blocked.has(n.id)&&t.user.blocked.delete(n.id):1===n.type&&t.user.friends.has(n.id)&&t.user.friends.delete(n.id)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=t.ws;n._trace=e.d._trace;const i=n.sequence-n.resumeStart;n.resumeStart=-1,t.emit("debug",`RESUMED ${n._trace.join(" -> ")} | replayed ${i} events. `),t.emit("resume",i),n.heartbeat()}}e.exports=s},function(e,t,n){function i(e,t){return e.client.setTimeout(()=>{e.client.emit(r.Events.TYPING_STOP,e,t,e._typing.get(t.id)),e._typing.delete(t.id)},6e3)}const s=n(1),r=n(0);class o extends s{handle(e){const t=this.packetManager.client,n=e.d,s=t.channels.get(n.channel_id),o=t.users.get(n.user_id),c=new Date(1e3*n.timestamp);if(s&&o){if("voice"===s.type)return void t.emit(r.Events.WARN,`Discord sent a typing packet to voice channel ${s.id}`);if(s._typing.has(o.id)){const e=s._typing.get(o.id);e.lastTimestamp=c,e.resetTimeout(i(s,o))}else s._typing.set(o.id,new a(t,c,c,i(s,o))),t.emit(r.Events.TYPING_START,s,o)}}}class a{constructor(e,t,n,i){this.client=e,this.since=t,this.lastTimestamp=n,this._timeout=i}resetTimeout(e){this.client.clearTimeout(this._timeout),this._timeout=e}get elapsedTime(){return Date.now()-this.since}}e.exports=o},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.UserNoteUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client;t.user.settings.patch(e.d),t.emit(s.Events.USER_SETTINGS_UPDATE,t.user.settings)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.UserUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.emit("self.voiceServer",n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=i.members.get(n.user_id);if(e){const i=r.cloneObject(e);e.voiceChannel&&e.voiceChannel.id!==n.channel_id&&e.voiceChannel.members.delete(i.id),n.channel_id||(e.speaking=null),e.user.id===t.user.id&&n.channel_id&&t.emit("self.voiceStateUpdate",n);const o=t.channels.get(n.channel_id);o&&o.members.set(e.user.id,e),e.serverMute=n.mute,e.serverDeaf=n.deaf,e.selfMute=n.self_mute,e.selfDeaf=n.self_deaf,e.voiceSessionID=n.session_id,e.voiceChannelID=n.channel_id,t.emit(s.Events.VOICE_STATE_UPDATE,i,e)}}}}e.exports=o},function(e,t,n){const i=n(66),s=n(3);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.message=e,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(e){return e.message.id!==this.message.id?null:{key:e.emoji.id||e.emoji.name,value:e}}postCheck(e,t){return this.users.set(t.id,t),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}e.exports=r},function(e,t){class n{constructor(e,t){this.user=e,this.setup(t)}setup(e){this.type=e.type,this.name=e.name,this.id=e.id,this.revoked=e.revoked,this.integrations=e.integrations}}e.exports=n},function(e,t,n){const i=n(3),s=n(175);class r{constructor(e,t){this.user=e,Object.defineProperty(this,"client",{value:e.client}),this.mutualGuilds=new i,this.connections=new i,this.setup(t)}setup(e){this.premium=e.premium,this.premiumSince=e.premium_since?new Date(e.premium_since):null;for(const t of e.mutual_guilds)this.client.guilds.has(t.id)&&this.mutualGuilds.set(t.id,this.client.guilds.get(t.id));for(const n of e.connected_accounts)this.connections.set(n.id,new s(this.user,n))}}e.exports=r},function(e,t){class n{constructor(e){this.id=e.id,this.name=e.name,this.vip=e.vip,this.deprecated=e.deprecated,this.optimal=e.optimal,this.custom=e.custom,this.sampleHostname=e.sample_hostname}}e.exports=n},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){const i=n(4);e.exports={Client:n(67),Shard:n(70),ShardClientUtil:n(71),ShardingManager:n(72),WebhookClient:n(68),Collection:n(3),Constants:n(0),EvaluatedPermissions:n(8),Permissions:n(8),Snowflake:n(7),SnowflakeUtil:n(7),Util:i,util:i,version:n(40).version,escapeMarkdown:i.escapeMarkdown,fetchRecommendedShards:i.fetchRecommendedShards,splitMessage:i.splitMessage,Channel:n(14),ClientUser:n(41),ClientUserSettings:n(42),DMChannel:n(43),Emoji:n(17),Game:n(12).Game,GroupDMChannel:n(28),Guild:n(24),GuildChannel:n(25),GuildMember:n(18),Invite:n(44),Message:n(19),MessageAttachment:n(45),MessageCollector:n(46),MessageEmbed:n(47),MessageMentions:n(48),MessageReaction:n(49),OAuth2Application:n(50),PartialGuild:n(51),PartialGuildChannel:n(52),PermissionOverwrites:n(53),Presence:n(12).Presence,ReactionEmoji:n(29),RichEmbed:n(69),Role:n(15),TextChannel:n(54),User:n(16),VoiceChannel:n(55),Webhook:n(30)},"browser"===n(23).platform()&&(window.Discord=e.exports)}]);
\ No newline at end of file
+\`\`\``),reply&&"dm"!==e.channel.type){const e=this.client.resolver.resolveUserID(reply),n=`<@${reply instanceof p&&reply.nickname?"!":""}${e}>`;t=`${n}${t?`, ${t}`:""}`}return this.rest.makeRequest("patch",a.Message(e),!0,{content:t,embed:embed}).then(e=>this.client.actions.MessageUpdate.handle(e).updated)}deleteMessage(e){return this.rest.makeRequest("delete",a.Message(e),!0).then(()=>this.client.actions.MessageDelete.handle({id:e.id,channel_id:e.channel.id}).message)}ackMessage(e){return this.rest.makeRequest("post",a.Message(e).ack,!0,{token:this._ackToken}).then(t=>{t.token&&(this._ackToken=t.token);return e})}ackTextChannel(e){return this.rest.makeRequest("post",a.Channel(e).ack,!0,{token:this._ackToken}).then(t=>{t.token&&(this._ackToken=t.token);return e})}ackGuild(e){return this.rest.makeRequest("post",a.Guild(e).ack,!0).then(()=>e)}bulkDeleteMessages(e,t,n){return n&&(t=t.filter(e=>Date.now()-u.deconstruct(e).date.getTime()<12096e5)),this.rest.makeRequest("post",a.Channel(e).messages.bulkDelete,!0,{messages:t}).then(()=>this.client.actions.MessageDeleteBulk.handle({channel_id:e.id,ids:t}).messages)}search(e,t){if(t.before&&(t.before instanceof Date||(t.before=new Date(t.before)),t.maxID=s.fromNumber(t.before.getTime()-14200704e5).shiftLeft(22).toString()),t.after&&(t.after instanceof Date||(t.after=new Date(t.after)),t.minID=s.fromNumber(t.after.getTime()-14200704e5).shiftLeft(22).toString()),t.during){t.during instanceof Date||(t.during=new Date(t.during));const e=t.during.getTime()-14200704e5;t.minID=s.fromNumber(e).shiftLeft(22).toString(),t.maxID=s.fromNumber(e+864e5).shiftLeft(22).toString()}t.channel&&(t.channel=this.client.resolver.resolveChannelID(t.channel)),t.author&&(t.author=this.client.resolver.resolveUserID(t.author)),t.mentions&&(t.mentions=this.client.resolver.resolveUserID(t.options.mentions)),t={content:t.content,max_id:t.maxID,min_id:t.minID,has:t.has,channel_id:t.channel,author_id:t.author,author_type:t.authorType,context_size:t.contextSize,sort_by:t.sortBy,sort_order:t.sortOrder,limit:t.limit,offset:t.offset,mentions:t.mentions,mentions_everyone:t.mentionsEveryone,link_hostname:t.linkHostname,embed_provider:t.embedProvider,embed_type:t.embedType,attachment_filename:t.attachmentFilename,attachment_extension:t.attachmentExtension};for(const e in t)void 0===t[e]&&delete t[e];const n=(i.stringify(t).match(/[^=&?]+=[^=&?]+/g)||[]).join("&");let r;if(e instanceof E)r=a.Channel(e).search;else{if(!(e instanceof _))throw new TypeError("Target must be a TextChannel, DMChannel, GroupDMChannel, or Guild.");r=a.Guild(e).search}return this.rest.makeRequest("get",`${r}?${n}`,!0).then(e=>{const t=e.messages.map(e=>e.map(e=>new d(this.client.channels.get(e.channel_id),e,this.client)));return{totalResults:e.total_results,messages:t}})}createChannel(e,t,n,i){return i instanceof c&&(i=i.array()),this.rest.makeRequest("post",a.Guild(e).channels,!0,{name:t,type:n,permission_overwrites:i}).then(e=>this.client.actions.ChannelCreate.handle(e).channel)}createDM(e){const t=this.getExistingDM(e);return t?Promise.resolve(t):this.rest.makeRequest("post",a.User(this.client.user).channels,!0,{recipient_id:e.id}).then(e=>this.client.actions.ChannelCreate.handle(e).channel)}createGroupDM(e){const t=this.client.user.bot?{access_tokens:e.accessTokens,nicks:e.nicks}:{recipients:e.recipients};return this.rest.makeRequest("post",a.User("@me").channels,!0,t).then(e=>new w(this.client,e))}addUserToGroupDM(e,t){const n=this.client.user.bot?{nick:t.nick,access_token:t.accessToken}:{recipient:t.id};return this.rest.makeRequest("put",a.Channel(e).Recipient(t.id),!0,n).then(()=>e)}getExistingDM(e){return this.client.channels.find(t=>t.recipient&&t.recipient.id===e.id)}deleteChannel(e){return(e instanceof h||e instanceof p)&&(e=this.getExistingDM(e)),e?this.rest.makeRequest("delete",a.Channel(e),!0).then(t=>{t.id=e.id;return this.client.actions.ChannelDelete.handle(t).channel}):Promise.reject(new Error("No channel to delete."))}updateChannel(e,t){const n={};return n.name=(t.name||e.name).trim(),n.topic=t.topic||e.topic,n.position=t.position||e.position,n.bitrate=t.bitrate||e.bitrate,n.user_limit=t.userLimit||e.userLimit,this.rest.makeRequest("patch",a.Channel(e),!0,n).then(e=>this.client.actions.ChannelUpdate.handle(e).updated)}leaveGuild(e){return e.ownerID===this.client.user.id?Promise.reject(new Error("Guild is owned by the client.")):this.rest.makeRequest("delete",a.User("@me").Guild(e.id),!0).then(()=>this.client.actions.GuildDelete.handle({id:e.id}).guild)}createGuild(e){return e.icon=this.client.resolver.resolveBase64(e.icon)||null,e.region=e.region||"us-central",new Promise((t,n)=>{this.rest.makeRequest("post",a.guilds,!0,e).then(e=>{if(this.client.guilds.has(e.id))return t(this.client.guilds.get(e.id));const i=n=>{n.id===e.id&&(this.client.removeListener(o.Events.GUILD_CREATE,i),this.client.clearTimeout(s),t(n))};this.client.on(o.Events.GUILD_CREATE,i);const s=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,i);n(new Error("Took too long to receive guild data."))},1e4);return},n)})}deleteGuild(e){return this.rest.makeRequest("delete",a.Guild(e),!0).then(()=>this.client.actions.GuildDelete.handle({id:e.id}).guild)}getUser(e,t){return this.rest.makeRequest("get",a.User(e),!0).then(e=>t?this.client.actions.UserGet.handle(e).user:new h(this.client,e))}updateCurrentUser(e,t){const n=this.client.user,i={};return i.username=e.username||n.username,i.avatar=this.client.resolver.resolveBase64(e.avatar)||n.avatar,n.bot||(i.email=e.email||n.email,i.password=t,e.new_password&&(i.new_password=e.newPassword)),this.rest.makeRequest("patch",a.User("@me"),!0,i).then(e=>this.client.actions.UserUpdate.handle(e).updated)}updateGuild(e,t){const n={};return t.name&&(n.name=t.name),t.region&&(n.region=t.region),t.verificationLevel&&(n.verification_level=Number(t.verificationLevel)),t.afkChannel&&(n.afk_channel_id=this.client.resolver.resolveChannel(t.afkChannel).id),t.afkTimeout&&(n.afk_timeout=Number(t.afkTimeout)),t.icon&&(n.icon=this.client.resolver.resolveBase64(t.icon)),t.owner&&(n.owner_id=this.client.resolver.resolveUser(t.owner).id),t.splash&&(n.splash=this.client.resolver.resolveBase64(t.splash)),this.rest.makeRequest("patch",a.Guild(e),!0,n).then(e=>this.client.actions.GuildUpdate.handle(e).updated)}kickGuildMember(e,t){return this.rest.makeRequest("delete",a.Guild(e).Member(t),!0).then(()=>this.client.actions.GuildMemberRemove.handle({guild_id:e.id,user:t.user}).member)}createGuildRole(e,t){return t.color&&(t.color=this.client.resolver.resolveColor(t.color)),t.permissions&&(t.permissions=r.resolve(t.permissions)),this.rest.makeRequest("post",a.Guild(e).roles,!0,t).then(t=>this.client.actions.GuildRoleCreate.handle({guild_id:e.id,role:t}).role)}deleteGuildRole(e){return this.rest.makeRequest("delete",a.Guild(e.guild).Role(e.id),!0).then(()=>this.client.actions.GuildRoleDelete.handle({guild_id:e.guild.id,role_id:e.id}).role)}setChannelOverwrite(e,t){return this.rest.makeRequest("put",`${a.Channel(e).permissions}/${t.id}`,!0,t)}deletePermissionOverwrites(e){return this.rest.makeRequest("delete",`${a.Channel(e.channel).permissions}/${e.id}`,!0).then(()=>e)}getChannelMessages(e,t={}){const n=[];t.limit&&n.push(`limit=${t.limit}`),t.around?n.push(`around=${t.around}`):t.before?n.push(`before=${t.before}`):t.after&&n.push(`after=${t.after}`);let i=a.Channel(e).messages;return n.length>0&&(i+=`?${n.join("&")}`),this.rest.makeRequest("get",i,!0)}getChannelMessage(e,t){const n=e.messages.get(t);return n?Promise.resolve(n):this.rest.makeRequest("get",a.Channel(e).Message(t),!0)}putGuildMember(e,t,n){if(n.access_token=n.accessToken,n.roles){const e=n.roles;(e instanceof c||e instanceof Array&&e[0]instanceof f)&&(n.roles=e.map(e=>e.id))}return this.rest.makeRequest("put",a.Guild(e).Member(t.id),!0,n).then(t=>this.client.actions.GuildMemberGet.handle(e,t).member)}getGuildMember(e,t,n){return this.rest.makeRequest("get",a.Guild(e).Member(t.id),!0).then(t=>n?this.client.actions.GuildMemberGet.handle(e,t).member:new p(e,t))}updateGuildMember(e,t){t.channel&&(t.channel_id=this.client.resolver.resolveChannel(t.channel).id),t.roles&&(t.roles=t.roles.map(e=>e instanceof f?e.id:e));let n=a.Member(e);if(e.id===this.client.user.id){const i=Object.keys(t);1===i.length&&"nick"===i[0]&&(n=a.Member(e).nickname)}return this.rest.makeRequest("patch",n,!0,t).then(t=>e.guild._updateMember(e,t).mem)}addMemberRole(e,t){return new Promise((n,i)=>{if(e._roles.includes(t.id))return n(e);const s=(e,i)=>{!e._roles.includes(t.id)&&i._roles.includes(t.id)&&(this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),n(i))};this.client.on(o.Events.GUILD_MEMBER_UPDATE,s);const r=this.client.setTimeout(()=>this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),1e4);return this.rest.makeRequest("put",a.Member(e).Role(t.id),!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,s);this.client.clearTimeout(r);i(e)})})}removeMemberRole(e,t){return new Promise((n,i)=>{if(!e._roles.includes(t.id))return n(e);const s=(e,i)=>{e._roles.includes(t.id)&&!i._roles.includes(t.id)&&(this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),n(i))};this.client.on(o.Events.GUILD_MEMBER_UPDATE,s);const r=this.client.setTimeout(()=>this.client.removeListener(o.Events.GUILD_MEMBER_UPDATE,s),1e4);return this.rest.makeRequest("delete",a.Member(e).Role(t.id),!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,s);this.client.clearTimeout(r);i(e)})})}sendTyping(e){return this.rest.makeRequest("post",a.Channel(e).typing,!0)}banGuildMember(e,t,n=0){const i=this.client.resolver.resolveUserID(t);return i?this.rest.makeRequest("put",`${a.Guild(e).bans}/${i}?delete-message-days=${n}`,!0,{"delete-message-days":n}).then(()=>{if(t instanceof p)return t;const n=this.client.resolver.resolveUser(i);if(n)return(t=this.client.resolver.resolveGuildMember(e,n))||n;return i}):Promise.reject(new Error("Couldn't resolve the user ID to ban."))}unbanGuildMember(e,t){return new Promise((n,i)=>{const s=this.client.resolver.resolveUserID(t);if(!s)throw new Error("Couldn't resolve the user ID to unban.");const r=(t,i)=>{t.id===e.id&&i.id===s&&(this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r),this.client.clearTimeout(c),n(i))};this.client.on(o.Events.GUILD_BAN_REMOVE,r);const c=this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r);i(new Error("Took too long to receive the ban remove event."))},1e4);this.rest.makeRequest("delete",`${a.Guild(e).bans}/${s}`,!0).catch(e=>{this.client.removeListener(o.Events.GUILD_BAN_REMOVE,r);this.client.clearTimeout(c);i(e)})})}getGuildBans(e){return this.rest.makeRequest("get",a.Guild(e).bans,!0).then(e=>{const t=new c;for(const n of e){const e=this.client.dataManager.newUser(n.user);t.set(e.id,e)}return t})}updateGuildRole(e,t){const n={};return n.name=t.name||e.name,n.position=void 0!==t.position?t.position:e.position,n.color=this.client.resolver.resolveColor(t.color||e.color),n.hoist=void 0!==t.hoist?t.hoist:e.hoist,n.mentionable=void 0!==t.mentionable?t.mentionable:e.mentionable,t.permissions?n.permissions=r.resolve(t.permissions):n.permissions=e.permissions,this.rest.makeRequest("patch",a.Guild(e.guild).Role(e.id),!0,n).then(t=>this.client.actions.GuildRoleUpdate.handle({role:t,guild_id:e.guild.id}).updated)}pinMessage(e){return this.rest.makeRequest("put",a.Channel(e.channel).Pin(e.id),!0).then(()=>e)}unpinMessage(e){return this.rest.makeRequest("delete",a.Channel(e.channel).Pin(e.id),!0).then(()=>e)}getChannelPinnedMessages(e){return this.rest.makeRequest("get",a.Channel(e).pins,!0)}createChannelInvite(e,t){const n={};return n.temporary=t.temporary,n.max_age=t.maxAge,n.max_uses=t.maxUses,this.rest.makeRequest("post",a.Channel(e).invites,!0,n).then(e=>new m(this.client,e))}deleteInvite(e){return this.rest.makeRequest("delete",a.Invite(e.code),!0).then(()=>e)}getInvite(e){return this.rest.makeRequest("get",a.Invite(e),!0).then(e=>new m(this.client,e))}getGuildInvites(e){return this.rest.makeRequest("get",a.Guild(e).invites,!0).then(e=>{const t=new c;for(const n of e){const e=new m(this.client,n);t.set(e.code,e)}return t})}pruneGuildMembers(e,t,n){return this.rest.makeRequest(n?"get":"post",`${a.Guild(e).prune}?days=${t}`,!0).then(e=>e.pruned)}createEmoji(e,t,n,i){const s={image:t,name:n};return i&&(s.roles=i.map(e=>e.id?e.id:e)),this.rest.makeRequest("post",a.Guild(e).emojis,!0,s).then(t=>this.client.actions.GuildEmojiCreate.handle(e,t).emoji)}updateEmoji(e,t){const n={};return t.name&&(n.name=t.name),t.roles&&(n.roles=t.roles.map(e=>e.id?e.id:e)),this.rest.makeRequest("patch",a.Guild(e.guild).Emoji(e.id),!0,n).then(t=>this.client.actions.GuildEmojiUpdate.handle(e,t).emoji)}deleteEmoji(e){return this.rest.makeRequest("delete",a.Guild(e.guild).Emoji(e.id),!0).then(()=>this.client.actions.GuildEmojiDelete.handle(e).data)}getWebhook(e,t){return this.rest.makeRequest("get",a.Webhook(e,t),!t).then(e=>new g(this.client,e))}getGuildWebhooks(e){return this.rest.makeRequest("get",a.Guild(e).webhooks,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new g(this.client,n));return t})}getChannelWebhooks(e){return this.rest.makeRequest("get",a.Channel(e).webhooks,!0).then(e=>{const t=new c;for(const n of e)t.set(n.id,new g(this.client,n));return t})}createWebhook(e,t,n){return this.rest.makeRequest("post",a.Channel(e).webhooks,!0,{name:t,avatar:n}).then(e=>new g(this.client,e))}editWebhook(e,t,n){return this.rest.makeRequest("patch",a.Webhook(e.id,e.token),!1,{name:t,avatar:n}).then(t=>{e.name=t.name;e.avatar=t.avatar;return e})}deleteWebhook(e){return this.rest.makeRequest("delete",a.Webhook(e.id,e.token),!1)}sendWebhookMessage(e,t,{avatarURL:avatarURL,tts:tts,disableEveryone:disableEveryone,embeds:embeds,username:username}={},n=null){return username=username||e.name,void 0!==t&&(t=this.client.resolver.resolveString(t)),t&&(disableEveryone||void 0===disableEveryone&&this.client.options.disableEveryone)&&(t=t.replace(/@(everyone|here)/g,"@$1")),this.rest.makeRequest("post",`${a.Webhook(e.id,e.token)}?wait=true`,!1,{username:username,avatar_url:avatarURL,content:t,tts:tts,embeds:embeds},n)}sendSlackWebhookMessage(e,t){return this.rest.makeRequest("post",`${a.Webhook(e.id,e.token)}/slack?wait=true`,!1,t)}fetchUserProfile(e){return this.rest.makeRequest("get",a.User(e).profile,!0).then(t=>new v(e,t))}fetchMeMentions(e){return e.guild&&(e.guild=e.guild.id?e.guild.id:e.guild),this.rest.makeRequest("get",a.User("@me").mentions(e.limit,e.roles,e.everyone,e.guild)).then(e=>e.body.map(e=>new d(this.client.channels.get(e.channel_id),e,this.client)))}addFriend(e){return this.rest.makeRequest("post",a.User("@me"),!0,{username:e.username,discriminator:e.discriminator}).then(()=>e)}removeFriend(e){return this.rest.makeRequest("delete",a.User("@me").Relationship(e.id),!0).then(()=>e)}blockUser(e){return this.rest.makeRequest("put",a.User("@me").Relationship(e.id),!0,{type:2}).then(()=>e)}unblockUser(e){return this.rest.makeRequest("delete",a.User("@me").Relationship(e.id),!0).then(()=>e)}updateChannelPositions(e,t){const n=new Array(t.length);for(let e=0;ethis.client.actions.GuildChannelsPositionUpdate.handle({guild_id:e,channels:t}).guild)}setRolePositions(e,t){return this.rest.makeRequest("patch",a.Guild(e).roles,!0,t).then(()=>this.client.actions.GuildRolesPositionUpdate.handle({guild_id:e,roles:t}).guild)}setChannelPositions(e,t){return this.rest.makeRequest("patch",a.Guild(e).channels,!0,t).then(()=>this.client.actions.GuildChannelsPositionUpdate.handle({guild_id:e,channels:t}).guild)}addMessageReaction(e,t){return this.rest.makeRequest("put",a.Message(e).Reaction(t).User("@me"),!0).then(()=>e._addReaction(l.parseEmoji(t),e.client.user))}removeMessageReaction(e,t,n){const i=a.Message(e).Reaction(t).User(n===this.client.user.id?"@me":n);return this.rest.makeRequest("delete",i,!0).then(()=>this.client.actions.MessageReactionRemove.handle({user_id:n,message_id:e.id,emoji:l.parseEmoji(t),channel_id:e.channel.id}).reaction)}removeMessageReactions(e){return this.rest.makeRequest("delete",a.Message(e).reactions,!0).then(()=>e)}getMessageReactionUsers(e,t,n=100){return this.rest.makeRequest("get",a.Message(e).Reaction(t,n),!0)}getApplication(e){return this.rest.makeRequest("get",a.OAUTH2.Application(e),!0).then(e=>new b(this.client,e))}resetApplication(e){return this.rest.makeRequest("post",a.OAUTH2.Application(e).reset,!0).then(e=>new b(this.client,e))}setNote(e,t){return this.rest.makeRequest("put",a.User(e).note,!0,{note:t}).then(()=>e)}acceptInvite(e){return e.id&&(e=e.id),new Promise((t,n)=>this.rest.makeRequest("post",a.Invite(e),!0).then(e=>{const i=n=>{n.id===e.id&&(t(n),this.client.removeListener(o.Events.GUILD_CREATE,i))};this.client.on(o.Events.GUILD_CREATE,i);this.client.setTimeout(()=>{this.client.removeListener(o.Events.GUILD_CREATE,i);n(new Error("Accepting invite timed out"))},12e4)}))}patchUserSettings(e){return this.rest.makeRequest("patch",o.Endpoints.User("@me").settings,!0,e)}}e.exports=x},function(e,t,n){const i=n(64);class s extends i{constructor(e,t){super(e,t),this.client=e.client,this.limit=1/0,this.resetTime=null,this.remaining=1,this.timeDifference=0,this.resetTimeout=null}push(e){super.push(e),this.handle()}execute(e){e&&e.request.gen().end((t,n)=>{n&&n.headers&&(this.limit=Number(n.headers["x-ratelimit-limit"]),this.resetTime=1e3*Number(n.headers["x-ratelimit-reset"]),this.remaining=Number(n.headers["x-ratelimit-remaining"]),this.timeDifference=Date.now()-new Date(n.headers.date).getTime());if(t)if(429===t.status){if(this.queue.unshift(e),n.headers["x-ratelimit-global"]&&(this.globalLimit=!0),this.resetTimeout)return;this.resetTimeout=this.client.setTimeout(()=>{this.remaining=this.limit;this.globalLimit=!1;this.handle();this.resetTimeout=null},Number(n.headers["retry-after"])+this.client.options.restTimeOffset)}else e.reject(t),this.handle();else{this.globalLimit=!1;const t=n&&n.body?n.body:{};e.resolve(t),this.handle()}})}handle(){super.handle(),this.remaining<=0||0===this.queue.length||this.globalLimit||(this.execute(this.queue.shift()),this.remaining--,this.handle())}}e.exports=s},function(e,t,n){const i=n(64);class s extends i{constructor(e,t){super(e,t),this.endpoint=t,this.timeDifference=0,this.busy=!1}push(e){super.push(e),this.handle()}execute(e){return this.busy=!0,new Promise(t=>{e.request.gen().end((n,i)=>{i&&i.headers&&(this.requestLimit=Number(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());if(n)429===n.status?(this.queue.unshift(e),this.restManager.client.setTimeout(()=>{this.globalLimit=!1;t()},Number(i.headers["retry-after"])+this.restManager.client.options.restTimeOffset),i.headers["x-ratelimit-global"]&&(this.globalLimit=!0)):(e.reject(n),t(n));else{this.globalLimit=!1;const n=i&&i.body?i.body:{};e.resolve(n),0===this.requestRemaining?this.restManager.client.setTimeout(()=>t(n),this.requestResetTime-Date.now()+this.timeDifference+this.restManager.client.options.restTimeOffset):t(n)}})})}handle(){super.handle(),this.busy||0===this.remaining||0===this.queue.length||this.globalLimit||this.execute(this.queue.shift()).then(()=>{this.busy=!1;this.handle()})}}e.exports=s},function(e,t,n){(function(t){const i=n(0);class s{constructor(){this.build(this.constructor.DEFAULT)}set({url:url,version:version}={}){this.build({url:url||this.constructor.DFEAULT.url,version:version||this.constructor.DEFAULT.version})}build(e){this.userAgent=`DiscordBot (${e.url}, ${e.version}) Node.js/${t.version}`}}s.DEFAULT={url:i.Package.homepage.split("#")[0],version:i.Package.version},e.exports=s}).call(t,n(6))},function(e,t,n){const i=n(12).EventEmitter,s=n(0),r=n(138),o=n(65);class a extends i{constructor(e){super(),this.client=e,this.packetManager=new r(this),this.status=s.Status.IDLE,this.sessionID=null,this.sequence=-1,this.gateway=null,this.normalReady=!1,this.ws=null,this.disabledEvents={};for(const t of e.options.disabledEvents)this.disabledEvents[t]=!0;this.first=!0,this.lastHeartbeatAck=!0,this._trace=[],this.resumeStart=-1}_connect(e){this.client.emit("debug",`Connecting to gateway ${e}`),this.normalReady=!1,this.status!==s.Status.RECONNECTING&&(this.status=s.Status.CONNECTING),this.ws=new o(e),this.ws.on("open",this.eventOpen.bind(this)),this.ws.on("packet",this.eventPacket.bind(this)),this.ws.on("close",this.eventClose.bind(this)),this.ws.on("error",this.eventError.bind(this)),this._queue=[],this._remaining=120,this.client.setInterval(()=>{this._remaining=120;this._remainingReset=Date.now()},6e4)}connect(e=this.gateway){this.gateway=e,this.first?(this._connect(e),this.first=!1):this.client.setTimeout(()=>this._connect(e),5500)}heartbeat(e){if(e&&!this.lastHeartbeatAck)return void this.tryReconnect();this.client.emit("debug","Sending heartbeat"),this.client._pingTimestamp=Date.now(),this.client.ws.send({op:s.OPCodes.HEARTBEAT,d:this.sequence},!0),this.lastHeartbeatAck=!1}send(e,t=!1){if(t)return void this._send(e);this._queue.push(e),this.doQueue()}destroy(){this.ws&&this.ws.close(1e3),this._queue=[],this.status=s.Status.IDLE}_send(e){this.ws.readyState===o.WebSocket.OPEN&&(this.emit("send",e),this.ws.send(e))}doQueue(){const e=this._queue[0];if(this.ws.readyState===o.WebSocket.OPEN&&e){if(0===this.remaining)return void this.client.setTimeout(this.doQueue.bind(this),Date.now()-this.remainingReset);this._remaining--,this._send(e),this._queue.shift(),this.doQueue()}}eventOpen(){this.client.emit("debug","Connection to gateway opened"),this.lastHeartbeatAck=!0,this.sessionID?this._sendResume():this._sendNewIdentify()}_sendResume(){if(!this.sessionID)return void this._sendNewIdentify();this.client.emit("debug","Identifying as resumed session"),this.resumeStart=this.sequence;const e={token:this.client.token,session_id:this.sessionID,seq:this.sequence};this.send({op:s.OPCodes.RESUME,d:e})}_sendNewIdentify(){this.reconnecting=!1;const e=this.client.options.ws;e.token=this.client.token,this.client.options.shardCount>0&&(e.shard=[Number(this.client.options.shardId),Number(this.client.options.shardCount)]),this.client.emit("debug","Identifying as new session"),this.send({op:s.OPCodes.IDENTIFY,d:e}),this.sequence=-1}eventClose(e){this.emit("close",e),this.client.clearInterval(this.client.manager.heartbeatInterval),this.status=s.Status.DISCONNECTED,this._queue=[],this.reconnecting||this.client.emit(s.Events.DISCONNECT,e),[4004,4010,4011].includes(e.code)||this.reconnecting||1e3===e.code||this.tryReconnect()}eventPacket(e){return null===e?(this.eventError(new Error(s.Errors.BAD_WS_MESSAGE)),!1):(this.client.emit("raw",e),e.op===s.OPCodes.HELLO&&this.client.manager.setupKeepAlive(e.d.heartbeat_interval),this.packetManager.handle(e))}eventError(e){this.client.listenerCount("error")>0&&this.client.emit("error",e),this.tryReconnect()}_emitReady(e=!0){this.status=s.Status.READY,this.client.emit(s.Events.READY),this.packetManager.handleQueue(),this.normalReady=e}checkIfReady(){if(this.status!==s.Status.READY&&this.status!==s.Status.NEARLY){let e=0;for(const t of this.client.guilds.keys())e+=this.client.guilds.get(t).available?0:1;if(0===e){if(this.status=s.Status.NEARLY,this.client.options.fetchAllMembers){const e=this.client.guilds.map(e=>e.fetchMembers());return void Promise.all(e).then(()=>this._emitReady(),e=>{this.client.emit(s.Events.WARN,"Error in pre-ready guild member fetching");this.client.emit(s.Events.ERROR,e);this._emitReady()})}this._emitReady()}}}tryReconnect(){this.status!==s.Status.RECONNECTING&&this.status!==s.Status.CONNECTING&&this.client.token&&(this.status=s.Status.RECONNECTING,this.ws.close(),this.packetManager.handleQueue(),this.client.emit(s.Events.RECONNECTING),this.connect(this.client.ws.gateway))}}e.exports=a},function(e,t,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(e){this.ws=e,this.handlers={},this.queue=[],this.register(i.WSEvents.READY,n(165)),this.register(i.WSEvents.RESUMED,n(168)),this.register(i.WSEvents.GUILD_CREATE,n(145)),this.register(i.WSEvents.GUILD_DELETE,n(146)),this.register(i.WSEvents.GUILD_UPDATE,n(156)),this.register(i.WSEvents.GUILD_BAN_ADD,n(143)),this.register(i.WSEvents.GUILD_BAN_REMOVE,n(144)),this.register(i.WSEvents.GUILD_MEMBER_ADD,n(148)),this.register(i.WSEvents.GUILD_MEMBER_REMOVE,n(149)),this.register(i.WSEvents.GUILD_MEMBER_UPDATE,n(150)),this.register(i.WSEvents.GUILD_ROLE_CREATE,n(152)),this.register(i.WSEvents.GUILD_ROLE_DELETE,n(153)),this.register(i.WSEvents.GUILD_ROLE_UPDATE,n(154)),this.register(i.WSEvents.GUILD_EMOJIS_UPDATE,n(147)),this.register(i.WSEvents.GUILD_MEMBERS_CHUNK,n(151)),this.register(i.WSEvents.CHANNEL_CREATE,n(139)),this.register(i.WSEvents.CHANNEL_DELETE,n(140)),this.register(i.WSEvents.CHANNEL_UPDATE,n(142)),this.register(i.WSEvents.CHANNEL_PINS_UPDATE,n(141)),this.register(i.WSEvents.PRESENCE_UPDATE,n(164)),this.register(i.WSEvents.USER_UPDATE,n(172)),this.register(i.WSEvents.USER_NOTE_UPDATE,n(170)),this.register(i.WSEvents.USER_SETTINGS_UPDATE,n(171)),this.register(i.WSEvents.VOICE_STATE_UPDATE,n(174)),this.register(i.WSEvents.TYPING_START,n(169)),this.register(i.WSEvents.MESSAGE_CREATE,n(157)),this.register(i.WSEvents.MESSAGE_DELETE,n(158)),this.register(i.WSEvents.MESSAGE_UPDATE,n(163)),this.register(i.WSEvents.MESSAGE_DELETE_BULK,n(159)),this.register(i.WSEvents.VOICE_SERVER_UPDATE,n(173)),this.register(i.WSEvents.GUILD_SYNC,n(155)),this.register(i.WSEvents.RELATIONSHIP_ADD,n(166)),this.register(i.WSEvents.RELATIONSHIP_REMOVE,n(167)),this.register(i.WSEvents.MESSAGE_REACTION_ADD,n(160)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE,n(161)),this.register(i.WSEvents.MESSAGE_REACTION_REMOVE_ALL,n(162))}get client(){return this.ws.client}register(e,t){this.handlers[e]=new t(this)}handleQueue(){this.queue.forEach((e,t)=>{this.handle(this.queue[t]);this.queue.splice(t,1)})}setSequence(e){e&&e>this.ws.sequence&&(this.ws.sequence=e)}handle(e){return e.op===i.OPCodes.RECONNECT?(this.setSequence(e.s),this.ws.tryReconnect(),!1):e.op===i.OPCodes.INVALID_SESSION?(this.client.emit("debug",`SESSION INVALID! Waiting to reconnect: ${e.d}`),e.d?setTimeout(()=>{this.ws._sendResume()},2500):(this.ws.sessionID=null,this.ws._sendNewIdentify()),!1):(e.op===i.OPCodes.HEARTBEAT_ACK?(this.ws.client._pong(this.ws.client._pingTimestamp),this.ws.lastHeartbeatAck=!0,this.ws.client.emit("debug","Heartbeat acknowledged")):e.op===i.OPCodes.HEARTBEAT&&(this.client.ws.send({op:i.OPCodes.HEARTBEAT,d:this.client.ws.sequence}),this.ws.client.emit("debug","Received gateway heartbeat")),this.ws.status===i.Status.RECONNECTING&&(this.ws.reconnecting=!1,this.ws.checkIfReady()),this.setSequence(e.s),void 0===this.ws.disabledEvents[e.t]&&(this.ws.status!==i.Status.READY&&-1===s.indexOf(e.t)?(this.queue.push(e),!1):!!this.handlers[e.t]&&this.handlers[e.t].handle(e)))}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.ChannelCreate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.ChannelDelete.handle(n);i.channel&&t.emit(s.Events.CHANNEL_DELETE,i.channel)}}e.exports=r},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.channels.get(n.channel_id),r=new Date(n.last_pin_timestamp);i&&r&&t.emit(s.Events.CHANNEL_PINS_UPDATE,i,r)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.ChannelUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id),r=t.users.get(n.user.id);i&&r&&t.emit(s.Events.GUILD_BAN_ADD,i,r)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildBanRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.id);i?i.available||n.unavailable||(i.setup(n),this.packetManager.ws.checkIfReady()):t.dataManager.newGuild(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.GuildDelete.handle(n);i.guild&&t.emit(s.Events.GUILD_DELETE,i.guild)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildEmojisUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);i&&(i.memberCount++,i._addMember(n))}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildMemberRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=i.members.get(n.user.id);e&&i._updateMember(e,n)}}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=n.members.map(e=>i._addMember(e,!1));t.emit(s.Events.GUILD_MEMBERS_CHUNK,e,i),t.ws.lastHeartbeatAck=!0}}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleCreate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleDelete.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildRoleUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildSync.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.GuildUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.MessageCreate.handle(n);i.message&&t.emit(s.Events.MESSAGE_CREATE,i.message)}}e.exports=r},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.actions.MessageDelete.handle(n);i.message&&t.emit(s.Events.MESSAGE_DELETE,i.message)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageDeleteBulk.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionAdd.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionRemove.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageReactionRemoveAll.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.MessageUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(e){const t=this.packetManager.client,n=e.d;let i=t.users.get(n.user.id);const o=t.guilds.get(n.guild_id);if(!i){if(!n.user.username)return;i=t.dataManager.newUser(n.user)}const a=r.cloneObject(i);if(i.patch(n.user),i.equals(a)||t.emit(s.Events.USER_UPDATE,a,i),o){let e=o.members.get(i.id);if(e||"offline"===n.status||(e=o._addMember({user:i,roles:n.roles,deaf:!1,mute:!1},!1),t.emit(s.Events.GUILD_MEMBER_AVAILABLE,e)),e){if(0===t.listenerCount(s.Events.PRESENCE_UPDATE))return void o._setPresence(i.id,n);const a=r.cloneObject(e);e.presence&&(a.frozenPresence=r.cloneObject(e.presence)),o._setPresence(i.id,n),t.emit(s.Events.PRESENCE_UPDATE,a,e)}else o._setPresence(i.id,n)}}}e.exports=o},function(e,t,n){const i=n(1),s=n(39);class r extends i{handle(e){const t=this.packetManager.client,n=e.d;t.ws.heartbeat(),n.user.user_settings=n.user_settings;const i=new s(t,n.user);t.user=i,t.readyAt=new Date,t.users.set(i.id,i);for(const e of n.guilds)t.dataManager.newGuild(e);for(const e of n.private_channels)t.dataManager.newChannel(e);for(const e of n.relationships){const n=t.dataManager.newUser(e.user);1===e.type?t.user.friends.set(n.id,n):2===e.type&&t.user.blocked.set(n.id,n)}n.presences=n.presences||[];for(const e of n.presences)t.dataManager.newUser(e.user),t._setPresence(e.user.id,e);if(n.notes)for(const e in n.notes){let i=n.notes[e];i.length||(i=null),t.user.notes.set(e,i)}!t.user.bot&&t.options.sync&&t.setInterval(t.syncGuilds.bind(t),3e4),t.once("ready",t.syncGuilds.bind(t)),t.users.has("1")||t.dataManager.newUser({id:"1",username:"Clyde",discriminator:"0000",avatar:"https://discordapp.com/assets/f78426a064bc9dd24847519259bc42af.png",bot:!0,status:"online",game:null,verified:!0}),t.setTimeout(()=>{t.ws.normalReady||t.ws._emitReady(!1)},1200*n.guilds.length);const r=this.packetManager.ws;r.sessionID=n.session_id,r._trace=n._trace,t.emit("debug",`READY ${r._trace.join(" -> ")} ${r.sessionID}`),r.checkIfReady()}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;1===n.type?t.fetchUser(n.id).then(e=>{t.user.friends.set(e.id,e)}):2===n.type&&t.fetchUser(n.id).then(e=>{t.user.blocked.set(e.id,e)})}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;2===n.type?t.user.blocked.has(n.id)&&t.user.blocked.delete(n.id):1===n.type&&t.user.friends.has(n.id)&&t.user.friends.delete(n.id)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=t.ws;n._trace=e.d._trace;const i=n.sequence-n.resumeStart;n.resumeStart=-1,t.emit("debug",`RESUMED ${n._trace.join(" -> ")} | replayed ${i} events. `),t.emit("resume",i),n.heartbeat()}}e.exports=s},function(e,t,n){function i(e,t){return e.client.setTimeout(()=>{e.client.emit(r.Events.TYPING_STOP,e,t,e._typing.get(t.id));e._typing.delete(t.id)},6e3)}const s=n(1),r=n(0);class o extends s{handle(e){const t=this.packetManager.client,n=e.d,s=t.channels.get(n.channel_id),o=t.users.get(n.user_id),c=new Date(1e3*n.timestamp);if(s&&o){if("voice"===s.type)return void t.emit(r.Events.WARN,`Discord sent a typing packet to voice channel ${s.id}`);if(s._typing.has(o.id)){const e=s._typing.get(o.id);e.lastTimestamp=c,e.resetTimeout(i(s,o))}else s._typing.set(o.id,new a(t,c,c,i(s,o))),t.emit(r.Events.TYPING_START,s,o)}}}class a{constructor(e,t,n,i){this.client=e,this.since=t,this.lastTimestamp=n,this._timeout=i}resetTimeout(e){this.client.clearTimeout(this._timeout),this._timeout=e}get elapsedTime(){return Date.now()-this.since}}e.exports=o},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.UserNoteUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0);class r extends i{handle(e){const t=this.packetManager.client;t.user.settings.patch(e.d),t.emit(s.Events.USER_SETTINGS_UPDATE,t.user.settings)}}e.exports=r},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.actions.UserUpdate.handle(n)}}e.exports=s},function(e,t,n){const i=n(1);class s extends i{handle(e){const t=this.packetManager.client,n=e.d;t.emit("self.voiceServer",n)}}e.exports=s},function(e,t,n){const i=n(1),s=n(0),r=n(4);class o extends i{handle(e){const t=this.packetManager.client,n=e.d,i=t.guilds.get(n.guild_id);if(i){const e=i.members.get(n.user_id);if(e){const i=r.cloneObject(e);e.voiceChannel&&e.voiceChannel.id!==n.channel_id&&e.voiceChannel.members.delete(i.id),n.channel_id||(e.speaking=null),e.user.id===t.user.id&&n.channel_id&&t.emit("self.voiceStateUpdate",n);const o=t.channels.get(n.channel_id);o&&o.members.set(e.user.id,e),e.serverMute=n.mute,e.serverDeaf=n.deaf,e.selfMute=n.self_mute,e.selfDeaf=n.self_deaf,e.voiceSessionID=n.session_id,e.voiceChannelID=n.channel_id,t.emit(s.Events.VOICE_STATE_UPDATE,i,e)}}}}e.exports=o},function(e,t,n){const i=n(4);e.exports={Client:n(67),Shard:n(70),ShardClientUtil:n(71),ShardingManager:n(72),WebhookClient:n(68),Collection:n(3),Constants:n(0),EvaluatedPermissions:n(8),Permissions:n(8),Snowflake:n(7),SnowflakeUtil:n(7),Util:i,util:i,version:n(38).version,escapeMarkdown:i.escapeMarkdown,fetchRecommendedShards:i.fetchRecommendedShards,splitMessage:i.splitMessage,Channel:n(14),ClientUser:n(39),ClientUserSettings:n(40),DMChannel:n(41),Emoji:n(17),Game:n(11).Game,GroupDMChannel:n(28),Guild:n(24),GuildChannel:n(25),GuildMember:n(18),Invite:n(42),Message:n(19),MessageAttachment:n(43),MessageCollector:n(44),MessageEmbed:n(45),MessageMentions:n(46),MessageReaction:n(47),OAuth2Application:n(48),PartialGuild:n(49),PartialGuildChannel:n(50),PermissionOverwrites:n(51),Presence:n(11).Presence,ReactionEmoji:n(29),RichEmbed:n(69),Role:n(15),TextChannel:n(52),User:n(16),VoiceChannel:n(53),Webhook:n(30)},"browser"===n(23).platform()&&(window.Discord=e.exports)},function(e,t,n){const i=n(66),s=n(3);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.message=e,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(e){return e.message.id!==this.message.id?null:{key:e.emoji.id||e.emoji.name,value:e}}postCheck(e,t){return this.users.set(t.id,t),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}e.exports=r},function(e,t){class n{constructor(e,t){this.user=e,this.setup(t)}setup(e){this.type=e.type,this.name=e.name,this.id=e.id,this.revoked=e.revoked,this.integrations=e.integrations}}e.exports=n},function(e,t,n){const i=n(3),s=n(177);class r{constructor(e,t){this.user=e,Object.defineProperty(this,"client",{value:e.client}),this.mutualGuilds=new i,this.connections=new i,this.setup(t)}setup(e){this.premium=e.premium,this.premiumSince=e.premium_since?new Date(e.premium_since):null;for(const t of e.mutual_guilds)this.client.guilds.has(t.id)&&this.mutualGuilds.set(t.id,this.client.guilds.get(t.id));for(const t of e.connected_accounts)this.connections.set(t.id,new s(this.user,t))}}e.exports=r},function(e,t){class n{constructor(e){this.id=e.id,this.name=e.name,this.vip=e.vip,this.deprecated=e.deprecated,this.optimal=e.optimal,this.custom=e.custom,this.sampleHostname=e.sample_hostname}}e.exports=n},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){}]);
\ No newline at end of file