!function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=6)}([function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(r,e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(4),r),o(e(22),r),o(e(23),r),o(e(5),r)},function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(r,e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r)},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";(function(t){Object.defineProperty(r,"__esModule",{value:!0}),r.publicKey=r.apiPublicURI=r.uiPublicURI=void 0;const e=t,n=t=>{var r;return null!==(r=e[t])&&void 0!==r?r:""},o=t=>t.replace(/\/$/,"");r.uiPublicURI=o(n("UI_PUBLIC_URI")),r.apiPublicURI=o(n("API_PUBLIC_URI")),r.publicKey=o(n("DISCORD_PUBLIC_KEY"))}).call(this,e(2))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getQuery=r.userAgent=r.respond=void 0;r.respond=(t,r={})=>new Response(JSON.stringify(t),{...r,headers:{...r.headers||{},"content-type":"application/json"}}),r.userAgent="DiscordBot (https://github.com/roleypoly/roleypoly, git-main) (+https://roleypoly.com)";r.getQuery=t=>{const r={};for(let[e,n]of new URL(t.url).searchParams.entries())r[e]=n;return r}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Router=void 0;r.Router=class{constructor(){this.routingTree={},this.fallbacks={root:this.respondToRoot,404:this.notFound,500:this.serverError},this.corsOrigins=[]}addCORSOrigins(t){this.corsOrigins=[...this.corsOrigins,...t]}addFallback(t,r){this.fallbacks[t]=r}add(t,r,e){const n=t.toLowerCase();this.routingTree[n]||(this.routingTree[n]={}),this.routingTree[n][r]=e}async handle(t){const r=await this.processRequest(t);return this.injectCORSHeaders(t,r.headers),r}async processRequest(t){var r;const e=new URL(t.url);if("/"===e.pathname||""===e.pathname)return this.fallbacks.root(t);const n=t.method.toLowerCase(),o=e.pathname.split("/")[1],i=null===(r=this.routingTree[n])||void 0===r?void 0:r[o];if(i)try{return await i(t)}catch(r){return console.error(r),this.fallbacks[500](t)}return"options"===n?new Response(null,{}):this.fallbacks[404](t)}respondToRoot(){return new Response("Hi there!")}notFound(){return new Response(JSON.stringify({error:"not_found"}),{status:404})}serverError(){return new Response(JSON.stringify({error:"internal_server_error"}),{status:500})}injectCORSHeaders(t,r){if(r.set("access-control-allow-methods","*"),r.set("access-control-allow-headers","*"),0===this.corsOrigins.length)return void r.set("access-control-allow-origin","*");const e=t.headers.get("origin");if(!e)return;const n=new URL(e).hostname;this.corsOrigins.includes(n)&&r.set("access-control-allow-origin",n)}}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e(7),o=e(0),i=e(5),s=e(24),a=e(3),u=new i.Router;u.add("GET","_healthz",s.healthz),u.add("POST","interaction",n.interactionHandler),u.addFallback("root",()=>o.respond({__warning:"🦊",this:"is",a:"fox-based",web:"application",please:"be",mindful:"of",your:"surroundings",warning__:"🦊",meta:a.uiPublicURI})),addEventListener("fetch",t=>{t.respondWith(u.handle(t.request))})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.interactionHandler=void 0;const n=e(8),o=e(15),i=e(1),s=e(0),a={"hello-world":n.helloWorld};r.interactionHandler=async t=>{if(!await o.verifyRequest(t))return new Response("invalid request signature",{status:401});const r=await t.json();if(r.type===i.InteractionType.PING)return s.respond({type:1});if(r.type!==i.InteractionType.APPLICATION_COMMAND)return s.respond({err:"not implemented"},{status:400});if(!r.data)return s.respond({err:"data missing"},{status:400});const e=a[r.data.name];if(!e)return s.respond({err:"not implemented"},{status:400});try{const t=await e(r);return s.respond(t)}catch(t){return s.respond({err:"command errored"},{status:500})}}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.helloWorld=void 0;const n=e(1);r.helloWorld=async t=>{var r,e;return{type:n.InteractionCallbackType.CHANNEL_MESSAGE_WITH_SOURCE,data:{content:"Hey there, "+((null===(r=t.member)||void 0===r?void 0:r.nick)||(null===(e=t.user)||void 0===e?void 0:e.username))}}}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CategoryType=void 0,function(t){t[t.Multi=0]="Multi",t[t.Single=1]="Single"}(r.CategoryType||(r.CategoryType={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.WebhookValidationStatus=r.UserGuildPermissions=r.Features=void 0,function(t){t[t.None=0]="None",t[t.Preview=0]="Preview",t[t.LegacyGuild=2]="LegacyGuild",t[t.AccessControl=4]="AccessControl",t[t.AuditLogging=8]="AuditLogging"}(r.Features||(r.Features={})),function(t){t[t.User=0]="User",t[t.Manager=2]="Manager",t[t.Admin=4]="Admin"}(r.UserGuildPermissions||(r.UserGuildPermissions={})),function(t){t[t.Ok=0]="Ok",t[t.NoneSet=1]="NoneSet",t[t.DoesNotExist=2]="DoesNotExist",t[t.NotSameGuild=3]="NotSameGuild",t[t.NotDiscordURL=4]="NotDiscordURL"}(r.WebhookValidationStatus||(r.WebhookValidationStatus={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.InteractionCallbackType=r.InteractionType=void 0,function(t){t[t.PING=1]="PING",t[t.APPLICATION_COMMAND=2]="APPLICATION_COMMAND",t[t.MESSAGE_COMPONENT=3]="MESSAGE_COMPONENT"}(r.InteractionType||(r.InteractionType={})),function(t){t[t.PONG=1]="PONG",t[t.CHANNEL_MESSAGE_WITH_SOURCE=4]="CHANNEL_MESSAGE_WITH_SOURCE",t[t.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE=5]="DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE",t[t.DEFERRED_UPDATE_MESSAGE=6]="DEFERRED_UPDATE_MESSAGE",t[t.UPDATE_MESSAGE=7]="UPDATE_MESSAGE"}(r.InteractionCallbackType||(r.InteractionCallbackType={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.TransactionType=r.RoleSafety=void 0,function(t){t[t.Safe=0]="Safe",t[t.HigherThanBot=2]="HigherThanBot",t[t.DangerousPermissions=4]="DangerousPermissions",t[t.ManagedRole=8]="ManagedRole",t[t.AccessControl=16]="AccessControl"}(r.RoleSafety||(r.RoleSafety={})),function(t){t[t.None=0]="None",t[t.Remove=2]="Remove",t[t.Add=4]="Add"}(r.TransactionType||(r.TransactionType={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.verifyRequest=void 0;const o=e(3),i=n(e(20));r.verifyRequest=async r=>{const e=r.headers.get("x-signature-timestamp"),n=r.headers.get("x-signature-ed25519");if(!e||!n)return!1;const s=await r.json();return!!i.default.sign.detached.verify(t.from(e+JSON.stringify(s)),t.from(n,"hex"),t.from(o.publicKey,"hex"))}}).call(this,e(16).Buffer)},function(t,r,e){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=e(17),o=e(18),i=e(19);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function y(t,r){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return j(t).length;r=(""+r).toLowerCase(),n=!0}}function d(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,r,e);case"utf8":case"utf-8":return P(this,r,e);case"ascii":return S(this,r,e);case"latin1":case"binary":return T(this,r,e);case"base64":return U(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function v(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:w(t,r,e,n,o);if("number"==typeof r)return r&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):w(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,r,e,n,o){var i,s=1,a=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;s=2,a/=2,u/=2,e/=2}function f(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(o){var h=-1;for(i=e;ia&&(e=a-u),i=e;i>=0;i--){for(var c=!0,l=0;lo&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function U(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function P(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o239?4:f>223?3:f>191?2:1;if(o+c<=e)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&f)<<6|63&i)>127&&(h=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&f)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},u.prototype.compare=function(t,r,e,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),a=Math.min(i,s),f=this.slice(n,o),h=t.slice(r,e),c=0;co)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,t,r,e);case"utf8":case"utf-8":return b(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return m(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;on)&&(e=n);for(var o="",i=r;ie)throw new RangeError("Trying to access beyond buffer length")}function x(t,r,e,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||rt.length)throw new RangeError("Index out of range")}function I(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o>>8*(n?o:1-o)}function C(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o>>8*(n?o:3-o)&255}function L(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function N(t,r,e,n,i){return i||L(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function Y(t,r,e,n,i){return i||L(t,0,e,8),o.write(t,r,e,n,52,8),e+8}u.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r0&&(o*=256);)n+=this[t+--r]*o;return n},u.prototype.readUInt8=function(t,r){return r||B(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,r){return r||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,r){return r||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,r){return r||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,r){return r||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||B(t,r,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*r)),n},u.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||B(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},u.prototype.readInt8=function(t,r){return r||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,r){r||B(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){r||B(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return r||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return r||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return r||B(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return r||B(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return r||B(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return r||B(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i=0&&(i*=256);)this[r+o]=t/i&255;return r+e},u.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):I(this,t,r,!0),r+2},u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):I(this,t,r,!1),r+2},u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):C(this,t,r,!0),r+4},u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=0,s=1,a=0;for(this[r]=255&t;++i>0)-a&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=e-1,s=1,a=0;for(this[r+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/s>>0)-a&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):I(this,t,r,!0),r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):I(this,t,r,!1),r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):C(this,t,r,!0),r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},u.prototype.writeFloatLE=function(t,r,e){return N(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return N(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return Y(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return Y(this,t,r,!1,e)},u.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r=0;--o)t[o+r]=this[o+e];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function K(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,r,e,n){for(var o=0;o=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(2))},function(t,r,e){"use strict";r.byteLength=function(t){var r=f(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=f(t),s=n[0],a=n[1],u=new i(function(t,r,e){return 3*(r+e)/4-e}(0,s,a)),h=0,c=a>0?s-4:s;for(e=0;e>16&255,u[h++]=r>>8&255,u[h++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,u[h++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,u[h++]=r>>8&255,u[h++]=255&r);return u},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],s=0,a=e-o;sa?a:s+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function h(t,r,e){for(var o,i,s=[],a=r;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ r.read=function(t,r,e,n,o){var i,s,a=8*o-n-1,u=(1<>1,h=-7,c=e?o-1:0,l=e?-1:1,p=t[r+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=a;h>0;i=256*i+t[r+c],c+=l,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[r+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var s,a,u,f=8*i-o-1,h=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),(r+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(r*u-1)*Math.pow(2,o),s+=c):(a=r*Math.pow(2,c-1)*Math.pow(2,o),s=0));o>=8;t[e+p]=255&a,p+=y,a/=256,o-=8);for(s=s<0;t[e+p]=255&s,p+=y,s/=256,f-=8);t[e+p-y]|=128*d}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){!function(t){"use strict";var r=function(t){var r,e=new Float64Array(16);if(t)for(r=0;r>24&255,t[r+1]=e>>16&255,t[r+2]=e>>8&255,t[r+3]=255&e,t[r+4]=n>>24&255,t[r+5]=n>>16&255,t[r+6]=n>>8&255,t[r+7]=255&n}function d(t,r,e,n,o){var i,s=0;for(i=0;i>>8)-1}function g(t,r,e,n){return d(t,r,e,n,16)}function v(t,r,e,n){return d(t,r,e,n,32)}function w(t,r,e,n){!function(t,r,e,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,y=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,w=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,_=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=i,E=s,m=a,R=u,U=f,P=h,S=c,T=l,M=p,O=y,B=d,x=g,I=v,C=w,L=_,N=b,Y=0;Y<20;Y+=2)A^=(o=(I^=(o=(M^=(o=(U^=(o=A+I|0)<<7|o>>>25)+A|0)<<9|o>>>23)+U|0)<<13|o>>>19)+M|0)<<18|o>>>14,P^=(o=(E^=(o=(C^=(o=(O^=(o=P+E|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+C|0)<<18|o>>>14,B^=(o=(S^=(o=(m^=(o=(L^=(o=B+S|0)<<7|o>>>25)+B|0)<<9|o>>>23)+L|0)<<13|o>>>19)+m|0)<<18|o>>>14,N^=(o=(x^=(o=(T^=(o=(R^=(o=N+x|0)<<7|o>>>25)+N|0)<<9|o>>>23)+R|0)<<13|o>>>19)+T|0)<<18|o>>>14,A^=(o=(R^=(o=(m^=(o=(E^=(o=A+R|0)<<7|o>>>25)+A|0)<<9|o>>>23)+E|0)<<13|o>>>19)+m|0)<<18|o>>>14,P^=(o=(U^=(o=(T^=(o=(S^=(o=P+U|0)<<7|o>>>25)+P|0)<<9|o>>>23)+S|0)<<13|o>>>19)+T|0)<<18|o>>>14,B^=(o=(O^=(o=(M^=(o=(x^=(o=B+O|0)<<7|o>>>25)+B|0)<<9|o>>>23)+x|0)<<13|o>>>19)+M|0)<<18|o>>>14,N^=(o=(L^=(o=(C^=(o=(I^=(o=N+L|0)<<7|o>>>25)+N|0)<<9|o>>>23)+I|0)<<13|o>>>19)+C|0)<<18|o>>>14;A=A+i|0,E=E+s|0,m=m+a|0,R=R+u|0,U=U+f|0,P=P+h|0,S=S+c|0,T=T+l|0,M=M+p|0,O=O+y|0,B=B+d|0,x=x+g|0,I=I+v|0,C=C+w|0,L=L+_|0,N=N+b|0,t[0]=A>>>0&255,t[1]=A>>>8&255,t[2]=A>>>16&255,t[3]=A>>>24&255,t[4]=E>>>0&255,t[5]=E>>>8&255,t[6]=E>>>16&255,t[7]=E>>>24&255,t[8]=m>>>0&255,t[9]=m>>>8&255,t[10]=m>>>16&255,t[11]=m>>>24&255,t[12]=R>>>0&255,t[13]=R>>>8&255,t[14]=R>>>16&255,t[15]=R>>>24&255,t[16]=U>>>0&255,t[17]=U>>>8&255,t[18]=U>>>16&255,t[19]=U>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=S>>>0&255,t[25]=S>>>8&255,t[26]=S>>>16&255,t[27]=S>>>24&255,t[28]=T>>>0&255,t[29]=T>>>8&255,t[30]=T>>>16&255,t[31]=T>>>24&255,t[32]=M>>>0&255,t[33]=M>>>8&255,t[34]=M>>>16&255,t[35]=M>>>24&255,t[36]=O>>>0&255,t[37]=O>>>8&255,t[38]=O>>>16&255,t[39]=O>>>24&255,t[40]=B>>>0&255,t[41]=B>>>8&255,t[42]=B>>>16&255,t[43]=B>>>24&255,t[44]=x>>>0&255,t[45]=x>>>8&255,t[46]=x>>>16&255,t[47]=x>>>24&255,t[48]=I>>>0&255,t[49]=I>>>8&255,t[50]=I>>>16&255,t[51]=I>>>24&255,t[52]=C>>>0&255,t[53]=C>>>8&255,t[54]=C>>>16&255,t[55]=C>>>24&255,t[56]=L>>>0&255,t[57]=L>>>8&255,t[58]=L>>>16&255,t[59]=L>>>24&255,t[60]=N>>>0&255,t[61]=N>>>8&255,t[62]=N>>>16&255,t[63]=N>>>24&255}(t,r,e,n)}function _(t,r,e,n){!function(t,r,e,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,y=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,w=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,_=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,b=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=0;A<20;A+=2)i^=(o=(v^=(o=(p^=(o=(f^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+f|0)<<13|o>>>19)+p|0)<<18|o>>>14,h^=(o=(s^=(o=(w^=(o=(y^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+y|0)<<13|o>>>19)+w|0)<<18|o>>>14,d^=(o=(c^=(o=(a^=(o=(_^=(o=d+c|0)<<7|o>>>25)+d|0)<<9|o>>>23)+_|0)<<13|o>>>19)+a|0)<<18|o>>>14,b^=(o=(g^=(o=(l^=(o=(u^=(o=b+g|0)<<7|o>>>25)+b|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(u^=(o=(a^=(o=(s^=(o=i+u|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(f^=(o=(l^=(o=(c^=(o=h+f|0)<<7|o>>>25)+h|0)<<9|o>>>23)+c|0)<<13|o>>>19)+l|0)<<18|o>>>14,d^=(o=(y^=(o=(p^=(o=(g^=(o=d+y|0)<<7|o>>>25)+d|0)<<9|o>>>23)+g|0)<<13|o>>>19)+p|0)<<18|o>>>14,b^=(o=(_^=(o=(w^=(o=(v^=(o=b+_|0)<<7|o>>>25)+b|0)<<9|o>>>23)+v|0)<<13|o>>>19)+w|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=d>>>0&255,t[9]=d>>>8&255,t[10]=d>>>16&255,t[11]=d>>>24&255,t[12]=b>>>0&255,t[13]=b>>>8&255,t[14]=b>>>16&255,t[15]=b>>>24&255,t[16]=c>>>0&255,t[17]=c>>>8&255,t[18]=c>>>16&255,t[19]=c>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=p>>>0&255,t[25]=p>>>8&255,t[26]=p>>>16&255,t[27]=p>>>24&255,t[28]=y>>>0&255,t[29]=y>>>8&255,t[30]=y>>>16&255,t[31]=y>>>24&255}(t,r,e,n)}var b=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(t,r,e,n,o,i,s){var a,u,f=new Uint8Array(16),h=new Uint8Array(64);for(u=0;u<16;u++)f[u]=0;for(u=0;u<8;u++)f[u]=i[u];for(;o>=64;){for(w(h,f,s,b),u=0;u<64;u++)t[r+u]=e[n+u]^h[u];for(a=1,u=8;u<16;u++)a=a+(255&f[u])|0,f[u]=255&a,a>>>=8;o-=64,r+=64,n+=64}if(o>0)for(w(h,f,s,b),u=0;u=64;){for(w(u,a,o,b),s=0;s<64;s++)t[r+s]=u[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;e-=64,r+=64}if(e>0)for(w(u,a,o,b),s=0;s>>13|e<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(e>>>10|n<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,r,e,n,o,i){var s=new U(i);return s.update(e,n,o),s.finish(t,r),0}function S(t,r,e,n,o,i){var s=new Uint8Array(16);return P(s,0,e,n,o,i),g(t,r,s,0)}function T(t,r,e,n,o){var i;if(e<32)return-1;for(R(t,0,r,0,e,n,o),P(t,16,t,32,e-32,t),i=0;i<16;i++)t[i]=0;return 0}function M(t,r,e,n,o){var i,s=new Uint8Array(32);if(e<32)return-1;if(m(s,0,32,n,o),0!==S(r,16,r,32,e-32,s))return-1;for(R(t,0,r,0,e,n,o),i=0;i<32;i++)t[i]=0;return 0}function O(t,r){var e;for(e=0;e<16;e++)t[e]=0|r[e]}function B(t){var r,e,n=1;for(r=0;r<16;r++)e=t[r]+n+65535,n=Math.floor(e/65536),t[r]=e-65536*n;t[0]+=n-1+37*(n-1)}function x(t,r,e){for(var n,o=~(e-1),i=0;i<16;i++)n=o&(t[i]^r[i]),t[i]^=n,r[i]^=n}function I(t,e){var n,o,i,s=r(),a=r();for(n=0;n<16;n++)a[n]=e[n];for(B(a),B(a),B(a),o=0;o<2;o++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,x(a,s,1-i)}for(n=0;n<16;n++)t[2*n]=255&a[n],t[2*n+1]=a[n]>>8}function C(t,r){var e=new Uint8Array(32),n=new Uint8Array(32);return I(e,t),I(n,r),v(e,0,n,0)}function L(t){var r=new Uint8Array(32);return I(r,t),1&r[0]}function N(t,r){var e;for(e=0;e<16;e++)t[e]=r[2*e]+(r[2*e+1]<<8);t[15]&=32767}function Y(t,r,e){for(var n=0;n<16;n++)t[n]=r[n]+e[n]}function k(t,r,e){for(var n=0;n<16;n++)t[n]=r[n]-e[n]}function D(t,r,e){var n,o,i=0,s=0,a=0,u=0,f=0,h=0,c=0,l=0,p=0,y=0,d=0,g=0,v=0,w=0,_=0,b=0,A=0,E=0,m=0,R=0,U=0,P=0,S=0,T=0,M=0,O=0,B=0,x=0,I=0,C=0,L=0,N=e[0],Y=e[1],k=e[2],D=e[3],j=e[4],K=e[5],F=e[6],G=e[7],z=e[8],H=e[9],W=e[10],V=e[11],q=e[12],J=e[13],Z=e[14],X=e[15];i+=(n=r[0])*N,s+=n*Y,a+=n*k,u+=n*D,f+=n*j,h+=n*K,c+=n*F,l+=n*G,p+=n*z,y+=n*H,d+=n*W,g+=n*V,v+=n*q,w+=n*J,_+=n*Z,b+=n*X,s+=(n=r[1])*N,a+=n*Y,u+=n*k,f+=n*D,h+=n*j,c+=n*K,l+=n*F,p+=n*G,y+=n*z,d+=n*H,g+=n*W,v+=n*V,w+=n*q,_+=n*J,b+=n*Z,A+=n*X,a+=(n=r[2])*N,u+=n*Y,f+=n*k,h+=n*D,c+=n*j,l+=n*K,p+=n*F,y+=n*G,d+=n*z,g+=n*H,v+=n*W,w+=n*V,_+=n*q,b+=n*J,A+=n*Z,E+=n*X,u+=(n=r[3])*N,f+=n*Y,h+=n*k,c+=n*D,l+=n*j,p+=n*K,y+=n*F,d+=n*G,g+=n*z,v+=n*H,w+=n*W,_+=n*V,b+=n*q,A+=n*J,E+=n*Z,m+=n*X,f+=(n=r[4])*N,h+=n*Y,c+=n*k,l+=n*D,p+=n*j,y+=n*K,d+=n*F,g+=n*G,v+=n*z,w+=n*H,_+=n*W,b+=n*V,A+=n*q,E+=n*J,m+=n*Z,R+=n*X,h+=(n=r[5])*N,c+=n*Y,l+=n*k,p+=n*D,y+=n*j,d+=n*K,g+=n*F,v+=n*G,w+=n*z,_+=n*H,b+=n*W,A+=n*V,E+=n*q,m+=n*J,R+=n*Z,U+=n*X,c+=(n=r[6])*N,l+=n*Y,p+=n*k,y+=n*D,d+=n*j,g+=n*K,v+=n*F,w+=n*G,_+=n*z,b+=n*H,A+=n*W,E+=n*V,m+=n*q,R+=n*J,U+=n*Z,P+=n*X,l+=(n=r[7])*N,p+=n*Y,y+=n*k,d+=n*D,g+=n*j,v+=n*K,w+=n*F,_+=n*G,b+=n*z,A+=n*H,E+=n*W,m+=n*V,R+=n*q,U+=n*J,P+=n*Z,S+=n*X,p+=(n=r[8])*N,y+=n*Y,d+=n*k,g+=n*D,v+=n*j,w+=n*K,_+=n*F,b+=n*G,A+=n*z,E+=n*H,m+=n*W,R+=n*V,U+=n*q,P+=n*J,S+=n*Z,T+=n*X,y+=(n=r[9])*N,d+=n*Y,g+=n*k,v+=n*D,w+=n*j,_+=n*K,b+=n*F,A+=n*G,E+=n*z,m+=n*H,R+=n*W,U+=n*V,P+=n*q,S+=n*J,T+=n*Z,M+=n*X,d+=(n=r[10])*N,g+=n*Y,v+=n*k,w+=n*D,_+=n*j,b+=n*K,A+=n*F,E+=n*G,m+=n*z,R+=n*H,U+=n*W,P+=n*V,S+=n*q,T+=n*J,M+=n*Z,O+=n*X,g+=(n=r[11])*N,v+=n*Y,w+=n*k,_+=n*D,b+=n*j,A+=n*K,E+=n*F,m+=n*G,R+=n*z,U+=n*H,P+=n*W,S+=n*V,T+=n*q,M+=n*J,O+=n*Z,B+=n*X,v+=(n=r[12])*N,w+=n*Y,_+=n*k,b+=n*D,A+=n*j,E+=n*K,m+=n*F,R+=n*G,U+=n*z,P+=n*H,S+=n*W,T+=n*V,M+=n*q,O+=n*J,B+=n*Z,x+=n*X,w+=(n=r[13])*N,_+=n*Y,b+=n*k,A+=n*D,E+=n*j,m+=n*K,R+=n*F,U+=n*G,P+=n*z,S+=n*H,T+=n*W,M+=n*V,O+=n*q,B+=n*J,x+=n*Z,I+=n*X,_+=(n=r[14])*N,b+=n*Y,A+=n*k,E+=n*D,m+=n*j,R+=n*K,U+=n*F,P+=n*G,S+=n*z,T+=n*H,M+=n*W,O+=n*V,B+=n*q,x+=n*J,I+=n*Z,C+=n*X,b+=(n=r[15])*N,s+=38*(E+=n*k),a+=38*(m+=n*D),u+=38*(R+=n*j),f+=38*(U+=n*K),h+=38*(P+=n*F),c+=38*(S+=n*G),l+=38*(T+=n*z),p+=38*(M+=n*H),y+=38*(O+=n*W),d+=38*(B+=n*V),g+=38*(x+=n*q),v+=38*(I+=n*J),w+=38*(C+=n*Z),_+=38*(L+=n*X),i=(n=(i+=38*(A+=n*Y))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),_=(n=_+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),i=(n=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),_=(n=_+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=u,t[4]=f,t[5]=h,t[6]=c,t[7]=l,t[8]=p,t[9]=y,t[10]=d,t[11]=g,t[12]=v,t[13]=w,t[14]=_,t[15]=b}function j(t,r){D(t,r,r)}function K(t,e){var n,o=r();for(n=0;n<16;n++)o[n]=e[n];for(n=253;n>=0;n--)j(o,o),2!==n&&4!==n&&D(o,o,e);for(n=0;n<16;n++)t[n]=o[n]}function F(t,e){var n,o=r();for(n=0;n<16;n++)o[n]=e[n];for(n=250;n>=0;n--)j(o,o),1!==n&&D(o,o,e);for(n=0;n<16;n++)t[n]=o[n]}function G(t,e,n){var o,i,s=new Uint8Array(32),a=new Float64Array(80),f=r(),h=r(),c=r(),l=r(),p=r(),y=r();for(i=0;i<31;i++)s[i]=e[i];for(s[31]=127&e[31]|64,s[0]&=248,N(a,n),i=0;i<16;i++)h[i]=a[i],l[i]=f[i]=c[i]=0;for(f[0]=l[0]=1,i=254;i>=0;--i)x(f,h,o=s[i>>>3]>>>(7&i)&1),x(c,l,o),Y(p,f,c),k(f,f,c),Y(c,h,l),k(h,h,l),j(l,p),j(y,f),D(f,c,f),D(c,h,p),Y(p,f,c),k(f,f,c),j(h,f),k(c,l,y),D(f,c,u),Y(f,f,l),D(c,c,f),D(f,l,y),D(l,h,a),j(h,p),x(f,h,o),x(c,l,o);for(i=0;i<16;i++)a[i+16]=f[i],a[i+32]=c[i],a[i+48]=h[i],a[i+64]=l[i];var d=a.subarray(32),g=a.subarray(16);return K(d,d),D(g,g,d),I(t,g),0}function z(t,r){return G(t,r,i)}function H(t,r){return n(r,32),z(t,r)}function W(t,r,e){var n=new Uint8Array(32);return G(n,e,r),_(t,o,n,b)}U.prototype.blocks=function(t,r,e){for(var n,o,i,s,a,u,f,h,c,l,p,y,d,g,v,w,_,b,A,E=this.fin?0:2048,m=this.h[0],R=this.h[1],U=this.h[2],P=this.h[3],S=this.h[4],T=this.h[5],M=this.h[6],O=this.h[7],B=this.h[8],x=this.h[9],I=this.r[0],C=this.r[1],L=this.r[2],N=this.r[3],Y=this.r[4],k=this.r[5],D=this.r[6],j=this.r[7],K=this.r[8],F=this.r[9];e>=16;)l=c=0,l+=(m+=8191&(n=255&t[r+0]|(255&t[r+1])<<8))*I,l+=(R+=8191&(n>>>13|(o=255&t[r+2]|(255&t[r+3])<<8)<<3))*(5*F),l+=(U+=8191&(o>>>10|(i=255&t[r+4]|(255&t[r+5])<<8)<<6))*(5*K),l+=(P+=8191&(i>>>7|(s=255&t[r+6]|(255&t[r+7])<<8)<<9))*(5*j),c=(l+=(S+=8191&(s>>>4|(a=255&t[r+8]|(255&t[r+9])<<8)<<12))*(5*D))>>>13,l&=8191,l+=(T+=a>>>1&8191)*(5*k),l+=(M+=8191&(a>>>14|(u=255&t[r+10]|(255&t[r+11])<<8)<<2))*(5*Y),l+=(O+=8191&(u>>>11|(f=255&t[r+12]|(255&t[r+13])<<8)<<5))*(5*N),l+=(B+=8191&(f>>>8|(h=255&t[r+14]|(255&t[r+15])<<8)<<8))*(5*L),p=c+=(l+=(x+=h>>>5|E)*(5*C))>>>13,p+=m*C,p+=R*I,p+=U*(5*F),p+=P*(5*K),c=(p+=S*(5*j))>>>13,p&=8191,p+=T*(5*D),p+=M*(5*k),p+=O*(5*Y),p+=B*(5*N),c+=(p+=x*(5*L))>>>13,p&=8191,y=c,y+=m*L,y+=R*C,y+=U*I,y+=P*(5*F),c=(y+=S*(5*K))>>>13,y&=8191,y+=T*(5*j),y+=M*(5*D),y+=O*(5*k),y+=B*(5*Y),d=c+=(y+=x*(5*N))>>>13,d+=m*N,d+=R*L,d+=U*C,d+=P*I,c=(d+=S*(5*F))>>>13,d&=8191,d+=T*(5*K),d+=M*(5*j),d+=O*(5*D),d+=B*(5*k),g=c+=(d+=x*(5*Y))>>>13,g+=m*Y,g+=R*N,g+=U*L,g+=P*C,c=(g+=S*I)>>>13,g&=8191,g+=T*(5*F),g+=M*(5*K),g+=O*(5*j),g+=B*(5*D),v=c+=(g+=x*(5*k))>>>13,v+=m*k,v+=R*Y,v+=U*N,v+=P*L,c=(v+=S*C)>>>13,v&=8191,v+=T*I,v+=M*(5*F),v+=O*(5*K),v+=B*(5*j),w=c+=(v+=x*(5*D))>>>13,w+=m*D,w+=R*k,w+=U*Y,w+=P*N,c=(w+=S*L)>>>13,w&=8191,w+=T*C,w+=M*I,w+=O*(5*F),w+=B*(5*K),_=c+=(w+=x*(5*j))>>>13,_+=m*j,_+=R*D,_+=U*k,_+=P*Y,c=(_+=S*N)>>>13,_&=8191,_+=T*L,_+=M*C,_+=O*I,_+=B*(5*F),b=c+=(_+=x*(5*K))>>>13,b+=m*K,b+=R*j,b+=U*D,b+=P*k,c=(b+=S*Y)>>>13,b&=8191,b+=T*N,b+=M*L,b+=O*C,b+=B*I,A=c+=(b+=x*(5*F))>>>13,A+=m*F,A+=R*K,A+=U*j,A+=P*D,c=(A+=S*k)>>>13,A&=8191,A+=T*Y,A+=M*N,A+=O*L,A+=B*C,m=l=8191&(c=(c=((c+=(A+=x*I)>>>13)<<2)+c|0)+(l&=8191)|0),R=p+=c>>>=13,U=y&=8191,P=d&=8191,S=g&=8191,T=v&=8191,M=w&=8191,O=_&=8191,B=b&=8191,x=A&=8191,r+=16,e-=16;this.h[0]=m,this.h[1]=R,this.h[2]=U,this.h[3]=P,this.h[4]=S,this.h[5]=T,this.h[6]=M,this.h[7]=O,this.h[8]=B,this.h[9]=x},U.prototype.finish=function(t,r){var e,n,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(e=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=e,e=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*e,e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=e,e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=e,s[0]=this.h[0]+5,e=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+e,e=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,n=(1^e)-1,i=0;i<10;i++)s[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[r+0]=this.h[0]>>>0&255,t[r+1]=this.h[0]>>>8&255,t[r+2]=this.h[1]>>>0&255,t[r+3]=this.h[1]>>>8&255,t[r+4]=this.h[2]>>>0&255,t[r+5]=this.h[2]>>>8&255,t[r+6]=this.h[3]>>>0&255,t[r+7]=this.h[3]>>>8&255,t[r+8]=this.h[4]>>>0&255,t[r+9]=this.h[4]>>>8&255,t[r+10]=this.h[5]>>>0&255,t[r+11]=this.h[5]>>>8&255,t[r+12]=this.h[6]>>>0&255,t[r+13]=this.h[6]>>>8&255,t[r+14]=this.h[7]>>>0&255,t[r+15]=this.h[7]>>>8&255},U.prototype.update=function(t,r,e){var n,o;if(this.leftover){for((o=16-this.leftover)>e&&(o=e),n=0;n=16&&(o=e-e%16,this.blocks(t,r,o),r+=o,e-=o),e){for(n=0;n=128;){for(E=0;E<16;E++)m=8*E+q,O[E]=e[m+0]<<24|e[m+1]<<16|e[m+2]<<8|e[m+3],B[E]=e[m+4]<<24|e[m+5]<<16|e[m+6]<<8|e[m+7];for(E=0;E<80;E++)if(o=x,i=I,s=C,a=L,u=N,f=Y,h=k,D,l=j,p=K,y=F,d=G,g=z,v=H,w=W,V,P=65535&(U=V),S=U>>>16,T=65535&(R=D),M=R>>>16,P+=65535&(U=(z>>>14|N<<18)^(z>>>18|N<<14)^(N>>>9|z<<23)),S+=U>>>16,T+=65535&(R=(N>>>14|z<<18)^(N>>>18|z<<14)^(z>>>9|N<<23)),M+=R>>>16,P+=65535&(U=z&H^~z&W),S+=U>>>16,T+=65535&(R=N&Y^~N&k),M+=R>>>16,P+=65535&(U=J[2*E+1]),S+=U>>>16,T+=65535&(R=J[2*E]),M+=R>>>16,R=O[E%16],S+=(U=B[E%16])>>>16,T+=65535&R,M+=R>>>16,T+=(S+=(P+=65535&U)>>>16)>>>16,P=65535&(U=A=65535&P|S<<16),S=U>>>16,T=65535&(R=b=65535&T|(M+=T>>>16)<<16),M=R>>>16,P+=65535&(U=(j>>>28|x<<4)^(x>>>2|j<<30)^(x>>>7|j<<25)),S+=U>>>16,T+=65535&(R=(x>>>28|j<<4)^(j>>>2|x<<30)^(j>>>7|x<<25)),M+=R>>>16,S+=(U=j&K^j&F^K&F)>>>16,T+=65535&(R=x&I^x&C^I&C),M+=R>>>16,c=65535&(T+=(S+=(P+=65535&U)>>>16)>>>16)|(M+=T>>>16)<<16,_=65535&P|S<<16,P=65535&(U=d),S=U>>>16,T=65535&(R=a),M=R>>>16,S+=(U=A)>>>16,T+=65535&(R=b),M+=R>>>16,I=o,C=i,L=s,N=a=65535&(T+=(S+=(P+=65535&U)>>>16)>>>16)|(M+=T>>>16)<<16,Y=u,k=f,D=h,x=c,K=l,F=p,G=y,z=d=65535&P|S<<16,H=g,W=v,V=w,j=_,E%16==15)for(m=0;m<16;m++)R=O[m],P=65535&(U=B[m]),S=U>>>16,T=65535&R,M=R>>>16,R=O[(m+9)%16],P+=65535&(U=B[(m+9)%16]),S+=U>>>16,T+=65535&R,M+=R>>>16,b=O[(m+1)%16],P+=65535&(U=((A=B[(m+1)%16])>>>1|b<<31)^(A>>>8|b<<24)^(A>>>7|b<<25)),S+=U>>>16,T+=65535&(R=(b>>>1|A<<31)^(b>>>8|A<<24)^b>>>7),M+=R>>>16,b=O[(m+14)%16],S+=(U=((A=B[(m+14)%16])>>>19|b<<13)^(b>>>29|A<<3)^(A>>>6|b<<26))>>>16,T+=65535&(R=(b>>>19|A<<13)^(A>>>29|b<<3)^b>>>6),M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,O[m]=65535&T|M<<16,B[m]=65535&P|S<<16;P=65535&(U=j),S=U>>>16,T=65535&(R=x),M=R>>>16,R=t[0],S+=(U=r[0])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[0]=x=65535&T|M<<16,r[0]=j=65535&P|S<<16,P=65535&(U=K),S=U>>>16,T=65535&(R=I),M=R>>>16,R=t[1],S+=(U=r[1])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[1]=I=65535&T|M<<16,r[1]=K=65535&P|S<<16,P=65535&(U=F),S=U>>>16,T=65535&(R=C),M=R>>>16,R=t[2],S+=(U=r[2])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[2]=C=65535&T|M<<16,r[2]=F=65535&P|S<<16,P=65535&(U=G),S=U>>>16,T=65535&(R=L),M=R>>>16,R=t[3],S+=(U=r[3])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[3]=L=65535&T|M<<16,r[3]=G=65535&P|S<<16,P=65535&(U=z),S=U>>>16,T=65535&(R=N),M=R>>>16,R=t[4],S+=(U=r[4])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[4]=N=65535&T|M<<16,r[4]=z=65535&P|S<<16,P=65535&(U=H),S=U>>>16,T=65535&(R=Y),M=R>>>16,R=t[5],S+=(U=r[5])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[5]=Y=65535&T|M<<16,r[5]=H=65535&P|S<<16,P=65535&(U=W),S=U>>>16,T=65535&(R=k),M=R>>>16,R=t[6],S+=(U=r[6])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[6]=k=65535&T|M<<16,r[6]=W=65535&P|S<<16,P=65535&(U=V),S=U>>>16,T=65535&(R=D),M=R>>>16,R=t[7],S+=(U=r[7])>>>16,T+=65535&R,M+=R>>>16,M+=(T+=(S+=(P+=65535&U)>>>16)>>>16)>>>16,t[7]=D=65535&T|M<<16,r[7]=V=65535&P|S<<16,q+=128,n-=128}return n}function X(t,r,e){var n,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=e;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Z(o,i,r,e),e%=128,n=0;n=0;--o)Q(t,r,n=e[o/8|0]>>(7&o)&1),$(r,t),$(t,t),Q(t,r,n)}function et(t,e){var n=[r(),r(),r(),r()];O(n[0],c),O(n[1],l),O(n[2],a),D(n[3],c,l),rt(t,n,e)}function nt(t,e,o){var i,s=new Uint8Array(64),a=[r(),r(),r(),r()];for(o||n(e,32),X(s,e,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),tt(t,a),i=0;i<32;i++)e[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,r){var e,n,o,i;for(n=63;n>=32;--n){for(e=0,o=n-32,i=n-12;o>4)*ot[o],e=r[o]>>8,r[o]&=255;for(o=0;o<32;o++)r[o]-=e*ot[o];for(n=0;n<32;n++)r[n+1]+=r[n]>>8,t[n]=255&r[n]}function st(t){var r,e=new Float64Array(64);for(r=0;r<64;r++)e[r]=t[r];for(r=0;r<64;r++)t[r]=0;it(t,e)}function at(t,e,n,o){var i,s,a=new Uint8Array(64),u=new Uint8Array(64),f=new Uint8Array(64),h=new Float64Array(64),c=[r(),r(),r(),r()];X(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=n+64;for(i=0;i>7&&k(t[0],s,t[0]),D(t[3],t[0],t[1]),0)}(l,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),r=new Uint8Array(64);return nt(t,r),{publicKey:t,secretKey:r}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var r=new Uint8Array(32),e=0;e{const a=await fetch(r.discordAPIBase+t,{...s||{},headers:{...(null==s?void 0:s.headers)||{},authorization:`${o[i]} ${e}`,"user-agent":n.userAgent}});return a.status>=400&&console.error("discordFetch failed",{url:t,authType:i,payload:await a.text()}),a.ok?await a.json():null}},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.kvOrLocal=r.WrappedKVNamespace=void 0;r.WrappedKVNamespace=class{constructor(t){this.kvNamespace=t,this.list=this.kvNamespace.list,this.getWithMetadata=this.kvNamespace.getWithMetadata,this.delete=this.kvNamespace.delete}async get(t){const r=await this.kvNamespace.get(t,"text");return r?JSON.parse(r):null}async put(t,r,e){await this.kvNamespace.put(t,JSON.stringify(r),{expirationTtl:e})}};class n{constructor(){this.data=new Map,console.warn("EmulatedKV used. Data will be lost.")}async get(t){return this.data.has(t)?this.data.get(t):null}async getWithMetadata(t){return{value:await this.get(t),metadata:{}}}async put(t,r){this.data.set(t,r)}async delete(t){this.data.delete(t)}async list(t){let r=[];for(let e of this.data.keys())(null==t?void 0:t.prefix)&&!e.startsWith(t.prefix)||r.push({name:e});return{keys:r,cursor:"0",list_complete:!0}}}r.kvOrLocal=t=>t||new n},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.healthz=void 0;const n=e(0);r.healthz=async t=>n.respond({ok:!0})}]);