@libp2p/pnet 1.0.0-5d1f68e92 → 1.0.0-62e32252a

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- > Connection protection management for libp2p leveraging PSK encryption via XSalsa20.
1
+ # @libp2p/pnet
2
2
 
3
3
  [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
4
  [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
@@ -9,6 +9,21 @@
9
9
 
10
10
  # About
11
11
 
12
+ <!--
13
+
14
+ !IMPORTANT!
15
+
16
+ Everything in this README between "# About" and "# Install" is automatically
17
+ generated and will be overwritten the next time the doc generator is run.
18
+
19
+ To make changes to this section, please update the @packageDocumentation section
20
+ of src/index.js or src/index.ts
21
+
22
+ To experiment with formatting, please run "npm run docs" from the root of this
23
+ repo and examine the changes made.
24
+
25
+ -->
26
+
12
27
  Connection protection management for libp2p leveraging PSK encryption via XSalsa20.
13
28
 
14
29
  ## Example
@@ -53,7 +68,7 @@ node -e "import('@libp2p/pnet').then(({ generateKey }) => generateKey(process.st
53
68
 
54
69
  ### Programmatically
55
70
 
56
- ```js
71
+ ```TypeScript
57
72
  import fs from 'fs'
58
73
  import { generateKey } from '@libp2p/pnet'
59
74
 
@@ -85,8 +100,8 @@ Loading this module through a script tag will make it's exports available as `Li
85
100
 
86
101
  Licensed under either of
87
102
 
88
- - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
89
- - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
103
+ - Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p/blob/main/packages/pnet/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
104
+ - MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p/blob/main/packages/pnet/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
90
105
 
91
106
  # Contribution
92
107
 
package/dist/index.min.js CHANGED
@@ -1,20 +1,7 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PPnet = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var Libp2PPnet=(()=>{var ff=Object.create;var cr=Object.defineProperty;var cf=Object.getOwnPropertyDescriptor;var uf=Object.getOwnPropertyNames;var hf=Object.getPrototypeOf,lf=Object.prototype.hasOwnProperty;var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),V=(e,t)=>{for(var r in t)cr(e,r,{get:t[r],enumerable:!0})},Ra=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uf(t))!lf.call(e,i)&&i!==r&&cr(e,i,{get:()=>t[i],enumerable:!(n=cf(t,i))||n.enumerable});return e};var fe=(e,t,r)=>(r=e!=null?ff(hf(e)):{},Ra(t||!e||!e.__esModule?cr(r,"default",{value:e,enumerable:!0}):r,e)),pf=e=>Ra(cr({},"__esModule",{value:!0}),e);var J=Z((b1,Ua)=>{Ua.exports={options:{usePureJavaScript:!1}}});var Ka=Z((A1,Pa)=>{var on={};Pa.exports=on;var ka={};on.encode=function(e,t,r){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(e instanceof Uint8Array))n=df(e,t);else{var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var f=0,c=e[i];f<s.length;++f)c+=s[f]<<8,s[f]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;e[i]===0&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
3
- `)}return n};on.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=ka[t];if(!r){r=ka[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");for(var i=t.length,a=t.charAt(0),o=[0],n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(s===void 0)return;for(var f=0,c=s;f<o.length;++f)c+=o[f]*i,o[f]=c&255,c>>=8;for(;c>0;)o.push(c&255),c>>=8}for(var u=0;e[u]===a&&u<e.length-1;++u)o.push(0);return typeof Buffer<"u"?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function df(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var f="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)f+=i;for(r=a.length-1;r>=0;--r)f+=t[a[r]];return f}});var se=Z((w1,Va)=>{var Ma=J(),Fa=Ka(),x=Va.exports=Ma.util=Ma.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){x.nextTick=process.nextTick,typeof setImmediate=="function"?x.setImmediate=setImmediate:x.setImmediate=x.nextTick;return}if(typeof setImmediate=="function"){x.setImmediate=function(){return setImmediate.apply(void 0,arguments)},x.nextTick=function(s){return setImmediate(s)};return}if(x.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(f){if(f.source===window&&f.data===e){f.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(u){u()})}};var o=s,e="forge.setImmediate",t=[];x.setImmediate=function(f){t.push(f),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var f=t.slice();t.length=0,f.forEach(function(c){c()})}).observe(i,{attributes:!0});var a=x.setImmediate;x.setImmediate=function(f){Date.now()-r>15?(r=Date.now(),a(f)):(t.push(f),t.length===1&&i.setAttribute("a",n=!n))}}x.nextTick=x.setImmediate})();x.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;x.globalScope=function(){return x.isNodejs?globalThis:typeof self>"u"?window:self}();x.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};x.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};x.isArrayBufferView=function(e){return e&&x.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Mt(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}x.ByteBuffer=sn;function sn(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(x.isArrayBuffer(e)||x.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof sn||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}x.ByteStringBuffer=sn;var yf=4096;x.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>yf&&(this.data.substr(0,1),this._constructedStringLength=0)};x.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};x.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};x.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};x.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this};x.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};x.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(x.encodeUtf8(e))};x.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};x.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};x.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(e&255))};x.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};x.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};x.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};x.ByteStringBuffer.prototype.putInt=function(e,t){Mt(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)};x.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};x.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};x.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};x.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};x.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};x.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};x.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};x.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};x.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};x.ByteStringBuffer.prototype.getInt=function(e){Mt(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};x.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};x.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};x.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};x.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};x.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};x.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};x.ByteStringBuffer.prototype.copy=function(){var e=x.createBuffer(this.data);return e.read=this.read,e};x.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};x.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};x.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};x.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e};x.ByteStringBuffer.prototype.toString=function(){return x.decodeUtf8(this.bytes())};function xf(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=x.isArrayBuffer(e),n=x.isArrayBufferView(e);if(r||n){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}x.DataBuffer=xf;x.DataBuffer.prototype.length=function(){return this.write-this.read};x.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};x.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=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};x.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};x.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this};x.DataBuffer.prototype.putBytes=function(e,t){if(x.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(x.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof x.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&x.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(e instanceof x.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var a;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=x.binary.hex.decode(e,a,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=x.binary.base64.decode(e,a,this.write),this;if(t==="utf8"&&(e=x.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=x.binary.raw.decode(a),this;if(t==="utf16")return this.accommodate(e.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=x.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};x.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};x.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};x.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};x.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};x.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};x.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};x.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};x.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};x.DataBuffer.prototype.putInt=function(e,t){Mt(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};x.DataBuffer.prototype.putSignedInt=function(e,t){return Mt(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};x.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};x.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};x.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};x.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};x.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};x.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};x.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};x.DataBuffer.prototype.getInt=function(e){Mt(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};x.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};x.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):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};x.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};x.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};x.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};x.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};x.DataBuffer.prototype.copy=function(){return new x.DataBuffer(this)};x.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};x.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};x.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};x.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e};x.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return x.binary.raw.encode(t);if(e==="hex")return x.binary.hex.encode(t);if(e==="base64")return x.binary.base64.encode(t);if(e==="utf8")return x.text.utf8.decode(t);if(e==="utf16")return x.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};x.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=x.encodeUtf8(e)),new x.ByteBuffer(e)};x.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r};x.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a,n};x.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t};x.bytesToHex=function(e){return x.createBuffer(e).toHex()};x.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",He=[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],Oa="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";x.encode64=function(e,t){for(var r="",n="",i,a,o,s=0;s<e.length;)i=e.charCodeAt(s++),a=e.charCodeAt(s++),o=e.charCodeAt(s++),r+=Ge.charAt(i>>2),r+=Ge.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Ge.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":Ge.charAt(o&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
4
- `,r=r.substr(t));return n+=r,n};x.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,a,o=0;o<e.length;)r=He[e.charCodeAt(o++)-43],n=He[e.charCodeAt(o++)-43],i=He[e.charCodeAt(o++)-43],a=He[e.charCodeAt(o++)-43],t+=String.fromCharCode(r<<2|n>>4),i!==64&&(t+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(t+=String.fromCharCode((i&3)<<6|a)));return t};x.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};x.decodeUtf8=function(e){return decodeURIComponent(escape(e))};x.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Fa.encode,decode:Fa.decode}};x.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};x.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};x.binary.hex.encode=x.bytesToHex;x.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var i=0,a=r;for(e.length&1&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n};x.binary.base64.encode=function(e,t){for(var r="",n="",i,a,o,s=0;s<e.byteLength;)i=e[s++],a=e[s++],o=e[s++],r+=Ge.charAt(i>>2),r+=Ge.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Ge.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":Ge.charAt(o&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
5
- `,r=r.substr(t));return n+=r,n};x.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,o,s,f=0,c=r;f<e.length;)i=He[e.charCodeAt(f++)-43],a=He[e.charCodeAt(f++)-43],o=He[e.charCodeAt(f++)-43],s=He[e.charCodeAt(f++)-43],n[c++]=i<<2|a>>4,o!==64&&(n[c++]=(a&15)<<4|o>>2,s!==64&&(n[c++]=(o&3)<<6|s));return t?c-r:n.subarray(0,c)};x.binary.base58.encode=function(e,t){return x.binary.baseN.encode(e,Oa,t)};x.binary.base58.decode=function(e,t){return x.binary.baseN.decode(e,Oa,t)};x.text={utf8:{},utf16:{}};x.text.utf8.encode=function(e,t,r){e=x.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};x.text.utf8.decode=function(e){return x.decodeUtf8(String.fromCharCode.apply(null,e))};x.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n};x.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};x.deflate=function(e,t,r){if(t=x.decode64(e.deflate(x.encode64(t)).rval),r){var n=2,i=t.charCodeAt(1);i&32&&(n=6),t=t.substring(n,t.length-4)}return t};x.inflate=function(e,t,r){var n=e.inflate(x.encode64(t)).rval;return n===null?null:x.decode64(n)};var fn=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(r===null?n=e.removeItem(t):(r=x.encode64(JSON.stringify(r)),n=e.setItem(t,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},cn=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(x.decode64(r))),r},gf=function(e,t,r,n){var i=cn(e,t);i===null&&(i={}),i[r]=n,fn(e,t,i)},mf=function(e,t,r){var n=cn(e,t);return n!==null&&(n=r in n?n[r]:null),n},vf=function(e,t,r){var n=cn(e,t);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),fn(e,t,n)}},bf=function(e,t){fn(e,t,null)},ur=function(e,t,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");n=e.apply(this,t),a=i==="flash"}(i==="web"||i==="both")&&(t[0]=localStorage,n=e.apply(this,t),a=!0)}catch(f){o=f}if(a)break}if(!a)throw o;return n};x.setItem=function(e,t,r,n,i){ur(gf,arguments,i)};x.getItem=function(e,t,r,n){return ur(mf,arguments,n)};x.removeItem=function(e,t,r,n){ur(vf,arguments,n)};x.clearItems=function(e,t,r){ur(bf,arguments,r)};x.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};x.format=function(e){for(var t=/%./g,r,n,i=0,a=[],o=0;r=t.exec(e);){n=e.substring(o,t.lastIndex-2),n.length>0&&a.push(n),o=t.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")};x.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=r===void 0?",":r,s=n===void 0?".":n,f=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",u=c.length>3?c.length%3:0;return f+(u?c.substr(0,u)+s:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")};x.formatSize=function(e){return e>=1073741824?e=x.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=x.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=x.formatNumber(e/1024,0)+" KiB":e=x.formatNumber(e,0)+" bytes",e};x.bytesFromIP=function(e){return e.indexOf(".")!==-1?x.bytesFromIPv4(e):e.indexOf(":")!==-1?x.bytesFromIPv6(e):null};x.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=x.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()};x.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(o){return o.length===0&&++t,!0});for(var r=(8-e.length+t)*2,n=x.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=x.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};x.bytesToIP=function(e){return e.length===4?x.bytesToIPv4(e):e.length===16?x.bytesToIPv6(e):null};x.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")};x.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=x.bytesToHex(e[i]+e[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var o=r[r.length-1],s=t.length;!o||s!==o.end+1?r.push({start:s,end:s}):(o.end=s,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1))}t.push(a)}if(r.length>0){var f=r[n];f.end-f.start>0&&(t.splice(f.start,f.end-f.start+1,""),f.start===0&&t.unshift(""),f.end===7&&t.push(""))}return t.join(":")};x.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in x&&!e.update)return t(null,x.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return x.cores=navigator.hardwareConcurrency,t(null,x.cores);if(typeof Worker>"u")return x.cores=1,t(null,x.cores);if(typeof Blob>"u")return x.cores=2,t(null,x.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var s=Date.now(),f=s+4;Date.now()<f;);self.postMessage({st:s,et:f})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(o,s,f){if(s===0){var c=Math.floor(o.reduce(function(u,h){return u+h},0)/o.length);return x.cores=Math.max(1,c),URL.revokeObjectURL(r),t(null,x.cores)}i(f,function(u,h){o.push(a(f,h)),n(o,s-1,f)})}function i(o,s){for(var f=[],c=[],u=0;u<o;++u){var h=new Worker(r);h.addEventListener("message",function(p){if(c.push(p.data),c.length===o){for(var m=0;m<o;++m)f[m].terminate();s(null,c)}}),f.push(h)}for(var u=0;u<o;++u)f[u].postMessage(u)}function a(o,s){for(var f=[],c=0;c<o;++c)for(var u=s[c],h=f[c]=[],p=0;p<o;++p)if(c!==p){var m=s[p];(u.st>m.st&&u.st<m.et||m.st>u.st&&m.st<u.et)&&h.push(p)}return f.reduce(function(l,d){return Math.max(l,d.length)},0)}}});var hn=Z((E1,qa)=>{var ce=J();se();qa.exports=ce.cipher=ce.cipher||{};ce.cipher.algorithms=ce.cipher.algorithms||{};ce.cipher.createCipher=function(e,t){var r=e;if(typeof r=="string"&&(r=ce.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new ce.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})};ce.cipher.createDecipher=function(e,t){var r=e;if(typeof r=="string"&&(r=ce.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new ce.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})};ce.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),ce.cipher.algorithms[e]=t};ce.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in ce.cipher.algorithms?ce.cipher.algorithms[e]:null};var un=ce.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)};un.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=ce.util.createBuffer(),this.output=e.output||ce.util.createBuffer(),this.mode.start(t)};un.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};un.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return e(this.blockSize,r,!1)},this.mode.unpad=function(r){return e(this.blockSize,r,!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))}});var pn=Z((S1,za)=>{var ue=J();se();ue.cipher=ue.cipher||{};var q=za.exports=ue.cipher.modes=ue.cipher.modes||{};q.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};q.ecb.prototype.start=function(e){};q.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};q.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};q.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};q.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};q.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};q.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=hr(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};q.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock};q.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};q.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};q.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};q.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=ue.util.createBuffer(),this._partialBytes=0};q.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};q.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};q.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};q.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ue.util.createBuffer(),this._partialBytes=0};q.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};q.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};q.ofb.prototype.decrypt=q.ofb.prototype.encrypt;q.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ue.util.createBuffer(),this._partialBytes=0};q.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=hr(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};q.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}lr(this._inBlock)};q.ctr.prototype.decrypt=q.ctr.prototype.encrypt;q.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=ue.util.createBuffer(),this._partialBytes=0,this._R=3774873600};q.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=ue.util.createBuffer(e.iv);this._cipherLength=0;var r;if("additionalData"in e?r=ue.util.createBuffer(e.additionalData):r=ue.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=ue.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=t.length();if(n===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(ln(n*8)))}this._inBlock=this._j0.slice(0),lr(this._inBlock),this._partialBytes=0,r=ue.util.createBuffer(r),this._aDataLength=ln(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};q.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),lr(this._inBlock)};q.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),lr(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};q.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=ue.util.createBuffer();var n=this._aDataLength.concat(ln(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};q.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var a=e[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};q.gcm.prototype.pow=function(e,t){for(var r=e[3]&1,n=3;n>0;--n)t[n]=e[n]>>>1|(e[n-1]&1)<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)};q.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=e[n]>>>(7-r%8)*4&15,a=this._m[r][i];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t};q.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)};q.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],f=o/n|0,c=(n-1-o%n)*t;s[f]=1<<t-1<<c,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a};q.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],f=i[o];i[a+o]=[s[0]^f[0],s[1]^f[1],s[2]^f[2],s[3]^f[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i};function hr(e,t){if(typeof e=="string"&&(e=ue.util.createBuffer(e)),ue.util.isArray(e)&&e.length>4){var r=e;e=ue.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!ue.util.isArray(e)){for(var i=[],a=t/4,n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function lr(e){e[e.length-1]=e[e.length-1]+1&4294967295}function ln(e){return[e/4294967296|0,e&4294967295]}});var dr=Z((B1,Ya)=>{var j=J();hn();pn();se();Ya.exports=j.aes=j.aes||{};j.aes.startEncrypting=function(e,t,r,n){var i=pr({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i};j.aes.createEncryptionCipher=function(e,t){return pr({key:e,output:null,decrypt:!1,mode:t})};j.aes.startDecrypting=function(e,t,r,n){var i=pr({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i};j.aes.createDecryptionCipher=function(e,t){return pr({key:e,output:null,decrypt:!0,mode:t})};j.aes.Algorithm=function(e,t){xn||Ga();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(n,i){return yn(r._w,n,i,!1)},decrypt:function(n,i){return yn(r._w,n,i,!0)}}}),r._init=!1};j.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=j.util.createBuffer(t);else if(j.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=j.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(!j.util.isArray(t)){r=t,t=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)t.push(r.getInt32())}}if(!j.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,o=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=Ha(t,e.decrypt&&!o),this._init=!0}};j.aes._expandKey=function(e,t){return xn||Ga(),Ha(e,t)};j.aes._updateBlock=yn;pt("AES-ECB",j.cipher.modes.ecb);pt("AES-CBC",j.cipher.modes.cbc);pt("AES-CFB",j.cipher.modes.cfb);pt("AES-OFB",j.cipher.modes.ofb);pt("AES-CTR",j.cipher.modes.ctr);pt("AES-GCM",j.cipher.modes.gcm);function pt(e,t){var r=function(){return new j.aes.Algorithm(e,t)};j.cipher.registerAlgorithm(e,r)}var xn=!1,lt=4,de,dn,Qa,et,we;function Ga(){xn=!0,Qa=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;de=new Array(256),dn=new Array(256),et=new Array(4),we=new Array(4);for(var t=0;t<4;++t)et[t]=new Array(256),we[t]=new Array(256);for(var r=0,n=0,i,a,o,s,f,c,u,t=0;t<256;++t){s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^s&255^99,de[r]=s,dn[s]=r,f=e[s],i=e[r],a=e[i],o=e[a],c=f<<24^s<<16^s<<8^(s^f),u=(i^a^o)<<24^(r^o)<<16^(r^a^o)<<8^(r^i^o);for(var h=0;h<4;++h)et[h][r]=c,we[h][s]=u,c=c<<24|c>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^e[e[e[i^o]]],n^=e[e[n]])}}function Ha(e,t){for(var r=e.slice(0),n,i=1,a=r.length,o=a+6+1,s=lt*o,f=a;f<s;++f)n=r[f-1],f%a===0?(n=de[n>>>16&255]<<24^de[n>>>8&255]<<16^de[n&255]<<8^de[n>>>24]^Qa[i]<<24,i++):a>6&&f%a===4&&(n=de[n>>>24]<<24^de[n>>>16&255]<<16^de[n>>>8&255]<<8^de[n&255]),r[f]=r[f-a]^n;if(t){var c,u=we[0],h=we[1],p=we[2],m=we[3],l=r.slice(0);s=r.length;for(var f=0,d=s-lt;f<s;f+=lt,d-=lt)if(f===0||f===s-lt)l[f]=r[d],l[f+1]=r[d+3],l[f+2]=r[d+2],l[f+3]=r[d+1];else for(var g=0;g<lt;++g)c=r[d+g],l[f+(3&-g)]=u[de[c>>>24]]^h[de[c>>>16&255]]^p[de[c>>>8&255]]^m[de[c&255]];r=l}return r}function yn(e,t,r,n){var i=e.length/4-1,a,o,s,f,c;n?(a=we[0],o=we[1],s=we[2],f=we[3],c=dn):(a=et[0],o=et[1],s=et[2],f=et[3],c=de);var u,h,p,m,l,d,g;u=t[0]^e[0],h=t[n?3:1]^e[1],p=t[2]^e[2],m=t[n?1:3]^e[3];for(var b=3,S=1;S<i;++S)l=a[u>>>24]^o[h>>>16&255]^s[p>>>8&255]^f[m&255]^e[++b],d=a[h>>>24]^o[p>>>16&255]^s[m>>>8&255]^f[u&255]^e[++b],g=a[p>>>24]^o[m>>>16&255]^s[u>>>8&255]^f[h&255]^e[++b],m=a[m>>>24]^o[u>>>16&255]^s[h>>>8&255]^f[p&255]^e[++b],u=l,h=d,p=g;r[0]=c[u>>>24]<<24^c[h>>>16&255]<<16^c[p>>>8&255]<<8^c[m&255]^e[++b],r[n?3:1]=c[h>>>24]<<24^c[p>>>16&255]<<16^c[m>>>8&255]<<8^c[u&255]^e[++b],r[2]=c[p>>>24]<<24^c[m>>>16&255]<<16^c[u>>>8&255]<<8^c[h&255]^e[++b],r[n?1:3]=c[m>>>24]<<24^c[u>>>16&255]<<16^c[h>>>8&255]<<8^c[p&255]^e[++b]}function pr(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="AES-"+t,n;e.decrypt?n=j.cipher.createDecipher(r,e.key):n=j.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof j.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var mr=Z((Rx,go)=>{var zt=J();zt.pki=zt.pki||{};var Vn=go.exports=zt.pki.oids=zt.oids=zt.oids||{};function T(e,t){Vn[e]=t,Vn[t]=e}function W(e,t){Vn[e]=t}T("1.2.840.113549.1.1.1","rsaEncryption");T("1.2.840.113549.1.1.4","md5WithRSAEncryption");T("1.2.840.113549.1.1.5","sha1WithRSAEncryption");T("1.2.840.113549.1.1.7","RSAES-OAEP");T("1.2.840.113549.1.1.8","mgf1");T("1.2.840.113549.1.1.9","pSpecified");T("1.2.840.113549.1.1.10","RSASSA-PSS");T("1.2.840.113549.1.1.11","sha256WithRSAEncryption");T("1.2.840.113549.1.1.12","sha384WithRSAEncryption");T("1.2.840.113549.1.1.13","sha512WithRSAEncryption");T("1.3.101.112","EdDSA25519");T("1.2.840.10040.4.3","dsa-with-sha1");T("1.3.14.3.2.7","desCBC");T("1.3.14.3.2.26","sha1");T("1.3.14.3.2.29","sha1WithRSASignature");T("2.16.840.1.101.3.4.2.1","sha256");T("2.16.840.1.101.3.4.2.2","sha384");T("2.16.840.1.101.3.4.2.3","sha512");T("2.16.840.1.101.3.4.2.4","sha224");T("2.16.840.1.101.3.4.2.5","sha512-224");T("2.16.840.1.101.3.4.2.6","sha512-256");T("1.2.840.113549.2.2","md2");T("1.2.840.113549.2.5","md5");T("1.2.840.113549.1.7.1","data");T("1.2.840.113549.1.7.2","signedData");T("1.2.840.113549.1.7.3","envelopedData");T("1.2.840.113549.1.7.4","signedAndEnvelopedData");T("1.2.840.113549.1.7.5","digestedData");T("1.2.840.113549.1.7.6","encryptedData");T("1.2.840.113549.1.9.1","emailAddress");T("1.2.840.113549.1.9.2","unstructuredName");T("1.2.840.113549.1.9.3","contentType");T("1.2.840.113549.1.9.4","messageDigest");T("1.2.840.113549.1.9.5","signingTime");T("1.2.840.113549.1.9.6","counterSignature");T("1.2.840.113549.1.9.7","challengePassword");T("1.2.840.113549.1.9.8","unstructuredAddress");T("1.2.840.113549.1.9.14","extensionRequest");T("1.2.840.113549.1.9.20","friendlyName");T("1.2.840.113549.1.9.21","localKeyId");T("1.2.840.113549.1.9.22.1","x509Certificate");T("1.2.840.113549.1.12.10.1.1","keyBag");T("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");T("1.2.840.113549.1.12.10.1.3","certBag");T("1.2.840.113549.1.12.10.1.4","crlBag");T("1.2.840.113549.1.12.10.1.5","secretBag");T("1.2.840.113549.1.12.10.1.6","safeContentsBag");T("1.2.840.113549.1.5.13","pkcs5PBES2");T("1.2.840.113549.1.5.12","pkcs5PBKDF2");T("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");T("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");T("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");T("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");T("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");T("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");T("1.2.840.113549.2.7","hmacWithSHA1");T("1.2.840.113549.2.8","hmacWithSHA224");T("1.2.840.113549.2.9","hmacWithSHA256");T("1.2.840.113549.2.10","hmacWithSHA384");T("1.2.840.113549.2.11","hmacWithSHA512");T("1.2.840.113549.3.7","des-EDE3-CBC");T("2.16.840.1.101.3.4.1.2","aes128-CBC");T("2.16.840.1.101.3.4.1.22","aes192-CBC");T("2.16.840.1.101.3.4.1.42","aes256-CBC");T("2.5.4.3","commonName");T("2.5.4.4","surname");T("2.5.4.5","serialNumber");T("2.5.4.6","countryName");T("2.5.4.7","localityName");T("2.5.4.8","stateOrProvinceName");T("2.5.4.9","streetAddress");T("2.5.4.10","organizationName");T("2.5.4.11","organizationalUnitName");T("2.5.4.12","title");T("2.5.4.13","description");T("2.5.4.15","businessCategory");T("2.5.4.17","postalCode");T("2.5.4.42","givenName");T("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");T("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");T("2.16.840.1.113730.1.1","nsCertType");T("2.16.840.1.113730.1.13","nsComment");W("2.5.29.1","authorityKeyIdentifier");W("2.5.29.2","keyAttributes");W("2.5.29.3","certificatePolicies");W("2.5.29.4","keyUsageRestriction");W("2.5.29.5","policyMapping");W("2.5.29.6","subtreesConstraint");W("2.5.29.7","subjectAltName");W("2.5.29.8","issuerAltName");W("2.5.29.9","subjectDirectoryAttributes");W("2.5.29.10","basicConstraints");W("2.5.29.11","nameConstraints");W("2.5.29.12","policyConstraints");W("2.5.29.13","basicConstraints");T("2.5.29.14","subjectKeyIdentifier");T("2.5.29.15","keyUsage");W("2.5.29.16","privateKeyUsagePeriod");T("2.5.29.17","subjectAltName");T("2.5.29.18","issuerAltName");T("2.5.29.19","basicConstraints");W("2.5.29.20","cRLNumber");W("2.5.29.21","cRLReason");W("2.5.29.22","expirationDate");W("2.5.29.23","instructionCode");W("2.5.29.24","invalidityDate");W("2.5.29.25","cRLDistributionPoints");W("2.5.29.26","issuingDistributionPoint");W("2.5.29.27","deltaCRLIndicator");W("2.5.29.28","issuingDistributionPoint");W("2.5.29.29","certificateIssuer");W("2.5.29.30","nameConstraints");T("2.5.29.31","cRLDistributionPoints");T("2.5.29.32","certificatePolicies");W("2.5.29.33","policyMappings");W("2.5.29.34","policyConstraints");T("2.5.29.35","authorityKeyIdentifier");W("2.5.29.36","policyConstraints");T("2.5.29.37","extKeyUsage");W("2.5.29.46","freshestCRL");W("2.5.29.54","inhibitAnyPolicy");T("1.3.6.1.4.1.11129.2.4.2","timestampList");T("1.3.6.1.5.5.7.1.1","authorityInfoAccess");T("1.3.6.1.5.5.7.3.1","serverAuth");T("1.3.6.1.5.5.7.3.2","clientAuth");T("1.3.6.1.5.5.7.3.3","codeSigning");T("1.3.6.1.5.5.7.3.4","emailProtection");T("1.3.6.1.5.5.7.3.8","timeStamping")});var Gt=Z((Nx,vo)=>{var ee=J();se();mr();var R=vo.exports=ee.asn1=ee.asn1||{};R.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};R.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};R.create=function(e,t,r,n,i){if(ee.util.isArray(n)){for(var a=[],o=0;o<n.length;++o)n[o]!==void 0&&a.push(n[o]);n=a}var s={tagClass:e,type:t,constructed:r,composed:r||ee.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=R.copy(s)),s};R.copy=function(e,t){var r;if(ee.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(R.copy(e[n],t));return r}return typeof e=="string"?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:R.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)};R.equals=function(e,t,r){if(ee.util.isArray(e)){if(!ee.util.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!R.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&R.equals(e.value,t.value);return r&&r.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i};R.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var r,n=t&128;return n?r=e.getInt((t&127)<<3):r=t,r}};function Qt(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}var Nc=function(e,t){var r=e.getByte();if(t--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;Qt(e,t,a),n=e.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};R.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=ee.util.createBuffer(e));var r=e.length(),n=vr(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=e.length(),i}return n};function vr(e,t,r,n){var i;Qt(e,t,2);var a=e.getByte();t--;var o=a&192,s=a&31;i=e.length();var f=Nc(e,t);if(t-=i-e.length(),f!==void 0&&f>t){if(n.strict){var c=new Error("Too few bytes to read ASN.1 value.");throw c.available=e.length(),c.remaining=t,c.requested=f,c}f=t}var u,h,p=(a&32)===32;if(p)if(u=[],f===void 0)for(;;){if(Qt(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}i=e.length(),u.push(vr(e,t,r+1,n)),t-=i-e.length()}else for(;f>0;)i=e.length(),u.push(vr(e,f,r+1,n)),t-=i-e.length(),f-=i-e.length();if(u===void 0&&o===R.Class.UNIVERSAL&&s===R.Type.BITSTRING&&(h=e.bytes(f)),u===void 0&&n.decodeBitStrings&&o===R.Class.UNIVERSAL&&s===R.Type.BITSTRING&&f>1){var m=e.read,l=t,d=0;if(s===R.Type.BITSTRING&&(Qt(e,t,1),d=e.getByte(),t--),d===0)try{i=e.length();var g={strict:!0,decodeBitStrings:!0},b=vr(e,t,r+1,g),S=i-e.length();t-=S,s==R.Type.BITSTRING&&S++;var w=b.tagClass;S===f&&(w===R.Class.UNIVERSAL||w===R.Class.CONTEXT_SPECIFIC)&&(u=[b])}catch{}u===void 0&&(e.read=m,t=l)}if(u===void 0){if(f===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=t}if(s===R.Type.BMPSTRING)for(u="";f>0;f-=2)Qt(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(f),t-=f}var C=h===void 0?null:{bitStringContents:h};return R.create(o,s,p,u,C)}R.toDer=function(e){var t=ee.util.createBuffer(),r=e.tagClass|e.type,n=ee.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=R.equals(e,e.original))),i)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var a=0;a<e.value.length;++a)e.value[a]!==void 0&&n.putBuffer(R.toDer(e.value[a]))}else if(e.type===R.Type.BMPSTRING)for(var a=0;a<e.value.length;++a)n.putInt16(e.value.charCodeAt(a));else e.type===R.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),n.length()<=127)t.putByte(n.length()&127);else{var o=n.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);t.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)t.putByte(s.charCodeAt(a))}return t.putBuffer(n),t};R.oidToDer=function(e){var t=e.split("."),r=ee.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var n,i,a,o,s=2;s<t.length;++s){n=!0,i=[],a=parseInt(t[s],10);do o=a&127,a=a>>>7,n||(o|=128),i.push(o),n=!1;while(a>0);for(var f=i.length-1;f>=0;--f)r.putByte(i[f])}return r};R.derToOid=function(e){var t;typeof e=="string"&&(e=ee.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)r=e.getByte(),n=n<<7,r&128?n+=r&127:(t+="."+(n+r),n=0);return t};R.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var f=e.charAt(10),c=10;f!=="+"&&f!=="-"&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&(f=e.charAt(c),f==="+"||f==="-")){var u=parseInt(e.substr(c+1,2),10),h=parseInt(e.substr(c+4,2),10),p=u*60+h;p*=6e4,f==="+"?t.setTime(+t-p):t.setTime(+t+p)}return t};R.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),f=0,c=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var h=e.length-5,p=e.charAt(h);if(p==="+"||p==="-"){var m=parseInt(e.substr(h+1,2),10),l=parseInt(e.substr(h+4,2),10);c=m*60+l,c*=6e4,p==="+"&&(c*=-1),u=!0}return e.charAt(14)==="."&&(f=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,f),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,f)),t};R.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};R.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};R.integerToDer=function(e){var t=ee.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r};R.derToInteger=function(e){typeof e=="string"&&(e=ee.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};R.validate=function(e,t,r,n){var i=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(i=!0,t.value&&ee.util.isArray(t.value))for(var a=0,o=0;i&&o<t.value.length;++o)i=t.value[o].optional||!1,e.value[a]&&(i=R.validate(e.value[a],t.value[o],r,n),i?++a:t.value[o].optional&&(i=!0)),!i&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){var s;if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{var f=e.bitStringContents.charCodeAt(0);if(f!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return i};var mo=/[^\\u0000-\\u00ff]/;R.prettyPrint=function(e,t,r){var n="";t=t||0,r=r||2,t>0&&(n+=`
6
- `);for(var i="",a=0;a<t*r;++a)i+=" ";switch(n+=i+"Tag: ",e.tagClass){case R.Class.UNIVERSAL:n+="Universal:";break;case R.Class.APPLICATION:n+="Application:";break;case R.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case R.Class.PRIVATE:n+="Private:";break}if(e.tagClass===R.Class.UNIVERSAL)switch(n+=e.type,e.type){case R.Type.NONE:n+=" (None)";break;case R.Type.BOOLEAN:n+=" (Boolean)";break;case R.Type.INTEGER:n+=" (Integer)";break;case R.Type.BITSTRING:n+=" (Bit string)";break;case R.Type.OCTETSTRING:n+=" (Octet string)";break;case R.Type.NULL:n+=" (Null)";break;case R.Type.OID:n+=" (Object Identifier)";break;case R.Type.ODESC:n+=" (Object Descriptor)";break;case R.Type.EXTERNAL:n+=" (External or Instance of)";break;case R.Type.REAL:n+=" (Real)";break;case R.Type.ENUMERATED:n+=" (Enumerated)";break;case R.Type.EMBEDDED:n+=" (Embedded PDV)";break;case R.Type.UTF8:n+=" (UTF8)";break;case R.Type.ROID:n+=" (Relative Object Identifier)";break;case R.Type.SEQUENCE:n+=" (Sequence)";break;case R.Type.SET:n+=" (Set)";break;case R.Type.PRINTABLESTRING:n+=" (Printable String)";break;case R.Type.IA5String:n+=" (IA5String (ASCII))";break;case R.Type.UTCTIME:n+=" (UTC time)";break;case R.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case R.Type.BMPSTRING:n+=" (BMP String)";break}else n+=e.type;if(n+=`
7
- `,n+=i+"Constructed: "+e.constructed+`
8
- `,e.composed){for(var o=0,s="",a=0;a<e.value.length;++a)e.value[a]!==void 0&&(o+=1,s+=R.prettyPrint(e.value[a],t+1,r),a+1<e.value.length&&(s+=","));n+=i+"Sub values: "+o+s}else{if(n+=i+"Value: ",e.type===R.Type.OID){var f=R.derToOid(e.value);n+=f,ee.pki&&ee.pki.oids&&f in ee.pki.oids&&(n+=" ("+ee.pki.oids[f]+") ")}if(e.type===R.Type.INTEGER)try{n+=R.derToInteger(e.value)}catch{n+="0x"+ee.util.bytesToHex(e.value)}else if(e.type===R.Type.BITSTRING){if(e.value.length>1?n+="0x"+ee.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var c=e.value.charCodeAt(0);c==1?n+=" (1 unused bit shown)":c>1&&(n+=" ("+c+" unused bits shown)")}}else if(e.type===R.Type.OCTETSTRING)mo.test(e.value)||(n+="("+e.value+") "),n+="0x"+ee.util.bytesToHex(e.value);else if(e.type===R.Type.UTF8)try{n+=ee.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")n+="0x"+ee.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===R.Type.PRINTABLESTRING||e.type===R.Type.IA5String?n+=e.value:mo.test(e.value)?n+="0x"+ee.util.bytesToHex(e.value):e.value.length===0?n+="[null]":n+=e.value}return n}});var wo=Z((Lx,Ao)=>{var re=J();hn();pn();se();Ao.exports=re.des=re.des||{};re.des.startEncrypting=function(e,t,r,n){var i=br({key:e,output:r,decrypt:!1,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};re.des.createEncryptionCipher=function(e,t){return br({key:e,output:null,decrypt:!1,mode:t})};re.des.startDecrypting=function(e,t,r,n){var i=br({key:e,output:r,decrypt:!0,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};re.des.createDecryptionCipher=function(e,t){return br({key:e,output:null,decrypt:!0,mode:t})};re.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(n,i){return bo(r._keys,n,i,!1)},decrypt:function(n,i){return bo(r._keys,n,i,!0)}}}),r._init=!1};re.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=re.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Vc(t),this._init=!0}};Ie("DES-ECB",re.cipher.modes.ecb);Ie("DES-CBC",re.cipher.modes.cbc);Ie("DES-CFB",re.cipher.modes.cfb);Ie("DES-OFB",re.cipher.modes.ofb);Ie("DES-CTR",re.cipher.modes.ctr);Ie("3DES-ECB",re.cipher.modes.ecb);Ie("3DES-CBC",re.cipher.modes.cbc);Ie("3DES-CFB",re.cipher.modes.cfb);Ie("3DES-OFB",re.cipher.modes.ofb);Ie("3DES-CTR",re.cipher.modes.ctr);function Ie(e,t){var r=function(){return new re.des.Algorithm(e,t)};re.cipher.registerAlgorithm(e,r)}var Lc=[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],Uc=[-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],kc=[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],Pc=[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],Kc=[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],Mc=[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],Fc=[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],Oc=[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 Vc(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],d=e.length()>8?3:1,g=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],S=0,w,C=0;C<d;C++){var E=e.getInt32(),B=e.getInt32();w=(E>>>4^B)&252645135,B^=w,E^=w<<4,w=(B>>>-16^E)&65535,E^=w,B^=w<<-16,w=(E>>>2^B)&858993459,B^=w,E^=w<<2,w=(B>>>-16^E)&65535,E^=w,B^=w<<-16,w=(E>>>1^B)&1431655765,B^=w,E^=w<<1,w=(B>>>8^E)&16711935,E^=w,B^=w<<8,w=(E>>>1^B)&1431655765,B^=w,E^=w<<1,w=E<<8|B>>>20&240,E=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=w;for(var _=0;_<b.length;++_){b[_]?(E=E<<2|E>>>26,B=B<<2|B>>>26):(E=E<<1|E>>>27,B=B<<1|B>>>27),E&=-15,B&=-15;var D=t[E>>>28]|r[E>>>24&15]|n[E>>>20&15]|i[E>>>16&15]|a[E>>>12&15]|o[E>>>8&15]|s[E>>>4&15],U=f[B>>>28]|c[B>>>24&15]|u[B>>>20&15]|h[B>>>16&15]|p[B>>>12&15]|m[B>>>8&15]|l[B>>>4&15];w=(U>>>16^D)&65535,g[S++]=D^w,g[S++]=U^w<<16}}return g}function bo(e,t,r,n){var i=e.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],f=t[1];o=(s>>>4^f)&252645135,f^=o,s^=o<<4,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,s=s<<1|s>>>31,f=f<<1|f>>>31;for(var c=0;c<i;c+=3){for(var u=a[c+1],h=a[c+2],p=a[c];p!=u;p+=h){var m=f^e[p],l=(f>>>4|f<<28)^e[p+1];o=s,s=f,f=o^(Uc[m>>>24&63]|Pc[m>>>16&63]|Mc[m>>>8&63]|Oc[m&63]|Lc[l>>>24&63]|kc[l>>>16&63]|Kc[l>>>8&63]|Fc[l&63])}o=s,s=f,f=o}s=s>>>1|s<<31,f=f>>>1|f<<31,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(s>>>4^f)&252645135,f^=o,s^=o<<4,r[0]=s,r[1]=f}function br(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="DES-"+t,n;e.decrypt?n=re.cipher.createDecipher(r,e.key):n=re.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof re.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var rt=Z((Ux,Eo)=>{var Ar=J();Eo.exports=Ar.md=Ar.md||{};Ar.md.algorithms=Ar.md.algorithms||{}});var Bo=Z((kx,So)=>{var Fe=J();rt();se();var qc=So.exports=Fe.hmac=Fe.hmac||{};qc.create=function(){var e=null,t=null,r=null,n=null,i={};return i.start=function(a,o){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in Fe.md.algorithms)t=Fe.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else t=a;if(o===null)o=e;else{if(typeof o=="string")o=Fe.util.createBuffer(o);else if(Fe.util.isArray(o)){var s=o;o=Fe.util.createBuffer();for(var f=0;f<s.length;++f)o.putByte(s[f])}var c=o.length();c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=Fe.util.createBuffer(),n=Fe.util.createBuffer(),c=o.length();for(var f=0;f<c;++f){var s=o.at(f);r.putByte(54^s),n.putByte(92^s)}if(c<t.blockLength)for(var s=t.blockLength-c,f=0;f<s;++f)r.putByte(54),n.putByte(92);e=o,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},i.update=function(a){t.update(a)},i.getMac=function(){var a=t.digest().bytes();return t.start(),t.update(n),t.update(a),t.digest()},i.digest=i.getMac,i}});var wr=Z(()=>{});var qn=Z((Mx,Co)=>{var ye=J();Bo();rt();se();var zc=ye.pkcs5=ye.pkcs5||{},Oe;ye.util.isNodejs&&!ye.options.usePureJavaScript&&(Oe=wr());Co.exports=ye.pbkdf2=zc.pbkdf2=function(e,t,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),ye.util.isNodejs&&!ye.options.usePureJavaScript&&Oe.pbkdf2&&(i===null||typeof i!="object")&&(Oe.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?Oe.pbkdf2Sync.length===4?Oe.pbkdf2(e,t,r,n,function(w,C){if(w)return a(w);a(null,C.toString("binary"))}):Oe.pbkdf2(e,t,r,n,i,function(w,C){if(w)return a(w);a(null,C.toString("binary"))}):Oe.pbkdf2Sync.length===4?Oe.pbkdf2Sync(e,t,r,n).toString("binary"):Oe.pbkdf2Sync(e,t,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in ye.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=ye.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var f=Math.ceil(n/o),c=n-(f-1)*o,u=ye.hmac.create();u.start(i,e);var h="",p,m,l;if(!a){for(var d=1;d<=f;++d){u.start(null,null),u.update(t),u.update(ye.util.int32ToBytes(d)),p=l=u.digest().getBytes();for(var g=2;g<=r;++g)u.start(null,null),u.update(l),m=u.digest().getBytes(),p=ye.util.xorBytes(p,m,o),l=m;h+=d<f?p:p.substr(0,c)}return h}var d=1,g;function b(){if(d>f)return a(null,h);u.start(null,null),u.update(t),u.update(ye.util.int32ToBytes(d)),p=l=u.digest().getBytes(),g=2,S()}function S(){if(g<=r)return u.start(null,null),u.update(l),m=u.digest().getBytes(),p=ye.util.xorBytes(p,m,o),l=m,++g,ye.util.setImmediate(S);h+=d<f?p:p.substr(0,c),++d,b()}b()}});var _o=Z((Fx,To)=>{var Sr=J();se();var Io=To.exports=Sr.pem=Sr.pem||{};Io.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+`-----\r
9
- `,n;if(e.procType&&(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},r+=Er(n)),e.contentDomain&&(n={name:"Content-Domain",values:[e.contentDomain]},r+=Er(n)),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),r+=Er(n)),e.headers)for(var i=0;i<e.headers.length;++i)r+=Er(e.headers[i]);return e.procType&&(r+=`\r
10
- `),r+=Sr.util.encode64(e.body,t.maxline||64)+`\r
11
- `,r+="-----END "+e.type+`-----\r
12
- `,r};Io.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=r.exec(e),!!a;){var o=a[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var s={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Sr.util.decode64(a[3])};if(t.push(s),!!a[2]){for(var f=a[2].split(i),c=0;a&&c<f.length;){for(var u=f[c].replace(/\s+$/,""),h=c+1;h<f.length;++h){var p=f[h];if(!/\s/.test(p[0]))break;u+=p,c=h}if(a=u.match(n),a){for(var m={name:a[1],values:[]},l=a[2].split(","),d=0;d<l.length;++d)m.values.push(Qc(l[d]));if(s.procType)if(!s.contentDomain&&m.name==="Content-Domain")s.contentDomain=l[0]||"";else if(!s.dekInfo&&m.name==="DEK-Info"){if(m.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:l[0],parameters:l[1]||null}}else s.headers.push(m);else{if(m.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(m.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:l[0],type:l[1]}}}++c}if(s.procType==="ENCRYPTED"&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Er(e){for(var t=e.name+": ",r=[],n=function(f,c){return" "+c},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+`\r
13
- `;for(var a=0,o=-1,i=0;i<t.length;++i,++a)if(a>65&&o!==-1){var s=t[o];s===","?(++o,t=t.substr(0,o)+`\r
14
- `+t.substr(o)):t=t.substr(0,o)+`\r
15
- `+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function Qc(e){return e.replace(/^\s+/,"")}});var ko=Z((Ox,Uo)=>{var Te=J();rt();se();var Ro=Uo.exports=Te.sha256=Te.sha256||{};Te.md.sha256=Te.md.algorithms.sha256=Ro;Ro.create=function(){No||Gc();var e=null,t=Te.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return t=Te.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=Te.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),Do(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=Te.util.createBuffer();i.putBytes(t.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(zn.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)s=n.fullMessageLength[u+1]*8,f=s/4294967296>>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};Do(h,r,i);var p=Te.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},n};var zn=null,No=!1,Lo=null;function Gc(){zn="\x80",zn+=Te.util.fillString("\0",64),Lo=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],No=!0}function Do(e,t,r){for(var n,i,a,o,s,f,c,u,h,p,m,l,d,g,b,S=r.length();S>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=t[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=t[c-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,h=e.h1,p=e.h2,m=e.h3,l=e.h4,d=e.h5,g=e.h6,b=e.h7,c=0;c<64;++c)o=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),s=g^l&(d^g),a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),f=u&h|p&(u^h),n=b+o+s+Lo[c]+t[c],i=a+f,b=g,g=d,d=l,l=m+n>>>0,m=p,p=h,h=u,u=n+i>>>0;e.h0=e.h0+u|0,e.h1=e.h1+h|0,e.h2=e.h2+p|0,e.h3=e.h3+m|0,e.h4=e.h4+l|0,e.h5=e.h5+d|0,e.h6=e.h6+g|0,e.h7=e.h7+b|0,S-=64}}});var Ko=Z((Vx,Po)=>{var _e=J();se();var Br=null;_e.util.isNodejs&&!_e.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Br=wr());var Hc=Po.exports=_e.prng=_e.prng||{};Hc.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();t.pools=n,t.pool=0,t.generate=function(c,u){if(!u)return t.generateSync(c);var h=t.plugin.cipher,p=t.plugin.increment,m=t.plugin.formatKey,l=t.plugin.formatSeed,d=_e.util.createBuffer();t.key=null,g();function g(b){if(b)return u(b);if(d.length()>=c)return u(null,d.getBytes(c));if(t.generated>1048575&&(t.key=null),t.key===null)return _e.util.nextTick(function(){a(g)});var S=h(t.key,t.seed);t.generated+=S.length,d.putBytes(S),t.key=m(h(t.key,p(t.seed))),t.seed=l(h(t.key,t.seed)),_e.util.setImmediate(g)}},t.generateSync=function(c){var u=t.plugin.cipher,h=t.plugin.increment,p=t.plugin.formatKey,m=t.plugin.formatSeed;t.key=null;for(var l=_e.util.createBuffer();l.length()<c;){t.generated>1048575&&(t.key=null),t.key===null&&o();var d=u(t.key,t.seed);t.generated+=d.length,l.putBytes(d),t.key=p(u(t.key,h(t.seed))),t.seed=m(u(t.key,t.seed))}return l.getBytes(c)};function a(c){if(t.pools[0].messageLength>=32)return s(),c();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(h,p){if(h)return c(h);t.collect(p),s(),c()})}function o(){if(t.pools[0].messageLength>=32)return s();var c=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(c)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var c=t.plugin.md.create();c.update(t.keyBytes);for(var u=1,h=0;h<32;++h)t.reseeds%u===0&&(c.update(t.pools[h].digest().getBytes()),t.pools[h].start()),u=u<<1;t.keyBytes=c.digest().getBytes(),c.start(),c.update(t.keyBytes);var p=c.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(p),t.generated=0}function f(c){var u=null,h=_e.util.globalScope,p=h.crypto||h.msCrypto;p&&p.getRandomValues&&(u=function(E){return p.getRandomValues(E)});var m=_e.util.createBuffer();if(u)for(;m.length()<c;){var l=Math.max(1,Math.min(c-m.length(),65536)/4),d=new Uint32Array(Math.floor(l));try{u(d);for(var g=0;g<d.length;++g)m.putInt32(d[g])}catch(E){if(!(typeof QuotaExceededError<"u"&&E instanceof QuotaExceededError))throw E}}if(m.length()<c)for(var b,S,w,C=Math.floor(Math.random()*65536);m.length()<c;){S=16807*(C&65535),b=16807*(C>>16),S+=(b&32767)<<16,S+=b>>15,S=(S&2147483647)+(S>>31),C=S&4294967295;for(var g=0;g<3;++g)w=C>>>(g<<3),w^=Math.floor(Math.random()*256),m.putByte(w&255)}return m.getBytes(c)}return Br?(t.seedFile=function(c,u){Br.randomBytes(c,function(h,p){if(h)return u(h);u(null,p.toString())})},t.seedFileSync=function(c){return Br.randomBytes(c).toString()}):(t.seedFile=function(c,u){try{u(null,f(c))}catch(h){u(h)}},t.seedFileSync=f),t.collect=function(c){for(var u=c.length,h=0;h<u;++h)t.pools[t.pool].update(c.substr(h,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(c,u){for(var h="",p=0;p<u;p+=8)h+=String.fromCharCode(c>>p&255);t.collect(h)},t.registerWorker=function(c){if(c===self)t.seedFile=function(h,p){function m(l){var d=l.data;d.forge&&d.forge.prng&&(self.removeEventListener("message",m),p(d.forge.prng.err,d.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var p=h.data;p.forge&&p.forge.prng&&t.seedFile(p.forge.prng.needed,function(m,l){c.postMessage({forge:{prng:{err:m,bytes:l}}})})};c.addEventListener("message",u)}},t}});var Ht=Z((qx,Qn)=>{var he=J();dr();ko();Ko();se();(function(){if(he.random&&he.random.getBytes){Qn.exports=he.random;return}(function(e){var t={},r=new Array(4),n=he.util.createBuffer();t.formatKey=function(h){var p=he.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),he.aes._expandKey(h,!1)},t.formatSeed=function(h){var p=he.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),h},t.cipher=function(h,p){return he.aes._updateBlock(h,p,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},t.increment=function(h){return++h[3],h},t.md=he.md.sha256;function i(){var h=he.prng.create(t);return h.getBytes=function(p,m){return h.generate(p,m)},h.getBytesSync=function(p){return h.generate(p)},h}var a=i(),o=null,s=he.util.globalScope,f=s.crypto||s.msCrypto;if(f&&f.getRandomValues&&(o=function(h){return f.getRandomValues(h)}),he.options.usePureJavaScript||!he.util.isNodejs&&!o){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var u in navigator)try{typeof navigator[u]=="string"&&(c+=navigator[u])}catch{}a.collect(c),c=null}e&&(e().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),e().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!he.random)he.random=a;else for(var u in a)he.random[u]=a[u];he.random.createInstance=i,Qn.exports=he.random})(typeof jQuery<"u"?jQuery:null)})()});var Vo=Z((zx,Oo)=>{var xe=J();se();var Gn=[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],Mo=[1,2,3,5],Yc=function(e,t){return e<<t&65535|(e&65535)>>16-t},Wc=function(e,t){return(e&65535)>>t|e<<16-t&65535};Oo.exports=xe.rc2=xe.rc2||{};xe.rc2.expandKey=function(e,t){typeof e=="string"&&(e=xe.util.createBuffer(e)),t=t||128;var r=e,n=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=n;s<128;s++)r.putByte(Gn[r.at(s-1)+r.at(s-n)&255]);for(r.setAt(128-a,Gn[r.at(128-a)&o]),s=127-a;s>=0;s--)r.setAt(s,Gn[r.at(s+1)^r.at(s+a)]);return r};var Fo=function(e,t,r){var n=!1,i=null,a=null,o=null,s,f,c,u,h=[];for(e=xe.rc2.expandKey(e,t),c=0;c<64;c++)h.push(e.getInt16Le());r?(s=function(l){for(c=0;c<4;c++)l[c]+=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),l[c]=Yc(l[c],Mo[c]),u++},f=function(l){for(c=0;c<4;c++)l[c]+=h[l[(c+3)%4]&63]}):(s=function(l){for(c=3;c>=0;c--)l[c]=Wc(l[c],Mo[c]),l[c]-=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),u--},f=function(l){for(c=3;c>=0;c--)l[c]-=h[l[(c+3)%4]&63]});var p=function(l){var d=[];for(c=0;c<4;c++){var g=i.getInt16Le();o!==null&&(r?g^=o.getInt16Le():o.putInt16Le(g)),d.push(g&65535)}u=r?0:63;for(var b=0;b<l.length;b++)for(var S=0;S<l[b][0];S++)l[b][1](d);for(c=0;c<4;c++)o!==null&&(r?o.putInt16Le(d[c]):d[c]^=o.getInt16Le()),a.putInt16Le(d[c])},m=null;return m={start:function(l,d){l&&typeof l=="string"&&(l=xe.util.createBuffer(l)),n=!1,i=xe.util.createBuffer(),a=d||new xe.util.createBuffer,o=l,m.output=a},update:function(l){for(n||i.putBuffer(l);i.length()>=8;)p([[5,s],[1,f],[6,s],[1,f],[5,s]])},finish:function(l){var d=!0;if(r)if(l)d=l(8,i,!r);else{var g=i.length()===8?8:8-i.length();i.fillWithByte(g,g)}if(d&&(n=!0,m.update()),!r&&(d=i.length()===0,d))if(l)d=l(8,a,!r);else{var b=a.length(),S=a.at(b-1);S>b?d=!1:a.truncate(S)}return d}},m};xe.rc2.startEncrypting=function(e,t,r){var n=xe.rc2.createEncryptionCipher(e,128);return n.start(t,r),n};xe.rc2.createEncryptionCipher=function(e,t){return Fo(e,t,!0)};xe.rc2.startDecrypting=function(e,t,r){var n=xe.rc2.createDecryptionCipher(e,128);return n.start(t,r),n};xe.rc2.createDecryptionCipher=function(e,t){return Fo(e,t,!1)}});var Tr=Z((Qx,Jo)=>{var Hn=J();Jo.exports=Hn.jsbn=Hn.jsbn||{};var Ve,Jc=0xdeadbeefcafe,qo=(Jc&16777215)==15715070;function I(e,t,r){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}Hn.jsbn.BigInteger=I;function H(){return new I(null)}function $c(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function Xc(e,t,r,n,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var f=this.data[e]&32767,c=this.data[e++]>>15,u=s*f+c*o;f=o*f+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(f>>>30)+(u>>>15)+s*c+(i>>>30),r.data[n++]=f&1073741823}return i}function zo(e,t,r,n,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var f=this.data[e]&16383,c=this.data[e++]>>14,u=s*f+c*o;f=o*f+((u&16383)<<14)+r.data[n]+i,i=(f>>28)+(u>>14)+s*c,r.data[n++]=f&268435455}return i}typeof navigator>"u"?(I.prototype.am=zo,Ve=28):qo&&navigator.appName=="Microsoft Internet Explorer"?(I.prototype.am=Xc,Ve=30):qo&&navigator.appName!="Netscape"?(I.prototype.am=$c,Ve=26):(I.prototype.am=zo,Ve=28);I.prototype.DB=Ve;I.prototype.DM=(1<<Ve)-1;I.prototype.DV=1<<Ve;var Yn=52;I.prototype.FV=Math.pow(2,Yn);I.prototype.F1=Yn-Ve;I.prototype.F2=2*Ve-Yn;var Zc="0123456789abcdefghijklmnopqrstuvwxyz",Cr=new Array,At,me;At=48;for(me=0;me<=9;++me)Cr[At++]=me;At=97;for(me=10;me<36;++me)Cr[At++]=me;At=65;for(me=10;me<36;++me)Cr[At++]=me;function Qo(e){return Zc.charAt(e)}function Go(e,t){var r=Cr[e.charCodeAt(t)];return r??-1}function jc(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function eu(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function We(e){var t=H();return t.fromInt(e),t}function tu(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var o=r==8?e[n]&255:Go(e,n);if(o<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&I.ZERO.subTo(this,this)}function ru(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function nu(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(n=this.data[o]>>s)>0&&(i=!0,a=Qo(n));o>=0;)s<t?(n=(this.data[o]&(1<<s)-1)<<t-s,n|=this.data[--o]>>(s+=this.DB-t)):(n=this.data[o]>>(s-=t)&r,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(a+=Qo(n));return i?a:"0"}function iu(){var e=H();return I.ZERO.subTo(this,e),e}function au(){return this.s<0?this.negate():this}function ou(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this.data[r]-e.data[r])!=0)return t;return 0}function Ir(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function su(){return this.t<=0?0:this.DB*(this.t-1)+Ir(this.data[this.t-1]^this.s&this.DM)}function fu(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s}function cu(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s}function uu(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>n|o,o=(this.data[s]&i)<<r;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function hu(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}function lu(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()}function pu(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&I.ZERO.subTo(t,t)}function du(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()}function yu(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=H());var a=H(),o=this.s,s=e.s,f=this.DB-Ir(n.data[n.t-1]);f>0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,u=a.data[c-1];if(u!=0){var h=u*(1<<this.F1)+(c>1?a.data[c-2]>>this.F2:0),p=this.FV/h,m=(1<<this.F1)/h,l=1<<this.F2,d=r.t,g=d-c,b=t??H();for(a.dlShiftTo(g,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),I.ONE.dlShiftTo(c,b),b.subTo(a,a);a.t<c;)a.data[a.t++]=0;for(;--g>=0;){var S=r.data[--d]==u?this.DM:Math.floor(r.data[d]*p+(r.data[d-1]+l)*m);if((r.data[d]+=a.am(0,S,r,g,0,c))<S)for(a.dlShiftTo(g,b),r.subTo(b,r);r.data[d]<--S;)r.subTo(b,r)}t!=null&&(r.drShiftTo(c,t),o!=s&&I.ZERO.subTo(t,t)),r.t=c,r.clamp(),f>0&&r.rShiftTo(f,r),o<0&&I.ZERO.subTo(r,r)}}}function xu(e){var t=H();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(I.ZERO)>0&&e.subTo(t,t),t}function nt(e){this.m=e}function gu(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function mu(e){return e}function vu(e){e.divRemTo(this.m,null,e)}function bu(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Au(e,t){e.squareTo(t),this.reduce(t)}nt.prototype.convert=gu;nt.prototype.revert=mu;nt.prototype.reduce=vu;nt.prototype.mulTo=bu;nt.prototype.sqrTo=Au;function wu(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function it(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Eu(e){var t=H();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(I.ZERO)>0&&this.m.subTo(t,t),t}function Su(e){var t=H();return e.copyTo(t),this.reduce(t),t}function Bu(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e.data[t]&32767,n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Cu(e,t){e.squareTo(t),this.reduce(t)}function Iu(e,t,r){e.multiplyTo(t,r),this.reduce(r)}it.prototype.convert=Eu;it.prototype.revert=Su;it.prototype.reduce=Bu;it.prototype.mulTo=Iu;it.prototype.sqrTo=Cu;function Tu(){return(this.t>0?this.data[0]&1:this.s)==0}function _u(e,t){if(e>4294967295||e<1)return I.ONE;var r=H(),n=H(),i=t.convert(this),a=Ir(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var o=r;r=n,n=o}return t.revert(r)}function Du(e,t){var r;return e<256||t.isEven()?r=new nt(t):r=new it(t),this.exp(e,r)}I.prototype.copyTo=jc;I.prototype.fromInt=eu;I.prototype.fromString=tu;I.prototype.clamp=ru;I.prototype.dlShiftTo=fu;I.prototype.drShiftTo=cu;I.prototype.lShiftTo=uu;I.prototype.rShiftTo=hu;I.prototype.subTo=lu;I.prototype.multiplyTo=pu;I.prototype.squareTo=du;I.prototype.divRemTo=yu;I.prototype.invDigit=wu;I.prototype.isEven=Tu;I.prototype.exp=_u;I.prototype.toString=nu;I.prototype.negate=iu;I.prototype.abs=au;I.prototype.compareTo=ou;I.prototype.bitLength=su;I.prototype.mod=xu;I.prototype.modPowInt=Du;I.ZERO=We(0);I.ONE=We(1);function Ru(){var e=H();return this.copyTo(e),e}function Nu(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Lu(){return this.t==0?this.s:this.data[0]<<24>>24}function Uu(){return this.t==0?this.s:this.data[0]<<16>>16}function ku(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Pu(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Ku(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=We(r),i=H(),a=H(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o}function Mu(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,s=0;s<e.length;++s){var f=Go(e,s);if(f<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+f,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&I.ZERO.subTo(this,this)}function Fu(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(I.ONE.shiftLeft(e-1),Wn,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(I.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function Ou(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this.data[e]&(1<<r)-1)<<8-r,n|=this.data[--e]>>(r+=this.DB-8)):(n=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function Vu(e){return this.compareTo(e)==0}function qu(e){return this.compareTo(e)<0?this:e}function zu(e){return this.compareTo(e)>0?this:e}function Qu(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function Gu(e,t){return e&t}function Hu(e){var t=H();return this.bitwiseTo(e,Gu,t),t}function Wn(e,t){return e|t}function Yu(e){var t=H();return this.bitwiseTo(e,Wn,t),t}function Ho(e,t){return e^t}function Wu(e){var t=H();return this.bitwiseTo(e,Ho,t),t}function Yo(e,t){return e&~t}function Ju(e){var t=H();return this.bitwiseTo(e,Yo,t),t}function $u(){for(var e=H(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Xu(e){var t=H();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Zu(e){var t=H();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function ju(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function eh(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+ju(this.data[e]);return this.s<0?this.t*this.DB:-1}function th(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function rh(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=th(this.data[r]^t);return e}function nh(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function ih(e,t){var r=I.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function ah(e){return this.changeBit(e,Wn)}function oh(e){return this.changeBit(e,Yo)}function sh(e){return this.changeBit(e,Ho)}function fh(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()}function ch(e){var t=H();return this.addTo(e,t),t}function uh(e){var t=H();return this.subTo(e,t),t}function hh(e){var t=H();return this.multiplyTo(e,t),t}function lh(e){var t=H();return this.divRemTo(e,t,null),t}function ph(e){var t=H();return this.divRemTo(e,null,t),t}function dh(e){var t=H(),r=H();return this.divRemTo(e,t,r),new Array(t,r)}function yh(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function xh(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Yt(){}function Wo(e){return e}function gh(e,t,r){e.multiplyTo(t,r)}function mh(e,t){e.squareTo(t)}Yt.prototype.convert=Wo;Yt.prototype.revert=Wo;Yt.prototype.mulTo=gh;Yt.prototype.sqrTo=mh;function vh(e){return this.exp(e,new Yt)}function bh(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()}function Ah(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function wt(e){this.r2=H(),this.q3=H(),I.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function wh(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=H();return e.copyTo(t),this.reduce(t),t}function Eh(e){return e}function Sh(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function Bh(e,t){e.squareTo(t),this.reduce(t)}function Ch(e,t,r){e.multiplyTo(t,r),this.reduce(r)}wt.prototype.convert=wh;wt.prototype.revert=Eh;wt.prototype.reduce=Sh;wt.prototype.mulTo=Ch;wt.prototype.sqrTo=Bh;function Ih(e,t){var r=e.bitLength(),n,i=We(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new nt(t):t.isEven()?a=new wt(t):a=new it(t);var o=new Array,s=3,f=n-1,c=(1<<n)-1;if(o[1]=a.convert(this),n>1){var u=H();for(a.sqrTo(o[1],u);s<=c;)o[s]=H(),a.mulTo(u,o[s-2],o[s]),s+=2}var h=e.t-1,p,m=!0,l=H(),d;for(r=Ir(e.data[h])-1;h>=0;){for(r>=f?p=e.data[h]>>r-f&c:(p=(e.data[h]&(1<<r+1)-1)<<f-r,h>0&&(p|=e.data[h-1]>>this.DB+r-f)),s=n;!(p&1);)p>>=1,--s;if((r-=s)<0&&(r+=this.DB,--h),m)o[p].copyTo(i),m=!1;else{for(;s>1;)a.sqrTo(i,l),a.sqrTo(l,i),s-=2;s>0?a.sqrTo(i,l):(d=i,i=l,l=d),a.mulTo(l,o[p],i)}for(;h>=0&&!(e.data[h]&1<<r);)a.sqrTo(i,l),d=i,i=l,l=d,--r<0&&(r=this.DB-1,--h)}return a.revert(i)}function Th(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function _h(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r}function Dh(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return I.ZERO;for(var r=e.clone(),n=this.clone(),i=We(1),a=We(0),o=We(0),s=We(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),t&&o.subTo(i,o),s.subTo(a,s))}if(n.compareTo(I.ONE)!=0)return I.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var Ee=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Rh=(1<<26)/Ee[Ee.length-1];function Nh(e){var t,r=this.abs();if(r.t==1&&r.data[0]<=Ee[Ee.length-1]){for(t=0;t<Ee.length;++t)if(r.data[0]==Ee[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Ee.length;){for(var n=Ee[t],i=t+1;i<Ee.length&&n<Rh;)n*=Ee[i++];for(n=r.modInt(n);t<i;)if(n%Ee[t++]==0)return!1}return r.millerRabin(e)}function Lh(e){var t=this.subtract(I.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n=t.shiftRight(r),i=Uh(),a,o=0;o<e;++o){do a=new I(this.bitLength(),i);while(a.compareTo(I.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(n,this);if(s.compareTo(I.ONE)!=0&&s.compareTo(t)!=0){for(var f=1;f++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(I.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function Uh(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}I.prototype.chunkSize=ku;I.prototype.toRadix=Ku;I.prototype.fromRadix=Mu;I.prototype.fromNumber=Fu;I.prototype.bitwiseTo=Qu;I.prototype.changeBit=ih;I.prototype.addTo=fh;I.prototype.dMultiply=yh;I.prototype.dAddOffset=xh;I.prototype.multiplyLowerTo=bh;I.prototype.multiplyUpperTo=Ah;I.prototype.modInt=_h;I.prototype.millerRabin=Lh;I.prototype.clone=Ru;I.prototype.intValue=Nu;I.prototype.byteValue=Lu;I.prototype.shortValue=Uu;I.prototype.signum=Pu;I.prototype.toByteArray=Ou;I.prototype.equals=Vu;I.prototype.min=qu;I.prototype.max=zu;I.prototype.and=Hu;I.prototype.or=Yu;I.prototype.xor=Wu;I.prototype.andNot=Ju;I.prototype.not=$u;I.prototype.shiftLeft=Xu;I.prototype.shiftRight=Zu;I.prototype.getLowestSetBit=eh;I.prototype.bitCount=rh;I.prototype.testBit=nh;I.prototype.setBit=ah;I.prototype.clearBit=oh;I.prototype.flipBit=sh;I.prototype.add=ch;I.prototype.subtract=uh;I.prototype.multiply=hh;I.prototype.divide=lh;I.prototype.remainder=ph;I.prototype.divideAndRemainder=dh;I.prototype.modPow=Ih;I.prototype.modInverse=Dh;I.prototype.pow=vh;I.prototype.gcd=Th;I.prototype.isProbablePrime=Nh});var es=Z((Gx,jo)=>{var De=J();rt();se();var Xo=jo.exports=De.sha1=De.sha1||{};De.md.sha1=De.md.algorithms.sha1=Xo;Xo.create=function(){Zo||kh();var e=null,t=De.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return t=De.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=De.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),$o(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=De.util.createBuffer();i.putBytes(t.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Jn.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)s=n.fullMessageLength[u+1]*8,f=s/4294967296>>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};$o(h,r,i);var p=De.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},n};var Jn=null,Zo=!1;function kh(){Jn="\x80",Jn+=De.util.fillString("\0",64),Zo=!0}function $o(e,t,r){for(var n,i,a,o,s,f,c,u,h=r.length();h>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,f=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a&o|s&(a^o),n=(i<<5|i>>>27)+c+f+2400959708+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+3395469782+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+f|0,h-=64}}});var ns=Z((Hx,rs)=>{var Re=J();se();Ht();es();var ts=rs.exports=Re.pkcs1=Re.pkcs1||{};ts.encode_rsa_oaep=function(e,t,r){var n,i,a,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),a?a.start():a=Re.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),f=s-2*a.digestLength-2;if(t.length>f){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=t.length,c.maxLength=f,c}n||(n=""),a.update(n,"raw");for(var u=a.digest(),h="",p=f-t.length,m=0;m<p;m++)h+="\0";var l=u.getBytes()+h+""+t;if(!i)i=Re.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var c=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw c.seedLength=i.length,c.digestLength=a.digestLength,c}var d=_r(i,s-a.digestLength-1,o),g=Re.util.xorBytes(l,d,l.length),b=_r(g,a.digestLength,o),S=Re.util.xorBytes(i,b,i.length);return"\0"+S+g};ts.decode_rsa_oaep=function(e,t,r){var n,i,a;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var g=new Error("RSAES-OAEP encoded message length is invalid.");throw g.length=t.length,g.expectedLength=o,g}if(i===void 0?i=Re.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var s=i.digest().getBytes(),f=t.charAt(0),c=t.substring(1,i.digestLength+1),u=t.substring(1+i.digestLength),h=_r(u,i.digestLength,a),p=Re.util.xorBytes(c,h,c.length),m=_r(p,o-i.digestLength-1,a),l=Re.util.xorBytes(u,m,u.length),d=l.substring(0,i.digestLength),g=f!=="\0",b=0;b<i.digestLength;++b)g|=s.charAt(b)!==d.charAt(b);for(var S=1,w=i.digestLength,C=i.digestLength;C<l.length;C++){var E=l.charCodeAt(C),B=E&1^1,_=S?65534:0;g|=E&_,S=S&B,w+=S}if(g||l.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return l.substring(w+1)};function _r(e,t,r){r||(r=Re.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}});var is=Z((Yx,$n)=>{var Je=J();se();Tr();Ht();(function(){if(Je.prime){$n.exports=Je.prime;return}var e=$n.exports=Je.prime=Je.prime||{},t=Je.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new t(null);n.fromInt(30);var i=function(h,p){return h|p};e.generateProbablePrime=function(h,p,m){typeof p=="function"&&(m=p,p={}),p=p||{};var l=p.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var d=p.prng||Je.random,g={nextBytes:function(b){for(var S=d.getBytesSync(b.length),w=0;w<b.length;++w)b[w]=S.charCodeAt(w)}};if(l.name==="PRIMEINC")return a(h,g,l.options,m);throw new Error("Invalid prime generation algorithm: "+l.name)};function a(h,p,m,l){return"workers"in m?f(h,p,m,l):o(h,p,m,l)}function o(h,p,m,l){var d=c(h,p),g=0,b=u(d.bitLength());"millerRabinTests"in m&&(b=m.millerRabinTests);var S=10;"maxBlockTime"in m&&(S=m.maxBlockTime),s(d,h,p,g,b,S,l)}function s(h,p,m,l,d,g,b){var S=+new Date;do{if(h.bitLength()>p&&(h=c(p,m)),h.isProbablePrime(d))return b(null,h);h.dAddOffset(r[l++%8],0)}while(g<0||+new Date-S<g);Je.util.setImmediate(function(){s(h,p,m,l,d,g,b)})}function f(h,p,m,l){if(typeof Worker>"u")return o(h,p,m,l);var d=c(h,p),g=m.workers,b=m.workLoad||100,S=b*30/8,w=m.workerScript||"forge/prime.worker.js";if(g===-1)return Je.util.estimateCores(function(E,B){E&&(B=2),g=B-1,C()});C();function C(){g=Math.max(1,g);for(var E=[],B=0;B<g;++B)E[B]=new Worker(w);for(var _=g,B=0;B<g;++B)E[B].addEventListener("message",U);var D=!1;function U(z){if(!D){--_;var O=z.data;if(O.found){for(var F=0;F<E.length;++F)E[F].terminate();return D=!0,l(null,new t(O.prime,16))}d.bitLength()>h&&(d=c(h,p));var Y=d.toString(16);z.target.postMessage({hex:Y,workLoad:b}),d.dAddOffset(S,0)}}}}function c(h,p){var m=new t(h,p),l=h-1;return m.testBit(l)||m.bitwiseTo(t.ONE.shiftLeft(l),i,m),m.dAddOffset(31-m.mod(n).byteValue(),0),m}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var Rr=Z((Wx,hs)=>{var k=J();Gt();Tr();mr();ns();is();Ht();se();typeof G>"u"&&(G=k.jsbn.BigInteger);var G,Xn=k.util.isNodejs?wr():null,v=k.asn1,ve=k.util;k.pki=k.pki||{};hs.exports=k.pki.rsa=k.rsa=k.rsa||{};var P=k.pki,Ph=[6,4,2,4,2,4,6,2],Kh={name:"PrivateKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Mh={name:"RSAPrivateKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Fh={name:"RSAPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Oh=k.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Vh={name:"DigestInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:v.Class.UNIVERSAL,type:v.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},qh=function(e){var t;if(e.algorithm in P.oids)t=P.oids[e.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var n=v.oidToDer(t).getBytes(),i=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[]),a=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[]);a.value.push(v.create(v.Class.UNIVERSAL,v.Type.OID,!1,n)),a.value.push(v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,""));var o=v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),v.toDer(i).getBytes()},cs=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(G.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(G.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var n;do n=new G(k.util.bytesToHex(k.random.getBytes(t.n.bitLength()/8)),16);while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(G.ONE));e=e.multiply(n.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(n.modInverse(t.n)).mod(t.n),o};P.rsa.encrypt=function(e,t,r){var n=r,i,a=Math.ceil(t.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=us(e,t,r)):(i=k.util.createBuffer(),i.putBytes(e));for(var o=new G(i.toHex(),16),s=cs(o,t,n),f=s.toString(16),c=k.util.createBuffer(),u=a-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(k.util.hexToBytes(f)),c.getBytes()};P.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new G(k.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=cs(o,t,r),f=s.toString(16),c=k.util.createBuffer(),u=i-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(k.util.hexToBytes(f)),n!==!1?Dr(c.getBytes(),t,r):c.getBytes()};P.rsa.createKeyPairGenerationState=function(e,t,r){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,r=r||{};var n=r.prng||k.random,i={nextBytes:function(s){for(var f=n.getBytesSync(s.length),c=0;c<s.length;++c)s[c]=f.charCodeAt(c)}},a=r.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new G(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};P.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new G(null);r.fromInt(30);for(var n=0,i=function(h,p){return h|p},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var f=e.p===null?e.pBits:e.qBits,c=f-1;e.pqState===0?(e.num=new G(f,e.rng),e.num.testBit(c)||e.num.bitwiseTo(G.ONE.shiftLeft(c),i,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),n=0,++e.pqState):e.pqState===1?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(Qh(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Ph[n++%8],0):e.pqState===2?e.pqState=e.num.subtract(G.ONE).gcd(e.e).compareTo(G.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(G.ONE),e.q1=e.q.subtract(G.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(G.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:P.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:P.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};P.rsa.generateKeyPair=function(e,t,r,n){if(arguments.length===1?typeof e=="object"?(r=e,e=void 0):typeof e=="function"&&(n=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(n=t,t=void 0):typeof t!="number"&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},e===void 0&&(e=r.bits||2048),t===void 0&&(t=r.e||65537),!k.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(n){if(as("generateKeyPair"))return Xn.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,f,c){if(s)return n(s);n(null,{privateKey:P.privateKeyFromPem(c),publicKey:P.publicKeyFromPem(f)})});if(os("generateKey")&&os("exportKey"))return ve.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:fs(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return ve.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){n(s)}).then(function(s){if(s){var f=P.privateKeyFromAsn1(v.fromDer(k.util.createBuffer(s)));n(null,{privateKey:f,publicKey:P.setRsaPublicKey(f.n,f.e)})}});if(ss("generateKey")&&ss("exportKey")){var i=ve.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:fs(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var f=s.target.result,c=ve.globalScope.msCrypto.subtle.exportKey("pkcs8",f.privateKey);c.oncomplete=function(u){var h=u.target.result,p=P.privateKeyFromAsn1(v.fromDer(k.util.createBuffer(h)));n(null,{privateKey:p,publicKey:P.setRsaPublicKey(p.n,p.e)})},c.onerror=function(u){n(u)}},i.onerror=function(s){n(s)};return}}else if(as("generateKeyPairSync")){var a=Xn.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:P.privateKeyFromPem(a.privateKey),publicKey:P.publicKeyFromPem(a.publicKey)}}}var o=P.rsa.createKeyPairGenerationState(e,t,r);if(!n)return P.rsa.stepKeyPairGenerationState(o,0),o.keys;zh(o,r,n)};P.setRsaPublicKey=P.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,f,c){return us(s,f,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,f){return k.pkcs1.encode_rsa_oaep(f,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return P.rsa.encrypt(o,r,!0)},r.verify=function(n,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(f,c){c=Dr(c,r,!0);var u=v.fromDer(c,{parseAllBytes:o._parseAllDigestBytes}),h={},p=[];if(!v.validate(u,Vh,h,p)){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=p,m}var l=v.derToOid(h.algorithmIdentifier);if(!(l===k.oids.md2||l===k.oids.md5||l===k.oids.sha1||l===k.oids.sha224||l===k.oids.sha256||l===k.oids.sha384||l===k.oids.sha512||l===k.oids["sha512-224"]||l===k.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=l,m}if((l===k.oids.md2||l===k.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return f===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(f,c){return c=Dr(c,r,!0),f===c}});var s=P.rsa.decrypt(i,r,!0,!1);return a.verify(n,s,r.n.bitLength())},r};P.setRsaPrivateKey=P.rsa.setPrivateKey=function(e,t,r,n,i,a,o,s){var f={n:e,e:t,d:r,p:n,q:i,dP:a,dQ:o,qInv:s};return f.decrypt=function(c,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var p=P.rsa.decrypt(c,f,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:Dr};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(m,l){return k.pkcs1.decode_rsa_oaep(l,m,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(p,f,!1)},f.sign=function(c,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:qh},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return c}},h=1);var p=u.encode(c,f.n.bitLength());return P.rsa.encrypt(p,f,h)},f};P.wrapRsaPrivateKey=function(e){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,v.integerToDer(0).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(P.oids.rsaEncryption).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")]),v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(e).getBytes())])};P.privateKeyFromAsn1=function(e){var t={},r=[];if(v.validate(e,Kh,t,r)&&(e=v.fromDer(k.util.createBuffer(t.privateKey))),t={},r=[],!v.validate(e,Mh,t,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,o,s,f,c,u,h;return i=k.util.createBuffer(t.privateKeyModulus).toHex(),a=k.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=k.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=k.util.createBuffer(t.privateKeyPrime1).toHex(),f=k.util.createBuffer(t.privateKeyPrime2).toHex(),c=k.util.createBuffer(t.privateKeyExponent1).toHex(),u=k.util.createBuffer(t.privateKeyExponent2).toHex(),h=k.util.createBuffer(t.privateKeyCoefficient).toHex(),P.setRsaPrivateKey(new G(i,16),new G(a,16),new G(o,16),new G(s,16),new G(f,16),new G(c,16),new G(u,16),new G(h,16))};P.privateKeyToAsn1=P.privateKeyToRSAPrivateKey=function(e){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,v.integerToDer(0).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.n)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.e)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.d)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.p)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.q)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.dP)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.dQ)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.qInv))])};P.publicKeyFromAsn1=function(e){var t={},r=[];if(v.validate(e,Oh,t,r)){var n=v.derToOid(t.publicKeyOid);if(n!==P.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}e=t.rsaPublicKey}if(r=[],!v.validate(e,Fh,t,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=k.util.createBuffer(t.publicKeyModulus).toHex(),o=k.util.createBuffer(t.publicKeyExponent).toHex();return P.setRsaPublicKey(new G(a,16),new G(o,16))};P.publicKeyToAsn1=P.publicKeyToSubjectPublicKeyInfo=function(e){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(P.oids.rsaEncryption).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")]),v.create(v.Class.UNIVERSAL,v.Type.BITSTRING,!1,[P.publicKeyToRSAPublicKey(e)])])};P.publicKeyToRSAPublicKey=function(e){return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.n)),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,Ne(e.e))])};function us(e,t,r){var n=k.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o=i-3-e.length,s;if(r===0||r===1){s=r===0?0:255;for(var f=0;f<o;++f)n.putByte(s)}else for(;o>0;){for(var c=0,u=k.random.getBytes(o),f=0;f<o;++f)s=u.charCodeAt(f),s===0?++c:n.putByte(s);o=c}return n.putByte(0),n.putBytes(e),n}function Dr(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=k.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||r&&s!==0&&s!==1||!r&&s!=2||r&&s===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var f=0;if(s===0){f=i-3-n;for(var c=0;c<f;++c)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(f=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++f}else if(s===2)for(f=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++f}var u=a.getByte();if(u!==0||f!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function zh(e,t,r){typeof t=="function"&&(r=t,t={}),t=t||{};var n={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(n.prng=t.prng),i();function i(){a(e.pBits,function(s,f){if(s)return r(s);if(e.p=f,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,f){k.prime.generateProbablePrime(s,n,f)}function o(s,f){if(s)return r(s);if(e.q=f,e.p.compareTo(e.q)<0){var c=e.p;e.p=e.q,e.q=c}if(e.p.subtract(G.ONE).gcd(e.e).compareTo(G.ONE)!==0){e.p=null,i();return}if(e.q.subtract(G.ONE).gcd(e.e).compareTo(G.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(G.ONE),e.q1=e.q.subtract(G.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(G.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:P.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:P.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}}function Ne(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=k.util.hexToBytes(t);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Qh(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function as(e){return k.util.isNodejs&&typeof Xn[e]=="function"}function os(e){return typeof ve.globalScope<"u"&&typeof ve.globalScope.crypto=="object"&&typeof ve.globalScope.crypto.subtle=="object"&&typeof ve.globalScope.crypto.subtle[e]=="function"}function ss(e){return typeof ve.globalScope<"u"&&typeof ve.globalScope.msCrypto=="object"&&typeof ve.globalScope.msCrypto.subtle=="object"&&typeof ve.globalScope.msCrypto.subtle[e]=="function"}function fs(e){for(var t=k.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}});var gs=Z((Jx,xs)=>{var L=J();dr();Gt();wo();rt();mr();qn();_o();Ht();Vo();Rr();se();typeof ls>"u"&&(ls=L.jsbn.BigInteger);var ls,A=L.asn1,K=L.pki=L.pki||{};xs.exports=K.pbe=L.pbe=L.pbe||{};var at=K.oids,Gh={name:"EncryptedPrivateKeyInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Hh={name:"PBES2Algorithms",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Yh={name:"pkcs-12PbeParams",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"iterations"}]};K.encryptPrivateKeyInfo=function(e,t,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=L.random.getBytesSync(r.saltSize),i=r.count,a=A.integerToDer(i),o,s,f;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var c,u,h;switch(r.algorithm){case"aes128":o=16,c=16,u=at["aes128-CBC"],h=L.aes.createEncryptionCipher;break;case"aes192":o=24,c=16,u=at["aes192-CBC"],h=L.aes.createEncryptionCipher;break;case"aes256":o=32,c=16,u=at["aes256-CBC"],h=L.aes.createEncryptionCipher;break;case"des":o=8,c=8,u=at.desCBC,h=L.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),l=ys(m),d=L.pkcs5.pbkdf2(t,n,i,o,l),g=L.random.getBytesSync(c),b=h(d);b.start(g),b.update(A.toDer(e)),b.finish(),f=b.output.getBytes();var S=Wh(n,a,o,m);s=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(at.pkcs5PBES2).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(at.pkcs5PBKDF2).getBytes()),S]),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(u).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,g)])])])}else if(r.algorithm==="3des"){o=24;var w=new L.util.ByteBuffer(n),d=K.pbe.generatePkcs12Key(t,w,1,i,o),g=K.pbe.generatePkcs12Key(t,w,2,i,o),b=L.des.createEncryptionCipher(d);b.start(g),b.update(A.toDer(e)),b.finish(),f=b.output.getBytes(),s=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(at["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,n),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,a.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var C=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[s,A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,f)]);return C};K.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!A.validate(e,Gh,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=A.derToOid(n.encryptionOid),s=K.pbe.getCipher(o,n.encryptionParams,t),f=L.util.createBuffer(n.encryptedData);return s.update(f),s.finish()&&(r=A.fromDer(s.output)),r};K.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:A.toDer(e).getBytes()};return L.pem.encode(r,{maxline:t})};K.encryptedPrivateKeyFromPem=function(e){var t=L.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return A.fromDer(t.body)};K.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var n=K.wrapRsaPrivateKey(K.privateKeyToAsn1(e));return n=K.encryptPrivateKeyInfo(n,t,r),K.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=L.random.getBytesSync(16),s=L.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=L.random.getBytesSync(16),s=L.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=L.random.getBytesSync(16),s=L.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=L.random.getBytesSync(8),s=L.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=L.random.getBytesSync(8),s=L.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var c=L.pbe.opensslDeriveBytes(t,a.substr(0,8),o),u=s(c);u.start(a),u.update(A.toDer(K.privateKeyToAsn1(e))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:L.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return L.pem.encode(h)};K.decryptRsaPrivateKey=function(e,t){var r=null,n=L.pem.decode(e)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,o;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,o=L.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=L.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=L.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=L.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=L.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(h){return L.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,o=function(h){return L.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,o=function(h){return L.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var s=L.util.hexToBytes(n.dekInfo.parameters),f=L.pbe.opensslDeriveBytes(t,s.substr(0,8),a),c=o(f);if(c.start(s),c.update(L.util.createBuffer(n.body)),c.finish())r=c.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=K.decryptPrivateKeyInfo(A.fromDer(r),t):r=A.fromDer(r),r!==null&&(r=K.privateKeyFromAsn1(r)),r};K.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in L.md))throw new Error('"sha1" hash algorithm unavailable.');a=L.md.sha1.create()}var f=a.digestLength,c=a.blockLength,u=new L.util.ByteBuffer,h=new L.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)h.putInt16(e.charCodeAt(s));h.putInt16(0)}var p=h.length(),m=t.length(),l=new L.util.ByteBuffer;l.fillWithByte(r,c);var d=c*Math.ceil(m/c),g=new L.util.ByteBuffer;for(s=0;s<d;s++)g.putByte(t.at(s%m));var b=c*Math.ceil(p/c),S=new L.util.ByteBuffer;for(s=0;s<b;s++)S.putByte(h.at(s%p));var w=g;w.putBuffer(S);for(var C=Math.ceil(i/f),E=1;E<=C;E++){var B=new L.util.ByteBuffer;B.putBytes(l.bytes()),B.putBytes(w.bytes());for(var _=0;_<n;_++)a.start(),a.update(B.getBytes()),B=a.digest();var D=new L.util.ByteBuffer;for(s=0;s<c;s++)D.putByte(B.at(s%f));var U=Math.ceil(m/c)+Math.ceil(p/c),z=new L.util.ByteBuffer;for(o=0;o<U;o++){var O=new L.util.ByteBuffer(w.getBytes(c)),F=511;for(s=D.length()-1;s>=0;s--)F=F>>8,F+=D.at(s)+O.at(s),O.setAt(s,F&255);z.putBuffer(O)}w=z,u.putBuffer(B)}return u.truncate(u.length()-i),u};K.pbe.getCipher=function(e,t,r){switch(e){case K.oids.pkcs5PBES2:return K.pbe.getCipherForPBES2(e,t,r);case K.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case K.oids["pbewithSHAAnd40BitRC2-CBC"]:return K.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};K.pbe.getCipherForPBES2=function(e,t,r){var n={},i=[];if(!A.validate(t,Hh,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=A.derToOid(n.kdfOid),e!==K.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=A.derToOid(n.encOid),e!==K.oids["aes128-CBC"]&&e!==K.oids["aes192-CBC"]&&e!==K.oids["aes256-CBC"]&&e!==K.oids["des-EDE3-CBC"]&&e!==K.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=n.kdfSalt,s=L.util.createBuffer(n.kdfIterationCount);s=s.getInt(s.length()<<3);var f,c;switch(K.oids[e]){case"aes128-CBC":f=16,c=L.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,c=L.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,c=L.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,c=L.des.createDecryptionCipher;break;case"desCBC":f=8,c=L.des.createDecryptionCipher;break}var u=ds(n.prfOid),h=L.pkcs5.pbkdf2(r,o,s,f,u),p=n.encIv,m=c(h);return m.start(p),m};K.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!A.validate(t,Yh,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=L.util.createBuffer(n.salt),s=L.util.createBuffer(n.iterations);s=s.getInt(s.length()<<3);var f,c,u;switch(e){case K.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,c=8,u=L.des.startDecrypting;break;case K.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,c=8,u=function(d,g){var b=L.rc2.createDecryptionCipher(d,40);return b.start(g,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var h=ds(n.prfOid),p=K.pbe.generatePkcs12Key(r,o,1,s,f,h);h.start();var m=K.pbe.generatePkcs12Key(r,o,2,s,c,h);return u(p,m)};K.pbe.opensslDeriveBytes=function(e,t,r,n){if(typeof n>"u"||n===null){if(!("md5"in L.md))throw new Error('"md5" hash algorithm unavailable.');n=L.md.md5.create()}t===null&&(t="");for(var i=[ps(n,e+t)],a=16,o=1;a<r;++o,a+=16)i.push(ps(n,i[o-1]+e+t));return i.join("").substr(0,r)};function ps(e,t){return e.start().update(t).digest().getBytes()}function ds(e){var t;if(!e)t="hmacWithSHA1";else if(t=K.oids[A.derToOid(e)],!t){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return ys(t)}function ys(e){var t=L.md;switch(e){case"hmacWithSHA224":t=L.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function Wh(e,t,r,n){var i=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,e),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,t.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,L.util.hexToBytes(r.toString(16))),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(K.oids[n]).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.NULL,!1,"")])),i}});var h0=Z((Fm,u0)=>{var te=J();rt();se();var rr=u0.exports=te.sha512=te.sha512||{};te.md.sha512=te.md.algorithms.sha512=rr;var f0=te.sha384=te.sha512.sha384=te.sha512.sha384||{};f0.create=function(){return rr.create("SHA-384")};te.md.sha384=te.md.algorithms.sha384=f0;te.sha512.sha256=te.sha512.sha256||{create:function(){return rr.create("SHA-512/256")}};te.md["sha512/256"]=te.md.algorithms["sha512/256"]=te.sha512.sha256;te.sha512.sha224=te.sha512.sha224||{create:function(){return rr.create("SHA-512/224")}};te.md["sha512/224"]=te.md.algorithms["sha512/224"]=te.sha512.sha224;rr.create=function(e){if(c0||zp(),typeof e>"u"&&(e="SHA-512"),!(e in ut))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=ut[e],r=null,n=te.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var f=s.messageLengthSize/4,c=0;c<f;++c)s.fullMessageLength.push(0);n=te.util.createBuffer(),r=new Array(t.length);for(var c=0;c<t.length;++c)r[c]=t[c].slice(0);return s},s.start(),s.update=function(f,c){c==="utf8"&&(f=te.util.encodeUtf8(f));var u=f.length;s.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var h=s.fullMessageLength.length-1;h>=0;--h)s.fullMessageLength[h]+=u[1],u[1]=u[0]+(s.fullMessageLength[h]/4294967296>>>0),s.fullMessageLength[h]=s.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(f),s0(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),s},s.digest=function(){var f=te.util.createBuffer();f.putBytes(n.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;f.putBytes(Wi.substr(0,s.blockLength-u));for(var h,p,m=s.fullMessageLength[0]*8,l=0;l<s.fullMessageLength.length-1;++l)h=s.fullMessageLength[l+1]*8,p=h/4294967296>>>0,m+=p,f.putInt32(m>>>0),m=h>>>0;f.putInt32(m);for(var d=new Array(r.length),l=0;l<r.length;++l)d[l]=r[l].slice(0);s0(d,i,f);var g=te.util.createBuffer(),b;e==="SHA-512"?b=d.length:e==="SHA-384"?b=d.length-2:b=d.length-4;for(var l=0;l<b;++l)g.putInt32(d[l][0]),(l!==b-1||e!=="SHA-512/224")&&g.putInt32(d[l][1]);return g},s};var Wi=null,c0=!1,Ji=null,ut=null;function zp(){Wi="\x80",Wi+=te.util.fillString("\0",128),Ji=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],ut={},ut["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],ut["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],ut["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],ut["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],c0=!0}function s0(e,t,r){for(var n,i,a,o,s,f,c,u,h,p,m,l,d,g,b,S,w,C,E,B,_,D,U,z,O,F,Y,$,M,Q,N,ne,X,y,Ke,Da=r.length();Da>=128;){for(M=0;M<16;++M)t[M][0]=r.getInt32()>>>0,t[M][1]=r.getInt32()>>>0;for(;M<80;++M)ne=t[M-2],Q=ne[0],N=ne[1],n=((Q>>>19|N<<13)^(N>>>29|Q<<3)^Q>>>6)>>>0,i=((Q<<13|N>>>19)^(N<<3|Q>>>29)^(Q<<26|N>>>6))>>>0,y=t[M-15],Q=y[0],N=y[1],a=((Q>>>1|N<<31)^(Q>>>8|N<<24)^Q>>>7)>>>0,o=((Q<<31|N>>>1)^(Q<<24|N>>>8)^(Q<<25|N>>>7))>>>0,X=t[M-7],Ke=t[M-16],N=i+X[1]+o+Ke[1],t[M][0]=n+X[0]+a+Ke[0]+(N/4294967296>>>0)>>>0,t[M][1]=N>>>0;for(d=e[0][0],g=e[0][1],b=e[1][0],S=e[1][1],w=e[2][0],C=e[2][1],E=e[3][0],B=e[3][1],_=e[4][0],D=e[4][1],U=e[5][0],z=e[5][1],O=e[6][0],F=e[6][1],Y=e[7][0],$=e[7][1],M=0;M<80;++M)c=((_>>>14|D<<18)^(_>>>18|D<<14)^(D>>>9|_<<23))>>>0,u=((_<<18|D>>>14)^(_<<14|D>>>18)^(D<<23|_>>>9))>>>0,h=(O^_&(U^O))>>>0,p=(F^D&(z^F))>>>0,s=((d>>>28|g<<4)^(g>>>2|d<<30)^(g>>>7|d<<25))>>>0,f=((d<<4|g>>>28)^(g<<30|d>>>2)^(g<<25|d>>>7))>>>0,m=(d&b|w&(d^b))>>>0,l=(g&S|C&(g^S))>>>0,N=$+u+p+Ji[M][1]+t[M][1],n=Y+c+h+Ji[M][0]+t[M][0]+(N/4294967296>>>0)>>>0,i=N>>>0,N=f+l,a=s+m+(N/4294967296>>>0)>>>0,o=N>>>0,Y=O,$=F,O=U,F=z,U=_,z=D,N=B+i,_=E+n+(N/4294967296>>>0)>>>0,D=N>>>0,E=w,B=C,w=b,C=S,b=d,S=g,N=i+o,d=n+a+(N/4294967296>>>0)>>>0,g=N>>>0;N=e[0][1]+g,e[0][0]=e[0][0]+d+(N/4294967296>>>0)>>>0,e[0][1]=N>>>0,N=e[1][1]+S,e[1][0]=e[1][0]+b+(N/4294967296>>>0)>>>0,e[1][1]=N>>>0,N=e[2][1]+C,e[2][0]=e[2][0]+w+(N/4294967296>>>0)>>>0,e[2][1]=N>>>0,N=e[3][1]+B,e[3][0]=e[3][0]+E+(N/4294967296>>>0)>>>0,e[3][1]=N>>>0,N=e[4][1]+D,e[4][0]=e[4][0]+_+(N/4294967296>>>0)>>>0,e[4][1]=N>>>0,N=e[5][1]+z,e[5][0]=e[5][0]+U+(N/4294967296>>>0)>>>0,e[5][1]=N>>>0,N=e[6][1]+F,e[6][0]=e[6][0]+O+(N/4294967296>>>0)>>>0,e[6][1]=N>>>0,N=e[7][1]+$,e[7][0]=e[7][0]+Y+(N/4294967296>>>0)>>>0,e[7][1]=N>>>0,Da-=128}}});var J0=Z((BA,W0)=>{var my=(e,t)=>function(){return t||(0,e[Object.keys(e)[0]])((t={exports:{}}).exports,t),t.exports},vy=(()=>{for(var e=new Uint8Array(128),t=0;t<64;t++)e[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return r=>{for(var n=r.length,i=new Uint8Array((n-(r[n-1]=="=")-(r[n-2]=="="))*3/4|0),a=0,o=0;a<n;){var s=e[r.charCodeAt(a++)],f=e[r.charCodeAt(a++)],c=e[r.charCodeAt(a++)],u=e[r.charCodeAt(a++)];i[o++]=s<<2|f>>4,i[o++]=f<<4|c>>2,i[o++]=c<<6|u}return i}})(),by=my({"wasm-binary:./xsalsa20.wat"(e,t){t.exports=vy("AGFzbQEAAAABGgNgBn9/f39/fwBgBn9/f39+fwF+YAN/f38AAwcGAAEBAgICBQUBAQroBwcoAwZtZW1vcnkCAAx4c2Fsc2EyMF94b3IAAAxjb3JlX3NhbHNhMjAABArqEQYYACAAIAEgAiADIAQgACkDACAFEAE3AwALPQBB8AAgAyAFEAMgACABIAIgA0EQaiAEQfAAEAJB8ABCADcDAEH4AEIANwMAQYABQgA3AwBBiAFCADcDAAuHBQEBfyACQQBGBEBCAA8LQdAAIAUpAwA3AwBB2AAgBUEIaikDADcDAEHgACAFQRBqKQMANwMAQegAIAVBGGopAwA3AwBBACADKQMANwMAQQggBDcDAAJAA0AgAkHAAEkNAUEQQQBB0AAQBSAAIAEpAwBBECkDAIU3AwAgAEEIaiABQQhqKQMAQRgpAwCFNwMAIABBEGogAUEQaikDAEEgKQMAhTcDACAAQRhqIAFBGGopAwBBKCkDAIU3AwAgAEEgaiABQSBqKQMAQTApAwCFNwMAIABBKGogAUEoaikDAEE4KQMAhTcDACAAQTBqIAFBMGopAwBBwAApAwCFNwMAIABBOGogAUE4aikDAEHIACkDAIU3AwBBCEEIKQMAQgF8NwMAIABBwABqIQAgAUHAAGohASACQcAAayECDAALC0EIKQMAIQQgAkEASwRAQRBBAEHQABAFAkACQAJAAkACQAJAAkACQCACQQhuDgcHBgUEAwIBAAsgAEE4aiABQThqKQMAQcgAKQMAhTcDAAsgAEEwaiABQTBqKQMAQcAAKQMAhTcDAAsgAEEoaiABQShqKQMAQTgpAwCFNwMACyAAQSBqIAFBIGopAwBBMCkDAIU3AwALIABBGGogAUEYaikDAEEoKQMAhTcDAAsgAEEQaiABQRBqKQMAQSApAwCFNwMACyAAQQhqIAFBCGopAwBBGCkDAIU3AwALIAAgASkDAEEQKQMAhTcDAAtBEEIANwMAQRhCADcDAEEgQgA3AwBBKEIANwMAQTBCADcDAEE4QgA3AwBBwABCADcDAEHIAEIANwMAQdAAQgA3AwBB2ABCADcDAEHgAEIANwMAQegAQgA3AwAgBA8LnQUBEX9B5fDBiwYhA0HuyIGZAyEIQbLaiMsHIQ1B9MqB2QYhEiACKAIAIQQgAkEEaigCACEFIAJBCGooAgAhBiACQQxqKAIAIQcgAkEQaigCACEOIAJBFGooAgAhDyACQRhqKAIAIRAgAkEcaigCACERIAEoAgAhCSABQQRqKAIAIQogAUEIaigCACELIAFBDGooAgAhDEEUIRMCQANAIBNBAEYNASAHIAMgD2pBB3dzIQcgCyAHIANqQQl3cyELIA8gCyAHakENd3MhDyADIA8gC2pBEndzIQMgDCAIIARqQQd3cyEMIBAgDCAIakEJd3MhECAEIBAgDGpBDXdzIQQgCCAEIBBqQRJ3cyEIIBEgDSAJakEHd3MhESAFIBEgDWpBCXdzIQUgCSAFIBFqQQ13cyEJIA0gCSAFakESd3MhDSAGIBIgDmpBB3dzIQYgCiAGIBJqQQl3cyEKIA4gCiAGakENd3MhDiASIA4gCmpBEndzIRIgBCADIAZqQQd3cyEEIAUgBCADakEJd3MhBSAGIAUgBGpBDXdzIQYgAyAGIAVqQRJ3cyEDIAkgCCAHakEHd3MhCSAKIAkgCGpBCXdzIQogByAKIAlqQQ13cyEHIAggByAKakESd3MhCCAOIA0gDGpBB3dzIQ4gCyAOIA1qQQl3cyELIAwgCyAOakENd3MhDCANIAwgC2pBEndzIQ0gDyASIBFqQQd3cyEPIBAgDyASakEJd3MhECARIBAgD2pBDXdzIREgEiARIBBqQRJ3cyESIBNBAmshEwwACwsgACADNgIAIABBBGogCDYCACAAQQhqIA02AgAgAEEMaiASNgIAIABBEGogCTYCACAAQRRqIAo2AgAgAEEYaiALNgIAIABBHGogDDYCAAsKACAAIAEgAhAFC90GASF/QeXwwYsGIQNB7siBmQMhCEGy2ojLByENQfTKgdkGIRIgAigCACEEIAJBBGooAgAhBSACQQhqKAIAIQYgAkEMaigCACEHIAJBEGooAgAhDiACQRRqKAIAIQ8gAkEYaigCACEQIAJBHGooAgAhESABKAIAIQkgAUEEaigCACEKIAFBCGooAgAhCyABQQxqKAIAIQwgAyETIAQhFCAFIRUgBiEWIAchFyAIIRggCSEZIAohGiALIRsgDCEcIA0hHSAOIR4gDyEfIBAhICARISEgEiEiQRQhIwJAA0AgI0EARg0BIAcgAyAPakEHd3MhByALIAcgA2pBCXdzIQsgDyALIAdqQQ13cyEPIAMgDyALakESd3MhAyAMIAggBGpBB3dzIQwgECAMIAhqQQl3cyEQIAQgECAMakENd3MhBCAIIAQgEGpBEndzIQggESANIAlqQQd3cyERIAUgESANakEJd3MhBSAJIAUgEWpBDXdzIQkgDSAJIAVqQRJ3cyENIAYgEiAOakEHd3MhBiAKIAYgEmpBCXdzIQogDiAKIAZqQQ13cyEOIBIgDiAKakESd3MhEiAEIAMgBmpBB3dzIQQgBSAEIANqQQl3cyEFIAYgBSAEakENd3MhBiADIAYgBWpBEndzIQMgCSAIIAdqQQd3cyEJIAogCSAIakEJd3MhCiAHIAogCWpBDXdzIQcgCCAHIApqQRJ3cyEIIA4gDSAMakEHd3MhDiALIA4gDWpBCXdzIQsgDCALIA5qQQ13cyEMIA0gDCALakESd3MhDSAPIBIgEWpBB3dzIQ8gECAPIBJqQQl3cyEQIBEgECAPakENd3MhESASIBEgEGpBEndzIRIgI0ECayEjDAALCyAAIAMgE2o2AgAgAEEEaiAEIBRqNgIAIABBCGogBSAVajYCACAAQQxqIAYgFmo2AgAgAEEQaiAHIBdqNgIAIABBFGogCCAYajYCACAAQRhqIAkgGWo2AgAgAEEcaiAKIBpqNgIAIABBIGogCyAbajYCACAAQSRqIAwgHGo2AgAgAEEoaiANIB1qNgIAIABBLGogDiAeajYCACAAQTBqIA8gH2o2AgAgAEE0aiAQICBqNgIAIABBOGogESAhajYCACAAQTxqIBIgImo2AgAL")}}),Ay=by(),wy=new WebAssembly.Module(Ay);W0.exports=e=>new WebAssembly.Instance(wy,e).exports});var j0=Z((CA,Z0)=>{var fr=typeof WebAssembly<"u"&&J0()(),rn=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),ke=144,Kt=ke,tn=[];Z0.exports=Pe;Pe.NONCEBYTES=24;Pe.KEYBYTES=32;Pe.core_hsalsa20=X0;Pe.SIGMA=rn;function Pe(e,t){if(!(this instanceof Pe))return new Pe(e,t);if(!e||e.length<24)throw new Error("nonce must be at least 24 bytes");if(!t||t.length<32)throw new Error("key must be at least 32 bytes");this._xor=fr?new nn(e,t):new Sa(e,t)}Pe.prototype.update=function(e,t){if(!e)throw new Error("input must be Uint8Array or Buffer");return t||(t=new Uint8Array(e.length)),e.length&&this._xor.update(e,t),t};Pe.prototype.final=Pe.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function nn(e,t){tn.length||(tn.push(ke),ke+=64),this._pointer=tn.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(fr.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(e,this._nonce),this._memory.set(t,this._key)}nn.prototype.realloc=function(e){fr.memory.grow(Math.ceil(Math.abs(e-this._memory.length)/65536)),this._memory=new Uint8Array(fr.memory.buffer)};nn.prototype.update=function(e,t){var r=this._overflow+e.length,n=ke+this._overflow;Kt=ke+r,Kt>=this._memory.length&&this.realloc(Kt),this._memory.set(e,n),fr.xsalsa20_xor(this._pointer,ke,ke,r,this._nonce,this._key),t.set(this._memory.subarray(n,ke+r)),this._overflow=r&63};nn.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),Kt>ke&&(this._memory.fill(0,ke,Kt),Kt=0),tn.push(this._pointer)};function Sa(e,t){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,X0(this._s,e,t,rn);for(var r=0;r<8;r++)this._z[r]=e[r+16]}Sa.prototype.update=function(e,t){for(var r=new Uint8Array(64),n=0,i=this._overflow,a=e.length+this._overflow,o=this._z,s=-this._overflow,f=-this._overflow;a>=64;){for($0(r,o,this._s,rn);i<64;i++)t[f+i]=e[s+i]^r[i];for(n=1,i=8;i<16;i++)n+=o[i]&255|0,o[i]=n&255,n>>>=8;a-=64,f+=64,s+=64,i=0}if(a>0)for($0(r,o,this._s,rn);i<a;i++)t[f+i]=e[s+i]^r[i];this._overflow=a&63};Sa.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function $0(e,t,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,o=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,f=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,c=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,p=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,d=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,g=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,S=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=i,E=a,B=o,_=s,D=f,U=c,z=u,O=h,F=p,Y=m,$=l,M=d,Q=g,N=b,ne=S,X=w,y,Ke=0;Ke<20;Ke+=2)y=C+Q|0,D^=y<<7|y>>>25,y=D+C|0,F^=y<<9|y>>>23,y=F+D|0,Q^=y<<13|y>>>19,y=Q+F|0,C^=y<<18|y>>>14,y=U+E|0,Y^=y<<7|y>>>25,y=Y+U|0,N^=y<<9|y>>>23,y=N+Y|0,E^=y<<13|y>>>19,y=E+N|0,U^=y<<18|y>>>14,y=$+z|0,ne^=y<<7|y>>>25,y=ne+$|0,B^=y<<9|y>>>23,y=B+ne|0,z^=y<<13|y>>>19,y=z+B|0,$^=y<<18|y>>>14,y=X+M|0,_^=y<<7|y>>>25,y=_+X|0,O^=y<<9|y>>>23,y=O+_|0,M^=y<<13|y>>>19,y=M+O|0,X^=y<<18|y>>>14,y=C+_|0,E^=y<<7|y>>>25,y=E+C|0,B^=y<<9|y>>>23,y=B+E|0,_^=y<<13|y>>>19,y=_+B|0,C^=y<<18|y>>>14,y=U+D|0,z^=y<<7|y>>>25,y=z+U|0,O^=y<<9|y>>>23,y=O+z|0,D^=y<<13|y>>>19,y=D+O|0,U^=y<<18|y>>>14,y=$+Y|0,M^=y<<7|y>>>25,y=M+$|0,F^=y<<9|y>>>23,y=F+M|0,Y^=y<<13|y>>>19,y=Y+F|0,$^=y<<18|y>>>14,y=X+ne|0,Q^=y<<7|y>>>25,y=Q+X|0,N^=y<<9|y>>>23,y=N+Q|0,ne^=y<<13|y>>>19,y=ne+N|0,X^=y<<18|y>>>14;C=C+i|0,E=E+a|0,B=B+o|0,_=_+s|0,D=D+f|0,U=U+c|0,z=z+u|0,O=O+h|0,F=F+p|0,Y=Y+m|0,$=$+l|0,M=M+d|0,Q=Q+g|0,N=N+b|0,ne=ne+S|0,X=X+w|0,e[0]=C>>>0&255,e[1]=C>>>8&255,e[2]=C>>>16&255,e[3]=C>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=B>>>0&255,e[9]=B>>>8&255,e[10]=B>>>16&255,e[11]=B>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=D>>>0&255,e[17]=D>>>8&255,e[18]=D>>>16&255,e[19]=D>>>24&255,e[20]=U>>>0&255,e[21]=U>>>8&255,e[22]=U>>>16&255,e[23]=U>>>24&255,e[24]=z>>>0&255,e[25]=z>>>8&255,e[26]=z>>>16&255,e[27]=z>>>24&255,e[28]=O>>>0&255,e[29]=O>>>8&255,e[30]=O>>>16&255,e[31]=O>>>24&255,e[32]=F>>>0&255,e[33]=F>>>8&255,e[34]=F>>>16&255,e[35]=F>>>24&255,e[36]=Y>>>0&255,e[37]=Y>>>8&255,e[38]=Y>>>16&255,e[39]=Y>>>24&255,e[40]=$>>>0&255,e[41]=$>>>8&255,e[42]=$>>>16&255,e[43]=$>>>24&255,e[44]=M>>>0&255,e[45]=M>>>8&255,e[46]=M>>>16&255,e[47]=M>>>24&255,e[48]=Q>>>0&255,e[49]=Q>>>8&255,e[50]=Q>>>16&255,e[51]=Q>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=ne>>>0&255,e[57]=ne>>>8&255,e[58]=ne>>>16&255,e[59]=ne>>>24&255,e[60]=X>>>0&255,e[61]=X>>>8&255,e[62]=X>>>16&255,e[63]=X>>>24&255}function X0(e,t,r,n){for(var i=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,a=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,o=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,s=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,f=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,c=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,u=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,h=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,p=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,m=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,l=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,d=r[16]&255|(r[17]&255)<<8|(r[18]&255)<<16|(r[19]&255)<<24,g=r[20]&255|(r[21]&255)<<8|(r[22]&255)<<16|(r[23]&255)<<24,b=r[24]&255|(r[25]&255)<<8|(r[26]&255)<<16|(r[27]&255)<<24,S=r[28]&255|(r[29]&255)<<8|(r[30]&255)<<16|(r[31]&255)<<24,w=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,C=i,E=a,B=o,_=s,D=f,U=c,z=u,O=h,F=p,Y=m,$=l,M=d,Q=g,N=b,ne=S,X=w,y,Ke=0;Ke<20;Ke+=2)y=C+Q|0,D^=y<<7|y>>>25,y=D+C|0,F^=y<<9|y>>>23,y=F+D|0,Q^=y<<13|y>>>19,y=Q+F|0,C^=y<<18|y>>>14,y=U+E|0,Y^=y<<7|y>>>25,y=Y+U|0,N^=y<<9|y>>>23,y=N+Y|0,E^=y<<13|y>>>19,y=E+N|0,U^=y<<18|y>>>14,y=$+z|0,ne^=y<<7|y>>>25,y=ne+$|0,B^=y<<9|y>>>23,y=B+ne|0,z^=y<<13|y>>>19,y=z+B|0,$^=y<<18|y>>>14,y=X+M|0,_^=y<<7|y>>>25,y=_+X|0,O^=y<<9|y>>>23,y=O+_|0,M^=y<<13|y>>>19,y=M+O|0,X^=y<<18|y>>>14,y=C+_|0,E^=y<<7|y>>>25,y=E+C|0,B^=y<<9|y>>>23,y=B+E|0,_^=y<<13|y>>>19,y=_+B|0,C^=y<<18|y>>>14,y=U+D|0,z^=y<<7|y>>>25,y=z+U|0,O^=y<<9|y>>>23,y=O+z|0,D^=y<<13|y>>>19,y=D+O|0,U^=y<<18|y>>>14,y=$+Y|0,M^=y<<7|y>>>25,y=M+$|0,F^=y<<9|y>>>23,y=F+M|0,Y^=y<<13|y>>>19,y=Y+F|0,$^=y<<18|y>>>14,y=X+ne|0,Q^=y<<7|y>>>25,y=Q+X|0,N^=y<<9|y>>>23,y=N+Q|0,ne^=y<<13|y>>>19,y=ne+N|0,X^=y<<18|y>>>14;e[0]=C>>>0&255,e[1]=C>>>8&255,e[2]=C>>>16&255,e[3]=C>>>24&255,e[4]=U>>>0&255,e[5]=U>>>8&255,e[6]=U>>>16&255,e[7]=U>>>24&255,e[8]=$>>>0&255,e[9]=$>>>8&255,e[10]=$>>>16&255,e[11]=$>>>24&255,e[12]=X>>>0&255,e[13]=X>>>8&255,e[14]=X>>>16&255,e[15]=X>>>24&255,e[16]=z>>>0&255,e[17]=z>>>8&255,e[18]=z>>>16&255,e[19]=z>>>24&255,e[20]=O>>>0&255,e[21]=O>>>8&255,e[22]=O>>>16&255,e[23]=O>>>24&255,e[24]=F>>>0&255,e[25]=F>>>8&255,e[26]=F>>>16&255,e[27]=F>>>24&255,e[28]=Y>>>0&255,e[29]=Y>>>8&255,e[30]=Y>>>16&255,e[31]=Y>>>24&255}});var Sy={};V(Sy,{generateKey:()=>nf,preSharedKey:()=>Ey});var Cy=Symbol.for("@libp2p/connection");var Ty=Symbol.for("@libp2p/content-routing");var Ry=Symbol.for("@libp2p/peer-discovery");var Ly=Symbol.for("@libp2p/peer-id");var ky=Symbol.for("@libp2p/peer-routing");var Na;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(Na||(Na={}));var Fy=Symbol.for("@libp2p/transport");var La;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(La||(La={}));var le=class extends Error{code;props;constructor(t,r,n){super(t),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var an=class extends Event{detail;constructor(t,r){super(t,r),this.detail=r?.detail}},qy=globalThis.CustomEvent??an;var vx=fe(dr(),1),_c=fe(J(),1);function yr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}var An={};V(An,{base10:()=>Cf});function Af(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,g=0,b=0,S=l.length;b!==S&&l[b]===0;)b++,d++;for(var w=(S-b)*u+1>>>0,C=new Uint8Array(w);b!==S;){for(var E=l[b],B=0,_=w-1;(E!==0||B<g)&&_!==-1;_--,B++)E+=256*C[_]>>>0,C[_]=E%s>>>0,E=E/s>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,b++}for(var D=w-g;D!==w&&C[D]===0;)D++;for(var U=f.repeat(d);D<w;++D)U+=e.charAt(C[D]);return U}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var d=0;if(l[d]!==" "){for(var g=0,b=0;l[d]===f;)g++,d++;for(var S=(l.length-d)*c+1>>>0,w=new Uint8Array(S);l[d];){var C=r[l.charCodeAt(d)];if(C===255)return;for(var E=0,B=S-1;(C!==0||E<b)&&B!==-1;B--,E++)C+=s*w[B]>>>0,w[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=E,d++}if(l[d]!==" "){for(var _=S-b;_!==S&&w[_]===0;)_++;for(var D=new Uint8Array(g+(S-_)),U=g;_!==S;)D[U++]=w[_++];return D}}}function m(l){var d=p(l);if(d)return d;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var wf=Af,Ef=wf,Wa=Ef;var T1=new Uint8Array(0);var Ja=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Me=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var $a=e=>new TextEncoder().encode(e),Xa=e=>new TextDecoder().decode(e);var gn=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},mn=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return ja(this,t)}},vn=class{constructor(t){this.decoders=t}or(t){return ja(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ja=(e,t)=>new vn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),bn=class{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new gn(t,r,n),this.decoder=new mn(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},dt=({name:e,prefix:t,encode:r,decode:n})=>new bn(e,t,r,n),Ye=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Wa(r,t);return dt({prefix:e,name:t,encode:n,decode:a=>Me(i(a))})},Sf=(e,t,r,n)=>{let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},Bf=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ie=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>dt({prefix:t,name:e,encode(i){return Bf(i,n,r)},decode(i){return Sf(i,n,r,e)}});var Cf=Ye({prefix:"9",name:"base10",alphabet:"0123456789"});var wn={};V(wn,{base16:()=>If,base16upper:()=>Tf});var If=ie({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Tf=ie({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var En={};V(En,{base2:()=>_f});var _f=ie({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Sn={};V(Sn,{base256emoji:()=>Uf});var eo=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Df=eo.reduce((e,t,r)=>(e[r]=t,e),[]),Rf=eo.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Nf(e){return e.reduce((t,r)=>(t+=Df[r],t),"")}function Lf(e){let t=[];for(let r of e){let n=Rf[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var Uf=dt({prefix:"\u{1F680}",name:"base256emoji",encode:Nf,decode:Lf});var Bn={};V(Bn,{base32:()=>yt,base32hex:()=>Mf,base32hexpad:()=>Of,base32hexpadupper:()=>Vf,base32hexupper:()=>Ff,base32pad:()=>Pf,base32padupper:()=>Kf,base32upper:()=>kf,base32z:()=>qf});var yt=ie({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),kf=ie({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Pf=ie({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Kf=ie({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Mf=ie({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ff=ie({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Of=ie({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Vf=ie({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qf=ie({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Cn={};V(Cn,{base36:()=>zf,base36upper:()=>Qf});var zf=Ye({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Qf=Ye({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var In={};V(In,{base58btc:()=>Ce,base58flickr:()=>Gf});var Ce=Ye({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Gf=Ye({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Tn={};V(Tn,{base64:()=>Hf,base64pad:()=>Yf,base64url:()=>Wf,base64urlpad:()=>Jf});var Hf=ie({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yf=ie({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Wf=ie({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Jf=ie({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _n={};V(_n,{base8:()=>$f});var $f=ie({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Dn={};V(Dn,{identity:()=>Xf});var Xf=dt({prefix:"\0",name:"identity",encode:e=>Xa(e),decode:e=>$a(e)});var z1=new TextEncoder,Q1=new TextDecoder;var Nn={};V(Nn,{identity:()=>bc});var ec=no,to=128,tc=127,rc=~tc,nc=Math.pow(2,31);function no(e,t,r){t=t||[],r=r||0;for(var n=r;e>=nc;)t[r++]=e&255|to,e/=128;for(;e&rc;)t[r++]=e&255|to,e>>>=7;return t[r]=e|0,no.bytes=r-n+1,t}var ic=Rn,ac=128,ro=127;function Rn(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw Rn.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&ro)<<i:(o&ro)*Math.pow(2,i),i+=7}while(o>=ac);return Rn.bytes=a-n,r}var oc=Math.pow(2,7),sc=Math.pow(2,14),fc=Math.pow(2,21),cc=Math.pow(2,28),uc=Math.pow(2,35),hc=Math.pow(2,42),lc=Math.pow(2,49),pc=Math.pow(2,56),dc=Math.pow(2,63),yc=function(e){return e<oc?1:e<sc?2:e<fc?3:e<cc?4:e<uc?5:e<hc?6:e<lc?7:e<pc?8:e<dc?9:10},xc={encode:ec,decode:ic,encodingLength:yc},gc=xc,Ft=gc;var Ot=(e,t=0)=>[Ft.decode(e,t),Ft.decode.bytes],xt=(e,t,r=0)=>(Ft.encode(e,t,r),t),gt=e=>Ft.encodingLength(e);var tt=(e,t)=>{let r=t.byteLength,n=gt(e),i=n+gt(r),a=new Uint8Array(i+r);return xt(e,a,0),xt(r,a,n),a.set(t,i),new mt(e,r,t,a)},io=e=>{let t=Me(e),[r,n]=Ot(t),[i,a]=Ot(t.subarray(n)),o=t.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new mt(r,i,o,t)},ao=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Ja(e.bytes,r.bytes)}},mt=class{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};var oo=0,mc="identity",so=Me,vc=e=>tt(oo,so(e)),bc={code:oo,name:mc,encode:so,digest:vc};var kn={};V(kn,{sha256:()=>Ac,sha512:()=>wc});var Un=({name:e,code:t,encode:r})=>new Ln(e,t,r),Ln=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?tt(this.code,r):r.then(n=>tt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var co=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Ac=Un({name:"sha2-256",code:18,encode:co("SHA-256")}),wc=Un({name:"sha2-512",code:19,encode:co("SHA-512")});var uo=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Sc(r,Pn(e),t||Ce.encoder);default:return Bc(r,Pn(e),t||yt.encoder)}};var ho=new WeakMap,Pn=e=>{let t=ho.get(e);if(t==null){let r=new Map;return ho.set(e,r),r}return t},gr=class e{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==qt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Cc)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=tt(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&ao(t.multihash,n.multihash)}toString(t){return uo(this,t)}toJSON(){return{"/":uo(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new e(n,i,a,o||lo(n,i,a.bytes))}else if(r[Ic]===!0){let{version:n,multihash:i,code:a}=r,o=io(i);return e.create(n,a,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==qt)throw new Error(`Version 0 CID must use dag-pb (code: ${qt}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let i=lo(t,r,n.bytes);return new e(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,qt,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,i=Me(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new mt(r.multihashCode,r.digestSize,a,i);return[r.version===0?e.createV0(o):e.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[h,p]=Ot(t.subarray(r));return r+=p,h},i=n(),a=qt;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(t,r){let[n,i]=Ec(t,r),a=e.decode(i);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Pn(a).set(n,t),a}},Ec=(e,t)=>{switch(e[0]){case"Q":{let r=t||Ce;return[Ce.prefix,r.decode(`${Ce.prefix}${e}`)]}case Ce.prefix:{let r=t||Ce;return[Ce.prefix,r.decode(e)]}case yt.prefix:{let r=t||yt;return[yt.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},Sc=(e,t,r)=>{let{prefix:n}=r;if(n!==Ce.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let a=r.encode(e).slice(1);return t.set(n,a),a}else return i},Bc=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let a=r.encode(e);return t.set(n,a),a}else return i},qt=112,Cc=18,lo=(e,t,r)=>{let n=gt(e),i=n+gt(t),a=new Uint8Array(i+r.byteLength);return xt(e,a,0),xt(t,a,n),a.set(r,i),a},Ic=Symbol.for("@ipld/js-cid/CID");var Kn={...Dn,...En,..._n,...An,...wn,...Bn,...Cn,...In,...Tn,...Sn},ox={...kn,...Nn};function Mn(e=0){return globalThis.Buffer?.allocUnsafe!=null?yr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function yo(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var po=yo("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Fn=yo("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=Mn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),lx={utf8:po,"utf-8":po,hex:Kn.base16,latin1:Fn,ascii:Fn,binary:Fn,...Kn};var Vv=fe(Gt(),1),qv=fe(gs(),1);var Zp=fe(J(),1);var $x=new Uint8Array(0);function Nr(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function Jh(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,g=0,b=0,S=l.length;b!==S&&l[b]===0;)b++,d++;for(var w=(S-b)*u+1>>>0,C=new Uint8Array(w);b!==S;){for(var E=l[b],B=0,_=w-1;(E!==0||B<g)&&_!==-1;_--,B++)E+=256*C[_]>>>0,C[_]=E%s>>>0,E=E/s>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,b++}for(var D=w-g;D!==w&&C[D]===0;)D++;for(var U=f.repeat(d);D<w;++D)U+=e.charAt(C[D]);return U}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var d=0;if(l[d]!==" "){for(var g=0,b=0;l[d]===f;)g++,d++;for(var S=(l.length-d)*c+1>>>0,w=new Uint8Array(S);l[d];){var C=r[l.charCodeAt(d)];if(C===255)return;for(var E=0,B=S-1;(C!==0||E<b)&&B!==-1;B--,E++)C+=s*w[B]>>>0,w[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=E,d++}if(l[d]!==" "){for(var _=S-b;_!==S&&w[_]===0;)_++;for(var D=new Uint8Array(g+(S-_)),U=g;_!==S;)D[U++]=w[_++];return D}}}function m(l){var d=p(l);if(d)return d;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var $h=Jh,Xh=$h,ms=Xh;var Zn=class{name;prefix;baseEncode;constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},jn=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return vs(this,t)}},ei=class{decoders;constructor(t){this.decoders=t}or(t){return vs(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function vs(e,t){return new ei({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var ti=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Zn(t,r,n),this.decoder=new jn(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function bs({name:e,prefix:t,encode:r,decode:n}){return new ti(e,t,r,n)}function ri({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=ms(r,e);return bs({prefix:t,name:e,encode:n,decode:a=>Nr(i(a))})}function Zh(e,t,r,n){let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o}function jh(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o!==0&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a}function Wt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){return bs({prefix:t,name:e,encode(i){return jh(i,n,r)},decode(i){return Zh(i,n,r,e)}})}var el=ri({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ng=ri({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var tl=Es,As=128,rl=127,nl=~rl,il=Math.pow(2,31);function Es(e,t,r){t=t||[],r=r||0;for(var n=r;e>=il;)t[r++]=e&255|As,e/=128;for(;e&nl;)t[r++]=e&255|As,e>>>=7;return t[r]=e|0,Es.bytes=r-n+1,t}var al=ni,ol=128,ws=127;function ni(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw ni.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&ws)<<i:(o&ws)*Math.pow(2,i),i+=7}while(o>=ol);return ni.bytes=a-n,r}var sl=Math.pow(2,7),fl=Math.pow(2,14),cl=Math.pow(2,21),ul=Math.pow(2,28),hl=Math.pow(2,35),ll=Math.pow(2,42),pl=Math.pow(2,49),dl=Math.pow(2,56),yl=Math.pow(2,63),xl=function(e){return e<sl?1:e<fl?2:e<cl?3:e<ul?4:e<hl?5:e<ll?6:e<pl?7:e<dl?8:e<yl?9:10},gl={encode:tl,decode:al,encodingLength:xl},ml=gl,ii=ml;function ai(e,t,r=0){return ii.encode(e,t,r),t}function oi(e){return ii.encodingLength(e)}function Lr(e,t){let r=t.byteLength,n=oi(e),i=n+oi(r),a=new Uint8Array(i+r);return ai(e,a,0),ai(r,a,n),a.set(t,i),new si(e,r,t,a)}var si=class{code;size;digest;bytes;constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};function ci({name:e,code:t,encode:r}){return new fi(e,t,r)}var fi=class{name;code;encode;constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?Lr(this.code,r):r.then(n=>Lr(this.code,n))}else throw Error("Unknown type, must be binary type")}};function Bs(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Ur=ci({name:"sha2-256",code:18,encode:Bs("SHA-256")}),dg=ci({name:"sha2-512",code:19,encode:Bs("SHA-512")});var bg=fe(se(),1),Ag=fe(Tr(),1),bl=fe(J(),1);var kr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Al=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Al)throw new Error("Non little-endian hardware is not supported");var Tg={}.toString;function Cs(e=32){if(kr&&typeof kr.getRandomValues=="function")return kr.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var Is=Wt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Rg=Wt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ng=Wt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Lg=Wt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hi=new Float32Array([-0]),$e=new Uint8Array(hi.buffer);function _s(e,t,r){hi[0]=e,t[r]=$e[0],t[r+1]=$e[1],t[r+2]=$e[2],t[r+3]=$e[3]}function Ds(e,t){return $e[0]=e[t],$e[1]=e[t+1],$e[2]=e[t+2],$e[3]=e[t+3],hi[0]}var li=new Float64Array([-0]),pe=new Uint8Array(li.buffer);function Rs(e,t,r){li[0]=e,t[r]=pe[0],t[r+1]=pe[1],t[r+2]=pe[2],t[r+3]=pe[3],t[r+4]=pe[4],t[r+5]=pe[5],t[r+6]=pe[6],t[r+7]=pe[7]}function Ns(e,t){return pe[0]=e[t],pe[1]=e[t+1],pe[2]=e[t+2],pe[3]=e[t+3],pe[4]=e[t+4],pe[5]=e[t+5],pe[6]=e[t+6],pe[7]=e[t+7],li[0]}var Sl=BigInt(Number.MAX_SAFE_INTEGER),Bl=BigInt(Number.MIN_SAFE_INTEGER),ge=class e{lo;hi;constructor(t,r){this.lo=t|0,this.hi=r|0}toNumber(t=!1){if(!t&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(t=!1){if(t)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(t=!1){return this.toBigInt(t).toString()}zzEncode(){let t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this}zzDecode(){let t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this}length(){let t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(t){if(t===0n)return ot;if(t<Sl&&t>Bl)return this.fromNumber(Number(t));let r=t<0n;r&&(t=-t);let n=t>>32n,i=t-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>Ls&&(i=0n,++n>Ls&&(n=0n))),new e(Number(i),Number(n))}static fromNumber(t){if(t===0)return ot;let r=t<0;r&&(t=-t);let n=t>>>0,i=(t-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new e(n,i)}static from(t){return typeof t=="number"?e.fromNumber(t):typeof t=="bigint"?e.fromBigInt(t):typeof t=="string"?e.fromBigInt(BigInt(t)):t.low!=null||t.high!=null?new e(t.low>>>0,t.high>>>0):ot}},ot=new ge(0,0);ot.toBigInt=function(){return 0n};ot.zzEncode=ot.zzDecode=function(){return this};ot.length=function(){return 1};var Ls=4294967296n;function Us(e){let t=0,r=0;for(let n=0;n<e.length;++n)r=e.charCodeAt(n),r<128?t+=1:r<2048?t+=2:(r&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t}function ks(e,t,r){if(r-t<1)return"";let i,a=[],o=0,s;for(;t<r;)s=e[t++],s<128?a[o++]=s:s>191&&s<224?a[o++]=(s&31)<<6|e[t++]&63:s>239&&s<365?(s=((s&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,a[o++]=55296+(s>>10),a[o++]=56320+(s&1023)):a[o++]=(s&15)<<12|(e[t++]&63)<<6|e[t++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))}function pi(e,t,r){let n=r,i,a;for(let o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&((a=e.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128);return r-n}function Se(e,t){return RangeError(`index out of range: ${e.pos} + ${t??1} > ${e.len}`)}function Pr(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}var di=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(t){this.buf=t,this.pos=0,this.len=t.length}uint32(){let t=4294967295;if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,Se(this,10);return t}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Se(this,4);return Pr(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Se(this,4);return Pr(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Se(this,4);let t=Ds(this.buf,this.pos);return this.pos+=4,t}double(){if(this.pos+8>this.len)throw Se(this,4);let t=Ns(this.buf,this.pos);return this.pos+=8,t}bytes(){let t=this.uint32(),r=this.pos,n=this.pos+t;if(n>this.len)throw Se(this,t);return this.pos+=t,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let t=this.bytes();return ks(t,0,t.length)}skip(t){if(typeof t=="number"){if(this.pos+t>this.len)throw Se(this,t);this.pos+=t}else do if(this.pos>=this.len)throw Se(this);while(this.buf[this.pos++]&128);return this}skipType(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${t} at offset ${this.pos}`)}return this}readLongVarint(){let t=new ge(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Se(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,t}if(this.len-this.pos>4){for(;r<5;++r)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;r<5;++r){if(this.pos>=this.len)throw Se(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Se(this,8);let t=Pr(this.buf,this.pos+=4),r=Pr(this.buf,this.pos+=4);return new ge(t,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function yi(e){return new di(e instanceof Uint8Array?e:e.subarray())}function Kr(e,t){let r=yi(e);return t.decode(r)}function st(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function qe(e=0){return globalThis.Buffer?.alloc!=null?st(globalThis.Buffer.alloc(e)):new Uint8Array(e)}function be(e=0){return globalThis.Buffer?.allocUnsafe!=null?st(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}var bi={};V(bi,{base10:()=>Rl});function Cl(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,g=0,b=0,S=l.length;b!==S&&l[b]===0;)b++,d++;for(var w=(S-b)*u+1>>>0,C=new Uint8Array(w);b!==S;){for(var E=l[b],B=0,_=w-1;(E!==0||B<g)&&_!==-1;_--,B++)E+=256*C[_]>>>0,C[_]=E%s>>>0,E=E/s>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,b++}for(var D=w-g;D!==w&&C[D]===0;)D++;for(var U=f.repeat(d);D<w;++D)U+=e.charAt(C[D]);return U}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var d=0;if(l[d]!==" "){for(var g=0,b=0;l[d]===f;)g++,d++;for(var S=(l.length-d)*c+1>>>0,w=new Uint8Array(S);l[d];){var C=r[l.charCodeAt(d)];if(C===255)return;for(var E=0,B=S-1;(C!==0||E<b)&&B!==-1;B--,E++)C+=s*w[B]>>>0,w[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=E,d++}if(l[d]!==" "){for(var _=S-b;_!==S&&w[_]===0;)_++;for(var D=new Uint8Array(g+(S-_)),U=g;_!==S;)D[U++]=w[_++];return D}}}function m(l){var d=p(l);if(d)return d;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var Il=Cl,Tl=Il,Ks=Tl;var Xg=new Uint8Array(0);var Ms=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},ze=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var Fs=e=>new TextEncoder().encode(e),Os=e=>new TextDecoder().decode(e);var xi=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},gi=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return qs(this,t)}},mi=class{constructor(t){this.decoders=t}or(t){return qs(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},qs=(e,t)=>new mi({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),vi=class{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new xi(t,r,n),this.decoder=new gi(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Et=({name:e,prefix:t,encode:r,decode:n})=>new vi(e,t,r,n),Xe=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Ks(r,t);return Et({prefix:e,name:t,encode:n,decode:a=>ze(i(a))})},_l=(e,t,r,n)=>{let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},Dl=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ae=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Et({prefix:t,name:e,encode(i){return Dl(i,n,r)},decode(i){return _l(i,n,r,e)}});var Rl=Xe({prefix:"9",name:"base10",alphabet:"0123456789"});var Ai={};V(Ai,{base16:()=>Nl,base16upper:()=>Ll});var Nl=ae({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ll=ae({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var wi={};V(wi,{base2:()=>Ul});var Ul=ae({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ei={};V(Ei,{base256emoji:()=>Fl});var zs=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),kl=zs.reduce((e,t,r)=>(e[r]=t,e),[]),Pl=zs.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Kl(e){return e.reduce((t,r)=>(t+=kl[r],t),"")}function Ml(e){let t=[];for(let r of e){let n=Pl[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var Fl=Et({prefix:"\u{1F680}",name:"base256emoji",encode:Kl,decode:Ml});var Si={};V(Si,{base32:()=>St,base32hex:()=>zl,base32hexpad:()=>Gl,base32hexpadupper:()=>Hl,base32hexupper:()=>Ql,base32pad:()=>Vl,base32padupper:()=>ql,base32upper:()=>Ol,base32z:()=>Yl});var St=ae({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ol=ae({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vl=ae({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ql=ae({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),zl=ae({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ql=ae({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Gl=ae({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Hl=ae({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Yl=ae({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Bi={};V(Bi,{base36:()=>Wl,base36upper:()=>Jl});var Wl=Xe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Jl=Xe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ci={};V(Ci,{base58btc:()=>Le,base58flickr:()=>$l});var Le=Xe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),$l=Xe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ii={};V(Ii,{base64:()=>Xl,base64pad:()=>Zl,base64url:()=>jl,base64urlpad:()=>ep});var Xl=ae({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Zl=ae({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jl=ae({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ep=ae({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ti={};V(Ti,{base8:()=>tp});var tp=ae({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var _i={};V(_i,{identity:()=>rp});var rp=Et({prefix:"\0",name:"identity",encode:e=>Os(e),decode:e=>Fs(e)});var l2=new TextEncoder,p2=new TextDecoder;var Ri={};V(Ri,{identity:()=>Bp});var ap=Hs,Qs=128,op=127,sp=~op,fp=Math.pow(2,31);function Hs(e,t,r){t=t||[],r=r||0;for(var n=r;e>=fp;)t[r++]=e&255|Qs,e/=128;for(;e&sp;)t[r++]=e&255|Qs,e>>>=7;return t[r]=e|0,Hs.bytes=r-n+1,t}var cp=Di,up=128,Gs=127;function Di(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw Di.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&Gs)<<i:(o&Gs)*Math.pow(2,i),i+=7}while(o>=up);return Di.bytes=a-n,r}var hp=Math.pow(2,7),lp=Math.pow(2,14),pp=Math.pow(2,21),dp=Math.pow(2,28),yp=Math.pow(2,35),xp=Math.pow(2,42),gp=Math.pow(2,49),mp=Math.pow(2,56),vp=Math.pow(2,63),bp=function(e){return e<hp?1:e<lp?2:e<pp?3:e<dp?4:e<yp?5:e<xp?6:e<gp?7:e<mp?8:e<vp?9:10},Ap={encode:ap,decode:cp,encodingLength:bp},wp=Ap,Jt=wp;var $t=(e,t=0)=>[Jt.decode(e,t),Jt.decode.bytes],Bt=(e,t,r=0)=>(Jt.encode(e,t,r),t),Ct=e=>Jt.encodingLength(e);var ft=(e,t)=>{let r=t.byteLength,n=Ct(e),i=n+Ct(r),a=new Uint8Array(i+r);return Bt(e,a,0),Bt(r,a,n),a.set(t,i),new It(e,r,t,a)},Ys=e=>{let t=ze(e),[r,n]=$t(t),[i,a]=$t(t.subarray(n)),o=t.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new It(r,i,o,t)},Ws=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Ms(e.bytes,r.bytes)}},It=class{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};var Js=0,Ep="identity",$s=ze,Sp=e=>ft(Js,$s(e)),Bp={code:Js,name:Ep,encode:$s,digest:Sp};var Ui={};V(Ui,{sha256:()=>Cp,sha512:()=>Ip});var Li=({name:e,code:t,encode:r})=>new Ni(e,t,r),Ni=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?ft(this.code,r):r.then(n=>ft(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Zs=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Cp=Li({name:"sha2-256",code:18,encode:Zs("SHA-256")}),Ip=Li({name:"sha2-512",code:19,encode:Zs("SHA-512")});var js=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return _p(r,ki(e),t||Le.encoder);default:return Dp(r,ki(e),t||St.encoder)}};var e0=new WeakMap,ki=e=>{let t=e0.get(e);if(t==null){let r=new Map;return e0.set(e,r),r}return t},Fr=class e{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Zt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Rp)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=ft(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&Ws(t.multihash,n.multihash)}toString(t){return js(this,t)}toJSON(){return{"/":js(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new e(n,i,a,o||t0(n,i,a.bytes))}else if(r[Np]===!0){let{version:n,multihash:i,code:a}=r,o=Ys(i);return e.create(n,a,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Zt)throw new Error(`Version 0 CID must use dag-pb (code: ${Zt}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let i=t0(t,r,n.bytes);return new e(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,Zt,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,i=ze(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new It(r.multihashCode,r.digestSize,a,i);return[r.version===0?e.createV0(o):e.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[h,p]=$t(t.subarray(r));return r+=p,h},i=n(),a=Zt;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(t,r){let[n,i]=Tp(t,r),a=e.decode(i);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ki(a).set(n,t),a}},Tp=(e,t)=>{switch(e[0]){case"Q":{let r=t||Le;return[Le.prefix,r.decode(`${Le.prefix}${e}`)]}case Le.prefix:{let r=t||Le;return[Le.prefix,r.decode(e)]}case St.prefix:{let r=t||St;return[St.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},_p=(e,t,r)=>{let{prefix:n}=r;if(n!==Le.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let a=r.encode(e).slice(1);return t.set(n,a),a}else return i},Dp=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let a=r.encode(e);return t.set(n,a),a}else return i},Zt=112,Rp=18,t0=(e,t,r)=>{let n=Ct(e),i=n+Ct(t),a=new Uint8Array(i+r.byteLength);return Bt(e,a,0),Bt(t,a,n),a.set(r,i),a},Np=Symbol.for("@ipld/js-cid/CID");var Pi={..._i,...wi,...Ti,...bi,...Ai,...Si,...Bi,...Ci,...Ii,...Ei},_2={...Ui,...Ri};function n0(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var r0=n0("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Ki=n0("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=be(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Lp={utf8:r0,"utf-8":r0,hex:Pi.base16,latin1:Ki,ascii:Ki,binary:Ki,...Pi},i0=Lp;function a0(e,t="utf8"){let r=i0[t];if(r==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?st(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function Mi(e){let t=e??8192,r=t>>>1,n,i=t;return function(o){if(o<1||o>r)return be(o);i+o>t&&(n=be(t),i=0);let s=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),s}}var ct=class{fn;len;next;val;constructor(t,r,n){this.fn=t,this.len=r,this.next=void 0,this.val=n}};function Fi(){}var Vi=class{head;tail;len;next;constructor(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}},Up=Mi();function kp(e){return globalThis.Buffer!=null?be(e):Up(e)}var tr=class{len;head;tail;states;constructor(){this.len=0,this.head=new ct(Fi,0,0),this.tail=this.head,this.states=null}_push(t,r,n){return this.tail=this.tail.next=new ct(t,r,n),this.len+=r,this}uint32(t){return this.len+=(this.tail=this.tail.next=new qi((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this}int32(t){return t<0?this._push(jt,10,ge.fromNumber(t)):this.uint32(t)}sint32(t){return this.uint32((t<<1^t>>31)>>>0)}uint64(t){let r=ge.fromBigInt(t);return this._push(jt,r.length(),r)}uint64Number(t){let r=ge.fromNumber(t);return this._push(jt,r.length(),r)}uint64String(t){return this.uint64(BigInt(t))}int64(t){return this.uint64(t)}int64Number(t){return this.uint64Number(t)}int64String(t){return this.uint64String(t)}sint64(t){let r=ge.fromBigInt(t).zzEncode();return this._push(jt,r.length(),r)}sint64Number(t){let r=ge.fromNumber(t).zzEncode();return this._push(jt,r.length(),r)}sint64String(t){return this.sint64(BigInt(t))}bool(t){return this._push(Oi,1,t?1:0)}fixed32(t){return this._push(er,4,t>>>0)}sfixed32(t){return this.fixed32(t)}fixed64(t){let r=ge.fromBigInt(t);return this._push(er,4,r.lo)._push(er,4,r.hi)}fixed64Number(t){let r=ge.fromNumber(t);return this._push(er,4,r.lo)._push(er,4,r.hi)}fixed64String(t){return this.fixed64(BigInt(t))}sfixed64(t){return this.fixed64(t)}sfixed64Number(t){return this.fixed64Number(t)}sfixed64String(t){return this.fixed64String(t)}float(t){return this._push(_s,4,t)}double(t){return this._push(Rs,8,t)}bytes(t){let r=t.length>>>0;return r===0?this._push(Oi,1,0):this.uint32(r)._push(Kp,r,t)}string(t){let r=Us(t);return r!==0?this.uint32(r)._push(pi,r,t):this._push(Oi,1,0)}fork(){return this.states=new Vi(this),this.head=this.tail=new ct(Fi,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new ct(Fi,0,0),this.len=0),this}ldelim(){let t=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=t.next,this.tail=r,this.len+=n),this}finish(){let t=this.head.next,r=kp(this.len),n=0;for(;t!=null;)t.fn(t.val,r,n),n+=t.len,t=t.next;return r}};function Oi(e,t,r){t[r]=e&255}function Pp(e,t,r){for(;e>127;)t[r++]=e&127|128,e>>>=7;t[r]=e}var qi=class extends ct{next;constructor(t,r){super(Pp,t,r),this.next=void 0}};function jt(e,t,r){for(;e.hi!==0;)t[r++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=e.lo&127|128,e.lo=e.lo>>>7;t[r++]=e.lo}function er(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function Kp(e,t,r){t.set(e,r)}globalThis.Buffer!=null&&(tr.prototype.bytes=function(e){let t=e.length>>>0;return this.uint32(t),t>0&&this._push(Mp,t,e),this},tr.prototype.string=function(e){let t=globalThis.Buffer.byteLength(e);return this.uint32(t),t>0&&this._push(Fp,t,e),this});function Mp(e,t,r){t.set(e,r)}function Fp(e,t,r){e.length<40?pi(e,t,r):t.utf8Write!=null?t.utf8Write(e,r):t.set(a0(e),r)}function zi(){return new tr}function Or(e,t){let r=zi();return t.encode(e,r,{lengthDelimited:!1}),r.finish()}var Tt;(function(e){e[e.VARINT=0]="VARINT",e[e.BIT64=1]="BIT64",e[e.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",e[e.START_GROUP=3]="START_GROUP",e[e.END_GROUP=4]="END_GROUP",e[e.BIT32=5]="BIT32"})(Tt||(Tt={}));function Vr(e,t,r,n){return{name:e,type:t,encode:r,decode:n}}function Qi(e){function t(i){if(e[i.toString()]==null)throw new Error("Invalid enum value");return e[i]}let r=function(a,o){let s=t(a);o.int32(s)},n=function(a){let o=a.int32();return t(o)};return Vr("enum",Tt.VARINT,r,n)}function qr(e,t){return Vr("message",Tt.LENGTH_DELIMITED,e,t)}var Ae;(function(e){e.RSA="RSA",e.Ed25519="Ed25519",e.Secp256k1="Secp256k1"})(Ae||(Ae={}));var Gi;(function(e){e[e.RSA=0]="RSA",e[e.Ed25519=1]="Ed25519",e[e.Secp256k1=2]="Secp256k1"})(Gi||(Gi={}));(function(e){e.codec=()=>Qi(Gi)})(Ae||(Ae={}));var _t;(function(e){let t;e.codec=()=>(t==null&&(t=qr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ae.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=Ae.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),t),e.encode=r=>Or(r,e.codec()),e.decode=r=>Kr(r,e.codec())})(_t||(_t={}));var Dt;(function(e){let t;e.codec=()=>(t==null&&(t=qr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),Ae.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=Ae.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),t),e.encode=r=>Or(r,e.codec()),e.decode=r=>Kr(r,e.codec())})(Dt||(Dt={}));var Vp={"P-256":256,"P-384":384,"P-521":521},qp=Object.keys(Vp),Im=qp.join(" / ");var Wp=fe(J(),1);var gv=fe(h0(),1);function Ze(e){if(isNaN(e)||e<=0)throw new le("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Cs(e)}var zm=fe(Rr(),1),Gp=fe(J(),1);var Ym=fe(Gt(),1),Wm=fe(Rr(),1);var Hp=fe(J(),1);var ed=fe(qn(),1),td=fe(se(),1);function $i(e,t){t==null&&(t=e.reduce((i,a)=>i+a.length,0));let r=be(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return st(r)}function p0(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}var y0=Symbol.for("@achingbrain/uint8arraylist");function d0(e,t){if(t==null||t<0)throw new RangeError("index is out of bounds");let r=0;for(let n of e){let i=r+n.byteLength;if(t<i)return{buf:n,index:t-r};r=i}throw new RangeError("index is out of bounds")}function Qr(e){return!!e?.[y0]}var nr=class e{bufs;length;[y0]=!0;constructor(...t){this.bufs=[],this.length=0,t.length>0&&this.appendAll(t)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...t){this.appendAll(t)}appendAll(t){let r=0;for(let n of t)if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.push(n);else if(Qr(n))r+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}prepend(...t){this.prependAll(t)}prependAll(t){let r=0;for(let n of t.reverse())if(n instanceof Uint8Array)r+=n.byteLength,this.bufs.unshift(n);else if(Qr(n))r+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=r}get(t){let r=d0(this.bufs,t);return r.buf[r.index]}set(t,r){let n=d0(this.bufs,t);n.buf[n.index]=r}write(t,r=0){if(t instanceof Uint8Array)for(let n=0;n<t.length;n++)this.set(r+n,t[n]);else if(Qr(t))for(let n=0;n<t.length;n++)this.set(r+n,t.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(t){if(t=Math.trunc(t),!(Number.isNaN(t)||t<=0)){if(t===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(t>=this.bufs[0].byteLength)t-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(t),this.length-=t;break}}}slice(t,r){let{bufs:n,length:i}=this._subList(t,r);return $i(n,i)}subarray(t,r){let{bufs:n,length:i}=this._subList(t,r);return n.length===1?n[0]:$i(n,i)}sublist(t,r){let{bufs:n,length:i}=this._subList(t,r),a=new e;return a.length=i,a.bufs=[...n],a}_subList(t,r){if(t=t??0,r=r??this.length,t<0&&(t=this.length+t),r<0&&(r=this.length+r),t<0||r>this.length)throw new RangeError("index is out of bounds");if(t===r)return{bufs:[],length:0};if(t===0&&r===this.length)return{bufs:this.bufs,length:this.length};let n=[],i=0;for(let a=0;a<this.bufs.length;a++){let o=this.bufs[a],s=i,f=s+o.byteLength;if(i=f,t>=f)continue;let c=t>=s&&t<f,u=r>s&&r<=f;if(c&&u){if(t===s&&r===f){n.push(o);break}let h=t-s;n.push(o.subarray(h,h+(r-t)));break}if(c){if(t===0){n.push(o);continue}n.push(o.subarray(t-s));continue}if(u){if(r===f){n.push(o);break}n.push(o.subarray(0,r-s));break}n.push(o)}return{bufs:n,length:r-t}}indexOf(t,r=0){if(!Qr(t)&&!(t instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=t instanceof Uint8Array?t:t.subarray();if(r=Number(r??0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;let i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");let a=256,o=new Int32Array(a);for(let h=0;h<a;h++)o[h]=-1;for(let h=0;h<i;h++)o[n[h]]=h;let s=o,f=this.byteLength-n.byteLength,c=n.byteLength-1,u;for(let h=r;h<=f;h+=u){u=0;for(let p=c;p>=0;p--){let m=this.get(h+p);if(n[p]!==m){u=Math.max(1,p-s[m]);break}}if(u===0)return h}return-1}getInt8(t){let r=this.subarray(t,t+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt8(0)}setInt8(t,r){let n=be(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,r),this.write(n,t)}getInt16(t,r){let n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,r)}setInt16(t,r,n){let i=qe(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,r,n),this.write(i,t)}getInt32(t,r){let n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,r)}setInt32(t,r,n){let i=qe(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,r,n),this.write(i,t)}getBigInt64(t,r){let n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,r)}setBigInt64(t,r,n){let i=qe(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,r,n),this.write(i,t)}getUint8(t){let r=this.subarray(t,t+1);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint8(0)}setUint8(t,r){let n=be(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,r),this.write(n,t)}getUint16(t,r){let n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,r)}setUint16(t,r,n){let i=qe(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,r,n),this.write(i,t)}getUint32(t,r){let n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,r)}setUint32(t,r,n){let i=qe(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,r,n),this.write(i,t)}getBigUint64(t,r){let n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,r)}setBigUint64(t,r,n){let i=qe(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,r,n),this.write(i,t)}getFloat32(t,r){let n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,r)}setFloat32(t,r,n){let i=qe(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,r,n),this.write(i,t)}getFloat64(t,r){let n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,r)}setFloat64(t,r,n){let i=qe(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,r,n),this.write(i,t)}equals(t){if(t==null||!(t instanceof e)||t.bufs.length!==this.bufs.length)return!1;for(let r=0;r<this.bufs.length;r++)if(!p0(this.bufs[r],t.bufs[r]))return!1;return!0}static fromUint8Arrays(t,r){let n=new e;return n.bufs=t,r==null&&(r=t.reduce((i,a)=>i+a.byteLength,0)),n.length=r,n}};function Be(){let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}var Gr=class extends Error{type;code;constructor(t,r){super(t??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=r??"ABORT_ERR"}};async function x0(e,t,r){if(t==null)return e;if(t.aborted)return Promise.reject(new Gr(r?.errorMessage,r?.errorCode));let n,i=new Gr(r?.errorMessage,r?.errorCode);try{return await Promise.race([e,new Promise((a,o)=>{n=()=>{o(i)},t.addEventListener("abort",n)})])}finally{n!=null&&t.removeEventListener("abort",n)}}var Xi=class{needNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.needNext=Be(),this.haveNext=Be()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("Have next but next was undefined");let t=this.nextResult;return this.nextResult=void 0,this.needNext.resolve(),this.needNext=Be(),t}async throw(t){return this.ended=!0,t!=null&&this.haveNext.reject(t),{done:!0,value:void 0}}async return(){let t={done:!0,value:void 0};return await this._push(void 0),t}async push(t,r){await this._push(t,r)}async end(t,r){t!=null?await this.throw(t):await this._push(void 0,r)}async _push(t,r){if(t!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");this.nextResult!=null&&await this.needNext.promise,t!=null?this.nextResult={done:!1,value:t}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=Be(),await x0(this.needNext.promise,r?.signal,r)}};function g0(){return new Xi}var Hr=class extends Error{code;constructor(t,r){super(t),this.code=r}},Zi=class extends Hr{type;constructor(t){super(t,"ABORT_ERR"),this.type="aborted"}};function m0(e,t){let r=g0();e.sink(r).catch(async o=>{await r.end(o)}),e.sink=async o=>{for await(let s of o)await r.push(s);await r.end()};let n=e.source;e.source[Symbol.iterator]!=null?n=e.source[Symbol.iterator]():e.source[Symbol.asyncIterator]!=null&&(n=e.source[Symbol.asyncIterator]());let i=new nr;return{read:async(o,s)=>{s?.signal?.throwIfAborted();let f,c=new Promise((u,h)=>{f=()=>{h(new Zi("Read aborted"))},s?.signal?.addEventListener("abort",f)});try{if(o==null){let{done:h,value:p}=await Promise.race([n.next(),c]);return h===!0?new nr:p}for(;i.byteLength<o;){let{value:h,done:p}=await Promise.race([n.next(),c]);if(p===!0)throw new Hr("unexpected end of input","ERR_UNEXPECTED_EOF");i.append(h)}let u=i.sublist(0,o);return i.consume(o),u}finally{f!=null&&s?.signal?.removeEventListener("abort",f)}},write:async(o,s)=>{s?.signal?.throwIfAborted(),o instanceof Uint8Array?await r.push(o,s):await r.push(o.subarray(),s)},unwrap:()=>{if(i.byteLength>0){let o=e.source;e.source=async function*(){t?.yieldBytes===!1?yield i:yield*i,yield*o}()}return e}}}function rd(e){let[t,r]=e[Symbol.asyncIterator]!=null?[e[Symbol.asyncIterator](),Symbol.asyncIterator]:[e[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>t.next(),push:i=>{n.push(i)},next:()=>n.length>0?{done:!1,value:n.shift()}:t.next(),[r](){return this}}}var v0=rd;function nd(e){return e[Symbol.asyncIterator]!=null}function id(e,t){if(nd(e))return async function*(){for await(let s of e)yield t(s)}();let r=v0(e),{value:n,done:i}=r.next();if(i===!0)return function*(){}();let a=t(n);if(typeof a.then=="function")return async function*(){yield await a;for await(let s of r)yield t(s)}();let o=t;return function*(){yield a;for(let s of r)yield o(s)}()}var b0=id;function ji(){let e=Be(),t=!1;return{sink:async r=>{if(t)throw new Error("already piped");t=!0,e.resolve(r)},source:async function*(){yield*await e.promise}()}}function A0(){let e=ji(),t=ji();return[{source:e.source,sink:t.sink},{source:t.source,sink:e.sink}]}var Yr=class{buffer;mask;top;btm;next;constructor(t){if(!(t>0)||t-1&t)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}push(t){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){let t=this.buffer[this.btm];if(t!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}isEmpty(){return this.buffer[this.btm]===void 0}},Rt=class{size;hwm;head;tail;constructor(t={}){this.hwm=t.splitLimit??16,this.head=new Yr(this.hwm),this.tail=this.head,this.size=0}calculateSize(t){return t?.byteLength!=null?t.byteLength:1}push(t){if(t?.value!=null&&(this.size+=this.calculateSize(t.value)),!this.head.push(t)){let r=this.head;this.head=r.next=new Yr(2*this.head.buffer.length),this.head.push(t)}}shift(){let t=this.tail.shift();if(t===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,t=this.tail.shift()}return t?.value!=null&&(this.size-=this.calculateSize(t.value)),t}isEmpty(){return this.head.isEmpty()}};var ea=class extends Error{type;code;constructor(t,r){super(t??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Wr(e={}){return ad(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},e)}function ad(e,t){t=t??{};let r=t.onEnd,n=new Rt,i,a,o,s=Be(),f=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((g,b)=>{a=S=>{a=null,n.push(S);try{g(e(n))}catch(w){b(w)}return i}}):e(n)}finally{n.isEmpty()&&queueMicrotask(()=>{s.resolve(),s=Be()})}},c=g=>a!=null?a(g):(n.push(g),i),u=g=>(n=new Rt,a!=null?a({error:g}):(n.push({error:g}),i)),h=g=>{if(o)return i;if(t?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return c({done:!1,value:g})},p=g=>o?i:(o=!0,g!=null?u(g):c({done:!0})),m=()=>(n=new Rt,p(),{done:!0}),l=g=>(p(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:f,return:m,throw:l,push:h,end:p,get readableLength(){return n.size},onEmpty:async g=>{let b=g?.signal;if(b?.throwIfAborted(),n.isEmpty())return;let S,w;b!=null&&(S=new Promise((C,E)=>{w=()=>{E(new ea)},b.addEventListener("abort",w)}));try{await Promise.race([s.promise,S])}finally{w!=null&&b!=null&&b?.removeEventListener("abort",w)}}},r==null)return i;let d=i;return i={[Symbol.asyncIterator](){return this},next(){return d.next()},throw(g){return d.throw(g),r!=null&&(r(g),r=void 0),{done:!0}},return(){return d.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(g){return d.end(g),r!=null&&(r(g),r=void 0),i},get readableLength(){return d.readableLength},onEmpty:g=>d.onEmpty(g)},i}function od(e){return e[Symbol.asyncIterator]!=null}function sd(...e){let t=[];for(let r of e)od(r)||t.push(r);return t.length===e.length?function*(){for(let r of t)yield*r}():async function*(){let r=Wr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(e.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var w0=sd;function E0(e,...t){if(e==null)throw new Error("Empty pipeline");if(ta(e)){let n=e;e=()=>n.source}else if(B0(e)||S0(e)){let n=e;e=()=>n}let r=[e,...t];if(r.length>1&&ta(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)ta(r[n])&&(r[n]=cd(r[n]));return fd(...r)}var fd=(...e)=>{let t;for(;e.length>0;)t=e.shift()(t);return t},S0=e=>e?.[Symbol.asyncIterator]!=null,B0=e=>e?.[Symbol.iterator]!=null,ta=e=>e==null?!1:e.sink!=null&&e.source!=null,cd=e=>t=>{let r=e.sink(t);if(r?.then!=null){let n=Wr({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,a=e.source;if(S0(a))i=async function*(){yield*a,n.end()};else if(B0(a))i=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return w0(n,i())}return e.source};function Jr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}var oa={};V(oa,{base10:()=>yd});function ud(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,g=0,b=0,S=l.length;b!==S&&l[b]===0;)b++,d++;for(var w=(S-b)*u+1>>>0,C=new Uint8Array(w);b!==S;){for(var E=l[b],B=0,_=w-1;(E!==0||B<g)&&_!==-1;_--,B++)E+=256*C[_]>>>0,C[_]=E%s>>>0,E=E/s>>>0;if(E!==0)throw new Error("Non-zero carry");g=B,b++}for(var D=w-g;D!==w&&C[D]===0;)D++;for(var U=f.repeat(d);D<w;++D)U+=e.charAt(C[D]);return U}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var d=0;if(l[d]!==" "){for(var g=0,b=0;l[d]===f;)g++,d++;for(var S=(l.length-d)*c+1>>>0,w=new Uint8Array(S);l[d];){var C=r[l.charCodeAt(d)];if(C===255)return;for(var E=0,B=S-1;(C!==0||E<b)&&B!==-1;B--,E++)C+=s*w[B]>>>0,w[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=E,d++}if(l[d]!==" "){for(var _=S-b;_!==S&&w[_]===0;)_++;for(var D=new Uint8Array(g+(S-_)),U=g;_!==S;)D[U++]=w[_++];return D}}}function m(l){var d=p(l);if(d)return d;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var hd=ud,ld=hd,C0=ld;var kb=new Uint8Array(0);var I0=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Qe=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var T0=e=>new TextEncoder().encode(e),_0=e=>new TextDecoder().decode(e);var ra=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},na=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return R0(this,t)}},ia=class{constructor(t){this.decoders=t}or(t){return R0(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},R0=(e,t)=>new ia({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),aa=class{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ra(t,r,n),this.decoder=new na(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Nt=({name:e,prefix:t,encode:r,decode:n})=>new aa(e,t,r,n),je=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=C0(r,t);return Nt({prefix:e,name:t,encode:n,decode:a=>Qe(i(a))})},pd=(e,t,r,n)=>{let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},dd=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},oe=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Nt({prefix:t,name:e,encode(i){return dd(i,n,r)},decode(i){return pd(i,n,r,e)}});var yd=je({prefix:"9",name:"base10",alphabet:"0123456789"});var sa={};V(sa,{base16:()=>xd,base16upper:()=>gd});var xd=oe({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),gd=oe({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var fa={};V(fa,{base2:()=>md});var md=oe({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ca={};V(ca,{base256emoji:()=>Ed});var N0=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),vd=N0.reduce((e,t,r)=>(e[r]=t,e),[]),bd=N0.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Ad(e){return e.reduce((t,r)=>(t+=vd[r],t),"")}function wd(e){let t=[];for(let r of e){let n=bd[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var Ed=Nt({prefix:"\u{1F680}",name:"base256emoji",encode:Ad,decode:wd});var ua={};V(ua,{base32:()=>Lt,base32hex:()=>Id,base32hexpad:()=>_d,base32hexpadupper:()=>Dd,base32hexupper:()=>Td,base32pad:()=>Bd,base32padupper:()=>Cd,base32upper:()=>Sd,base32z:()=>Rd});var Lt=oe({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Sd=oe({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bd=oe({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Cd=oe({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Id=oe({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Td=oe({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_d=oe({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Dd=oe({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Rd=oe({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ha={};V(ha,{base36:()=>Nd,base36upper:()=>Ld});var Nd=je({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ld=je({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var la={};V(la,{base58btc:()=>Ue,base58flickr:()=>Ud});var Ue=je({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ud=je({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var pa={};V(pa,{base64:()=>kd,base64pad:()=>Pd,base64url:()=>Kd,base64urlpad:()=>Md});var kd=oe({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Pd=oe({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kd=oe({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Md=oe({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var da={};V(da,{base8:()=>Fd});var Fd=oe({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ya={};V(ya,{identity:()=>Od});var Od=Nt({prefix:"\0",name:"identity",encode:e=>_0(e),decode:e=>T0(e)});var $b=new TextEncoder,Xb=new TextDecoder;var ga={};V(ga,{identity:()=>cy});var zd=k0,L0=128,Qd=127,Gd=~Qd,Hd=Math.pow(2,31);function k0(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Hd;)t[r++]=e&255|L0,e/=128;for(;e&Gd;)t[r++]=e&255|L0,e>>>=7;return t[r]=e|0,k0.bytes=r-n+1,t}var Yd=xa,Wd=128,U0=127;function xa(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw xa.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&U0)<<i:(o&U0)*Math.pow(2,i),i+=7}while(o>=Wd);return xa.bytes=a-n,r}var Jd=Math.pow(2,7),$d=Math.pow(2,14),Xd=Math.pow(2,21),Zd=Math.pow(2,28),jd=Math.pow(2,35),ey=Math.pow(2,42),ty=Math.pow(2,49),ry=Math.pow(2,56),ny=Math.pow(2,63),iy=function(e){return e<Jd?1:e<$d?2:e<Xd?3:e<Zd?4:e<jd?5:e<ey?6:e<ty?7:e<ry?8:e<ny?9:10},ay={encode:zd,decode:Yd,encodingLength:iy},oy=ay,ir=oy;var ar=(e,t=0)=>[ir.decode(e,t),ir.decode.bytes],Ut=(e,t,r=0)=>(ir.encode(e,t,r),t),kt=e=>ir.encodingLength(e);var ht=(e,t)=>{let r=t.byteLength,n=kt(e),i=n+kt(r),a=new Uint8Array(i+r);return Ut(e,a,0),Ut(r,a,n),a.set(t,i),new Pt(e,r,t,a)},P0=e=>{let t=Qe(e),[r,n]=ar(t),[i,a]=ar(t.subarray(n)),o=t.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new Pt(r,i,o,t)},K0=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&I0(e.bytes,r.bytes)}},Pt=class{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};var M0=0,sy="identity",F0=Qe,fy=e=>ht(M0,F0(e)),cy={code:M0,name:sy,encode:F0,digest:fy};var ba={};V(ba,{sha256:()=>uy,sha512:()=>hy});var va=({name:e,code:t,encode:r})=>new ma(e,t,r),ma=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?ht(this.code,r):r.then(n=>ht(this.code,n))}else throw Error("Unknown type, must be binary type")}};var V0=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),uy=va({name:"sha2-256",code:18,encode:V0("SHA-256")}),hy=va({name:"sha2-512",code:19,encode:V0("SHA-512")});var q0=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return py(r,Aa(e),t||Ue.encoder);default:return dy(r,Aa(e),t||Lt.encoder)}};var z0=new WeakMap,Aa=e=>{let t=z0.get(e);if(t==null){let r=new Map;return z0.set(e,r),r}return t},Xr=class e{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==sr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==yy)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=ht(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&K0(t.multihash,n.multihash)}toString(t){return q0(this,t)}toJSON(){return{"/":q0(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new e(n,i,a,o||Q0(n,i,a.bytes))}else if(r[xy]===!0){let{version:n,multihash:i,code:a}=r,o=P0(i);return e.create(n,a,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==sr)throw new Error(`Version 0 CID must use dag-pb (code: ${sr}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let i=Q0(t,r,n.bytes);return new e(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,sr,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,i=Qe(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new Pt(r.multihashCode,r.digestSize,a,i);return[r.version===0?e.createV0(o):e.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[h,p]=ar(t.subarray(r));return r+=p,h},i=n(),a=sr;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(t,r){let[n,i]=ly(t,r),a=e.decode(i);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Aa(a).set(n,t),a}},ly=(e,t)=>{switch(e[0]){case"Q":{let r=t||Ue;return[Ue.prefix,r.decode(`${Ue.prefix}${e}`)]}case Ue.prefix:{let r=t||Ue;return[Ue.prefix,r.decode(e)]}case Lt.prefix:{let r=t||Lt;return[Lt.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},py=(e,t,r)=>{let{prefix:n}=r;if(n!==Ue.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let a=r.encode(e).slice(1);return t.set(n,a),a}else return i},dy=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let a=r.encode(e);return t.set(n,a),a}else return i},sr=112,yy=18,Q0=(e,t,r)=>{let n=kt(e),i=n+kt(t),a=new Uint8Array(i+r.byteLength);return Ut(e,a,0),Ut(t,a,n),a.set(r,i),a},xy=Symbol.for("@ipld/js-cid/CID");var wa={...ya,...fa,...da,...oa,...sa,...ua,...ha,...la,...pa,...ca},pA={...ba,...ga};function G0(e=0){return globalThis.Buffer?.allocUnsafe!=null?Jr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Y0(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var H0=Y0("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Ea=Y0("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=G0(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),gy={utf8:H0,"utf-8":H0,hex:wa.base16,latin1:Ea,ascii:Ea,binary:Ea,...wa},Zr=gy;function jr(e,t="utf8"){let r=Zr[t];if(r==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Jr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function en(e,t="utf8"){let r=Zr[t];if(r==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var Ta=fe(j0(),1);var Ba="Your private shared key is invalid";var ef="No connection for the handshake provided";var tf="ERR_INVALID_PARAMETERS";function nf(e){let t=en(Ze(Ia),"base16"),r=jr(`/key/swarm/psk/1.0.0/
2
+ "use strict";var Libp2PPnet=(()=>{var tr=Object.create;var ue=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,sr=Object.prototype.hasOwnProperty;var st=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),O=(r,e)=>{for(var t in e)ue(r,t,{get:e[t],enumerable:!0})},it=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nr(e))!sr.call(r,o)&&o!==t&&ue(r,o,{get:()=>e[o],enumerable:!(n=rr(e,o))||n.enumerable});return r};var ir=(r,e,t)=>(t=r!=null?tr(or(r)):{},it(e||!r||!r.__esModule?ue(t,"default",{value:r,enumerable:!0}):t,r)),fr=r=>it(ue({},"__esModule",{value:!0}),r);var jt=st((ys,Vt)=>{var Cn=(r,e)=>function(){return e||(0,r[Object.keys(r)[0]])((e={exports:{}}).exports,e),e.exports},vn=(()=>{for(var r=new Uint8Array(128),e=0;e<64;e++)r[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return t=>{for(var n=t.length,o=new Uint8Array((n-(t[n-1]=="=")-(t[n-2]=="="))*3/4|0),i=0,f=0;i<n;){var a=r[t.charCodeAt(i++)],c=r[t.charCodeAt(i++)],w=r[t.charCodeAt(i++)],l=r[t.charCodeAt(i++)];o[f++]=a<<2|c>>4,o[f++]=c<<4|w>>2,o[f++]=w<<6|l}return o}})(),Qn=Cn({"wasm-binary:./xsalsa20.wat"(r,e){e.exports=vn("AGFzbQEAAAABGgNgBn9/f39/fwBgBn9/f39+fwF+YAN/f38AAwcGAAEBAgICBQUBAQroBwcoAwZtZW1vcnkCAAx4c2Fsc2EyMF94b3IAAAxjb3JlX3NhbHNhMjAABArqEQYYACAAIAEgAiADIAQgACkDACAFEAE3AwALPQBB8AAgAyAFEAMgACABIAIgA0EQaiAEQfAAEAJB8ABCADcDAEH4AEIANwMAQYABQgA3AwBBiAFCADcDAAuHBQEBfyACQQBGBEBCAA8LQdAAIAUpAwA3AwBB2AAgBUEIaikDADcDAEHgACAFQRBqKQMANwMAQegAIAVBGGopAwA3AwBBACADKQMANwMAQQggBDcDAAJAA0AgAkHAAEkNAUEQQQBB0AAQBSAAIAEpAwBBECkDAIU3AwAgAEEIaiABQQhqKQMAQRgpAwCFNwMAIABBEGogAUEQaikDAEEgKQMAhTcDACAAQRhqIAFBGGopAwBBKCkDAIU3AwAgAEEgaiABQSBqKQMAQTApAwCFNwMAIABBKGogAUEoaikDAEE4KQMAhTcDACAAQTBqIAFBMGopAwBBwAApAwCFNwMAIABBOGogAUE4aikDAEHIACkDAIU3AwBBCEEIKQMAQgF8NwMAIABBwABqIQAgAUHAAGohASACQcAAayECDAALC0EIKQMAIQQgAkEASwRAQRBBAEHQABAFAkACQAJAAkACQAJAAkACQCACQQhuDgcHBgUEAwIBAAsgAEE4aiABQThqKQMAQcgAKQMAhTcDAAsgAEEwaiABQTBqKQMAQcAAKQMAhTcDAAsgAEEoaiABQShqKQMAQTgpAwCFNwMACyAAQSBqIAFBIGopAwBBMCkDAIU3AwALIABBGGogAUEYaikDAEEoKQMAhTcDAAsgAEEQaiABQRBqKQMAQSApAwCFNwMACyAAQQhqIAFBCGopAwBBGCkDAIU3AwALIAAgASkDAEEQKQMAhTcDAAtBEEIANwMAQRhCADcDAEEgQgA3AwBBKEIANwMAQTBCADcDAEE4QgA3AwBBwABCADcDAEHIAEIANwMAQdAAQgA3AwBB2ABCADcDAEHgAEIANwMAQegAQgA3AwAgBA8LnQUBEX9B5fDBiwYhA0HuyIGZAyEIQbLaiMsHIQ1B9MqB2QYhEiACKAIAIQQgAkEEaigCACEFIAJBCGooAgAhBiACQQxqKAIAIQcgAkEQaigCACEOIAJBFGooAgAhDyACQRhqKAIAIRAgAkEcaigCACERIAEoAgAhCSABQQRqKAIAIQogAUEIaigCACELIAFBDGooAgAhDEEUIRMCQANAIBNBAEYNASAHIAMgD2pBB3dzIQcgCyAHIANqQQl3cyELIA8gCyAHakENd3MhDyADIA8gC2pBEndzIQMgDCAIIARqQQd3cyEMIBAgDCAIakEJd3MhECAEIBAgDGpBDXdzIQQgCCAEIBBqQRJ3cyEIIBEgDSAJakEHd3MhESAFIBEgDWpBCXdzIQUgCSAFIBFqQQ13cyEJIA0gCSAFakESd3MhDSAGIBIgDmpBB3dzIQYgCiAGIBJqQQl3cyEKIA4gCiAGakENd3MhDiASIA4gCmpBEndzIRIgBCADIAZqQQd3cyEEIAUgBCADakEJd3MhBSAGIAUgBGpBDXdzIQYgAyAGIAVqQRJ3cyEDIAkgCCAHakEHd3MhCSAKIAkgCGpBCXdzIQogByAKIAlqQQ13cyEHIAggByAKakESd3MhCCAOIA0gDGpBB3dzIQ4gCyAOIA1qQQl3cyELIAwgCyAOakENd3MhDCANIAwgC2pBEndzIQ0gDyASIBFqQQd3cyEPIBAgDyASakEJd3MhECARIBAgD2pBDXdzIREgEiARIBBqQRJ3cyESIBNBAmshEwwACwsgACADNgIAIABBBGogCDYCACAAQQhqIA02AgAgAEEMaiASNgIAIABBEGogCTYCACAAQRRqIAo2AgAgAEEYaiALNgIAIABBHGogDDYCAAsKACAAIAEgAhAFC90GASF/QeXwwYsGIQNB7siBmQMhCEGy2ojLByENQfTKgdkGIRIgAigCACEEIAJBBGooAgAhBSACQQhqKAIAIQYgAkEMaigCACEHIAJBEGooAgAhDiACQRRqKAIAIQ8gAkEYaigCACEQIAJBHGooAgAhESABKAIAIQkgAUEEaigCACEKIAFBCGooAgAhCyABQQxqKAIAIQwgAyETIAQhFCAFIRUgBiEWIAchFyAIIRggCSEZIAohGiALIRsgDCEcIA0hHSAOIR4gDyEfIBAhICARISEgEiEiQRQhIwJAA0AgI0EARg0BIAcgAyAPakEHd3MhByALIAcgA2pBCXdzIQsgDyALIAdqQQ13cyEPIAMgDyALakESd3MhAyAMIAggBGpBB3dzIQwgECAMIAhqQQl3cyEQIAQgECAMakENd3MhBCAIIAQgEGpBEndzIQggESANIAlqQQd3cyERIAUgESANakEJd3MhBSAJIAUgEWpBDXdzIQkgDSAJIAVqQRJ3cyENIAYgEiAOakEHd3MhBiAKIAYgEmpBCXdzIQogDiAKIAZqQQ13cyEOIBIgDiAKakESd3MhEiAEIAMgBmpBB3dzIQQgBSAEIANqQQl3cyEFIAYgBSAEakENd3MhBiADIAYgBWpBEndzIQMgCSAIIAdqQQd3cyEJIAogCSAIakEJd3MhCiAHIAogCWpBDXdzIQcgCCAHIApqQRJ3cyEIIA4gDSAMakEHd3MhDiALIA4gDWpBCXdzIQsgDCALIA5qQQ13cyEMIA0gDCALakESd3MhDSAPIBIgEWpBB3dzIQ8gECAPIBJqQQl3cyEQIBEgECAPakENd3MhESASIBEgEGpBEndzIRIgI0ECayEjDAALCyAAIAMgE2o2AgAgAEEEaiAEIBRqNgIAIABBCGogBSAVajYCACAAQQxqIAYgFmo2AgAgAEEQaiAHIBdqNgIAIABBFGogCCAYajYCACAAQRhqIAkgGWo2AgAgAEEcaiAKIBpqNgIAIABBIGogCyAbajYCACAAQSRqIAwgHGo2AgAgAEEoaiANIB1qNgIAIABBLGogDiAeajYCACAAQTBqIA8gH2o2AgAgAEE0aiAQICBqNgIAIABBOGogESAhajYCACAAQTxqIBIgImo2AgAL")}}),Sn=Qn(),Dn=new WebAssembly.Module(Sn);Vt.exports=r=>new WebAssembly.Instance(Dn,r).exports});var Ht=st((ws,Kt)=>{var ce=typeof WebAssembly<"u"&&jt()(),Ie=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),G=144,re=G,Ee=[];Kt.exports=V;V.NONCEBYTES=24;V.KEYBYTES=32;V.core_hsalsa20=Pt;V.SIGMA=Ie;function V(r,e){if(!(this instanceof V))return new V(r,e);if(!r||r.length<24)throw new Error("nonce must be at least 24 bytes");if(!e||e.length<32)throw new Error("key must be at least 32 bytes");this._xor=ce?new Be(r,e):new Ze(r,e)}V.prototype.update=function(r,e){if(!r)throw new Error("input must be Uint8Array or Buffer");return e||(e=new Uint8Array(r.length)),r.length&&this._xor.update(r,e),e};V.prototype.final=V.prototype.finalize=function(){this._xor.finalize(),this._xor=null};function Be(r,e){Ee.length||(Ee.push(G),G+=64),this._pointer=Ee.pop(),this._nonce=this._pointer+8,this._key=this._nonce+24,this._overflow=0,this._memory=new Uint8Array(ce.memory.buffer),this._memory.fill(0,this._pointer,this._pointer+8),this._memory.set(r,this._nonce),this._memory.set(e,this._key)}Be.prototype.realloc=function(r){ce.memory.grow(Math.ceil(Math.abs(r-this._memory.length)/65536)),this._memory=new Uint8Array(ce.memory.buffer)};Be.prototype.update=function(r,e){var t=this._overflow+r.length,n=G+this._overflow;re=G+t,re>=this._memory.length&&this.realloc(re),this._memory.set(r,n),ce.xsalsa20_xor(this._pointer,G,G,t,this._nonce,this._key),e.set(this._memory.subarray(n,G+t)),this._overflow=t&63};Be.prototype.finalize=function(){this._memory.fill(0,this._pointer,this._key+32),re>G&&(this._memory.fill(0,G,re),re=0),Ee.push(this._pointer)};function Ze(r,e){this._s=new Uint8Array(32),this._z=new Uint8Array(16),this._overflow=0,Pt(this._s,r,e,Ie);for(var t=0;t<8;t++)this._z[t]=r[t+16]}Ze.prototype.update=function(r,e){for(var t=new Uint8Array(64),n=0,o=this._overflow,i=r.length+this._overflow,f=this._z,a=-this._overflow,c=-this._overflow;i>=64;){for(kt(t,f,this._s,Ie);o<64;o++)e[c+o]=r[a+o]^t[o];for(n=1,o=8;o<16;o++)n+=f[o]&255|0,f[o]=n&255,n>>>=8;i-=64,c+=64,a+=64,o=0}if(i>0)for(kt(t,f,this._s,Ie);o<i;o++)e[c+o]=r[a+o]^t[o];this._overflow=i&63};Ze.prototype.finalize=function(){this._s.fill(0),this._z.fill(0)};function kt(r,e,t,n){for(var o=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,f=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,a=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,c=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,w=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,l=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,I=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,q=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,p=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,m=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,u=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,E=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,U=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,N=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,A=o,d=i,b=f,x=a,g=c,y=w,B=l,C=h,v=I,Q=q,S=p,M=m,R=u,_=E,T=U,D=N,s,ne=0;ne<20;ne+=2)s=A+R|0,g^=s<<7|s>>>25,s=g+A|0,v^=s<<9|s>>>23,s=v+g|0,R^=s<<13|s>>>19,s=R+v|0,A^=s<<18|s>>>14,s=y+d|0,Q^=s<<7|s>>>25,s=Q+y|0,_^=s<<9|s>>>23,s=_+Q|0,d^=s<<13|s>>>19,s=d+_|0,y^=s<<18|s>>>14,s=S+B|0,T^=s<<7|s>>>25,s=T+S|0,b^=s<<9|s>>>23,s=b+T|0,B^=s<<13|s>>>19,s=B+b|0,S^=s<<18|s>>>14,s=D+M|0,x^=s<<7|s>>>25,s=x+D|0,C^=s<<9|s>>>23,s=C+x|0,M^=s<<13|s>>>19,s=M+C|0,D^=s<<18|s>>>14,s=A+x|0,d^=s<<7|s>>>25,s=d+A|0,b^=s<<9|s>>>23,s=b+d|0,x^=s<<13|s>>>19,s=x+b|0,A^=s<<18|s>>>14,s=y+g|0,B^=s<<7|s>>>25,s=B+y|0,C^=s<<9|s>>>23,s=C+B|0,g^=s<<13|s>>>19,s=g+C|0,y^=s<<18|s>>>14,s=S+Q|0,M^=s<<7|s>>>25,s=M+S|0,v^=s<<9|s>>>23,s=v+M|0,Q^=s<<13|s>>>19,s=Q+v|0,S^=s<<18|s>>>14,s=D+T|0,R^=s<<7|s>>>25,s=R+D|0,_^=s<<9|s>>>23,s=_+R|0,T^=s<<13|s>>>19,s=T+_|0,D^=s<<18|s>>>14;A=A+o|0,d=d+i|0,b=b+f|0,x=x+a|0,g=g+c|0,y=y+w|0,B=B+l|0,C=C+h|0,v=v+I|0,Q=Q+q|0,S=S+p|0,M=M+m|0,R=R+u|0,_=_+E|0,T=T+U|0,D=D+N|0,r[0]=A>>>0&255,r[1]=A>>>8&255,r[2]=A>>>16&255,r[3]=A>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=b>>>0&255,r[9]=b>>>8&255,r[10]=b>>>16&255,r[11]=b>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=g>>>0&255,r[17]=g>>>8&255,r[18]=g>>>16&255,r[19]=g>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=C>>>0&255,r[29]=C>>>8&255,r[30]=C>>>16&255,r[31]=C>>>24&255,r[32]=v>>>0&255,r[33]=v>>>8&255,r[34]=v>>>16&255,r[35]=v>>>24&255,r[36]=Q>>>0&255,r[37]=Q>>>8&255,r[38]=Q>>>16&255,r[39]=Q>>>24&255,r[40]=S>>>0&255,r[41]=S>>>8&255,r[42]=S>>>16&255,r[43]=S>>>24&255,r[44]=M>>>0&255,r[45]=M>>>8&255,r[46]=M>>>16&255,r[47]=M>>>24&255,r[48]=R>>>0&255,r[49]=R>>>8&255,r[50]=R>>>16&255,r[51]=R>>>24&255,r[52]=_>>>0&255,r[53]=_>>>8&255,r[54]=_>>>16&255,r[55]=_>>>24&255,r[56]=T>>>0&255,r[57]=T>>>8&255,r[58]=T>>>16&255,r[59]=T>>>24&255,r[60]=D>>>0&255,r[61]=D>>>8&255,r[62]=D>>>16&255,r[63]=D>>>24&255}function Pt(r,e,t,n){for(var o=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,i=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,f=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,a=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,c=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,w=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,l=e[0]&255|(e[1]&255)<<8|(e[2]&255)<<16|(e[3]&255)<<24,h=e[4]&255|(e[5]&255)<<8|(e[6]&255)<<16|(e[7]&255)<<24,I=e[8]&255|(e[9]&255)<<8|(e[10]&255)<<16|(e[11]&255)<<24,q=e[12]&255|(e[13]&255)<<8|(e[14]&255)<<16|(e[15]&255)<<24,p=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,m=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,u=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,E=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,U=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,N=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,A=o,d=i,b=f,x=a,g=c,y=w,B=l,C=h,v=I,Q=q,S=p,M=m,R=u,_=E,T=U,D=N,s,ne=0;ne<20;ne+=2)s=A+R|0,g^=s<<7|s>>>25,s=g+A|0,v^=s<<9|s>>>23,s=v+g|0,R^=s<<13|s>>>19,s=R+v|0,A^=s<<18|s>>>14,s=y+d|0,Q^=s<<7|s>>>25,s=Q+y|0,_^=s<<9|s>>>23,s=_+Q|0,d^=s<<13|s>>>19,s=d+_|0,y^=s<<18|s>>>14,s=S+B|0,T^=s<<7|s>>>25,s=T+S|0,b^=s<<9|s>>>23,s=b+T|0,B^=s<<13|s>>>19,s=B+b|0,S^=s<<18|s>>>14,s=D+M|0,x^=s<<7|s>>>25,s=x+D|0,C^=s<<9|s>>>23,s=C+x|0,M^=s<<13|s>>>19,s=M+C|0,D^=s<<18|s>>>14,s=A+x|0,d^=s<<7|s>>>25,s=d+A|0,b^=s<<9|s>>>23,s=b+d|0,x^=s<<13|s>>>19,s=x+b|0,A^=s<<18|s>>>14,s=y+g|0,B^=s<<7|s>>>25,s=B+y|0,C^=s<<9|s>>>23,s=C+B|0,g^=s<<13|s>>>19,s=g+C|0,y^=s<<18|s>>>14,s=S+Q|0,M^=s<<7|s>>>25,s=M+S|0,v^=s<<9|s>>>23,s=v+M|0,Q^=s<<13|s>>>19,s=Q+v|0,S^=s<<18|s>>>14,s=D+T|0,R^=s<<7|s>>>25,s=R+D|0,_^=s<<9|s>>>23,s=_+R|0,T^=s<<13|s>>>19,s=T+_|0,D^=s<<18|s>>>14;r[0]=A>>>0&255,r[1]=A>>>8&255,r[2]=A>>>16&255,r[3]=A>>>24&255,r[4]=y>>>0&255,r[5]=y>>>8&255,r[6]=y>>>16&255,r[7]=y>>>24&255,r[8]=S>>>0&255,r[9]=S>>>8&255,r[10]=S>>>16&255,r[11]=S>>>24&255,r[12]=D>>>0&255,r[13]=D>>>8&255,r[14]=D>>>16&255,r[15]=D>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=C>>>0&255,r[21]=C>>>8&255,r[22]=C>>>16&255,r[23]=C>>>24&255,r[24]=v>>>0&255,r[25]=v>>>8&255,r[26]=v>>>16&255,r[27]=v>>>24&255,r[28]=Q>>>0&255,r[29]=Q>>>8&255,r[30]=Q>>>16&255,r[31]=Q>>>24&255}});var Ln={};O(Ln,{generateKey:()=>Wt,preSharedKey:()=>Nn});var J=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var De={};O(De,{base58btc:()=>F,base58flickr:()=>lr});var Rn=new Uint8Array(0);function ft(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function j(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function at(r){return new TextEncoder().encode(r)}function ct(r){return new TextDecoder().decode(r)}function ar(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var i=r.charAt(o),f=i.charCodeAt(0);if(t[f]!==255)throw new TypeError(i+" is ambiguous");t[f]=o}var a=r.length,c=r.charAt(0),w=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var m=0,u=0,E=0,U=p.length;E!==U&&p[E]===0;)E++,m++;for(var N=(U-E)*l+1>>>0,A=new Uint8Array(N);E!==U;){for(var d=p[E],b=0,x=N-1;(d!==0||b<u)&&x!==-1;x--,b++)d+=256*A[x]>>>0,A[x]=d%a>>>0,d=d/a>>>0;if(d!==0)throw new Error("Non-zero carry");u=b,E++}for(var g=N-u;g!==N&&A[g]===0;)g++;for(var y=c.repeat(m);g<N;++g)y+=r.charAt(A[g]);return y}function I(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var m=0;if(p[m]!==" "){for(var u=0,E=0;p[m]===c;)u++,m++;for(var U=(p.length-m)*w+1>>>0,N=new Uint8Array(U);p[m];){var A=t[p.charCodeAt(m)];if(A===255)return;for(var d=0,b=U-1;(A!==0||d<E)&&b!==-1;b--,d++)A+=a*N[b]>>>0,N[b]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");E=d,m++}if(p[m]!==" "){for(var x=U-E;x!==U&&N[x]===0;)x++;for(var g=new Uint8Array(u+(U-x)),y=u;x!==U;)g[y++]=N[x++];return g}}}function q(p){var m=I(p);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:I,decode:q}}var cr=ar,ur=cr,ht=ur;var Ce=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ve=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return At(this,e)}},Qe=class{decoders;constructor(e){this.decoders=e}or(e){return At(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function At(r,e){return new Qe({...r.decoders??{[r.prefix]:r},...e.decoders??{[e.prefix]:e}})}var Se=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new Ce(e,t,n),this.decoder=new ve(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Y({name:r,prefix:e,encode:t,decode:n}){return new Se(r,e,t,n)}function P({name:r,prefix:e,alphabet:t}){let{encode:n,decode:o}=ht(t,r);return Y({prefix:e,name:r,encode:n,decode:i=>j(o(i))})}function hr(r,e,t,n){let o={};for(let l=0;l<e.length;++l)o[e[l]]=l;let i=r.length;for(;r[i-1]==="=";)--i;let f=new Uint8Array(i*t/8|0),a=0,c=0,w=0;for(let l=0;l<i;++l){let h=o[r[l]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<t|h,a+=t,a>=8&&(a-=8,f[w++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return f}function Ar(r,e,t){let n=e[e.length-1]==="=",o=(1<<t)-1,i="",f=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],f+=8;f>t;)f-=t,i+=e[o&a>>f];if(f!==0&&(i+=e[o&a<<t-f]),n)for(;i.length*t&7;)i+="=";return i}function L({name:r,prefix:e,bitsPerChar:t,alphabet:n}){return Y({prefix:e,name:r,encode(o){return Ar(o,n,t)},decode(o){return hr(o,n,t,r)}})}var F=P({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),lr=P({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Le={};O(Le,{identity:()=>Rr});var pr=dt,lt=128,dr=127,xr=~dr,gr=Math.pow(2,31);function dt(r,e,t){e=e||[],t=t||0;for(var n=t;r>=gr;)e[t++]=r&255|lt,r/=128;for(;r&xr;)e[t++]=r&255|lt,r>>>=7;return e[t]=r|0,dt.bytes=t-n+1,e}var br=Ne,yr=128,pt=127;function Ne(r,n){var t=0,n=n||0,o=0,i=n,f,a=r.length;do{if(i>=a)throw Ne.bytes=0,new RangeError("Could not decode varint");f=r[i++],t+=o<28?(f&pt)<<o:(f&pt)*Math.pow(2,o),o+=7}while(f>=yr);return Ne.bytes=i-n,t}var wr=Math.pow(2,7),mr=Math.pow(2,14),Er=Math.pow(2,21),Ir=Math.pow(2,28),Br=Math.pow(2,35),Cr=Math.pow(2,42),vr=Math.pow(2,49),Qr=Math.pow(2,56),Sr=Math.pow(2,63),Dr=function(r){return r<wr?1:r<mr?2:r<Er?3:r<Ir?4:r<Br?5:r<Cr?6:r<vr?7:r<Qr?8:r<Sr?9:10},Nr={encode:pr,decode:br,encodingLength:Dr},Lr=Nr,oe=Lr;function se(r,e=0){return[oe.decode(r,e),oe.decode.bytes]}function X(r,e,t=0){return oe.encode(r,e,t),e}function W(r){return oe.encodingLength(r)}function K(r,e){let t=e.byteLength,n=W(r),o=n+W(t),i=new Uint8Array(o+t);return X(r,i,0),X(t,i,n),i.set(e,o),new $(r,t,e,i)}function xt(r){let e=j(r),[t,n]=se(e),[o,i]=se(e.subarray(n)),f=e.subarray(n+i);if(f.byteLength!==o)throw new Error("Incorrect length");return new $(t,o,f,e)}function gt(r,e){if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&ft(r.bytes,t.bytes)}}var $=class{code;size;digest;bytes;constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var bt=0,Ur="identity",yt=j;function Mr(r){return K(bt,yt(r))}var Rr={code:bt,name:Ur,encode:yt,digest:Mr};var Re={};O(Re,{sha256:()=>_r,sha512:()=>Tr});function Me({name:r,code:e,encode:t}){return new Ue(r,e,t)}var Ue=class{name;code;encode;constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?K(this.code,t):t.then(n=>K(this.code,n))}else throw Error("Unknown type, must be binary type")}};function mt(r){return async e=>new Uint8Array(await crypto.subtle.digest(r,e))}var _r=Me({name:"sha2-256",code:18,encode:mt("SHA-256")}),Tr=Me({name:"sha2-512",code:19,encode:mt("SHA-512")});function Et(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}function k(r=0){return new Uint8Array(r)}function H(r=0){return new Uint8Array(r)}function _e(r,e){e==null&&(e=r.reduce((o,i)=>o+i.length,0));let t=H(e),n=0;for(let o of r)t.set(o,n),n+=o.length;return t}var Te={};O(Te,{base10:()=>Or});var Or=P({prefix:"9",name:"base10",alphabet:"0123456789"});var Oe={};O(Oe,{base16:()=>qr,base16upper:()=>zr});var qr=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),zr=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qe={};O(qe,{base2:()=>Fr});var Fr=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ze={};O(ze,{base256emoji:()=>Pr});var It=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Gr=It.reduce((r,e,t)=>(r[t]=e,r),[]),Vr=It.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function jr(r){return r.reduce((e,t)=>(e+=Gr[t],e),"")}function kr(r){let e=[];for(let t of r){let n=Vr[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Pr=Y({prefix:"\u{1F680}",name:"base256emoji",encode:jr,decode:kr});var Fe={};O(Fe,{base32:()=>Z,base32hex:()=>Yr,base32hexpad:()=>Wr,base32hexpadupper:()=>$r,base32hexupper:()=>Xr,base32pad:()=>Hr,base32padupper:()=>Jr,base32upper:()=>Kr,base32z:()=>Zr});var Z=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Kr=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Hr=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Jr=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Yr=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Xr=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Wr=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),$r=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Zr=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ge={};O(Ge,{base36:()=>en,base36upper:()=>tn});var en=P({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),tn=P({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ve={};O(Ve,{base64:()=>rn,base64pad:()=>nn,base64url:()=>on,base64urlpad:()=>sn});var rn=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),nn=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),on=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),sn=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var je={};O(je,{base8:()=>fn});var fn=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ke={};O(ke,{identity:()=>an});var an=Y({prefix:"\0",name:"identity",encode:r=>ct(r),decode:r=>at(r)});var ao=new TextEncoder,co=new TextDecoder;function Bt(r,e){let{bytes:t,version:n}=r;switch(n){case 0:return An(t,Pe(r),e??F.encoder);default:return ln(t,Pe(r),e??Z.encoder)}}var Ct=new WeakMap;function Pe(r){let e=Ct.get(r);if(e==null){let t=new Map;return Ct.set(r,t),t}return e}var Ae=class r{code;version;multihash;bytes;"/";constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==fe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==pn)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=K(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n!=null&&e.code===n.code&&e.version===n.version&&gt(e.multihash,n.multihash)}toString(e){return Bt(this,e)}toJSON(){return{"/":Bt(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:i,bytes:f}=t;return new r(n,o,i,f??vt(n,o,i.bytes))}else if(t[dn]===!0){let{version:n,multihash:o,code:i}=t,f=xt(o);return r.create(n,i,f)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==fe)throw new Error(`Version 0 CID must use dag-pb (code: ${fe}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let o=vt(e,t,n.bytes);return new r(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,fe,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,o=j(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=o.subarray(t.multihashSize-t.digestSize),f=new $(t.multihashCode,t.digestSize,i,o);return[t.version===0?r.createV0(f):r.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[h,I]=se(e.subarray(t));return t+=I,h},o=n(),i=fe;if(o===18?(o=0,t=0):i=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let f=t,a=n(),c=n(),w=t+c,l=w-f;return{version:o,codec:i,multihashCode:a,digestSize:c,multihashSize:l,size:w}}static parse(e,t){let[n,o]=hn(e,t),i=r.decode(o);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Pe(i).set(n,e),i}};function hn(r,e){switch(r[0]){case"Q":{let t=e??F;return[F.prefix,t.decode(`${F.prefix}${r}`)]}case F.prefix:{let t=e??F;return[F.prefix,t.decode(r)]}case Z.prefix:{let t=e??Z;return[Z.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}}function An(r,e,t){let{prefix:n}=t;if(n!==F.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let i=t.encode(r).slice(1);return e.set(n,i),i}else return o}function ln(r,e,t){let{prefix:n}=t,o=e.get(n);if(o==null){let i=t.encode(r);return e.set(n,i),i}else return o}var fe=112,pn=18;function vt(r,e,t){let n=W(r),o=n+W(e),i=new Uint8Array(o+t.byteLength);return X(r,i,0),X(e,i,n),i.set(t,o),i}var dn=Symbol.for("@ipld/js-cid/CID");var Ke={...ke,...qe,...je,...Te,...Oe,...Fe,...Ge,...De,...Ve,...ze},vo={...Re,...Le};function St(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var Qt=St("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),He=St("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=H(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),xn={utf8:Qt,"utf-8":Qt,hex:Ke.base16,latin1:He,ascii:He,binary:He,...Ke},le=xn;function pe(r,e="utf8"){let t=le[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var de=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var _o=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var To={}.toString;function Dt(r=32){if(de&&typeof de.getRandomValues=="function")return de.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function xe(r,e="utf8"){let t=le[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}function ee(r){if(isNaN(r)||r<=0)throw new J("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return Dt(r)}function z(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var ge=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.name="AbortError",this.code=t??"ABORT_ERR"}};async function Nt(r,e,t){if(e==null)return r;if(e.aborted)return Promise.reject(new ge(t?.errorMessage,t?.errorCode));let n,o=new ge(t?.errorMessage,t?.errorCode);try{return await Promise.race([r,new Promise((i,f)=>{n=()=>{f(o)},e.addEventListener("abort",n)})])}finally{n!=null&&e.removeEventListener("abort",n)}}var Je=class{readNext;haveNext;ended;nextResult;constructor(){this.ended=!1,this.readNext=z(),this.haveNext=z()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("HaveNext promise resolved but nextResult was undefined");let e=this.nextResult;return this.nextResult=void 0,this.readNext.resolve(),this.readNext=z(),e}async throw(e){return this.ended=!0,e!=null&&(this.haveNext.promise.catch(()=>{}),this.haveNext.reject(e)),{done:!0,value:void 0}}async return(){let e={done:!0,value:void 0};return await this._push(void 0),e}async push(e,t){await this._push(e,t)}async end(e,t){e!=null?await this.throw(e):await this._push(void 0,t)}async _push(e,t){if(e!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");for(;this.nextResult!=null;)await this.readNext.promise;e!=null?this.nextResult={done:!1,value:e}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=z(),await Nt(this.readNext.promise,t?.signal,t)}};function Lt(){return new Je}var Mt=Symbol.for("@achingbrain/uint8arraylist");function Ut(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let n of r){let o=t+n.byteLength;if(e<o)return{buf:n,index:e-t};t=o}throw new RangeError("index is out of bounds")}function be(r){return!!r?.[Mt]}var ae=class r{bufs;length;[Mt]=!0;constructor(...e){this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let n of e)if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.push(n);else if(be(n))t+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let n of e.reverse())if(n instanceof Uint8Array)t+=n.byteLength,this.bufs.unshift(n);else if(be(n))t+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ut(this.bufs,e);return t.buf[t.index]}set(e,t){let n=Ut(this.bufs,e);n.buf[n.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let n=0;n<e.length;n++)this.set(t+n,e[n]);else if(be(e))for(let n=0;n<e.length;n++)this.set(t+n,e.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:n,length:o}=this._subList(e,t);return _e(n,o)}subarray(e,t){let{bufs:n,length:o}=this._subList(e,t);return n.length===1?n[0]:_e(n,o)}sublist(e,t){let{bufs:n,length:o}=this._subList(e,t),i=new r;return i.length=o,i.bufs=[...n],i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:this.bufs,length:this.length};let n=[],o=0;for(let i=0;i<this.bufs.length;i++){let f=this.bufs[i],a=o,c=a+f.byteLength;if(o=c,e>=c)continue;let w=e>=a&&e<c,l=t>a&&t<=c;if(w&&l){if(e===a&&t===c){n.push(f);break}let h=e-a;n.push(f.subarray(h,h+(t-e)));break}if(w){if(e===0){n.push(f);continue}n.push(f.subarray(e-a));continue}if(l){if(t===c){n.push(f);break}n.push(f.subarray(0,t-a));break}n.push(f)}return{bufs:n,length:t-e}}indexOf(e,t=0){if(!be(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let n=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let o=n.byteLength;if(o===0)throw new TypeError("search must be at least 1 byte long");let i=256,f=new Int32Array(i);for(let h=0;h<i;h++)f[h]=-1;for(let h=0;h<o;h++)f[n[h]]=h;let a=f,c=this.byteLength-n.byteLength,w=n.byteLength-1,l;for(let h=t;h<=c;h+=l){l=0;for(let I=w;I>=0;I--){let q=this.get(h+I);if(n[I]!==q){l=Math.max(1,I-a[q]);break}}if(l===0)return h}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,t),this.write(n,e)}getInt16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,t)}setInt16(e,t,n){let o=k(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt16(0,t,n),this.write(o,e)}getInt32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,t)}setInt32(e,t,n){let o=k(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt32(0,t,n),this.write(o,e)}getBigInt64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,t)}setBigInt64(e,t,n){let o=k(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigInt64(0,t,n),this.write(o,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let n=H(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,t),this.write(n,e)}getUint16(e,t){let n=this.subarray(e,e+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,t)}setUint16(e,t,n){let o=k(2);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint16(0,t,n),this.write(o,e)}getUint32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,t)}setUint32(e,t,n){let o=k(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint32(0,t,n),this.write(o,e)}getBigUint64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,t)}setBigUint64(e,t,n){let o=k(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setBigUint64(0,t,n),this.write(o,e)}getFloat32(e,t){let n=this.subarray(e,e+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,t)}setFloat32(e,t,n){let o=k(4);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat32(0,t,n),this.write(o,e)}getFloat64(e,t){let n=this.subarray(e,e+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,t)}setFloat64(e,t,n){let o=k(8);new DataView(o.buffer,o.byteOffset,o.byteLength).setFloat64(0,t,n),this.write(o,e)}equals(e){if(e==null||!(e instanceof r)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!Et(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let n=new r;return n.bufs=e,t==null&&(t=e.reduce((o,i)=>o+i.byteLength,0)),n.length=t,n}};var ye=class extends Error{code;constructor(e,t){super(e),this.code=t}},Ye=class extends ye{type;constructor(e){super(e,"ABORT_ERR"),this.type="aborted"}};function Rt(r,e){let t=Lt();r.sink(t).catch(async f=>{await t.end(f)}),r.sink=async f=>{for await(let a of f)await t.push(a);await t.end()};let n=r.source;r.source[Symbol.iterator]!=null?n=r.source[Symbol.iterator]():r.source[Symbol.asyncIterator]!=null&&(n=r.source[Symbol.asyncIterator]());let o=new ae;return{read:async(f,a)=>{a?.signal?.throwIfAborted();let c,w=new Promise((l,h)=>{c=()=>{h(new Ye("Read aborted"))},a?.signal?.addEventListener("abort",c)});try{if(f==null){let{done:h,value:I}=await Promise.race([n.next(),w]);return h===!0?new ae:I}for(;o.byteLength<f;){let{value:h,done:I}=await Promise.race([n.next(),w]);if(I===!0)throw new ye("unexpected end of input","ERR_UNEXPECTED_EOF");o.append(h)}let l=o.sublist(0,f);return o.consume(f),l}finally{c!=null&&a?.signal?.removeEventListener("abort",c)}},write:async(f,a)=>{a?.signal?.throwIfAborted(),f instanceof Uint8Array?await t.push(f,a):await t.push(f.subarray(),a)},unwrap:()=>{if(o.byteLength>0){let f=r.source;r.source=async function*(){e?.yieldBytes===!1?yield o:yield*o,yield*f}()}return r}}}function gn(r){let[e,t]=r[Symbol.asyncIterator]!=null?[r[Symbol.asyncIterator](),Symbol.asyncIterator]:[r[Symbol.iterator](),Symbol.iterator],n=[];return{peek:()=>e.next(),push:o=>{n.push(o)},next:()=>n.length>0?{done:!1,value:n.shift()}:e.next(),[t](){return this}}}var _t=gn;function bn(r){return r[Symbol.asyncIterator]!=null}function yn(r,e){let t=0;if(bn(r))return async function*(){for await(let c of r)yield e(c,t++)}();let n=_t(r),{value:o,done:i}=n.next();if(i===!0)return function*(){}();let f=e(o,t++);if(typeof f.then=="function")return async function*(){yield await f;for await(let c of n)yield e(c,t++)}();let a=e;return function*(){yield f;for(let c of n)yield a(c,t++)}()}var Tt=yn;function Xe(){let r=z(),e=!1;return{sink:async t=>{if(e)throw new Error("already piped");e=!0,r.resolve(t)},source:async function*(){yield*await r.promise}()}}function Ot(){let r=Xe(),e=Xe();return[{source:r.source,sink:e.sink},{source:e.source,sink:r.sink}]}var we=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},te=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new we(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new we(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var We=class extends Error{type;code;constructor(e,t){super(e??"The operation was aborted"),this.type="aborted",this.code=t??"ABORT_ERR"}};function me(r={}){return wn(t=>{let n=t.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},r)}function wn(r,e){e=e??{};let t=e.onEnd,n=new te,o,i,f,a=z(),c=async()=>{try{return n.isEmpty()?f?{done:!0}:await new Promise((u,E)=>{i=U=>{i=null,n.push(U);try{u(r(n))}catch(N){E(N)}return o}}):r(n)}finally{n.isEmpty()&&queueMicrotask(()=>{a.resolve(),a=z()})}},w=u=>i!=null?i(u):(n.push(u),o),l=u=>(n=new te,i!=null?i({error:u}):(n.push({error:u}),o)),h=u=>{if(f)return o;if(e?.objectMode!==!0&&u?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return w({done:!1,value:u})},I=u=>f?o:(f=!0,u!=null?l(u):w({done:!0})),q=()=>(n=new te,I(),{done:!0}),p=u=>(I(u),{done:!0});if(o={[Symbol.asyncIterator](){return this},next:c,return:q,throw:p,push:h,end:I,get readableLength(){return n.size},onEmpty:async u=>{let E=u?.signal;if(E?.throwIfAborted(),n.isEmpty())return;let U,N;E!=null&&(U=new Promise((A,d)=>{N=()=>{d(new We)},E.addEventListener("abort",N)}));try{await Promise.race([a.promise,U])}finally{N!=null&&E!=null&&E?.removeEventListener("abort",N)}}},t==null)return o;let m=o;return o={[Symbol.asyncIterator](){return this},next(){return m.next()},throw(u){return m.throw(u),t!=null&&(t(u),t=void 0),{done:!0}},return(){return m.return(),t!=null&&(t(),t=void 0),{done:!0}},push:h,end(u){return m.end(u),t!=null&&(t(u),t=void 0),o},get readableLength(){return m.readableLength},onEmpty:u=>m.onEmpty(u)},o}function mn(r){return r[Symbol.asyncIterator]!=null}function En(...r){let e=[];for(let t of r)mn(t)||e.push(t);return e.length===r.length?function*(){for(let t of e)yield*t}():async function*(){let t=me({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async n=>{for await(let o of n)t.push(o)})),t.end()}catch(n){t.end(n)}}),yield*t}()}var qt=En;function zt(r,...e){if(r==null)throw new Error("Empty pipeline");if($e(r)){let n=r;r=()=>n.source}else if(Gt(r)||Ft(r)){let n=r;r=()=>n}let t=[r,...e];if(t.length>1&&$e(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let n=1;n<t.length-1;n++)$e(t[n])&&(t[n]=Bn(t[n]));return In(...t)}var In=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},Ft=r=>r?.[Symbol.asyncIterator]!=null,Gt=r=>r?.[Symbol.iterator]!=null,$e=r=>r==null?!1:r.sink!=null&&r.source!=null,Bn=r=>e=>{let t=r.sink(e);if(t?.then!=null){let n=me({objectMode:!0});t.then(()=>{n.end()},f=>{n.end(f)});let o,i=r.source;if(Ft(i))o=async function*(){yield*i,n.end()};else if(Gt(i))o=function*(){yield*i,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return qt(n,o())}return r.source};var nt=ir(Ht(),1);var et="Your private shared key is invalid";var Jt="No connection for the handshake provided";var Yt="ERR_INVALID_PARAMETERS";function Wt(r){let e=xe(ee(rt),"base16"),t=pe(`/key/swarm/psk/1.0.0/
16
3
  /base16/
17
- `+t);e instanceof Uint8Array?e.set(r):e.write(r)}var Ca=24,Ia=32;function af(e,t){let r=(0,Ta.default)(e,t);return n=>async function*(){for await(let i of n)yield Uint8Array.from(r.update(i.subarray()))}()}function of(e,t){return r=>async function*(){let n=(0,Ta.default)(e,t);for await(let i of r)yield Uint8Array.from(n.update(i.subarray()))}()}function sf(e){try{let t=en(e).split(/(?:\r\n|\r|\n)/g),r=t.shift(),n=t.shift(),i=t.shift(),a=jr(i??"","base16");if(a.byteLength!==Ia)throw new Error(Ba);return{tag:r,codecName:n,psk:a}}catch{throw new Error(Ba)}}var _a=class{tag;log;psk;timeout;constructor(t,r){this.log=t.logger.forComponent("libp2p:pnet"),this.timeout=r.timeout??1e3;let n=sf(r.psk);this.psk=n.psk,this.tag=n.tag??""}async protect(t){if(t==null)throw new le(ef,tf);this.log("protecting the connection");let r=Ze(Ca),n=AbortSignal.timeout(this.timeout),i=m0(t),[,a]=await Promise.all([i.write(r,{signal:n}),i.read(Ca,{signal:n})]),o=a.subarray();this.log("exchanged nonces");let[s,f]=A0();return E0(f,af(r,this.psk),i.unwrap(),c=>b0(c,u=>u.subarray()),of(o,this.psk),f).catch(this.log.error),{...t,...s}}};function Ey(e){return t=>new _a(t,e)}return pf(Sy);})();
4
+ `+e);r instanceof Uint8Array?r.set(t):r.write(t)}var tt=24,rt=32;function $t(r,e){let t=(0,nt.default)(r,e);return n=>async function*(){for await(let o of n)yield Uint8Array.from(t.update(o.subarray()))}()}function Zt(r,e){return t=>async function*(){let n=(0,nt.default)(r,e);for await(let o of t)yield Uint8Array.from(n.update(o.subarray()))}()}function er(r){try{let e=xe(r).split(/(?:\r\n|\r|\n)/g),t=e.shift(),n=e.shift(),o=e.shift(),i=pe(o??"","base16");if(i.byteLength!==rt)throw new Error(et);return{tag:t,codecName:n,psk:i}}catch{throw new Error(et)}}var ot=class{tag;log;psk;timeout;constructor(e,t){this.log=e.logger.forComponent("libp2p:pnet"),this.timeout=t.timeout??1e3;let n=er(t.psk);this.psk=n.psk,this.tag=n.tag??""}async protect(e){if(e==null)throw new J(Jt,Yt);this.log("protecting the connection");let t=ee(tt),n=AbortSignal.timeout(this.timeout),o=Rt(e),[,i]=await Promise.all([o.write(t,{signal:n}),o.read(tt,{signal:n})]),f=i.subarray();this.log("exchanged nonces");let[a,c]=Ot();return zt(c,$t(t,this.psk),o.unwrap(),w=>Tt(w,l=>l.subarray()),Zt(f,this.psk),c).catch(this.log.error),{...e,...a}}};function Nn(r){return e=>new ot(e,r)}return fr(Ln);})();
18
5
  /*! Bundled license information:
19
6
 
20
7
  @noble/hashes/esm/utils.js:
@@ -45,7 +45,7 @@
45
45
  *
46
46
  * ### Programmatically
47
47
  *
48
- * ```js
48
+ * ```TypeScript
49
49
  * import fs from 'fs'
50
50
  * import { generateKey } from '@libp2p/pnet'
51
51
  *
package/dist/src/index.js CHANGED
@@ -45,7 +45,7 @@
45
45
  *
46
46
  * ### Programmatically
47
47
  *
48
- * ```js
48
+ * ```TypeScript
49
49
  * import fs from 'fs'
50
50
  * import { generateKey } from '@libp2p/pnet'
51
51
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/pnet",
3
- "version": "1.0.0-5d1f68e92",
3
+ "version": "1.0.0-62e32252a",
4
4
  "description": "Implementation of Connection protection management via a shared secret",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pnet#readme",
@@ -46,27 +46,29 @@
46
46
  "test:firefox": "aegir test -t browser -- --browser firefox",
47
47
  "test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
48
48
  "test:node": "aegir test -t node --cov",
49
- "dep-check": "aegir dep-check"
49
+ "dep-check": "aegir dep-check",
50
+ "doc-check": "aegir doc-check"
50
51
  },
51
52
  "dependencies": {
52
- "@libp2p/crypto": "3.0.2-5d1f68e92",
53
- "@libp2p/interface": "1.0.2-5d1f68e92",
54
- "it-byte-stream": "^1.0.5",
55
- "it-map": "^3.0.4",
53
+ "@libp2p/crypto": "4.1.2-62e32252a",
54
+ "@libp2p/interface": "1.4.0-62e32252a",
55
+ "it-byte-stream": "^1.0.10",
56
+ "it-map": "^3.1.0",
56
57
  "it-pair": "^2.0.6",
57
58
  "it-pipe": "^3.0.1",
58
59
  "it-stream-types": "^2.0.1",
59
- "uint8arraylist": "^2.4.7",
60
- "uint8arrays": "^5.0.0",
61
- "xsalsa20": "^1.1.0"
60
+ "uint8arraylist": "^2.4.8",
61
+ "uint8arrays": "^5.1.0",
62
+ "xsalsa20": "^1.2.0"
62
63
  },
63
64
  "devDependencies": {
64
- "@libp2p/interface-compliance-tests": "5.0.8-5d1f68e92",
65
- "@libp2p/logger": "4.0.2-5d1f68e92",
66
- "@libp2p/peer-id-factory": "4.0.1-5d1f68e92",
67
- "@multiformats/multiaddr": "^12.1.10",
68
- "@types/xsalsa20": "^1.1.0",
69
- "aegir": "^41.0.2",
70
- "it-all": "^3.0.3"
71
- }
65
+ "@libp2p/interface-compliance-tests": "5.4.5-62e32252a",
66
+ "@libp2p/logger": "4.0.13-62e32252a",
67
+ "@libp2p/peer-id-factory": "4.1.2-62e32252a",
68
+ "@multiformats/multiaddr": "^12.2.3",
69
+ "@types/xsalsa20": "^1.1.3",
70
+ "aegir": "^43.0.1",
71
+ "it-all": "^3.0.6"
72
+ },
73
+ "sideEffects": false
72
74
  }
package/src/index.ts CHANGED
@@ -45,7 +45,7 @@
45
45
  *
46
46
  * ### Programmatically
47
47
  *
48
- * ```js
48
+ * ```TypeScript
49
49
  * import fs from 'fs'
50
50
  * import { generateKey } from '@libp2p/pnet'
51
51
  *