"}},13:function(e,t){},1304:function(e,t,r){"use strict";const n=r("8724"),i=r("609c"),s=r("59c5"),o=r("e730");t.Key=n,t.MemoryDatastore=i,t.utils=s,t.Errors=o},"131a":function(e,t,r){var n=r("23e7"),i=r("d2bb");n({target:"Object",stat:!0},{setPrototypeOf:i})},"131d":function(e,t,r){"use strict";const n=r("83fd").Errors,i=r("34eb")("datastore:core:tiered");class s{constructor(e){this.stores=e.slice()}async open(){try{await this.stores.map(e=>e.open())}catch(e){throw n.dbOpenFailedError()}}async put(e,t){try{await Promise.all(this.stores.map(r=>r.put(e,t)))}catch(r){throw n.dbWriteFailedError()}}async get(e){for(const r of this.stores)try{const t=await r.get(e);if(t)return t}catch(t){i(t)}throw n.notFoundError()}has(e){return new Promise(async t=>{await Promise.all(this.stores.map(async r=>{const n=await r.has(e);n&&t(!0)})),t(!1)})}async delete(e){try{await Promise.all(this.stores.map(t=>t.delete(e)))}catch(t){throw n.dbDeleteFailedError()}}async close(){await Promise.all(this.stores.map(e=>e.close()))}batch(){const e=this.stores.map(e=>e.batch());return{put:(t,r)=>{e.forEach(e=>e.put(t,r))},delete:t=>{e.forEach(e=>e.delete(t))},commit:async()=>{for(const t of e)await t.commit()}}}query(e){return this.stores[this.stores.length-1].query(e)}}e.exports=s},"132c":function(e,t,r){var n=r("5995");r("31a0"),r("8f53"),r("1b43");var i=e.exports=n.pkcs1=n.pkcs1||{};function s(e,t,r){r||(r=n.md.sha1.create());for(var i="",s=Math.ceil(t/r.digestLength),o=0;o>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+a),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,a,c;"string"===typeof r?(i=r,o=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),c||(c=a);var u=Math.ceil(e.n.bitLength()/8),l=u-2*a.digestLength-2;if(t.length>l){var h=new Error("RSAES-OAEP input message length is too long.");throw h.length=t.length,h.maxLength=l,h}i||(i=""),a.update(i,"raw");for(var f=a.digest(),d="",p=l-t.length,y=0;y{const o=new n("directory"),a=new s(o.marshal(),[]),c=await i(a,t,r),u=e.path;return{cid:c,path:u,unixfs:o,node:a}};e.exports=o},1364:function(e){e.exports=JSON.parse('{"sha1":{"securityStrength":128,"outlen":160,"seedlen":440},"sha224":{"securityStrength":192,"outlen":224,"seedlen":440},"sha256":{"securityStrength":256,"outlen":256,"seedlen":440},"sha384":{"securityStrength":256,"outlen":384,"seedlen":888},"sha512":{"securityStrength":256,"outlen":512,"seedlen":888}}')},"13b0":function(e,t,r){(function(t,n){var i=r("53a8"),s=r("3eed"),o=r("46be"),a=r("7804"),c=Object.prototype.hasOwnProperty,u="start end gt gte lt lte".split(" ");function l(e){this.status="new",this.supports=s(e,{status:!0})}function h(e,t){var r={};for(var n in t)if(c.call(t,n)){var i=t[n];f(n)&&(i=e._serializeKey(i)),r[n]=i}return r}function f(e){return-1!==u.indexOf(e)}l.prototype.open=function(e,t){var r=this,n=this.status;if("function"===typeof e&&(t=e),"function"!==typeof t)throw new Error("open() requires a callback argument");"object"===typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},l.prototype._open=function(e,r){t.nextTick(r)},l.prototype.close=function(e){var t=this,r=this.status;if("function"!==typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},l.prototype._close=function(e){t.nextTick(e)},l.prototype.get=function(e,r,n){if("function"===typeof r&&(n=r),"function"!==typeof n)throw new Error("get() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"===typeof r&&null!==r||(r={}),r.asBuffer=!1!==r.asBuffer,this._get(e,r,n)},l.prototype._get=function(e,r,n){t.nextTick((function(){n(new Error("NotFound"))}))},l.prototype.put=function(e,r,n,i){if("function"===typeof n&&(i=n),"function"!==typeof i)throw new Error("put() requires a callback argument");var s=this._checkKey(e)||this._checkValue(r);if(s)return t.nextTick(i,s);e=this._serializeKey(e),r=this._serializeValue(r),"object"===typeof n&&null!==n||(n={}),this._put(e,r,n,i)},l.prototype._put=function(e,r,n,i){t.nextTick(i)},l.prototype.del=function(e,r,n){if("function"===typeof r&&(n=r),"function"!==typeof n)throw new Error("del() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"===typeof r&&null!==r||(r={}),this._del(e,r,n)},l.prototype._del=function(e,r,n){t.nextTick(n)},l.prototype.batch=function(e,r,n){if(!arguments.length)return this._chainedBatch();if("function"===typeof r&&(n=r),"function"===typeof e&&(n=e),"function"!==typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return t.nextTick(n,new Error("batch(array) requires an array argument"));if(0===e.length)return t.nextTick(n);"object"===typeof r&&null!==r||(r={});for(var s=new Array(e.length),o=0;o(n(`New MFS root will be ${t}`),await e.repo.datastore.put(i,t.buffer),t);e.exports=s},14:function(e,t){},1405:function(e,t,r){"use strict";var n=r("4ea4"),i=n(r("a34a")),s=n(r("c973")),o=n(r("dfb7")),a=n(r("427a"));function c(e){return a.default.encodeBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function u(e){var t=a.default.decodeBase64(e);return(function(){var e=(0,s.default)(i.default.mark((function e(r){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",c(o.default.sign.detached(a.default.decodeUTF8(r),t)));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}())}e.exports=u},1421:function(e,t,r){"use strict";(function(t){const n=r("37c4"),i=r("1e83"),s=r("9efb"),o=r("e5af"),a=r("87dd"),c=a.proto((function(e){if(!(this instanceof c))return new c(e);if(null==e&&(e=""),e instanceof t)this.buffer=n.fromBuffer(e);else if("string"===typeof e||e instanceof String){if(e.length>0&&"/"!==e.charAt(0))throw new Error(`multiaddr "${e}" must start with a "/"`);this.buffer=n.fromString(e)}else{if(!(e.buffer&&e.protos&&e.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=n.fromBuffer(e.buffer)}}),{className:"Multiaddr",symbolName:"@multiformats/js-multiaddr/multiaddr"});c.prototype.toString=function(){return n.bufferToString(this.buffer)},c.prototype.toJSON=c.prototype.toString,c.prototype.toOptions=function(){const e={},t=this.toString().split("/");return e.family="ip4"===t[1]?"ipv4":"ipv6",e.host=t[2],e.transport=t[3],e.port=t[4],e},c.prototype.inspect=function(){return""},c.prototype.protos=function(){return this.protoCodes().map(e=>Object.assign({},i(e)))},c.prototype.protoCodes=function(){const e=[],t=this.buffer;let r=0;while(re.name)},c.prototype.tuples=function(){return n.bufferToTuples(this.buffer)},c.prototype.stringTuples=function(){const e=n.bufferToTuples(this.buffer);return n.tuplesToStringTuples(e)},c.prototype.encapsulate=function(e){return e=c(e),c(this.toString()+e.toString())},c.prototype.decapsulate=function(e){e=e.toString();const t=this.toString(),r=t.lastIndexOf(e);if(r<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return c(t.slice(0,r))},c.prototype.getPeerId=function(){let e=null;try{const t=this.stringTuples().filter(e=>{if(e[0]===i.names.ipfs.code)return!0});e=t.pop()[1],o.decode(e)}catch(t){e=null}return e},c.prototype.getPath=function(){let e=null;try{e=this.stringTuples().filter(e=>{const t=i(e[0]);if(t.path)return!0})[0][1]}catch(t){e=null}return e},c.prototype.equals=function(e){return this.buffer.equals(e.buffer)},c.prototype.nodeAddress=function(){const e=this.protoCodes(),t=this.protoNames(),r=this.toString().split("/").slice(1);if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(4!==e[0]&&41!==e[0]&&54!==e[0]&&55!==e[0])throw new Error(`no protocol with name: "'${t[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`);if("tcp"!==r[2]&&"udp"!==r[2])throw new Error(`no protocol with name: "'${t[1]}'". Must have a valid transport protocol: "{tcp, udp}".`);return{family:41===e[0]||55===e[0]?6:4,address:r[1],port:r[3]}},c.fromNodeAddress=function(e,t){if(!e)throw new Error("requires node address object");if(!t)throw new Error("requires transport protocol");const r="IPv6"===e.family?"ip6":"ip4";return c("/"+[r,e.address,t,e.port].join("/"))},c.prototype.isThinWaistAddress=function(e){const t=(e||this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))},c.protocols=i,c.isName=function(e){return!!c.isMultiaddr(e)&&e.protos().some(e=>e.resolvable)},c.resolve=function(e,t){return c.isMultiaddr(e)&&c.isName(e)?t(new Error("not implemented yet")):t(new Error("not a valid name"))},e.exports=c}).call(this,r("b639").Buffer)},1428:function(e,t,r){function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){var r;function i(){if(i.enabled){var e=i,n=+new Date,s=n-(r||n);e.diff=s,e.prev=r,e.curr=n,r=n;for(var o=new Array(arguments.length),a=0;a100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]),u=(t[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*s;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function u(e){var t=Math.abs(e);return t>=s?Math.round(e/s)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}function l(e){var t=Math.abs(e);return t>=s?h(e,t,s,"day"):t>=i?h(e,t,i,"hour"):t>=n?h(e,t,n,"minute"):t>=r?h(e,t,r,"second"):e+" ms"}function h(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return c(e);if("number"===r&&isFinite(e))return t.long?l(e):u(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},"14ec":function(e,t,r){var n=r("8327");function i(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function s(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var s=e[t+1]+n;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,o,a){var c=f[o],u=f[o+1],l=f[a],d=f[a+1];i(h,e,t),s(h,e,c,u);var p=h[n]^h[e],y=h[n+1]^h[e+1];h[n]=y,h[n+1]=p,i(h,r,n),p=h[t]^h[r],y=h[t+1]^h[r+1],h[t]=p>>>24^y<<8,h[t+1]=y>>>24^p<<8,i(h,e,t),s(h,e,l,d),p=h[n]^h[e],y=h[n+1]^h[e+1],h[n]=p>>>16^y<<16,h[n+1]=y>>>16^p<<16,i(h,r,n),p=h[t]^h[r],y=h[t+1]^h[r+1],h[t]=y>>>31^p<<1,h[t+1]=p>>>31^y<<1}var c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],l=new Uint8Array(u.map((function(e){return 2*e}))),h=new Uint32Array(32),f=new Uint32Array(32);function d(e,t){var r=0;for(r=0;r<16;r++)h[r]=e.h[r],h[r+16]=c[r];for(h[24]=h[24]^e.t,h[25]=h[25]^e.t/4294967296,t&&(h[28]=~h[28],h[29]=~h[29]),r=0;r<32;r++)f[r]=o(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,l[16*r+0],l[16*r+1]),a(2,10,18,26,l[16*r+2],l[16*r+3]),a(4,12,20,28,l[16*r+4],l[16*r+5]),a(6,14,22,30,l[16*r+6],l[16*r+7]),a(0,10,20,30,l[16*r+8],l[16*r+9]),a(2,12,22,24,l[16*r+10],l[16*r+11]),a(4,14,16,26,l[16*r+12],l[16*r+13]),a(6,8,18,28,l[16*r+14],l[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^h[r]^h[r+16]}function p(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=c[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(y(r,t),r.c=128),r}function y(e,t){for(var r=0;r>2]>>8*(3&r);return t}function m(e,t,r){r=r||64,e=n.normalizeInput(e);var i=p(r,t);return y(i,e),g(i)}function b(e,t,r){var i=m(e,t,r);return n.toHex(i)}e.exports={blake2b:m,blake2bHex:b,blake2bInit:p,blake2bUpdate:y,blake2bFinal:g}},15:function(e,t){},1514:function(e,t){e.exports=function(e,t,r){r=r||0;for(var n=0,i=-1,s=r;s-1&&e.length-i=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}function c(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function l(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var s=n.util.createBuffer();if(t)while(s.length()>16),l+=(32767&u)<<16,l+=u>>15,l=(2147483647&l)+(l>>31),f=4294967295&l;for(c=0;c<3;++c)h=f>>>(c<<3),h^=Math.floor(256*Math.random()),s.putByte(String.fromCharCode(255&h))}}return s.getBytes(e)}return t.pools=s,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,s=t.plugin.increment,o=t.plugin.formatKey,c=t.plugin.formatSeed,u=n.util.createBuffer();function l(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick((function(){a(l)}));var f=i(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=o(i(t.key,s(t.seed))),t.seed=c(i(t.key,t.seed)),n.util.setImmediate(l)}t.key=null,l()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;var a=n.util.createBuffer();while(a.length()1048575&&(t.key=null),null===t.key&&c();var u=r(t.key,t.seed);t.generated+=u.length,a.putBytes(u),t.key=s(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return a.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,l(e))}catch(r){t(r)}},t.seedFileSync=l),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){function r(e){var n=e.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",r),t(n.forge.prng.err,n.forge.prng.bytes))}self.addEventListener("message",r),self.postMessage({forge:{prng:{needed:e}}})};else{var r=function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))};e.addEventListener("message",r)}},t}}).call(this,r("4362"))},1547:function(e,t){function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=r},"157d":function(e,t,r){"use strict";var n=r("8638"),i=r("5fbf"),s=r("7d44"),o=r("9e13")||0;function a(t){return n.seed(t),e.exports}function c(t){return o=t,e.exports}function u(e){return void 0!==e&&n.characters(e),n.shuffled()}function l(){return i(o)}e.exports=l,e.exports.generate=l,e.exports.seed=a,e.exports.worker=c,e.exports.characters=u,e.exports.isValid=s},1587:function(e,t,r){"use strict";const n=r("d3fa"),i=r("faa1");e.exports=e=>{const t=Object.assign(new i,{incoming:r("in"),outgoing:r("out")});return e.on("peer-mux-established",e=>{t.emit("peer:connected",e.id.toB58String())}),e.on("peer-mux-closed",e=>{t.emit("peer:closed",e.id.toB58String())}),t;function r(e){return(t,r,i)=>n(n=>(s(i,t,r,e,n.length),n))}function s(e,r,n,i,s){e.then(e=>{if(e){const o=e.id.toB58String();t.emit("message",o,r,n,i,s)}})}}},"159b":function(e,t,r){var n=r("da84"),i=r("fdbc"),s=r("17c2"),o=r("9112");for(var a in i){var c=n[a],u=c&&c.prototype;if(u&&u.forEach!==s)try{o(u,"forEach",s)}catch(l){u.forEach=s}}},"15f0":function(e,t,r){"use strict";const n=r("fdab");e.exports=(e,t)=>{const r=[];return n(e,(e,n,i)=>Promise.resolve(t(n,i)).then(e=>{r.push(e)})).then(()=>r)}},16:function(e,t){},1629:function(e,t,r){"use strict";function n(e){return e}var i=r("b6d6"),s=r("76c0");e.exports=function(e,t){e=i(e)||n;var r={};return s((function(n){var i=e(n);return r[i]?!!t:(r[i]=!0,!t)}))}},1631:function(e,t,r){"use strict";e.exports=function(e,t){var r,n;function i(s){if(r=s,n)return i.abort();(function i(){var s=!0,o=!1;while(s)if(o=!1,r(null,(function(a,c){if(o=!0,a=a||n){if(s=!1,t)t(!0===a?null:a);else if(a&&!0!==a)throw a}else e&&!1===e(c)||n?(s=!1,r(n||!0,t||function(){})):s||i()})),!o)return void(s=!1)})()}return i.abort=function(e,t){if("function"==typeof e&&(t=e,e=!0),n=e||!0,r)return r(n,t||function(){})},i}},1652:function(e,t,r){"use strict";const{filter:n,sortAll:i,take:s,map:o}=r("8281"),a=r("220c"),c=r("e5c1");class u{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){const t=await this.has(e);if(!t)throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=o(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>i(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=s(t,e.limit)),!0===e.keysOnly&&(t=o(t,e=>({key:e.key}))),t}async close(){}}e.exports=u},"169a":function(e,t,r){"use strict";(function(t,n){const i=r("7048"),s=r(17),o=r("4bc2")("ipfs:mfs:utils:to-async-iterator"),{MAX_CHUNK_SIZE:a}=r("a9f3"),c=e=>{if(!e)throw i(new Error("paths must start with a leading /"),"ERR_INVALID_PATH");if("string"===typeof e||e instanceof String)return o("Content was a path"),s.createReadStream(e);if(e.length)return o("Content was array-like"),{[Symbol.asyncIterator]:function*(){yield e}};if(e[Symbol.asyncIterator])return o("Content was an async iterator"),e;if(e[Symbol.iterator])return o("Content was an iterator"),e;if(t.Blob&&e instanceof t.Blob){o("Content was an HTML5 Blob");let r=0;const i={next:()=>r>e.size?{done:!0}:new Promise((i,s)=>{const o=e.slice(r,a);r+=a;const c=new t.FileReader,u=e=>{if(c.removeEventListener("loadend",u,!1),e.error)return s(e.error);i({done:!1,value:n.from(c.result)})};c.addEventListener("loadend",u),c.readAsArrayBuffer(o)})};return{[Symbol.asyncIterator]:()=>i}}throw i(new Error(`Don't know how to convert ${e} into an async iterator`),"ERR_INVALID_PARAMS")};e.exports=c}).call(this,r("c8ba"),r("b639").Buffer)},"16e2":function(e,t,r){"use strict";(function(t){const n=r("b13c"),i=r("e009"),s=r("91f6"),o=r("cdc1"),a=s.toCallback,c=s.toBuf,u=s.fromString,l=s.fromNumberTo32BitBuf,h=(e,r)=>{o.sha2256(e,(e,n)=>{e&&r(e),o.sha2256(t.from(n),r)})};e.exports={sha1:o.sha1,sha2256:o.sha2256,sha2512:o.sha2512,sha3512:a(c(n.sha3_512)),sha3384:a(c(n.sha3_384)),sha3256:a(c(n.sha3_256)),sha3224:a(c(n.sha3_224)),shake128:a(c(n.shake_128,128)),shake256:a(c(n.shake_256,256)),keccak224:a(c(n.keccak_224)),keccak256:a(c(n.keccak_256)),keccak384:a(c(n.keccak_384)),keccak512:a(c(n.keccak_512)),murmur3128:a(c(u(i.x64.hash128))),murmur332:a(l(u(i.x86.hash32))),addBlake:r("5754"),dblSha2256:h}}).call(this,r("b639").Buffer)},"16fe":function(e,t,r){"use strict";e.exports=function(){return function(e,t){t(!0)}}},17:function(e,t){},1711:function(e,t,r){var n=r("918b");function i(e,t){var r=function(){return new n.des.Algorithm(e,t)};n.cipher.registerAlgorithm(e,r)}r("083e"),r("70c8"),r("5ee0"),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=y({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(r._keys,e,t,!1)},decrypt:function(e,t){return p(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=d(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,w=0;w>>4^E),E^=t,_^=t<<4,t=65535&(E>>>-16^_),_^=t,E^=t<<-16,t=858993459&(_>>>2^E),E^=t,_^=t<<2,t=65535&(E>>>-16^_),_^=t,E^=t<<-16,t=1431655765&(_>>>1^E),E^=t,_^=t<<1,t=16711935&(E>>>8^_),_^=t,E^=t<<8,t=1431655765&(_>>>1^E),E^=t,_^=t<<1,t=_<<8|E>>>20&240,_=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var S=0;S>>26,E=E<<2|E>>>26):(_=_<<1|_>>>27,E=E<<1|E>>>27),_&=-15,E&=-15;var k=r[_>>>28]|n[_>>>24&15]|i[_>>>20&15]|s[_>>>16&15]|o[_>>>12&15]|a[_>>>8&15]|c[_>>>4&15],C=u[E>>>28]|l[E>>>24&15]|h[E>>>20&15]|f[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|y[E>>>4&15];t=65535&(C>>>16^k),m[v++]=k^t,m[v++]=C^t<<16}}return m}function p(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];d=252645135&(y>>>4^g),g^=d,y^=d<<4,d=65535&(y>>>16^g),g^=d,y^=d<<16,d=858993459&(g>>>2^y),y^=d,g^=d<<2,d=16711935&(g>>>8^y),y^=d,g^=d<<8,d=1431655765&(y>>>1^g),g^=d,y^=d<<1,y=y<<1|y>>>31,g=g<<1|g>>>31;for(var m=0;m>>4|g<<28)^e[w+1];d=y,y=g,g=d^(o[_>>>24&63]|c[_>>>16&63]|l[_>>>8&63]|f[63&_]|s[E>>>24&63]|a[E>>>16&63]|u[E>>>8&63]|h[63&E])}d=y,y=g,g=d}y=y>>>1|y<<31,g=g>>>1|g<<31,d=1431655765&(y>>>1^g),g^=d,y^=d<<1,d=16711935&(g>>>8^y),y^=d,g^=d<<8,d=858993459&(g>>>2^y),y^=d,g^=d<<2,d=65535&(y>>>16^g),g^=d,y^=d<<16,d=252645135&(y>>>4^g),g^=d,y^=d<<4,r[0]=y,r[1]=g}function y(e){e=e||{};var t,r=(e.mode||"CBC").toUpperCase(),i="DES-"+r;t=e.decrypt?n.cipher.createDecipher(i,e.key):n.cipher.createCipher(i,e.key);var s=t.start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),r=r||{},r.output=i,r.iv=e,s.call(t,r)},t}},1727:function(e,t,r){"use strict";(function(e){var r=Object.prototype.toString;t.isArray=function(e,t){if(!Array.isArray(e))throw TypeError(t)},t.isBoolean=function(e,t){if("[object Boolean]"!==r.call(e))throw TypeError(t)},t.isBuffer=function(t,r){if(!e.isBuffer(t))throw TypeError(r)},t.isFunction=function(e,t){if("[object Function]"!==r.call(e))throw TypeError(t)},t.isNumber=function(e,t){if("[object Number]"!==r.call(e))throw TypeError(t)},t.isObject=function(e,t){if("[object Object]"!==r.call(e))throw TypeError(t)},t.isBufferLength=function(e,t,r){if(e.length!==t)throw RangeError(r)},t.isBufferLength2=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},t.isLengthGTZero=function(e,t){if(0===e.length)throw RangeError(t)},t.isNumberInInterval=function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}}).call(this,r("b639").Buffer)},"173c":function(e,t,r){"use strict";(function(t){const n=r("ac9f"),i=r("f106"),s=r("e5af"),o=r("5e57"),a=i(r("437b"));class c{constructor(e){this._key=y(e,o.publicKeyLength)}verify(e,t,r){p(r),o.hashAndVerify(this._key,t,e,r)}marshal(){return t.from(this._key)}get bytes(){return a.PublicKey.encode({Type:a.KeyType.Ed25519,Data:this.marshal()})}equals(e){return this.bytes.equals(e.bytes)}hash(e){p(e),n(this.bytes,"sha2-256",e)}}class u{constructor(e,t){this._key=y(e,o.privateKeyLength),this._publicKey=y(t,o.publicKeyLength)}sign(e,t){p(t),o.hashAndSign(this._key,e,t)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new c(this._publicKey)}marshal(){return t.concat([t.from(this._key),t.from(this._publicKey)])}get bytes(){return a.PrivateKey.encode({Type:a.KeyType.Ed25519,Data:this.marshal()})}equals(e){return this.bytes.equals(e.bytes)}hash(e){p(e),n(this.bytes,"sha2-256",e)}id(e){this.public.hash((t,r)=>{if(t)return e(t);e(null,s.encode(r))})}}function l(e,t){try{e=y(e,o.privateKeyLength+o.publicKeyLength)}catch(i){return t(i)}const r=e.slice(0,o.privateKeyLength),n=e.slice(o.privateKeyLength,e.length);t(null,new u(r,n))}function h(e){return e=y(e,o.publicKeyLength),new c(e)}function f(e,t){void 0===t&&"function"===typeof e&&(t=e),o.generateKey((e,r)=>{if(e)return t(e);let n;try{n=new u(r.secretKey,r.publicKey)}catch(e){return void t(e)}t(null,n)})}function d(e,t,r){void 0===r&&"function"===typeof t&&(r=t),o.generateKeyFromSeed(e,(e,t)=>{if(e)return r(e);let n;try{n=new u(t.secretKey,t.publicKey)}catch(e){return void r(e)}r(null,n)})}function p(e){if("function"!==typeof e)throw new Error("callback is required")}function y(e,r){if(t.isBuffer(e)&&(e=new Uint8Array(e)),!(e instanceof Uint8Array)||e.length!==r)throw new Error("Key must be a Uint8Array or Buffer of length "+r);return e}e.exports={Ed25519PublicKey:c,Ed25519PrivateKey:u,unmarshalEd25519PrivateKey:l,unmarshalEd25519PublicKey:h,generateKeyPair:f,generateKeyPairFromSeed:d}}).call(this,r("b639").Buffer)},1789:function(e,t,r){(function(n){function i(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"===typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function s(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(s=i))})),e.splice(s,0,n)}}function o(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}}function c(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",BASE_URL:"/"}).DEBUG),e}function u(){try{return window.localStorage}catch(e){}}t=e.exports=r("1428"),t.log=o,t.formatArgs=s,t.save=a,t.load=c,t.useColors=i,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(c())}).call(this,r("4362"))},"17b2":function(e,t,r){"use strict";const n=r("cfab"),i={};for(const[s,o]of Object.entries(n))void 0===i[o]&&(i[o]=s);e.exports=Object.freeze(i)},"17c2":function(e,t,r){"use strict";var n=r("b727").forEach,i=r("a640"),s=r("ae40"),o=i("forEach"),a=s("forEach");e.exports=o&&a?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},"17e2":function(e,t,r){var n=r("f4d7"),i=r("4bc2")("socket.io-client:url");function s(e,t){var r=e;t=t||"undefined"!==typeof location&&location,null==e&&(e=t.protocol+"//"+t.host),"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(i("protocol-less url %s",e),e="undefined"!==typeof t?t.protocol+"//"+e:"https://"+e),i("parse %s",e),r=n(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=-1!==r.host.indexOf(":"),o=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port,r.href=r.protocol+"://"+o+(t&&t.port===r.port?"":":"+r.port),r}e.exports=s},"17e5":function(e,t,r){var n=r("4f94");function i(e){if(!(e instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');return s(e)}function s(e,t){for(var r in t=new n(e,t),e){var i=e[r];if(i instanceof Object&&(t.contains(i)||s(i,t)))return!0}return!1}e.exports=i},18:function(e,t){},"180b":function(e,t,r){var n=r("5995");r("c882"),r("80f7"),r("84f3"),r("ce05"),r("71c7"),r("9050"),r("8f53"),r("31a0"),r("5609");var i=n.asn1,s=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,s.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function a(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function c(e){for(var t=[],r=0;r0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),s=0;s=r&&o0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),s.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,s)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var s=t.certificate;"string"===typeof s&&(s=n.pki.certificateFromPem(s)),r=s.issuer.attributes,i=s.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof o&&(o=n.pki.privateKeyFromPem(o));var a=t.digestAlgorithm||n.pki.oids.sha1;switch(a){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,h=0;hn((t,r,n)=>{function i(e,t,r){if(t)return e(t);if(!r)return e(new Error("empty response"));if(0===r.length)return e(new Error("no value returned for key"));if(Array.isArray(r)&&(r=r[0]),5===r.Type)e(null,r.Extra);else{let t=new Error("key was not found (type 6)");e(t)}}"function"!==typeof r||n||(n=r,r={}),"function"===typeof r&&"function"===typeof n&&(n=r,r={}),e({path:"dht/get",args:t,qs:r},i.bind(null,n))})},"186e":function(e,t,r){"use strict";const n=r("720b"),i=r("792d"),s=r("e15f"),o=r("b838"),a=r("8e122"),c={"legacy-ipfs":s,ipfs:o,orbitdb:a},u=e=>{if(!l.isSupported(e))throw new Error(`AccessController type '${e}' is not supported`);return c[e]};class l{static get AccessController(){return n}static isSupported(e){return Object.keys(c).includes(e)}static addAccessController(e){if(!e.AccessController)throw new Error("AccessController class needs to be given as an option");if(!e.AccessController.type||"string"!==typeof e.AccessController.type)throw new Error("Given AccessController class needs to implement: static get type() { /* return a string */}.");c[e.AccessController.type]=e.AccessController}static addAccessControllers(e){const t=e.AccessControllers;if(!t)throw new Error("AccessController classes need to be given as an option");t.forEach(e=>{l.addAccessController({AccessController:e})})}static removeAccessController(e){delete c[e]}static async resolve(e,t,r={}){const{type:n,params:s}=await i.resolve(e._ipfs,t,r),o=u(n),a=await o.create(e,Object.assign({},r,s));return await a.load(s.address),a}static async create(e,t,r={}){const n=u(t),s=await n.create(e,r),o=await s.save(),a=await i.create(e._ipfs,t,o);return a}}e.exports=l},"18ac":function(e,t,r){"use strict";e.exports=i;var n=r("fab2");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r("c3bb")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},19:function(e,t){},1972:function(e,t,r){"use strict";var n=r("e0c5").Buffer,i=r("bce7"),s=r("c627");function o(e,t){null===e&&null===t?(this.x=this.y=null,this.inf=!0):(this.x=e,this.y=t,this.inf=!1)}o.fromPublicKey=function(e){var t,r,n=e[0];return 33!==e.length||2!==n&&3!==n?65!==e.length||4!==n&&6!==n&&7!==n?null:(t=i.fromBuffer(e.slice(1,33)),r=i.fromBuffer(e.slice(33,65)),t.ucmp(i.p)>=0||r.ucmp(i.p)>=0?null:6!==n&&7!==n||r.isOdd()===(7===n)?0!==t.redSqr().redMul(t).redIAdd7().ucmp(r.redSqr())?null:new o(t,r):null):(t=i.fromBuffer(e.slice(1,33)),t.ucmp(i.p)>=0?null:(r=t.redSqr().redMul(t).redIAdd7().redSqrt(),null===r?null:(3===n!==r.isOdd()&&(r=r.redNeg()),new o(t,r))))},o.prototype.toPublicKey=function(e){var t,r=this.x,i=this.y;return e?(t=n.alloc(33),t[0]=i.isOdd()?3:2,r.toBuffer().copy(t,1)):(t=n.alloc(65),t[0]=4,r.toBuffer().copy(t,1),i.toBuffer().copy(t,33)),t},o.fromECJPoint=function(e){if(e.inf)return new o(null,null);var t=e.z.redInvm(),r=t.redSqr(),n=e.x.redMul(r),i=e.y.redMul(r).redMul(t);return new o(n,i)},o.prototype.toECJPoint=function(){return this.inf?new s(null,null,null):new s(this.x,this.y,s.one)},o.prototype.neg=function(){return this.inf?this:new o(this.x,this.y.redNeg())},o.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(0===this.x.ucmp(e.x))return 0===this.y.ucmp(e.y)?this.dbl():new o(null,null);var t=this.y.redSub(e.y);t.isZero()||(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return new o(r,n)},o.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.isZero())return new o(null,null);var t=this.x.redSqr(),r=t.redAdd(t).redIAdd(t).redMul(e.redInvm()),n=r.redSqr().redISub(this.x.redAdd(this.x)),i=r.redMul(this.x.redSub(n)).redISub(this.y);return new o(n,i)},o.prototype.mul=function(e){for(var t=this._getNAFPoints(4),r=t.points,n=e.getNAF(t.wnd),i=new s(null,null,null),a=n.length-1;a>=0;a--){for(var c=0;a>=0&&0===n[a];a--,++c);if(a>=0&&(c+=1),i=i.dblp(c),a<0)break;var u=n[a];i=u>0?i.mixedAdd(r[u-1>>1]):i.mixedAdd(r[-u-1>>1].neg())}return o.fromECJPoint(i)},o.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},o.prototype._getNAFPoints=function(e){var t=new Array((1<{const n=a.createHash(t),i=await n(e);return r?i.slice(0,r):i},a.createHash=function(e){if(!e)throw i("hash algorithm must be specified","ERR_HASH_ALGORITHM_NOT_SPECIFIED");if(e=s.coerceCode(e),!a.functions[e])throw i(`multihash function '${e}' not yet supported`,"ERR_HASH_ALGORITHM_NOT_SUPPORTED");return a.functions[e]},a.functions={17:o.sha1,18:o.sha2256,19:o.sha2512,20:o.sha3512,21:o.sha3384,22:o.sha3256,23:o.sha3224,24:o.shake128,25:o.shake256,26:o.keccak224,27:o.keccak256,28:o.keccak384,29:o.keccak512,34:o.murmur3128,35:o.murmur332,86:o.dblSha2256},o.addBlake(a.functions),a.validate=async(e,t)=>{const r=await a(e,s.decode(t).name);return 0===n.compare(t,r)},e.exports=a},"1a8c":function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},"1aad":function(e,t,r){"use strict";const n=r("9f73"),i=Object.prototype.hasOwnProperty,s=Object.propertyIsEnumerable,o=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),a=this,c={concatArrays:!1},u=e=>{const t=[];for(const r in e)i.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(let n=0;n{o(t,r,l(e[r]))}),t}function f(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return u(e).forEach(r=>{o(t,r,l(e[r]))}),t}const d=(e,t,r,n)=>(r.forEach(r=>{r in e&&e[r]!==Object.getPrototypeOf(e)?o(e,r,y(e[r],t[r],n)):o(e,r,l(t[r]))}),e),p=(e,t,r)=>{let n=e.slice(0,0),s=0;return[e,t].forEach(t=>{const a=[];for(let r=0;r-1===a.indexOf(e)),r)}),n};function y(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?p(e,t,r):n(t)&&n(e)?d(e,t,u(t),r):l(t)}e.exports=function(){const e=y(l(c),this!==a&&this||{},c);let t={foobar:{}};for(let r=0;r{const t=new Array(4);for(let r=0;r<4;r++)t[r]=255&e,e>>=8;return n.from(t)};e.exports={fromNumberTo32BitBuf:i}},"1b2f":function(e,t,r){"use strict";e.exports='\n syntax = "proto2";\n\n package ipfs.pin;\n\n option go_package = "pb";\n\n message Set {\n optional uint32 version = 1;\n optional uint32 fanout = 2;\n optional fixed32 seed = 3;\n }\n'},"1b43":function(e,t,r){var n=r("5995");r("b3d5"),r("31a0");var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||a();var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s>>0,a>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=a[1],a[1]=a[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(s),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var a,u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize,h=l&i.blockLength-1;o.putBytes(s.substr(0,i.blockLength-h));for(var f=8*i.fullMessageLength[0],d=0;d>>0,f+=u,o.putInt32(f>>>0),f=a>>>0;o.putInt32(f);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};c(p,r,o);var y=n.util.createBuffer();return y.putInt32(p.h0),y.putInt32(p.h1),y.putInt32(p.h2),y.putInt32(p.h3),y.putInt32(p.h4),y},i};var s=null,o=!1;function a(){s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),o=!0}function c(e,t,r){var n,i,s,o,a,c,u,l,h=r.length();while(h>=64){for(i=e.h0,s=e.h1,o=e.h2,a=e.h3,c=e.h4,l=0;l<16;++l)n=r.getInt32(),t[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<20;++l)n=t[l-3]^t[l-8]^t[l-14]^t[l-16],n=n<<1|n>>>31,t[l]=n,u=a^s&(o^a),n=(i<<5|i>>>27)+u+c+1518500249+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<32;++l)n=t[l-3]^t[l-8]^t[l-14]^t[l-16],n=n<<1|n>>>31,t[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<40;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+1859775393+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<60;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=s&o|a&(s^o),n=(i<<5|i>>>27)+u+c+2400959708+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;for(;l<80;++l)n=t[l-6]^t[l-16]^t[l-28]^t[l-32],n=n<<2|n>>>30,t[l]=n,u=s^o^a,n=(i<<5|i>>>27)+u+c+3395469782+n,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+o|0,e.h3=e.h3+a|0,e.h4=e.h4+c|0,h-=64}}},"1b69":function(e,t,r){"use strict";const n=r("fa4d"),i=r("33fc");e.exports=function(e){return n((t,r,n)=>{"function"===typeof r&&(n=r,r={}),i(e.pingPullStream(t,r),i.collect(n))})}},"1bb3":function(e,t,r){"use strict";var n=r("8707").Buffer,i=r("98e6"),s=r("e28f"),o=r("f8c1"),a=r("0286"),c=r("eda6"),u=r("8bb0");t.privateKeyVerify=function(e){var t=a.fromBuffer(e);return!(t.isOverflow()||t.isZero())},t.privateKeyExport=function(e,t){var r=a.fromBuffer(e);if(r.isOverflow()||r.isZero())throw new Error(o.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return u.mul(r).toPublicKey(t)},t.privateKeyNegate=function(e){var t=a.fromBuffer(e);return t.isZero()?n.alloc(32):(t.ucmp(a.n)>0&&t.isub(a.n),a.n.sub(t).toBuffer())},t.privateKeyModInverse=function(e){var t=a.fromBuffer(e);if(t.isOverflow()||t.isZero())throw new Error(o.EC_PRIVATE_KEY_RANGE_INVALID);return t.uinvm().toBuffer()},t.privateKeyTweakAdd=function(e,t){var r=a.fromBuffer(t);if(r.isOverflow())throw new Error(o.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(a.fromBuffer(e)),r.isOverflow()&&r.isub(a.n),r.isZero())throw new Error(o.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toBuffer()},t.privateKeyTweakMul=function(e,t){var r=a.fromBuffer(t);if(r.isOverflow()||r.isZero())throw new Error(o.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var n=a.fromBuffer(e);return r.umul(n).ureduce().toBuffer()},t.publicKeyCreate=function(e,t){var r=a.fromBuffer(e);if(r.isOverflow()||r.isZero())throw new Error(o.EC_PUBLIC_KEY_CREATE_FAIL);return u.mul(r).toPublicKey(t)},t.publicKeyConvert=function(e,t){var r=c.fromPublicKey(e);if(null===r)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);return r.toPublicKey(t)},t.publicKeyVerify=function(e){return null!==c.fromPublicKey(e)},t.publicKeyTweakAdd=function(e,t,r){var n=c.fromPublicKey(e);if(null===n)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);if(t=a.fromBuffer(t),t.isOverflow())throw new Error(o.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var i=u.mul(t).add(n);if(i.inf)throw new Error(o.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return i.toPublicKey(r)},t.publicKeyTweakMul=function(e,t,r){var n=c.fromPublicKey(e);if(null===n)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);if(t=a.fromBuffer(t),t.isOverflow()||t.isZero())throw new Error(o.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.mul(t).toPublicKey(r)},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),n=0;n=0)&&0===n.iadd(a.psn).redMul(p).ucmp(d.x)},t.recover=function(e,t,r,i){var s=a.fromBuffer(t.slice(0,32)),l=a.fromBuffer(t.slice(32,64));if(s.isOverflow()||l.isOverflow())throw new Error(o.ECDSA_SIGNATURE_PARSE_FAIL);do{if(s.isZero()||l.isZero())break;var h=s;if(r>>1){if(h.ucmp(a.psn)>=0)break;h=s.add(a.n)}var f=n.concat([n.from([2+(1&r)]),h.toBuffer()]),d=c.fromPublicKey(f);if(null===d)break;var p=s.uinvm(),y=a.n.sub(a.fromBuffer(e)).umul(p).ureduce(),g=l.umul(p).ureduce(),m=c.fromECJPoint(u.mulAdd(y,d,g));return m.toPublicKey(i)}while(0);throw new Error(o.ECDSA_RECOVER_FAIL)},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return i("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var n=c.fromPublicKey(e);if(null===n)throw new Error(o.EC_PUBLIC_KEY_PARSE_FAIL);var i=a.fromBuffer(t);if(i.isOverflow()||i.isZero())throw new Error(o.ECDH_FAIL);return n.mul(i).toPublicKey(r)}},"1c13":function(e,t,r){"use strict";(function(t){const n=r("2612");function i(e){return parseInt(e.toString("hex"),16)}function s(e){let r=e.toString(16);return r.length%2===1&&(r="0"+r),t.from(r,"hex")}function o(e){return t.from(n.encode(i(e)))}function a(e){return s(n.decode(e))}function c(e){return t.from(n.encode(e))}e.exports={numberToBuffer:s,bufferToNumber:i,varintBufferEncode:o,varintBufferDecode:a,varintEncode:c}}).call(this,r("b639").Buffer)},"1c1d":function(e,t){e.exports=function(e,t,r){"use asm";var n=new e.Uint8Array(r);var i=t.pushInt;var s=t.pushInt32;var o=t.pushInt32Neg;var a=t.pushInt64;var c=t.pushInt64Neg;var u=t.pushFloat;var l=t.pushFloatSingle;var h=t.pushFloatDouble;var f=t.pushTrue;var d=t.pushFalse;var p=t.pushUndefined;var y=t.pushNull;var g=t.pushInfinity;var m=t.pushInfinityNeg;var b=t.pushNaN;var v=t.pushNaNNeg;var w=t.pushArrayStart;var _=t.pushArrayStartFixed;var E=t.pushArrayStartFixed32;var S=t.pushArrayStartFixed64;var k=t.pushObjectStart;var C=t.pushObjectStartFixed;var A=t.pushObjectStartFixed32;var I=t.pushObjectStartFixed64;var T=t.pushByteString;var x=t.pushByteStringStart;var B=t.pushUtf8String;var R=t.pushUtf8StringStart;var N=t.pushSimpleUnassigned;var O=t.pushTagStart;var P=t.pushTagStart4;var D=t.pushTagStart8;var L=t.pushTagUnassigned;var M=t.pushBreak;var U=e.Math.pow;var j=0;var K=0;var F=0;function V(e){e=e|0;j=0;K=e;while((j|0)<(K|0)){F=Qe[n[j]&255](n[j]|0)|0;if((F|0)>0){break}}return F|0}function q(e){e=e|0;if(((j|0)+(e|0)|0)<(K|0)){return 0}return 1}function z(e){e=e|0;return n[e|0]<<8|n[e+1|0]|0}function H(e){e=e|0;return n[e|0]<<24|n[e+1|0]<<16|n[e+2|0]<<8|n[e+3|0]|0}function G(e){e=e|0;i(e|0);j=j+1|0;return 0}function $(e){e=e|0;if(q(1)|0){return 1}i(n[j+1|0]|0);j=j+2|0;return 0}function W(e){e=e|0;if(q(2)|0){return 1}i(z(j+1|0)|0);j=j+3|0;return 0}function Y(e){e=e|0;if(q(4)|0){return 1}s(z(j+1|0)|0,z(j+3|0)|0);j=j+5|0;return 0}function Q(e){e=e|0;if(q(8)|0){return 1}a(z(j+1|0)|0,z(j+3|0)|0,z(j+5|0)|0,z(j+7|0)|0);j=j+9|0;return 0}function J(e){e=e|0;i(-1-(e-32|0)|0);j=j+1|0;return 0}function X(e){e=e|0;if(q(1)|0){return 1}i(-1-(n[j+1|0]|0)|0);j=j+2|0;return 0}function Z(e){e=e|0;var t=0;if(q(2)|0){return 1}t=z(j+1|0)|0;i(-1-(t|0)|0);j=j+3|0;return 0}function ee(e){e=e|0;if(q(4)|0){return 1}o(z(j+1|0)|0,z(j+3|0)|0);j=j+5|0;return 0}function te(e){e=e|0;if(q(8)|0){return 1}c(z(j+1|0)|0,z(j+3|0)|0,z(j+5|0)|0,z(j+7|0)|0);j=j+9|0;return 0}function re(e){e=e|0;var t=0;var r=0;var n=0;n=e-64|0;if(q(n|0)|0){return 1}t=j+1|0;r=(j+1|0)+(n|0)|0;T(t|0,r|0);j=r|0;return 0}function ne(e){e=e|0;var t=0;var r=0;var i=0;if(q(1)|0){return 1}i=n[j+1|0]|0;t=j+2|0;r=(j+2|0)+(i|0)|0;if(q(i+1|0)|0){return 1}T(t|0,r|0);j=r|0;return 0}function ie(e){e=e|0;var t=0;var r=0;var n=0;if(q(2)|0){return 1}n=z(j+1|0)|0;t=j+3|0;r=(j+3|0)+(n|0)|0;if(q(n+2|0)|0){return 1}T(t|0,r|0);j=r|0;return 0}function se(e){e=e|0;var t=0;var r=0;var n=0;if(q(4)|0){return 1}n=H(j+1|0)|0;t=j+5|0;r=(j+5|0)+(n|0)|0;if(q(n+4|0)|0){return 1}T(t|0,r|0);j=r|0;return 0}function oe(e){e=e|0;return 1}function ae(e){e=e|0;x();j=j+1|0;return 0}function ce(e){e=e|0;var t=0;var r=0;var n=0;n=e-96|0;if(q(n|0)|0){return 1}t=j+1|0;r=(j+1|0)+(n|0)|0;B(t|0,r|0);j=r|0;return 0}function ue(e){e=e|0;var t=0;var r=0;var i=0;if(q(1)|0){return 1}i=n[j+1|0]|0;t=j+2|0;r=(j+2|0)+(i|0)|0;if(q(i+1|0)|0){return 1}B(t|0,r|0);j=r|0;return 0}function le(e){e=e|0;var t=0;var r=0;var n=0;if(q(2)|0){return 1}n=z(j+1|0)|0;t=j+3|0;r=(j+3|0)+(n|0)|0;if(q(n+2|0)|0){return 1}B(t|0,r|0);j=r|0;return 0}function he(e){e=e|0;var t=0;var r=0;var n=0;if(q(4)|0){return 1}n=H(j+1|0)|0;t=j+5|0;r=(j+5|0)+(n|0)|0;if(q(n+4|0)|0){return 1}B(t|0,r|0);j=r|0;return 0}function fe(e){e=e|0;return 1}function de(e){e=e|0;R();j=j+1|0;return 0}function pe(e){e=e|0;_(e-128|0);j=j+1|0;return 0}function ye(e){e=e|0;if(q(1)|0){return 1}_(n[j+1|0]|0);j=j+2|0;return 0}function ge(e){e=e|0;if(q(2)|0){return 1}_(z(j+1|0)|0);j=j+3|0;return 0}function me(e){e=e|0;if(q(4)|0){return 1}E(z(j+1|0)|0,z(j+3|0)|0);j=j+5|0;return 0}function be(e){e=e|0;if(q(8)|0){return 1}S(z(j+1|0)|0,z(j+3|0)|0,z(j+5|0)|0,z(j+7|0)|0);j=j+9|0;return 0}function ve(e){e=e|0;w();j=j+1|0;return 0}function we(e){e=e|0;var t=0;t=e-160|0;if(q(t|0)|0){return 1}C(t|0);j=j+1|0;return 0}function _e(e){e=e|0;if(q(1)|0){return 1}C(n[j+1|0]|0);j=j+2|0;return 0}function Ee(e){e=e|0;if(q(2)|0){return 1}C(z(j+1|0)|0);j=j+3|0;return 0}function Se(e){e=e|0;if(q(4)|0){return 1}A(z(j+1|0)|0,z(j+3|0)|0);j=j+5|0;return 0}function ke(e){e=e|0;if(q(8)|0){return 1}I(z(j+1|0)|0,z(j+3|0)|0,z(j+5|0)|0,z(j+7|0)|0);j=j+9|0;return 0}function Ce(e){e=e|0;k();j=j+1|0;return 0}function Ae(e){e=e|0;O(e-192|0|0);j=j+1|0;return 0}function Ie(e){e|0;O(e|0);j=j+1|0;return 0}function Te(e){e|0;O(e|0);j=j+1|0;return 0}function xe(e){e|0;O(e|0);j=j+1|0;return 0}function Be(e){e|0;O(e|0);j=j+1|0;return 0}function Re(e){e=e|0;O(e-192|0|0);j=j+1|0;return 0}function Ne(e){e|0;O(e|0);j=j+1|0;return 0}function Oe(e){e|0;O(e|0);j=j+1|0;return 0}function Pe(e){e|0;O(e|0);j=j+1|0;return 0}function De(e){e=e|0;if(q(1)|0){return 1}O(n[j+1|0]|0);j=j+2|0;return 0}function Le(e){e=e|0;if(q(2)|0){return 1}O(z(j+1|0)|0);j=j+3|0;return 0}function Me(e){e=e|0;if(q(4)|0){return 1}P(z(j+1|0)|0,z(j+3|0)|0);j=j+5|0;return 0}function Ue(e){e=e|0;if(q(8)|0){return 1}D(z(j+1|0)|0,z(j+3|0)|0,z(j+5|0)|0,z(j+7|0)|0);j=j+9|0;return 0}function je(e){e=e|0;N((e|0)-224|0);j=j+1|0;return 0}function Ke(e){e=e|0;d();j=j+1|0;return 0}function Fe(e){e=e|0;f();j=j+1|0;return 0}function Ve(e){e=e|0;y();j=j+1|0;return 0}function qe(e){e=e|0;p();j=j+1|0;return 0}function ze(e){e=e|0;if(q(1)|0){return 1}N(n[j+1|0]|0);j=j+2|0;return 0}function He(e){e=e|0;var t=0;var r=0;var i=1.0;var s=0.0;var o=0.0;var a=0.0;if(q(2)|0){return 1}t=n[j+1|0]|0;r=n[j+2|0]|0;if((t|0)&0x80){i=-1.0}s=+(((t|0)&0x7C)>>2);o=+(((t|0)&0x03)<<8|r);if(+s==0.0){u(+(+i*+5.9604644775390625e-8*+o))}else if(+s==31.0){if(+i==1.0){if(+o>0.0){b()}else{g()}}else{if(+o>0.0){v()}else{m()}}}else{u(+(+i*U(+2,+(+s-25.0))*+(1024.0+o)))}j=j+3|0;return 0}function Ge(e){e=e|0;if(q(4)|0){return 1}l(n[j+1|0]|0,n[j+2|0]|0,n[j+3|0]|0,n[j+4|0]|0);j=j+5|0;return 0}function $e(e){e=e|0;if(q(8)|0){return 1}h(n[j+1|0]|0,n[j+2|0]|0,n[j+3|0]|0,n[j+4|0]|0,n[j+5|0]|0,n[j+6|0]|0,n[j+7|0]|0,n[j+8|0]|0);j=j+9|0;return 0}function We(e){e=e|0;return 1}function Ye(e){e=e|0;M();j=j+1|0;return 0}var Qe=[G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,G,$,W,Y,Q,We,We,We,We,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,J,X,Z,ee,te,We,We,We,We,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,re,ne,ie,se,oe,We,We,We,ae,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ce,ue,le,he,fe,We,We,We,de,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,pe,ye,ge,me,be,We,We,We,ve,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,we,_e,Ee,Se,ke,We,We,We,Ce,Ae,Ae,Ae,Ae,Ae,Ae,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,Re,De,Le,Me,Ue,We,We,We,We,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,je,Ke,Fe,Ve,qe,ze,He,Ge,$e,We,We,We,Ye];return{parse:V}}},"1c27":function(e,t,r){"use strict";const n=r("f294"),i=r("faa1").EventEmitter,s=r("4bc2"),o=s("libp2p");o.error=s("libp2p:error");const a=r("000a"),c=r("fa4d"),u=r("88ae"),l=r("0512"),h=r("4a0d"),f=r("9f2e"),d=r("7fa9"),p=r("8911"),y=r("c3f4"),g=r("b126"),m=r("2db6"),b=r("5c2f"),{emitFirst:v}=r("eaa4"),w=r("647f"),_=r("510a"),E=r("76d9"),S=r("9b20"),{getPeerInfoRemote:k}=r("e5e0"),C=r("7268").validate,{codes:A}=r("a41c"),I=(e,t)=>a(new Error(`libp2p cannot ${e} when not started; state is ${t}`),A.ERR_NODE_NOT_STARTED);class T extends i{constructor(e){if(super(),this._options=C(e),this.datastore=this._options.datastore,this.peerInfo=this._options.peerInfo,this.peerBook=this._options.peerBook||new d,this._modules=this._options.modules,this._config=this._options.config,this._transport=[],this._discovery=[],this._switch=new y(this.peerInfo,this.peerBook,this._options.switch),this._switch.on("error",(...e)=>this.emit("error",...e)),this.stats=this._switch.stats,this.connectionManager=new b(this,this._options.connectionManager),this._modules.streamMuxer){const e=this._modules.streamMuxer;e.forEach(e=>this._switch.connection.addStreamMuxer(e)),this._switch.connection.reuse(),this._switch.connection.enableCircuitRelay(this._config.relay),this._switch.on("peer-mux-established",e=>{this.emit("peer:connect",e)}),this._switch.on("peer-mux-closed",e=>{this.emit("peer:disconnect",e)})}if(this._switch.on("connection:start",e=>{this.emit("connection:start",e)}),this._switch.on("connection:end",e=>{this.emit("connection:end",e)}),this._modules.connEncryption){const e=this._modules.connEncryption;e.forEach(e=>{this._switch.connection.crypto(e.tag,e.encrypt)})}if(this._modules.connProtector)this._switch.protector=this._modules.connProtector;else if(Object({NODE_ENV:"production",BASE_URL:"/"}).LIBP2P_FORCE_PNET)throw new Error("Private network is enforced, but no protector was provided");if(this._config.dht.enabled){const e=this._modules.dht;this._dht=new e(this._switch,{datastore:this.datastore,...this._config.dht})}this._modules.pubsub&&!1!==this._config.pubsub.enabled&&(this.pubsub=S(this,this._modules.pubsub,this._config.pubsub)),this.peerRouting=w(this),this.contentRouting=_(this),this.dht=E(this),g.mount(this._switch),this.state=new n("STOPPED",{STOPPED:{start:"STARTING",stop:"STOPPED"},STARTING:{done:"STARTED",abort:"STOPPED",stop:"STOPPING"},STARTED:{stop:"STOPPING",start:"STARTED"},STOPPING:{stop:"STOPPING",done:"STOPPED"}}),this.state.on("STARTING",()=>{o("libp2p is starting"),this._onStarting()}),this.state.on("STOPPING",()=>{o("libp2p is stopping"),this._onStopping()}),this.state.on("STARTED",()=>{o("libp2p has started"),this.emit("start")}),this.state.on("STOPPED",()=>{o("libp2p has stopped"),this.emit("stop")}),this.state.on("error",e=>{o.error(e),this.emit("error",e)}),this.state.on("STARTED",()=>{this.peerBook.getAllArray().forEach(e=>{this.emit("peer:discovery",e),this._maybeConnect(e)})}),this._peerDiscovered=this._peerDiscovered.bind(this),["start","stop","dial","dialProtocol","dialFSM","hangUp","ping"].forEach(e=>{this[e]=c(this[e],{context:this})})}emit(e,...t){"error"!==e||this._events.error?super.emit(e,...t):o.error(...t)}start(e=(()=>{})){v(this,["error","start"],e),this.state("start")}stop(e=(()=>{})){v(this,["error","stop"],e),this.state("stop")}isStarted(){return!!this.state&&"STARTED"===this.state._state}dial(e,t){this.dialProtocol(e,null,t)}dialProtocol(e,t,r){if(!this.isStarted())return r(I("dial",this.state._state));"function"===typeof t&&(r=t,t=void 0),k(e,this).then(e=>{this._switch.dial(e,t,r)},r)}dialFSM(e,t,r){if(!this.isStarted())return r(I("dial",this.state._state));"function"===typeof t&&(r=t,t=void 0),k(e,this).then(e=>{this._switch.dialFSM(e,t,r)},r)}hangUp(e,t){k(e,this).then(e=>{this._switch.hangUp(e,t)},t)}ping(e,t){if(!this.isStarted())return t(I("ping",this.state._state));k(e,this).then(e=>{t(null,new g(this._switch,e))},t)}handle(e,t,r){this._switch.handle(e,t,r)}unhandle(e){this._switch.unhandle(e)}_onStarting(){if(!this._modules.transport)return this.emit("error",new Error("no transports were present")),this.state("abort");let e;const t=[],r=[];this.peerInfo.multiaddrs.toArray().forEach(e=>{e.getPeerId()||(t.push(e),r.push(e.encapsulate("/p2p/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(t,r);const n=this.peerInfo.multiaddrs.toArray();this._modules.transport.forEach(t=>{let r;r="function"===typeof t?new t({libp2p:this}):t,r.filter(n).length>0?this._switch.transport.add(r.tag||r[Symbol.toStringTag],r):m.isWebSockets(r)&&(e=r),this._transport.push(r)}),l([e=>{this.connectionManager.start(),this._switch.start(e)},t=>{e&&this._switch.transport.add(e.tag||e.constructor.name,e);const r=this.peerInfo.multiaddrs.toArray();r.forEach(e=>{e.toString().match(/\/p2p-circuit($|\/)/)||this._transport.find(t=>t.filter(e).length>0)||this.peerInfo.multiaddrs.delete(e)}),t()},e=>{this._dht?this._dht.start(()=>{this._dht.on("peer",this._peerDiscovered),e()}):e()},e=>{if(this.pubsub)return this.pubsub.start(e);e()},e=>{this._modules.peerDiscovery?this._setupPeerDiscovery(e):e()}],e=>{if(e)return o.error(e),this.emit("error",e),this.state("stop");this.state("done")})}_onStopping(){l([e=>{h(this._discovery.map(e=>(e.removeListener("peer",this._peerDiscovered),t=>e.stop(e=>{o.error("an error occurred stopping the discovery service",e),t()}))),e)},e=>{if(this.pubsub)return this.pubsub.stop(e);e()},e=>{if(this._dht)return this._dht.removeListener("peer",this._peerDiscovered),this._dht.stop(e);e()},e=>{this.connectionManager.stop(),this._switch.stop(e)},e=>{this._switch.transport.removeAll(()=>e())}],e=>{e&&(o.error(e),this.emit("error",e)),this.state("done")})}_peerDiscovered(e){e.id.toB58String()!==this.peerInfo.id.toB58String()?(e=this.peerBook.put(e),this.isStarted()&&(this.emit("peer:discovery",e),this._maybeConnect(e))):o.error(new Error(A.ERR_DISCOVERED_SELF))}_maybeConnect(e){if(!0===this._config.peerDiscovery.autoDial&&!e.isConnected()){const t=this._options.connectionManager.minPeers||0;t>Object.keys(this._switch.connection.connections).length&&(o("connecting to discovered peer"),this._switch.dialer.connect(e,e=>{e&&o.error("could not connect to discovered peer",e)}))}}_setupPeerDiscovery(e){for(const t of this._modules.peerDiscovery){let e={enabled:!0};if(t.tag&&this._config.peerDiscovery&&this._config.peerDiscovery[t.tag]&&(e={...e,...this._config.peerDiscovery[t.tag]}),e.enabled){let r;r="function"===typeof t?new t(Object.assign({},e,{peerInfo:this.peerInfo})):t,r.on("peer",this._peerDiscovered),this._discovery.push(r)}}u(this._discovery,(e,t)=>{e.start(t)},e)}}e.exports=T,e.exports.createLibp2p=c((e,t)=>{if(e.peerInfo)return f(t,null,new T(e));p.create((r,n)=>{if(r)return t(r);e.peerInfo=n,t(null,new T(e))})})},"1c7ef":function(e,t,r){"use strict";(function(n){const i=r("334b"),{cid:s,serialize:o}=r("bda9");function a(e){let t;return e.Data&&e.Data.length>0?(t=n.alloc(e.Data.length),e.Data.copy(t)):t=n.alloc(0),t}function c(e){return e.Links.slice()}function u(e,t){return n.compare(e.nameAsBuffer,t.nameAsBuffer)}t=e.exports;const l=async(e,t={})=>{const r=o(e),n=await s(r);return new i(t.name||"",r.length,n)};t.cloneData=a,t.cloneLinks=c,t.linkSort=u,t.toDAGLink=l}).call(this,r("b639").Buffer)},"1c9b":function(e,t,r){"use strict";(function(t){function r(e,r){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(r?r(e):!e||this._writableState&&this._writableState.errorEmitted||t.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!r&&e?(t.nextTick(n,s,e),s._writableState&&(s._writableState.errorEmitted=!0)):r?(t.nextTick(i,s),r(e)):t.nextTick(i,s)})),this)}function n(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}e.exports={destroy:r,undestroy:s}}).call(this,r("4362"))},"1cd4":function(e,t,r){"use strict";const n=r("334b");function i(e){return new n(e.Name||e.name||"",e.Tsize||e.Size||e.size||0,e.Hash||e.hash||e.multihash||e.cid)}t=e.exports,t.createDagLinkFromB58EncodedHash=i},"1d74":function(e,t,r){"use strict";(function(t){const n=r("9efb");function i(e){return parseInt(e.toString("hex"),16)}function s(e){let r=e.toString(16);return r.length%2===1&&(r="0"+r),t.from(r,"hex")}function o(e){return t.from(n.encode(i(e)))}function a(e){return s(n.decode(e))}e.exports={numberToBuffer:s,bufferToNumber:i,varintBufferEncode:o,varintBufferDecode:a}}).call(this,r("b639").Buffer)},"1d81":function(e,t,r){"use strict";var n,i,s=r("4ea4"),o=s(r("a34a")),a=s(r("c973")),c=s(r("970b")),u=s(r("5bc3")),l=s(r("6b58")),h=s(r("36c6")),f=s(r("3c96")),d=s(r("ed6d")),p=r("8ded"),y=r("cde5"),g=r("972c"),m=r("84b5"),b=m.createLink,v=m.validateLink,w=r("9211"),_=r("b42c"),E=r("ebfe"),S=r("f87d"),k=r("b535"),C=r("8400"),A=r("aaed"),I=r("dd35"),T=r("b3ec"),x=r("bc13"),B=r("888a"),R=r("5eec"),N=r("a886"),O=T.pinning_node,P=T.address_server_url,D=T.ipfs_options,L=function(e){function t(e,r){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,c["default"])(this,t),n=(0,l["default"])(this,(0,h["default"])(t).call(this)),n._provider=e,n._ipfs=r,g(n._ipfs,{pin:!0}),n._serverUrl=i.addressServer||P,n["public"]=null,n["private"]=null,n.verified=new k((0,f["default"])(n)),n.spaces={},n.syncDone=null,n.hasPublishedLink={},n}return(0,d["default"])(t,e),(0,u["default"])(t,[{key:"_init",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,_.create(this._ipfs,t);case 2:this.replicator=e.sent;case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_load",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r,n,i,s,a,c,u,l=this,h=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,this._3id.getAddress();case 3:if(r=e.sent,!r){e.next=10;break}return e.next=7,this._getLinkedData(r);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0={};case 11:if(n=e.t0,i=n.rootStoreAddress,s=n.did,!i){e.next=26;break}return e.next=17,this.replicator.start(i,s,{profile:!0});case 17:return e.next=19,this.replicator.rootstoreSyncDone;case 19:return e.next=21,this.replicator.getAuthData();case 21:return a=e.sent,e.next=24,this._3id.authenticate(t.spaces,{authData:a});case 24:e.next=35;break;case 26:return e.next=28,this._3id.authenticate(t.spaces);case 28:return c=this._3id.muportFingerprint+".root",e.next=31,this._3id.getPublicKeys(null,!0);case 31:return u=e.sent.signingKey,e.next=34,this.replicator["new"](c,u,this._3id.DID);case 34:this._publishRootStore(this.replicator.rootstore.address.toString());case 35:return e.t1=this.replicator.rootstore,e.next=38,this._3id.getOdbId();case 38:return e.t2=e.sent,e.t1.setIdentity.call(e.t1,e.t2),this.syncDone=this.replicator.syncDone,this._3id.events.on("new-auth-method",(function(e){l._writeRootstoreEntry(_.entryTypes.AUTH_DATA,e)})),this._3id.events.on("new-link-proof",(function(e){l._writeAddressLink(e)})),this._3id.startUpdatePolling(),this["public"]=new E(this._3id.muportFingerprint+".public",this._linkProfile.bind(this),this.replicator,this._3id),this["private"]=new S(this._3id.muportFingerprint+".private",this.replicator,this._3id),e.next=48,this["public"]._load();case 48:return e.next=50,this["private"]._load();case 50:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"auth",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r,n=this,i=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:[],r=i.length>1&&void 0!==i[1]?i[1]:{},this._3id){e.next=12;break}if(this._provider.is3idProvider||r.address){e.next=5;break}throw new Error("auth: address needed when 3ID provider is not used");case 5:return e.next=7,w.getIdFromEthAddress(r.address,this._provider,this._ipfs,this.replicator._orbitdb.keystore,r);case 7:return this._3id=e.sent,e.next=10,this._load(Object.assign(r,{spaces:t}));case 10:e.next=14;break;case 12:return e.next=14,this._3id.authenticate(t);case 14:return e.next=16,Promise.all(t.map(function(){var e=(0,a["default"])(o["default"].mark((function e(t){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!n.spaces[t]){e.next=3;break}return e.next=3,n.spaces[t]._authThreads(n._3id);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"openSpace",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r,n=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]?n[1]:{},!t.includes(".")){e.next=3;break}throw new Error('Invalid name: character "." not allowed');case 3:if(this._3id){e.next=5;break}throw new Error("openSpace: auth required");case 5:if(this.spaces[t]||(this.spaces[t]=new C(t,this.replicator)),this.spaces[t].isOpen){e.next=26;break}return e.prev=7,e.next=10,this.spaces[t].open(this._3id,r);case 10:return e.next=12,this.isAddressLinked();case 12:if(e.sent){e.next=14;break}this.linkAddress();case 14:e.next=24;break;case 16:if(e.prev=16,e.t0=e["catch"](7),delete this.spaces[t],!e.t0.message.includes("User denied message signature.")){e.next=23;break}throw new Error("User denied space consent.");case 23:throw new Error("An error occured while opening space: ",e.t0.message);case 24:e.next=27;break;case 26:r.onSyncDone&&r.onSyncDone();case 27:return e.abrupt("return",this.spaces[t]);case 28:case"end":return e.stop()}}),e,this,[[7,16]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"openThread",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t,r,n){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.spaces[t]||(this.spaces[t]=new C(t,this.replicator)),e.abrupt("return",this.spaces[t].joinThread(r,n));case 2:case"end":return e.stop()}}),e,this)})));function t(t,r,n){return e.apply(this,arguments)}return t}()},{key:"onSyncDone",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.syncDone;case 2:t();case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_publishRootStore",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r,n,i=this;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._3id.signJWT({rootStoreAddress:t});case 2:return r=e.sent,n=function(){var e=(0,a["default"])(o["default"].mark((function e(t){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A.fetchJson(i._serverUrl+"/odbAddress",{address_token:t});case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e["catch"](0),"Invalid JWT"!==e.t0.message){e.next=12;break}return e.next=10,new Promise((function(e){return setTimeout(e,300)}));case 10:return e.next=12,n(t);case 12:if(e.t0.statusCode){e.next=14;break}throw new Error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),e.next=6,n(r);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_getLinkedData",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r,n,i;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A.fetchJson("".concat(this._serverUrl,"/odbAddress/").concat(t));case 3:return r=e.sent.data,n=r.rootStoreAddress,i=r.did,e.abrupt("return",{rootStoreAddress:n,did:i});case 9:if(e.prev=9,e.t0=e["catch"](0),404!==e.t0.statusCode){e.next=13;break}return e.abrupt("return",{});case 13:throw new Error("Error while getting rootstore",e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"linkAddress",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},this._3id){e.next=3;break}throw new Error("linkAddress: auth required");case 3:if(!t.proof){e.next=8;break}return e.next=6,this._writeAddressLink(t.proof);case 6:e.next=10;break;case 8:return e.next=10,this._linkProfile();case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"removeAddressLink",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r,n,i,s;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._3id){e.next=2;break}throw new Error("removeAddressLink: auth required");case 2:return t=t.toLowerCase(),e.next=5,this.isAddressLinked({address:t});case 5:if(r=e.sent,r){e.next=8;break}throw new Error("removeAddressLink: link for given address does not exist");case 8:return n={address:t,type:"delete-address-link"},i=3600,e.next=12,this._3id.signJWT(n,{expiresIn:i});case 12:return s=e.sent,e.prev=13,e.next=16,A.fetchJson(this._serverUrl+"/linkdelete",{delete_token:s});case 16:e.next=22;break;case 18:if(e.prev=18,e.t0=e["catch"](13),e.t0.statusCode){e.next=22;break}throw new Error(e.t0);case 22:return e.next=24,this._deleteAddressLink(t);case 24:return e.abrupt("return",!0);case 25:case"end":return e.stop()}}),e,this,[[13,18]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"isAddressLinked",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r,n,i=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:{},this._3id){e.next=3;break}throw new Error("isAddressLinked: auth required");case 3:return t.address&&(t.address=t.address.toLowerCase()),e.next=6,this._readAddressLinks();case 6:return r=e.sent,n=r.find((function(e){var r=!t.address||e.address.toLowerCase()===t.address;return t.type?r&&e.type===t.type:r})),e.abrupt("return",Boolean(n));case 9:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"listAddressLinks",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._3id){e.next=2;break}throw new Error("listAddressLinks: auth required");case 2:return e.next=4,this._readAddressLinks();case 4:return t=e.sent,e.abrupt("return",t.reduce((function(e,t){var r=Object.assign({},t);return r.linkId=r.entry.hash,delete r.entry,e.push(r),e}),[]));case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_writeAddressLink",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,v(t);case 2:if(r=e.sent,r){e.next=5;break}throw new Error("tried to write invalid link proof",t);case 5:return e.next=7,this.isAddressLinked({address:r.address});case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:return e.next=11,this._writeRootstoreEntry(_.entryTypes.ADDRESS_LINK,t);case 11:return e.next=13,A.fetchJson(this._serverUrl+"/link",t);case 13:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_linkProfile",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r,n,i,s;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._3id.getAddress();case 2:return t=e.sent,e.next=5,this._readAddressLink(t);case 5:if(r=e.sent,r){e.next=27;break}if(this._provider.is3idProvider){e.next=25;break}return e.prev=8,e.next=11,b(this._3id.DID,t,this._provider);case 11:r=e.sent,e.next=17;break;case 14:throw e.prev=14,e.t0=e["catch"](8),new Error("Link consent message must be signed before adding data, to link address to store",e.t0);case 17:return e.prev=17,e.next=20,this._writeAddressLink(r);case 20:e.next=25;break;case 22:throw e.prev=22,e.t1=e["catch"](17),new Error("An error occured while publishing link:",e.t1);case 25:e.next=37;break;case 27:if(this.hasPublishedLink[r.signature]){e.next=37;break}return this.hasPublishedLink[r.signature]=!0,e.prev=29,e.next=32,A.fetchJson(this._serverUrl+"/link",r);case 32:e.next=37;break;case 34:throw e.prev=34,e.t2=e["catch"](29),new Error("An error occured while publishing link:",e.t2);case 37:return e.next=39,this["public"].get("proof_did");case 39:if(n=e.sent,!n){e.next=53;break}if(i=N.decodeJWT(n).payload.iss,!i.includes("muport")){e.next=51;break}return s={muport:n},e.t3=this["public"],e.next=47,this._3id.signJWT(s);case 47:return e.t4=e.sent,e.t5={noLink:!0},e.next=51,e.t3.set.call(e.t3,"proof_did",e.t4,e.t5);case 51:e.next=60;break;case 53:return e.t6=this["public"],e.next=56,this._3id.signJWT();case 56:return e.t7=e.sent,e.t8={noLink:!0},e.next=60,e.t6.set.call(e.t6,"proof_did",e.t7,e.t8);case 60:case"end":return e.stop()}}),e,this,[[8,14],[17,22],[29,34]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"_writeRootstoreEntry",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t,r){var n,i,s,c,u=this;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._ipfs.dag.put(r);case 2:return n=e.sent.toBaseEncodedString(),e.next=5,this._ipfs.pin.add(n);case 5:return e.next=7,this._typeCIDExists(t,n);case 7:if(i=e.sent,!i){e.next=10;break}return e.abrupt("return");case 10:s={type:t,data:n},c=this._rootstoreQueue,this._rootstoreQueue=(0,a["default"])(o["default"].mark((function e(){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!c){e.next=3;break}return e.next=3,c;case 3:return e.next=5,u.replicator.rootstore.add(s);case 5:case"end":return e.stop()}}),e)})))();case 13:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"_typeCIDExists",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t,r){var n,i;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.replicator.rootstore.iterator({limit:-1}).collect();case 2:return n=e.sent,i=n.filter((function(e){return e.payload.value.type===t})),e.abrupt("return",Boolean(i.find((function(e){return e.data===r}))));case 5:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"_deleteAddressLink",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=t.toLowerCase(),e.next=3,this._readAddressLink(t);case 3:if(r=e.sent,r){e.next=6;break}throw new Error("_deleteAddressLink: link for given address does not exist");case 6:return e.abrupt("return",this.replicator.rootstore.remove(r.entry.hash));case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_readAddressLinks",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.replicator.getAddressLinks();case 2:return t=e.sent,e.next=5,Promise.all(t.map(v));case 5:return r=e.sent,e.abrupt("return",r.filter(Boolean));case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_readAddressLink",value:function(){var e=(0,a["default"])(o["default"].mark((function e(t){var r;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=t.toLowerCase(),e.next=3,this._readAddressLinks();case 3:return r=e.sent,e.abrupt("return",r.find((function(e){return e.address.toLowerCase()===t})));case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"close",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._3id){e.next=2;break}throw new Error("close: auth required");case 2:return e.next=4,this.replicator.stop();case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"logout",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._3id){e.next=2;break}throw new Error("logout: auth required");case 2:return e.next=4,this.close();case 4:return this._3id.logout(),e.next=7,this._3id.getAddress();case 7:t=e.sent,p.remove("linkConsent_"+t);case 9:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"DID",get:function(){if(!this._3id)throw new Error("DID: auth required");return this._3id.DID}}],[{key:"create",value:function(){var e=(0,a["default"])(o["default"].mark((function e(r){var n,i,s,a=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,t.getIPFS(n);case 3:return i=e.sent,s=new t(r,i,n),e.next=7,s._init(n);case 7:return e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)})));function r(t){return e.apply(this,arguments)}return r}()},{key:"openBox",value:function(){var e=(0,a["default"])(o["default"].mark((function e(r,n){var i,s,a=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=a.length>2&&void 0!==a[2]?a[2]:{},i=Object.assign(i,{address:r}),e.next=4,t.create(n,i);case 4:return s=e.sent,e.next=7,s.auth([],i);case 7:return e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)})));function r(t,r){return e.apply(this,arguments)}return r}()},{key:"isLoggedIn",value:function(e){return w.isLoggedIn(e)}},{key:"getIPFS",value:function(){var e=(0,a["default"])(o["default"].mark((function e(){var t,r,s,a=arguments;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},"undefined"!==typeof window&&(n=window.globalIPFS,i=window.globalIPFSPromise),n||i||(i=U(t.ipfs,t.iframeStore,t.ipfsOptions)),"undefined"!==typeof window&&(window.globalIPFSPromise=i),n){e.next=8;break}return e.next=7,i;case 7:n=e.sent;case 8:return"undefined"!==typeof window&&(window.globalIPFS=n),r=n,s=t.pinningNode||O,r.swarm.connect(s,(function(){})),e.abrupt("return",r);case 13:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()}]),t}(x);function M(){var e,t={};if("undefined"!==typeof window&&window.indexedDB){var r=A.randInt(1e4);e="ipfs/root/"+r;var n=new R(e);t={storageBackends:{root:function(){return n}}}}var i=new B("ipfs",t);return{repo:i,rootPath:e}}function U(e,t,r){return j.apply(this,arguments)}function j(){return j=(0,a["default"])(o["default"].mark((function e(t,r,n){var i;return o["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t&&r&&console.warn("Warning: iframeStore true, orbit db cache in iframe, but the given ipfs object is being used, and may not be running in same iframe."),!t){e.next=5;break}return e.abrupt("return",t);case 5:return n||(i=M(),n=Object.assign(D,{repo:i.repo})),e.next=8,y.create(n);case 8:return t=e.sent,i&&"undefined"!==typeof window&&window.indexedDB&&window.indexedDB.deleteDatabase(i.rootPath),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}L.idUtils=I,e.exports=L},"1d86":function(e,t,r){(function(n){r("33fc");var i=r("a761");function s(e){e.destroy?e.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function o(e,t,r){var o,a,c=!1;function u(){a||(a=!0,r&&r(!0===o?null:o))}function l(){c||(c=!0,f(),o?u():e(o=!0,u))}function h(t){f(),o||e(o=t,u)}function f(){t.on("finish",l),t.removeListener("close",l),t.removeListener("error",h)}t.on("close",l),t.on("finish",l),t.on("error",h),n.nextTick((function(){i((function(r){e(null,(function(e,n){if(o=o||e,!0===e)return t._isStdio?u():t.end();if(o=o||e)return s(t),u(o);if(t._isStdio)t.write(n,(function(){r()}));else{var i=t.write(n);!1===i?t.once("drain",r):r()}}))}))}))}function a(e){var t,r=!1,n=!1;function i(){var r=e.read();if(null!==r&&t){var n=t;t=null,n(null,r)}}return e.on("readable",(function(){n=!0,t&&i()})).on("end",(function(){r=!0,t&&t(r)})).on("error",(function(e){r=e,t&&t(r)})),function(e,s){t=s,r?s(r):n&&i()}}function c(e){var t,r=[],n=[],i=!1;function o(){while((r.length||t)&&n.length)n.shift()(r.length?null:t,r.shift());!r.length&&i&&(i=!1,e.resume())}return e.on("data",(function(t){r.push(t),o(),r.length&&e.pause&&(i=!0,e.pause())})),e.on("end",(function(){t=!0,o()})),e.on("close",(function(){t=!0,o()})),e.on("error",(function(e){t=e,o()})),function(r,i){if(!i)throw new Error("*must* provide cb");if(r){function a(){while(n.length)n.shift()(r);i(r)}if(t)return a();e.once("close",a),s(e)}else n.push(i),o()}}var u=c,l=function(e,t){return function(r){return o(r,e,t)}},h=function(e){return c(e)};t=e.exports=function(e,t){return e.writable&&e.write?e.readable?function(r){return o(r,e,t),c(e)}:l(e,t):h(e)},t.sink=l,t.source=h,t.read=u,t.read1=c,t.read2=a,t.duplex=function(e,t){return{source:h(e),sink:l(e,t)}},t.transform=function(e){return function(t){var r=h(e);return l(e)(t),r}}}).call(this,r("4362"))},"1dc7":function(e,t,r){"use strict";function n(e,t,r){var n,i=e instanceof Error?e:new Error(e);if("object"===typeof t?r=t:null!=t&&(i.code=t),r)for(n in r)i[n]=r[n];return i}e.exports=n},"1dde":function(e,t,r){var n=r("d039"),i=r("b622"),s=r("2d00"),o=i("species");e.exports=function(e){return s>=51||!n((function(){var t=[],r=t.constructor={};return r[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},"1df2":function(e,t,r){"use strict";const n=r("6e64"),i=n.ShardingDatastore,s=r("1a18"),o=r("e3d5"),a=r("5345"),{cidToKey:c}=r("aee5");function u(e,t){if(t.sharding){const t=new n.shard.NextToLast(2);return i.createOrOpen(e,t)}return e}function l(e){return{async*query(t){for await(const r of e.query(t))yield r},async get(t){if(!o.isCID(t))throw a(new Error("Not a valid cid"),"ERR_INVALID_CID");const r=c(t);let n;try{return n=await e.get(r),new s(n,t)}catch(i){if("ERR_NOT_FOUND"===i.code){const n=h(t);if(!n)throw i;const o=c(n),a=await e.get(o);return await e.put(r,a),new s(a,t)}throw i}},async put(t){if(!s.isBlock(t))throw new Error("invalid block");const r=c(t.cid),n=await e.has(r);if(!n)return e.put(r,t.data)},async putMany(t){const r=e.batch();for await(const n of t){const t=c(n.cid);await e.has(t)||r.put(t,n.data)}return r.commit()},async has(t){if(!o.isCID(t))throw a(new Error("Not a valid cid"),"ERR_INVALID_CID");const r=await e.has(c(t));if(r)return r;const n=h(t);return!!n&&e.has(c(n))},async delete(t){if(!o.isCID(t))throw a(new Error("Not a valid cid"),"ERR_INVALID_CID");return e.delete(c(t))},async close(){return e.close()}}}function h(e){try{return 0===e.version?e.toV1():e.toV0()}catch(t){return null}}e.exports=async(e,t)=>{const r=await u(e,t);return l(r)}},"1e35":function(e,t,r){"use strict";e.exports=function(){return Date.now()}},"1e6d":function(e,t,r){var n=r("9efb");t.encode=function e(t,r,i){t=t>=0?2*t:-2*t-1;var s=n.encode(t,r,i);return e.bytes=n.encode.bytes,s},t.decode=function e(t,r){var i=n.decode(t,r);return e.bytes=n.decode.bytes,1&i?(i+1)/-2:i/2},t.encodingLength=function(e){return n.encodingLength(e>=0?2*e:-2*e-1)}},"1e83":function(e,t,r){"use strict";function n(e){if("number"===typeof e){if(n.codes[e])return n.codes[e];throw new Error("no protocol with code: "+e)}if("string"===typeof e||e instanceof String){if(n.names[e])return n.names[e];throw new Error("no protocol with name: "+e)}throw new Error("invalid protocol id type: "+e)}const i=-1;function s(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}n.lengthPrefixedVarSize=i,n.V=i,n.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,i,"ip6zone"],[53,i,"dns","resolvable"],[54,i,"dns4","resolvable"],[55,i,"dns6","resolvable"],[56,i,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,i,"unix",!1,"path"],[421,i,"p2p"],[421,i,"ipfs"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,i,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"]],n.names={},n.codes={},n.table.map(e=>{const t=s.apply(null,e);n.codes[t.code]=t,n.names[t.name]=t}),n.object=s,e.exports=n},"1ea5":function(e,t,r){"use strict";(function(t){const n=r("24f8"),i=r("b383"),s=r("f032"),o=r("0398"),a=r("82bd");
+/**
+ * @class CoinGecko
+ * @author Mark Miscavage
+ * @description A Node.js wrapper for the CoinGecko API with no dependencies. For more information, visit: https://www.coingecko.com/api/docs/v3
+ * @example
+ * const CoinGecko = require('coingecko-api');
+ * const CoinGeckoClient = new CoinGecko();
+ * @public
+ * @version 1.0.10
+ * @license MIT
+ * @kind class
+ */
+class c{ping(){const e="/ping";return this._request(e)}global(){const e="/global";return this._request(e)}get coins(){const e="coins";return{all:(t={})=>{const r=`/${e}`;return this._request(r,t)},list:()=>{const t=`/${e}/list`;return this._request(t)},markets:(t={})=>{const r=`/${e}/markets`;return s.isObject(t)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(t["vs_currency"])&&!s.isStringEmpty(t["vs_currency"])||(t.vs_currency="usd"),s.isArray(t["ids"])&&(t.ids=t.ids.join(",")),this._request(r,t)},fetch:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters.");const n=`/${e}/${t}`;return this._request(n,r)},fetchTickers:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters."),s.isArray(r["exchange_ids"])&&(r.exchange_ids=r.exchange_ids.join(","));const n=`/${e}/${t}/tickers`;return this._request(n,r)},fetchHistory:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters."),s.isObject(r)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(r["date"])&&!s.isStringEmpty(r["date"])||s._WARN_("Missing parameter","params must include `date` and be a string in format: `dd-mm-yyyy`");const n=`/${e}/${t}/history`;return this._request(n,r)},fetchMarketChart:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters."),s.isObject(r)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(r["vs_currency"])&&!s.isStringEmpty(r["vs_currency"])||(r.vs_currency="usd"),void 0==r["days"]&&(r.days=1);const n=`/${e}/${t}/market_chart`;return this._request(n,r)},fetchMarketChartRange:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters."),s.isObject(r)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(r["vs_currency"])&&!s.isStringEmpty(r["vs_currency"])||(r.vs_currency="usd"),s.isNumber(r["from"])||s._WARN_("Missing parameter","params must include `from` and be a UNIX timestamp."),s.isNumber(r["to"])||s._WARN_("Missing parameter","params must include `to` and be a UNIX timestamp.");const n=`/${e}/${t}/market_chart/range`;return this._request(n,r)},fetchStatusUpdates:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","coinId must be of type: String and greater than 0 characters.");const n=`/${e}/${t}/status_updates`;return this._request(n,r)},fetchCoinContractInfo:(t,r="ethereum")=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","contractAddress must be of type: String and greater than 0 characters."),s.isString(r)&&!s.isStringEmpty(r)||s._WARN_("Invalid parameter","assetPlatform must be of type: String and greater than 0 characters.");const n=`/${e}/${r}/contract/${t}`;return this._request(n)},fetchCoinContractMarketChart:(t,r="ethereum",n={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","contractAddress must be of type: String and greater than 0 characters."),s.isString(r)&&!s.isStringEmpty(r)||s._WARN_("Invalid parameter","assetPlatform must be of type: String and greater than 0 characters."),s.isObject(n)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(n["vs_currency"])&&!s.isStringEmpty(n["vs_currency"])||(n.vs_currency="usd"),void 0==n["days"]&&(n.days=1);const i=`/${e}/${r}/contract/${t}/market_chart`;return this._request(i,n)},fetchCoinContractMarketChartRange:(t,r="ethereum",n={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","contractAddress must be of type: String and greater than 0 characters."),s.isString(r)&&!s.isStringEmpty(r)||s._WARN_("Invalid parameter","assetPlatform must be of type: String and greater than 0 characters."),s.isObject(n)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(n["vs_currency"])&&!s.isStringEmpty(n["vs_currency"])||(n.vs_currency="usd"),void 0==n["days"]&&(n.days=1);const i=`/${e}/${r}/contract/${t}/market_chart/range`;return this._request(i,n)}}}get exchanges(){const e="exchanges";return{all:()=>{const t=`/${e}`;return this._request(t)},list:()=>{const t=`/${e}/list`;return this._request(t)},fetch:t=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","exchangeId must be of type: String and greater than 0 characters.");const r=`/${e}/${t}`;return this._request(r)},fetchTickers:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","exchangeId must be of type: String and greater than 0 characters."),s.isArray(r["coin_ids"])&&(r.coin_ids=r.coin_ids.join(","));const n=`/${e}/${t}/tickers`;return this._request(n,r)},fetchStatusUpdates:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","exchangeId must be of type: String and greater than 0 characters.");const n=`/${e}/${t}/status_updates`;return this._request(n,r)},fetchVolumeChart:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","exchangeId must be of type: String and greater than 0 characters.");const n=`/${e}/${t}/volume_chart`;return this._request(n,r)}}}get statusUpdates(){return{all:(e={})=>{const t="/status_updates";return this._request(t,e)}}}get events(){const e="events";return{all:(t={})=>{const r=`/${e}`;return this._request(r,t)},fetchCountries:()=>{const t=`/${e}/countries`;return this._request(t)},fetchTypes:()=>{const t=`/${e}/types`;return this._request(t)}}}get exchangeRates(){return{all:()=>{const e="/exchange_rates";return this._request(e)}}}get simple(){return{price:(e={})=>{s.isObject(e)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isArray(e["vs_currencies"])&&(e.vs_currencies=e.vs_currencies.join(",")),s.isString(e["vs_currencies"])&&!s.isStringEmpty(e["vs_currencies"])||(e.vs_currencies="usd"),s.isArray(e["ids"])&&(e.ids=e.ids.join(",")),s.isString(e["ids"])&&!s.isStringEmpty(e["ids"])||s._WARN_("Invalid parameter","params.ids must be of type: String or Array and greater than 0 characters.");const t="/simple/price";return this._request(t,e)},supportedVsCurrencies:()=>{const e="/simple/supported_vs_currencies";return this._request(e)},fetchTokenPrice:(e={},t="ethereum")=>{s.isObject(e)||s._WARN_("Invalid parameter","params must be of type: Object"),s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","assetPlatform must be of type: String and greater than 0 characters."),e["contract_addresses"]||s._WARN_("Missing parameter","params must include `contract_addresses` and be a of type: String or Object"),e["vs_currencies"]||s._WARN_("Missing parameter","params must include `vs_currencies` and be a of type: String or Object"),s.isArray(e["contract_addresses"])&&(e.contract_addresses=e.contract_addresses.join(",")),s.isArray(e["vs_currencies"])&&(e.vs_currencies=e.vs_currencies.join(","));const r=`/simple/token_price/${t}`;return this._request(r,e)}}}get finance(){return{fetchPlatforms:(e={})=>{const t="/finance_platforms";return this._request(t,e)},fetchProducts:(e={})=>{const t="/finance_products";return this._request(t,e)}}}get indexes(){const e="indexes";return{all:(t={})=>{const r=`/${e}`;return this._request(r,t)},fetch:t=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","indexId must be of type: String and greater than 0 characters.");const r=`/${e}/${t}`;return this._request(r)},list:()=>{const t=`/${e}/list`;return this._request(t)}}}get derivatives(){const e="derivatives";return{fetchTickers:()=>{const t=`/${e}`;return this._request(t)},allExchanges:(t={})=>{const r=`/${e}/exchanges`;return this._request(r,t)},fetchExchange:(t,r={})=>{s.isString(t)&&!s.isStringEmpty(t)||s._WARN_("Invalid parameter","exchangeId must be of type: String and greater than 0 characters.");const n=`/${e}/exchanges/${t}`;return this._request(n,r)},listExchanges:()=>{const t=`/${e}/exchanges/list`;return this._request(t)}}}_buildRequestOptions(e,t){return t=s.isObject(t)?i.stringify(t):void 0,e=void 0==t?`/api/v${o.API_VERSION}${e}`:`/api/v${o.API_VERSION}${e}?${t}`,{path:e,method:"GET",host:o.HOST,port:443,timeout:c.TIMEOUT}}_request(e,r){let i=this._buildRequestOptions(e,r);return new Promise((e,r)=>{let o=n.request(i,n=>{let i=[];n.on("data",e=>{i.push(e)}),n.on("end",()=>{try{i=t.concat(i),i=i.toString(),i.startsWith("")?s._WARN_("Invalid request","There was a problem with your request. The parameter(s) you gave are missing or incorrect."):i.startsWith("Throttled")&&s._WARN_("Throttled request","There was a problem with request limit."),i=JSON.parse(i)}catch(o){r(o)}e(a(!(n.statusCode<200||n.statusCode>=300),n.statusMessage,n.statusCode,i))})});o.on("error",e=>r(e)),o.on("timeout",()=>{o.abort(),r(new Error(`CoinGecko API request timed out. Current timeout is: ${c.TIMEOUT} milliseconds`))}),o.end()})}}c.API_VERSION=o.API_VERSION,c.REQUESTS_PER_SECOND=o.REQUESTS_PER_SECOND,c.ORDER=o.ORDER,c.STATUS_UPDATE_CATEGORY=o.STATUS_UPDATE_CATEGORY,c.STATUS_UPDATE_PROJECT_TYPE=o.STATUS_UPDATE_PROJECT_TYPE,c.EVENT_TYPE=o.EVENT_TYPE,c.TIMEOUT=o.TIMEOUT,e.exports=c}).call(this,r("b639").Buffer)},"1eca":function(e,t,r){"use strict";(function(t){const n=r("e3d5"),i=(e,r)=>{if("string"===typeof r)e._links=e._links.filter(e=>e.Name!==r);else{if(!t.isBuffer(r)&&!n.isCID(r))throw new Error("second arg needs to be a name or CID");e._links=e._links.filter(e=>!e.Hash.equals(r))}};e.exports=i}).call(this,r("b639").Buffer)},"1ef8":function(e,t,r){"use strict";const n=r("d3c3"),i=r("a796"),s=r("8f0a"),{default:o}=r("10d9"),a=r("4bc2"),c=a("libp2p-delegated-content-routing");c.error=a("libp2p-delegated-content-routing:error");const u=3e4,l={protocol:"https",port:443,host:"node0.delegate.ipfs.io"},h=4;class f{constructor(e,t){if(null==e)throw new Error("missing self peerId");this.api=Object.assign({},s(),l,t),this.dht=n(this.api),this.refs=i(this.api),this.peerId=e;const r={concurrency:h};this._httpQueue=new o(r),this._httpQueueRefs=new o(Object.assign({},r,{concurrency:2})),c(`enabled DelegatedContentRouting via ${this.api.protocol}://${this.api.host}:${this.api.port}`)}async*findProviders(e,t={}){const r=e.toBaseEncodedString();c("findProviders starts: "+r),t.maxTimeout=t.maxTimeout||u;const n=await this._httpQueue.add(()=>this.dht.findProvs(e,{timeout:`${t.maxTimeout}ms`}));for(let i=0;ithis.refs(t,{recursive:!1})),c("provide finished: "+t)}}e.exports=f},"1f17":function(e,t,r){"use strict";const n=r("7048"),i=r("8f3a"),s=r("5ffd"),o=e=>function*(t={}){const{offset:r,length:n}=s(e.length,t.offset,t.length);yield i(e,0,r,r+n)},a=async(e,t,r,i,s,a,c)=>{if(i.length)throw n(new Error(`No link named ${r} found in raw node ${e.toBaseEncodedString()}`),"ERR_NOT_FOUND");const u=await c.get(e);return{entry:{name:t,path:r,cid:e,node:u,content:o(u),depth:a}}};e.exports=a},"1f1d":function(e,t,r){"use strict";(function(t){const n=r("1a18"),i=r("e3d5"),s=r("4bb2"),o=r("8671"),a=r("c75d"),c=r("2773"),u=r("0c9a"),l=r("07a0"),{extendIterator:h}=r("8c82");class f{constructor(e){const t=s(f.defaultOptions,e);if(!t.blockService)throw new Error("Missing blockservice");this.bs=t.blockService,this.resolvers={},"function"!==typeof t.loadFormat?this.loadFormat=e=>{const t=u.print[e];throw new Error(`No resolver found for codec "${t}"`)}:this.loadFormat=t.loadFormat;for(const r of t.formats)this.addFormat(r)}addFormat(e){const t=e.codec;if(this.resolvers[e.format]){const e=u.print[t];throw new Error(`Resolver already exists for codec "${e}"`)}return this.resolvers[t]=e,this}removeFormat(e){return this.resolvers[e]&&delete this.resolvers[e],this}resolve(e,t){if(!i.isCID(e))throw new Error("`cid` argument must be a CID");if("string"!==typeof t)throw new Error("`path` argument must be a string");const r=async function*(){while(null!==e){const n=await this._getFormat(e.codec),s=await this.bs.get(e),o=n.resolver.resolve(s.data,t);t=o.remainderPath;let a=o.value;if(1===Object.keys(a).length&&"/"in a)try{a=new i(a["/"])}catch(r){a=null}e=i.isCID(a)?a:null,yield{remainderPath:t,value:a}}}.bind(this);return h(r())}async get(e){const t=await this.bs.get(e),r=await this._getFormat(t.cid.codec),n=r.util.deserialize(t.data);return n}getMany(e){if(!l.isIterable(e)||"string"===typeof e||t.isBuffer(e))throw new Error("`cids` must be an iterable of CIDs");const r=async function*(){for await(const t of e)yield this.get(t)}.bind(this);return h(r())}async put(e,t,r){if(void 0===t)throw new Error("`put` requires a format");if("number"!==typeof t)throw new Error("`format` parameter must be number (multicodec)");const i=await this._getFormat(t),o={hashAlg:i.defaultHashAlg,cidVersion:1,onlyHash:!1},a=s(o,r),c={cidVersion:a.cidVersion,hashAlg:a.hashAlg,onlyHash:a.onlyHash},u=i.util.serialize(e),l=await i.util.cid(u,c);if(!a.onlyHash){const e=new n(u,l);await this.bs.put(e)}return l}putMany(e,r,n){if(!l.isIterable(e)||"string"===typeof e||t.isBuffer(e))throw new Error("`nodes` must be an iterable");if(void 0===r)throw new Error("`put` requires a format");if("number"!==typeof r)throw new Error("`format` parameter must be number (multicodec)");let i,o;const a=async function*(){for await(const t of e){if(void 0===i){o=await this._getFormat(r);const e={hashAlg:o.defaultHashAlg,cidVersion:1,onlyHash:!1};i=s(e,n)}yield this.put(t,r,i)}}.bind(this);return h(a())}async remove(e){return this.bs.delete(e)}removeMany(e){if(!l.isIterable(e)||"string"===typeof e||t.isBuffer(e))throw new Error("`cids` must be an iterable of CIDs");const r=async function*(){for await(const t of e)yield this.remove(t)}.bind(this);return h(r())}tree(e,t,r){"object"===typeof t&&(r=t,t=void 0),t=t||"";const n={recursive:!1},o=s(n,r),a=async(e,t)=>{const r=await this._getFormat(e.cid.codec),n=r.resolver.resolve(e.data,t);return i.isCID(n.value)?n.value:null},c=async function*(){const r=[];let n;const i=[{cid:e,basePath:""}];let s;while(r.length>0||i.length>0){if(0===r.length&&i.length>0){({cid:e,basePath:s}=i.shift());const t=await this._getFormat(e.codec);n=await this.bs.get(e);const o=t.resolver.tree(n.data);r.push(...o)}const c=r.shift();let u=s+c;o.recursive&&(e=await a(n,c),null!==e&&i.push({cid:e,basePath:u+"/"})),u.startsWith(t)&&u.length>t.length&&(t.length>0&&(u=u.slice(t.length+1)),yield u)}}.bind(this);return h(c())}async _getFormat(e){if("string"===typeof e){const t=e.toUpperCase().replace(/-/g,"_");e=u[t]}if(this.resolvers[e])return this.resolvers[e];const t=await this.loadFormat(e);return this.addFormat(t),t}}f.defaultOptions={formats:[o,a,c]},e.exports=f}).call(this,r("b639").Buffer)},"1f39":function(e,t,r){"use strict";const n=r("faa1"),i=r("26a6"),s=r("d720");class o extends n{constructor(e,t){super(),this._options=t,this._queue=[],this._stats={},this._frequencyLastTime=Date.now(),this._frequencyAccumulators={},this._movingAverages={},this._update=this._update.bind(this),e.forEach(e=>{this._stats[e]=i(0),this._movingAverages[e]={},this._options.movingAverageIntervals.forEach(t=>{const r=this._movingAverages[e][t]=s(t);r.push(this._frequencyLastTime,0)})}),this._enabled=this._options.enabled}enable(){this._enabled=!0}disable(){this._disabled=!0}stop(){this._timeout&&clearTimeout(this._timeout)}get snapshot(){return Object.assign({},this._stats)}get movingAverages(){return Object.assign({},this._movingAverages)}push(e,t){this._enabled&&(this._queue.push([e,t,Date.now()]),this._resetComputeTimeout())}_resetComputeTimeout(){this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(this._update,this._nextTimeout())}_nextTimeout(){const e=this._queue.length/this._options.computeThrottleMaxQueueSize;return Math.max(this._options.computeThrottleTimeout*(1-e),0)}_update(){if(this._timeout=null,this._queue.length){let e;while(this._queue.length){const t=e=this._queue.shift();this._applyOp(t)}this._updateFrequency(e[2]),this.emit("update",this._stats)}}_updateFrequency(e){const t=e-this._frequencyLastTime;Object.keys(this._stats).forEach(r=>{this._updateFrequencyFor(r,t,e)}),this._frequencyLastTime=e}_updateFrequencyFor(e,t,r){const n=this._frequencyAccumulators[e]||0;this._frequencyAccumulators[e]=0;const i=n/t*1e3;let o=this._movingAverages[e];o||(o=this._movingAverages[e]={}),this._options.movingAverageIntervals.forEach(e=>{let t=o[e];t||(t=o[e]=s(e)),t.push(r,i)})}_applyOp(e){const t=e[0],r=e[1];if("number"!==typeof r)throw new Error("invalid increment number:",r);let n;n=Object.prototype.hasOwnProperty.call(this._stats,t)?this._stats[t]:this._stats[t]=i(0),this._stats[t]=n.plus(r),this._frequencyAccumulators[t]||(this._frequencyAccumulators[t]=0),this._frequencyAccumulators[t]+=r}}e.exports=o},"1f47":function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e){while(e.length>1){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],s=0;s=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?i+=n.charAt(o):a<128?i+=s[a]:a<2048?i+=s[192|a>>6]+s[128|63&a]:a<55296||a>=57344?i+=s[224|a>>12]+s[128|a>>6&63]+s[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&n.charCodeAt(o)),i+=s[240|a>>18]+s[128|a>>12&63]+s[128|a>>6&63]+s[128|63&a])}return i},f=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n0;return l(e,o,a,(function(e){n||(n=e),e&&s.forEach(h),o||(s.forEach(h),i(n))}))}));return t.reduce(f)}e.exports=p},20:function(e,t){},2007:function(e,t,r){var n=r("9070"),i=r("7a7a"),s=r("e39a"),o=r("464c"),a=r("eb5c");function c(e){var t=-1,r=null==e?0:e.length;this.clear();while(++tnew n.Entry(e,s.kMaxPriority-r,t));i.forEach(e=>{e.cancel?r?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(this._log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(const n of this.peers.values())n.addEntries(i)}_startPeerHandler(e){let t=this.peers.get(e.toB58String());if(t)return void t.refcnt++;t=new o(this._peerId,e,this.network);const r=new n(!0);for(const n of this.wantlist.entries())r.addEntry(n[1].cid,n[1].priority);return t.addMessage(r),this.peers.set(e.toB58String(),t),t}_stopPeerHandler(e){const t=this.peers.get(e.toB58String());t&&(t.refcnt--,t.refcnt>0||this.peers.delete(e.toB58String()))}wantBlocks(e){this._addEntries(e,!1)}unwantBlocks(e){this._log("unwant blocks: %s",e.length),this._addEntries(e,!0,!0)}cancelWants(e){this._log("cancel wants: %s",e.length),this._addEntries(e,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(e){this._startPeerHandler(e)}disconnected(e){this._stopPeerHandler(e)}start(){this.timer=setInterval(()=>{this._log("resend full-wantlist");const e=new n(!0);this.wantlist.forEach(t=>{e.addEntry(t.cid,t.priority)}),this.peers.forEach(t=>t.addMessage(e))},6e4)}stop(){this.peers.forEach(e=>this.disconnected(e.peerId)),clearInterval(this.timer)}}},2046:function(e,t){e.exports={WORKER_REQUEST_READ_LOCK:"lock:worker:request-read",WORKER_RELEASE_READ_LOCK:"lock:worker:release-read",MASTER_GRANT_READ_LOCK:"lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK:"lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK:"lock:worker:release-write",MASTER_GRANT_WRITE_LOCK:"lock:master:grant-write"}},2054:function(e,t,r){"use strict";(function(t){const n=r("ba1f"),i=r("956c"),s=r("2612"),o=r("0774"),a=r("c449"),c=r("ec12"),u=Symbol.for("nodejs.util.inspect.custom"),l=c.proto((function(e){if(!(this instanceof l))return new l(e);if(null==e&&(e=""),e instanceof t)this.buffer=n.fromBuffer(e);else if("string"===typeof e||e instanceof String){if(e.length>0&&"/"!==e.charAt(0))throw new Error(`multiaddr "${e}" must start with a "/"`);this.buffer=n.fromString(e)}else{if(!(e.buffer&&e.protos&&e.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=n.fromBuffer(e.buffer)}}),{className:"Multiaddr",symbolName:"@multiformats/js-multiaddr/multiaddr"});l.prototype.toString=function(){return n.bufferToString(this.buffer)},l.prototype.toJSON=l.prototype.toString,l.prototype.toOptions=function(){const e={},t=this.toString().split("/");return e.family="ip4"===t[1]?"ipv4":"ipv6",e.host=t[2],e.transport=t[3],e.port=parseInt(t[4]),e},l.prototype[u]=function(){return""},l.prototype.inspect=function(){return""},l.prototype.protos=function(){return this.protoCodes().map(e=>Object.assign({},i(e)))},l.prototype.protoCodes=function(){const e=[],t=this.buffer;let r=0;while(re.name)},l.prototype.tuples=function(){return n.bufferToTuples(this.buffer)},l.prototype.stringTuples=function(){const e=n.bufferToTuples(this.buffer);return n.tuplesToStringTuples(e)},l.prototype.encapsulate=function(e){return e=l(e),l(this.toString()+e.toString())},l.prototype.decapsulate=function(e){e=e.toString();const t=this.toString(),r=t.lastIndexOf(e);if(r<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return l(t.slice(0,r))},l.prototype.decapsulateCode=function(e){const t=this.tuples();for(let r=t.length-1;r>=0;r--)if(t[r][0]===e)return l(n.tuplesToBuffer(t.slice(0,r)));return this},l.prototype.getPeerId=function(){let e=null;try{const t=this.stringTuples().filter(e=>{if(e[0]===i.names.ipfs.code)return!0});e=t.pop()[1],e=o.encode(new a(e).multihash)}catch(t){e=null}return e},l.prototype.getPath=function(){let e=null;try{e=this.stringTuples().filter(e=>{const t=i(e[0]);if(t.path)return!0})[0][1]}catch(t){e=null}return e},l.prototype.equals=function(e){return this.buffer.equals(e.buffer)},l.prototype.nodeAddress=function(){const e=this.protoCodes(),t=this.protoNames(),r=this.toString().split("/").slice(1);if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(4!==e[0]&&41!==e[0]&&54!==e[0]&&55!==e[0])throw new Error(`no protocol with name: "'${t[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`);if("tcp"!==r[2]&&"udp"!==r[2])throw new Error(`no protocol with name: "'${t[1]}'". Must have a valid transport protocol: "{tcp, udp}".`);return{family:41===e[0]||55===e[0]?6:4,address:r[1],port:parseInt(r[3])}},l.fromNodeAddress=function(e,t){if(!e)throw new Error("requires node address object");if(!t)throw new Error("requires transport protocol");const r="IPv6"===e.family?"ip6":"ip4";return l("/"+[r,e.address,t,e.port].join("/"))},l.prototype.isThinWaistAddress=function(e){const t=(e||this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))},l.protocols=i,l.isName=function(e){return!!l.isMultiaddr(e)&&e.protos().some(e=>e.resolvable)},l.resolve=function(e){return l.isMultiaddr(e)&&l.isName(e)?Promise.reject(new Error("not implemented yet")):Promise.reject(Error("not a valid name"))},e.exports=l}).call(this,r("b639").Buffer)},2072:function(e,t,r){const n=r("f0e0"),i=r("0d07"),s=r("f269"),o=r("6ecd");e.exports={OdbIdentityProvider:n,ModeratorAccessController:i,ThreadAccessController:s,LegacyIPFS3BoxAccessController:o}},"2091e":function(e,t,r){"use strict";const n=r("f106"),i=n(r("c545")),s=i.Data,o=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],a=["directory","hamt-sharded-directory"];function c(e,t){if(!(this instanceof c))return new c(e,t);if(-1===o.indexOf(e))throw new Error("Type: "+e+" is not valid");this.type=e,this.data=t,this.blockSizes=[],this.addBlockSize=e=>{this.blockSizes.push(e)},this.removeBlockSize=e=>{this.blockSizes.splice(e,1)},this.fileSize=()=>{if(a.indexOf(this.type)>=0)return;let e=0;return this.blockSizes.forEach(t=>{e+=t}),t&&(e+=t.length),e},this.marshal=()=>{let e;switch(this.type){case"raw":e=s.DataType.Raw;break;case"directory":e=s.DataType.Directory;break;case"file":e=s.DataType.File;break;case"metadata":e=s.DataType.Metadata;break;case"symlink":e=s.DataType.Symlink;break;case"hamt-sharded-directory":e=s.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let t=this.fileSize(),r=this.data;this.data&&this.data.length||(r=void 0);let n=this.blockSizes;return this.blockSizes&&this.blockSizes.length||(n=void 0),s.encode({Type:e,Data:r,filesize:t,blocksizes:n,hashType:this.hashType,fanout:this.fanout})}}c.unmarshal=e=>{const t=s.decode(e);t.Data||(t.Data=void 0);const r=new c(o[t.Type],t.Data);return r.blockSizes=t.blocksizes,r},e.exports=c},"20b8":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t=(0,c.default)(t||o.default),!(0,i.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){var n=(0,p.default)(e[r++]);t.push((0,f.default)(s)),n.apply(null,t)}function s(i){if(i||r===e.length)return t.apply(null,arguments);n((0,l.default)(arguments,1))}n([])};var n=r("cdca"),i=y(n),s=r("c1cd"),o=y(s),a=r("0924"),c=y(a),u=r("6307"),l=y(u),h=r("ba12"),f=y(h),d=r("76bf"),p=y(d);function y(e){return e&&e.__esModule?e:{default:e}}e.exports=t["default"]},"20ba":function(e,t,r){"use strict";(function(t){const{Key:n}=r("7b6d"),{Record:i}=r("7943"),{encodeBase32:s}=r("7397"),o=r("7048"),a=r("4bc2"),c=a("ipfs:ipns:offline-datastore");c.error=a("ipfs:ipns:offline-datastore:error");class u{constructor(e){this._repo=e}async put(e,r){if(!t.isBuffer(e))throw o(new Error("Offline datastore key must be a buffer"),"ERR_INVALID_KEY");if(!t.isBuffer(r))throw o(new Error("Offline datastore value must be a buffer"),"ERR_INVALID_VALUE");let n;try{n=this._routingKey(e)}catch(a){throw c.error(a),o(new Error("Not possible to generate the routing key"),"ERR_GENERATING_ROUTING_KEY")}const s=new i(e,r);return this._repo.datastore.put(n,s.serialize())}async get(e){if(!t.isBuffer(e))throw o(new Error("Offline datastore key must be a buffer"),"ERR_INVALID_KEY");let r;try{r=this._routingKey(e)}catch(a){throw c.error(a),o(new Error("Not possible to generate the routing key"),"ERR_GENERATING_ROUTING_KEY")}const n=await this._repo.datastore.get(r);let s;try{s=i.deserialize(n)}catch(a){throw c.error(a),a}return s.value}_routingKey(e){return new n("/"+s(e),!1)}}e.exports=u}).call(this,r("b639").Buffer)},"20bc":function(e,t,r){var n=r("e0c5").Buffer;function i(e,t,r){var n,i,o,a=-1,c=8,u=0;while(++a>a%8,e._prev=s(e._prev,r?i:o);return u}function s(e,t){var r=e.length,i=-1,s=n.allocUnsafe(e.length);e=n.concat([e,n.from([t])]);while(++i>7;return s}t.encrypt=function(e,t,r){var s=t.length,o=n.allocUnsafe(s),a=-1;while(++a{let t;for await(const r of e)t=r;return t};e.exports=n},"20d6":function(e,t,r){var n=r("9a16"),i=r("0937"),s=n(i,"Map");e.exports=s},"20d8":function(e,t,r){"use strict";(function(t){const n=r("670b"),i=r("c14d");class s extends n{createTag(e,t){return`${e}(${t})`}createInt(e){return super.createInt(e).toString()}createInt32(e,t){return super.createInt32(e,t).toString()}createInt64(e,t,r,n){return super.createInt64(e,t,r,n).toString()}createInt32Neg(e,t){return super.createInt32Neg(e,t).toString()}createInt64Neg(e,t,r,n){return super.createInt64Neg(e,t,r,n).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(e){const t=super.createFloat(e);return i.isNegativeZero(e)?"-0_1":`${t}_1`}createFloatSingle(e,t,r,n){const i=super.createFloatSingle(e,t,r,n);return`${i}_2`}createFloatDouble(e,t,r,n,i,s,o,a){const c=super.createFloatDouble(e,t,r,n,i,s,o,a);return`${c}_3`}createByteString(e,t){const r=e.join(", ");return-1===t?`(_ ${r})`:`h'${r}`}createByteStringFromHeap(e,r){const n=t.from(super.createByteStringFromHeap(e,r)).toString("hex");return`h'${n}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(e){return`simple(${e})`}createArray(e,t){const r=super.createArray(e,t);return-1===t?`[_ ${r.join(", ")}]`:`[${r.join(", ")}]`}createMap(e,t){const r=super.createMap(e),n=Array.from(r.keys()).reduce(o(r),"");return-1===t?`{_ ${n}}`:`{${n}}`}createObject(e,t){const r=super.createObject(e),n=Object.keys(r).reduce(o(r),"");return-1===t?`{_ ${n}}`:`{${n}}`}createUtf8String(e,t){const r=e.join(", ");return-1===t?`(_ ${r})`:`"${r}"`}createUtf8StringFromHeap(e,r){const n=t.from(super.createUtf8StringFromHeap(e,r)).toString("utf8");return`"${n}"`}static diagnose(e,r){"string"===typeof e&&(e=t.from(e,r||"hex"));const n=new s;return n.decodeFirst(e)}}function o(e){return(t,r)=>t?`${t}, ${r}: ${e[r]}`:`${r}: ${e[r]}`}e.exports=s}).call(this,r("b639").Buffer)},"20df":function(e,t,r){"use strict";(function(t){e.exports=function(e){return{encode(e){return"string"===typeof e?t.from(e).toString("hex"):e.toString("hex")},decode(r){for(let t of r)if(e.indexOf(t)<0)throw new Error("invalid base16 character");return t.from(r,"hex")}}}}).call(this,r("b639").Buffer)},"20e2":function(e,t,r){"use strict";var n=r("1727"),i=r("b93e"),s=r("5380");function o(e,t){return void 0===e?t:(n.isBoolean(e,s.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),r=o(r,!0);var a=e.privateKeyExport(t,r);return i.privateKeyExport(t,a,r)},privateKeyImport:function(t){if(n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),t=i.privateKeyImport(t),t&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(s.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,s.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,s.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,s.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,s.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,s.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,s.EC_PRIVATE_KEY_LENGTH_INVALID),r=o(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,s.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,s.EC_PUBLIC_KEY_LENGTH_INVALID),r=o(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,s.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return n.isBuffer(t,s.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,s.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,s.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,s.TWEAK_LENGTH_INVALID),i=o(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return n.isBuffer(t,s.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,s.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,s.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,s.TWEAK_LENGTH_INVALID),i=o(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){n.isArray(t,s.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,s.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i{if(t){if(e.return)try{await e.return()}catch(i){return r(i)}return r(t)}let n;try{n=await e.next()}catch(i){return r(i)}if(n.done)return r(!0);r(null,n.value)}}s.source=s,s.transform=s.through=e=>t=>s(e(i(t))),s.duplex=e=>({sink:s.sink(e.sink),source:s(e.source)}),s.sink=e=>t=>{e({[Symbol.asyncIterator](){return this},next:()=>new Promise((e,r)=>{t(null,(t,n)=>!0===t?e({done:!0,value:n}):t?r(t):void e({done:!1,value:n}))}),return:()=>new Promise((e,r)=>{t(!0,(t,n)=>{if(t&&!0!==t)return r(t);e({done:!0,value:n})})}),throw:e=>new Promise((r,n)=>{t(e,(e,t)=>{if(e&&!0!==e)return n(e);r({done:!0,value:t})})})})},e.exports=s},"21b4":function(e,t,r){"use strict";const n=r("c8d3"),{DIAL_ABORTED:i,ERR_DENIED:s}=r("a10a"),o=r("9f2e"),a=r("c59f"),c=r("4bc2"),u=c("libp2p:switch:dial");function l({protocol:e,connection:t,callback:r}){if(!e)return r();t.shake(e,(e,n)=>{if(!n)return r(e);n.setPeerInfo(t.theirPeerInfo),r(null,n)})}u.error=c("libp2p:switch:dial:error");class h{constructor(e,t,r){this.id=e,this.switch=t,this._queue=[],this.denylisted=null,this.denylistCount=0,this.isRunning=!1,this.onStopped=r}get length(){return this._queue.length}add(e,t,r){if(!this.isDialAllowed())return o(r,s());this._queue.push({protocol:e,useFSM:t,callback:r})}isDialAllowed(){return!this.denylisted||Date.now()>this.denylisted&&(this.denylisted=null,!0)}start(){return!this.isRunning&&(u("starting dial queue to %s",this.id),this.isRunning=!0,this._run(),!0)}stop(){this.isRunning&&(u("stopping dial queue to %s",this.id),this.isRunning=!1,this.onStopped(this.id))}abort(){while(this.length>0){const e=this._queue.shift();e.callback(i())}this.stop()}denylist(){if(this.denylistCount++,this.denylistCount>=this.switch.dialer.DENY_ATTEMPTS)return void(this.denylisted=1/0);let e=this.switch.dialer.DENY_TTL*Math.pow(this.denylistCount,3);const t=.9*e,r=1.1*e;e=Math.floor(Math.random()*(r-t)+t),this.denylisted=Date.now()+e,this.abort()}_getOrCreateConnection(e){let t=this.switch.connection.getOne(this.id),r=!1;return t||(t=new n({_switch:this.switch,peerInfo:e,muxer:null,conn:null}),this.switch.connection.add(t),t.once("connected",()=>t.protect()),t.once("private",()=>t.encrypt()),t.once("encrypted",()=>t.upgrade()),r=!0),{connectionFSM:t,didCreate:r}}_run(){if(this.length<1||!this.isRunning)return u("stopping the queue for %s",this.id),this.stop();const e=a(()=>{u("starting next dial to %s",this.id),this._run()}),t=this.switch._peerBook.get(this.id),r=this._queue.shift(),{connectionFSM:n,didCreate:i}=this._getOrCreateConnection(t);if(r.useFSM&&o(r.callback,null,n),["MUXED","CONNECTED"].includes(n.getState()))return r.connection=n,l(r),void e();n.once("error",e=>{r.callback(e),t.protocols.size>0&&t.isConnected()||this.denylist()}),n.once("close",()=>{e()}),n.once("muxed",()=>{this.denylistCount=0,r.connection=n,l(r),e()}),n.once("unmuxed",()=>{this.denylistCount=0,r.connection=n,l(r),e()}),i&&n.dial()}}e.exports=h},"21d6":function(e,t,r){var n=r("6b4f"),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=n?n.toStringTag:void 0;function c(e){var t=s.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(c){}var i=o.call(e);return n&&(t?e[a]=r:delete e[a]),i}e.exports=c},22:function(e,t){},2204:function(e,t,r){"use strict";function n(e){return e}var i=r("b6d6"),s=r("1631");e.exports=function(e,t){var r=!1;return t?e=i(e)||n:(t=e,e=n),s((function(n){if(e(n))return r=!0,t(null,n),!1}),(function(e){r||t(!0===e?null:e,null)}))}},"220c":function(e,t,r){"use strict";(function(t){const n=r("c64e"),i=r("ec12"),s="/",o=t.from(s),a=o[0];class c{constructor(e,r){if("string"===typeof e?this._buf=t.from(e):t.isBuffer(e)&&(this._buf=e),null==r&&(r=!0),r&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error(`Invalid key: ${this.toString()}`)}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(e){return new h(e.join(s))}static random(){return new h(n().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=t.from(s)),this._buf[0]!==a&&(this._buf=t.concat([o,this._buf]));while(this._buf.length>1&&this._buf[this._buf.length-1]===a)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;ni)return!1}return t.length
+ * https://github.com/rvagg/prr
+ * License: MIT
+ */
+(function(t,r,n){e.exports?e.exports=n():r[t]=n()})("prr",this,(function(){var e="function"==typeof Object.defineProperty?function(e,t,r){return Object.defineProperty(e,t,r),e}:function(e,t,r){return e[t]=r.value,e},t=function(e,t){var r="object"==typeof t,n=!r&&"string"==typeof t,i=function(e){return r?!!t[e]:!!n&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}},r=function(r,n,i,s){var o;if(s=t(i,s),"object"==typeof n){for(o in n)Object.hasOwnProperty.call(n,o)&&(s.value=n[o],e(r,o,s));return r}return e(r,n,s)};return r}))},2236:function(e,t){function r(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t{})}){s.isCID(e)||(e=new s(e));const n=e=>async()=>{const{value:s}=await this.dag.get(e,{preload:t});if(r(e),"dag-pb"===e.codec)i.addAll(s.Links.map(e=>n(e.Hash)));else if("dag-cbor"===e.codec)for(const[e,t]of l(s))i.add(n(t))},i=new o({concurrency:g});i.add(n(e)),await i.onIdle()}directKeys(){return Array.from(this.directPins,e=>new s(e).buffer)}recursiveKeys(){return Array.from(this.recursivePins,e=>new s(e).buffer)}async getIndirectKeys({preload:e}){const t=new Set;for(const r of this.recursiveKeys())await this._walkDag({cid:new s(r),preload:e||!1,onCid:e=>{e=e.toString(),this.recursivePins.has(e)||t.add(e)}});return Array.from(t)}async flushPins(){const[e,r]=await Promise.all([this.pinset.storeSet(this.directKeys()).then(e=>new i(w.direct,e.node.size,e.cid)),this.pinset.storeSet(this.recursiveKeys()).then(e=>new i(w.recursive,e.node.size,e.cid)),this.dag.put(new n(t.alloc(0)),{version:0,format:u.DAG_PB,hashAlg:u.SHA2_256,preload:!1})]),s=new n(t.alloc(0),[e,r]),o=await this.dag.put(s,{version:0,format:u.DAG_PB,hashAlg:u.SHA2_256,preload:!1});await this.repo.datastore.put(b,o.buffer),this.log(`Flushed pins with root: ${o}`)}async load(){const e=await this.repo.datastore.has(b);if(!e)return;const t=await this.repo.datastore.get(b),r=await this.dag.get(new s(t),"",{preload:!1}),[n,i]=await Promise.all([this.pinset.loadSet(r.value,w.recursive),this.pinset.loadSet(r.value,w.direct)]);this.directPins=new Set(i.map(e=>f(e))),this.recursivePins=new Set(n.map(e=>f(e))),this.log("Loaded pins from the datastore")}async isPinnedWithType(e,t){const r=f(e),{recursive:n,direct:i,all:a}=w;if((t===n||t===a)&&this.recursivePins.has(r))return{key:r,pinned:!0,reason:n};if(t===n)return{key:r,pinned:!1};if((t===i||t===a)&&this.directPins.has(r))return{key:r,pinned:!0,reason:i};if(t===i)return{key:r,pinned:!1};const c=new o({concurrency:m});let u;return c.addAll(this.recursiveKeys().map(e=>(e=new s(e),async()=>{const t=await this.pinset.hasDescendant(e,r);t&&(u=e,c.clear())}))),await c.onIdle(),{key:r,pinned:Boolean(u),reason:u}}async getInternalBlocks(){let e;try{e=await this.repo.datastore.get(b)}catch(i){if(i.code===y)return this.log("No pinned blocks"),[];throw new Error(`Could not get pin sets root from datastore: ${i.message}`)}const t=new s(e),r=await this.dag.get(t,"",{preload:!1}),n=await this.pinset.getInternalCids(r.value);return n.concat(t)}async fetchCompleteDag(e,t){await this._walkDag({cid:e,preload:t.preload})}static checkPinType(e){if("string"!==typeof e||!Object.keys(w).includes(e))return v(e)}}_.PinTypes=w,e.exports=_}).call(this,r("b639").Buffer)},23:function(e,t){},2304:function(e,t,r){e.exports=r("27a7")},"230c":function(e,t,r){"use strict";var n=r("c3bb"),i=r("f522").AbstractIterator,s=r("2f06"),o=r("d13e"),a=r("a6a3"),c=function(){};function u(e,t,r){if(i.call(this,e),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0!==this._limit){try{var n=this.createKeyRange(r)}catch(s){return void(this._completed=!0)}this.createIterator(t,n,r.reverse)}else this._completed=!0}e.exports=u,n(u,i),u.prototype.createKeyRange=function(e){var t=s.lowerBound(e),r=s.upperBound(e),n=s.lowerBoundExclusive(e),i=s.upperBoundExclusive(e);return void 0!==t&&void 0!==r?IDBKeyRange.bound(t,r,n,i):void 0!==t?IDBKeyRange.lowerBound(t,n):void 0!==r?IDBKeyRange.upperBound(r,i):null},u.prototype.createIterator=function(e,t,r){var n=this,i=this.db.db.transaction([e],"readonly"),s=i.objectStore(e),o=s.openCursor(t,r?"prev":"next");o.onsuccess=function(e){var t=e.target.result;t&&n.onItem(t)},this._transaction=i,i.onabort=function(){n.onAbort(n._transaction.error||new Error("aborted by user"))},i.oncomplete=function(){n.onComplete()}},u.prototype.onItem=function(e){this._cache.push(e.key,e.value),(this._limit<=0||++this._count0){var r=this._cache.shift(),n=this._cache.shift();this._keyAsBuffer&&(r=o(r)),this._valueAsBuffer&&(n=o(n)),a((function(){e(null,r,n)}))}else this._completed?a(e):this._callback=e},u.prototype._end=function(e){if(this._aborted||this._completed){var t=this._error;a((function(){e(t)}))}else this.onItem=c,this.onAbort=e,this.onComplete=e}},"231e":function(e,t,r){"use strict";const n=r("70e3");e.exports={createCipheriv:n.createCipheriv,createDecipheriv:n.createDecipheriv}},2366:function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);function i(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}e.exports=i},2377:function(e,t,r){(function(t,n){var i;
+/*
+ * [hi-base32]{@link https://github.com/emn178/hi-base32}
+ *
+ * @version 0.5.0
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
+ * @copyright Chen, Yi-Cyuan 2015-2018
+ * @license MIT
+ */(function(){"use strict";var s="object"===typeof window?window:{},o=!s.HI_BASE32_NO_NODE_JS&&"object"===typeof t&&t.versions&&t.versions.node;o&&(s=n);var a=!s.HI_BASE32_NO_COMMON_JS&&"object"===typeof e&&e.exports,c=r("3c35"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),l={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},h=[0,0,0,0,0,0,0,0],f=function(e,t){t.length>10&&(t="..."+t.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw r.position=e,r},d=function(e){var t,r,n="",i=e.length,s=0,o=0;while(s191&&t<=223?(r=31&t,o=1):t<=239?(r=15&t,o=2):t<=247?(r=7&t,o=3):f(s,n);for(var a=0;a191)&&f(s,n),r<<=6,r+=63&t;r>=55296&&r<=57343&&f(s,n),r>1114111&&f(s,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+(1023&r)))}return n},p=function(e){if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");e=e.replace(/=/g,"");for(var t,r,n,i,s,o,a,c,u=[],h=0,f=e.length,d=0,p=f>>3<<3;d>>2),u[h++]=255&(r<<6|n<<1|i>>>4),u[h++]=255&(i<<4|s>>>1),u[h++]=255&(s<<7|o<<2|a>>>3),u[h++]=255&(a<<5|c);var y=f-p;return 2===y?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],u[h++]=255&(t<<3|r>>>2)):4===y?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],i=l[e.charAt(d++)],u[h++]=255&(t<<3|r>>>2),u[h++]=255&(r<<6|n<<1|i>>>4)):5===y?(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],i=l[e.charAt(d++)],s=l[e.charAt(d++)],u[h++]=255&(t<<3|r>>>2),u[h++]=255&(r<<6|n<<1|i>>>4),u[h++]=255&(i<<4|s>>>1)):7===y&&(t=l[e.charAt(d++)],r=l[e.charAt(d++)],n=l[e.charAt(d++)],i=l[e.charAt(d++)],s=l[e.charAt(d++)],o=l[e.charAt(d++)],a=l[e.charAt(d++)],u[h++]=255&(t<<3|r>>>2),u[h++]=255&(r<<6|n<<1|i>>>4),u[h++]=255&(i<<4|s>>>1),u[h++]=255&(s<<7|o<<2|a>>>3)),u},y=function(e){for(var t,r,n,i,s,o="",a=e.length,c=0,l=5*parseInt(a/5);c>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[31&(i<<3|s>>>5)]+u[31&s];var h=a-l;return 1===h?(t=e.charCodeAt(c),o+=u[t>>>3]+u[t<<2&31]+"======"):2===h?(t=e.charCodeAt(c++),r=e.charCodeAt(c),o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[r<<4&31]+"===="):3===h?(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c),o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[n<<1&31]+"==="):4===h&&(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c++),i=e.charCodeAt(c),o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[i<<3&31]+"="),o},g=function(e){var t,r,n,i,s,o,a,c=!1,l="",f=0,d=0,p=e.length;do{for(h[0]=h[5],h[1]=h[6],h[2]=h[7],a=d;f>6,h[a++]=128|63&o):o<55296||o>=57344?(h[a++]=224|o>>12,h[a++]=128|o>>6&63,h[a++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),h[a++]=240|o>>18,h[a++]=128|o>>12&63,h[a++]=128|o>>6&63,h[a++]=128|63&o);a-d,d=a-5,f===p&&++f,f>p&&a<6&&(c=!0),t=h[0],a>4?(r=h[1],n=h[2],i=h[3],s=h[4],l+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[31&(i<<3|s>>>5)]+u[31&s]):1===a?l+=u[t>>>3]+u[t<<2&31]+"======":2===a?(r=h[1],l+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[r<<4&31]+"===="):3===a?(r=h[1],n=h[2],l+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[n<<1&31]+"==="):(r=h[1],n=h[2],i=h[3],l+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[i<<3&31]+"=")}while(!c);return l},m=function(e){for(var t,r,n,i,s,o="",a=e.length,c=0,l=5*parseInt(a/5);c>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[31&(i<<3|s>>>5)]+u[31&s];var h=a-l;return 1===h?(t=e[c],o+=u[t>>>3]+u[t<<2&31]+"======"):2===h?(t=e[c++],r=e[c],o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[r<<4&31]+"===="):3===h?(t=e[c++],r=e[c++],n=e[c],o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[n<<1&31]+"==="):4===h&&(t=e[c++],r=e[c++],n=e[c++],i=e[c],o+=u[t>>>3]+u[31&(t<<2|r>>>6)]+u[r>>>1&31]+u[31&(r<<4|n>>>4)]+u[31&(n<<1|i>>>7)]+u[i>>>2&31]+u[i<<3&31]+"="),o},b=function(e,t){var r="string"!==typeof e;return r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),r?m(e):t?y(e):g(e)},v=function(e,t){if(!t)return d(p(e));if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var r,n,i,s,o,a,c,u,h="",f=e.indexOf("=");-1===f&&(f=e.length);for(var y=0,g=f>>3<<3;y>>2))+String.fromCharCode(255&(n<<6|i<<1|s>>>4))+String.fromCharCode(255&(s<<4|o>>>1))+String.fromCharCode(255&(o<<7|a<<2|c>>>3))+String.fromCharCode(255&(c<<5|u));var m=f-g;return 2===m?(r=l[e.charAt(y++)],n=l[e.charAt(y++)],h+=String.fromCharCode(255&(r<<3|n>>>2))):4===m?(r=l[e.charAt(y++)],n=l[e.charAt(y++)],i=l[e.charAt(y++)],s=l[e.charAt(y++)],h+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|s>>>4))):5===m?(r=l[e.charAt(y++)],n=l[e.charAt(y++)],i=l[e.charAt(y++)],s=l[e.charAt(y++)],o=l[e.charAt(y++)],h+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|s>>>4))+String.fromCharCode(255&(s<<4|o>>>1))):7===m&&(r=l[e.charAt(y++)],n=l[e.charAt(y++)],i=l[e.charAt(y++)],s=l[e.charAt(y++)],o=l[e.charAt(y++)],a=l[e.charAt(y++)],c=l[e.charAt(y++)],h+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|s>>>4))+String.fromCharCode(255&(s<<4|o>>>1))+String.fromCharCode(255&(o<<7|a<<2|c>>>3))),h},w={encode:b,decode:v};v.asBytes=p,a?e.exports=w:(s.base32=w,c&&(i=function(){return w}.call(w,r,w,e),void 0===i||(e.exports=i)))})()}).call(this,r("4362"),r("c8ba"))},2388:function(e,t,r){"use strict";function n(e,t,r){e.emit("stream",t,r)}function i(e,t){e.emit("error",t)}e.exports.emitError=i,e.exports.emitStream=n},"2388f":function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},"239c":function(e,t,r){e.exports=r("5cb7")},"23bc":function(e,t,r){"use strict";(function(t){const n=r("7e03"),i=(e,r)=>t.compare(e.nameAsBuffer,r.nameAsBuffer),s=e=>n(e,i);e.exports=s}).call(this,r("b639").Buffer)},24:function(e,t){},2411:function(e,t,r){"use strict";(function(e){const n=r("748a"),i=r("ea91");t.publicKeyLength=n.sign.publicKeyLength,t.privateKeyLength=n.sign.secretKeyLength,t.generateKey=function(e){i(()=>{let t;try{t=n.sign.keyPair()}catch(r){return e(r)}e(null,t)})},t.generateKeyFromSeed=function(e,t){i(()=>{let r;try{r=n.sign.keyPair.fromSeed(e)}catch(i){return t(i)}t(null,r)})},t.hashAndSign=function(t,r,s){i(()=>{s(null,e.from(n.sign.detached(r,t)))})},t.hashAndVerify=function(e,t,r,s){i(()=>{let i;try{i=n.sign.detached.verify(r,t,e)}catch(o){return s(o)}s(null,i)})}}).call(this,r("b639").Buffer)},2424:function(e,t,r){"use strict";r.r(t);var n=r("28a7");r.d(t,"default",(function(){return n["c"]})),r.d(t,"HTTPError",(function(){return n["a"]})),r.d(t,"TimeoutError",(function(){return n["b"]}))},"245c":function(e,t,r){"use strict";const n=r("09a4"),i=r("e62b").version;e.exports=function(e){return n(async()=>({id:e._peerInfo.id.toB58String(),publicKey:e._peerInfo.id.pubKey.bytes.toString("base64"),addresses:e._peerInfo.multiaddrs.toArray().map(e=>e.toString()).filter(e=>e.indexOf("ipfs")>=0).sort(),agentVersion:`js-ipfs/${i}`,protocolVersion:"9000"}))}},2462:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=(0,o.default)(e);return(0,i.default)((function(e,t){r(e[0],t)}),t,1)};var n=r("9d97"),i=a(n),s=r("76bf"),o=a(s);function a(e){return e&&e.__esModule?e:{default:e}}e.exports=t["default"]},"247b":function(e,t,r){"use strict";(function(e){const n=r("a261"),i=r("f982"),s=r("a0e5").bignum,o=r("5cdc"),a=o.toBase64,c=o.toBn,u={"P-256":256,"P-384":384,"P-521":521};t.generateEphmeralKeyPair=function(t,r){i(n.subtle.generateKey({name:"ECDH",namedCurve:t},!0,["deriveBits"]).then(r=>{const s=(s,o,a)=>{let c;"function"===typeof o&&(a=o,o=void 0),c=o?n.subtle.importKey("jwk",d(t,o),{name:"ECDH",namedCurve:t},!1,["deriveBits"]):Promise.resolve(r.privateKey);const l=Promise.all([n.subtle.importKey("jwk",f(t,s),{name:"ECDH",namedCurve:t},!1,[]),c]);i(l.then(e=>n.subtle.deriveBits({name:"ECDH",namedCurve:t,public:e[0]},e[1],u[t])).then(t=>e.from(t)),a)};return n.subtle.exportKey("jwk",r.publicKey).then(e=>({key:h(e),genSharedKey:s}))}),r)};const l={"P-256":32,"P-384":48,"P-521":66};function h(t){const r=l[t.crv];return e.concat([e.from([4]),c(t.x).toArrayLike(e,"be",r),c(t.y).toArrayLike(e,"be",r)],1+2*r)}function f(t,r){const n=l[t];if(!r.slice(0,1).equals(e.from([4])))throw new Error("Invalid key format");const i=new s(r.slice(1,n+1)),o=new s(r.slice(1+n));return{kty:"EC",crv:t,x:a(i,n),y:a(o,n),ext:!0}}function d(e,t){const r=f(e,t.public);return r.d=a(new s(t.private)),r}}).call(this,r("b639").Buffer)},2498:function(e,t,r){var n=r("918b");r("91bb"),r("5ee0");var i=n.asn1,s=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=s;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};s.contentInfoValidator=o;var a={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};s.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(a)},s.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(a)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};s.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},s.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},"24d2":function(e,t,r){(function(r,n){"use strict";var i={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function s(e){if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return!1;for(var t=0;t255)return!1;return!0}function o(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function a(e,t){return e<>>32-t}function c(e){return e^=e>>>16,e=o(e,2246822507),e^=e>>>13,e=o(e,3266489909),e^=e>>>16,e}function u(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function l(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function h(e,t){return t%=64,32===t?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function f(e,t){return t%=64,0===t?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=l(e,[4283543511,3981806797]),e=d(e,[0,e[0]>>>1]),e=l(e,[3301882366,444984403]),e=d(e,[0,e[0]>>>1]),e}i.x86.hash32=function(e,t){if(i.inputValidation&&!s(e))return n;t=t||0;for(var r=e.length%4,u=e.length-r,l=t,h=0,f=3432918353,d=461845907,p=0;p>>0},i.x86.hash128=function(e,t){if(i.inputValidation&&!s(e))return n;t=t||0;for(var r=e.length%16,u=e.length-r,l=t,h=t,f=t,d=t,p=0,y=0,g=0,m=0,b=597399067,v=2869860233,w=951274213,_=2716044179,E=0;E>>0).toString(16)).slice(-8)+("00000000"+(h>>>0).toString(16)).slice(-8)+("00000000"+(f>>>0).toString(16)).slice(-8)+("00000000"+(d>>>0).toString(16)).slice(-8)},i.x64.hash128=function(e,t){if(i.inputValidation&&!s(e))return n;t=t||0;for(var r=e.length%16,o=e.length-r,a=[0,t],c=[0,t],y=[0,0],g=[0,0],m=[2277735313,289559509],b=[1291169091,658871167],v=0;v>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=i),t.murmurHash3=i})()},"24d5":function(e,t,r){"use strict";const n=r("0bda"),i=r("4bc2"),s=r("e3d5"),o=r("4503"),a=r("8d9e"),c=r("ca60"),u=i("ipfs:preload");u.error=i("ipfs:preload:error"),e.exports=e=>{const t=e._options.preload||{};if(t.enabled=Boolean(t.enabled),t.addresses=t.addresses||[],!t.enabled||!t.addresses.length){u("preload disabled");const e=()=>{};return e.start=()=>{},e.stop=()=>{},e}let r=!0,i=[];const l=t.addresses.map(n),h=async e=>{try{if(r)throw new Error(`preload ${e} but preloader is not started`);"string"!==typeof e&&(e=new s(e).toString());const n=o(l);let h=!1;const f=Date.now();for(const s of n){if(r)throw new Error(`preload aborted for ${e}`);let n;try{n=new a,i=i.concat(n),await c(`${s}/api/v0/refs?r=true&arg=${encodeURIComponent(e)}`,{signal:n.signal}),h=!0}catch(t){"aborted"!==t.type&&u.error(t)}finally{i=i.filter(e=>e!==n)}if(h)break}u(`${h?"":"un"}successfully preloaded ${e} in ${Date.now()-f}ms`)}catch(t){u.error(t)}};return h.start=()=>{r=!1},h.stop=()=>{r=!0,u(`aborting ${i.length} pending preload request(s)`),i.forEach(e=>e.abort()),i=[]},h}},"24e6":function(e,t,r){"use strict";const n=r("7048"),i={"dag-pb":r("5051"),raw:r("1f17"),"dag-cbor":r("521b")},s=(e,t,r,o,a,c)=>{const u=i[e.codec];if(!u)throw n(new Error(`No resolver for codec ${e.codec}`),"ERR_NO_RESOLVER");return u(e,t,r,o,s,a,c)};e.exports=s},25:function(e,t){},"252b":function(e,t,r){(function(t){var r="Expected a function",n="__lodash_hash_undefined__",i=1/0,s=9007199254740991,o="[object Arguments]",a="[object Function]",c="[object GeneratorFunction]",u="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,h=/^\w*$/,f=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/[\\^$.*+?()[\]{}|]/g,y=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,b="object"==typeof t&&t&&t.Object===Object&&t,v="object"==typeof self&&self&&self.Object===Object&&self,w=b||v||Function("return this")();function _(e,t){return null==e?void 0:e[t]}function E(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}var S=Array.prototype,k=Function.prototype,C=Object.prototype,A=w["__core-js_shared__"],I=function(){var e=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),T=k.toString,x=C.hasOwnProperty,B=C.toString,R=RegExp("^"+T.call(x).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=w.Symbol,O=C.propertyIsEnumerable,P=S.splice,D=ue(w,"Map"),L=ue(Object,"create"),M=N?N.prototype:void 0,U=M?M.toString:void 0;function j(e){var t=-1,r=e?e.length:0;this.clear();while(++t-1}function Q(e,t){var r=this.__data__,n=ne(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function J(e){var t=-1,r=e?e.length:0;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=s}function Ae(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ie(e){return!!e&&"object"==typeof e}function Te(e){return"symbol"==typeof e||Ie(e)&&B.call(e)==u}function xe(e){return null==e?"":oe(e)}function Be(e,t){return null!=e&&le(e,t,ie)}e.exports=Be}).call(this,r("c8ba"))},2579:function(e,t,r){"use strict";var n=r("b80a"),i=r("fd47");e.exports=function(e){if(!n(e.then))throw new TypeError("Expected a promise");return function(t){e.then((function(e){i(t,null,e)}),(function(e){i(t,e)}))}}},"25d9":function(e,t){e.exports=o;var r=128,n=127,i=~n,s=Math.pow(2,31);function o(e,t,n){t=t||[],n=n||0;var a=n;while(e>=s)t[n++]=255&e|r,e/=128;while(e&i)t[n++]=255&e|r,e>>>=7;return t[n]=0|e,o.bytes=n-a+1,t}},"25e6":function(e,t,r){var n=r("dae2"),i=r("021d"),s=i;s.v1=n,s.v4=i,e.exports=s},"25ee":function(e,t,r){(function(t){var r="Input must be an string, Buffer or Uint8Array";function n(e){var n;if(e instanceof Uint8Array)n=e;else if(e instanceof t)n=new Uint8Array(e);else{if("string"!==typeof e)throw new Error(r);n=new Uint8Array(t.from(e,"utf8"))}return n}function i(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")}function s(e){return(4294967296+e).toString(16).substring(1)}function o(e,t,r){for(var n="\n"+e+" = ",i=0;i{Object(c["defineReadOnly"])(this,e,t[e])})}_startPending(){l.warn("WARNING: API provider does not support pending filters")}getSigner(e){return l.throwError("API provider does not support signing",o["Logger"].errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return l.throwError("not implemented; sub-classes must override getUrl",o["Logger"].errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const f=new o["Logger"](a["a"]),d="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class p extends h{static getApiKey(e){return null==e?d:(e&&"string"!==typeof e&&f.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/jsonrpc/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/jsonrpc/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/jsonrpc/";break;case"kovan":r="eth-kovan.alchemyapi.io/jsonrpc/";break;default:f.throwArgumentError("unsupported network","network",arguments[0])}return"https://"+r+t}}const y=new o["Logger"](a["a"]);class g extends h{static getApiKey(e){return null!=e&&y.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="https://cloudflare-eth.com/";break;default:y.throwArgumentError("unsupported network","network",arguments[0])}return r}}var m=r("549e"),b=r("baf7"),v=function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(t){s(t)}}function a(e){try{c(n["throw"](e))}catch(t){s(t)}}function c(e){e.done?r(e.value):i(e.value).then(o,a)}c((n=n.apply(e,t||[])).next())}))};const w=new o["Logger"](a["a"]);function _(e){const t=[];for(let r in e){if(null==e[r])continue;let n=Object(m["hexlify"])(e[r]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[r]&&(n=Object(m["hexValue"])(n)),t.push(r+"="+n)}return t.join("&")}function E(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}return e.result}function S(e){if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function k(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}class C extends s["a"]{constructor(e,t){w.checkNew(new.target,C),super(e);let r="invalid";this.network&&(r=this.network.name);let n=null;switch(r){case"homestead":n="https://api.etherscan.io";break;case"ropsten":n="https://api-ropsten.etherscan.io";break;case"rinkeby":n="https://api-rinkeby.etherscan.io";break;case"kovan":n="https://api-kovan.etherscan.io";break;case"goerli":n="https://api-goerli.etherscan.io";break;default:throw new Error("unsupported network")}Object(c["defineReadOnly"])(this,"baseUrl",n),Object(c["defineReadOnly"])(this,"apiKey",t)}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return v(this,void 0,void 0,(function*(){let n=this.baseUrl,i="";this.apiKey&&(i+="&apikey="+this.apiKey);const s=(e,t)=>v(this,void 0,void 0,(function*(){this.emit("debug",{action:"request",request:e,provider:this});const r=yield Object(b["a"])(e,null,t||S);return this.emit("debug",{action:"response",request:e,response:Object(c["deepCopy"])(r),provider:this}),r}));switch(e){case"getBlockNumber":return n+="/api?module=proxy&action=eth_blockNumber"+i,s(n);case"getGasPrice":return n+="/api?module=proxy&action=eth_gasPrice"+i,s(n);case"getBalance":return n+="/api?module=account&action=balance&address="+t.address,n+="&tag="+t.blockTag+i,s(n,E);case"getTransactionCount":return n+="/api?module=proxy&action=eth_getTransactionCount&address="+t.address,n+="&tag="+t.blockTag+i,s(n);case"getCode":return n+="/api?module=proxy&action=eth_getCode&address="+t.address,n+="&tag="+t.blockTag+i,s(n,S);case"getStorageAt":return n+="/api?module=proxy&action=eth_getStorageAt&address="+t.address,n+="&position="+t.position,n+="&tag="+t.blockTag+i,s(n,S);case"sendTransaction":return n+="/api?module=proxy&action=eth_sendRawTransaction&hex="+t.signedTransaction,n+=i,s(n).catch(e=>{throw e.responseText&&(e.responseText.toLowerCase().indexOf("insufficient funds")>=0&&w.throwError("insufficient funds",o["Logger"].errors.INSUFFICIENT_FUNDS,{}),e.responseText.indexOf("same hash was already imported")>=0&&w.throwError("nonce has already been used",o["Logger"].errors.NONCE_EXPIRED,{}),e.responseText.indexOf("another transaction with same nonce")>=0&&w.throwError("replacement fee too low",o["Logger"].errors.REPLACEMENT_UNDERPRICED,{})),e});case"getBlock":if(t.blockTag)return n+="/api?module=proxy&action=eth_getBlockByNumber&tag="+t.blockTag,t.includeTransactions?n+="&boolean=true":n+="&boolean=false",n+=i,s(n);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return n+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+t.transactionHash,n+=i,s(n);case"getTransactionReceipt":return n+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+t.transactionHash,n+=i,s(n);case"call":{let e=_(t.transaction);if(e&&(e="&"+e),n+="/api?module=proxy&action=eth_call"+e,"latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");return n+=i,s(n)}case"estimateGas":{let e=_(t.transaction);return e&&(e="&"+e),n+="/api?module=proxy&action=eth_estimateGas&"+e,n+=i,s(n)}case"getLogs":{if(n+="/api?module=logs&action=getLogs",t.filter.fromBlock&&(n+="&fromBlock="+k(t.filter.fromBlock)),t.filter.toBlock&&(n+="&toBlock="+k(t.filter.toBlock)),t.filter.address&&(n+="&address="+t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&w.throwError("unsupported topic count",o["Logger"].errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const e=t.filter.topics[0];"string"===typeof e&&66===e.length||w.throwError("unsupported topic format",o["Logger"].errors.UNSUPPORTED_OPERATION,{topic0:e}),n+="&topic0="+e}n+=i;const e=yield s(n,E);let r={};for(let t=0;t(n+="/api?module=account&action=txlist&address="+e,n+="&startblock="+t,n+="&endblock="+r,n+="&sort=asc"+i,this.emit("debug",{action:"request",request:n,provider:this}),Object(b["a"])(n,null,E).then(e=>{this.emit("debug",{action:"response",request:n,response:Object(c["deepCopy"])(e),provider:this});let t=[];return e.forEach(e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);let r=this.formatter.transactionResponse(e);e.timeStamp&&(r.timestamp=parseInt(e.timeStamp)),t.push(r)}),t})))}}var A=r("d4c7"),I=r("3a17"),T=function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(t){s(t)}}function a(e){try{c(n["throw"](e))}catch(t){s(t)}}function c(e){e.done?r(e.value):i(e.value).then(o,a)}c((n=n.apply(e,t||[])).next())}))};const x=new o["Logger"](a["a"]);function B(){return(new Date).getTime()}function R(e){let t=null;for(let r=0;rO(e)));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map(t=>{let r=e[t];return r="function"===typeof r?"[function]":O(r),JSON.stringify(t)+":"+r}).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let P=1;function D(e){return new Promise(t=>{const r=setTimeout(t,e);r.unref&&r.unref()})}function L(e,t){const r={provider:e.provider,weight:e.weight};return e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function M(e,t){return function(r){const n={};r.forEach(t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++});const i=Object.keys(n);for(let e=0;e=t)return r.result}}}function U(e,t,r){let n=O;switch(t){case"getBlockNumber":return function(t){const r=t.map(e=>e.result);let n=Math.ceil(N(t.map(e=>e.result)));return r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map(e=>e.result);return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return N(e.map(e=>e.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:(e=Object(c["shallowCopy"])(e),e.confirmations=-1,O(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:(e=Object(c["shallowCopy"])(e),e.transactions=e.transactions.map(e=>(e=Object(c["shallowCopy"])(e),e.confirmations=-1,e)),O(e))}:function(e){return null==e?null:O(e)};break;default:throw new Error("unknown method: "+t)}return M(n,e.quorum)}function j(e,t,r){switch(t){case"getBlockNumber":case"getGasPrice":return e[t]();case"getEtherPrice":if(e.getEtherPrice)return e.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return e[t](r.address,r.blockTag||"latest");case"getStorageAt":return e.getStorageAt(r.address,r.position,r.blockTag||"latest");case"getBlock":return e[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash);case"call":case"estimateGas":return e[t](r.transaction);case"getTransaction":case"getTransactionReceipt":return e[t](r.transactionHash);case"getLogs":return e.getLogs(r.filter)}return x.throwError("unknown method error",o["Logger"].errors.UNKNOWN_ERROR,{method:t,params:r})}class K extends s["a"]{constructor(e,t){x.checkNew(new.target,K),0===e.length&&x.throwArgumentError("missing providers","providers",e);const r=e.map((e,t)=>{if(n["b"].isProvider(e))return Object.freeze({provider:e,weight:1,stallTimeout:750,priority:1});const r=Object(c["shallowCopy"])(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=750),null==r.weight&&(r.weight=1);const i=r.weight;return(i%1||i>512||i<1)&&x.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,i),Object.freeze(r)}),i=r.reduce((e,t)=>e+t.weight,0);null==t?t=i/2:t>i&&x.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);const s=R(r.map(e=>e.provider.network));if(s)super(s);else{const e=Promise.all(r.map(e=>e.provider.getNetwork())).then(e=>R(e));super(e)}Object(c["defineReadOnly"])(this,"providerConfigs",Object.freeze(r)),Object(c["defineReadOnly"])(this,"quorum",t),this._highestBlockNumber=-1}perform(e,t){return T(this,void 0,void 0,(function*(){if("sendTransaction"===e)return Promise.all(this.providerConfigs.map(e=>e.provider.sendTransaction(t.signedTransaction).then(e=>e.hash,e=>e))).then(e=>{for(let t=0;tObject(c["shallowCopy"])(e)));n.sort((e,t)=>e.priority-t.priority);let i=0;while(1){const s=B();let o=n.filter(e=>e.runner&&s-e.starte+t.weight,0);while(o{r.staller=null}),r.runner=j(r.provider,e,t).then(n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:L(r,B()),request:{method:e,params:Object(c["deepCopy"])(t)},provider:this})},n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:L(r,B()),request:{method:e,params:Object(c["deepCopy"])(t)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:L(r,null),request:{method:e,params:Object(c["deepCopy"])(t)},provider:this}),o+=r.weight}const a=[];n.forEach(e=>{!e.done&&e.runner&&(a.push(e.runner),e.staller&&a.push(e.staller))}),a.length&&(yield Promise.race(a));const u=n.filter(e=>e.done&&null==e.error);if(u.length>=this.quorum){const e=r(u);if(void 0!==e)return e}if(0===n.filter(e=>!e.done).length)break}return x.throwError("failed to meet quorum",o["Logger"].errors.SERVER_ERROR,{method:e,params:t,results:n.map(e=>L(e)),provider:this})}))}}var F=r("3d68");const V=new o["Logger"](a["a"]),q="84842078b09946638c03157f83405213";class z extends h{static getApiKey(e){const t={apiKey:q,projectId:q,projectSecret:null};return null==e?t:("string"===typeof e?t.projectId=e:null!=e.projectSecret?("string"!==typeof e.projectId&&V.throwArgumentError("projectSecret requires a projectId","projectId",e.projectId),"string"!==typeof e.projectSecret&&V.throwArgumentError("invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId,t)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;default:V.throwError("unsupported network",o["Logger"].errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={url:"https://"+r+"/v3/"+t.projectId};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}const H=new o["Logger"](a["a"]),G="ETHERS_JS_SHARED";class $ extends h{static getApiKey(e){return e&&"string"!==typeof e&&H.throwArgumentError("invalid apiKey","apiKey",e),e||G}static getUrl(e,t){H.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:H.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const W=new o["Logger"](a["a"]);class Y extends u["a"]{constructor(e,t){W.checkNew(new.target,Y),super(e.host||e.path||"",t),e&&(e.sendAsync?this._sendAsync=e.sendAsync.bind(e):e.send&&(this._sendAsync=e.send.bind(e))),this._sendAsync||W.throwArgumentError("invalid web3Provider","web3Provider",e),Object(c["defineReadOnly"])(this,"provider",e)}send(e,t){return"eth_sign"==e&&this.provider.isMetaMask&&(e="personal_sign",t=[t[1],t[0]]),new Promise((r,n)=>{const i={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this._sendAsync(i,(function(e,t){if(e)n(e);else{if(t.error){const e=new Error(t.error.message);return e.code=t.error.code,e.data=t.error.data,void n(e)}r(t.result)}}))})}}var Q=r("7f06");r.d(t,"getDefaultProvider",(function(){return X})),r.d(t,"Provider",(function(){return n["b"]})),r.d(t,"BaseProvider",(function(){return s["a"]})),r.d(t,"FallbackProvider",(function(){return K})),r.d(t,"AlchemyProvider",(function(){return p})),r.d(t,"CloudflareProvider",(function(){return g})),r.d(t,"EtherscanProvider",(function(){return C})),r.d(t,"InfuraProvider",(function(){return z})),r.d(t,"JsonRpcProvider",(function(){return u["a"]})),r.d(t,"NodesmithProvider",(function(){return $})),r.d(t,"Web3Provider",(function(){return Y})),r.d(t,"IpcProvider",(function(){return F["a"]})),r.d(t,"JsonRpcSigner",(function(){return u["b"]})),r.d(t,"getNetwork",(function(){return i["a"]})),r.d(t,"Formatter",(function(){return Q["a"]}));const J=new o["Logger"](a["a"]);function X(e,t){null==e&&(e="homestead");const r=Object(i["a"])(e);return r&&r._defaultProvider||J.throwError("unsupported getDefaultProvider network",o["Logger"].errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:K,AlchemyProvider:p,CloudflareProvider:g,EtherscanProvider:C,InfuraProvider:z,JsonRpcProvider:u["a"],NodesmithProvider:$,Web3Provider:Y,IpcProvider:F["a"]},t)}},2612:function(e,t,r){e.exports={encode:r("af3a"),decode:r("fa45"),encodingLength:r("61f1")}},26137:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),i=self.crypto||self.msCrypto;e.exports=e=>{if("undefined"===typeof self||!self.crypto&&!self.msCrypto)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");return async t=>{switch(e){case"sha1":return n.from(await i.subtle.digest({name:"SHA-1"},t));case"sha2-256":return n.from(await i.subtle.digest({name:"SHA-256"},t));case"sha2-512":return n.from(await i.subtle.digest({name:"SHA-512"},t));case"dbl-sha2-256":{const e=await i.subtle.digest({name:"SHA-256"},t);return n.from(await i.subtle.digest({name:"SHA-256"},e))}default:throw new Error(`${e} is not a supported algorithm`)}}}},2632:function(e,t,r){"use strict";(function(t){const n=r("09a4"),i=r("6f12");e.exports=function(e){return n.variadic((async function(r,n){return t.concat(await i(e._catAsyncIterator(r,n)))}))}}).call(this,r("b639").Buffer)},2644:function(e,t,r){"use strict";const n=r("81f3");function i(e,t,r){"function"===typeof e.pipe?n(e,(e,n)=>{if(e)return r(e);t(n,r)}):t(e,r)}e.exports=i},2655:function(e,t){function r(e){return e&&"function"===typeof e.then}e.exports=r},"268b":function(e,t,r){"use strict";const n=r("cff5"),i=r("8b60"),s=r("9941"),o="sha2-256";e.exports=e=>{const t=32;function r(t){const r=(e,r)=>s(()=>t(e,r));let i;do{i=e(32)}while(!n.privateKeyVerify(i));r(null,i)}function a(e,t,r){const a=(e,t)=>s(()=>r(e,t));i.digest(t,o,(t,r)=>{if(t)return a(t);try{const t=n.sign(r,e),i=n.signatureExport(t.signature);return a(null,i)}catch(t){a(t)}})}function c(e,t,r,a){const c=(e,t)=>s(()=>a(e,t));i.digest(r,o,(r,i)=>{if(r)return c(r);try{t=n.signatureImport(t);const r=n.verify(i,t,e);return c(null,r)}catch(r){c(r)}})}function u(e){if(!n.publicKeyVerify(e))throw new Error("Invalid public key");return n.publicKeyConvert(e,!0)}function l(e){return n.publicKeyConvert(e,!1)}function h(e){if(!n.privateKeyVerify(e))throw new Error("Invalid private key")}function f(e){if(!n.publicKeyVerify(e))throw new Error("Invalid public key")}function d(e){return h(e),n.publicKeyCreate(e)}return{generateKey:r,privateKeyLength:t,hashAndSign:a,hashAndVerify:c,compressPublicKey:u,decompressPublicKey:l,validatePrivateKey:h,validatePublicKey:f,computePublicKey:d}}},"26a6":function(e,t,r){var n;(function(i){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",h=1e14,f=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(e){var t,r,n,i=L.prototype={constructor:L,toString:null,valueOf:null},s=new L(1),C=20,A=4,I=-7,T=21,x=-1e7,B=1e7,R=!1,N=1,O=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},D="0123456789abcdefghijklmnopqrstuvwxyz";function L(e,t){var i,s,a,u,h,p,y,g,m=this;if(!(m instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>B?m.c=m.e=null:e.e=10;h/=10,u++);return void(u>B?m.c=m.e=null:(m.e=u,m.c=[e]))}g=String(e)}else{if(!o.test(g=String(e)))return n(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(h=g.search(/e/i))>0?(u<0&&(u=h),u+=+g.slice(h+1),g=g.substring(0,h)):u<0&&(u=g.length)}else{if(_(t,2,D.length,"Base"),10==t)return m=new L(e),K(m,C+m.e+1,A);if(g=String(e),p="number"==typeof e){if(0*e!=0)return n(m,g,p,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,L.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(i=D.slice(0,t),u=h=0,y=g.length;hu){u=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,h=-1,u=0;continue}return n(m,String(e),p,t)}p=!1,g=r(g,t,10,m.s),(u=g.indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(h=0;48===g.charCodeAt(h);h++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(h,++y)){if(y-=h,p&&L.DEBUG&&y>15&&(e>d||e!==c(e)))throw Error(l+m.s*e);if((u=u-h-1)>B)m.c=m.e=null;else if(u=T)?S(c,o):k(c,o,"0");else if(e=K(new L(e),t,r),s=e.e,c=v(e.c),a=c.length,1==n||2==n&&(t<=s||s<=I)){for(;aa){if(--t>0)for(c+=".";t--;c+="0");}else if(t+=s-a,t>0)for(s+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function U(e,t){for(var r,n=1,i=new L(e[0]);n=10;i/=10,n++);return(r=n+r*f-1)>B?e.c=e.e=null:r=10;u/=10,i++);if(s=t-i,s<0)s+=f,o=t,l=g[d=0],y=l/m[i-o-1]%10|0;else if(d=a((s+1)/f),d>=g.length){if(!n)break e;for(;g.length<=d;g.push(0));l=y=0,i=1,s%=f,o=s-f+1}else{for(l=u=g[d],i=1;u>=10;u/=10,i++);s%=f,o=s-f+i,y=o<0?0:l/m[i-o-1]%10|0}if(n=n||t<0||null!=g[d+1]||(o<0?l:l%m[i-o-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(s>0?o>0?l/m[i-o]:0:g[d-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=m[(f-t%f)%f],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=d,u=1,d--):(g.length=d+1,u=m[f-s],g[d]=o>0?c(l/m[i-o]%m[o])*u:0),n)for(;;){if(0==d){for(s=1,o=g[0];o>=10;o/=10,s++);for(o=g[0]+=u,u=1;o>=10;o/=10,u++);s!=u&&(e.e++,g[0]==h&&(g[0]=1));break}if(g[d]+=u,g[d]!=h)break;g[d--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}e.e>B?e.c=e.e=null:e.e=T?S(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=m,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(r=e[t],_(r,0,g,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(r=e[t],_(r,0,8,t),A=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&(r=e[t],r&&r.pop?(_(r[0],-g,0,t),_(r[1],0,g,t),I=r[0],T=r[1]):(_(r,-g,g,t),I=-(T=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if(r=e[t],r&&r.pop)_(r[0],-g,-1,t),_(r[1],1,g,t),x=r[0],B=r[1];else{if(_(r,-g,g,t),!r)throw Error(u+t+" cannot be zero: "+r);x=-(B=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if(r=e[t],r!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw R=!r,Error(u+"crypto unavailable");R=r}else R=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(r=e[t],_(r,0,9,t),N=r),e.hasOwnProperty(t="POW_PRECISION")&&(r=e[t],_(r,0,g,t),O=r),e.hasOwnProperty(t="FORMAT")){if(r=e[t],"object"!=typeof r)throw Error(u+t+" not an object: "+r);P=r}if(e.hasOwnProperty(t="ALPHABET")){if(r=e[t],"string"!=typeof r||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);D=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:A,EXPONENTIAL_AT:[I,T],RANGE:[x,B],CRYPTO:R,MODULO_MODE:N,POW_PRECISION:O,FORMAT:P,ALPHABET:D}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&i>=-g&&i<=g&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if(t=(i+1)%f,t<1&&(t+=f),String(n[0]).length==t){for(t=0;t=h||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return U(arguments,i.lt)},L.minimum=L.min=function(){return U(arguments,i.gt)},L.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return c(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var r,n,i,o,l,h=0,d=[],y=new L(s);if(null==e?e=C:_(e,0,g),o=a(e/f),R)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(o*=2));h>>11),l>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[h]=n[0],r[h+1]=n[1]):(d.push(l%1e14),h+=2);h=o/2}else{if(!crypto.randomBytes)throw R=!1,Error(u+"crypto unavailable");for(r=crypto.randomBytes(o*=7);h=9e15?crypto.randomBytes(7).copy(r,h):(d.push(l%1e14),h+=7);h=o/7}if(!R)for(;h=10;l/=10,h++);hr-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,s,o,a){var c,u,l,h,f,d,p,y,g=n.indexOf("."),m=C,b=A;for(g>=0&&(h=O,O=0,n=n.replace(".",""),y=new L(i),d=y.pow(n.length-g),O=h,y.c=r(k(v(d.c),d.e,"0"),10,s,e),y.e=y.c.length),p=r(n,i,s,a?(c=D,e):(c=e,D)),l=h=p.length;0==p[--h];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(d.c=p,d.e=l,d.s=o,d=t(d,y,m,b,s),p=d.c,f=d.r,l=d.e),u=l+m+1,g=p[u],h=s/2,f=f||u<0||null!=p[u+1],f=b<4?(null!=g||f)&&(0==b||b==(d.s<0?3:2)):g>h||g==h&&(4==b||f||6==b&&1&p[u-1]||b==(d.s<0?8:7)),u<1||!p[0])n=f?k(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,f)for(--s;++p[--u]>s;)p[u]=0,u||(++l,p=[1].concat(p));for(h=p.length;!p[--h];);for(g=0,n="";g<=h;n+=c.charAt(p[g++]));n=k(n,l,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,i,s,o,a=0,c=e.length,u=t%y,l=t/y|0;for(e=e.slice();c--;)s=e[c]%y,o=e[c]/y|0,n=l*s+o*u,i=u*s+n%y*y+a,a=(i/r|0)+(n/y|0)+l*o,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;it[i]?1:-1;break}return s}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,s,o,a){var u,l,d,p,y,g,m,v,w,_,E,S,k,C,A,I,T,x=n.s==i.s?1:-1,B=n.c,R=i.c;if(!B||!B[0]||!R||!R[0])return new L(n.s&&i.s&&(B?!R||B[0]!=R[0]:R)?B&&0==B[0]||!R?0*x:x/0:NaN);for(v=new L(x),w=v.c=[],l=n.e-i.e,x=s+l+1,a||(a=h,l=b(n.e/f)-b(i.e/f),x=x/f|0),d=0;R[d]==(B[d]||0);d++);if(R[d]>(B[d]||0)&&l--,x<0)w.push(1),p=!0;else{for(C=B.length,I=R.length,d=0,x+=2,y=c(a/(R[0]+1)),y>1&&(R=e(R,y,a),B=e(B,y,a),I=R.length,C=B.length),k=I,_=B.slice(0,I),E=_.length;E=a/2&&A++;do{if(y=0,u=t(R,_,I,E),u<0){if(S=_[0],I!=E&&(S=S*a+(_[1]||0)),y=c(S/A),y>1){y>=a&&(y=a-1),g=e(R,y,a),m=g.length,E=_.length;while(1==t(g,_,m,E))y--,r(g,I=10;x/=10,d++);K(v,s+(v.e=d+l*f-1)+1,o,p)}else v.e=l,v.r=+p;return v}}(),n=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(s,o,a,c){var l,h=a?o:o.replace(i,"");if(n.test(h))s.s=isNaN(h)?null:h<0?-1:1;else{if(!a&&(h=h.replace(e,(function(e,t,r){return l="x"==(r=r.toLowerCase())?16:"b"==r?2:8,c&&c!=l?e:t})),c&&(l=c,h=h.replace(t,"$1").replace(r,"0.$1")),o!=h))return new L(h,l);if(L.DEBUG)throw Error(u+"Not a"+(c?" base "+c:"")+" number: "+o);s.s=null}s.c=s.e=null}}(),i.absoluteValue=i.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},i.comparedTo=function(e,t){return w(this,new L(e,t))},i.decimalPlaces=i.dp=function(e,t){var r,n,i,s=this;if(null!=e)return _(e,0,g),null==t?t=A:_(t,0,8),K(new L(s),e+s.e+1,t);if(!(r=s.c))return null;if(n=((i=r.length-1)-b(this.e/f))*f,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},i.dividedBy=i.div=function(e,r){return t(this,new L(e,r),C,A)},i.dividedToIntegerBy=i.idiv=function(e,r){return t(this,new L(e,r),0,1)},i.exponentiatedBy=i.pow=function(e,t){var r,n,i,o,l,h,d,p,y,g=this;if(e=new L(e),e.c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+F(e));if(null!=t&&(t=new L(t)),h=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return y=new L(Math.pow(+F(g),h?2-E(e):+F(e))),t?y.mod(t):y;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);n=!d&&g.isInteger()&&t.isInteger(),n&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||h&&g.c[1]>=24e7:g.c[0]<8e13||h&&g.c[0]<=9999975e7)))return o=g.s<0&&E(e)?-0:0,g.e>-1&&(o=1/o),new L(d?1/o:o);O&&(o=a(O/f+2))}for(h?(r=new L(.5),d&&(e.s=1),p=E(e)):(i=Math.abs(+F(e)),p=i%2),y=new L(s);;){if(p){if(y=y.times(g),!y.c)break;o?y.c.length>o&&(y.c.length=o):n&&(y=y.mod(t))}if(i){if(i=c(i/2),0===i)break;p=i%2}else if(e=e.times(r),K(e,e.e+1,1),e.e>14)p=E(e);else{if(i=+F(e),0===i)break;p=i%2}g=g.times(g),o?g.c&&g.c.length>o&&(g.c.length=o):n&&(g=g.mod(t))}return n?y:(d&&(y=s.div(y)),t?y.mod(t):o?K(y,O,A,l):y)},i.integerValue=function(e){var t=new L(this);return null==e?e=A:_(e,0,8),K(t,t.e+1,e)},i.isEqualTo=i.eq=function(e,t){return 0===w(this,new L(e,t))},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(e,t){return w(this,new L(e,t))>0},i.isGreaterThanOrEqualTo=i.gte=function(e,t){return 1===(t=w(this,new L(e,t)))||0===t},i.isInteger=function(){return!!this.c&&b(this.e/f)>this.c.length-2},i.isLessThan=i.lt=function(e,t){return w(this,new L(e,t))<0},i.isLessThanOrEqualTo=i.lte=function(e,t){return-1===(t=w(this,new L(e,t)))||0===t},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.minus=function(e,t){var r,n,i,s,o=this,a=o.s;if(e=new L(e,t),t=e.s,!a||!t)return new L(NaN);if(a!=t)return e.s=-t,o.plus(e);var c=o.e/f,u=e.e/f,l=o.c,d=e.c;if(!c||!u){if(!l||!d)return l?(e.s=-t,e):new L(d?o:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new L(l[0]?o:3==A?-0:0)}if(c=b(c),u=b(u),l=l.slice(),a=c-u){for((s=a<0)?(a=-a,i=l):(u=c,i=d),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(s=(a=l.length)<(t=d.length))?a:t,a=t=0;t0)for(;t--;l[r++]=0);for(t=h-1;n>a;){if(l[--n]=0;){for(r=0,p=S[i]%w,g=S[i]/w|0,o=c,s=i+o;s>i;)u=E[--o]%w,l=E[o]/w|0,a=g*u+l*p,u=p*u+a%w*w+m[s]+r,r=(u/v|0)+(a/w|0)+g*l,m[s--]=u%v;m[s]=r}return r?++n:m.splice(0,1),j(e,m,n)},i.negated=function(){var e=new L(this);return e.s=-e.s||null,e},i.plus=function(e,t){var r,n=this,i=n.s;if(e=new L(e,t),t=e.s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,n.minus(e);var s=n.e/f,o=e.e/f,a=n.c,c=e.c;if(!s||!o){if(!a||!c)return new L(i/0);if(!a[0]||!c[0])return c[0]?e:new L(a[0]?n:0*i)}if(s=b(s),o=b(o),a=a.slice(),i=s-o){for(i>0?(o=s,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for(i=a.length,t=c.length,i-t<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/h|0,a[t]=h===a[t]?0:a[t]%h;return i&&(a=[i].concat(a),++o),j(e,a,o)},i.precision=i.sd=function(e,t){var r,n,i,s=this;if(null!=e&&e!==!!e)return _(e,1,g),null==t?t=A:_(t,0,8),K(new L(s),e,t);if(!(r=s.c))return null;if(i=r.length-1,n=i*f+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&s.e+1>n&&(n=s.e+1),n},i.shiftedBy=function(e){return _(e,-d,d),this.times("1e"+e)},i.squareRoot=i.sqrt=function(){var e,r,n,i,s,o=this,a=o.c,c=o.s,u=o.e,l=C+4,h=new L("0.5");if(1!==c||!a||!a[0])return new L(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(c=Math.sqrt(+F(o)),0==c||c==1/0?(r=v(a),(r.length+u)%2==0&&(r+="0"),c=Math.sqrt(+r),u=b((u+1)/2)-(u<0||u%2),c==1/0?r="1e"+u:(r=c.toExponential(),r=r.slice(0,r.indexOf("e")+1)+u),n=new L(r)):n=new L(c+""),n.c[0])for(u=n.e,c=u+l,c<3&&(c=0);;)if(s=n,n=h.times(s.plus(t(o,s,l,1))),v(s.c).slice(0,c)===(r=v(n.c)).slice(0,c)){if(n.e0&&y>0){for(s=y%a||a,h=p.substr(0,s);s0&&(h+=l+p.slice(s)),d&&(h="-"+h)}n=f?h+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):h}return(r.prefix||"")+n+(r.suffix||"")},i.toFraction=function(e){var r,n,i,o,a,c,l,h,d,y,g,m,b=this,w=b.c;if(null!=e&&(l=new L(e),!l.isInteger()&&(l.c||1!==l.s)||l.lt(s)))throw Error(u+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+F(l));if(!w)return new L(b);for(r=new L(s),d=n=new L(s),i=h=new L(s),m=v(w),a=r.e=m.length-b.e-1,r.c[0]=p[(c=a%f)<0?f+c:c],e=!e||l.comparedTo(r)>0?a>0?r:d:l,c=B,B=1/0,l=new L(m),h.c[0]=0;;){if(y=t(l,r,0,1),o=n.plus(y.times(i)),1==o.comparedTo(e))break;n=i,i=o,d=h.plus(y.times(o=d)),h=o,r=l.minus(y.times(o=r)),l=o}return o=t(e.minus(n),i,0,1),h=h.plus(o.times(d)),n=n.plus(o.times(i)),h.s=d.s=b.s,a*=2,g=t(d,i,a,A).minus(b).abs().comparedTo(t(h,n,a,A).minus(b).abs())<1?[d,i]:[h,n],B=c,g},i.toNumber=function(){return+F(this)},i.toPrecision=function(e,t){return null!=e&&_(e,1,g),M(this,e,t,2)},i.toString=function(e){var t,n=this,i=n.s,s=n.e;return null===s?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=s<=I||s>=T?S(v(n.c),s):k(v(n.c),s,"0"):10===e?(n=K(new L(n),C+s+1,A),t=k(v(n.c),n.e,"0")):(_(e,2,D.length,"Base"),t=r(k(v(n.c),s,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},i.valueOf=i.toJSON=function(){return F(this)},i._isBigNumber=!0,null!=e&&L.set(e),L}function b(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,i=e.length,s=e[0]+"";nu^r?1:-1;for(a=(c=i.length)<(u=s.length)?c:u,o=0;os[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function _(e,t,r,n){if(er||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return b(e.e/f)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t>>t^e<<32-t}var a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function h(e,t){var r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),s(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),s(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),s(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),s(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),s(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),s(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),s(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(a),b:new Uint32Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(d(n,t),n.c=64),n}function d(e,t){for(var r=0;r>2]>>8*(3&r)&255;return t}function y(e,t,r){r=r||32,e=n.normalizeInput(e);var i=f(r,t);return d(i,e),p(i)}function g(e,t,r){var i=y(e,t,r);return n.toHex(i)}e.exports={blake2s:y,blake2sHex:g,blake2sInit:f,blake2sUpdate:d,blake2sFinal:p}},"26d5":function(e,t,r){"use strict";const{Buffer:n}=r("b639"),i=self.crypto||self.msCrypto;e.exports=e=>{if("undefined"===typeof self||!self.crypto&&!self.msCrypto)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");return async t=>{switch(e){case"sha1":return n.from(await i.subtle.digest({name:"SHA-1"},t));case"sha2-256":return n.from(await i.subtle.digest({name:"SHA-256"},t));case"sha2-512":return n.from(await i.subtle.digest({name:"SHA-512"},t));case"dbl-sha2-256":{const e=await i.subtle.digest({name:"SHA-256"},t);return n.from(await i.subtle.digest({name:"SHA-256"},e))}default:throw new Error(`${e} is not a supported algorithm`)}}}},27:function(e,t){},"276e":function(e,t,r){"use strict";(function(t){const n=r("c64e"),i=r("ec12"),s="/",o=t.from(s),a=o[0];class c{constructor(e,r){if("string"===typeof e?this._buf=t.from(e):t.isBuffer(e)&&(this._buf=e),null==r&&(r=!0),r&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error(`Invalid key: ${this.toString()}`)}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(e){return new h(e.join(s))}static random(){return new h(n().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=t.from(s)),this._buf[0]!==a&&(this._buf=t.concat([o,this._buf]));while(this._buf.length>1&&this._buf[this._buf.length-1]===a)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;ni)return!1}return t.length65536)throw new Error("Port number is not in range(1, 65536)");const s=f(i);return t.concat([n,s])}function v(e){const r=e.split(":");if(2!==r.length)throw new Error("failed to parse onion addr: "+r+" does not contain a port number");if(56!==r[0].length)throw new Error("failed to parse onion addr: "+r[0]+" not a Tor onion3 address.");const n=t.from(a.decode.asBytes(r[0].toUpperCase())),i=parseInt(r[1],10);if(i<1||i>65536)throw new Error("Port number is not in range(1, 65536)");const s=f(i);return t.concat([n,s])}function w(e){const t=e.slice(0,e.length-2),r=e.slice(e.length-2),n=a.encode(t).toString("ascii").toLowerCase(),i=d(r);return n+":"+i}e.exports=u,u.toString=function(e,t){switch(e=s(e),e.code){case 4:case 41:return h(t);case 6:case 273:case 33:case 132:return d(t);case 53:case 54:case 55:case 56:case 400:return y(t);case 421:return m(t);case 444:return w(t);case 445:return w(t);default:return t.toString("hex")}},u.toBuffer=function(e,r){switch(e=s(e),e.code){case 4:return l(r);case 41:return l(r);case 6:case 273:case 33:case 132:return f(parseInt(r,10));case 53:case 54:case 55:case 56:case 400:return p(r);case 421:return g(r);case 444:return b(r);case 445:return v(r);default:return t.from(r,"hex")}}}).call(this,r("b639").Buffer)},2773:function(e,t,r){"use strict";const n=r("e3d5"),i=r("1a76"),s=r("0c9a");e.exports={codec:s.RAW,defaultHashAlg:s.SHA2_256,resolver:{resolve:(e,t)=>({value:e,remainderPath:""}),tree:e=>({done:!0})},util:{deserialize:e=>e,serialize:e=>e,cid:async(t,r)=>{const o={cidVersion:1,hashAlg:e.exports.defaultHashAlg},a=Object.assign(o,r),c=await i(t,a.hashAlg),u=s.print[e.exports.codec],l=new n(a.cidVersion,u,c);return l}}}},2776:function(e,t,r){(function(t,n){var i=r("0bac"),s=r("7ec1"),o=r("f7ae"),a=r("d7a8"),c=Object.prototype.hasOwnProperty,u="start end gt gte lt lte".split(" ");function l(e){this.status="new",this.supports=s(e,{status:!0})}function h(e,t){var r={};for(var n in t)if(c.call(t,n)){var i=t[n];f(n)&&(i=e._serializeKey(i)),r[n]=i}return r}function f(e){return-1!==u.indexOf(e)}l.prototype.open=function(e,t){var r=this,n=this.status;if("function"===typeof e&&(t=e),"function"!==typeof t)throw new Error("open() requires a callback argument");"object"===typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},l.prototype._open=function(e,r){t.nextTick(r)},l.prototype.close=function(e){var t=this,r=this.status;if("function"!==typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},l.prototype._close=function(e){t.nextTick(e)},l.prototype.get=function(e,r,n){if("function"===typeof r&&(n=r),"function"!==typeof n)throw new Error("get() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"===typeof r&&null!==r||(r={}),r.asBuffer=!1!==r.asBuffer,this._get(e,r,n)},l.prototype._get=function(e,r,n){t.nextTick((function(){n(new Error("NotFound"))}))},l.prototype.put=function(e,r,n,i){if("function"===typeof n&&(i=n),"function"!==typeof i)throw new Error("put() requires a callback argument");var s=this._checkKey(e)||this._checkValue(r);if(s)return t.nextTick(i,s);e=this._serializeKey(e),r=this._serializeValue(r),"object"===typeof n&&null!==n||(n={}),this._put(e,r,n,i)},l.prototype._put=function(e,r,n,i){t.nextTick(i)},l.prototype.del=function(e,r,n){if("function"===typeof r&&(n=r),"function"!==typeof n)throw new Error("del() requires a callback argument");var i=this._checkKey(e);if(i)return t.nextTick(n,i);e=this._serializeKey(e),"object"===typeof r&&null!==r||(r={}),this._del(e,r,n)},l.prototype._del=function(e,r,n){t.nextTick(n)},l.prototype.batch=function(e,r,n){if(!arguments.length)return this._chainedBatch();if("function"===typeof r&&(n=r),"function"===typeof e&&(n=e),"function"!==typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return t.nextTick(n,new Error("batch(array) requires an array argument"));if(0===e.length)return t.nextTick(n);"object"===typeof r&&null!==r||(r={});for(var s=new Array(e.length),o=0;o{let t=0,r=e.node.size||e.node.length;return e.unixfs&&(r=e.unixfs.fileSize(),t=a[e.unixfs.type]),{cid:e.cid,name:e.name,type:t,size:r}};e.exports=e=>async function*(t=o,r={}){"object"!==typeof t||t instanceof String||(r=t,t=o),r=i(r,c);const a=await s(e,t),l=await n(a.mfsPath,e.ipld);if(l.unixfs&&l.unixfs.type.includes("directory"))for await(const e of l.content(r))yield u(e);else yield u(l)}},"27a7":function(e,t,r){(function(r,n){"use strict";var i={version:"3.0.1",x86:{},x64:{}};function s(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function o(e,t){return e<>>32-t}function a(e){return e^=e>>>16,e=s(e,2246822507),e^=e>>>13,e=s(e,3266489909),e^=e>>>16,e}function c(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function u(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function l(e,t){return t%=64,32===t?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function h(e,t){return t%=64,0===t?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=u(e,[4283543511,3981806797]),e=f(e,[0,e[0]>>>1]),e=u(e,[3301882366,444984403]),e=f(e,[0,e[0]>>>1]),e}i.x86.hash32=function(e,t){e=e||"",t=t||0;for(var r=e.length%4,n=e.length-r,i=t,c=0,u=3432918353,l=461845907,h=0;h>>0},i.x86.hash128=function(e,t){e=e||"",t=t||0;for(var r=e.length%16,n=e.length-r,i=t,c=t,u=t,l=t,h=0,f=0,d=0,p=0,y=597399067,g=2869860233,m=951274213,b=2716044179,v=0;v>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(u>>>0).toString(16)).slice(-8)+("00000000"+(l>>>0).toString(16)).slice(-8)},i.x64.hash128=function(e,t){e=e||"",t=t||0;for(var r=e.length%16,n=e.length-r,i=[0,t],s=[0,t],o=[0,0],a=[0,0],p=[2277735313,289559509],y=[1291169091,658871167],g=0;g>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=i),t.murmurHash3=i})()},"27cd":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=g;var n=r("9868"),i=d(n),s=r("532e"),o=d(s),a=r("2cf9"),c=d(a),u=r("c1cd"),l=d(u),h=r("76bf"),f=d(h);function d(e){return e&&e.__esModule?e:{default:e}}function p(e,t,r,n){var i=new Array(t.length);e(t,(function(e,t,n){r(e,(function(e,r){i[t]=!!r,n(e)}))}),(function(e){if(e)return n(e);for(var r=[],s=0;s{for(const n of r.topics)if(n===e){t.push(r.msgID);break}});return t}shift(){const e=this.history[this.history.length-1];e.forEach(e=>{this.msgs.delete(e.msgID)}),this.history.pop(),this.history.unshift([])}}e.exports={CacheEntry:i,MessageCache:s}},"282f":function(e,t,r){var n=r("5995");r("31a0"),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){e&&this._input.putBuffer(e);while(!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},2835:function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function s(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,r,n,s){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new o(r,n||e,s),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function c(e,t){0===--e._eventsCount?e._events=new s:delete e._events[t]}function u(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,o=new Array(s);n{t=Object(o["arrayify"])(t);const r=t.slice(0,16),n=t.slice(16,32),i=t.slice(32,64),a=new p.a.Counter(m),c=new p.a.ModeOfOperation.ctr(r,a),_=Object(o["arrayify"])(c.encrypt(s)),k=Object(u["a"])(Object(o["concat"])([n,_])),C={address:e.address.substring(2).toLowerCase(),id:B.a.v4({random:b}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(o["hexlify"])(m).substring(2)},ciphertext:Object(o["hexlify"])(_).substring(2),kdf:"scrypt",kdfparams:{salt:Object(o["hexlify"])(g).substring(2),n:v,dklen:32,p:S,r:E},mac:k.substring(2)}};if(l){const e=Object(h["randomBytes"])(16),t=new p.a.Counter(e),r=new p.a.ModeOfOperation.ctr(i,t),n=Object(o["arrayify"])(r.encrypt(l)),s=new Date,a=s.getUTCFullYear()+"-"+w(s.getUTCMonth()+1,2)+"-"+w(s.getUTCDate(),2)+"T"+w(s.getUTCHours(),2)+"-"+w(s.getUTCMinutes(),2)+"-"+w(s.getUTCSeconds(),2)+".0Z";C["x-ethers"]={client:y,gethFilename:"UTC--"+a+"--"+C.address,mnemonicCounter:Object(o["hexlify"])(e).substring(2),mnemonicCiphertext:Object(o["hexlify"])(n).substring(2),path:f,locale:d,version:"0.1"}}return JSON.stringify(C)})}function U(e,t,r){if(A(e)){r&&r(0);const n=C(e,t);return r&&r(1),Promise.resolve(n)}return I(e)?L(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}const j="wallet/5.0.0-beta.137";r.d(t,"Wallet",(function(){return q})),r.d(t,"verifyMessage",(function(){return z}));const K=new m["Logger"](j);function F(e){return null!=e&&Object(o["isHexString"])(e.privateKey,32)&&null!=e.address}function V(e){const t=e.mnemonic;return t&&t.phrase}class q extends s["a"]{constructor(e,t){if(K.checkNew(new.target,q),super(),F(e)){const t=new f["a"](e.privateKey);if(Object(l["defineReadOnly"])(this,"_signingKey",()=>t),Object(l["defineReadOnly"])(this,"address",Object(R["a"])(this.publicKey)),this.address!==Object(n["a"])(e.address)&&K.throwArgumentError("privateKey/address mismatch","privateKey","[REDCACTED]"),V(e)){const t=e.mnemonic;Object(l["defineReadOnly"])(this,"_mnemonic",()=>({phrase:t.phrase,path:t.path||c["defaultPath"],locale:t.locale||"en"}));const r=this.mnemonic,n=c["HDNode"].fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);Object(R["a"])(n.privateKey)!==this.address&&K.throwArgumentError("mnemonic/address mismatch","privateKey","[REDCACTED]")}else Object(l["defineReadOnly"])(this,"_mnemonic",()=>null)}else{if(f["a"].isSigningKey(e))"secp256k1"!==e.curve&&K.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Object(l["defineReadOnly"])(this,"_signingKey",()=>e);else{const t=new f["a"](e);Object(l["defineReadOnly"])(this,"_signingKey",()=>t)}Object(l["defineReadOnly"])(this,"_mnemonic",()=>null),Object(l["defineReadOnly"])(this,"address",Object(R["a"])(this.publicKey))}t&&!i["b"].isProvider(t)&&K.throwArgumentError("invalid provider","provider",t),Object(l["defineReadOnly"])(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new q(this,e)}signTransaction(e){return Object(l["resolveProperties"])(e).then(e=>{if(null!=e.from){if(Object(n["a"])(e.from)!==this.address)throw new Error("transaction from address mismatch");delete e.from}const t=this._signingKey().signDigest(Object(u["a"])(Object(R["d"])(e)));return Object(R["d"])(e,t)})}signMessage(e){return Promise.resolve(Object(o["joinSignature"])(this._signingKey().signDigest(Object(a["hashMessage"])(e))))}encrypt(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),M(this,e,t,r)}static createRandom(e){let t=Object(h["randomBytes"])(16);e||(e={}),e.extraEntropy&&(t=Object(o["arrayify"])(Object(o["hexDataSlice"])(Object(u["a"])(Object(o["concat"])([t,e.extraEntropy])),0,16)));const r=Object(c["entropyToMnemonic"])(t,e.locale);return q.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return U(e,t,r).then(e=>new q(e))}static fromMnemonic(e,t,r){return t||(t=c["defaultPath"]),new q(c["HDNode"].fromMnemonic(e,null,r).derivePath(t))}}function z(e,t){return Object(R["c"])(Object(a["hashMessage"])(e),t)}},"289f":function(e,t,r){"use strict";(function(t){const n=r("021d"),i=r("87dd"),s="/",o=t.from(s),a=o[0];class c{constructor(e,r){if("string"===typeof e?this._buf=t.from(e):t.isBuffer(e)&&(this._buf=e),null==r&&(r=!0),r&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error(`Invalid key: ${this.toString()}`)}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(e){return new f(e.join(s))}static random(){return new f(n().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=t.from(s)),this._buf[0]!==a&&(this._buf=t.concat([o,this._buf]));while(this._buf.length>1&&this._buf[this._buf.length-1]===a)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;ni)return!1}return t.lengthe.namespaces()))])}}function u(e){const t=e.split(":");return t.length<2?"":t.slice(0,-1).join(":")}function l(e){const t=e.split(":");return t[t.length-1]}function h(e){return[].concat(...e)}const f=i(c,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=f}).call(this,r("b639").Buffer)},"28a7":function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return y}));
+/*! MIT License © Sindre Sorhus */
+const n={};{const t=t=>{let r;if("undefined"!==typeof self&&self&&t in self&&(r=self),"undefined"!==typeof window&&window&&t in window&&(r=window),"undefined"!==typeof e&&e&&t in e&&(r=e),"undefined"!==typeof globalThis&&globalThis&&(r=globalThis),"undefined"===typeof r)return;const n=r[t];return"function"===typeof n?n.bind(r):n},r=["document","Headers","Request","Response","ReadableStream","fetch","AbortController","FormData"],i={};for(const e of r)i[e]={get(){return t(e)}};Object.defineProperties(n,i)}const i=e=>null!==e&&"object"===typeof e,s="function"===typeof n.AbortController,o="function"===typeof n.ReadableStream,a="function"===typeof n.FormData,c=(...e)=>{let t={};for(const r of e)if(Array.isArray(r))Array.isArray(t)||(t=[]),t=[...t,...r];else if(i(r))for(let[e,n]of Object.entries(r))i(n)&&Reflect.has(t,e)&&(n=c(t[e],n)),t={...t,[e]:n};return t},u=["get","post","put","patch","head","delete"],l={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},h=new Set(["get","put","head","delete","options","trace"]),f=new Set([408,413,429,500,502,503,504]),d=new Set([413,429,503]);class p extends Error{constructor(e){super(e.statusText),this.name="HTTPError",this.response=e}}class y extends Error{constructor(){super("Request timed out"),this.name="TimeoutError"}}const g=(e,t,r)=>(r>2147483647&&t(new RangeError("The `timeout` option cannot be greater than 2147483647")),setTimeout(e,r)),m=e=>new Promise((t,r)=>g(t,r,e)),b=(e,t,r)=>new Promise((n,i)=>{const o=g(()=>{s&&r.abort(),i(new y)},i,t);e.then(n).catch(i).then(()=>{clearTimeout(o)})}),v=e=>u.includes(e)?e.toUpperCase():e,w={limit:2,methods:h,statusCodes:f,afterStatusCodes:d},_=e=>{if("number"===typeof e)return{...w,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...w,...e,methods:e.methods?new Set(e.methods):w.methods,statusCodes:e.statusCodes?new Set(e.statusCodes):w.statusCodes,afterStatusCodes:d}};class E{constructor(e,{timeout:t=1e4,hooks:r,throwHttpErrors:i=!0,searchParams:u,json:h,retry:f={},...d}){if(this._retryCount=0,this._options={method:"get",credentials:"same-origin",retry:_(f),...d},e instanceof n.Request)this._input=e,this._options={...this._options,method:d.method||e.method,headers:d.headers||e.headers,body:d.body||e.body,credentials:d.credentials||e.credentials};else{if(!(e instanceof URL||"string"===typeof e))throw new TypeError("`input` must be a string, URL, or Request");if(this._input=String(e||""),this._options.prefixUrl=String(this._options.prefixUrl||""),this._options.prefixUrl&&this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");if(this._options.prefixUrl&&!this._options.prefixUrl.endsWith("/")&&(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input,u){const e=new URL(this._input,n.document&&n.document.baseURI);if("string"===typeof u||URLSearchParams&&u instanceof URLSearchParams)e.search=u;else{if(!Object.values(u).every(e=>"number"===typeof e||"string"===typeof e))throw new Error("The `searchParams` option must be either a string, `URLSearchParams` instance or an object with string and number values");e.search=new URLSearchParams(u).toString()}this._input=e.toString()}}s&&(this.abortController=new n.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",()=>{this.abortController.abort()}),this._options.signal=this.abortController.signal),this._options.method=v(this._options.method),this._timeout=t,this._hooks=c({beforeRequest:[],beforeRetry:[],afterResponse:[]},r),this._throwHttpErrors=i;const y=new n.Headers(this._options.headers||{});if((a&&this._options.body instanceof n.FormData||this._options.body instanceof URLSearchParams)&&y.has("content-type"))throw new Error(`The \`content-type\` header cannot be used with a ${this._options.body.constructor.name} body. It will be set automatically.`);if(h){if(this._options.body)throw new Error("The `json` option cannot be used with the `body` option");y.set("content-type","application/json"),this._options.body=JSON.stringify(h)}this._options.headers=y;const g=async()=>{await m(1);let e=await this._fetch();for(const t of this._hooks.afterResponse){const r=await t(this._input,this._options,e.clone());r instanceof n.Response&&(e=r)}if(!e.ok&&this._throwHttpErrors)throw new p(e);if(this._options.onDownloadProgress){if("function"!==typeof this._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!o)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return this._stream(e.clone(),this._options.onDownloadProgress)}return e},b=this._options.retry.methods.has(this._options.method.toLowerCase()),w=b?this._retry(g):g();for(const[n,s]of Object.entries(l))w[n]=async()=>(y.set("accept",s),(await w).clone()[n]());return w}_calculateRetryDelay(e){if(this._retryCount++,this._retryCountthis._options.retry.maxRetryAfter?0:e}if(413===e.response.status)return 0}const t=.3;return t*2**(this._retryCount-1)*1e3}return 0}async _retry(e){try{return await e()}catch(t){const r=this._calculateRetryDelay(t);if(0!==r&&this._retryCount>0){await m(r);for(const e of this._hooks.beforeRetry)await e(this._input,this._options,t,this._retryCount);return this._retry(e)}if(this._throwHttpErrors)throw t}}async _fetch(){for(const e of this._hooks.beforeRequest){const t=await e(this._input,this._options);if(t instanceof Response)return t}return!1===this._timeout?n.fetch(this._input,this._options):b(n.fetch(this._input,this._options),this._timeout,this.abortController)}_stream(e,t){const r=Number(e.headers.get("content-length"))||0;let i=0;return new n.Response(new n.ReadableStream({start(n){const s=e.body.getReader();async function o(){const{done:e,value:a}=await s.read();if(e)n.close();else{if(t){i+=a.byteLength;const e=0===r?0:i/r;t({percent:e,transferredBytes:i,totalBytes:r},a)}n.enqueue(a),o()}}t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),o()}}))}}const S=(...e)=>{for(const t of e)if((!i(t)||Array.isArray(t))&&"undefined"!==typeof t)throw new TypeError("The `options` argument must be an object");return c({},...e)},k=e=>{const t=(t,r)=>new E(t,S(e,r));for(const r of u)t[r]=(t,n)=>new E(t,S(e,n,{method:r}));return t.create=e=>k(S(e)),t.extend=t=>k(S(e,t)),t};t["c"]=k()}).call(this,r("c8ba"))},"28d3":function(e,t,r){"use strict";(function(t){function r(e,r){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(o,this,e)):t.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!r&&e?s._writableState?s._writableState.errorEmitted?t.nextTick(i,s):(s._writableState.errorEmitted=!0,t.nextTick(n,s,e)):t.nextTick(n,s,e):r?(t.nextTick(i,s),r(e)):t.nextTick(i,s)})),this)}function n(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}function a(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:r,undestroy:s,errorOrDestroy:a}}).call(this,r("4362"))},"28d37":function(e,t,r){var n=r("9bc4"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,o=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(s,"$1"):r||e)})),t}));e.exports=o},"28e5":function(e,t,r){"use strict";const n=r("c59f"),i=r("21b4"),{DIAL_ABORTED:s}=r("a10a"),o=r("9f2e"),a=r("65b6"),{QUARTER_HOUR:c,PRIORITY_HIGH:u}=r("0d8d"),l=r("4bc2"),h=l("libp2p:switch:dial:manager"),f=()=>{};class d{constructor(e){this._queue=new Set,this._coldCallQueue=new Set,this._dialingQueues=new Set,this._queues={},this.switch=e,this._cleanInterval=a(this._clean.bind(this),c),this.start()}_clean(){const e=Object.values(this._queues);e.forEach(e=>{if(e.denylisted===1/0)return e.abort(),void delete this._queues[e.id];if(!e.denylisted&&!e.isRunning&&e.length<1){let r=!1;try{const t=this.switch._peerBook.get(e.id);r=Boolean(t.isConnected())}catch(t){}r||(e.abort(),delete this._queues[e.id])}}),this._cleanInterval.reschedule(c)}start(){this.isRunning=!0}stop(){this.isRunning=!1,this._queue.clear(),this._coldCallQueue.clear(),this._cleanInterval.clear();const e=Object.values(this._queues);e.forEach(e=>{e.abort(),delete this._queues[e.id]})}add({peerInfo:e,protocol:t,options:r,callback:i}){i=i?n(i):f;const a=this.getQueue(e);if(r.priority>u){if(this._coldCallQueue.size>=this.switch.dialer.MAX_COLD_CALLS)return o(i,s());if(this._queue.has(a.id))return o(i,s())}a.add(t,r.useFSM,i),e.isConnected()?a.start():a.isDialAllowed()&&(a.isRunning||(r.priority<=u?(this._queue.add(a.id),this._coldCallQueue.delete(a.id)):this._coldCallQueue.add(a.id)),this.run())}run(){if(this.isRunning&&this._dialingQueues.size0?(e=this._queue.values().next(),this._queue.delete(e.value)):this._coldCallQueue.size>0&&(e=this._coldCallQueue.values().next(),this._coldCallQueue.delete(e.value)),e.done)return;const t=this._queues[e.value];if(!t)return void h("missing queue %s, maybe it was aborted?",e.value);this._dialingQueues.add(t.id),t.start()}}clearDenylist(e){const t=this.getQueue(e);t.denylisted=null,t.denylistCount=0}_onQueueStopped(e){this._dialingQueues.delete(e),this.run()}getQueue(e){const t=e.id.toB58String();return this._queues[t]=this._queues[t]||new i(t,this.switch,this._onQueueStopped.bind(this)),this._queues[t]}}e.exports=d},2957:function(e,t,r){e.exports=r.p+"media/Kaytranada10.6fd40029.mp3"},"297e":function(e,t){function r(e,t,r,n){var i=e.length,s=r+(n?1:-1);while(n?s--:++si(n=>{const i=r.init(e,null);return r.update(i,n),t.from(r.digest(i))});e.exports=e=>{for(let t=0;t<64;t++)e[s+t]=u(t+1,a);for(let t=0;t<32;t++)e[o+t]=u(t+1,c)}}).call(this,r("b639").Buffer)},"29c7":function(e,t,r){"use strict";function n(e,t,r){const n=e===t;r(null,n)}e.exports=n},"29e1":function(e,t,r){"use strict";(function(t){e.exports=l;var n=r("f522").AbstractLevelDOWN,i=r("c3bb"),s=r("230c"),o=r("d13e"),a=r("a6a3"),c=r("f689"),u="level-js-";function l(e,t){if(!(this instanceof l))return new l(e,t);if(n.call(this),t=t||{},"string"!==typeof e)throw new Error("constructor requires a location string argument");this.location=e,this.prefix=null==t.prefix?u:t.prefix,this.version=parseInt(t.version||1,10)}i(l,n),l.binaryKeys=c.binaryKeys(indexedDB),l.arrayKeys=c.arrayKeys(indexedDB),l.prototype._open=function(e,t){var r=indexedDB.open(this.prefix+this.location,this.version),n=this;r.onerror=function(){t(r.error||new Error("unknown error"))},r.onsuccess=function(){n.db=r.result,t()},r.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(n.location)||t.createObjectStore(n.location)}},l.prototype.store=function(e){var t=this.db.transaction([this.location],e);return t.objectStore(this.location)},l.prototype.await=function(e,t){var r=e.transaction;r.onabort=function(){t(r.error||new Error("aborted by user"))},r.oncomplete=function(){t(null,e.result)}},l.prototype._get=function(e,t,r){var n=this.store("readonly");try{var i=n.get(e)}catch(s){return a((function(){r(s)}))}this.await(i,(function(e,n){return e?r(e):void 0===n?r(new Error("NotFound")):(t.asBuffer&&(n=o(n)),void r(null,n))}))},l.prototype._del=function(e,t,r){var n=this.store("readwrite");try{var i=n.delete(e)}catch(s){return a((function(){r(s)}))}this.await(i,r)},l.prototype._put=function(e,t,r,n){var i=this.store("readwrite");try{var s=i.put(t,e)}catch(o){return a((function(){n(o)}))}this.await(s,n)},l.prototype._serializeKey=function(e){return t.isBuffer(e)?l.binaryKeys?e:e.toString():Array.isArray(e)?l.arrayKeys?e.map(this._serializeKey,this):String(e):e},l.prototype._serializeValue=function(e){return e},l.prototype._iterator=function(e){return new s(this,this.location,e)},l.prototype._batch=function(e,t,r){if(0===e.length)return a(r);var n,i=this.store("readwrite"),s=i.transaction,o=0;function c(){var t=e[o++],r=t.key;try{var a="del"===t.type?i.delete(r):i.put(t.value,r)}catch(u){return n=u,void s.abort()}o0&&void 0!==arguments[0]&&arguments[0];function t(t){var r=t.r,n=t.s,i=t.recoveryParam,s=a.Buffer.alloc(e?65:64);if(a.Buffer.from(r,"hex").copy(s,0),a.Buffer.from(n,"hex").copy(s,32),e){if(void 0===i)throw new Error("Signer did not return a recoveryParam");s[64]=i}return o.default.encode(s)}return(function(){var e=(0,s.default)(i.default.mark((function e(r,n){var s;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n(r);case 2:return s=e.sent,e.abrupt("return",t(s));case 4:case"end":return e.stop()}}),e,this)})));function r(t,r){return e.apply(this,arguments)}return r}())}function u(){return function(){var e=(0,s.default)(i.default.mark((function e(t,r){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",r(t));case 1:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()}var l={ES256K:c(),"ES256K-R":c(!0),Ed25519:u()};function h(e){var t=l[e];if(!t)throw new Error("Unsupported algorithm ".concat(e));return t}e.exports=h},"2a68":function(e,t,r){"use strict";e.exports=function(){return function(e,t){t(!0)}}},"2abf":function(e,t,r){var n=r("7b77"),i=r("7be9");e.exports=function(){var e=n(),t=i();return{source:e,sink:t,resolve:function(r){e.resolve(r.source),t.resolve(r.sink)}}}},"2abf3":function(e,t,r){"use strict";e.exports="\nmessage RPC {\n repeated SubOpts subscriptions = 1;\n repeated Message msgs = 2;\n\n message SubOpts {\n optional bool subscribe = 1; // subscribe or unsubcribe\n optional string topicID = 2;\n }\n\n message Message {\n optional bytes from = 1;\n optional bytes data = 2;\n optional bytes seqno = 3;\n repeated string topicIDs = 4;\n optional bytes signature = 5;\n optional bytes key = 6;\n }\n}"},"2b3e":function(e,t,r){var n=r("d0b2"),i=r("98c9"),s=Object.prototype,o=s.hasOwnProperty,a=s.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},"2b65":function(e,t){e.exports=function(e){if(e){if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();if("function"===typeof e.next)return e}throw new Error("argument is not an iterator or iterable")}},"2bbd":function(e,t,r){"use strict";const{filter:n,sortAll:i,take:s,map:o}=r("917c"),a=r("276e"),c=r("8859");class u{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){const t=await this.has(e);if(!t)throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=o(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>i(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=s(t,e.limit)),!0===e.keysOnly&&(t=o(t,e=>({key:e.key}))),t}async close(){}}e.exports=u},"2bbf":function(e,t,r){"use strict";const n="[a-fA-F\\d:]",i=e=>e&&e.includeBoundaries?`(?:(?<=\\s|^)(?=${n})|(?<=${n})(?=\\s|$))`:"",s="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",a=`\n(\n(?:${o}:){7}(?:${o}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${o}:){6}(?:${s}|:${o}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${o}:){5}(?::${s}|(:${o}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${o}:){4}(?:(:${o}){0,1}:${s}|(:${o}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${o}:){3}(?:(:${o}){0,2}:${s}|(:${o}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${o}:){2}(?:(:${o}){0,3}:${s}|(:${o}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${o}:){1}(?:(:${o}){0,4}:${s}|(:${o}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::((?::${o}){0,5}:${s}|(?::${o}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),c=e=>e&&e.exact?new RegExp(`(?:^${s}$)|(?:^${a}$)`):new RegExp(`(?:${i(e)}${s}${i(e)})|(?:${i(e)}${a}${i(e)})`,"g");c.v4=e=>e&&e.exact?new RegExp(`^${s}$`):new RegExp(`${i(e)}${s}${i(e)}`,"g"),c.v6=e=>e&&e.exact?new RegExp(`^${a}$`):new RegExp(`${i(e)}${a}${i(e)}`,"g"),e.exports=c},"2bdd":function(e,t,r){"use strict";const n=r("f654"),i=r("770a"),s={stat:r("5f7e")},o={cp:r("6da9"),flush:r("d2f9"),mkdir:r("c9b5"),mv:r("3faa9"),rm:r("be69")},a={write:r("8904"),read:r("40ee"),ls:r("2794")},c=({options:e,mfs:t,operations:r,lock:n})=>{Object.keys(r).forEach(i=>{t[i]=n(r[i](e))})},u={repoOwner:!0,ipld:null,repo:null};e.exports=e=>{const{repoOwner:t}=Object.assign({},u||{},e);n(e.ipld,"MFS requires an IPLD instance"),n(e.blocks,"MFS requires an BlockStore instance"),n(e.datastore,"MFS requires a DataStore instance"),e.repo={blocks:e.blocks,datastore:e.datastore};const r=i(t),l=e=>r.readLock(e),h=e=>r.writeLock(e),f={};return c({options:e,mfs:f,operations:s,lock:l}),c({options:e,mfs:f,operations:o,lock:h}),Object.keys(a).forEach(t=>{f[t]=a[t](e)}),f}},"2bff":function(e,t,r){"use strict";(function(t,n){var i;e.exports=x,x.ReadableState=T;r("faa1").EventEmitter;var s=function(e,t){return e.listeners(t).length},o=r("5329"),a=r("b639").Buffer,c=t.Uint8Array||function(){};function u(e){return a.from(e)}function l(e){return a.isBuffer(e)||e instanceof c}var h,f=r(10);h=f&&f.debuglog?f.debuglog("stream"):function(){};var d,p,y=r("821b"),g=r("1c9b"),m=r("6a87"),b=m.getHighWaterMark,v=r("93bc").codes,w=v.ERR_INVALID_ARG_TYPE,_=v.ERR_STREAM_PUSH_AFTER_EOF,E=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k=r("7f9c"),C=k.emitExperimentalWarning;r("c3bb")(x,o);var A=["error","close","destroy","pause","resume"];function I(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function T(e,t,n){i=i||r("53b2"),e=e||{},"boolean"!==typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",n),this.buffer=new y,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.paused=!0,this.emitClose=!1!==e.emitClose,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r("7d72").StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function x(e){if(i=i||r("53b2"),!(this instanceof x))return new x(e);var t=this instanceof i;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function B(e,t,r,n,i){h("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,L(e,o);else if(i||(s=N(o,t)),s)e.emit("error",s);else if(o.objectMode||t&&t.length>0)if("string"===typeof t||o.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=u(t)),n)o.endEmitted?e.emit("error",new S):R(e,o,t,!0);else if(o.ended)e.emit("error",new _);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?R(e,o,t,!1):j(e,o)):R(e,o,t,!1)}else n||(o.reading=!1,j(e,o));return!o.ended&&(o.length=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(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=P(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(U,e))}function U(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||e.emit("readable"),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,G(e)}function j(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(K,e,t))}function K(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function q(e){h("readable nexttick read 0"),e.read(0)}function z(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(H,e,t))}function H(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),G(e),t.flowing&&!t.reading&&e.read(0)}function G(e){var t=e._readableState;h("flow",t.flowing);while(t.flowing&&null!==e.read());}function $(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function W(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(Y,t,e))}function Y(e,t){h("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?W(this):M(this),null;if(e=D(e,t),0===e&&t.ended)return 0===t.length&&W(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?$(e,t):null,null===n?(t.needReadable=!0,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&W(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){this.emit("error",new E("_read()"))},x.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,a=o?u:b;function c(e,t){h("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,d())}function u(){h("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",c);var l=F(r);e.on("drain",l);var f=!1;function d(){h("cleanup"),e.removeListener("close",g),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",y),e.removeListener("unpipe",c),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",p),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}function p(t){h("ondata");var n=e.write(t);h("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==Q(i.pipes,e))&&!f&&(h("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function y(t){h("onerror",t),b(),e.removeListener("error",y),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",m),b()}function m(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",p),I(e,"error",y),e.once("close",g),e.once("finish",m),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};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,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,h("on readable",i.length,i.reading),i.length?M(this):i.reading||n.nextTick(q,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(V,this),r},x.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(V,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,z(this,e)),e.paused=!1,this},x.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){if(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){var s=t.push(i);s||(n=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s0?n(null,o.shift()):r=n}return e.addEventListener("message",(function(e){var t=e.data;if(i(t)&&(t=n.from(t)),r)return r(null,t);o.push(t)})),e.addEventListener("close",(function(e){s||r&&r(s=!0)})),e.addEventListener("error",(function(e){s||(s=e,a||(a=!0,t&&t(e)),r&&r(s))})),e.addEventListener("open",(function(e){a||s||(a=!0)})),c}},"2c49":function(e,t){const r=window.XMLHttpRequest;e.exports=r},"2c93":function(e,t,r){(function(t){const n=r("faa1").EventEmitter,i=r("e063"),{WORKER_REQUEST_READ_LOCK:s,WORKER_RELEASE_READ_LOCK:o,MASTER_GRANT_READ_LOCK:a,WORKER_REQUEST_WRITE_LOCK:c,WORKER_RELEASE_WRITE_LOCK:u,MASTER_GRANT_WRITE_LOCK:l}=r("2046");let h;const f=(e,t,r,n,i)=>(s,o)=>{o&&o.type===r&&e.emit(t,o.name,()=>(s.send({type:i,name:o.name,identifier:o.identifier}),new Promise(e=>{const t=r=>{r&&r.type===n&&r.identifier===o.identifier&&(s.removeListener("message",t),e())};s.on("message",t)})))},d=(e,r,n,s)=>()=>{const o=i.generate();return t.send({type:r,identifier:o,name:e}),new Promise(r=>{const i=a=>{a&&a.type===n&&a.identifier===o&&(t.removeListener("message",i),r(()=>{t.send({type:s,identifier:o,name:e})}))};t.on("message",i)})};e.exports=e=>{try{if(h=r(16),!Object.keys(h).length)return}catch(t){return}if(h.isMaster||e.singleProcess){const e=new n;return h.on("message",f(e,"requestReadLock",s,o,a)),h.on("message",f(e,"requestWriteLock",c,u,l)),e}return{isWorker:!0,readLock:e=>d(e,s,a,o),writeLock:e=>d(e,c,l,u)}}}).call(this,r("4362"))},"2cdb":function(e,t,r){"use strict";const n=r("c449"),i=r("85b8");t.resolve=(e,t)=>{let r=i.deserialize(e);const s=t.split("/").filter(Boolean);while(s.length){const e=s.shift();if(void 0===r[e]){for(const t of r.Links)if(t.Name===e)return{value:t.Hash,remainderPath:s.join("/")};throw new Error(`Object has no property '${e}'`)}if(r=r[e],n.isCID(r))return{value:r,remainderPath:s.join("/")}}return{value:r,remainderPath:""}},t.tree=function*(e){const t=i.deserialize(e);yield"Data",yield"Links";for(let r=0;r{const t=c.logger(e.peerInfo.id,"rpc:get-providers");async function r(r,s){let u;try{u=new n(s.key)}catch(g){throw o(new Error(`Invalid CID: ${g.message}`),"ERR_INVALID_CID")}t("%s",u.toBaseEncodedString());const l=c.bufferToKey(u.buffer),[h,f,d]=await Promise.all([e.datastore.has(l),e.providers.getProviders(u),e._betterPeersToQueryAsync(s,r)]),p=f.map(t=>e.peerBook.has(t)?e.peerBook.get(t):e.peerBook.put(new i(t)));h&&p.push(e.peerInfo);const y=new a(s.type,s.key,s.clusterLevel);return p.length>0&&(y.providerPeers=p),d.length>0&&(y.closerPeers=d),t("got %s providers %s closerPeers",p.length,d.length),y}return function(e,t,n){s(r(e,t))(n)}}},"2d6f":function(e,t,r){"use strict";
+/*!
+ * bytes
+ * Copyright(c) 2012-2014 TJ Holowaychuk
+ * Copyright(c) 2015 Jed Watson
+ * MIT Licensed
+ */e.exports=a,e.exports.format=c,e.exports.parse=u;var n=/\B(?=(\d{3})+(?!\d))/g,i=/(?:\.0*|(\.[^0]+)0+)$/,s={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},o=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function a(e,t){return"string"===typeof e?u(e):"number"===typeof e?c(e,t):null}function c(e,t){if(!Number.isFinite(e))return null;var r=Math.abs(e),o=t&&t.thousandsSeparator||"",a=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,u=Boolean(t&&t.fixedDecimals),l=t&&t.unit||"";l&&s[l.toLowerCase()]||(l=r>=s.pb?"PB":r>=s.tb?"TB":r>=s.gb?"GB":r>=s.mb?"MB":r>=s.kb?"KB":"B");var h=e/s[l.toLowerCase()],f=h.toFixed(c);return u||(f=f.replace(i,"$1")),o&&(f=f.replace(n,o)),f+a+l}function u(e){if("number"===typeof e&&!isNaN(e))return e;if("string"!==typeof e)return null;var t,r=o.exec(e),n="b";return r?(t=parseFloat(r[1]),n=r[4].toLowerCase()):(t=parseInt(e,10),n="b"),Math.floor(s[n]*t)}},"2db6":function(e,t,r){"use strict";const n=r("eeb3"),i=r("cf8f"),s=r("87dd"),o=r("e24c").Connection,a=r("0bda"),c=r("4bc2"),u=c("libp2p:websockets:dialer"),l=r("063e");class h{dial(e,t,r){"function"===typeof t&&(r=t,t={}),r=r||function(){};const i=a(e);u("dialing %s",i);const s=n(i,{binary:!0,onConnect:e=>{r(e)}}),c=new o(s);return c.getObservedAddrs=t=>t(null,[e]),c.close=e=>s.close(e),c}createListener(e,t){return"function"===typeof e&&(t=e,e={}),l(e,t)}filter(e){return Array.isArray(e)||(e=[e]),e.filter(e=>!e.protoNames().includes("p2p-circuit")&&("function"===typeof e.decapsulateCode?e=e.decapsulateCode(421):e.protoNames().includes("ipfs")&&(e=e.decapsulate("ipfs")),i.WebSockets.matches(e)||i.WebSocketsSecure.matches(e)))}}e.exports=s(h,{className:"WebSockets",symbolName:"@libp2p/js-libp2p-websockets/websockets"})},"2dce":function(e,t,r){"use strict";function n(e){return e>=55296&&e<=56319}function i(e){return e>=56320&&e<=57343}e.exports=function(e,t,r){if("string"!==typeof t)throw new Error("Input must be string");for(var s,o,a=t.length,c=0,u=0;ur)return t.slice(0,u-o.length+1)}return t}},"2dee":function(e,t,r){"use strict";(function(t){const n=r("e782"),i=r("7a79");function s(e,t,r,i){if("function"===typeof r&&(i=r,r=void 0),!i)throw new Error("Missing callback");s.digest(e,t,r,(e,s)=>{if(e)return i(e);i(null,n.encode(s,t,r))})}e.exports=s,s.Buffer=t,s.multihash=n,s.digest=function(e,t,r,n){if("function"===typeof r&&(n=r,r=void 0),!n)throw new Error("Missing callback");let i,o=n;r&&(o=(e,t)=>{if(e)return n(e);n(null,t.slice(0,r))});try{i=s.createHash(t)}catch(a){return o(a)}i(e,o)},s.createHash=function(e){if(e=n.coerceCode(e),!s.functions[e])throw new Error("multihash function "+e+" not yet supported");return s.functions[e]},s.functions={17:i.sha1,18:i.sha2256,19:i.sha2512,20:i.sha3512,21:i.sha3384,22:i.sha3256,23:i.sha3224,24:i.shake128,25:i.shake256,26:i.keccak224,27:i.keccak256,28:i.keccak384,29:i.keccak512,34:i.murmur3128,35:i.murmur332,86:i.dblSha2256},i.addBlake(s.functions)}).call(this,r("b639").Buffer)},"2e00":function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.hasNextTick=t.hasSetImmediate=void 0,t.fallback=u,t.wrap=l;var n=r("dea4"),i=s(n);function s(e){return e&&e.__esModule?e:{default:e}}var o,a=t.hasSetImmediate="function"===typeof setImmediate&&setImmediate,c=t.hasNextTick="object"===typeof e&&"function"===typeof e.nextTick;function u(e){setTimeout(e,0)}function l(e){return function(t){var r=(0,i.default)(arguments,1);e((function(){t.apply(null,r)}))}}o=a?setImmediate:c?e.nextTick:u,t.default=l(o)}).call(this,r("4362"))},"2e15":function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="LockExistsError",this.code=n.code}}n.code="ERR_LOCK_EXISTS",t.LockExistsError=n;class i extends Error{constructor(e){super(e),this.name="NotFoundError",this.code=i.code}}i.code="ERR_NOT_FOUND",t.NotFoundError=i;class s extends Error{constructor(e){super(e),this.name="InvalidRepoVersionError",this.code=s.code}}s.code="ERR_INVALID_REPO_VERSION",t.InvalidRepoVersionError=s,t.ERR_REPO_NOT_INITIALIZED="ERR_REPO_NOT_INITIALIZED",t.ERR_REPO_ALREADY_OPEN="ERR_REPO_ALREADY_OPEN",t.ERR_REPO_ALREADY_CLOSED="ERR_REPO_ALREADY_CLOSED"},"2e53":function(e,t,r){"use strict";(function(t){const n=r("e2e5"),i=r("7c2b"),{Key:s}=r("9a94"),o=r("f929"),a=r("b1aa"),c=r("e782"),u=r("7048"),l=r("fa4d"),h=r("4bc2"),f=h("jsipns");f.error=h("jsipns:error");const d=r("3958"),{parseRFC3339:p}=r("a816"),y=r("c1a6"),g=c.names.id,m="/ipns/",b=(e,t,r,n)=>{const s=new i(Date.now()+Number(n)).toString(),o=d.ValidityType.EOL;return w(e,t,r,s,o)},v=(e,t,r,n)=>{const i=d.ValidityType.EOL;return w(e,t,r,n,i)},w=async(e,t,r,n,i)=>{const s=await I(e,t,i,n),o={value:t,signature:s,validityType:i,validity:n,sequence:r};return f(`ipns entry for ${t} created`),o},_=async(e,t)=>{const{value:r,validityType:n,validity:i}=t,s=x(r,n,i);let o;try{o=await l(e.verify,{context:e})(s,t.signature)}catch(a){o=!1}if(!o)throw f.error("record signature verification failed"),u(new Error("record signature verification failed"),y.ERR_SIGNATURE_VERIFICATION);if(n===d.ValidityType.EOL){let e;try{e=p(i.toString())}catch(c){throw f.error("unrecognized validity format (not an rfc3339 format)"),u(new Error("unrecognized validity format (not an rfc3339 format)"),y.ERR_UNRECOGNIZED_FORMAT)}if(e{if(!e||!e.bytes||!t){const e=new Error("one or more of the provided parameters are not defined");throw f.error(e),u(e,y.ERR_UNDEFINED_PARAMETER)}let r,n;try{r=await l(a.createFromPubKey)(e.bytes)}catch(i){throw u(i,y.ERR_PEER_ID_FROM_PUBLIC_KEY)}try{n=B(r)}catch(i){throw f.error(i),u(i,y.ERR_PUBLIC_KEY_FROM_ID)}if(n)return null;try{t.pubKey=o.keys.marshalPublicKey(e)}catch(i){throw f.error(i),i}return t},S=(e,t)=>{if(!t||!e){const e=new Error("one or more of the provided parameters are not defined");throw f.error(e),u(e,y.ERR_UNDEFINED_PARAMETER)}if(t.pubKey){let e;try{e=o.keys.unmarshalPublicKey(t.pubKey)}catch(r){throw f.error(r),r}return e}if(e.pubKey)return e.pubKey;throw Object.assign(new Error("no public key is available"),{code:y.ERR_UNDEFINED_PARAMETER})},k=e=>n(e,"RFC4648",{padding:!1}),C=e=>new s(`/ipns/${k(e)}`),A=e=>{const r=t.from("/pk/"),n=t.from("/ipns/");return{routingPubKey:new s(t.concat([r,e])),pkKey:new s(k(t.concat([r,e]))),routingKey:new s(t.concat([n,e])),ipnsKey:new s(k(t.concat([n,e])))}},I=(e,t,r,n)=>{try{const i=x(t,r,n);return l(e.sign,{context:e})(i)}catch(i){throw f.error("record signature creation failed"),u(new Error("record signature creation failed: "+i.message),y.ERR_SIGNATURE_CREATION)}},T=e=>{if("0"===e.toString())return"EOL";const t=new Error(`unrecognized validity type ${e.toString()}`);throw f.error(t),u(t,y.ERR_UNRECOGNIZED_VALIDITY)},x=(e,r,n)=>{const i=t.from(e),s=t.from(T(r)),o=t.from(n);return t.concat([i,o,s])},B=e=>{const t=c.decode(e.id);return t.code!==g?null:o.keys.unmarshalPublicKey(t.digest)},R=d.encode,N=d.decode,O={validate:async(e,t)=>{const r=N(e),n=t.slice("/ipns/".length),i=a.createFromBytes(n),s=S(i,r);return await _(s,r),!0},select:(e,t)=>{const r=N(e),n=N(t);return r.sequence>n.sequence?0:1}};e.exports={create:b,createWithExpiration:v,validate:_,embedPublicKey:E,extractPublicKey:S,getLocalKey:C,getIdKeys:A,marshal:R,unmarshal:N,validator:O,namespace:m,namespaceLength:m.length}}).call(this,r("b639").Buffer)},"2e81":function(e,t,r){"use strict";const{filter:n,sortAll:i,take:s,map:o}=r("5e27"),a=r("c368"),c=r("4547");class u{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){const t=await this.has(e);if(!t)throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=o(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>i(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=s(t,e.limit)),!0===e.keysOnly&&(t=o(t,e=>({key:e.key}))),t}async close(){}}e.exports=u},"2e97":function(e,t,r){"use strict";const n=r("efb7");async function*i(e,t,r){yield await s(e,t,r)}async function s(e,t,r){const i=[];for await(const s of n(e,r.maxChildrenPerNode))i.push(await t(s));return i.length>1?s(i,t,r):i[0]}e.exports=i},"2ea6":function(e,t,r){"use strict";(function(e){const n=r("682d"),i=r("e31f"),s=r("ffc2"),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"},a=(t,r,s)=>{n(i.subtle.sign({name:"HMAC"},t,r).then(t=>e.from(t)),s)};t.create=function(e,t,r){const c=o[e];n(i.subtle.importKey("raw",t,{name:"HMAC",hash:{name:c}},!1,["sign"]).then(t=>({digest(e,r){a(t,e,r)},length:s[e]})),r)}}).call(this,r("b639").Buffer)},"2edf":function(e,t,r){e.exports=r("1ea5")},"2f06":function(e,t,r){(function(e){function r(e){return void 0!==e&&""!==e}function n(e,t){return Object.hasOwnProperty.call(e,t)}function i(e,t){return Object.hasOwnProperty.call(e,t)&&t}t.compare=function(t,r){if(e.isBuffer(t)){for(var n=Math.min(t.length,r.length),i=0;ir?1:0};var s=t.lowerBoundKey=function(e){return i(e,"gt")||i(e,"gte")||i(e,"min")||(e.reverse?i(e,"end"):i(e,"start"))||void 0},o=t.lowerBound=function(e,t){var r=s(e);return r?e[r]:t},a=t.lowerBoundInclusive=function(e){return!n(e,"gt")},c=t.upperBoundInclusive=function(e){return!n(e,"lt")},u=t.lowerBoundExclusive=function(e){return!a(e)},l=t.upperBoundExclusive=function(e){return!c(e)},h=t.upperBoundKey=function(e){return i(e,"lt")||i(e,"lte")||i(e,"max")||(e.reverse?i(e,"start"):i(e,"end"))||void 0},f=t.upperBound=function(e,t){var r=h(e);return r?e[r]:t};function d(e){return e}t.start=function(e,t){return e.reverse?f(e,t):o(e,t)},t.end=function(e,t){return e.reverse?o(e,t):f(e,t)},t.startInclusive=function(e){return e.reverse?c(e):a(e)},t.endInclusive=function(e){return e.reverse?a(e):c(e)},t.toLtgt=function(e,r,i,s,o){r=r||{},i=i||d;var a=arguments.length>3,c=t.lowerBoundKey(e),u=t.upperBoundKey(e);return c?"gt"===c?r.gt=i(e.gt,!1):r.gte=i(e[c],!1):a&&(r.gte=i(s,!1)),u?"lt"===u?r.lt=i(e.lt,!0):r.lte=i(e[u],!0):a&&(r.lte=i(o,!0)),null!=e.reverse&&(r.reverse=!!e.reverse),n(r,"max")&&delete r.max,n(r,"min")&&delete r.min,n(r,"start")&&delete r.start,n(r,"end")&&delete r.end,r},t.contains=function(e,n,i){i=i||t.compare;var s=o(e);if(r(s)){var a=i(n,s);if(a<0||0===a&&u(e))return!1}var c=f(e);if(r(c)){a=i(n,c);if(a>0||0===a&&l(e))return!1}return!0},t.filter=function(e,r){return function(n){return t.contains(e,n,r)}}}).call(this,r("b639").Buffer)},"2f07":function(e,t,r){var n=r("5887"),i=r("0c4e"),s=r("e0c5").Buffer,o=r("715d"),a=r("5190"),c=r("d7d8"),u=r("4eef"),l=r("c3bb");function h(e,t,r){a.call(this),this._cache=new d,this._cipher=new c.AES(t),this._prev=s.from(r),this._mode=e,this._autopadding=!0}l(h,a),h.prototype._update=function(e){var t,r;this._cache.add(e);var n=[];while(t=this._cache.get())r=this._mode.encrypt(this,t),n.push(r);return s.concat(n)};var f=s.alloc(16,16);function d(){this.cache=s.allocUnsafe(0)}function p(e,t,r){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof t&&(t=s.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"===typeof r&&(r=s.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new o(a.module,t,r):"auth"===a.type?new i(a.module,t,r):new h(a.module,t,r)}function y(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(t,!1,r.key,r.iv);return p(e,i.key,i.iv)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=s.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){var e=16-this.cache.length,t=s.allocUnsafe(e),r=-1;while(++r{const o=i.digest({name:e},r);if("function"!==typeof o.then)return o.onerror=()=>{s(new Error(`hashing data using ${e}`))},void(o.oncomplete=e=>{s(null,e.target.result)});n(o.then(e=>t.from(new Uint8Array(e))),s)}}function a(e,t){o("SHA-1")(e,t)}function c(e,t){o("SHA-256")(e,t)}function u(e,t){o("SHA-512")(e,t)}e.exports={sha1:a,sha2256:c,sha2512:u}}).call(this,r("b639").Buffer)},"2f79":function(e,t,r){"use strict";const n=r("55cd"),i=r("8049"),s=i.toBase64,o=i.toBn,a=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())})),c=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))})),u=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("algorithm").use(c),this.key("subjectPublicKey").bitstr())})),l=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.pkcs1ToJwk=function(e){const t=a.decode(e,"der");return{kty:"RSA",n:s(t.modulus),e:s(t.publicExponent),d:s(t.privateExponent),p:s(t.prime1),q:s(t.prime2),dp:s(t.exponent1),dq:s(t.exponent2),qi:s(t.coefficient),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkcs1=function(e){return a.encode({version:0,modulus:o(e.n),publicExponent:o(e.e),privateExponent:o(e.d),prime1:o(e.p),prime2:o(e.q),exponent1:o(e.dp),exponent2:o(e.dq),coefficient:o(e.qi)},"der")},t.pkixToJwk=function(e){const t=u.decode(e,"der"),r=l.decode(t.subjectPublicKey.data,"der");return{kty:"RSA",n:s(r.modulus),e:s(r.publicExponent),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkix=function(e){return u.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:l.encode({modulus:o(e.n),publicExponent:o(e.e)},"der")}},"der")}},"2fd8":function(e,t,r){"use strict";const n=r("1005"),i=r("eb33"),s=r("45d0"),o=r("b116");t.Key=n,t.MemoryDatastore=i,t.utils=s,t.Errors=o},"2fe8":function(e,t,r){(function(t){const n=r("d733"),i=r("e3d5"),s=r("1a18"),o=r("17e5"),a=r("63e1"),c=r("3022").promisify,u=c(a),l=42;function h(e){return"string"===typeof e?e=new i(e).buffer:i.isCID(e)&&(e=e.buffer),new n.Tagged(l,t.concat([t.from("00","hex"),e]))}function f(e){let r;try{r=o(e)}catch(s){r=!1}if(r)throw new Error("The object passed has circular references");function n(e){if(!e||t.isBuffer(e)||"string"===typeof e)return e;if(Array.isArray(e))return e.map(n);if(i.isCID(e))return h(e);const r=Object.keys(e);if(1===r.length&&"/"===r[0])return h(e["/"]);if(r.length>0){const t={};return r.forEach(r=>{"object"===typeof e[r]?t[r]=n(e[r]):t[r]=e[r]}),t}return e}return n(e)}e.exports=e=>{let t=new n.Decoder({tags:{[l]:e=>(e=e.slice(1),new i(e))},size:e});const r=e=>t.decodeFirst(e),o=e=>{let t=f(e);return n.encode(t)},a=async(e,t="sha2-256")=>{let r=o(e),n=await u(r,t),a=new i(1,"dag-cbor",n);return new s(r,a)};return{serialize:o,deserialize:r,mkblock:a}}}).call(this,r("b639").Buffer)},"2ff2":function(e,t,r){"use strict";const n=r("af8e"),i=r("96a8"),s=r("0774"),o=r("ea91"),a=r("e7ba"),c=i(r("eee0"));r("508d"),r("b6fe");const u=r("f0a0");class l{constructor(e){this._key=e}verify(e,t,r){m(r),a.hashAndVerify(this._key,t,e,r)}marshal(){return a.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()})}encrypt(e,t){return h(()=>a.encrypt(this._key,e),t)}equals(e){return this.bytes.equals(e.bytes)}hash(e){m(e),n(this.bytes,"sha2-256",e)}}function h(e,t){let r;try{r=e()}catch(n){t(n)}return t(null,r)}class f{constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return a.getRandomValues(16)}sign(e,t){m(t),a.hashAndSign(this._key,e,t)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new l(this._publicKey)}decrypt(e,t){h(()=>a.decrypt(this._key,e),t)}marshal(){return a.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()})}equals(e){return this.bytes.equals(e.bytes)}hash(e){m(e),n(this.bytes,"sha2-256",e)}id(e){this.public.hash((t,r)=>{if(t)return e(t);e(null,s.encode(r))})}export(e,t,r){"function"===typeof t&&(r=t,t=e,e="pkcs-8"),m(r),o(()=>{let n=null,i=null;try{const r=new u.util.ByteBuffer(this.marshal()),s=u.asn1.fromDer(r),o=u.pki.privateKeyFromAsn1(s);if("pkcs-8"===e){const e={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};i=u.pki.encryptRsaPrivateKey(o,t,e)}else n=new Error(`Unknown export format '${e}'`)}catch(s){n=s}r(n,i)})}}function d(e,t){const r=a.utils.pkcs1ToJwk(e);a.unmarshalPrivateKey(r,(e,r)=>{if(e)return t(e);t(null,new f(r.privateKey,r.publicKey))})}function p(e){const t=a.utils.pkixToJwk(e);return new l(t)}function y(e,t){a.unmarshalPrivateKey(e,(e,r)=>{if(e)return t(e);t(null,new f(r.privateKey,r.publicKey))})}function g(e,t){a.generateKey(e,(e,r)=>{if(e)return t(e);t(null,new f(r.privateKey,r.publicKey))})}function m(e){if("function"!==typeof e)throw new Error("callback is required")}e.exports={RsaPublicKey:l,RsaPrivateKey:f,unmarshalRsaPublicKey:p,unmarshalRsaPrivateKey:d,generateKeyPair:g,fromJwk:y}},"300a":function(e,t,r){"use strict";(function(t){const n=r("e3d5");e.exports=function(e){if(t.isBuffer(e))return new n(e).toString();if(n.isCID(e))return e.toString();if("string"!==typeof e)throw new Error("unexpected cid type: "+typeof e);return new n(e.split("/")[0]),e}}).call(this,r("b639").Buffer)},3053:function(e,t,r){(function(t){var r=o(),n=a(),i=c(),s="undefined"!==typeof window?window:t;function o(){return Object.assign?Object.assign:function(e,t,r,n){for(var i=1;i{const n=a.createHash(t),i=await n(e);return r?i.slice(0,r):i},a.createHash=function(e){if(!e)throw i("hash algorithm must be specified","ERR_HASH_ALGORITHM_NOT_SPECIFIED");if(e=s.coerceCode(e),!a.functions[e])throw i(`multihash function '${e}' not yet supported`,"ERR_HASH_ALGORITHM_NOT_SUPPORTED");return a.functions[e]},a.functions={17:o.sha1,18:o.sha2256,19:o.sha2512,20:o.sha3512,21:o.sha3384,22:o.sha3256,23:o.sha3224,24:o.shake128,25:o.shake256,26:o.keccak224,27:o.keccak256,28:o.keccak384,29:o.keccak512,34:o.murmur3128,35:o.murmur332,86:o.dblSha2256},o.addBlake(a.functions),a.validate=async(e,t)=>{const r=await a(e,s.decode(t).name);return 0===n.compare(t,r)},e.exports=a},"309b":function(e,t,r){"use strict";t.defined=function(e){return null!==e&&void 0!==e&&("number"!==typeof e||!isNaN(e))}},"30ae":function(e,t,r){(function(t){var n=r("d485");e.exports=s,e.exports.source=function(e){return s(null,e)},e.exports.sink=function(e){return s(e,null)};var i="undefined"===typeof setImmediate?t.nextTick:setImmediate;function s(e,t){e&&"object"===typeof e&&(t=e.source,e=e.sink);var r,s,o,a=[],c=[],u=new n;u.writable=u.readable=!0,u.write=function(e){return a.length?a.shift()(null,e):c.push(e),a.length||(s=!0),!!a.length},u.end=function(){t?c.length?y():t(r=!0,a.length?a.shift():function(){}):a.length&&a.shift()(!0)},u.source=function(e,t){c.length?(t(null,c.shift()),c.length||u.emit("drain")):((r=r||e)?t(r):a.push(t),s&&(s=!1,u.emit("drain")))},e&&(o=e(u.source)),o&&!t&&(t=o);var l=[],h=!1,f=!1;if(u.sink=function(e){t=e,i(y)},t){u.sink(t),u.paused=!0;var d=u.on.bind(u);u.on=(e,t)=>{var r=d(e,t);return"data"===e&&u.paused&&i(u.resume.bind(u)),r};var p=u.pipe.bind(u);u.pipe=function(e,t){var r=p(e,t);return u.paused&&u.resume(),r}}function y(){if(!1,t&&!f){while(l.length&&!u.paused)u.emit("data",l.shift());if(!u.paused){if(h)return u.emit("end");f=!0,t(null,(function e(n,i){f=!1,u.paused?(!0===n?h=n:n?u.emit("error",n):l.push(i),!0):n&&!0!==(r=n)?u.emit("error",n):(r=r||n)?u.emit("end"):(u.emit("data",i),f=!0,t(null,e))}))}}}return u.pause=function(){return u.paused=!0,u},u.resume=function(){return u.paused=!1,y(),u},u.destroy=function(){!r&&t&&t(r=!0,(function(){})),r=!0,a.length&&a.shift()(!0),u.emit("close")},u}}).call(this,r("4362"))},3136:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),i=r("670f"),s=r("354e"),o=r("d183");async function a(e,t,r){const n=await a.digest(e,t,r);return s.encode(n,t,r)}a.Buffer=n,a.multihash=s,a.digest=async(e,t,r)=>{const n=a.createHash(t),i=await n(e);return r?i.slice(0,r):i},a.createHash=function(e){if(!e)throw i(new Error("hash algorithm must be specified"),"ERR_HASH_ALGORITHM_NOT_SPECIFIED");if(e=s.coerceCode(e),!a.functions[e])throw i(new Error(`multihash function '${e}' not yet supported`),"ERR_HASH_ALGORITHM_NOT_SUPPORTED");return a.functions[e]},a.functions={0:o.identity,17:o.sha1,18:o.sha2256,19:o.sha2512,20:o.sha3512,21:o.sha3384,22:o.sha3256,23:o.sha3224,24:o.shake128,25:o.shake256,26:o.keccak224,27:o.keccak256,28:o.keccak384,29:o.keccak512,34:o.murmur3128,35:o.murmur332,86:o.dblSha2256},o.addBlake(a.functions),a.validate=async(e,t)=>{const r=await a(e,s.decode(t).name);return 0===n.compare(t,r)},e.exports=a},3156:function(e,t,r){r("a4d3"),r("99af"),r("4de4"),r("4160"),r("e439"),r("b64b"),r("159b");var n=r("9523");function i(e){for(var t=1;t>>t^e<<32-t}var a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function h(e,t){var r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),s(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),s(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),s(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),s(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),s(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),s(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),s(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(a),b:new Uint32Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(d(n,t),n.c=64),n}function d(e,t){for(var r=0;r>2]>>8*(3&r)&255;return t}function y(e,t,r){r=r||32,e=n.normalizeInput(e);var i=f(r,t);return d(i,e),p(i)}function g(e,t,r){var i=y(e,t,r);return n.toHex(i)}e.exports={blake2s:y,blake2sHex:g,blake2sInit:f,blake2sUpdate:d,blake2sFinal:p}},"31a0":function(e,t,r){(function(t,n,i){var s=r("5995"),o=r("3bdc"),a=e.exports=s.util=s.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function u(e){if(this.data="",this.read=0,"string"===typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!==typeof i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r15?(i=Date.now(),c(e)):(r.push(e),1===r.length&&o.setAttribute("a",s=!s))}}a.nextTick=a.setImmediate})(),a.isNodejs="undefined"!==typeof t&&t.versions&&t.versions.node,a.globalScope=function(){return a.isNodejs?n:"undefined"===typeof self?window:self}(),a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=u,a.ByteStringBuffer=u;var l=4096;function h(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==e&&void 0!==e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>l&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);var r=this.data;while(t>0)1&t&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0)1&t&&(r+=e),t>>>=1,t>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",s="",o=0,a=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),a>=10&&(n+=s,s="",a=0),s+=String.fromCharCode(i),++a;return n+=s,n},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],p="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){var r,n,i,s="",o="",a=0;while(a>2),s+=f.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=f.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":f.charAt(63&i)),t&&s.length>t&&(o+=s.substr(0,t)+"\r\n",s=s.substr(t));return o+=s,o},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");var t,r,n,i,s="",o=0;while(o>4),64!==n&&(s+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(s+=String.fromCharCode((3&n)<<6|i)));return s},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:o.encode,decode:o.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,s=0;s>2),s+=f.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=f.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":f.charAt(63&i)),t&&s.length>t&&(o+=s.substr(0,t)+"\r\n",s=s.substr(t));return o+=s,o},a.binary.base64.decode=function(e,t,r){var n,i,s,o,a=t;a||(a=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;var c=0,u=r;while(c>4,64!==s&&(a[u++]=(15&i)<<4|s>>2,64!==o&&(a[u++]=(3&s)<<6|o));return t?u-r:a.subarray(0,u)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,p,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,p,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,s=0;s0?(i=r[n].substring(0,o),s=r[n].substring(o+1)):(i=r[n],s=null),i in t||(t[i]=[]),i in Object.prototype||null===s||t[i].push(unescape(s))}return t};return"undefined"===typeof e?(null===E&&(E="undefined"!==typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=E):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");i.length>0&&""===i[0]&&i.shift();var s=""===r?{}:a.getQueryVariables(r);return{pathString:t,queryString:r,path:i,query:s}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return"undefined"===typeof e?t.path:t.path[e]},getQuery:function(e,r){var n;return"undefined"===typeof e?n=t.query:(n=t.query[e],n&&"undefined"!==typeof r&&(n=n[r])),n},getQueryLast:function(e,t){var n,i=r.getQuery(e);return n=i?i[i.length-1]:t,n}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.setPath=function(e,t,r){if("object"===typeof e&&null!==e){var n=0,i=t.length;while(n0&&s.push(r),o=n.lastIndex;var a=t[0][1];switch(a){case"s":case"o":i");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(e.substring(o)),s.join("")},a.formatNumber=function(e,t,r,n){var i=e,s=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,a=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+a:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(i-u).toFixed(s).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes",e},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(e=e.split("."),4!==e.length)return null;for(var t=a.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"===typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"===typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"===typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;while(Date.now()a.st&&i.sti.st&&a.st(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},3267:function(e,t,r){"use strict";const n=r("fa4d"),i=r("2644"),s=r("1421"),o=r("b1aa"),a=r("8911");e.exports=e=>n((t,r,n)=>{"function"!==typeof r||n||(n=r,r={}),"function"===typeof r&&"function"===typeof n&&(n=r,r={});const c=(e,t)=>{Array.isArray(e)||(e=[e]);let r=[];e.forEach(e=>{4===e.Type&&e.Responses.forEach(e=>{const t=new a(o.createFromB58String(e.ID));e.Addrs&&e.Addrs.forEach(e=>{const r=s(e);t.multiaddrs.add(r)}),r.push(t)})}),t(null,r)};e({path:"dht/findprovs",args:t.toString(),qs:r},(e,t)=>{if(e)return n(e);i(t,c,n)})})},"326a":function(e,t,r){"use strict";const n=r("4bc2"),i=r("7048"),s=r("09a4"),o=r("6158"),a=n("ipfs:name-pubsub");a.error=n("ipfs:name-pubsub:error");const c=e=>{try{return Boolean(u(e))}catch(t){return!1}},u=e=>{if(!e._ipns||!e._options.EXPERIMENTAL.ipnsPubsub)throw i(new Error("IPNS pubsub subsystem is not enabled"),"ERR_IPNS_PUBSUB_NOT_ENABLED");if(o.isIpnsPubsubDatastore(e._ipns.routing))return e._ipns.routing;const t=(e._ipns.routing.stores||[]).find(e=>o.isIpnsPubsubDatastore(e));if(!t)throw i(new Error("IPNS pubsub datastore not found"),"ERR_PUBSUB_DATASTORE_NOT_FOUND");return t};e.exports=function(e){return{state:s(async()=>({enabled:c(e)})),cancel:s(async t=>{const r=u(e);return r.cancel(t)}),subs:s(async()=>{const t=u(e);return t.getSubscriptions()})}}},3276:function(e,t,r){"use strict";e.exports="\n// topicCID = cid(merkledag_protobuf(topicDescriptor)); (not the topic.name)\nmessage TopicDescriptor {\n optional string name = 1;\n optional AuthOpts auth = 2;\n optional EncOpts enc = 2;\n\n message AuthOpts {\n optional AuthMode mode = 1;\n repeated bytes keys = 2; // root keys to trust\n\n enum AuthMode {\n NONE = 0; // no authentication, anyone can publish\n KEY = 1; // only messages signed by keys in the topic descriptor are accepted\n WOT = 2; // web of trust, certificates can allow publisher set to grow\n }\n }\n\n message EncOpts {\n optional EncMode mode = 1;\n repeated bytes keyHashes = 2; // the hashes of the shared keys used (salted)\n\n enum EncMode {\n NONE = 0; // no encryption, anyone can read\n SHAREDKEY = 1; // messages are encrypted with shared key\n WOT = 2; // web of trust, certificates can allow publisher set to grow\n }\n }\n}"},"32c0":function(e,t){function r(){var e,t=new Promise((function(t,r){e=function(e,n){e?r(e):t(n)}}));return e.promise=t,e}e.exports=r},"334b":function(e,t,r){"use strict";(function(n){const i=r("c449"),s=r("f654"),o=r("ec12"),a=r("41fe");class c{constructor(e,t,r){s(r,"A link requires a cid to point to"),this._name=e||"",this._nameBuf=null,this._size=t,this._cid=new i(r),a.hidePrivateFields(this),a.addEnumerableGetters(this,["Hash","Name","Tsize"])}toString(){return`DAGLink <${this._cid.toBaseEncodedString()} - name: "${this.Name}", size: ${this.Tsize}>`}toJSON(){return this._json||(this._json=Object.freeze({name:this.Name,size:this.Tsize,cid:this.Hash.toBaseEncodedString()})),Object.assign({},this._json)}get Name(){return this._name}get nameAsBuffer(){return null!==this._nameBuf?this._nameBuf:(this._nameBuf=n.from(this._name),this._nameBuf)}set Name(e){throw new Error("Can't set property: 'name' is immutable")}get Tsize(){return this._size}set Tsize(e){throw new Error("Can't set property: 'size' is immutable")}get Hash(){return this._cid}set Hash(e){throw new Error("Can't set property: 'cid' is immutable")}}t=e.exports=o(c,{className:"DAGLink",symbolName:"@ipld/js-ipld-dag-pb/daglink"}),t.util=r("1cd4")}).call(this,r("b639").Buffer)},3387:function(e,t,r){var n=r("7a03"),i="__lodash_hash_undefined__",s=Object.prototype,o=s.hasOwnProperty;function a(e){var t=this.__data__;if(n){var r=t[e];return r===i?void 0:r}return o.call(t,e)?t[e]:void 0}e.exports=a},"33ae":function(e,t,r){"use strict";const n=r("73b5"),i=r("c591"),s=r("4bc2"),o=r("0b0f"),a=r("449a"),c=r("50b0"),u=s("pull-plex");function l(e,t){const r=new a(!t),s=n();i(e,r,s,e);const o=new c(e,r);return o.once("error",e=>{u.err("got error",e),s.abort(e)}),o.on("close",()=>{u("closing muxer"),s.abort()}),o}u.err=s("pull-plex:err"),t=e.exports=l,t.pullMplex=a,t.multicodec=o,t.dialer=e=>l(e,!1),t.listener=e=>l(e,!0)},"33b3":function(e,t,r){"use strict";function n(e){return e}var i=r("64f1"),s=r("90de");e.exports=function(e,t){var r=!1;return t?e=i(e)||n:(t=e,e=n),s((function(n){if(e(n))return r=!0,t(null,n),!1}),(function(e){r||t(!0===e?null:e,null)}))}},"33d8":function(e,t,r){"use strict";e.exports={}},"33fc":function(e,t,r){"use strict";e.exports=function e(t){var r=arguments.length;if("function"===typeof t&&1===t.length){for(var n=new Array(r),i=0;ii[r?e[r]:e]=!0;e.forEach(s);var o=(e,t)=>{var s=void 0!==i[r?t[r]:t],o=void 0!==n[r?t[r]:t];return s||o||(e.push(t),n[r?t[r]:t]=!0),e};return t.reduce(o,[])}e.exports=n},"34c0":function(e,t,r){var n=r("1514");e.exports=function(e,t,r){var i=-1,s=[],o=r?t.length:0;while((i=n(e,t))>-1)s.push(e.slice(0,i+o)),e=e.slice(i+t.length,e.length);return s.push(e),s}},"34eb":function(e,t,r){(function(n){function i(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"===typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function s(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)}function o(...e){return"object"===typeof console&&console.log&&console.log(...e)}function a(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}}function c(){let e;try{e=t.storage.getItem("debug")}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",BASE_URL:"/"}).DEBUG),e}function u(){try{return localStorage}catch(e){}}t.log=o,t.formatArgs=s,t.save=a,t.load=c,t.useColors=i,t.storage=u(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r("dc90")(t);const{formatters:l}=e.exports;l.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r("4362"))},3524:function(e,t,r){var{relative:n}=r("e2a8"),i={http:"ws",https:"wss"},s="ws";e.exports=function(e,t){return n(e,t,i,s)}},"354e":function(e,t,r){"use strict";(function(e){const n=r("0774"),i=r("479a");t.names=i.names,t.codes=i.codes,t.defaultLengths=i.defaultLengths;const s=r("2612");function o(e){t.decode(e)}t.toHexString=function(t){if(!e.isBuffer(t))throw new Error("must be passed a buffer");return t.toString("hex")},t.fromHexString=function(t){return e.from(t,"hex")},t.toB58String=function(t){if(!e.isBuffer(t))throw new Error("must be passed a buffer");return n.encode(t)},t.fromB58String=function(t){let r=t;return e.isBuffer(t)&&(r=t.toString()),e.from(n.decode(r))},t.decode=function(r){if(!e.isBuffer(r))throw new Error("multihash must be a Buffer");if(r.length<3)throw new Error("multihash too short. must be > 3 bytes.");const n=s.decode(r);if(!t.isValidCode(n))throw new Error(`multihash unknown function code: 0x${n.toString(16)}`);r=r.slice(s.decode.bytes);const o=s.decode(r);if(o<1)throw new Error(`multihash invalid length: 0x${o.toString(16)}`);if(r=r.slice(s.decode.bytes),r.length!==o)throw new Error(`multihash length inconsistent: 0x${r.toString("hex")}`);return{code:n,name:i.codes[n],length:o,digest:r}},t.encode=function(r,n,i){if(!r||void 0===n)throw new Error("multihash encode requires at least two args: digest, code");const o=t.coerceCode(n);if(!e.isBuffer(r))throw new Error("digest should be a Buffer");if(null==i&&(i=r.length),i&&r.length!==i)throw new Error("digest length should be equal to specified length.");return e.concat([e.from(s.encode(o)),e.from(s.encode(i)),r])},t.coerceCode=function(e){let r=e;if("string"===typeof e){if(void 0===i.names[e])throw new Error(`Unrecognized hash function named: ${e}`);r=i.names[e]}if("number"!==typeof r)throw new Error(`Hash function code should be a number. Got: ${r}`);if(void 0===i.codes[r]&&!t.isAppCode(r))throw new Error(`Unrecognized function code: ${r}`);return r},t.isAppCode=function(e){return e>0&&e<16},t.isValidCode=function(e){return!!t.isAppCode(e)||!!i.codes[e]},t.validate=o,t.prefix=function(e){return o(e),e.slice(0,2)}}).call(this,r("b639").Buffer)},3554:function(e,t,r){"use strict";e.exports=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})}},3580:function(e,t,r){"use strict";const n=r("fb92").Key,i=r("fb92").Errors,s=r("fb92").utils,o=s.filter,a=s.take,c=s.sortAll,u=s.replaceStartWith,l=r("6429");class h{constructor(e){this.mounts=e.slice()}open(){return Promise.all(this.mounts.map(e=>e.datastore.open()))}_lookup(e){for(let t of this.mounts)if(t.prefix.toString()===e.toString()||t.prefix.isAncestorOf(e)){const r=u(e.toString(),t.prefix.toString());return{datastore:t.datastore,mountpoint:t.prefix,rest:new n(r)}}}put(e,t){const r=this._lookup(e);if(null==r)throw i.dbWriteFailedError(new Error("No datastore mounted for this key"));return r.datastore.put(r.rest,t)}get(e){const t=this._lookup(e);if(null==t)throw i.notFoundError(new Error("No datastore mounted for this key"));return t.datastore.get(t.rest)}has(e){const t=this._lookup(e);return null!=t&&t.datastore.has(t.rest)}delete(e){const t=this._lookup(e);if(null==t)throw i.dbDeleteFailedError(new Error("No datastore mounted for this key"));return t.datastore.delete(t.rest)}close(){return Promise.all(this.mounts.map(e=>e.datastore.close()))}batch(){const e={},t=t=>{const r=this._lookup(t);if(null==r)throw new Error("No datastore mounted for this key");const n=r.mountpoint.toString();return null==e[n]&&(e[n]=r.datastore.batch()),{batch:e[n],rest:r.rest}};return{put:(e,r)=>{const n=t(e);n.batch.put(n.rest,r)},delete:e=>{const r=t(e);r.batch.delete(r.rest)},commit:()=>Promise.all(Object.keys(e).map(t=>e[t].commit()))}}query(e){const t=this.mounts.map(t=>{const r=new l(t.datastore,{convert:e=>{throw new Error("should never be called")},invert:e=>t.prefix.child(e)});let n;return null!=e.prefix&&(n=u(e.prefix,t.prefix.toString())),r.query({prefix:n,filters:e.filters,keysOnly:e.keysOnly})});let r=f(t);if(e.filters&&e.filters.forEach(e=>{r=o(r,e)}),e.orders&&e.orders.forEach(e=>{r=c(r,e)}),null!=e.offset){let t=0;r=o(r,()=>t++>=e.offset)}return null!=e.limit&&(r=a(r,e.limit)),r}}function f(e){return async function*(){let t=e.map(()=>!1);while(!t.every(Boolean))for(const[r,n]of e.entries()){const e=await n.next();e.done?t[r]=!0:yield e.value}}()}e.exports=h},"363c":function(e,t,r){"use strict";const n=r("80f8");e.exports=function(e){return function(t,r){return n.readable(async function*(){for await(const i of e._getAsyncIterator(t,r))i.content&&(i.content=n.readable(i.content())),yield i}(),{objectMode:!0})}}},3676:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=r("c1cd"),i=a(n),s=r("76bf"),o=a(s);function a(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r,n){n=n||i.default,t=t||[];var s=[],a=0,c=(0,o.default)(r);e(t,(function(e,t,r){var n=a++;c(e,(function(e,t){s[n]=t,r(e)}))}),(function(e){n(e,s)}))}e.exports=t["default"]},"36a2":function(e,t,r){"use strict";(function(t){const n=r("b1aa"),i=r("4bb2"),s=r("09a4"),o=r("fa4d"),a=r("708c"),c=r("a818"),{DAGNode:u}=r("c75d"),l=r("2091e"),h=r("0c9a"),f=r("467e"),d=r("20ba"),p=r(15),{profiles:y}=r("94f7");function g(e,r){return r.privateKey?(e.log("using user-supplied private-key"),"object"===typeof r.privateKey?r.privateKey:o(n.createFromPrivKey)(t.from(r.privateKey,"base64"))):(r.log(`generating ${r.bits}-bit RSA keypair...`,!1),e.log("generating peer id: %s bits",r.bits),o(n.create)({bits:r.bits}))}async function m(e,t){if("uninitialized"!==e.state.state())throw new Error("Not able to init from state: "+e.state.state());if(e.state.init(),e.log("init"),t.repo)return void(e._repo=t.repo);t.emptyRepo=t.emptyRepo||!1,t.bits=Number(t.bits)||2048,t.log=t.log||function(){};const r=i(a(),e._options.config);v(e,r,t);const n=await e._repo.exists();if(e.log("repo exists?",n),!0===n)throw Error("repo already exists");const s=await g(e,t);e.log("identity generated"),r.Identity={PeerID:s.toB58String(),PrivKey:s.privKey.bytes.toString("base64")};const o=s.privKey;if(t.pass&&(r.Keychain=c.generateOptions()),t.log("done"),t.log("peer identity: "+r.Identity.PeerID),await e._repo.init(r),await e._repo.open(),e.log("repo opened"),t.pass){e.log("creating keychain");const n=Object.assign({passPhrase:t.pass},r.Keychain);e._keychain=new c(e._repo.keys,n),await e._keychain.importPeer("self",{privKey:o})}const u=new d(e._repo);return e._ipns=new f(u,e._repo.datastore,e._peerInfo,e._keychain,e._options),b(e,o,t)}async function b(e,t,r){if(r.emptyRepo)return;e.log("adding assets");const n=new u(new l("directory").marshal()),i=await e.dag.put(n,{version:0,format:h.DAG_PB,hashAlg:h.SHA2_256,preload:!1});return await e._ipns.initializeKeyspace(t,i.toBaseEncodedString()),e.log("Initialised keyspace"),"function"===typeof p?(e.log("Adding default assets"),p(e,r.log)):void 0}function v(e,t,r){if(r.profiles)for(const n of r.profiles){const r=y[n];if(!r)throw new Error(`Could not find profile with name '${n}'`);e.log(`applying profile ${n}`),r.transform(t)}}e.exports=function(e){return s.variadic(async t=>{t=t||{},await m(e,t),e.log("Created repo"),await e.preStart(),e.log("Done pre-start"),e.state.initialized(),e.emit("init")})}}).call(this,r("b639").Buffer)},"36c6":function(e,t,r){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}r("3410"),r("131a"),e.exports=n},3709:function(e,t,r){(function(t){function r(e){if("object"!==typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}r.prototype.next=function(e){var r=this;if("function"!==typeof e)throw new Error("next() requires a callback argument");return r._ended?(t.nextTick(e,new Error("cannot call next() after end()")),r):r._nexting?(t.nextTick(e,new Error("cannot call next() before previous next() has completed")),r):(r._nexting=!0,r._next((function(){r._nexting=!1,e.apply(null,arguments)})),r)},r.prototype._next=function(e){t.nextTick(e)},r.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},r.prototype._seek=function(e){},r.prototype.end=function(e){if("function"!==typeof e)throw new Error("end() requires a callback argument");if(this._ended)return t.nextTick(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},r.prototype._end=function(e){t.nextTick(e)},e.exports=r}).call(this,r("4362"))},"371e":function(e,t,r){"use strict";var n=r("4ea4"),i=n(r("a34a")),s=n(r("c973")),o=r("aaed"),a=o.fetchText,c=o.getMessageConsent,u=r("a886"),l=r("288a"),h=l.verifyMessage,f=r("b3ec"),d=r("aaed"),p=r("972c");r("b37b")["default"](),r("0397")();var y=f.profile_server_url,g=function(e){return{dag:{get:function(){var t=(0,s["default"])(i["default"].mark((function t(r){var n;return i["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n="".concat(e,"/did-doc?cid=").concat(encodeURIComponent(r)),t.abrupt("return",d.fetchJson(n));case 2:case"end":return t.stop()}}),t)})));function r(e){return t.apply(this,arguments)}return r}()}}};p(g(y),{pin:!1}),e.exports={verifyGithub:function(){var e=(0,s["default"])(i["default"].mark((function e(t,r){var n,s,o,c;return i["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n="string"===typeof t?[t]:t,r&&""!==r.trim()){e.next=3;break}return e.abrupt("return",null);case 3:return e.next=5,a(r);case 5:if(s=e.sent,o=n.reduce((function(e,t){return e||-1!==s.indexOf(t)}),!1),o){e.next=9;break}throw new Error("Gist File provided does not contain the correct DID of the user");case 9:return c=r.split("/")[3],e.abrupt("return",{username:c,proof:r});case 11:case"end":return e.stop()}}),e)})));function t(t,r){return e.apply(this,arguments)}return t}(),verifyTwitter:function(){var e=(0,s["default"])(i["default"].mark((function e(t,r){var n,s,o;return i["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n="string"===typeof t?[t]:t,r){e.next=3;break}return e.abrupt("return",null);case 3:return e.next=5,u.verifyJWT(r);case 5:if(s=e.sent,n.includes(s.payload.sub)){e.next=8;break}throw new Error("Verification not valid for given user");case 8:if(o=s.payload.claim,o.twitter_handle&&o.twitter_proof){e.next=11;break}throw new Error("The claim for your twitter is not correct");case 11:return e.abrupt("return",{username:o.twitter_handle,proof:o.twitter_proof,verifiedBy:s.payload.iss});case 12:case"end":return e.stop()}}),e)})));function t(t,r){return e.apply(this,arguments)}return t}(),verifyEmail:function(){var e=(0,s["default"])(i["default"].mark((function e(t,r){var n,s,o;return i["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n="string"===typeof t?[t]:t,r){e.next=3;break}return e.abrupt("return",null);case 3:return e.next=5,u.verifyJWT(r);case 5:if(s=e.sent,n.includes(s.payload.sub)){e.next=8;break}throw new Error("Verification not valid for given user");case 8:if(o=s.payload.claim,o.email_address){e.next=11;break}throw new Error("The claim for your email address is not correct");case 11:return e.abrupt("return",{email_address:o.email_address,verifiedBy:s.payload.iss});case 12:case"end":return e.stop()}}),e)})));function t(t,r){return e.apply(this,arguments)}return t}(),verifyDID:function(){var e=(0,s["default"])(i["default"].mark((function e(t){var r,n,s,o;return i["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,u.verifyJWT(t);case 2:if(r=e.sent,n=r.payload.muport,s={},!n){e.next=10;break}return e.next=8,u.verifyJWT(n);case 8:o=e.sent.payload.iss,s.muport=o;case 10:return s.did=r.payload.iss,e.abrupt("return",s);case 12:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}(),verifyEthereum:function(){var e=(0,s["default"])(i["default"].mark((function e(t,r){var n,s,o;return i["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("string"===typeof r?[r]:r,n=t.version?t.message:t["consent_msg"],s=t.version?t.signature:t["consent_signature"],o=c(r),n===o){e.next=6;break}throw new Error('Invalid consent message, got: "'.concat(n,'", expected: "').concat(o,'"'));case 6:return e.abrupt("return",h(n,s));case 7:case"end":return e.stop()}}),e)})));function t(t,r){return e.apply(this,arguments)}return t}()}},"3768b":function(e,t,r){"use strict";const n=r("87c4"),i=r("980c2"),s=r("79ea"),o=r("d8ac");t.Key=n,t.MemoryDatastore=i,t.utils=s,t.Errors=o},3798:function(e,t,r){var n=r("918b");r("5ee0");var i=e.exports=n.pem=n.pem||{};function s(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==o){var a=t[o];","===a?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+a+t.substr(o+1),s=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},i+=s(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},i+=s(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=s(r)),e.headers)for(var o=0;oasync t=>{switch(e){case"sha3-224":return n.from(i.sha3_224.arrayBuffer(t));case"sha3-256":return n.from(i.sha3_256.arrayBuffer(t));case"sha3-384":return n.from(i.sha3_384.arrayBuffer(t));case"sha3-512":return n.from(i.sha3_512.arrayBuffer(t));case"shake-128":return n.from(i.shake128.create(128).update(t).arrayBuffer());case"shake-256":return n.from(i.shake256.create(256).update(t).arrayBuffer());case"keccak-224":return n.from(i.keccak224.arrayBuffer(t));case"keccak-256":return n.from(i.keccak256.arrayBuffer(t));case"keccak-384":return n.from(i.keccak384.arrayBuffer(t));case"keccak-512":return n.from(i.keccak512.arrayBuffer(t));case"murmur3-128":return n.from(s.x64.hash128(t),"hex");case"murmur3-32":return a(s.x86.hash32(t));default:throw new TypeError(`${e} is not a supported algorithm`)}};e.exports={sha1:o("sha1"),sha2256:o("sha2-256"),sha2512:o("sha2-512"),dblSha2256:o("dbl-sha2-256"),sha3224:c("sha3-224"),sha3256:c("sha3-256"),sha3384:c("sha3-384"),sha3512:c("sha3-512"),shake128:c("shake-128"),shake256:c("shake-256"),keccak224:c("keccak-224"),keccak256:c("keccak-256"),keccak384:c("keccak-384"),keccak512:c("keccak-512"),murmur3128:c("murmur3-128"),murmur332:c("murmur3-32"),addBlake:r("ae8a")}},"37c4":function(e,t,r){"use strict";(function(t){const n=r("276f"),i=r("1e83"),s=r("9efb");function o(e){const t=[],r=e.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(let n=0;n=r.length)throw w("invalid address: "+e);if(o.path){t.push([s,v(r.slice(n).join("/"))]);break}t.push([s,r[n]])}else t.push([s])}return t}function a(e){const t=[];return e.map(e=>{const r=_(e);t.push(r.name),e.length>1&&t.push(e[1])}),v(t.join("/"))}function c(e){return e.map(e=>{Array.isArray(e)||(e=[e]);const t=_(e);return e.length>1?[t.code,n.toBuffer(t.code,e[1])]:[t.code]})}function u(e){return e.map(e=>{const t=_(e);return e.length>1?[t.code,n.toString(t.code,e[1])]:[t.code]})}function l(e){return g(t.concat(e.map(e=>{const r=_(e);let n=t.from(s.encode(r.code));return e.length>1&&(n=t.concat([n,e[1]])),n})))}function h(e,t){if(e.size>0)return e.size/8;if(0===e.size)return 0;{const e=s.decode(t);return e+s.decode.bytes}}function f(e){const t=[];let r=0;while(re.length)throw w("Invalid address buffer: "+e.toString("hex"));t.push([n,u])}return t}function d(e){const t=f(e),r=u(t);return a(r)}function p(e){e=v(e);const t=o(e),r=c(t);return l(r)}function y(e){return p(e)}function g(e){const r=m(e);if(r)throw r;return t.from(e)}function m(e){try{f(e)}catch(t){return t}}function b(e){return void 0===m(e)}function v(e){return"/"+e.trim().split("/").filter(e=>e).join("/")}function w(e){return new Error("Error parsing address: "+e)}function _(e){const t=i(e[0]);return t}e.exports={stringToStringTuples:o,stringTuplesToString:a,tuplesToStringTuples:u,stringTuplesToTuples:c,bufferToTuples:f,tuplesToBuffer:l,bufferToString:d,stringToBuffer:p,fromString:y,fromBuffer:g,validateBuffer:m,isValidBuffer:b,cleanPath:v,ParseError:w,protoFromTuple:_,sizeForAddr:h}}).call(this,r("b639").Buffer)},"37dd":function(e,t,r){"use strict";const n=(e,t)=>0;e.exports=n},3814:function(e,t,r){(function(t){var n=r("918b");r("5ee0");var i=null;!n.util.isNodejs||n.options.usePureJavaScript||t.versions["node-webkit"]||(i=r(5));var s=e.exports=n.prng=n.prng||{};s.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,s=new Array(32),o=0;o<32;++o)s[o]=r.create();function a(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}function c(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function l(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var s=n.util.createBuffer();if(t)while(s.length()>16),l+=(32767&u)<<16,l+=u>>15,l=(2147483647&l)+(l>>31),f=4294967295&l;for(c=0;c<3;++c)h=f>>>(c<<3),h^=Math.floor(256*Math.random()),s.putByte(String.fromCharCode(255&h))}}return s.getBytes(e)}return t.pools=s,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,s=t.plugin.increment,o=t.plugin.formatKey,c=t.plugin.formatSeed,u=n.util.createBuffer();function l(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick((function(){a(l)}));var f=i(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=o(i(t.key,s(t.seed))),t.seed=c(i(t.key,t.seed)),n.util.setImmediate(l)}t.key=null,l()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;var a=n.util.createBuffer();while(a.length()1048575&&(t.key=null),null===t.key&&c();var u=r(t.key,t.seed);t.generated+=u.length,a.putBytes(u),t.key=s(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return a.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,l(e))}catch(r){t(r)}},t.seedFileSync=l),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){function r(e){var n=e.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",r),t(n.forge.prng.err,n.forge.prng.bytes))}self.addEventListener("message",r),self.postMessage({forge:{prng:{needed:e}}})};else{var r=function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))};e.addEventListener("message",r)}},t}}).call(this,r("4362"))},3846:function(e,t,r){"use strict";e.exports={pk:r("fc86")}},3849:function(e,t,r){"use strict";const{Buffer:n}=r("b639"),i=r("ec4e"),s=45569,o=45633,a={init:i.blake2bInit,update:i.blake2bUpdate,digest:i.blake2bFinal},c={init:i.blake2sInit,update:i.blake2sUpdate,digest:i.blake2sFinal},u=(e,t)=>async r=>{const i=t.init(e,null);return t.update(i,r),n.from(t.digest(i))};e.exports=e=>{for(let t=0;t<64;t++)e[s+t]=u(t+1,a);for(let t=0;t<32;t++)e[o+t]=u(t+1,c)}},3866:function(e,t,r){"use strict";const n=r("33fc"),i=r("f1fd"),s=r("f2a1"),o=r("d260"),a=r("4bc2")("ipfs:gc:lock");class c{constructor(e,t){t=t||{},this.mutex=new o(e,{...t,log:a})}readLock(){return this.mutex.readLock()}writeLock(){return this.mutex.writeLock()}pullReadLock(e){return this.pullLock("readLock",e)}pullWriteLock(e){return this.pullLock("writeLock",e)}pullLock(e,t){const r=new u(this.mutex,e);return n(r.take(),t(),r.release())}}class u{constructor(e,t){this.mutex=e,this.type=t,this.releaseLock=null}take(){return s((e,t)=>{if(this.releaseLock)return t(null,e);this.mutex[this.type]().then(r=>{this.releaseLock=r,t(null,e)},t)})}release(){return i(null,e=>{this.releaseLock(e)})}}e.exports=c},3897:function(e,t,r){var n=r("1789")("socket.io-parser"),i=r("6a63"),s=r("8183"),o=r("4398"),a=r("4720");function c(){}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=c,t.Decoder=d;var u=t.ERROR+'"encode error"';function l(e){var r=""+e.type;if(t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(r+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(r+=e.nsp+","),null!=e.id&&(r+=e.id),null!=e.data){var i=h(e.data);if(!1===i)return u;r+=i}return n("encoded %j as %s",e,r),r}function h(e){try{return JSON.stringify(e)}catch(t){return!1}}function f(e,t){function r(e){var r=s.deconstructPacket(e),n=l(r.packet),i=r.buffers;i.unshift(n),t(i)}s.removeBlobs(e,r)}function d(){this.reconstructor=null}function p(e){var r=0,i={type:Number(e.charAt(0))};if(null==t.types[i.type])return m("unknown packet type "+i.type);if(t.BINARY_EVENT===i.type||t.BINARY_ACK===i.type){var s="";while("-"!==e.charAt(++r))if(s+=e.charAt(r),r==e.length)break;if(s!=Number(s)||"-"!==e.charAt(r))throw new Error("Illegal attachments");i.attachments=Number(s)}if("/"===e.charAt(r+1)){i.nsp="";while(++r){var a=e.charAt(r);if(","===a)break;if(i.nsp+=a,r===e.length)break}}else i.nsp="/";var c=e.charAt(r+1);if(""!==c&&Number(c)==c){i.id="";while(++r){a=e.charAt(r);if(null==a||Number(a)!=a){--r;break}if(i.id+=e.charAt(r),r===e.length)break}i.id=Number(i.id)}if(e.charAt(++r)){var u=y(e.substr(r)),l=!1!==u&&(i.type===t.ERROR||o(u));if(!l)return m("invalid payload");i.data=u}return n("decoded %s as %j",e,i),i}function y(e){try{return JSON.parse(e)}catch(t){return!1}}function g(e){this.reconPack=e,this.buffers=[]}function m(e){return{type:t.ERROR,data:"parser error: "+e}}c.prototype.encode=function(e,r){if(n("encoding packet %j",e),t.BINARY_EVENT===e.type||t.BINARY_ACK===e.type)f(e,r);else{var i=l(e);r([i])}},i(d.prototype),d.prototype.add=function(e){var r;if("string"===typeof e)r=p(e),t.BINARY_EVENT===r.type||t.BINARY_ACK===r.type?(this.reconstructor=new g(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!a(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,this.emit("decoded",r))}},d.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},g.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},g.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},"38d4":function(e,t){try{e.exports="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(r){e.exports=!1}},3902:function(e,t,r){"use strict";const n=r("5575"),i=r("e3d5"),{DAGNode:s}=r("c75d"),{normalizePath:o}=r("861c"),{Format:a}=r("12dd"),{Errors:c}=r("7b6d"),u=c.notFoundError().code;function l(e,t,r){const i=o(t),s=i.split("/"),a=s[0];if(!n.cid(a))throw new Error(`Error resolving path '${i}': '${a}' is not a valid CID`);return!1!==r.preload&&e._preload(a),"/ipfs/"+i}async function*h(e,t,r){const n=await e.resolve(t),i=n.split("/"),s=i[2];for await(const o of d(e,s,r.maxDepth,r.unique))o.parent&&(o.isDuplicate||(yield{ref:f(o.parent.cid,o.node.cid,o.node.name,r.format)}))}function f(e,t,r,n){let i=n.replace(//g,e.toString());return i=i.replace(//g,t.toString()),i=i.replace(//g,r),i}async function*d(e,t,r,n){const i=new Set;async function*s(t,o){const a=o+1;if(!(a>r))try{for(const r of await p(e,t.cid))yield{parent:t,node:r,isDuplicate:n&&i.has(r.cid.toString())},n&&i.add(r.cid.toString()),yield*s(r,a)}catch(c){throw c.code===u&&(c.message=`Could not find object with CID: ${t.cid}`),c}}yield*s({cid:t},0)}async function p(e,t){const r=await e._ipld.get(new i(t));return s.isDAGNode(r)?r.Links.map(({Name:e,Hash:t})=>({name:e,cid:new i(t)})):y(r)}function y(e,t=""){let r=[];for(const[n,s]of Object.entries(e))i.isCID(s)?r.push({name:t+n,cid:s}):"object"===typeof s&&(r=r.concat(y(s,t+n+"/")));return r}e.exports=function(e){return async function*(t,r){if(r=r||{},0===r.maxDepth)return;if(r.edges&&r.format&&r.format!==a.default)throw new Error("Cannot set edges to true and also specify format");r.format=r.edges?a.edges:r.format||a.default,"number"!==typeof r.maxDepth&&(r.maxDepth=r.recursive?1/0:1);const n=Array.isArray(t)?t:[t],i=n.map(t=>l(e,t,r));for(const s of i)yield*h(e,s,r)}}},3909:function(e,t,r){"use strict";const n=r("0b54"),i=async(e,t,r)=>n(new Array(e).fill(),(e,r)=>t(r),r);e.exports=i,e.exports.default=i},3958:function(e,t,r){"use strict";const n=r("f106"),i='\nmessage IpnsEntry {\n enum ValidityType {\n\t\tEOL = 0; // setting an EOL says "this record is valid until..."\n\t}\n\n required bytes value = 1;\n\trequired bytes signature = 2;\n\n\toptional ValidityType validityType = 3;\n\toptional bytes validity = 4;\n\n\toptional uint64 sequence = 5;\n\n\toptional uint64 ttl = 6;\n\n\t// in order for nodes to properly validate a record upon receipt, they need the public\n\t// key associated with it. For old RSA keys, its easiest if we just send this as part of\n\t// the record itself. For newer ed25519 keys, the public key can be embedded in the\n\t// peerID, making this field unnecessary.\n\toptional bytes pubKey = 7;\n}\n';e.exports=n(i).IpnsEntry},"39cd":function(e,t,r){var n=r("e0c5").Buffer,i=r("ff48");function s(e,t,r){var s=t.length,o=i(t,e._cache);return e._cache=e._cache.slice(s),e._prev=n.concat([e._prev,r?t:o]),o}t.encrypt=function(e,t,r){var i,o=n.allocUnsafe(0);while(t.length){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){o=n.concat([o,s(e,t,r)]);break}i=e._cache.length,o=n.concat([o,s(e,t.slice(0,i),r)]),t=t.slice(i)}return o}},"3a17":function(e,t,r){"use strict";var n=r("399f"),i=r("549e"),s=r("ffb2");const o="bignumber/5.0.0-beta.135",a=new s["Logger"](o),c={},u=9007199254740991;class l{constructor(e,t){a.checkNew(new.target,l),e!==c&&a.throwError("cannot call consturtor directly; use BigNumber.from",s["Logger"].errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return f(d(this).fromTwos(e))}toTwos(e){return f(d(this).toTwos(e))}abs(){return"-"===this._hex[0]?l.from(this._hex.substring(1)):this}add(e){return f(d(this).add(d(e)))}sub(e){return f(d(this).sub(d(e)))}div(e){const t=l.from(e);return t.isZero()&&p("division by zero","div"),f(d(this).div(d(e)))}mul(e){return f(d(this).mul(d(e)))}mod(e){return f(d(this).mod(d(e)))}pow(e){return f(d(this).pow(d(e)))}maskn(e){return f(d(this).maskn(e))}eq(e){return d(this).eq(d(e))}lt(e){return d(this).lt(d(e))}lte(e){return d(this).lte(d(e))}gt(e){return d(this).gt(d(e))}gte(e){return d(this).gte(d(e))}isZero(){return d(this).isZero()}toNumber(){try{return d(this).toNumber()}catch(e){p("overflow","toNumber",this.toString())}return null}toString(){return 0!==arguments.length&&a.throwError("bigNumber.toString does not accept parameters",s["Logger"].errors.UNEXPECTED_ARGUMENT,{}),d(this).toString(10)}toHexString(){return this._hex}static from(e){return e instanceof l?e:"string"===typeof e?e.match(/-?0x[0-9a-f]+/i)?new l(c,h(e)):e.match(/^-?[0-9]+$/)?new l(c,h(new n["BN"](e))):a.throwArgumentError("invalid BigNumber string","value",e):"number"===typeof e?(e%1&&p("underflow","BigNumber.from",e),(e>=u||e<=-u)&&p("overflow","BigNumber.from",e),l.from(String(e))):"bigint"===typeof e?l.from(e.toString()):Object(i["isBytes"])(e)?l.from(Object(i["hexlify"])(e)):e._hex&&Object(i["isHexString"])(e._hex)?l.from(e._hex):e.toHexString&&(e=e.toHexString(),"string"===typeof e)?l.from(e):a.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function h(e){if("string"!==typeof e)return h(e.toString(16));if("-"===e[0])return e=e.substring(1),"-"===e[0]&&a.throwArgumentError("invalid hex","value",e),e=h(e),"0x00"===e?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";e.length%2&&(e="0x0"+e.substring(2));while(e.length>4&&"0x00"===e.substring(0,4))e="0x"+e.substring(4);return e}function f(e){return l.from(h(e))}function d(e){const t=l.from(e).toHexString();return"-"===t[0]?new n["BN"]("-"+t.substring(3),16):new n["BN"](t.substring(2),16)}function p(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),a.throwError(e,s["Logger"].errors.NUMERIC_FAULT,n)}new s["Logger"](o),l.from(0),l.from(-1);let y="0";while(y.length<256)y+=y;r.d(t,"a",(function(){return l}))},"3a70":function(e,t,r){var n=r("5995");r("31a0");var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],s=[1,2,3,5],o=function(e,t){return e<>16-t},a=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"===typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,s=e,o=e.length(),a=t,c=Math.ceil(a/8),u=255>>(7&a);for(r=o;r<128;r++)s.putByte(i[s.at(r-1)+s.at(r-o)&255]);for(s.setAt(128-c,i[s.at(128-c)&u]),r=127-c;r>=0;r--)s.setAt(r,i[s.at(r+1)^s.at(r+c)]);return s};var c=function(e,t,r){var i,c,u,l,h=!1,f=null,d=null,p=null,y=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=o(e[u],s[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=a(e[u],s[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var n=f.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i=8)g([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(t&&(h=!0,m.update()),!r&&(t=0===f.length(),t))if(e)t=e(8,d,!r);else{var i=d.length(),s=d.at(i-1);s>i?t=!1:d.truncate(s)}return t}},m};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},"3a7b":function(e,t,r){for(var n=r("e2ec"),i=[],s={},o=0;o<256;o++)i[o]=(o+256).toString(16).substr(1),s[i[o]]=o;function a(e,t,r){var n=t&&r||0,i=0;t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,(function(e){i<16&&(t[n+i++]=s[e])}));while(i<16)t[n+i++]=0;return t}function c(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}var u=n(),l=[1|u[0],u[1],u[2],u[3],u[4],u[5]],h=16383&(u[6]<<8|u[7]),f=0,d=0;function p(e,t,r){var n=t&&r||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:h,o=void 0!==e.msecs?e.msecs:(new Date).getTime(),a=void 0!==e.nsecs?e.nsecs:d+1,u=o-f+(a-d)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||o>f)&&void 0===e.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=o,d=a,h=s,o+=122192928e5;var p=(1e4*(268435455&o)+a)%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var y=o/4294967296*1e4&268435455;i[n++]=y>>>8&255,i[n++]=255&y,i[n++]=y>>>24&15|16,i[n++]=y>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var g=e.node||l,m=0;m<6;m++)i[n+m]=g[m];return t||c(i)}function y(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var o=0;o<16;o++)t[i+o]=s[o];return t||c(s)}var g=y;g.v1=p,g.v4=y,g.parse=a,g.unparse=c,e.exports=g},"3a90":function(e,t,r){"use strict";const n=r("239c"),i=r("c044"),s=r("4bc2"),o=r("fa4d"),a=r("8945"),c=s("libp2p:dht:peer-queue");class u{static async fromPeerId(e){const t=await o(t=>a.convertPeerId(e,t))();return new u(t)}static async fromKey(e){const t=await o(t=>a.convertBuffer(e,t))();return new u(t)}constructor(e){c("create: %b",e),this.from=e,this.heap=new n(a.xorCompare)}async enqueue(e){c("enqueue %s",e.toB58String());const t=await o(t=>a.convertPeerId(e,t))(),r={id:e,distance:i(this.from,t)};this.heap.push(r)}dequeue(){const e=this.heap.pop();return c("dequeue %s",e.id.toB58String()),e.id}get length(){return this.heap.size()}}e.exports=u},"3a9a":function(e,t,r){"use strict";const{Buffer:n}=r("b639"),i=self.crypto||self.msCrypto;e.exports=e=>{if("undefined"===typeof self||!self.crypto&&!self.msCrypto)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");return async t=>{switch(e){case"sha1":return n.from(await i.subtle.digest({name:"SHA-1"},t));case"sha2-256":return n.from(await i.subtle.digest({name:"SHA-256"},t));case"sha2-512":return n.from(await i.subtle.digest({name:"SHA-512"},t));case"dbl-sha2-256":{const e=await i.subtle.digest({name:"SHA-256"},t);return n.from(await i.subtle.digest({name:"SHA-256"},e))}default:throw new Error(`${e} is not a supported algorithm`)}}}},"3b1c":function(e,t,r){"use strict";var n=r("399f"),i=r("549e"),s=r("3a17"),o=r("6f5a"),a=r("e165"),c=r("ffb2");const u="address/5.0.0-beta.134";r.d(t,"a",(function(){return m})),r.d(t,"b",(function(){return b}));const l=new c["Logger"](u);function h(e){Object(i["isHexString"])(e,20)||l.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=Object(i["arrayify"])(Object(o["a"])(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&n[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const f=9007199254740991;function d(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const p={};for(let v=0;v<10;v++)p[String(v)]=String(v);for(let v=0;v<26;v++)p[String.fromCharCode(65+v)]=String(10+v);const y=Math.floor(d(f));function g(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(e=>p[e]).join("");while(t.length>=y){let e=t.substring(0,y);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);while(r.length<2)r="0"+r;return r}function m(e){let t=null;if("string"!==typeof e&&l.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=h(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&l.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){e.substring(2,4)!==g(e)&&l.throwArgumentError("bad icap checksum","address",e),t=new n["BN"](e.substring(4),36).toString(16);while(t.length<40)t="0"+t;t=h("0x"+t)}else l.throwArgumentError("invalid address","address",e);return t}function b(e){let t=null;try{t=m(e.from)}catch(n){l.throwArgumentError("missing from address","transaction",e)}const r=Object(i["stripZeros"])(Object(i["arrayify"])(s["a"].from(e.nonce).toHexString()));return m(Object(i["hexDataSlice"])(Object(o["a"])(Object(a["b"])([t,r])),12))}},"3b1f":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var n=r("bcdf"),i=h(n),s=r("dea4"),o=h(s),a=r("ac7e"),c=h(a),u=r("691e"),l=h(u);function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t,r){r=(0,c.default)(r||i.default);var n=(0,l.default)(t);if(!e())return r(null);var s=function(t){if(t)return r(t);if(e())return n(s);var i=(0,o.default)(arguments,1);r.apply(null,[null].concat(i))};n(s)}e.exports=t["default"]},"3b27":function(e,t,r){"use strict";e.exports={repoVersion:7}},"3b66":function(e,t,r){"use strict";const n=r("e3d5"),i=r("0c9a"),s=r("3074");t=e.exports,t.codec=i.DAG_PB,t.defaultHashAlg=i.SHA2_256;const o=async(e,r)=>{const o={cidVersion:1,hashAlg:t.defaultHashAlg},a=Object.assign(o,r),c=await s(e,a.hashAlg),u=i.print[t.codec],l=new n(a.cidVersion,u,c);return l};t.cid=o},"3ba4":function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);function i(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}e.exports=i},"3bd5":function(e,t,r){"use strict";const n=r("33fc"),i=r("03b2"),s=r("5b39"),o=r("4bc2"),a=o("libp2p:secio");a.error=o("libp2p:secio:error");const c=r("e822"),u=r("ab24");e.exports=function(e,t){a("3. finish - start");const r=e.protocols,o=e.shake.rest(),l=s({timeout:e.timeout},e=>{if(e)throw e});n(o,c.createUnboxStream(r.remote.cipher,r.remote.mac),l,c.createBoxStream(r.local.cipher,r.local.mac),o),l.handshake.write(e.proposal.in.rand),l.handshake.read(e.proposal.in.rand.length,(r,n)=>{const s=r=>{a.error(r),e.secure.resolve({source:i(r),sink(e){}}),t(r)};if(r)return s(r);try{u.verifyNonce(e,n)}catch(r){return s(r)}a("3. finish - finish"),e.secure.resolve(l.handshake.rest()),t()})}},"3bd8":function(e,t,r){"use strict";const n={util:r("5ee0"),pki:r("aecb"),jsbn:r("8e82")};function i(e){var t=n.util.decode64((e+"===".slice((e.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"));return new n.jsbn.BigInteger(n.util.bytesToHex(t),16)}function s(e,t){return t.map(t=>i(e[t]))}function o(e){return n.pki.setRsaPrivateKey(...s(e,["n","e","d","p","q","dp","dq","qi"]))}function a(e){return n.pki.privateKeyToPem(o(e))}function c(e){return n.pki.setRsaPublicKey(...s(e,["n","e"]))}function u(e){return n.pki.publicKeyToPem(c(e))}e.exports={jwk2pub:c,jwk2pubPem:u,jwk2priv:o,jwk2privPem:a}},"3bdc":function(e,t,r){(function(t){var r={};e.exports=r;var n={};function i(e,t){var r=0,n=t.length,i=t.charAt(0),s=[0];for(r=0;r0)s.push(a%n),a=a/n|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[s[r]];return c}r.encode=function(e,t,r){if("string"!==typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!==typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var s=0,o=t.length,a=t.charAt(0),c=[0];for(s=0;s0)c.push(l%o),l=l/o|0}for(s=0;0===e[s]&&s=0;--s)n+=t[c[s]]}else n=i(e,t);if(r){var h=new RegExp(".{1,"+r+"}","g");n=n.match(h).join("\r\n")}return n},r.decode=function(e,r){if("string"!==typeof e)throw new TypeError('"input" must be a string.');if("string"!==typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var s=0;s>=8;while(h>0)c.push(255&h),h>>=8}for(var f=0;e[f]===a&&f(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},"3bf8":function(e,t,r){"use strict";e.exports=e=>r("8a3f")(e)},"3c0e":function(e,t,r){"use strict";const n=r("daf7");class i{constructor(e){this.partner=e,this.wantlist=new n,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(e){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=e}receivedBytes(e){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=e}wants(e,t){this.wantlist.add(e,t)}cancelWant(e){this.wantlist.remove(e)}wantlistContains(e){return this.wantlist.contains(e)}debtRatio(){return this.accounting.bytesSent/(this.accounting.bytesRecv+1)}}e.exports=i},"3c1a":function(e,t,r){e.exports=r.p+"img/lock.7aee2123.svg"},"3c1c":function(module,exports,__webpack_require__){"use strict";const fs="object"===typeof window||"object"===typeof self?null:eval('require("fs")'),level=__webpack_require__("cf59"),crypto=__webpack_require__("ff5f"),secp256k1=__webpack_require__("2330"),LRU=__webpack_require__("4128"),Buffer=__webpack_require__("8707").Buffer,{verifier:verifier}=__webpack_require__("720a");function createStore(e="./keystore"){return fs&&fs.mkdirSync&&fs.mkdirSync(e,{recursive:!0}),level(e)}const verifiedCache=new LRU(1e3);class Keystore{constructor(e={}){"string"===typeof e?this._store=createStore(e):"function"===typeof e.open?this._store=e:"string"===typeof e.store?this._store=createStore(e.store):this._store=e.store||createStore(),this._cache=e.cache||new LRU(100)}async open(){return this._store?(await this._store.open(),Promise.resolve()):Promise.reject(new Error("Keystore: No store found to open"))}async close(){this._store&&await this._store.close()}async hasKey(e){if(!e)throw new Error("id needed to check a key");if(this._store.status&&"open"!==this._store.status)return Promise.resolve(null);let t=!1;try{let r=this._cache.get(e)||await this._store.get(e);t=void 0!==r&&null!==r}catch(r){console.error("Error: ENOENT: no such file or directory")}return t}async createKey(e){if(!e)throw new Error("id needed to create a key");if(this._store.status&&"open"!==this._store.status)return Promise.resolve(null);const t=()=>new Promise((e,t)=>{crypto.keys.generateKeyPair("secp256k1",256,(r,n)=>{r||e(n),t(r)})}),r=await t(),n=secp256k1.publicKeyConvert(r.public.marshal(),!1),i={publicKey:n.toString("hex"),privateKey:r.marshal().toString("hex")};try{await this._store.put(e,JSON.stringify(i))}catch(s){console.log(s)}return this._cache.set(e,i),r}async getKey(e){if(!e)throw new Error("id needed to get a key");if(this._store||await this.open(),this._store.status&&"open"!==this._store.status)return Promise.resolve(null);const t=this._cache.get(e);let r;try{r=t||await this._store.get(e)}catch(s){}if(!r)return;const n=t||JSON.parse(r);if(!n)return;t||this._cache.set(e,n);const i=e=>new Promise((t,r)=>{crypto.keys.supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(e,(e,n)=>{e||t(n),r(e)})});return i(Buffer.from(n.privateKey,"hex"))}async sign(e,t){if(!e)throw new Error("No signing key given");if(!t)throw new Error("Given input data was undefined");return Buffer.isBuffer(t)||(t=Buffer.from(t)),new Promise((r,n)=>{e.sign(t,(e,t)=>{e||r(t.toString("hex")),n(e)})})}getPublic(e,t={}){const r=["hex","buffer"],n="undefined"===typeof t.decompress||t.decompress,i=t.format||"hex";if(-1===r.indexOf(i))throw new Error("Supported formats are `hex` and `buffer`");let s=e.public.marshal();return n&&(s=secp256k1.publicKeyConvert(s,!1)),"buffer"===i?s:s.toString("hex")}async verify(e,t,r,n="v1"){return Keystore.verify(e,t,r,n)}static async verify(e,t,r,n="v1"){const i=verifiedCache.get(e);let s=!1;if(i){const e=(e,t,r)=>{let n;return n="v0"===r?0===Buffer.compare(Buffer.alloc(30,e),Buffer.alloc(30,t)):Buffer.isBuffer(t)?0===Buffer.compare(e,t):e===t,n};s=i.publicKey===t&&e(i.data,r,n)}else{const i=await verifier(n).verify(e,t,r);s=i,i&&verifiedCache.set(e,{publicKey:t,data:r})}return s}}module.exports=Keystore},"3c3f":function(e,t){e.exports={name:"memoryStorage",read:n,write:i,each:s,remove:o,clearAll:a};var r={};function n(e){return r[e]}function i(e,t){r[e]=t}function s(e){for(var t in r)r.hasOwnProperty(t)&&e(r[t],t)}function o(e){delete r[e]}function a(e){r={}}},"3c57":function(e,t,r){"use strict";(function(t){const n=r("f106"),i=r("f654"),s=n(r("061f")).Record,o=r("90f6");class a{constructor(e,r,n){e&&i(t.isBuffer(e),"key must be a Buffer"),r&&i(t.isBuffer(r),"value must be a buffer"),this.key=e,this.value=r,this.timeReceived=n}serialize(){return s.encode(this.prepareSerialize())}prepareSerialize(){return{key:this.key,value:this.value,timeReceived:this.timeReceived&&o.toRFC3339(this.timeReceived)}}static deserialize(e){const t=s.decode(e);return a.fromDeserialized(t)}static fromDeserialized(e){let t;e.timeReceived&&(t=o.parseRFC3339(e.timeReceived));const r=new a(e.key,e.value,t);return r}}e.exports=a}).call(this,r("b639").Buffer)},"3c7d":function(e,t,r){"use strict";const n=r("f256"),i=r("8d3f"),s={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};function o(e,t,r,o,a){const c=s[a];if(!c)throw new Error(`Hash '${a}' is unknown or not supported`);const u=n(e,t,r,o,c);return i.encode64(u)}e.exports=o},"3c96":function(e,t){function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=r},"3ca3":function(e,t,r){"use strict";var n=r("6547").charAt,i=r("69f3"),s=r("7dd0"),o="String Iterator",a=i.set,c=i.getterFor(o);s(String,"String",(function(e){a(this,{type:o,string:String(e),index:0})}),(function(){var e,t=c(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},"3cdd":function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},"3ce6":function(e,t,r){var n=r("5995");r("b3d5"),r("31a0");var i=e.exports=n.hmac=n.hmac||{};i.create=function(){var e=null,t=null,r=null,i=null,s={start:function(s,o){if(null!==s)if("string"===typeof s){if(s=s.toLowerCase(),!(s in n.md.algorithms))throw new Error('Unknown hash algorithm "'+s+'"');t=n.md.algorithms[s].create()}else t=s;if(null===o)o=e;else{if("string"===typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var a=o;o=n.util.createBuffer();for(var c=0;ct.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=o.length();for(c=0;c1&&this._buf[this._buf.length-1]===a)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;ni)return!1}return t.length"),e.oneof&&(r="");var n=Object.keys(e.options||{}).map((function(t){return t+" = "+e.options[t]})).join(",");return n&&(n=" ["+n+"]"),t.push((r?r+" ":"")+("map"===e.map?"":e.type+" ")+e.name+" = "+e.tag+n+";"),t},n=function(e,t){t.push("message "+e.name+" {"),e.enums||(e.enums=[]),e.enums.forEach((function(e){t.push(i(e,[]))})),e.messages||(e.messages=[]),e.messages.forEach((function(e){t.push(n(e,[]))}));var s={};return e.fields||(e.fields=[]),e.fields.forEach((function(e){e.oneof?(s[e.oneof]||(s[e.oneof]=[]),s[e.oneof].push(r(e,[]))):t.push(r(e,[]))})),Object.keys(s).forEach((function(e){s[e].unshift("oneof "+e+" {"),s[e].push("}"),t.push(s[e])})),t.push("}",""),t},i=function(e,t){t.push("enum "+e.name+" {"),e.options||(e.options={});var r=o(e.options,[]);return r.length>1&&t.push(r.slice(0,-1)),Object.keys(e.values).map((function(r){var n=s(e.values[r]);t.push([r+" = "+n+";"])})),t.push("}",""),t},s=function(e,t){var r=Object.keys(e.options||{}).map((function(t){return t+" = "+e.options[t]})).join(",");r&&(r=" ["+r+"]");var n=e.value+r;return n},o=function(e,t){var r=Object.keys(e);return r.forEach((function(r){var n=e[r];~r.indexOf(".")&&(r="("+r+")");var i=typeof n;"object"===i?(n=a(n,[]),n.length&&t.push("option "+r+" = {",n,"};")):("string"===i&&"optimize_for"!==r&&(n='"'+n+'"'),t.push("option "+r+" = "+n+";"))})),r.length>0&&t.push(""),t},a=function(e,t){var r=Object.keys(e);return r.forEach((function(r){var n=e[r],i=typeof n;"object"===i?Array.isArray(n)?n.forEach((function(e){e=a(e,[]),e.length&&t.push(r+" {",e,"}")})):(n=a(n,[]),n.length&&t.push(r+" {",n,"}")):("string"===i&&(n='"'+n+'"'),t.push(r+": "+n))})),t},c=function(e,t){return t.push("service "+e.name+" {"),e.options||(e.options={}),o(e.options,t),e.methods||(e.methods=[]),e.methods.forEach((function(e){t.push(u(e,[]))})),t.push("}",""),t},u=function(e,t){var r="rpc "+e.name+"(";e.client_streaming&&(r+="stream "),r+=e.input_type+") returns (",e.server_streaming&&(r+="stream "),r+=e.output_type+")",e.options||(e.options={});var n=o(e.options,[]);return n.length>1?t.push(r+" {",n.slice(0,-1),"}"):t.push(r+";"),t},l=function(e){return function(t){return Array.isArray(t)?t.map(l(e+" ")).join("\n"):e+t}};e.exports=function(e){var t=[];return t.push('syntax = "proto'+e.syntax+'";',""),e.package&&t.push("package "+e.package+";",""),e.options||(e.options={}),o(e.options,t),e.enums||(e.enums=[]),e.enums.forEach((function(e){i(e,t)})),e.messages||(e.messages=[]),e.messages.forEach((function(e){n(e,t)})),e.services&&e.services.forEach((function(e){c(e,t)})),t.map(l("")).join("\n")}},"3d4d":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("2e00"),i=s(n);function s(e){return e&&e.__esModule?e:{default:e}}t.default=i.default,e.exports=t["default"]},"3d5a":function(e,t,r){"use strict";const n=r("0e38");e.exports=function(e){if(!e||"number"!==typeof e)throw new Error("first argument must be a Number bigger than 0");return n(e)}},"3d68":function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return l}));var n=r("33d8"),i=r.n(n),s=r("9bda"),o=r("ffb2"),a=r("4a45"),c=r("3e80");const u=new o["Logger"](a["a"]);class l extends c["a"]{constructor(e,t){u.checkNew(new.target,l),null==e&&u.throwError("missing path",o["Logger"].errors.MISSING_ARGUMENT,{arg:"path"}),super("ipc://"+e,t),Object(s["defineReadOnly"])(this,"path",e)}send(t,r){let n=JSON.stringify({method:t,params:r,id:42,jsonrpc:"2.0"});return new Promise((t,r)=>{let s=e.alloc(0),o=i.a.connect(this.path);o.on("data",t=>{s=e.concat([s,t])}),o.on("end",()=>{try{t(JSON.parse(s.toString()).result),o.destroy()}catch(e){r(e),o.destroy()}}),o.on("error",e=>{r(e),o.destroy()}),o.write(n),o.end()})}}}).call(this,r("b639").Buffer)},"3d73":function(e,t,r){(function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t