(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Ipfs = factory()}(typeof self !== 'undefined' ? self : this, function () { var Ipfs=(()=>{var bbe=Object.create;var O3=Object.defineProperty;var vbe=Object.getOwnPropertyDescriptor;var wbe=Object.getOwnPropertyNames;var _be=Object.getPrototypeOf,Ebe=Object.prototype.hasOwnProperty;var XO=t=>O3(t,"__esModule",{value:!0});var Ea=typeof require!="undefined"?require:t=>{throw new Error('Dynamic require of "'+t+'" is not supported')};var bt=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zt=(t,e)=>{XO(t);for(var r in e)O3(t,r,{get:e[r],enumerable:!0})},Sbe=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wbe(e))!Ebe.call(t,i)&&i!=="default"&&O3(t,i,{get:()=>e[i],enumerable:!(r=vbe(e,i))||r.enumerable});return t},M=t=>Sbe(XO(O3(t!=null?bbe(_be(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var JO=m(k3=>{l();"use strict";k3.byteLength=Abe;k3.toByteArray=Tbe;k3.fromByteArray=Cbe;var Sa=[],qs=[],xbe=typeof Uint8Array!="undefined"?Uint8Array:Array,iw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(El=0,QO=iw.length;El0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function Abe(t){var e=ZO(t),r=e[0],i=e[1];return(r+i)*3/4-i}function Ibe(t,e,r){return(e+r)*3/4-r}function Tbe(t){var e,r=ZO(t),i=r[0],n=r[1],s=new xbe(Ibe(t,i,n)),o=0,a=n>0?i-4:i,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return n===2&&(e=qs[t.charCodeAt(c)]<<2|qs[t.charCodeAt(c+1)]>>4,s[o++]=e&255),n===1&&(e=qs[t.charCodeAt(c)]<<10|qs[t.charCodeAt(c+1)]<<4|qs[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Rbe(t){return Sa[t>>18&63]+Sa[t>>12&63]+Sa[t>>6&63]+Sa[t&63]}function Pbe(t,e,r){for(var i,n=[],s=e;sa?a:o+s));return i===1?(e=t[r-1],n.push(Sa[e>>2]+Sa[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Sa[e>>10]+Sa[e>>4&63]+Sa[e<<2&63]+"=")),n.join("")}});var ek=m(nw=>{l();nw.read=function(t,e,r,i,n){var s,o,a=n*8-i-1,c=(1<>1,f=-7,d=r?n-1:0,h=r?-1:1,p=t[e+d];for(d+=h,s=p&(1<<-f)-1,p>>=-f,f+=a;f>0;s=s*256+t[e+d],d+=h,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+d],d+=h,f-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-u}return(p?-1:1)*o*Math.pow(2,s-i)};nw.write=function(t,e,r,i,n,s){var o,a,c,u=s*8-n-1,f=(1<>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,y=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=h/c:e+=h*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=f?(a=0,o=f):o+d>=1?(a=(e*c-1)*Math.pow(2,n),o=o+d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=a&255,p+=y,a/=256,n-=8);for(o=o<0;t[r+p]=o&255,p+=y,o/=256,u-=8);t[r+p-y]|=b*128}});var Ht=m(Bh=>{l();"use strict";var sw=JO(),Oh=ek(),tk=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Bh.Buffer=pe;Bh.SlowBuffer=Mbe;Bh.INSPECT_MAX_BYTES=50;var D3=2147483647;Bh.kMaxLength=D3;pe.TYPED_ARRAY_SUPPORT=Obe();!pe.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Obe(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(pe.prototype,"parent",{enumerable:!0,get:function(){if(!!pe.isBuffer(this))return this.buffer}});Object.defineProperty(pe.prototype,"offset",{enumerable:!0,get:function(){if(!!pe.isBuffer(this))return this.byteOffset}});function Uc(t){if(t>D3)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,pe.prototype),e}function pe(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ow(t)}return rk(t,e,r)}pe.poolSize=8192;function rk(t,e,r){if(typeof t=="string")return Dbe(t,e);if(ArrayBuffer.isView(t))return Bbe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(xa(t,ArrayBuffer)||t&&xa(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(xa(t,SharedArrayBuffer)||t&&xa(t.buffer,SharedArrayBuffer)))return cw(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return pe.from(i,e,r);let n=Nbe(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return pe.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}pe.from=function(t,e,r){return rk(t,e,r)};Object.setPrototypeOf(pe.prototype,Uint8Array.prototype);Object.setPrototypeOf(pe,Uint8Array);function ik(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function kbe(t,e,r){return ik(t),t<=0?Uc(t):e!==void 0?typeof r=="string"?Uc(t).fill(e,r):Uc(t).fill(e):Uc(t)}pe.alloc=function(t,e,r){return kbe(t,e,r)};function ow(t){return ik(t),Uc(t<0?0:uw(t)|0)}pe.allocUnsafe=function(t){return ow(t)};pe.allocUnsafeSlow=function(t){return ow(t)};function Dbe(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!pe.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=nk(t,e)|0,i=Uc(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function aw(t){let e=t.length<0?0:uw(t.length)|0,r=Uc(e);for(let i=0;i=D3)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D3.toString(16)+" bytes");return t|0}function Mbe(t){return+t!=t&&(t=0),pe.alloc(+t)}pe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==pe.prototype};pe.compare=function(e,r){if(xa(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),xa(r,Uint8Array)&&(r=pe.from(r,r.offset,r.byteLength)),!pe.isBuffer(e)||!pe.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,o=Math.min(i,n);sn.length?(pe.isBuffer(o)||(o=pe.from(o)),o.copy(n,s)):Uint8Array.prototype.set.call(n,o,s);else if(pe.isBuffer(o))o.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return n};function nk(t,e){if(pe.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||xa(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return lw(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gk(t).length;default:if(n)return i?-1:lw(t).length;e=(""+e).toLowerCase(),n=!0}}pe.byteLength=nk;function Lbe(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return $be(this,e,r);case"utf8":case"utf-8":return ak(this,e,r);case"ascii":return Hbe(this,e,r);case"latin1":case"binary":return Gbe(this,e,r);case"base64":return Vbe(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wbe(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}pe.prototype._isBuffer=!0;function Sl(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}pe.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};tk&&(pe.prototype[tk]=pe.prototype.inspect);pe.prototype.compare=function(e,r,i,n,s){if(xa(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),!pe.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let o=s-n,a=i-r,c=Math.min(o,a),u=this.slice(n,s),f=e.slice(r,i);for(let d=0;d2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,dw(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=pe.from(e,i)),pe.isBuffer(e))return e.length===0?-1:ok(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ok(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function ok(t,e,r,i,n){let s=1,o=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function c(f,d){return s===1?f[d]:f.readUInt16BE(d*s)}let u;if(n){let f=-1;for(u=r;uo&&(r=o-a),u=r;u>=0;u--){let f=!0;for(let d=0;dn&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return qbe(this,e,r,i);case"utf8":case"utf-8":return jbe(this,e,r,i);case"ascii":case"latin1":case"binary":return Ube(this,e,r,i);case"base64":return Fbe(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kbe(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};pe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Vbe(t,e,r){return e===0&&r===t.length?sw.fromByteArray(t):sw.fromByteArray(t.slice(e,r))}function ak(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:s>223?3:s>191?2:1;if(n+a<=r){let c,u,f,d;switch(a){case 1:s<128&&(o=s);break;case 2:c=t[n+1],(c&192)==128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=t[n+1],u=t[n+2],(c&192)==128&&(u&192)==128&&(d=(s&15)<<12|(c&63)<<6|u&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=t[n+1],u=t[n+2],f=t[n+3],(c&192)==128&&(u&192)==128&&(f&192)==128&&(d=(s&15)<<18|(c&63)<<12|(u&63)<<6|f&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=a}return zbe(i)}var ck=4096;function zbe(t){let e=t.length;if(e<=ck)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let s=e;si&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}pe.prototype.readUintLE=pe.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Fi(e,r,this.length);let n=this[e],s=1,o=0;for(;++o>>0,r=r>>>0,i||Fi(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};pe.prototype.readUint8=pe.prototype.readUInt8=function(e,r){return e=e>>>0,r||Fi(e,1,this.length),this[e]};pe.prototype.readUint16LE=pe.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Fi(e,2,this.length),this[e]|this[e+1]<<8};pe.prototype.readUint16BE=pe.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Fi(e,2,this.length),this[e]<<8|this[e+1]};pe.prototype.readUint32LE=pe.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Fi(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};pe.prototype.readUint32BE=pe.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Fi(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};pe.prototype.readBigUInt64LE=Vu(function(e){e=e>>>0,Dh(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&T2(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<>>0,Dh(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&T2(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||Fi(e,r,this.length);let n=this[e],s=1,o=0;for(;++o=s&&(n-=Math.pow(2,8*r)),n};pe.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Fi(e,r,this.length);let n=r,s=1,o=this[e+--n];for(;n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};pe.prototype.readInt8=function(e,r){return e=e>>>0,r||Fi(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};pe.prototype.readInt16LE=function(e,r){e=e>>>0,r||Fi(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};pe.prototype.readInt16BE=function(e,r){e=e>>>0,r||Fi(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};pe.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Fi(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};pe.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Fi(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};pe.prototype.readBigInt64LE=Vu(function(e){e=e>>>0,Dh(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&T2(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,Dh(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&T2(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||Fi(e,4,this.length),Oh.read(this,e,!0,23,4)};pe.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Fi(e,4,this.length),Oh.read(this,e,!1,23,4)};pe.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Fi(e,8,this.length),Oh.read(this,e,!0,52,8)};pe.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Fi(e,8,this.length),Oh.read(this,e,!1,52,8)};function Wn(t,e,r,i,n,s){if(!pe.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}pe.prototype.writeUintLE=pe.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;Wn(this,e,r,i,a,0)}let s=1,o=0;for(this[r]=e&255;++o>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;Wn(this,e,r,i,a,0)}let s=i-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+i};pe.prototype.writeUint8=pe.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,1,255,0),this[r]=e&255,r+1};pe.prototype.writeUint16LE=pe.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};pe.prototype.writeUint16BE=pe.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};pe.prototype.writeUint32LE=pe.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};pe.prototype.writeUint32BE=pe.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function uk(t,e,r,i,n){yk(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function fk(t,e,r,i,n){yk(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}pe.prototype.writeBigUInt64LE=Vu(function(e,r=0){return uk(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});pe.prototype.writeBigUInt64BE=Vu(function(e,r=0){return fk(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});pe.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let c=Math.pow(2,8*i-1);Wn(this,e,r,i,c-1,-c)}let s=0,o=1,a=0;for(this[r]=e&255;++s>0)-a&255;return r+i};pe.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let c=Math.pow(2,8*i-1);Wn(this,e,r,i,c-1,-c)}let s=i-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};pe.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};pe.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};pe.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};pe.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};pe.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Wn(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};pe.prototype.writeBigInt64LE=Vu(function(e,r=0){return uk(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});pe.prototype.writeBigInt64BE=Vu(function(e,r=0){return fk(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function lk(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dk(t,e,r,i,n){return e=+e,r=r>>>0,n||lk(t,e,r,4,34028234663852886e22,-34028234663852886e22),Oh.write(t,e,r,i,23,4),r+4}pe.prototype.writeFloatLE=function(e,r,i){return dk(this,e,r,!0,i)};pe.prototype.writeFloatBE=function(e,r,i){return dk(this,e,r,!1,i)};function hk(t,e,r,i,n){return e=+e,r=r>>>0,n||lk(t,e,r,8,17976931348623157e292,-17976931348623157e292),Oh.write(t,e,r,i,52,8),r+8}pe.prototype.writeDoubleLE=function(e,r,i){return hk(this,e,r,!0,i)};pe.prototype.writeDoubleBE=function(e,r,i){return hk(this,e,r,!1,i)};pe.prototype.copy=function(e,r,i,n){if(!pe.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?n=pk(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=pk(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function pk(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Ybe(t,e,r){Dh(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&T2(e,t.length-(r+1))}function yk(t,e,r,i,n,s){if(t>r||t3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new kh.ERR_OUT_OF_RANGE("value",a,t)}Ybe(i,n,s)}function Dh(t,e){if(typeof t!="number")throw new kh.ERR_INVALID_ARG_TYPE(e,"number",t)}function T2(t,e,r){throw Math.floor(t)!==t?(Dh(t,r),new kh.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new kh.ERR_BUFFER_OUT_OF_BOUNDS:new kh.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Xbe=/[^+/0-9A-Za-z-_]/g;function Qbe(t){if(t=t.split("=")[0],t=t.trim().replace(Xbe,""),t.length<2)return"";for(;t.length%4!=0;)t=t+"=";return t}function lw(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Zbe(t){let e=[];for(let r=0;r>8,n=r%256,s.push(n),s.push(i);return s}function gk(t){return sw.toByteArray(Qbe(t))}function B3(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function xa(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function dw(t){return t!==t}var e5e=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function Vu(t){return typeof BigInt=="undefined"?t5e:t}function t5e(){throw new Error("BigInt not supported")}});var _k=m((dtt,wk)=>{l();var ui=wk.exports={},Aa,Ia;function hw(){throw new Error("setTimeout has not been defined")}function pw(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Aa=setTimeout:Aa=hw}catch(t){Aa=hw}try{typeof clearTimeout=="function"?Ia=clearTimeout:Ia=pw}catch(t){Ia=pw}})();function mk(t){if(Aa===setTimeout)return setTimeout(t,0);if((Aa===hw||!Aa)&&setTimeout)return Aa=setTimeout,setTimeout(t,0);try{return Aa(t,0)}catch(e){try{return Aa.call(null,t,0)}catch(r){return Aa.call(this,t,0)}}}function r5e(t){if(Ia===clearTimeout)return clearTimeout(t);if((Ia===pw||!Ia)&&clearTimeout)return Ia=clearTimeout,clearTimeout(t);try{return Ia(t)}catch(e){try{return Ia.call(null,t)}catch(r){return Ia.call(this,t)}}}var Fc=[],Nh=!1,xl,N3=-1;function i5e(){!Nh||!xl||(Nh=!1,xl.length?Fc=xl.concat(Fc):N3=-1,Fc.length&&bk())}function bk(){if(!Nh){var t=mk(i5e);Nh=!0;for(var e=Fc.length;e;){for(xl=Fc,Fc=[];++N31)for(var r=1;r{({Buffer}=Ht()),process=_k()});var Sk=m((ptt,Ek)=>{l();"use strict";Ek.exports=t=>{if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}});var Al=m((Tk,Rk)=>{l();"use strict";var M3=Sk(),{hasOwnProperty:xk}=Object.prototype,{propertyIsEnumerable:n5e}=Object,Mh=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),s5e=Tk,Ak={concatArrays:!1,ignoreUndefined:!1},L3=t=>{let e=[];for(let r in t)xk.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){let r=Object.getOwnPropertySymbols(t);for(let i of r)n5e.call(t,i)&&e.push(i)}return e};function Lh(t){return Array.isArray(t)?o5e(t):M3(t)?a5e(t):t}function o5e(t){let e=t.slice(0,0);return L3(t).forEach(r=>{Mh(e,r,Lh(t[r]))}),e}function a5e(t){let e=Object.getPrototypeOf(t)===null?Object.create(null):{};return L3(t).forEach(r=>{Mh(e,r,Lh(t[r]))}),e}var Ik=(t,e,r,i)=>(r.forEach(n=>{typeof e[n]=="undefined"&&i.ignoreUndefined||(n in t&&t[n]!==Object.getPrototypeOf(t)?Mh(t,n,yw(t[n],e[n],i)):Mh(t,n,Lh(e[n])))}),t),c5e=(t,e,r)=>{let i=t.slice(0,0),n=0;return[t,e].forEach(s=>{let o=[];for(let a=0;a!o.includes(a)),r)}),i};function yw(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?c5e(t,e,r):!M3(e)||!M3(t)?Lh(e):Ik(t,e,L3(e),r)}Rk.exports=function(...t){let e=yw(Lh(Ak),this!==s5e&&this||{},Ak),r={_:{}};for(let i of t)if(i!==void 0){if(!M3(i))throw new TypeError("`"+i+"` is not an Option Object");r=yw(r,{_:i},e)}return r._}});var gw=m((gtt,Ck)=>{l();function u5e(){return typeof window!="undefined"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process!="undefined"&&typeof process.versions=="object"&&!!process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0}Ck.exports=u5e});var P2=m((mtt,Ok)=>{l();"use strict";var f5e=gw(),q3=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,R2=f5e(),l5e=q3&&!R2,d5e=R2&&!q3,h5e=R2&&q3,p5e=typeof Ea=="function"&&typeof process!="undefined"&&typeof process.release!="undefined"&&process.release.name==="node"&&!R2,y5e=typeof importScripts=="function"&&typeof self!="undefined"&&typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,g5e=typeof process!="undefined"&&typeof process.env!="undefined"&&!1,m5e=typeof navigator!="undefined"&&navigator.product==="ReactNative";Ok.exports={isTest:g5e,isElectron:R2,isElectronMain:d5e,isElectronRenderer:h5e,isNode:p5e,isBrowser:l5e,isWebWorker:y5e,isEnvWithDom:q3,isReactNative:m5e}});var mw=m((btt,kk)=>{l();var qh=1e3,jh=qh*60,Uh=jh*60,Il=Uh*24,b5e=Il*7,v5e=Il*365.25;kk.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return w5e(t);if(r==="number"&&isFinite(t))return e.long?E5e(t):_5e(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function w5e(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*v5e;case"weeks":case"week":case"w":return r*b5e;case"days":case"day":case"d":return r*Il;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Uh;case"minutes":case"minute":case"mins":case"min":case"m":return r*jh;case"seconds":case"second":case"secs":case"sec":case"s":return r*qh;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function _5e(t){var e=Math.abs(t);return e>=Il?Math.round(t/Il)+"d":e>=Uh?Math.round(t/Uh)+"h":e>=jh?Math.round(t/jh)+"m":e>=qh?Math.round(t/qh)+"s":t+"ms"}function E5e(t){var e=Math.abs(t);return e>=Il?j3(t,e,Il,"day"):e>=Uh?j3(t,e,Uh,"hour"):e>=jh?j3(t,e,jh,"minute"):e>=qh?j3(t,e,qh,"second"):t+" ms"}function j3(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var Bk=m((vtt,Dk)=>{l();function S5e(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=n,r.enabled=o,r.humanize=mw(),r.destroy=u,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let d=0;for(let h=0;h{if(B==="%%")return"%";F++;let W=r.formatters[H];if(typeof W=="function"){let X=E[F];B=W.call(v,X),E.splice(F,1),F--}return B}),r.formatArgs.call(v,E),(v.log||r.log).apply(v,E)}return b.namespace=f,b.useColors=r.useColors(),b.color=r.selectColor(f),b.extend=i,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,y=r.enabled(f)),y),set:E=>{h=E}}),typeof r.init=="function"&&r.init(b),b}function i(f,d){let h=r(this.namespace+(typeof d=="undefined"?":":d)+f);return h.log=this.log,h}function n(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d,h=(typeof f=="string"?f:"").split(/[\s,]+/),p=h.length;for(d=0;d"-"+d)].join(",");return r.enable(""),f}function o(f){if(f[f.length-1]==="*")return!0;let d,h;for(d=0,h=r.skips.length;d{l();gs.formatArgs=A5e;gs.save=I5e;gs.load=T5e;gs.useColors=x5e;gs.storage=R5e();gs.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();gs.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function x5e(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function A5e(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+U3.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}gs.log=console.debug||console.log||(()=>{});function I5e(t){try{t?gs.storage.setItem("debug",t):gs.storage.removeItem("debug")}catch(e){}}function T5e(){let t;try{t=gs.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function R5e(){try{return localStorage}catch(t){}}U3.exports=Bk()(gs);var{formatters:P5e}=U3.exports;P5e.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Rt=m((wtt,Mk)=>{l();"use strict";function Nk(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function C5e(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Nk(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),Nk(new n,r)}}Mk.exports=C5e});var jk=m((_tt,qk)=>{l();"use strict";function Lk(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function O5e(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Lk(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),Lk(new n,r)}}qk.exports=O5e});var Fk=m((Ett,Uk)=>{l();"use strict";Uk.exports=k5e;function k5e(t,e){for(var r=new Array(arguments.length-1),i=0,n=2,s=!0;n{l();"use strict";var F3=zk;F3.length=function(e){var r=e.length;if(!r)return 0;for(var i=0;--r%4>1&&e.charAt(r)==="=";)++i;return Math.ceil(e.length*3)/4-i};var Fh=new Array(64),Kk=new Array(123);for(No=0;No<64;)Kk[Fh[No]=No<26?No+65:No<52?No+71:No<62?No-4:No-59|43]=No++;var No;F3.encode=function(e,r,i){for(var n=null,s=[],o=0,a=0,c;r>2],c=(u&3)<<4,a=1;break;case 1:s[o++]=Fh[c|u>>4],c=(u&15)<<2,a=2;break;case 2:s[o++]=Fh[c|u>>6],s[o++]=Fh[u&63],a=0;break}o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=Fh[c],s[o++]=61,a===1&&(s[o++]=61)),n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var Vk="invalid encoding";F3.decode=function(e,r,i){for(var n=i,s=0,o,a=0;a1)break;if((c=Kk[c])===void 0)throw Error(Vk);switch(s){case 0:o=c,s=1;break;case 1:r[i++]=o<<2|(c&48)>>4,o=c,s=2;break;case 2:r[i++]=(o&15)<<4|(c&60)>>2,o=c,s=3;break;case 3:r[i++]=(o&3)<<6|c,s=0;break}}if(s===1)throw Error(Vk);return i-n};F3.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var $k=m((xtt,Gk)=>{l();"use strict";Gk.exports=K3;function K3(){this._listeners={}}K3.prototype.on=function(e,r,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:i||this}),this};K3.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var i=this._listeners[e],n=0;n{l();"use strict";Jk.exports=Wk(Wk);function Wk(t){return typeof Float32Array!="undefined"?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),i=r[3]===128;function n(c,u,f){e[0]=c,u[f]=r[0],u[f+1]=r[1],u[f+2]=r[2],u[f+3]=r[3]}function s(c,u,f){e[0]=c,u[f]=r[3],u[f+1]=r[2],u[f+2]=r[1],u[f+3]=r[0]}t.writeFloatLE=i?n:s,t.writeFloatBE=i?s:n;function o(c,u){return r[0]=c[u],r[1]=c[u+1],r[2]=c[u+2],r[3]=c[u+3],e[0]}function a(c,u){return r[3]=c[u],r[2]=c[u+1],r[1]=c[u+2],r[0]=c[u+3],e[0]}t.readFloatLE=i?o:a,t.readFloatBE=i?a:o}():function(){function e(i,n,s,o){var a=n<0?1:0;if(a&&(n=-n),n===0)i(1/n>0?0:2147483648,s,o);else if(isNaN(n))i(2143289344,s,o);else if(n>34028234663852886e22)i((a<<31|2139095040)>>>0,s,o);else if(n<11754943508222875e-54)i((a<<31|Math.round(n/1401298464324817e-60))>>>0,s,o);else{var c=Math.floor(Math.log(n)/Math.LN2),u=Math.round(n*Math.pow(2,-c)*8388608)&8388607;i((a<<31|c+127<<23|u)>>>0,s,o)}}t.writeFloatLE=e.bind(null,Yk),t.writeFloatBE=e.bind(null,Xk);function r(i,n,s){var o=i(n,s),a=(o>>31)*2+1,c=o>>>23&255,u=o&8388607;return c===255?u?NaN:a*(1/0):c===0?a*1401298464324817e-60*u:a*Math.pow(2,c-150)*(u+8388608)}t.readFloatLE=r.bind(null,Qk),t.readFloatBE=r.bind(null,Zk)}(),typeof Float64Array!="undefined"?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),i=r[7]===128;function n(c,u,f){e[0]=c,u[f]=r[0],u[f+1]=r[1],u[f+2]=r[2],u[f+3]=r[3],u[f+4]=r[4],u[f+5]=r[5],u[f+6]=r[6],u[f+7]=r[7]}function s(c,u,f){e[0]=c,u[f]=r[7],u[f+1]=r[6],u[f+2]=r[5],u[f+3]=r[4],u[f+4]=r[3],u[f+5]=r[2],u[f+6]=r[1],u[f+7]=r[0]}t.writeDoubleLE=i?n:s,t.writeDoubleBE=i?s:n;function o(c,u){return r[0]=c[u],r[1]=c[u+1],r[2]=c[u+2],r[3]=c[u+3],r[4]=c[u+4],r[5]=c[u+5],r[6]=c[u+6],r[7]=c[u+7],e[0]}function a(c,u){return r[7]=c[u],r[6]=c[u+1],r[5]=c[u+2],r[4]=c[u+3],r[3]=c[u+4],r[2]=c[u+5],r[1]=c[u+6],r[0]=c[u+7],e[0]}t.readDoubleLE=i?o:a,t.readDoubleBE=i?a:o}():function(){function e(i,n,s,o,a,c){var u=o<0?1:0;if(u&&(o=-o),o===0)i(0,a,c+n),i(1/o>0?0:2147483648,a,c+s);else if(isNaN(o))i(0,a,c+n),i(2146959360,a,c+s);else if(o>17976931348623157e292)i(0,a,c+n),i((u<<31|2146435072)>>>0,a,c+s);else{var f;if(o<22250738585072014e-324)f=o/5e-324,i(f>>>0,a,c+n),i((u<<31|f/4294967296)>>>0,a,c+s);else{var d=Math.floor(Math.log(o)/Math.LN2);d===1024&&(d=1023),f=o*Math.pow(2,-d),i(f*4503599627370496>>>0,a,c+n),i((u<<31|d+1023<<20|f*1048576&1048575)>>>0,a,c+s)}}}t.writeDoubleLE=e.bind(null,Yk,0,4),t.writeDoubleBE=e.bind(null,Xk,4,0);function r(i,n,s,o,a){var c=i(o,a+n),u=i(o,a+s),f=(u>>31)*2+1,d=u>>>20&2047,h=4294967296*(u&1048575)+c;return d===2047?h?NaN:f*(1/0):d===0?f*5e-324*h:f*Math.pow(2,d-1075)*(h+4503599627370496)}t.readDoubleLE=r.bind(null,Qk,0,4),t.readDoubleBE=r.bind(null,Zk,4,0)}(),t}function Yk(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Xk(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function Qk(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function Zk(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var tD=m((exports,module)=>{l();"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}});var iD=m(rD=>{l();"use strict";var bw=rD;bw.length=function(e){for(var r=0,i=0,n=0;n191&&c<224?o[a++]=(c&31)<<6|e[r++]&63:c>239&&c<365?(c=((c&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,o[a++]=55296+(c>>10),o[a++]=56320+(c&1023)):o[a++]=(c&15)<<12|(e[r++]&63)<<6|e[r++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};bw.write=function(e,r,i){for(var n=i,s,o,a=0;a>6|192,r[i++]=s&63|128):(s&64512)==55296&&((o=e.charCodeAt(a+1))&64512)==56320?(s=65536+((s&1023)<<10)+(o&1023),++a,r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128);return i-n}});var sD=m((Ttt,nD)=>{l();"use strict";nD.exports=D5e;function D5e(t,e,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(c){if(c<1||c>n)return t(c);o+c>i&&(s=t(i),o=0);var u=e.call(s,o,o+=c);return o&7&&(o=(o|7)+1),u}}});var aD=m((Rtt,oD)=>{l();"use strict";oD.exports=Ki;var C2=Hu();function Ki(t,e){this.lo=t>>>0,this.hi=e>>>0}var Tl=Ki.zero=new Ki(0,0);Tl.toNumber=function(){return 0};Tl.zzEncode=Tl.zzDecode=function(){return this};Tl.length=function(){return 1};var B5e=Ki.zeroHash="\0\0\0\0\0\0\0\0";Ki.fromNumber=function(e){if(e===0)return Tl;var r=e<0;r&&(e=-e);var i=e>>>0,n=(e-i)/4294967296>>>0;return r&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new Ki(i,n)};Ki.from=function(e){if(typeof e=="number")return Ki.fromNumber(e);if(C2.isString(e))if(C2.Long)e=C2.Long.fromString(e);else return Ki.fromNumber(parseInt(e,10));return e.low||e.high?new Ki(e.low>>>0,e.high>>>0):Tl};Ki.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,i=~this.hi>>>0;return r||(i=i+1>>>0),-(r+i*4294967296)}return this.lo+this.hi*4294967296};Ki.prototype.toLong=function(e){return C2.Long?new C2.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var zu=String.prototype.charCodeAt;Ki.fromHash=function(e){return e===B5e?Tl:new Ki((zu.call(e,0)|zu.call(e,1)<<8|zu.call(e,2)<<16|zu.call(e,3)<<24)>>>0,(zu.call(e,4)|zu.call(e,5)<<8|zu.call(e,6)<<16|zu.call(e,7)<<24)>>>0)};Ki.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Ki.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Ki.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Ki.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10}});var Hu=m(vw=>{l();"use strict";var $e=vw;$e.asPromise=Fk();$e.base64=Hk();$e.EventEmitter=$k();$e.float=eD();$e.inquire=tD();$e.utf8=iD();$e.pool=sD();$e.LongBits=aD();$e.isNode=Boolean(typeof globalThis!="undefined"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);$e.global=$e.isNode&&globalThis||typeof window!="undefined"&&window||typeof self!="undefined"&&self||vw;$e.emptyArray=Object.freeze?Object.freeze([]):[];$e.emptyObject=Object.freeze?Object.freeze({}):{};$e.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};$e.isString=function(e){return typeof e=="string"||e instanceof String};$e.isObject=function(e){return e&&typeof e=="object"};$e.isset=$e.isSet=function(e,r){var i=e[r];return i!=null&&e.hasOwnProperty(r)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1};$e.Buffer=function(){try{var t=$e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}();$e._Buffer_from=null;$e._Buffer_allocUnsafe=null;$e.newBuffer=function(e){return typeof e=="number"?$e.Buffer?$e._Buffer_allocUnsafe(e):new $e.Array(e):$e.Buffer?$e._Buffer_from(e):typeof Uint8Array=="undefined"?e:new Uint8Array(e)};$e.Array=typeof Uint8Array!="undefined"?Uint8Array:Array;$e.Long=$e.global.dcodeIO&&$e.global.dcodeIO.Long||$e.global.Long||$e.inquire("long");$e.key2Re=/^true|false|0|1$/;$e.key32Re=/^-?(?:0|[1-9][0-9]*)$/;$e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;$e.longToHash=function(e){return e?$e.LongBits.from(e).toHash():$e.LongBits.zeroHash};$e.longFromHash=function(e,r){var i=$e.LongBits.fromHash(e);return $e.Long?$e.Long.fromBits(i.lo,i.hi,r):i.toNumber(Boolean(r))};function cD(t,e,r){for(var i=Object.keys(e),n=0;n-1;--s)if(r[n[s]]===1&&this[n[s]]!==void 0&&this[n[s]]!==null)return n[s]}};$e.oneOfSetter=function(e){return function(r){for(var i=0;i{l();"use strict";hD.exports=jt;var js=Hu(),ww,V3=js.LongBits,fD=js.base64,lD=js.utf8;function O2(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function _w(){}function N5e(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function jt(){this.len=0,this.head=new O2(_w,0,0),this.tail=this.head,this.states=null}var dD=function(){return js.Buffer?function(){return(jt.create=function(){return new ww})()}:function(){return new jt}};jt.create=dD();jt.alloc=function(e){return new js.Array(e)};js.Array!==Array&&(jt.alloc=js.pool(jt.alloc,js.Array.prototype.subarray));jt.prototype._push=function(e,r,i){return this.tail=this.tail.next=new O2(e,r,i),this.len+=r,this};function Ew(t,e,r){e[r]=t&255}function M5e(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function Sw(t,e){this.len=t,this.next=void 0,this.val=e}Sw.prototype=Object.create(O2.prototype);Sw.prototype.fn=M5e;jt.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new Sw((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};jt.prototype.int32=function(e){return e<0?this._push(xw,10,V3.fromNumber(e)):this.uint32(e)};jt.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function xw(t,e,r){for(;t.hi;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}jt.prototype.uint64=function(e){var r=V3.from(e);return this._push(xw,r.length(),r)};jt.prototype.int64=jt.prototype.uint64;jt.prototype.sint64=function(e){var r=V3.from(e).zzEncode();return this._push(xw,r.length(),r)};jt.prototype.bool=function(e){return this._push(Ew,1,e?1:0)};function Aw(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}jt.prototype.fixed32=function(e){return this._push(Aw,4,e>>>0)};jt.prototype.sfixed32=jt.prototype.fixed32;jt.prototype.fixed64=function(e){var r=V3.from(e);return this._push(Aw,4,r.lo)._push(Aw,4,r.hi)};jt.prototype.sfixed64=jt.prototype.fixed64;jt.prototype.float=function(e){return this._push(js.float.writeFloatLE,4,e)};jt.prototype.double=function(e){return this._push(js.float.writeDoubleLE,8,e)};var L5e=js.Array.prototype.set?function(e,r,i){r.set(e,i)}:function(e,r,i){for(var n=0;n>>0;if(!r)return this._push(Ew,1,0);if(js.isString(e)){var i=jt.alloc(r=fD.length(e));fD.decode(e,i,0),e=i}return this.uint32(r)._push(L5e,r,e)};jt.prototype.string=function(e){var r=lD.length(e);return r?this.uint32(r)._push(lD.write,r,e):this._push(Ew,1,0)};jt.prototype.fork=function(){return this.states=new N5e(this),this.head=this.tail=new O2(_w,0,0),this.len=0,this};jt.prototype.reset=function(){return this.states?(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 O2(_w,0,0),this.len=0),this};jt.prototype.ldelim=function(){var e=this.head,r=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=r,this.len+=i),this};jt.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,r,i),i+=e.len,e=e.next;return r};jt._configure=function(t){ww=t,jt.create=dD(),ww._configure()}});var gD=m((Ott,yD)=>{l();"use strict";yD.exports=Ta;var pD=Iw();(Ta.prototype=Object.create(pD.prototype)).constructor=Ta;var Gu=Hu();function Ta(){pD.call(this)}Ta._configure=function(){Ta.alloc=Gu._Buffer_allocUnsafe,Ta.writeBytesBuffer=Gu.Buffer&&Gu.Buffer.prototype instanceof Uint8Array&&Gu.Buffer.prototype.set.name==="set"?function(e,r,i){r.set(e,i)}:function(e,r,i){if(e.copy)e.copy(r,i,0,e.length);else for(var n=0;n>>0;return this.uint32(r),r&&this._push(Ta.writeBytesBuffer,r,e),this};function q5e(t,e,r){t.length<40?Gu.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}Ta.prototype.string=function(e){var r=Gu.Buffer.byteLength(e);return this.uint32(r),r&&this._push(q5e,r,e),this};Ta._configure()});var Pw=m((ktt,_D)=>{l();"use strict";_D.exports=fi;var Ra=Hu(),Tw,mD=Ra.LongBits,j5e=Ra.utf8;function Mo(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function fi(t){this.buf=t,this.pos=0,this.len=t.length}var bD=typeof Uint8Array!="undefined"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new fi(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new fi(e);throw Error("illegal buffer")},vD=function(){return Ra.Buffer?function(r){return(fi.create=function(n){return Ra.Buffer.isBuffer(n)?new Tw(n):bD(n)})(r)}:bD};fi.create=vD();fi.prototype._slice=Ra.Array.prototype.subarray||Ra.Array.prototype.slice;fi.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Mo(this,10);return e}}();fi.prototype.int32=function(){return this.uint32()|0};fi.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function Rw(){var t=new mD(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>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;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Mo(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw Mo(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}fi.prototype.bool=function(){return this.uint32()!==0};function z3(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}fi.prototype.fixed32=function(){if(this.pos+4>this.len)throw Mo(this,4);return z3(this.buf,this.pos+=4)};fi.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Mo(this,4);return z3(this.buf,this.pos+=4)|0};function wD(){if(this.pos+8>this.len)throw Mo(this,8);return new mD(z3(this.buf,this.pos+=4),z3(this.buf,this.pos+=4))}fi.prototype.float=function(){if(this.pos+4>this.len)throw Mo(this,4);var e=Ra.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};fi.prototype.double=function(){if(this.pos+8>this.len)throw Mo(this,4);var e=Ra.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};fi.prototype.bytes=function(){var e=this.uint32(),r=this.pos,i=this.pos+e;if(i>this.len)throw Mo(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(r,i):r===i?new this.buf.constructor(0):this._slice.call(this.buf,r,i)};fi.prototype.string=function(){var e=this.bytes();return j5e.read(e,0,e.length)};fi.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Mo(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Mo(this);while(this.buf[this.pos++]&128);return this};fi.prototype.skipType=function(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};fi._configure=function(t){Tw=t,fi.create=vD(),Tw._configure();var e=Ra.Long?"toLong":"toNumber";Ra.merge(fi.prototype,{int64:function(){return Rw.call(this)[e](!1)},uint64:function(){return Rw.call(this)[e](!0)},sint64:function(){return Rw.call(this).zzDecode()[e](!1)},fixed64:function(){return wD.call(this)[e](!0)},sfixed64:function(){return wD.call(this)[e](!1)}})}});var AD=m((Dtt,xD)=>{l();"use strict";xD.exports=Rl;var ED=Pw();(Rl.prototype=Object.create(ED.prototype)).constructor=Rl;var SD=Hu();function Rl(t){ED.call(this,t)}Rl._configure=function(){SD.Buffer&&(Rl.prototype._slice=SD.Buffer.prototype.slice)};Rl.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Rl._configure()});var TD=m((Btt,ID)=>{l();"use strict";ID.exports=k2;var Cw=Hu();(k2.prototype=Object.create(Cw.EventEmitter.prototype)).constructor=k2;function k2(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");Cw.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(r)}k2.prototype.rpcCall=function t(e,r,i,n,s){if(!n)throw TypeError("request must be specified");var o=this;if(!s)return Cw.asPromise(t,o,e,r,i,n);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,r[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(c,u){if(c)return o.emit("error",c,e),s(c);if(u===null){o.end(!0);return}if(!(u instanceof i))try{u=i[o.responseDelimited?"decodeDelimited":"decode"](u)}catch(f){return o.emit("error",f,e),s(f)}return o.emit("data",u,e),s(null,u)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};k2.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var PD=m(RD=>{l();"use strict";var U5e=RD;U5e.Service=TD()});var OD=m((Mtt,CD)=>{l();"use strict";CD.exports={}});var BD=m(DD=>{l();"use strict";var Yn=DD;Yn.build="minimal";Yn.Writer=Iw();Yn.BufferWriter=gD();Yn.Reader=Pw();Yn.BufferReader=AD();Yn.util=Hu();Yn.rpc=PD();Yn.roots=OD();Yn.configure=kD;function kD(){Yn.util._configure(),Yn.Writer._configure(Yn.BufferWriter),Yn.Reader._configure(Yn.BufferReader)}kD()});var Vi=m((qtt,ND)=>{l();"use strict";ND.exports=BD()});function FD(t,e,r){e=e||[],r=r||0;for(var i=r;t>=H5e;)e[r++]=t&255|UD,t/=128;for(;t&z5e;)e[r++]=t&255|UD,t>>>=7;return e[r]=t|0,FD.bytes=r-i+1,e}function kw(t,e){var r=0,e=e||0,i=0,n=e,s,o=t.length;do{if(n>=o)throw kw.bytes=0,new RangeError("Could not decode varint");s=t[n++],r+=i<28?(s&KD)<=$5e);return kw.bytes=n-e,r}var K5e,UD,V5e,z5e,H5e,G5e,$5e,KD,W5e,Y5e,X5e,Q5e,Z5e,J5e,e8e,t8e,r8e,i8e,n8e,s8e,D2,VD=bt(()=>{l();K5e=FD,UD=128,V5e=127,z5e=~V5e,H5e=Math.pow(2,31);G5e=kw,$5e=128,KD=127;W5e=Math.pow(2,7),Y5e=Math.pow(2,14),X5e=Math.pow(2,21),Q5e=Math.pow(2,28),Z5e=Math.pow(2,35),J5e=Math.pow(2,42),e8e=Math.pow(2,49),t8e=Math.pow(2,56),r8e=Math.pow(2,63),i8e=function(t){return t{l();VD();B2=t=>[D2.decode(t),D2.decode.bytes],zh=(t,e,r=0)=>(D2.encode(t,e,r),e),Hh=t=>D2.encodingLength(t)});var Gh={};zt(Gh,{coerce:()=>Us,empty:()=>HD,equals:()=>Dw,fromHex:()=>a8e,fromString:()=>Bw,isBinary:()=>c8e,toHex:()=>o8e,toString:()=>Nw});var HD,o8e,a8e,Dw,Us,c8e,Bw,Nw,$u=bt(()=>{l();HD=new Uint8Array(0),o8e=t=>t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),""),a8e=t=>{let e=t.match(/../g);return e?new Uint8Array(e.map(r=>parseInt(r,16))):HD},Dw=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},c8e=t=>t instanceof ArrayBuffer||ArrayBuffer.isView(t),Bw=t=>new TextEncoder().encode(t),Nw=t=>new TextDecoder().decode(t)});var Wh={};zt(Wh,{Digest:()=>$h,create:()=>N2,decode:()=>Ri,equals:()=>Mw});var N2,Ri,Mw,$h,Bn=bt(()=>{l();$u();G3();N2=(t,e)=>{let r=e.byteLength,i=Hh(t),n=i+Hh(r),s=new Uint8Array(n+r);return zh(t,s,0),zh(r,s,i),s.set(e,n),new $h(t,r,e,s)},Ri=t=>{let e=Us(t),[r,i]=B2(e),[n,s]=B2(e.subarray(i)),o=e.subarray(i+s);if(o.byteLength!==n)throw new Error("Incorrect length");return new $h(r,n,o,e)},Mw=(t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&Dw(t.bytes,e.bytes),$h=class{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}});function u8e(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,F=new Uint8Array(R);v!==A;){for(var D=y[v],B=0,H=R-1;(D!==0||B>>0,F[H]=D%a>>>0,D=D/a>>>0;if(D!==0)throw new Error("Non-zero carry");E=B,v++}for(var W=R-E;W!==R&&F[W]===0;)W++;for(var X=c.repeat(b);W>>0,R=new Uint8Array(A);y[b];){var F=r[y.charCodeAt(b)];if(F===255)return;for(var D=0,B=A-1;(F!==0||D>>0,R[B]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");v=D,b++}if(y[b]!==" "){for(var H=A-v;H!==A&&R[H]===0;)H++;for(var W=new Uint8Array(E+(A-H)),X=E;H!==A;)W[X++]=R[H++];return W}}}function p(y){var b=h(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:p}}var f8e,l8e,GD,$D=bt(()=>{l();f8e=u8e,l8e=f8e,GD=l8e});var WD,YD,$3,XD,W3,Wu,d8e,h8e,Qr,Pa=bt(()=>{l();$D();$u();WD=class{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},YD=class{constructor(e,r,i){this.name=e,this.prefix=r,this.baseDecode=i}decode(e){if(typeof e=="string")switch(e[0]){case this.prefix:return this.baseDecode(e.slice(1));default:throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}else throw Error("Can only multibase decode strings")}or(e){let r={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new $3(r)}},$3=class{constructor(e){this.decoders=e}or(e){let r=e.decoders||{[e.prefix]:e};return new $3({...this.decoders,...r})}decode(e){let r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},XD=class{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new WD(e,r,i),this.decoder=new YD(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},W3=({name:t,prefix:e,encode:r,decode:i})=>new XD(t,e,r,i),Wu=({prefix:t,name:e,alphabet:r})=>{let{encode:i,decode:n}=GD(r,e);return W3({prefix:t,name:e,encode:i,decode:s=>Us(n(s))})},d8e=(t,e,r,i)=>{let n={};for(let f=0;f=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},h8e=(t,e,r)=>{let i=e[e.length-1]==="=",n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<W3({prefix:e,name:t,encode(n){return h8e(n,i,r)},decode(n){return d8e(n,i,r,t)}})});var Fs={};zt(Fs,{base58btc:()=>pt,base58flickr:()=>p8e});var pt,p8e,li=bt(()=>{l();Pa();pt=Wu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),p8e=Wu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Yu={};zt(Yu,{base32:()=>rr,base32hex:()=>g8e,base32hexpad:()=>b8e,base32hexpadupper:()=>v8e,base32hexupper:()=>m8e,base32pad:()=>qw,base32padupper:()=>y8e,base32upper:()=>Lw,base32z:()=>w8e});var rr,Lw,qw,y8e,g8e,m8e,b8e,v8e,w8e,yn=bt(()=>{l();Pa();rr=Qr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Lw=Qr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qw=Qr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),y8e=Qr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),g8e=Qr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),m8e=Qr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),b8e=Qr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),v8e=Qr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),w8e=Qr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var Xu={};zt(Xu,{CID:()=>J});var J,_8e,E8e,S8e,M2,x8e,QD,ZD,Y3,X3,A8e,I8e,T8e,Te=bt(()=>{l();G3();Bn();li();yn();$u();J=class{constructor(e,r,i,n){this.code=r,this.version=e,this.multihash=i,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:X3,byteLength:X3,code:Y3,version:Y3,multihash:Y3,bytes:Y3,_baseCache:X3,asCID:X3})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==M2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==x8e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return J.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,i=N2(e,r);return J.createV1(this.code,i)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Mw(this.multihash,e.multihash)}toString(e){let{bytes:r,version:i,_baseCache:n}=this;switch(i){case 0:return E8e(r,n,e||pt.encoder);default:return S8e(r,n,e||rr.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return I8e(/^0\.0/,T8e),!!(e&&(e[ZD]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof J)return e;if(e!=null&&e.asCID===e){let{version:r,code:i,multihash:n,bytes:s}=e;return new J(r,i,n,s||QD(r,i,n.bytes))}else if(e!=null&&e[ZD]===!0){let{version:r,multihash:i,code:n}=e,s=Ri(i);return J.create(r,n,s)}else return null}static create(e,r,i){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==M2)throw new Error(`Version 0 CID must use dag-pb (code: ${M2}) block encoding`);return new J(e,r,i,i.bytes)}case 1:{let n=QD(e,r,i.bytes);return new J(e,r,i,n)}default:throw new Error("Invalid version")}}static createV0(e){return J.create(0,M2,e)}static createV1(e,r){return J.create(1,e,r)}static decode(e){let[r,i]=J.decodeFirst(e);if(i.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=J.inspectBytes(e),i=r.size-r.multihashSize,n=Us(e.subarray(i,i+r.multihashSize));if(n.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=n.subarray(r.multihashSize-r.digestSize),o=new $h(r.multihashCode,r.digestSize,s,n);return[r.version===0?J.createV0(o):J.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,i=()=>{let[d,h]=B2(e.subarray(r));return r+=h,d},n=i(),s=M2;if(n===18?(n=0,r=0):n===1&&(s=i()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let o=r,a=i(),c=i(),u=r+c,f=u-o;return{version:n,codec:s,multihashCode:a,digestSize:c,multihashSize:f,size:u}}static parse(e,r){let[i,n]=_8e(e,r),s=J.decode(n);return s._baseCache.set(i,e),s}},_8e=(t,e)=>{switch(t[0]){case"Q":{let r=e||pt;return[pt.prefix,r.decode(`${pt.prefix}${t}`)]}case pt.prefix:{let r=e||pt;return[pt.prefix,r.decode(t)]}case rr.prefix:{let r=e||rr;return[rr.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},E8e=(t,e,r)=>{let{prefix:i}=r;if(i!==pt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=e.get(i);if(n==null){let s=r.encode(t).slice(1);return e.set(i,s),s}else return n},S8e=(t,e,r)=>{let{prefix:i}=r,n=e.get(i);if(n==null){let s=r.encode(t);return e.set(i,s),s}else return n},M2=112,x8e=18,QD=(t,e,r)=>{let i=Hh(t),n=i+Hh(e),s=new Uint8Array(n+r.byteLength);return zh(t,s,0),zh(e,s,i),s.set(r,n),s},ZD=Symbol.for("@ipld/js-cid/CID"),Y3={writable:!1,configurable:!1,enumerable:!0},X3={writable:!1,enumerable:!1,configurable:!1},A8e="0.0.0-dev",I8e=(t,e)=>{if(t.test(A8e))console.warn(e);else throw new Error(e)},T8e=`CID.isCID(v) is deprecated and will be removed in the next major release. Following code pattern: if (CID.isCID(value)) { doSomethingWithCID(value) } Is replaced with: const cid = CID.asCID(value) if (cid) { // Make sure to use cid instead of value doSomethingWithCID(cid) } `});var Ju,gN,H2=bt(()=>{l();Bn();Ju=({name:t,code:e,encode:r})=>new gN(t,e,r),gN=class{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}async digest(e){if(e instanceof Uint8Array){let r=await this.encode(e);return N2(this.code,r)}else throw Error("Unknown type, must be binary type")}}});var G2={};zt(G2,{identity:()=>_s});var _s,Gc=bt(()=>{l();H2();$u();_s=Ju({name:"identity",code:0,encode:t=>Us(t)})});var Zw={};zt(Zw,{identity:()=>dve});var dve,bN=bt(()=>{l();Pa();$u();dve=W3({prefix:"\0",name:"identity",encode:t=>Nw(t),decode:t=>Bw(t)})});var Jw={};zt(Jw,{base2:()=>hve});var hve,vN=bt(()=>{l();Pa();hve=Qr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var e9={};zt(e9,{base8:()=>pve});var pve,wN=bt(()=>{l();Pa();pve=Qr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var t9={};zt(t9,{base10:()=>yve});var yve,_N=bt(()=>{l();Pa();yve=Wu({prefix:"9",name:"base10",alphabet:"0123456789"})});var a6={};zt(a6,{base16:()=>gve,base16upper:()=>mve});var gve,mve,r9=bt(()=>{l();Pa();gve=Qr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mve=Qr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var c6={};zt(c6,{base36:()=>bve,base36upper:()=>vve});var bve,vve,i9=bt(()=>{l();Pa();bve=Wu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vve=Wu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var e0={};zt(e0,{base64:()=>wve,base64pad:()=>_ve,base64url:()=>Eve,base64urlpad:()=>Sve});var wve,_ve,Eve,Sve,$2=bt(()=>{l();Pa();wve=Qr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_ve=Qr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Eve=Qr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Sve=Qr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var zs={};zt(zs,{sha256:()=>dr,sha512:()=>n9});var EN,dr,n9,di=bt(()=>{l();H2();EN=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),dr=Ju({name:"sha2-256",code:18,encode:EN("SHA-256")}),n9=Ju({name:"sha2-512",code:19,encode:EN("SHA-512")})});var W2={};zt(W2,{code:()=>Pi,decode:()=>Ive,encode:()=>Ave,name:()=>xve});var xve,Pi,Ave,Ive,Hs=bt(()=>{l();$u();xve="raw",Pi=85,Ave=t=>Us(t),Ive=t=>Us(t)});var o9={};zt(o9,{code:()=>s9,decode:()=>Ove,encode:()=>Cve,name:()=>Pve});var Tve,Rve,Pve,s9,Cve,Ove,a9=bt(()=>{l();Tve=new TextEncoder,Rve=new TextDecoder,Pve="json",s9=512,Cve=t=>Tve.encode(JSON.stringify(t)),Ove=t=>JSON.parse(Rve.decode(t))});var Y2=bt(()=>{l();Te();G3();$u();H2();Bn()});var kl,u6,f6,l6=bt(()=>{l();bN();vN();wN();_N();r9();yn();i9();li();$2();di();Gc();Hs();a9();Y2();kl={...Zw,...Jw,...e9,...t9,...a6,...Yu,...c6,...Fs,...e0},u6={...zs,...G2},f6={raw:W2,json:o9}});function AN(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}var IN,c9,kve,d6,u9=bt(()=>{l();l6();IN=AN("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),c9=AN("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);let e=new Uint8Array(t.length);for(let r=0;rXe});function Xe(t,e="utf8"){let r=d6[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return r.decoder.decode(`${r.prefix}${t}`)}var dt=bt(()=>{l();u9()});var l9=m((int,RN)=>{l();"use strict";var TN="[a-fA-F\\d:]",rf=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${TN})|(?<=${TN})(?=\\s|$))`:"",Uo="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",vi="[a-fA-F\\d]{1,4}",h6=` (?: (?:${vi}:){7}(?:${vi}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 (?:${vi}:){6}(?:${Uo}|:${vi}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 (?:${vi}:){5}(?::${Uo}|(?::${vi}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 (?:${vi}:){4}(?:(?::${vi}){0,1}:${Uo}|(?::${vi}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 (?:${vi}:){3}(?:(?::${vi}){0,2}:${Uo}|(?::${vi}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 (?:${vi}:){2}(?:(?::${vi}){0,3}:${Uo}|(?::${vi}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 (?:${vi}:){1}(?:(?::${vi}){0,4}:${Uo}|(?::${vi}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::${vi}){0,5}:${Uo}|(?::${vi}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 `.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Dve=new RegExp(`(?:^${Uo}$)|(?:^${h6}$)`),Bve=new RegExp(`^${Uo}$`),Nve=new RegExp(`^${h6}$`),f9=t=>t&&t.exact?Dve:new RegExp(`(?:${rf(t)}${Uo}${rf(t)})|(?:${rf(t)}${h6}${rf(t)})`,"g");f9.v4=t=>t&&t.exact?Bve:new RegExp(`${rf(t)}${Uo}${rf(t)}`,"g");f9.v6=t=>t&&t.exact?Nve:new RegExp(`${rf(t)}${h6}${rf(t)}`,"g");RN.exports=f9});var CN=m((nnt,PN)=>{l();"use strict";var d9=l9(),i0=t=>d9({exact:!0}).test(t);i0.v4=t=>d9.v4({exact:!0}).test(t);i0.v6=t=>d9.v6({exact:!0}).test(t);i0.version=t=>i0(t)?i0.v4(t)?4:6:void 0;PN.exports=i0});var hr={};zt(hr,{toString:()=>Ge});function Ge(t,e="utf8"){let r=d6[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return r.encoder.encode(t).substring(1)}var tt=bt(()=>{l();u9()});var NN=m((ont,BN)=>{l();"use strict";var h9=CN(),{toString:ON}=(tt(),hr),Mve=h9,p9=h9.v4,kN=h9.v6,DN=function(t,e,r){r=~~r;let i;if(p9(t))i=e||new Uint8Array(r+4),t.split(/\./g).map(function(n){i[r++]=parseInt(n,10)&255});else if(kN(t)){let n=t.split(":",8),s;for(s=0;s0;s--)o.push("0");n.splice.apply(n,o)}for(i=e||new Uint8Array(r+16),s=0;s>8&255,i[r++]=o&255}}if(!i)throw Error("Invalid ip address: "+t);return i},Lve=function(t,e,r){e=~~e,r=r||t.length-e;let i=[],n,s=new DataView(t.buffer);if(r===4){for(let o=0;o{l();"use strict";function Zn(t){if(typeof t=="number"){if(Zn.codes[t])return Zn.codes[t];throw new Error("no protocol with code: "+t)}else if(typeof t=="string"){if(Zn.names[t])return Zn.names[t];throw new Error("no protocol with name: "+t)}throw new Error("invalid protocol id type: "+t)}var Gs=-1;Zn.lengthPrefixedVarSize=Gs;Zn.V=Gs;Zn.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,Gs,"ip6zone"],[53,Gs,"dns","resolvable"],[54,Gs,"dns4","resolvable"],[55,Gs,"dns6","resolvable"],[56,Gs,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,Gs,"unix",!1,"path"],[421,Gs,"ipfs"],[421,Gs,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,Gs,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,Gs,"memory"]];Zn.names={};Zn.codes={};Zn.table.map(t=>{let e=MN.apply(null,t);return Zn.codes[e.code]=e,Zn.names[e.name]=e,null});Zn.object=MN;function MN(t,e,r,i,n){return{code:t,size:e,name:r,resolvable:Boolean(i),path:Boolean(n)}}LN.exports=Zn});var UN=m((cnt,jN)=>{l();jN.exports=y9;var qN=128,qve=127,jve=~qve,Uve=Math.pow(2,31);function y9(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw y9.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var i=r;t>=Uve;)e[r++]=t&255|qN,t/=128;for(;t&jve;)e[r++]=t&255|qN,t>>>=7;return e[r]=t|0,y9.bytes=r-i+1,e}});var VN=m((unt,KN)=>{l();KN.exports=g9;var Fve=128,FN=127;function g9(t,e){var r=0,e=e||0,i=0,n=e,s,o=t.length;do{if(n>=o||i>49)throw g9.bytes=0,new RangeError("Could not decode varint");s=t[n++],r+=i<28?(s&FN)<=Fve);return g9.bytes=n-e,r}});var HN=m((fnt,zN)=>{l();var Kve=Math.pow(2,7),Vve=Math.pow(2,14),zve=Math.pow(2,21),Hve=Math.pow(2,28),Gve=Math.pow(2,35),$ve=Math.pow(2,42),Wve=Math.pow(2,49),Yve=Math.pow(2,56),Xve=Math.pow(2,63);zN.exports=function(t){return t{l();GN.exports={encode:UN(),decode:VN(),encodingLength:HN()}});var $s={};zt($s,{concat:()=>gn});function gn(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));let r=new Uint8Array(e),i=0;for(let n of t)r.set(n,i),i+=n.length;return r}var mn=bt(()=>{l()});var eM=m((dnt,JN)=>{l();"use strict";var p6=NN(),$N=X2(),{CID:Qve}=(Te(),Xu),{base32:WN}=(yn(),Yu),{base58btc:Zve}=(li(),Fs),Jve=(Bn(),Wh),n0=Es(),{toString:y6}=(tt(),hr),{fromString:YN}=(dt(),bi),{concat:g6}=(mn(),$s);JN.exports=Q2;function Q2(t,e){return e instanceof Uint8Array?Q2.toString(t,e):Q2.toBytes(t,e)}Q2.toString=function(e,r){switch($N(e).code){case 4:case 41:return e7e(r);case 6:case 273:case 33:case 132:return QN(r).toString();case 53:case 54:case 55:case 56:case 400:case 777:return r7e(r);case 421:return n7e(r);case 444:return ZN(r);case 445:return ZN(r);default:return y6(r,"base16")}};Q2.toBytes=function(e,r){switch($N(e).code){case 4:return XN(r);case 41:return XN(r);case 6:case 273:case 33:case 132:return m9(parseInt(r,10));case 53:case 54:case 55:case 56:case 400:case 777:return t7e(r);case 421:return i7e(r);case 444:return s7e(r);case 445:return o7e(r);default:return YN(r,"base16")}};function XN(t){if(!p6.isIP(t))throw new Error("invalid ip address");return p6.toBytes(t)}function e7e(t){let e=p6.toString(t);if(!e||!p6.isIP(e))throw new Error("invalid ip address");return e}function m9(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function QN(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function t7e(t){let e=YN(t),r=Uint8Array.from(n0.encode(e.length));return g6([r,e],r.length+e.length)}function r7e(t){let e=n0.decode(t);if(t=t.slice(n0.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return y6(t)}function i7e(t){let e;t[0]==="Q"||t[0]==="1"?e=Jve.decode(Zve.decode(`z${t}`)).bytes:e=Qve.parse(t).multihash.bytes;let r=Uint8Array.from(n0.encode(e.length));return g6([r,e],r.length+e.length)}function n7e(t){let e=n0.decode(t),r=t.slice(n0.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return y6(r,"base58btc")}function s7e(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==16)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion address.");let r=WN.decode("b"+e[0]),i=parseInt(e[1],10);if(i<1||i>65536)throw new Error("Port number is not in range(1, 65536)");let n=m9(i);return g6([r,n],r.length+n.length)}function o7e(t){let e=t.split(":");if(e.length!==2)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(e[0].length!==56)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion3 address.");let r=WN.decode("b"+e[0]),i=parseInt(e[1],10);if(i<1||i>65536)throw new Error("Port number is not in range(1, 65536)");let n=m9(i);return g6([r,n],r.length+n.length)}function ZN(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),i=y6(e,"base32"),n=QN(r);return i+":"+n}});var dM=m((hnt,lM)=>{l();"use strict";var tM=eM(),b9=X2(),Z2=Es(),{concat:rM}=(mn(),$s),{toString:a7e}=(tt(),hr);lM.exports={stringToStringTuples:iM,stringTuplesToString:nM,tuplesToStringTuples:oM,stringTuplesToTuples:sM,bytesToTuples:v9,tuplesToBytes:aM,bytesToString:c7e,stringToBytes:uM,fromString:u7e,fromBytes:fM,validateBytes:w9,isValidBytes:f7e,cleanPath:m6,ParseError:_9,protoFromTuple:J2,sizeForAddr:cM};function iM(t){let e=[],r=t.split("/").slice(1);if(r.length===1&&r[0]==="")return[];for(let i=0;i=r.length)throw _9("invalid address: "+t);if(s.path){e.push([n,m6(r.slice(i).join("/"))]);break}e.push([n,r[i]])}return e}function nM(t){let e=[];return t.map(r=>{let i=J2(r);return e.push(i.name),r.length>1&&e.push(r[1]),null}),m6(e.join("/"))}function sM(t){return t.map(e=>{Array.isArray(e)||(e=[e]);let r=J2(e);return e.length>1?[r.code,tM.toBytes(r.code,e[1])]:[r.code]})}function oM(t){return t.map(e=>{let r=J2(e);return e[1]?[r.code,tM.toString(r.code,e[1])]:[r.code]})}function aM(t){return fM(rM(t.map(e=>{let r=J2(e),i=Uint8Array.from(Z2.encode(r.code));return e.length>1&&(i=rM([i,e[1]])),i})))}function cM(t,e){return t.size>0?t.size/8:t.size===0?0:Z2.decode(e)+Z2.decode.bytes}function v9(t){let e=[],r=0;for(;rt.length)throw _9("Invalid address Uint8Array: "+a7e(t,"base16"));e.push([i,a])}return e}function c7e(t){let e=v9(t),r=oM(e);return nM(r)}function uM(t){t=m6(t);let e=iM(t),r=sM(e);return aM(r)}function u7e(t){return uM(t)}function fM(t){let e=w9(t);if(e)throw e;return Uint8Array.from(t)}function w9(t){try{v9(t)}catch(e){return e}}function f7e(t){return w9(t)===void 0}function m6(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function _9(t){return new Error("Error parsing address: "+t)}function J2(t){return b9(t[0])}});var yM=m((pnt,pM)=>{l();"use strict";function hM(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function l7e(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return hM(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),hM(new n,r)}}pM.exports=l7e});var bn={};zt(bn,{equals:()=>Ba});function Ba(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r{l()});var rt=m((ynt,bM)=>{l();"use strict";var Fo=dM(),s0=X2(),gM=Es(),{CID:d7e}=(Te(),Xu),{base58btc:h7e}=(li(),Fs),p7e=yM(),y7e=Symbol.for("nodejs.util.inspect.custom"),{toString:b6}=(tt(),hr),{equals:g7e}=(wi(),bn),E9=new Map,mM=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Mn=class{constructor(e){if(e==null&&(e=""),Object.defineProperty(this,mM,{value:!0}),e instanceof Uint8Array)this.bytes=Fo.fromBytes(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=Fo.fromString(e)}else if(Mn.isMultiaddr(e))this.bytes=Fo.fromBytes(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Fo.bytesToString(this.bytes)}toJSON(){return this.toString()}toOptions(){let e={},r=this.toString().split("/");return e.family=r[1]==="ip4"?4:6,e.host=r[2],e.transport=r[3],e.port=parseInt(r[4]),e}protos(){return this.protoCodes().map(e=>Object.assign({},s0(e)))}protoCodes(){let e=[],r=this.bytes,i=0;for(;ie.name)}tuples(){return Fo.bytesToTuples(this.bytes)}stringTuples(){let e=Fo.bytesToTuples(this.bytes);return Fo.tuplesToStringTuples(e)}encapsulate(e){return e=new Mn(e),new Mn(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),i=this.toString(),n=i.lastIndexOf(r);if(n<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return new Mn(i.slice(0,n))}decapsulateCode(e){let r=this.tuples();for(let i=r.length-1;i>=0;i--)if(r[i][0]===e)return new Mn(Fo.tuplesToBytes(r.slice(0,i)));return this}getPeerId(){try{let r=this.stringTuples().filter(i=>i[0]===s0.names.ipfs.code).pop();if(r&&r[1]){let i=r[1];return i[0]==="Q"||i[0]==="1"?b6(h7e.decode(`z${i}`),"base58btc"):b6(d7e.parse(i).multihash.bytes,"base58btc")}return null}catch(e){return null}}getPath(){let e=null;try{e=this.stringTuples().filter(r=>!!s0(r[0]).path)[0][1],e||(e=null)}catch(r){e=null}return e}equals(e){return g7e(this.bytes,e.bytes)}async resolve(){let e=this.protos().find(n=>n.resolvable);if(!e)return[this];let r=E9.get(e.name);if(!r)throw p7e(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await r(this)).map(n=>new Mn(n))}nodeAddress(){let e=this.protoCodes(),r=this.protoNames(),i=this.toString().split("/").slice(1);if(i.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(e[0]!==4&&e[0]!==41&&e[0]!==54&&e[0]!==55)throw new Error(`no protocol with name: "'${r[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`);if(i[2]!=="tcp"&&i[2]!=="udp")throw new Error(`no protocol with name: "'${r[1]}'". Must have a valid transport protocol: "{tcp, udp}".`);return{family:e[0]===41||e[0]===55?6:4,address:i[1],port:parseInt(i[3])}}isThinWaistAddress(e){let r=(e||this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}static fromNodeAddress(e,r){if(!e)throw new Error("requires node address object");if(!r)throw new Error("requires transport protocol");let i;switch(e.family){case 4:i="ip4";break;case 6:i="ip6";break;default:throw Error(`Invalid addr family. Got '${e.family}' instead of 4 or 6`)}return new Mn("/"+[i,e.address,r,e.port].join("/"))}static isName(e){return Mn.isMultiaddr(e)?e.protos().some(r=>r.resolvable):!1}static isMultiaddr(e){return e instanceof Mn||Boolean(e&&e[mM])}[y7e](){return""}inspect(){return""}};Mn.protocols=s0;Mn.resolvers=E9;function m7e(t){return new Mn(t)}bM.exports={Multiaddr:Mn,multiaddr:m7e,protocols:s0,resolvers:E9}});var Bl=m((gnt,RM)=>{l();"use strict";var{Multiaddr:S9}=rt(),vM=Ze("dns4"),wM=Ze("dns6"),_M=Ze("dnsaddr"),Dl=vn(Ze("dns"),_M,vM,wM),ey=vn(Ze("ip4"),Ze("ip6")),o0=vn(gt(ey,Ze("tcp")),gt(Dl,Ze("tcp"))),x9=gt(ey,Ze("udp")),EM=gt(x9,Ze("utp")),SM=gt(x9,Ze("quic")),a0=vn(gt(o0,Ze("ws")),gt(Dl,Ze("ws"))),c0=vn(gt(o0,Ze("wss")),gt(Dl,Ze("wss"))),v6=vn(gt(o0,Ze("http")),gt(ey,Ze("http")),gt(Dl,Ze("http"))),w6=vn(gt(o0,Ze("https")),gt(ey,Ze("https")),gt(Dl,Ze("https"))),A9=vn(gt(a0,Ze("p2p-webrtc-star"),Ze("p2p")),gt(c0,Ze("p2p-webrtc-star"),Ze("p2p")),gt(a0,Ze("p2p-webrtc-star")),gt(c0,Ze("p2p-webrtc-star"))),b7e=vn(gt(a0,Ze("p2p-websocket-star"),Ze("p2p")),gt(c0,Ze("p2p-websocket-star"),Ze("p2p")),gt(a0,Ze("p2p-websocket-star")),gt(c0,Ze("p2p-websocket-star"))),I9=vn(gt(v6,Ze("p2p-webrtc-direct"),Ze("p2p")),gt(w6,Ze("p2p-webrtc-direct"),Ze("p2p")),gt(v6,Ze("p2p-webrtc-direct")),gt(w6,Ze("p2p-webrtc-direct"))),u0=vn(a0,c0,v6,w6,A9,I9,o0,EM,SM,Dl),v7e=vn(gt(u0,Ze("p2p-stardust"),Ze("p2p")),gt(u0,Ze("p2p-stardust"))),nf=vn(gt(u0,Ze("p2p")),A9,I9,Ze("p2p")),xM=vn(gt(nf,Ze("p2p-circuit"),nf),gt(nf,Ze("p2p-circuit")),gt(Ze("p2p-circuit"),nf),gt(u0,Ze("p2p-circuit")),gt(Ze("p2p-circuit"),u0),Ze("p2p-circuit")),AM=()=>vn(gt(xM,AM),xM),f0=AM(),IM=vn(gt(f0,nf,f0),gt(nf,f0),gt(f0,nf),f0,nf);RM.exports={DNS:Dl,DNS4:vM,DNS6:wM,DNSADDR:_M,IP:ey,TCP:o0,UDP:x9,QUIC:SM,UTP:EM,HTTP:v6,HTTPS:w6,WebSockets:a0,WebSocketsSecure:c0,WebSocketStar:b7e,WebRTCStar:A9,WebRTCDirect:I9,Reliable:u0,Stardust:v7e,Circuit:f0,P2P:IM,IPFS:IM};function TM(t){function e(r){if(!S9.isMultiaddr(r))try{r=new S9(r)}catch(n){return!1}let i=t(r.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return e}function gt(...t){function e(r){if(r.length(i=typeof n=="function"?n().partialMatch(r):n.partialMatch(r),Array.isArray(i)&&(r=i),i===null)),i}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:TM(e),partialMatch:e}}function vn(...t){function e(i){let n=null;return t.some(s=>{let o=typeof s=="function"?s().partialMatch(i):s.partialMatch(i);return o?(n=o,!0):!1}),n}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:TM(e),partialMatch:e}}function Ze(t){let e=t;function r(n){let s;if(typeof n=="string"||n instanceof Uint8Array)try{s=new S9(n)}catch(a){return!1}else s=n;let o=s.protoNames();return o.length===1&&o[0]===e}function i(n){return n.length===0?null:n[0]===e?n.slice(1):null}return{toString:function(){return e},matches:r,partialMatch:i}}});var T9=m((mnt,OM)=>{l();"use strict";var w7e=typeof navigator!="undefined"&&navigator.product==="ReactNative";function _7e(){return w7e?"http://localhost":self.location.protocol+"//"+self.location.host}var ty=self.URL,PM=_7e(),CM=class{constructor(e="",r=PM){this.super=new ty(e,r),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return ty.createObjectURL(e)}static revokeObjectURL(e){ty.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}};function E7e(t){if(typeof t=="string")return new ty(t).toString();if(!(t instanceof ty)){let e=t.username&&t.password?`${t.username}:${t.password}@`:"",r=t.auth?t.auth+"@":"",i=t.port?":"+t.port:"",n=t.protocol?t.protocol+"//":"",s=t.host||"",o=t.hostname||"",a=t.search||(t.query?"?"+t.query:""),c=t.hash||"",u=t.pathname||"",f=t.path||u+a;return`${n}${e||r}${s||o+i}${f}${c}`}}OM.exports={URLWithLegacySupport:CM,URLSearchParams:self.URLSearchParams,defaultBase:PM,format:E7e}});var BM=m((bnt,DM)=>{l();"use strict";var{URLWithLegacySupport:kM,format:S7e}=T9();DM.exports=(t,e={},r={},i)=>{let n=e.protocol?e.protocol.replace(":",""):"http";n=(r[n]||i||n)+":";let s;try{s=new kM(t)}catch(a){s={}}let o=Object.assign({},e,{protocol:n||s.protocol,host:e.host||s.host});return new kM(t,S7e(o)).toString()}});var _6=m((vnt,NM)=>{l();"use strict";var{URLWithLegacySupport:x7e,format:A7e,URLSearchParams:I7e,defaultBase:T7e}=T9(),R7e=BM();NM.exports={URL:x7e,URLSearchParams:I7e,format:A7e,relative:R7e,defaultBase:T7e}});var d0=m((wnt,WM)=>{l();"use strict";var{base58btc:P7e}=(li(),Fs),{base32:C7e}=(yn(),Yu),O7e=(Bn(),Wh),{Multiaddr:MM}=rt(),k7e=Bl(),{CID:R9}=(Te(),Xu),{URL:D7e}=_6(),{toString:B7e}=(tt(),hr),P9=/^https?:\/\/[^/]+\/(ip[fn]s)\/([^/?#]+)/,l0=/^\/(ip[fn]s)\/([^/?#]+)/,LM=1,qM=2,ry=/^https?:\/\/([^/]+)\.(ip[fn]s)\.[^/?]+/,jM=1,UM=2,N7e=/^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)+([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/;function M7e(t){let e=C9(t);try{O7e.decode(P7e.decode("z"+e))}catch{return!1}return!0}function L7e(t){try{C7e.decode(t)}catch{return!1}return!0}function iy(t){try{return typeof t=="string"?Boolean(R9.parse(t)):t instanceof Uint8Array?Boolean(R9.decode(t)):Boolean(R9.asCID(t))}catch(e){return!1}}function FM(t){if(!t)return!1;if(MM.isMultiaddr(t))return!0;try{return new MM(t),!0}catch(e){return!1}}function q7e(t){return FM(t)&&k7e.P2P.matches(t)}function ny(t,e,r=LM,i=qM){let n=C9(t);if(!n)return!1;let s=n.match(e);if(!s||s[r]!=="ipfs")return!1;let o=s[i];return o&&e===ry&&(o=o.toLowerCase()),iy(o)}function E6(t,e,r=LM,i=qM){let n=C9(t);if(!n)return!1;let s=n.match(e);if(!s||s[r]!=="ipns")return!1;let o=s[i];if(o&&e===ry){if(o=o.toLowerCase(),iy(o))return!0;try{!o.includes(".")&&o.includes("-")&&(o=o.replace(/--/g,"@").replace(/-/g,".").replace(/@/g,"-"));let{hostname:a}=new D7e(`http://${o}`);return N7e.test(a)}catch(a){return!1}}return!0}function KM(t){return typeof t=="string"}function C9(t){return t instanceof Uint8Array?B7e(t,"base58btc"):KM(t)?t:!1}var O9=t=>ny(t,ry,UM,jM),k9=t=>E6(t,ry,UM,jM),VM=t=>O9(t)||k9(t),zM=t=>ny(t,P9)||O9(t),HM=t=>E6(t,P9)||k9(t),GM=t=>zM(t)||HM(t)||VM(t),$M=t=>ny(t,l0)||E6(t,l0);WM.exports={multihash:M7e,multiaddr:FM,peerMultiaddr:q7e,cid:iy,base32cid:t=>L7e(t)&&iy(t),ipfsSubdomain:O9,ipnsSubdomain:k9,subdomain:VM,subdomainGatewayPattern:ry,ipfsUrl:zM,ipnsUrl:HM,url:GM,pathGatewayPattern:P9,ipfsPath:t=>ny(t,l0),ipnsPath:t=>E6(t,l0),path:$M,pathPattern:l0,urlOrPath:t=>GM(t)||$M(t),cidPath:t=>KM(t)&&!iy(t)&&ny(`/ipfs/${t}`,l0)}});var YM,XM=bt(()=>{l();YM="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"});var B9={};zt(B9,{customAlphabet:()=>j7e,customRandom:()=>ZM,nanoid:()=>D9,random:()=>QM,urlAlphabet:()=>YM});var QM,ZM,j7e,D9,S6=bt(()=>{l();XM();QM=t=>crypto.getRandomValues(new Uint8Array(t)),ZM=(t,e,r)=>{let i=(2<{let s="";for(;;){let o=r(n),a=n;for(;a--;)if(s+=t[o[a]&i]||"",s.length===e)return s}}},j7e=(t,e)=>ZM(t,e,QM),D9=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let i=r[t]&63;i<36?e+=i.toString(36):i<62?e+=(i-26).toString(36).toUpperCase():i<63?e+="_":e+="-"}return e}});var sy={};zt(sy,{Key:()=>qe});function U7e(t){let e=t.split(":");return e.length<2?"":e.slice(0,-1).join(":")}function F7e(t){let e=t.split(":");return e[e.length-1]}function K7e(t){return[].concat(...t)}var $c,JM,x6,qe,Br=bt(()=>{l();S6();tt();dt();$c="/",JM=new TextEncoder().encode($c),x6=JM[0],qe=class{constructor(e,r){if(typeof e=="string")this._buf=Xe(e);else if(e instanceof Uint8Array)this._buf=e;else throw new Error("Invalid key, should be String of Uint8Array");if(r==null&&(r=!0),r&&this.clean(),this._buf.byteLength===0||this._buf[0]!==x6)throw new Error("Invalid key")}toString(e="utf8"){return Ge(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(e){return new qe(e.join($c))}static random(){return new qe(D9().replace(/-/g,""))}static asKey(e){return e instanceof Uint8Array||typeof e=="string"?new qe(e):e.uint8Array?new qe(e.uint8Array()):null}clean(){if((!this._buf||this._buf.byteLength===0)&&(this._buf=JM),this._buf[0]!==x6){let e=new Uint8Array(this._buf.byteLength+1);e.fill(x6,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===x6;)this._buf=this._buf.subarray(0,-1)}less(e){let r=this.list(),i=e.list();for(let n=0;no)return!1}return r.lengthr.namespaces()))])}}});var h0=m((Int,A6)=>{l();"use strict";var{AbortController:eL,AbortSignal:V7e}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;A6.exports=eL;A6.exports.AbortSignal=V7e;A6.exports.default=eL});var rL=m((Tnt,tL)=>{l();"use strict";tL.exports=function(){return Date.now()}});var nL=m((Rnt,iL)=>{l();"use strict";var N9=rL();function M9(t,e,r){var i=this;this._started=N9(),this._rescheduled=0,this._scheduled=e,this._args=r,this._timer=setTimeout(n,e);function n(){i._rescheduled>0?(i._scheduled=i._rescheduled-(N9()-i._started),i._timer=setTimeout(n,i._scheduled),i._rescheduled=0):t.apply(null,i._args)}}M9.prototype.reschedule=function(t){var e=N9();return e+t-(this._started+this._scheduled)<0?!1:(this._started=e,this._rescheduled=t,!0)};M9.prototype.clear=function(){clearTimeout(this._timer)};function z7e(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("timeout needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e{l();"use strict";var{AbortController:H7e}=typeof self!="undefined"?self:typeof window!="undefined"?window:h0(),sL=nL(),oy=class extends H7e{constructor(e){super();this._ms=e,this._timer=sL(()=>this.abort(),e),Object.setPrototypeOf(this,oy.prototype)}abort(){return this._timer.clear(),super.abort()}clear(){this._timer.clear()}reset(){this._timer.clear(),this._timer=sL(()=>this.abort(),this._ms)}};L9.exports=oy;L9.exports.TimeoutController=oy});var wn=m((Cnt,oL)=>{l();"use strict";var T6;globalThis.AbortController&&globalThis.AbortSignal?T6=globalThis:T6=h0();oL.exports={AbortController:T6.AbortController,AbortSignal:T6.AbortSignal}});var sf=m((Ont,q9)=>{l();var{AbortController:G7e}=wn();function aL(t){let e=new G7e;function r(){e.abort();for(let i of t)!i||!i.removeEventListener||i.removeEventListener("abort",r)}for(let i of t)if(!(!i||!i.addEventListener)){if(i.aborted){r();break}i.addEventListener("abort",r)}return e.signal}q9.exports=aL;q9.exports.anySignal=aL});var p0=m((Lnt,dL)=>{l();"use strict";function lL(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function W7e(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return lL(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),lL(new n,r)}}dL.exports=W7e});var g0=m((Jnt,vL)=>{l();vL.exports=function(t){if(!t)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,r=Object.create(null),i=Object.create(null);function n(s,o){r[s]=o,e++,e>=t&&(e=0,i=r,r=Object.create(null))}return{has:function(s){return r[s]!==void 0||i[s]!==void 0},remove:function(s){r[s]!==void 0&&(r[s]=void 0),i[s]!==void 0&&(i[s]=void 0)},get:function(s){var o=r[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return n(s,o),o},set:function(s,o){r[s]!==void 0?r[s]=o:n(s,o)},clear:function(){r=Object.create(null),i=Object.create(null)}}}});var EL=m((tst,K9)=>{l();"use strict";var X7e=Object.prototype.hasOwnProperty,qn="~";function uy(){}Object.create&&(uy.prototype=Object.create(null),new uy().__proto__||(qn=!1));function Q7e(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function _L(t,e,r,i,n){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new Q7e(r,i||t,n),o=qn?qn+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],s]:t._events[o].push(s):(t._events[o]=s,t._eventsCount++),t}function C6(t,e){--t._eventsCount==0?t._events=new uy:delete t._events[e]}function _n(){this._events=new uy,this._eventsCount=0}_n.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)X7e.call(r,i)&&e.push(qn?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};_n.prototype.listeners=function(e){var r=qn?qn+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n{l();"use strict";SL.exports=(t,e)=>(e=e||(()=>{}),t.then(r=>new Promise(i=>{i(e())}).then(()=>r),r=>new Promise(i=>{i(e())}).then(()=>{throw r})))});var IL=m((ist,O6)=>{l();"use strict";var Z7e=xL(),V9=class extends Error{constructor(e){super(e);this.name="TimeoutError"}},AL=(t,e,r)=>new Promise((i,n)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){i(t);return}let s=setTimeout(()=>{if(typeof r=="function"){try{i(r())}catch(c){n(c)}return}let o=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,a=r instanceof Error?r:new V9(o);typeof t.cancel=="function"&&t.cancel(),n(a)},e);Z7e(t.then(i,n),()=>{clearTimeout(s)})});O6.exports=AL;O6.exports.default=AL;O6.exports.TimeoutError=V9});var TL=m(z9=>{l();"use strict";Object.defineProperty(z9,"__esModule",{value:!0});function J7e(t,e,r){let i=0,n=t.length;for(;n>0;){let s=n/2|0,o=i+s;r(t[o],e)<=0?(i=++o,n-=s+1):n=s}return i}z9.default=J7e});var PL=m(H9=>{l();"use strict";Object.defineProperty(H9,"__esModule",{value:!0});var ewe=TL(),RL=class{constructor(){this._queue=[]}enqueue(e,r){r=Object.assign({priority:0},r);let i={priority:r.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(i);return}let n=ewe.default(this._queue,i,(s,o)=>o.priority-s.priority);this._queue.splice(n,0,i)}dequeue(){let e=this._queue.shift();return e==null?void 0:e.run}filter(e){return this._queue.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this._queue.length}};H9.default=RL});var Yc=m(G9=>{l();"use strict";Object.defineProperty(G9,"__esModule",{value:!0});var twe=EL(),CL=IL(),rwe=PL(),k6=()=>{},iwe=new CL.TimeoutError,OL=class extends twe{constructor(e){var r,i,n,s;super();if(this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=k6,this._resolveIdle=k6,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:rwe.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(n=e.interval)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||e.interval===0,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=e.throwOnTimeout===!0,this._isPaused=e.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),e&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,r={}){return new Promise((i,n)=>{let s=async()=>{this._pendingCount++,this._intervalCount++;try{let o=this._timeout===void 0&&r.timeout===void 0?e():CL.default(Promise.resolve(e()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&n(iwe)});i(await o)}catch(o){n(o)}this._next()};this._queue.enqueue(s,r),this._tryToStartAnother(),this.emit("add")})}async addAll(e,r){return Promise.all(e.map(async i=>this.add(i,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(e=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}};G9.default=OL});var $9=m(D6=>{l();"use strict";var kL=class extends Error{constructor(e="Request timed out"){super(e);this.name="TimeoutError"}};D6.TimeoutError=kL;var DL=class extends Error{constructor(e="The operation was aborted."){super(e);this.name="AbortError"}};D6.AbortError=DL;var BL=class extends Error{constructor(e){super(e.statusText);this.name="HTTPError",this.response=e}};D6.HTTPError=BL});var NL=m(()=>{l()});var fy=m((m0,ML)=>{l();"use strict";var nwe=function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof Xc!="undefined")return Xc;throw new Error("unable to locate global object")},Xc=nwe();ML.exports=m0=Xc.fetch;Xc.fetch&&(m0.default=Xc.fetch.bind(Xc));m0.Headers=Xc.Headers;m0.Request=Xc.Request;m0.Response=Xc.Response});var Y9=m((fst,W9)=>{l();"use strict";globalThis.fetch&&globalThis.Headers&&globalThis.Request&&globalThis.Response?W9.exports={default:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response}:W9.exports={default:fy().default,Headers:fy().Headers,Request:fy().Request,Response:fy().Response}});var LL=m((lst,X9)=>{l();"use strict";var{isElectronMain:swe}=P2();swe?X9.exports=NL():X9.exports=Y9()});var FL=m((dst,UL)=>{l();"use strict";var{TimeoutError:owe,AbortError:awe}=$9(),{Response:qL,Request:cwe,Headers:Q9,default:uwe}=LL(),fwe=(t,e={})=>{let r=new XMLHttpRequest;r.open(e.method||"GET",t.toString(),!0);let{timeout:i,headers:n}=e;if(i&&i>0&&i<1/0&&(r.timeout=i),e.overrideMimeType!=null&&r.overrideMimeType(e.overrideMimeType),n)for(let[s,o]of new Q9(n))r.setRequestHeader(s,o);return e.signal&&(e.signal.onabort=()=>r.abort()),e.onUploadProgress&&(r.upload.onprogress=e.onUploadProgress),r.responseType="arraybuffer",new Promise((s,o)=>{let a=c=>{switch(c.type){case"error":{s(qL.error());break}case"load":{s(new jL(r.responseURL,r.response,{status:r.status,statusText:r.statusText,headers:hwe(r.getAllResponseHeaders())}));break}case"timeout":{o(new owe);break}case"abort":{o(new awe);break}default:break}};r.onerror=a,r.onload=a,r.ontimeout=a,r.onabort=a,r.send(e.body)})},lwe=uwe,dwe=(t,e={})=>e.onUploadProgress!=null?fwe(t,e):lwe(t,e),hwe=t=>{let e=new Q9;for(let r of t.trim().split(/[\r\n]+/)){let i=r.indexOf(": ");i>0&&e.set(r.slice(0,i),r.slice(i+1))}return e},jL=class extends qL{constructor(e,r,i){super(r,i);Object.defineProperty(this,"url",{value:e})}};UL.exports={fetch:dwe,Request:cwe,Headers:Q9}});var ly=m((hst,$L)=>{l();"use strict";var{fetch:pwe,Request:ywe,Headers:gwe}=FL(),{TimeoutError:Z9,HTTPError:KL}=$9(),VL=Al().bind({ignoreUndefined:!0}),{URL:zL,URLSearchParams:HL}=_6(),{AbortController:mwe}=wn(),bwe=sf(),vwe=(t,e,r)=>{if(e===void 0)return t;let i=Date.now(),n=()=>Date.now()-i>=e;return new Promise((s,o)=>{let a=setTimeout(()=>{n()&&(o(new Z9),r.abort())},e),c=u=>d=>{if(clearTimeout(a),n()){o(new Z9);return}u(d)};t.then(c(s),c(o))})},wwe={throwHttpErrors:!0,credentials:"same-origin"},jn=class{constructor(e={}){this.opts=VL(wwe,e)}async fetch(e,r={}){let i=VL(this.opts,r),n=new gwe(i.headers);if(typeof e!="string"&&!(e instanceof zL||e instanceof ywe))throw new TypeError("`resource` must be a string, URL, or Request");let s=new zL(e.toString(),i.base),{searchParams:o,transformSearchParams:a,json:c}=i;o&&(typeof a=="function"?s.search=a(new HL(i.searchParams)):s.search=new HL(i.searchParams)),c&&(i.body=JSON.stringify(i.json),n.set("content-type","application/json"));let u=new mwe,f=bwe([u.signal,i.signal]),d=await vwe(pwe(s.toString(),{...i,signal:f,timeout:void 0,headers:n}),i.timeout,u);if(!d.ok&&i.throwHttpErrors)throw i.handleError&&await i.handleError(d),new KL(d);return d.iterator=function(){return GL(d.body)},d.ndjson=async function*(){for await(let h of _we(d.iterator()))r.transform?yield r.transform(h):yield h},d}post(e,r={}){return this.fetch(e,{...r,method:"POST"})}get(e,r={}){return this.fetch(e,{...r,method:"GET"})}put(e,r={}){return this.fetch(e,{...r,method:"PUT"})}delete(e,r={}){return this.fetch(e,{...r,method:"DELETE"})}options(e,r={}){return this.fetch(e,{...r,method:"OPTIONS"})}},_we=async function*(t){let e=new TextDecoder,r="";for await(let i of t){r+=e.decode(i,{stream:!0});let n=r.split(/\r?\n/);for(let s=0;s0&&(yield JSON.parse(o))}r=n[n.length-1]}r+=e.decode(),r=r.trim(),r.length!==0&&(yield JSON.parse(r))},GL=t=>{if(xwe(t)){let e=t[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{next:e.next.bind(e),return(r){return t.destroy(),typeof e.return=="function"?e.return():Promise.resolve({done:!0,value:r})}}}}}if(Swe(t)){let e=t.getReader();return async function*(){try{for(;;){let{done:r,value:i}=await e.read();if(r)return;i&&(yield i)}}finally{e.releaseLock()}}()}if(Ewe(t))return t;throw new TypeError("Body can't be converted to AsyncIterable")},Ewe=t=>typeof t=="object"&&t!==null&&typeof t[Symbol.asyncIterator]=="function",Swe=t=>t&&typeof t.getReader=="function",xwe=t=>Object.prototype.hasOwnProperty.call(t,"readable")&&Object.prototype.hasOwnProperty.call(t,"writable");jn.HTTPError=KL;jn.TimeoutError=Z9;jn.streamToAsyncIterator=GL;jn.post=(t,e)=>new jn(e).post(t,e);jn.get=(t,e)=>new jn(e).get(t,e);jn.put=(t,e)=>new jn(e).put(t,e);jn.delete=(t,e)=>new jn(e).delete(t,e);jn.options=(t,e)=>new jn(e).options(t,e);$L.exports=jn});var M6=m((wst,eq)=>{l();"use strict";var Nl=Vi(),N6=Nl.Reader,JL=Nl.Writer,En=Nl.util,Ws=Nl.roots["libp2p-crypto-keys"]||(Nl.roots["libp2p-crypto-keys"]={});Ws.KeyType=function(){var t={},e=Object.create(t);return e[t[0]="RSA"]=0,e[t[1]="Ed25519"]=1,e[t[2]="Secp256k1"]=2,e}();Ws.PublicKey=function(){function t(e){if(e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.Type=r.int32();break;case 2:s.Data=r.bytes();break;default:r.skipType(o&7);break}}if(!s.hasOwnProperty("Type"))throw En.ProtocolError("missing required 'Type'",{instance:s});if(!s.hasOwnProperty("Data"))throw En.ProtocolError("missing required 'Data'",{instance:s});return s},t.fromObject=function(r){if(r instanceof Ws.PublicKey)return r;var i=new Ws.PublicKey;switch(r.Type){case"RSA":case 0:i.Type=0;break;case"Ed25519":case 1:i.Type=1;break;case"Secp256k1":case 2:i.Type=2;break}return r.Data!=null&&(typeof r.Data=="string"?En.base64.decode(r.Data,i.Data=En.newBuffer(En.base64.length(r.Data)),0):r.Data.length&&(i.Data=r.Data)),i},t.toObject=function(r,i){i||(i={});var n={};return i.defaults&&(n.Type=i.enums===String?"RSA":0,i.bytes===String?n.Data="":(n.Data=[],i.bytes!==Array&&(n.Data=En.newBuffer(n.Data)))),r.Type!=null&&r.hasOwnProperty("Type")&&(n.Type=i.enums===String?Ws.KeyType[r.Type]:r.Type),r.Data!=null&&r.hasOwnProperty("Data")&&(n.Data=i.bytes===String?En.base64.encode(r.Data,0,r.Data.length):i.bytes===Array?Array.prototype.slice.call(r.Data):r.Data),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,Nl.util.toJSONOptions)},t}();Ws.PrivateKey=function(){function t(e){if(e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.Type=r.int32();break;case 2:s.Data=r.bytes();break;default:r.skipType(o&7);break}}if(!s.hasOwnProperty("Type"))throw En.ProtocolError("missing required 'Type'",{instance:s});if(!s.hasOwnProperty("Data"))throw En.ProtocolError("missing required 'Data'",{instance:s});return s},t.fromObject=function(r){if(r instanceof Ws.PrivateKey)return r;var i=new Ws.PrivateKey;switch(r.Type){case"RSA":case 0:i.Type=0;break;case"Ed25519":case 1:i.Type=1;break;case"Secp256k1":case 2:i.Type=2;break}return r.Data!=null&&(typeof r.Data=="string"?En.base64.decode(r.Data,i.Data=En.newBuffer(En.base64.length(r.Data)),0):r.Data.length&&(i.Data=r.Data)),i},t.toObject=function(r,i){i||(i={});var n={};return i.defaults&&(n.Type=i.enums===String?"RSA":0,i.bytes===String?n.Data="":(n.Data=[],i.bytes!==Array&&(n.Data=En.newBuffer(n.Data)))),r.Type!=null&&r.hasOwnProperty("Type")&&(n.Type=i.enums===String?Ws.KeyType[r.Type]:r.Type),r.Data!=null&&r.hasOwnProperty("Data")&&(n.Data=i.bytes===String?En.base64.encode(r.Data,0,r.Data.length):i.bytes===Array?Array.prototype.slice.call(r.Data):r.Data),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,Nl.util.toJSONOptions)},t}();eq.exports=Ws});var yt=m((_st,tq)=>{l();tq.exports={options:{usePureJavaScript:!1}}});var nq=m((Est,iq)=>{l();var e_={};iq.exports=e_;var rq={};e_.encode=function(t,e,r){if(typeof e!="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 i="";if(!(t instanceof Uint8Array))i=Pwe(t,e);else{var n=0,s=e.length,o=e.charAt(0),a=[0];for(n=0;n0;)a.push(u%s),u=u/s|0}for(n=0;t[n]===0&&n=0;--n)i+=e[a[n]]}if(r){var f=new RegExp(".{1,"+r+"}","g");i=i.match(f).join(`\r `)}return i};e_.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=rq[e];if(!r){r=rq[e]=[];for(var i=0;i>=8;for(;u>0;)o.push(u&255),u>>=8}for(var f=0;t[f]===s&&f0;)s.push(a%i),a=a/i|0}var c="";for(r=0;t.at(r)===0&&r=0;--r)c+=e[s[r]];return c}});var nr=m((Sst,cq)=>{l();var sq=yt(),oq=nq(),se=cq.exports=sq.util=sq.util||{};(function(){if(typeof process!="undefined"&&process.nextTick&&!process.browser){se.nextTick=process.nextTick,typeof setImmediate=="function"?se.setImmediate=setImmediate:se.setImmediate=se.nextTick;return}if(typeof setImmediate=="function"){se.setImmediate=function(){return setImmediate.apply(void 0,arguments)},se.nextTick=function(a){return setImmediate(a)};return}if(se.setImmediate=function(a){setTimeout(a,0)},typeof window!="undefined"&&typeof window.postMessage=="function"){let a=function(c){if(c.source===window&&c.data===t){c.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(f){f()})}};var o=a,t="forge.setImmediate",e=[];se.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",a,!0)}if(typeof MutationObserver!="undefined"){var r=Date.now(),i=!0,n=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(u){u()})}).observe(n,{attributes:!0});var s=se.setImmediate;se.setImmediate=function(c){Date.now()-r>15?(r=Date.now(),s(c)):(e.push(c),e.length===1&&n.setAttribute("a",i=!i))}}se.nextTick=se.setImmediate})();se.isNodejs=typeof process!="undefined"&&process.versions&&process.versions.node;se.globalScope=function(){return se.isNodejs?globalThis:typeof self=="undefined"?window:self}();se.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};se.isArrayBuffer=function(t){return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer};se.isArrayBufferView=function(t){return t&&se.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function dy(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}se.ByteBuffer=t_;function t_(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(se.isArrayBuffer(t)||se.isArrayBufferView(t))if(typeof Buffer!="undefined"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(i){for(var r=0;rCwe&&(this.data.substr(0,1),this._constructedStringLength=0)};se.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};se.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};se.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};se.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};se.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};se.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(se.encodeUtf8(t))};se.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};se.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};se.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};se.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};se.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};se.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};se.ByteStringBuffer.prototype.putInt=function(t,e){dy(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};se.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};se.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};se.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};se.ByteStringBuffer.prototype.bytes=function(t){return typeof t=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};se.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};se.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};se.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};se.ByteStringBuffer.prototype.copy=function(){var t=se.createBuffer(this.data);return t.read=this.read,t};se.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};se.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};se.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};se.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),i=new Uint8Array(this.length()+e);return i.set(r),this.data=new DataView(i.buffer),this};se.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};se.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};se.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};se.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};se.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};se.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};se.DataBuffer.prototype.putInt=function(t,e){dy(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};se.DataBuffer.prototype.putSignedInt=function(t,e){return dy(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};se.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};se.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};se.DataBuffer.prototype.bytes=function(t){return typeof t=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};se.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};se.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};se.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};se.DataBuffer.prototype.copy=function(){return new se.DataBuffer(this)};se.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};se.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};se.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};se.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};se.xorBytes=function(t,e,r){for(var i="",n="",s="",o=0,a=0;r>0;--r,++o)n=t.charCodeAt(o)^e.charCodeAt(o),a>=10&&(i+=s,s="",a=0),s+=String.fromCharCode(n),++a;return i+=s,i};se.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var ff="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",lf=[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],aq="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";se.encode64=function(t,e){for(var r="",i="",n,s,o,a=0;a>2),r+=ff.charAt((n&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ff.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":ff.charAt(o&63)),e&&r.length>e&&(i+=r.substr(0,e)+`\r `,r=r.substr(e));return i+=r,i};se.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,i,n,s,o=0;o>4),n!==64&&(e+=String.fromCharCode((i&15)<<4|n>>2),s!==64&&(e+=String.fromCharCode((n&3)<<6|s)));return e};se.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};se.decodeUtf8=function(t){return decodeURIComponent(escape(t))};se.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:oq.encode,decode:oq.decode}};se.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};se.binary.raw.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(t.length)),r=r||0;for(var n=r,s=0;s>2),r+=ff.charAt((n&3)<<4|s>>4),isNaN(s)?r+="==":(r+=ff.charAt((s&15)<<2|o>>6),r+=isNaN(o)?"=":ff.charAt(o&63)),e&&r.length>e&&(i+=r.substr(0,e)+`\r `,r=r.substr(e));return i+=r,i};se.binary.base64.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var n,s,o,a,c=0,u=r;c>4,o!==64&&(i[u++]=(s&15)<<4|o>>2,a!==64&&(i[u++]=(o&3)<<6|a));return e?u-r:i.subarray(0,u)};se.binary.base58.encode=function(t,e){return se.binary.baseN.encode(t,aq,e)};se.binary.base58.decode=function(t,e){return se.binary.baseN.decode(t,aq,e)};se.text={utf8:{},utf16:{}};se.text.utf8.encode=function(t,e,r){t=se.encodeUtf8(t);var i=e;i||(i=new Uint8Array(t.length)),r=r||0;for(var n=r,s=0;s0?(c=s[o].substring(0,a),u=s[o].substring(a+1)):(c=s[o],u=null),c in n||(n[c]=[]),!(c in Object.prototype)&&u!==null&&n[c].push(unescape(u))}return n},r;return typeof t=="undefined"?(q6===null&&(typeof window!="undefined"&&window.location&&window.location.search?q6=e(window.location.search.substring(1)):q6={}),r=q6):r=e(t),r};se.parseFragment=function(t){var e=t,r="",i=t.indexOf("?");i>0&&(e=t.substring(0,i),r=t.substring(i+1));var n=e.split("/");n.length>0&&n[0]===""&&n.shift();var s=r===""?{}:se.getQueryVariables(r);return{pathString:e,queryString:r,path:n,query:s}};se.makeRequest=function(t){var e=se.parseFragment(t),r={path:e.pathString,query:e.queryString,getPath:function(i){return typeof i=="undefined"?e.path:e.path[i]},getQuery:function(i,n){var s;return typeof i=="undefined"?s=e.query:(s=e.query[i],s&&typeof n!="undefined"&&(s=s[n])),s},getQueryLast:function(i,n){var s,o=r.getQuery(i);return o?s=o[o.length-1]:s=n,s}};return r};se.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var i=jQuery.param(e||{});return r=r||"",t+(i.length>0?"?"+i:"")+(r.length>0?"#"+r:"")};se.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};se.format=function(t){for(var e=/%./g,r,i,n=0,s=[],o=0;r=e.exec(t);){i=t.substring(o,e.lastIndex-2),i.length>0&&s.push(i),o=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":n");break;case"%":s.push("%");break;default:s.push("<%"+a+"?>")}}return s.push(t.substring(o)),s.join("")};se.formatNumber=function(t,e,r,i){var n=t,s=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,a=i===void 0?".":i,c=n<0?"-":"",u=parseInt(n=Math.abs(+n||0).toFixed(s),10)+"",f=u.length>3?u.length%3:0;return c+(f?u.substr(0,f)+a:"")+u.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+a)+(s?o+Math.abs(n-u).toFixed(s).slice(2):"")};se.formatSize=function(t){return t>=1073741824?t=se.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=se.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=se.formatNumber(t/1024,0)+" KiB":t=se.formatNumber(t,0)+" bytes",t};se.bytesFromIP=function(t){return t.indexOf(".")!==-1?se.bytesFromIPv4(t):t.indexOf(":")!==-1?se.bytesFromIPv6(t):null};se.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=se.createBuffer(),r=0;rr[i].end-r[i].start&&(i=r.length-1))}e.push(s)}if(r.length>0){var c=r[i];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};se.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in se&&!t.update)return e(null,se.cores);if(typeof navigator!="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return se.cores=navigator.hardwareConcurrency,e(null,se.cores);if(typeof Worker=="undefined")return se.cores=1,e(null,se.cores);if(typeof Blob=="undefined")return se.cores=2,e(null,se.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var a=Date.now(),c=a+4;Date.now()p.st&&f.stf.st&&p.st{l();var hy=yt();hy.pki=hy.pki||{};var n_=uq.exports=hy.pki.oids=hy.oids=hy.oids||{};function Ie(t,e){n_[t]=e,n_[e]=t}function Qt(t,e){n_[t]=e}Ie("1.2.840.113549.1.1.1","rsaEncryption");Ie("1.2.840.113549.1.1.4","md5WithRSAEncryption");Ie("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Ie("1.2.840.113549.1.1.7","RSAES-OAEP");Ie("1.2.840.113549.1.1.8","mgf1");Ie("1.2.840.113549.1.1.9","pSpecified");Ie("1.2.840.113549.1.1.10","RSASSA-PSS");Ie("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Ie("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Ie("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Ie("1.3.101.112","EdDSA25519");Ie("1.2.840.10040.4.3","dsa-with-sha1");Ie("1.3.14.3.2.7","desCBC");Ie("1.3.14.3.2.26","sha1");Ie("2.16.840.1.101.3.4.2.1","sha256");Ie("2.16.840.1.101.3.4.2.2","sha384");Ie("2.16.840.1.101.3.4.2.3","sha512");Ie("1.2.840.113549.2.5","md5");Ie("1.2.840.113549.1.7.1","data");Ie("1.2.840.113549.1.7.2","signedData");Ie("1.2.840.113549.1.7.3","envelopedData");Ie("1.2.840.113549.1.7.4","signedAndEnvelopedData");Ie("1.2.840.113549.1.7.5","digestedData");Ie("1.2.840.113549.1.7.6","encryptedData");Ie("1.2.840.113549.1.9.1","emailAddress");Ie("1.2.840.113549.1.9.2","unstructuredName");Ie("1.2.840.113549.1.9.3","contentType");Ie("1.2.840.113549.1.9.4","messageDigest");Ie("1.2.840.113549.1.9.5","signingTime");Ie("1.2.840.113549.1.9.6","counterSignature");Ie("1.2.840.113549.1.9.7","challengePassword");Ie("1.2.840.113549.1.9.8","unstructuredAddress");Ie("1.2.840.113549.1.9.14","extensionRequest");Ie("1.2.840.113549.1.9.20","friendlyName");Ie("1.2.840.113549.1.9.21","localKeyId");Ie("1.2.840.113549.1.9.22.1","x509Certificate");Ie("1.2.840.113549.1.12.10.1.1","keyBag");Ie("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Ie("1.2.840.113549.1.12.10.1.3","certBag");Ie("1.2.840.113549.1.12.10.1.4","crlBag");Ie("1.2.840.113549.1.12.10.1.5","secretBag");Ie("1.2.840.113549.1.12.10.1.6","safeContentsBag");Ie("1.2.840.113549.1.5.13","pkcs5PBES2");Ie("1.2.840.113549.1.5.12","pkcs5PBKDF2");Ie("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Ie("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Ie("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Ie("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Ie("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Ie("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Ie("1.2.840.113549.2.7","hmacWithSHA1");Ie("1.2.840.113549.2.8","hmacWithSHA224");Ie("1.2.840.113549.2.9","hmacWithSHA256");Ie("1.2.840.113549.2.10","hmacWithSHA384");Ie("1.2.840.113549.2.11","hmacWithSHA512");Ie("1.2.840.113549.3.7","des-EDE3-CBC");Ie("2.16.840.1.101.3.4.1.2","aes128-CBC");Ie("2.16.840.1.101.3.4.1.22","aes192-CBC");Ie("2.16.840.1.101.3.4.1.42","aes256-CBC");Ie("2.5.4.3","commonName");Ie("2.5.4.5","serialName");Ie("2.5.4.6","countryName");Ie("2.5.4.7","localityName");Ie("2.5.4.8","stateOrProvinceName");Ie("2.5.4.9","streetAddress");Ie("2.5.4.10","organizationName");Ie("2.5.4.11","organizationalUnitName");Ie("2.5.4.13","description");Ie("2.5.4.15","businessCategory");Ie("2.5.4.17","postalCode");Ie("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Ie("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Ie("2.16.840.1.113730.1.1","nsCertType");Ie("2.16.840.1.113730.1.13","nsComment");Qt("2.5.29.1","authorityKeyIdentifier");Qt("2.5.29.2","keyAttributes");Qt("2.5.29.3","certificatePolicies");Qt("2.5.29.4","keyUsageRestriction");Qt("2.5.29.5","policyMapping");Qt("2.5.29.6","subtreesConstraint");Qt("2.5.29.7","subjectAltName");Qt("2.5.29.8","issuerAltName");Qt("2.5.29.9","subjectDirectoryAttributes");Qt("2.5.29.10","basicConstraints");Qt("2.5.29.11","nameConstraints");Qt("2.5.29.12","policyConstraints");Qt("2.5.29.13","basicConstraints");Ie("2.5.29.14","subjectKeyIdentifier");Ie("2.5.29.15","keyUsage");Qt("2.5.29.16","privateKeyUsagePeriod");Ie("2.5.29.17","subjectAltName");Ie("2.5.29.18","issuerAltName");Ie("2.5.29.19","basicConstraints");Qt("2.5.29.20","cRLNumber");Qt("2.5.29.21","cRLReason");Qt("2.5.29.22","expirationDate");Qt("2.5.29.23","instructionCode");Qt("2.5.29.24","invalidityDate");Qt("2.5.29.25","cRLDistributionPoints");Qt("2.5.29.26","issuingDistributionPoint");Qt("2.5.29.27","deltaCRLIndicator");Qt("2.5.29.28","issuingDistributionPoint");Qt("2.5.29.29","certificateIssuer");Qt("2.5.29.30","nameConstraints");Ie("2.5.29.31","cRLDistributionPoints");Ie("2.5.29.32","certificatePolicies");Qt("2.5.29.33","policyMappings");Qt("2.5.29.34","policyConstraints");Ie("2.5.29.35","authorityKeyIdentifier");Qt("2.5.29.36","policyConstraints");Ie("2.5.29.37","extKeyUsage");Qt("2.5.29.46","freshestCRL");Qt("2.5.29.54","inhibitAnyPolicy");Ie("1.3.6.1.4.1.11129.2.4.2","timestampList");Ie("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Ie("1.3.6.1.5.5.7.3.1","serverAuth");Ie("1.3.6.1.5.5.7.3.2","clientAuth");Ie("1.3.6.1.5.5.7.3.3","codeSigning");Ie("1.3.6.1.5.5.7.3.4","emailProtection");Ie("1.3.6.1.5.5.7.3.8","timeStamping")});var Qc=m((Ast,lq)=>{l();var Ir=yt();nr();b0();var Me=lq.exports=Ir.asn1=Ir.asn1||{};Me.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Me.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};Me.create=function(t,e,r,i,n){if(Ir.util.isArray(i)){for(var s=[],o=0;oe){var i=new Error("Too few bytes to parse DER.");throw i.available=t.length(),i.remaining=e,i.requested=r,i}}var Mwe=function(t,e){var r=t.getByte();if(e--,r!==128){var i,n=r&128;if(!n)i=r;else{var s=r&127;py(t,e,s),i=t.getInt(s<<3)}if(i<0)throw new Error("Negative length: "+i);return i}};Me.fromDer=function(t,e){return e===void 0&&(e={strict:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=Ir.util.createBuffer(t)),j6(t,t.length(),0,e)};function j6(t,e,r,i){var n;py(t,e,2);var s=t.getByte();e--;var o=s&192,a=s&31;n=t.length();var c=Mwe(t,e);if(e-=n-t.length(),c!==void 0&&c>e){if(i.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=c,u}c=e}var f,d,h=(s&32)==32;if(h)if(f=[],c===void 0)for(;;){if(py(t,e,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),e-=2;break}n=t.length(),f.push(j6(t,e,r+1,i)),e-=n-t.length()}else for(;c>0;)n=t.length(),f.push(j6(t,c,r+1,i)),e-=n-t.length(),c-=n-t.length();if(f===void 0&&o===Me.Class.UNIVERSAL&&a===Me.Type.BITSTRING&&(d=t.bytes(c)),f===void 0&&i.decodeBitStrings&&o===Me.Class.UNIVERSAL&&a===Me.Type.BITSTRING&&c>1){var p=t.read,y=e,b=0;if(a===Me.Type.BITSTRING&&(py(t,e,1),b=t.getByte(),e--),b===0)try{n=t.length();var E={verbose:i.verbose,strict:!0,decodeBitStrings:!0},v=j6(t,e,r+1,E),A=n-t.length();e-=A,a==Me.Type.BITSTRING&&A++;var R=v.tagClass;A===c&&(R===Me.Class.UNIVERSAL||R===Me.Class.CONTEXT_SPECIFIC)&&(f=[v])}catch(D){}f===void 0&&(t.read=p,e=y)}if(f===void 0){if(c===void 0){if(i.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(a===Me.Type.BMPSTRING)for(f="";c>0;c-=2)py(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(c)}var F=d===void 0?null:{bitStringContents:d};return Me.create(o,a,h,f,F)}Me.toDer=function(t){var e=Ir.util.createBuffer(),r=t.tagClass|t.type,i=Ir.util.createBuffer(),n=!1;if("bitStringContents"in t&&(n=!0,t.original&&(n=Me.equals(t,t.original))),n)i.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:i.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)==0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)==128)?i.putBytes(t.value.substr(1)):i.putBytes(t.value);if(e.putByte(r),i.length()<=127)e.putByte(i.length()&127);else{var o=i.length(),a="";do a+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(a.length|128);for(var s=a.length-1;s>=0;--s)e.putByte(a.charCodeAt(s))}return e.putBuffer(i),e};Me.oidToDer=function(t){var e=t.split("."),r=Ir.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var i,n,s,o,a=2;a>>7,i||(o|=128),n.push(o),i=!1;while(s>0);for(var c=n.length-1;c>=0;--c)r.putByte(n[c])}return r};Me.derToOid=function(t){var e;typeof t=="string"&&(t=Ir.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)r=t.getByte(),i=i<<7,r&128?i+=r&127:(e+="."+(i+r),i=0);return e};Me.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var i=parseInt(t.substr(2,2),10)-1,n=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var c=t.charAt(10),u=10;c!=="+"&&c!=="-"&&(a=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,i,n),e.setUTCHours(s,o,a,0),u&&(c=t.charAt(u),c==="+"||c==="-")){var f=parseInt(t.substr(u+1,2),10),d=parseInt(t.substr(u+4,2),10),h=f*60+d;h*=6e4,c==="+"?e.setTime(+e-h):e.setTime(+e+h)}return e};Me.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),i=parseInt(t.substr(4,2),10)-1,n=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),c=0,u=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var d=t.length-5,h=t.charAt(d);if(h==="+"||h==="-"){var p=parseInt(t.substr(d+1,2),10),y=parseInt(t.substr(d+4,2),10);u=p*60+y,u*=6e4,h==="+"&&(u*=-1),f=!0}return t.charAt(14)==="."&&(c=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,i,n),e.setUTCHours(s,o,a,c),e.setTime(+e+u)):(e.setFullYear(r,i,n),e.setHours(s,o,a,c)),e};Me.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var i=0;i=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};Me.derToInteger=function(t){typeof t=="string"&&(t=Ir.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};Me.validate=function(t,e,r,i){var n=!1;if((t.tagClass===e.tagClass||typeof e.tagClass=="undefined")&&(t.type===e.type||typeof e.type=="undefined"))if(t.constructed===e.constructed||typeof e.constructed=="undefined"){if(n=!0,e.value&&Ir.util.isArray(e.value))for(var s=0,o=0;n&&o0&&(i+=` `);for(var n="",s=0;s1?i+="0x"+Ir.util.bytesToHex(t.value.slice(1)):i+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?i+=" (1 unused bit shown)":u>1&&(i+=" ("+u+" unused bits shown)")}}else t.type===Me.Type.OCTETSTRING?(fq.test(t.value)||(i+="("+t.value+") "),i+="0x"+Ir.util.bytesToHex(t.value)):t.type===Me.Type.UTF8?i+=Ir.util.decodeUtf8(t.value):t.type===Me.Type.PRINTABLESTRING||t.type===Me.Type.IA5String?i+=t.value:fq.test(t.value)?i+="0x"+Ir.util.bytesToHex(t.value):t.value.length===0?i+="[null]":i+=t.value}return i}});var o_=m((Ist,dq)=>{l();var Gi=yt();nr();dq.exports=Gi.cipher=Gi.cipher||{};Gi.cipher.algorithms=Gi.cipher.algorithms||{};Gi.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Gi.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Gi.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Gi.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Gi.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Gi.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Gi.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Gi.cipher.algorithms[t]=e};Gi.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Gi.cipher.algorithms?Gi.cipher.algorithms[t]:null};var s_=Gi.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};s_.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Gi.util.createBuffer(),this.output=t.output||Gi.util.createBuffer(),this.mode.start(e)};s_.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};s_.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var c_=m((Tst,hq)=>{l();var $i=yt();nr();$i.cipher=$i.cipher||{};var Et=hq.exports=$i.cipher.modes=$i.cipher.modes||{};Et.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Et.ecb.prototype.start=function(t){};Et.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var i=0;i0))return!0;for(var i=0;i0)return!1;var r=t.length(),i=t.at(r-1);return i>this.blockSize<<2?!1:(t.truncate(i),!0)};Et.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Et.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=U6(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Et.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var i=0;i0))return!0;for(var i=0;i0)return!1;var r=t.length(),i=t.at(r-1);return i>this.blockSize<<2?!1:(t.truncate(i),!0)};Et.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=$i.util.createBuffer(),this._partialBytes=0};Et.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=U6(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Et.cfb.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var n=0;n0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n0)t.read-=this.blockSize;else for(var n=0;n0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};Et.cfb.prototype.decrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var n=0;n0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n0)t.read-=this.blockSize;else for(var n=0;n0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};Et.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=$i.util.createBuffer(),this._partialBytes=0};Et.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=U6(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Et.ofb.prototype.encrypt=function(t,e,r){var i=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var n=0;n0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n0)t.read-=this.blockSize;else for(var n=0;n0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};Et.ofb.prototype.decrypt=Et.ofb.prototype.encrypt;Et.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=$i.util.createBuffer(),this._partialBytes=0};Et.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=U6(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Et.ctr.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize)for(var n=0;n0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}F6(this._inBlock)};Et.ctr.prototype.decrypt=Et.ctr.prototype.encrypt;Et.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=$i.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Et.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=$i.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=$i.util.createBuffer(t.additionalData):r=$i.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=$i.util.createBuffer(t.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 i=e.length();if(i===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a_(i*8)))}this._inBlock=this._j0.slice(0),F6(this._inBlock),this._partialBytes=0,r=$i.util.createBuffer(r),this._aDataLength=a_(r.length()*8);var n=r.length()%this.blockSize;for(n&&r.fillWithByte(0,this.blockSize-n),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()])};Et.gcm.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var n=0;n0&&(s=this.blockSize-s),this._partialOutput.clear();for(var n=0;n0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),F6(this._inBlock)};Et.gcm.prototype.decrypt=function(t,e,r){var i=t.length();if(i0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),F6(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n0;--i)e[i]=t[i]>>>1|(t[i-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Et.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var i=r/8|0,n=t[i]>>>(7-r%8)*4&15,s=this._m[r][n];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Et.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Et.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,i=4*r,n=16*r,s=new Array(n),o=0;o>>1,n=new Array(r);n[i]=t.slice(0);for(var s=i>>>1;s>0;)this.pow(n[2*s],n[s]=[]),s>>=1;for(s=2;s4){var r=t;t=$i.util.createBuffer();for(var i=0;i{l();var pr=yt();o_();c_();nr();mq.exports=pr.aes=pr.aes||{};pr.aes.startEncrypting=function(t,e,r,i){var n=K6({key:t,output:r,decrypt:!1,mode:i});return n.start(e),n};pr.aes.createEncryptionCipher=function(t,e){return K6({key:t,output:null,decrypt:!1,mode:e})};pr.aes.startDecrypting=function(t,e,r,i){var n=K6({key:t,output:r,decrypt:!0,mode:i});return n.start(e),n};pr.aes.createDecryptionCipher=function(t,e){return K6({key:t,output:null,decrypt:!0,mode:e})};pr.aes.Algorithm=function(t,e){u_||yq();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(i,n){return l_(r._w,i,n,!1)},decrypt:function(i,n){return l_(r._w,i,n,!0)}}}),r._init=!1};pr.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=pr.util.createBuffer(e);else if(pr.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=pr.util.createBuffer();for(var i=0;i>>2;for(var i=0;i>8^a&255^99,Un[r]=a,f_[a]=r,c=t[a],n=t[r],s=t[n],o=t[s],u=c<<24^a<<16^a<<8^(a^c),f=(n^s^o)<<24^(r^o)<<16^(r^s^o)<<8^(r^n^o);for(var d=0;d<4;++d)Ml[d][r]=u,Ko[d][a]=f,u=u<<24|u>>>8,f=f<<24|f>>>8;r===0?r=i=1:(r=n^t[t[t[n^o]]],i^=t[t[i]])}}function gq(t,e){for(var r=t.slice(0),i,n=1,s=r.length,o=s+6+1,a=w0*o,c=s;c>>16&255]<<24^Un[i>>>8&255]<<16^Un[i&255]<<8^Un[i>>>24]^pq[n]<<24,n++):s>6&&c%s==4&&(i=Un[i>>>24]<<24^Un[i>>>16&255]<<16^Un[i>>>8&255]<<8^Un[i&255]),r[c]=r[c-s]^i;if(e){var u,f=Ko[0],d=Ko[1],h=Ko[2],p=Ko[3],y=r.slice(0);a=r.length;for(var c=0,b=a-w0;c>>24]]^d[Un[u>>>16&255]]^h[Un[u>>>8&255]]^p[Un[u&255]];r=y}return r}function l_(t,e,r,i){var n=t.length/4-1,s,o,a,c,u;i?(s=Ko[0],o=Ko[1],a=Ko[2],c=Ko[3],u=f_):(s=Ml[0],o=Ml[1],a=Ml[2],c=Ml[3],u=Un);var f,d,h,p,y,b,E;f=e[0]^t[0],d=e[i?3:1]^t[1],h=e[2]^t[2],p=e[i?1:3]^t[3];for(var v=3,A=1;A>>24]^o[d>>>16&255]^a[h>>>8&255]^c[p&255]^t[++v],b=s[d>>>24]^o[h>>>16&255]^a[p>>>8&255]^c[f&255]^t[++v],E=s[h>>>24]^o[p>>>16&255]^a[f>>>8&255]^c[d&255]^t[++v],p=s[p>>>24]^o[f>>>16&255]^a[d>>>8&255]^c[h&255]^t[++v],f=y,d=b,h=E;r[0]=u[f>>>24]<<24^u[d>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++v],r[i?3:1]=u[d>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[f&255]^t[++v],r[2]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[f>>>8&255]<<8^u[d&255]^t[++v],r[i?1:3]=u[p>>>24]<<24^u[f>>>16&255]<<16^u[d>>>8&255]<<8^u[h&255]^t[++v]}function K6(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,i;t.decrypt?i=pr.cipher.createDecipher(r,t.key):i=pr.cipher.createCipher(r,t.key);var n=i.start;return i.start=function(s,o){var a=null;o instanceof pr.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,n.call(i,o)},i}});var z6=m((Pst,vq)=>{l();var Tr=yt();o_();c_();nr();vq.exports=Tr.des=Tr.des||{};Tr.des.startEncrypting=function(t,e,r,i){var n=V6({key:t,output:r,decrypt:!1,mode:i||(e===null?"ECB":"CBC")});return n.start(e),n};Tr.des.createEncryptionCipher=function(t,e){return V6({key:t,output:null,decrypt:!1,mode:e})};Tr.des.startDecrypting=function(t,e,r,i){var n=V6({key:t,output:r,decrypt:!0,mode:i||(e===null?"ECB":"CBC")});return n.start(e),n};Tr.des.createDecryptionCipher=function(t,e){return V6({key:t,output:null,decrypt:!0,mode:e})};Tr.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(i,n){return bq(r._keys,i,n,!1)},decrypt:function(i,n){return bq(r._keys,i,n,!0)}}}),r._init=!1};Tr.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Tr.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=Hwe(e),this._init=!0}};Na("DES-ECB",Tr.cipher.modes.ecb);Na("DES-CBC",Tr.cipher.modes.cbc);Na("DES-CFB",Tr.cipher.modes.cfb);Na("DES-OFB",Tr.cipher.modes.ofb);Na("DES-CTR",Tr.cipher.modes.ctr);Na("3DES-ECB",Tr.cipher.modes.ecb);Na("3DES-CBC",Tr.cipher.modes.cbc);Na("3DES-CFB",Tr.cipher.modes.cfb);Na("3DES-OFB",Tr.cipher.modes.ofb);Na("3DES-CTR",Tr.cipher.modes.ctr);function Na(t,e){var r=function(){return new Tr.des.Algorithm(t,e)};Tr.cipher.registerAlgorithm(t,r)}var Lwe=[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],qwe=[-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],jwe=[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],Uwe=[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],Fwe=[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],Kwe=[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],Vwe=[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],zwe=[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 Hwe(t){for(var e=[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],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[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],a=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],b=t.length()>8?3:1,E=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],A=0,R,F=0;F>>4^B)&252645135,B^=R,D^=R<<4,R=(B>>>-16^D)&65535,D^=R,B^=R<<-16,R=(D>>>2^B)&858993459,B^=R,D^=R<<2,R=(B>>>-16^D)&65535,D^=R,B^=R<<-16,R=(D>>>1^B)&1431655765,B^=R,D^=R<<1,R=(B>>>8^D)&16711935,D^=R,B^=R<<8,R=(D>>>1^B)&1431655765,B^=R,D^=R<<1,R=D<<8|B>>>20&240,D=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=R;for(var H=0;H>>26,B=B<<2|B>>>26):(D=D<<1|D>>>27,B=B<<1|B>>>27),D&=-15,B&=-15;var W=e[D>>>28]|r[D>>>24&15]|i[D>>>20&15]|n[D>>>16&15]|s[D>>>12&15]|o[D>>>8&15]|a[D>>>4&15],X=c[B>>>28]|u[B>>>24&15]|f[B>>>20&15]|d[B>>>16&15]|h[B>>>12&15]|p[B>>>8&15]|y[B>>>4&15];R=(X>>>16^W)&65535,E[A++]=W^R,E[A++]=X^R<<16}}return E}function bq(t,e,r,i){var n=t.length===32?3:9,s;n===3?s=i?[30,-2,-2]:[0,32,2]:s=i?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,a=e[0],c=e[1];o=(a>>>4^c)&252645135,c^=o,a^=o<<4,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,a=a<<1|a>>>31,c=c<<1|c>>>31;for(var u=0;u>>4|c<<28)^t[h+1];o=a,a=c,c=o^(qwe[p>>>24&63]|Uwe[p>>>16&63]|Kwe[p>>>8&63]|zwe[p&63]|Lwe[y>>>24&63]|jwe[y>>>16&63]|Fwe[y>>>8&63]|Vwe[y&63])}o=a,a=c,c=o}a=a>>>1|a<<31,c=c>>>1|c<<31,o=(a>>>1^c)&1431655765,c^=o,a^=o<<1,o=(c>>>8^a)&16711935,a^=o,c^=o<<8,o=(c>>>2^a)&858993459,a^=o,c^=o<<2,o=(a>>>16^c)&65535,c^=o,a^=o<<16,o=(a>>>4^c)&252645135,c^=o,a^=o<<4,r[0]=a,r[1]=c}function V6(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,i;t.decrypt?i=Tr.cipher.createDecipher(r,t.key):i=Tr.cipher.createCipher(r,t.key);var n=i.start;return i.start=function(s,o){var a=null;o instanceof Tr.util.ByteBuffer&&(a=o,o={}),o=o||{},o.output=a,o.iv=s,n.call(i,o)},i}});var df=m((Cst,wq)=>{l();var H6=yt();wq.exports=H6.md=H6.md||{};H6.md.algorithms=H6.md.algorithms||{}});var Eq=m((Ost,_q)=>{l();var Zc=yt();df();nr();var Gwe=_q.exports=Zc.hmac=Zc.hmac||{};Gwe.create=function(){var t=null,e=null,r=null,i=null,n={};return n.start=function(s,o){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in Zc.md.algorithms)e=Zc.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(o===null)o=t;else{if(typeof o=="string")o=Zc.util.createBuffer(o);else if(Zc.util.isArray(o)){var a=o;o=Zc.util.createBuffer();for(var c=0;ce.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=Zc.util.createBuffer(),i=Zc.util.createBuffer(),u=o.length();for(var c=0;c{l()});var d_=m((Bst,Sq)=>{l();var Fn=yt();Eq();df();nr();var $we=Fn.pkcs5=Fn.pkcs5||{},Jc;Fn.util.isNodejs&&!Fn.options.usePureJavaScript&&(Jc=E0());Sq.exports=Fn.pbkdf2=$we.pbkdf2=function(t,e,r,i,n,s){if(typeof n=="function"&&(s=n,n=null),Fn.util.isNodejs&&!Fn.options.usePureJavaScript&&Jc.pbkdf2&&(n===null||typeof n!="object")&&(Jc.pbkdf2Sync.length>4||!n||n==="sha1"))return typeof n!="string"&&(n="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?Jc.pbkdf2Sync.length===4?Jc.pbkdf2(t,e,r,i,function(R,F){if(R)return s(R);s(null,F.toString("binary"))}):Jc.pbkdf2(t,e,r,i,n,function(R,F){if(R)return s(R);s(null,F.toString("binary"))}):Jc.pbkdf2Sync.length===4?Jc.pbkdf2Sync(t,e,r,i).toString("binary"):Jc.pbkdf2Sync(t,e,r,i,n).toString("binary");if((typeof n=="undefined"||n===null)&&(n="sha1"),typeof n=="string"){if(!(n in Fn.md.algorithms))throw new Error("Unknown hash algorithm: "+n);n=Fn.md[n].create()}var o=n.digestLength;if(i>4294967295*o){var a=new Error("Derived key is too long.");if(s)return s(a);throw a}var c=Math.ceil(i/o),u=i-(c-1)*o,f=Fn.hmac.create();f.start(n,t);var d="",h,p,y;if(!s){for(var b=1;b<=c;++b){f.start(null,null),f.update(e),f.update(Fn.util.int32ToBytes(b)),h=y=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(y),p=f.digest().getBytes(),h=Fn.util.xorBytes(h,p,o),y=p;d+=bc)return s(null,d);f.start(null,null),f.update(e),f.update(Fn.util.int32ToBytes(b)),h=y=f.digest().getBytes(),E=2,A()}function A(){if(E<=r)return f.start(null,null),f.update(y),p=f.digest().getBytes(),h=Fn.util.xorBytes(h,p,o),y=p,++E,Fn.util.setImmediate(A);d+=b{l();var G6=yt();nr();var xq=Aq.exports=G6.pem=G6.pem||{};xq.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r `,i;if(t.procType&&(i={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=$6(i)),t.contentDomain&&(i={name:"Content-Domain",values:[t.contentDomain]},r+=$6(i)),t.dekInfo&&(i={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&i.values.push(t.dekInfo.parameters),r+=$6(i)),t.headers)for(var n=0;n65&&o!==-1){var a=e[o];a===","?(++o,e=e.substr(0,o)+`\r `+e.substr(o)):e=e.substr(0,o)+`\r `+a+e.substr(o+1),s=n-o-1,o=-1,++n}else(e[n]===" "||e[n]===" "||e[n]===",")&&(o=n);return e}function Wwe(t){return t.replace(/^\s+/,"")}});var Oq=m((Mst,Cq)=>{l();var Ma=yt();df();nr();var Iq=Cq.exports=Ma.sha256=Ma.sha256||{};Ma.md.sha256=Ma.md.algorithms.sha256=Iq;Iq.create=function(){Tq||Ywe();var t=null,e=Ma.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=i.fullMessageLength.length-1;a>=0;--a)i.fullMessageLength[a]+=o[1],o[1]=o[0]+(i.fullMessageLength[a]/4294967296>>>0),i.fullMessageLength[a]=i.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(n),Pq(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),i},i.digest=function(){var n=Ma.util.createBuffer();n.putBytes(e.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize,o=s&i.blockLength-1;n.putBytes(h_.substr(0,i.blockLength-o));for(var a,c,u=i.fullMessageLength[0]*8,f=0;f>>0,u+=c,n.putInt32(u>>>0),u=a>>>0;n.putInt32(u);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Pq(d,r,n);var h=Ma.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h.putInt32(d.h5),h.putInt32(d.h6),h.putInt32(d.h7),h},i};var h_=null,Tq=!1,Rq=null;function Ywe(){h_=String.fromCharCode(128),h_+=Ma.util.fillString(String.fromCharCode(0),64),Rq=[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],Tq=!0}function Pq(t,e,r){for(var i,n,s,o,a,c,u,f,d,h,p,y,b,E,v,A=r.length();A>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)i=e[u-2],i=(i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,n=e[u-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,e[u]=i+e[u-7]+n+e[u-16]|0;for(f=t.h0,d=t.h1,h=t.h2,p=t.h3,y=t.h4,b=t.h5,E=t.h6,v=t.h7,u=0;u<64;++u)o=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),a=E^y&(b^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),c=f&d|h&(f^d),i=v+o+a+Rq[u]+e[u],n=s+c,v=E,E=b,b=y,y=p+i>>>0,p=h,h=d,d=f,f=i+n>>>0;t.h0=t.h0+f|0,t.h1=t.h1+d|0,t.h2=t.h2+h|0,t.h3=t.h3+p|0,t.h4=t.h4+y|0,t.h5=t.h5+b|0,t.h6=t.h6+E|0,t.h7=t.h7+v|0,A-=64}}});var Dq=m((Lst,kq)=>{l();var La=yt();nr();var Y6=null;La.util.isNodejs&&!La.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Y6=E0());var Xwe=kq.exports=La.prng=La.prng||{};Xwe.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,i=new Array(32),n=0;n<32;++n)i[n]=r.create();e.pools=i,e.pool=0,e.generate=function(u,f){if(!f)return e.generateSync(u);var d=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,y=e.plugin.formatSeed,b=La.util.createBuffer();e.key=null,E();function E(v){if(v)return f(v);if(b.length()>=u)return f(null,b.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return La.util.nextTick(function(){s(E)});var A=d(e.key,e.seed);e.generated+=A.length,b.putBytes(A),e.key=p(d(e.key,h(e.seed))),e.seed=y(d(e.key,e.seed)),La.util.setImmediate(E)}},e.generateSync=function(u){var f=e.plugin.cipher,d=e.plugin.increment,h=e.plugin.formatKey,p=e.plugin.formatSeed;e.key=null;for(var y=La.util.createBuffer();y.length()1048575&&(e.key=null),e.key===null&&o();var b=f(e.key,e.seed);e.generated+=b.length,y.putBytes(b),e.key=h(f(e.key,d(e.seed))),e.seed=p(f(e.key,e.seed))}return y.getBytes(u)};function s(u){if(e.pools[0].messageLength>=32)return a(),u();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(d,h){if(d)return u(d);e.collect(h),a(),u()})}function o(){if(e.pools[0].messageLength>=32)return a();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),a()}function a(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var f=1,d=0;d<32;++d)e.reseeds%f==0&&(u.update(e.pools[d].digest().getBytes()),e.pools[d].start()),f=f<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var h=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(h),e.generated=0}function c(u){var f=null,d=La.util.globalScope,h=d.crypto||d.msCrypto;h&&h.getRandomValues&&(f=function(D){return h.getRandomValues(D)});var p=La.util.createBuffer();if(f)for(;p.length()>16),A+=(v&32767)<<16,A+=v>>15,A=(A&2147483647)+(A>>31),F=A&4294967295;for(var E=0;E<3;++E)R=F>>>(E<<3),R^=Math.floor(Math.random()*256),p.putByte(String.fromCharCode(R&255))}return p.getBytes(u)}return Y6?(e.seedFile=function(u,f){Y6.randomBytes(u,function(d,h){if(d)return f(d);f(null,h.toString())})},e.seedFileSync=function(u){return Y6.randomBytes(u).toString()}):(e.seedFile=function(u,f){try{f(null,c(u))}catch(d){f(d)}},e.seedFileSync=c),e.collect=function(u){for(var f=u.length,d=0;d>h&255);e.collect(d)},e.registerWorker=function(u){if(u===self)e.seedFile=function(d,h){function p(y){var b=y.data;b.forge&&b.forge.prng&&(self.removeEventListener("message",p),h(b.forge.prng.err,b.forge.prng.bytes))}self.addEventListener("message",p),self.postMessage({forge:{prng:{needed:d}}})};else{var f=function(d){var h=d.data;h.forge&&h.forge.prng&&e.seedFile(h.forge.prng.needed,function(p,y){u.postMessage({forge:{prng:{err:p,bytes:y}}})})};u.addEventListener("message",f)}},e}});var hf=m((qst,p_)=>{l();var Wi=yt();_0();Oq();Dq();nr();(function(){if(Wi.random&&Wi.random.getBytes){p_.exports=Wi.random;return}(function(t){var e={},r=new Array(4),i=Wi.util.createBuffer();e.formatKey=function(d){var h=Wi.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),Wi.aes._expandKey(d,!1)},e.formatSeed=function(d){var h=Wi.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),d},e.cipher=function(d,h){return Wi.aes._updateBlock(d,h,r,!1),i.putInt32(r[0]),i.putInt32(r[1]),i.putInt32(r[2]),i.putInt32(r[3]),i.getBytes()},e.increment=function(d){return++d[3],d},e.md=Wi.md.sha256;function n(){var d=Wi.prng.create(e);return d.getBytes=function(h,p){return d.generate(h,p)},d.getBytesSync=function(h){return d.generate(h)},d}var s=n(),o=null,a=Wi.util.globalScope,c=a.crypto||a.msCrypto;if(c&&c.getRandomValues&&(o=function(d){return c.getRandomValues(d)}),Wi.options.usePureJavaScript||!Wi.util.isNodejs&&!o){if(typeof window=="undefined"||window.document===void 0,s.collectInt(+new Date,32),typeof navigator!="undefined"){var u="";for(var f in navigator)try{typeof navigator[f]=="string"&&(u+=navigator[f])}catch(d){}s.collect(u),u=null}t&&(t().mousemove(function(d){s.collectInt(d.clientX,16),s.collectInt(d.clientY,16)}),t().keypress(function(d){s.collectInt(d.charCode,8)}))}if(!Wi.random)Wi.random=s;else for(var f in s)Wi.random[f]=s[f];Wi.random.createInstance=n,p_.exports=Wi.random})(typeof jQuery!="undefined"?jQuery:null)})()});var Lq=m((jst,Mq)=>{l();var Jn=yt();nr();var y_=[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],Bq=[1,2,3,5],Qwe=function(t,e){return t<>16-e},Zwe=function(t,e){return(t&65535)>>e|t<<16-e&65535};Mq.exports=Jn.rc2=Jn.rc2||{};Jn.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Jn.util.createBuffer(t)),e=e||128;var r=t,i=t.length(),n=e,s=Math.ceil(n/8),o=255>>(n&7),a;for(a=i;a<128;a++)r.putByte(y_[r.at(a-1)+r.at(a-i)&255]);for(r.setAt(128-s,y_[r.at(128-s)&o]),a=127-s;a>=0;a--)r.setAt(a,y_[r.at(a+1)^r.at(a+s)]);return r};var Nq=function(t,e,r){var i=!1,n=null,s=null,o=null,a,c,u,f,d=[];for(t=Jn.rc2.expandKey(t,e),u=0;u<64;u++)d.push(t.getInt16Le());r?(a=function(y){for(u=0;u<4;u++)y[u]+=d[f]+(y[(u+3)%4]&y[(u+2)%4])+(~y[(u+3)%4]&y[(u+1)%4]),y[u]=Qwe(y[u],Bq[u]),f++},c=function(y){for(u=0;u<4;u++)y[u]+=d[y[(u+3)%4]&63]}):(a=function(y){for(u=3;u>=0;u--)y[u]=Zwe(y[u],Bq[u]),y[u]-=d[f]+(y[(u+3)%4]&y[(u+2)%4])+(~y[(u+3)%4]&y[(u+1)%4]),f--},c=function(y){for(u=3;u>=0;u--)y[u]-=d[y[(u+3)%4]&63]});var h=function(y){var b=[];for(u=0;u<4;u++){var E=n.getInt16Le();o!==null&&(r?E^=o.getInt16Le():o.putInt16Le(E)),b.push(E&65535)}f=r?0:63;for(var v=0;v=8;)h([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(y){var b=!0;if(r)if(y)b=y(8,n,!r);else{var E=n.length()===8?8:8-n.length();n.fillWithByte(E,E)}if(b&&(i=!0,p.update()),!r&&(b=n.length()===0,b))if(y)b=y(8,s,!r);else{var v=s.length(),A=s.at(v-1);A>v?b=!1:s.truncate(A)}return b}},p};Jn.rc2.startEncrypting=function(t,e,r){var i=Jn.rc2.createEncryptionCipher(t,128);return i.start(e,r),i};Jn.rc2.createEncryptionCipher=function(t,e){return Nq(t,e,!0)};Jn.rc2.startDecrypting=function(t,e,r){var i=Jn.rc2.createDecryptionCipher(t,128);return i.start(e,r),i};Jn.rc2.createDecryptionCipher=function(t,e){return Nq(t,e,!1)}});var gy=m((Ust,Hq)=>{l();var g_=yt();Hq.exports=g_.jsbn=g_.jsbn||{};var eu,Jwe=244837814094590,qq=(Jwe&16777215)==15715070;function Se(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}g_.jsbn.BigInteger=Se;function Ut(){return new Se(null)}function e9e(t,e,r,i,n,s){for(;--s>=0;){var o=e*this.data[t++]+r.data[i]+n;n=Math.floor(o/67108864),r.data[i++]=o&67108863}return n}function t9e(t,e,r,i,n,s){for(var o=e&32767,a=e>>15;--s>=0;){var c=this.data[t]&32767,u=this.data[t++]>>15,f=a*c+u*o;c=o*c+((f&32767)<<15)+r.data[i]+(n&1073741823),n=(c>>>30)+(f>>>15)+a*u+(n>>>30),r.data[i++]=c&1073741823}return n}function jq(t,e,r,i,n,s){for(var o=e&16383,a=e>>14;--s>=0;){var c=this.data[t]&16383,u=this.data[t++]>>14,f=a*c+u*o;c=o*c+((f&16383)<<14)+r.data[i]+n,n=(c>>28)+(f>>14)+a*u,r.data[i++]=c&268435455}return n}typeof navigator=="undefined"?(Se.prototype.am=jq,eu=28):qq&&navigator.appName=="Microsoft Internet Explorer"?(Se.prototype.am=t9e,eu=30):qq&&navigator.appName!="Netscape"?(Se.prototype.am=e9e,eu=26):(Se.prototype.am=jq,eu=28);Se.prototype.DB=eu;Se.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function n9e(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function pf(t){var e=Ut();return e.fromInt(t),e}function s9e(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var i=t.length,n=!1,s=0;--i>=0;){var o=r==8?t[i]&255:Fq(t,i);if(o<0){t.charAt(i)=="-"&&(n=!0);continue}n=!1,s==0?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function a9e(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(a>a)>0&&(n=!0,s=Uq(i));o>=0;)a>(a+=this.DB-e)):(i=this.data[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),i>0&&(n=!0),n&&(s+=Uq(i));return n?s:"0"}function c9e(){var t=Ut();return Se.ZERO.subTo(this,t),t}function u9e(){return this.s<0?this.negate():this}function f9e(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function Q6(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function l9e(){return this.t<=0?0:this.DB*(this.t-1)+Q6(this.data[this.t-1]^this.s&this.DM)}function d9e(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function h9e(t,e){for(var r=t;r=0;--a)e.data[a+s+1]=this.data[a]>>i|o,o=(this.data[a]&n)<=0;--a)e.data[a]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()}function y9e(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB,n=this.DB-i,s=(1<>i;for(var o=r+1;o>i;i>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e.data[r++]=this.DV+i:i>0&&(e.data[r++]=i),e.t=r,e.clamp()}function m9e(t,e){var r=this.abs(),i=t.abs(),n=r.t;for(e.t=n+i.t;--n>=0;)e.data[n]=0;for(n=0;n=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function v9e(t,e,r){var i=t.abs();if(!(i.t<=0)){var n=this.abs();if(n.t0?(i.lShiftTo(c,s),n.lShiftTo(c,r)):(i.copyTo(s),n.copyTo(r));var u=s.t,f=s.data[u-1];if(f!=0){var d=f*(1<1?s.data[u-2]>>this.F2:0),h=this.FV/d,p=(1<=0&&(r.data[r.t++]=1,r.subTo(v,r)),Se.ONE.dlShiftTo(u,v),v.subTo(s,s);s.t=0;){var A=r.data[--b]==f?this.DM:Math.floor(r.data[b]*h+(r.data[b-1]+y)*p);if((r.data[b]+=s.am(0,A,r,E,0,u))0&&r.rShiftTo(c,r),o<0&&Se.ZERO.subTo(r,r)}}}function w9e(t){var e=Ut();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Se.ZERO)>0&&t.subTo(e,e),e}function Ll(t){this.m=t}function _9e(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function E9e(t){return t}function S9e(t){t.divRemTo(this.m,null,t)}function x9e(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function A9e(t,e){t.squareTo(e),this.reduce(e)}Ll.prototype.convert=_9e;Ll.prototype.revert=E9e;Ll.prototype.reduce=S9e;Ll.prototype.mulTo=x9e;Ll.prototype.sqrTo=A9e;function I9e(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ql(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function R9e(t){var e=Ut();return t.copyTo(e),this.reduce(e),e}function P9e(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,i,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function C9e(t,e){t.squareTo(e),this.reduce(e)}function O9e(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ql.prototype.convert=T9e;ql.prototype.revert=R9e;ql.prototype.reduce=P9e;ql.prototype.mulTo=O9e;ql.prototype.sqrTo=C9e;function k9e(){return(this.t>0?this.data[0]&1:this.s)==0}function D9e(t,e){if(t>4294967295||t<1)return Se.ONE;var r=Ut(),i=Ut(),n=e.convert(this),s=Q6(t)-1;for(n.copyTo(r);--s>=0;)if(e.sqrTo(r,i),(t&1<0)e.mulTo(i,n,r);else{var o=r;r=i,i=o}return e.revert(r)}function B9e(t,e){var r;return t<256||e.isEven()?r=new Ll(e):r=new ql(e),this.exp(t,r)}Se.prototype.copyTo=i9e;Se.prototype.fromInt=n9e;Se.prototype.fromString=s9e;Se.prototype.clamp=o9e;Se.prototype.dlShiftTo=d9e;Se.prototype.drShiftTo=h9e;Se.prototype.lShiftTo=p9e;Se.prototype.rShiftTo=y9e;Se.prototype.subTo=g9e;Se.prototype.multiplyTo=m9e;Se.prototype.squareTo=b9e;Se.prototype.divRemTo=v9e;Se.prototype.invDigit=I9e;Se.prototype.isEven=k9e;Se.prototype.exp=D9e;Se.prototype.toString=a9e;Se.prototype.negate=c9e;Se.prototype.abs=u9e;Se.prototype.compareTo=f9e;Se.prototype.bitLength=l9e;Se.prototype.mod=w9e;Se.prototype.modPowInt=B9e;Se.ZERO=pf(0);Se.ONE=pf(1);function N9e(){var t=Ut();return this.copyTo(t),t}function M9e(){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)<>24}function q9e(){return this.t==0?this.s:this.data[0]<<16>>16}function j9e(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function U9e(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function F9e(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=pf(r),n=Ut(),s=Ut(),o="";for(this.divRemTo(i,n,s);n.signum()>0;)o=(r+s.intValue()).toString(t).substr(1)+o,n.divRemTo(i,n,s);return s.intValue().toString(t)+o}function K9e(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),n=!1,s=0,o=0,a=0;a=r&&(this.dMultiply(i),this.dAddOffset(o,0),s=0,o=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),n&&Se.ZERO.subTo(this,this)}function V9e(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Se.ONE.shiftLeft(t-1),b_,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Se.ONE.shiftLeft(t-1),this);else{var i=new Array,n=t&7;i.length=(t>>3)+1,e.nextBytes(i),n>0?i[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<=0;)r<8?(i=(this.data[t]&(1<>(r+=this.DB-8)):(i=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(i&128)!=0&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}function H9e(t){return this.compareTo(t)==0}function G9e(t){return this.compareTo(t)<0?this:t}function $9e(t){return this.compareTo(t)>0?this:t}function W9e(t,e,r){var i,n,s=Math.min(t.t,this.t);for(i=0;i>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}function n_e(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e.data[r++]=i:i<-1&&(e.data[r++]=this.DV+i),e.t=r,e.clamp()}function h_e(t){var e=Ut();return this.addTo(t,e),e}function p_e(t){var e=Ut();return this.subTo(t,e),e}function y_e(t){var e=Ut();return this.multiplyTo(t,e),e}function g_e(t){var e=Ut();return this.divRemTo(t,e,null),e}function m_e(t){var e=Ut();return this.divRemTo(t,null,e),e}function b_e(t){var e=Ut(),r=Ut();return this.divRemTo(t,e,r),new Array(e,r)}function v_e(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function w_e(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function yy(){}function zq(t){return t}function __e(t,e,r){t.multiplyTo(e,r)}function E_e(t,e){t.squareTo(e)}yy.prototype.convert=zq;yy.prototype.revert=zq;yy.prototype.mulTo=__e;yy.prototype.sqrTo=E_e;function S_e(t){return this.exp(t,new yy)}function x_e(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;var n;for(n=r.t-this.t;i=0;)r.data[i]=0;for(i=Math.max(e-this.t,0);i2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ut();return t.copyTo(e),this.reduce(e),e}function T_e(t){return t}function R_e(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function P_e(t,e){t.squareTo(e),this.reduce(e)}function C_e(t,e,r){t.multiplyTo(e,r),this.reduce(r)}x0.prototype.convert=I_e;x0.prototype.revert=T_e;x0.prototype.reduce=R_e;x0.prototype.mulTo=C_e;x0.prototype.sqrTo=P_e;function O_e(t,e){var r=t.bitLength(),i,n=pf(1),s;if(r<=0)return n;r<18?i=1:r<48?i=3:r<144?i=4:r<768?i=5:i=6,r<8?s=new Ll(e):e.isEven()?s=new x0(e):s=new ql(e);var o=new Array,a=3,c=i-1,u=(1<1){var f=Ut();for(s.sqrTo(o[1],f);a<=u;)o[a]=Ut(),s.mulTo(f,o[a-2],o[a]),a+=2}var d=t.t-1,h,p=!0,y=Ut(),b;for(r=Q6(t.data[d])-1;d>=0;){for(r>=c?h=t.data[d]>>r-c&u:(h=(t.data[d]&(1<0&&(h|=t.data[d-1]>>this.DB+r-c)),a=i;(h&1)==0;)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--d),p)o[h].copyTo(n),p=!1;else{for(;a>1;)s.sqrTo(n,y),s.sqrTo(y,n),a-=2;a>0?s.sqrTo(n,y):(b=n,n=y,y=b),s.mulTo(y,o[h],n)}for(;d>=0&&(t.data[d]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function D_e(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this.data[i])%t;return r}function B_e(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Se.ZERO;for(var r=t.clone(),i=this.clone(),n=pf(1),s=pf(0),o=pf(0),a=pf(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!n.isEven()||!s.isEven())&&(n.addTo(this,n),s.subTo(t,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?((!o.isEven()||!a.isEven())&&(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(i)>=0?(r.subTo(i,r),e&&n.subTo(o,n),s.subTo(a,s)):(i.subTo(r,i),e&&o.subTo(n,o),a.subTo(s,a))}if(i.compareTo(Se.ONE)!=0)return Se.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a}var Vo=[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],N_e=(1<<26)/Vo[Vo.length-1];function M_e(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Vo[Vo.length-1]){for(e=0;e=0);var a=s.modPow(i,this);if(a.compareTo(Se.ONE)!=0&&a.compareTo(e)!=0){for(var c=1;c++{l();var qa=yt();df();nr();var Gq=Yq.exports=qa.sha1=qa.sha1||{};qa.md.sha1=qa.md.algorithms.sha1=Gq;Gq.create=function(){$q||j_e();var t=null,e=qa.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,s=0;s>>0,o>>>0];for(var a=i.fullMessageLength.length-1;a>=0;--a)i.fullMessageLength[a]+=o[1],o[1]=o[0]+(i.fullMessageLength[a]/4294967296>>>0),i.fullMessageLength[a]=i.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(n),Wq(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),i},i.digest=function(){var n=qa.util.createBuffer();n.putBytes(e.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize,o=s&i.blockLength-1;n.putBytes(v_.substr(0,i.blockLength-o));for(var a,c,u=i.fullMessageLength[0]*8,f=0;f>>0,u+=c,n.putInt32(u>>>0),u=a>>>0;n.putInt32(u);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Wq(d,r,n);var h=qa.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h},i};var v_=null,$q=!1;function j_e(){v_=String.fromCharCode(128),v_+=qa.util.fillString(String.fromCharCode(0),64),$q=!0}function Wq(t,e,r){for(var i,n,s,o,a,c,u,f,d=r.length();d>=64;){for(n=t.h0,s=t.h1,o=t.h2,a=t.h3,c=t.h4,f=0;f<16;++f)i=r.getInt32(),e[f]=i,u=a^s&(o^a),i=(n<<5|n>>>27)+u+c+1518500249+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;for(;f<20;++f)i=e[f-3]^e[f-8]^e[f-14]^e[f-16],i=i<<1|i>>>31,e[f]=i,u=a^s&(o^a),i=(n<<5|n>>>27)+u+c+1518500249+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;for(;f<32;++f)i=e[f-3]^e[f-8]^e[f-14]^e[f-16],i=i<<1|i>>>31,e[f]=i,u=s^o^a,i=(n<<5|n>>>27)+u+c+1859775393+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;for(;f<40;++f)i=e[f-6]^e[f-16]^e[f-28]^e[f-32],i=i<<2|i>>>30,e[f]=i,u=s^o^a,i=(n<<5|n>>>27)+u+c+1859775393+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;for(;f<60;++f)i=e[f-6]^e[f-16]^e[f-28]^e[f-32],i=i<<2|i>>>30,e[f]=i,u=s&o|a&(s^o),i=(n<<5|n>>>27)+u+c+2400959708+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;for(;f<80;++f)i=e[f-6]^e[f-16]^e[f-28]^e[f-32],i=i<<2|i>>>30,e[f]=i,u=s^o^a,i=(n<<5|n>>>27)+u+c+3395469782+i,c=a,a=o,o=(s<<30|s>>>2)>>>0,s=n,n=i;t.h0=t.h0+n|0,t.h1=t.h1+s|0,t.h2=t.h2+o|0,t.h3=t.h3+a|0,t.h4=t.h4+c|0,d-=64}}});var Jq=m((Kst,Zq)=>{l();var ja=yt();nr();hf();Xq();var Qq=Zq.exports=ja.pkcs1=ja.pkcs1||{};Qq.encode_rsa_oaep=function(t,e,r){var i,n,s,o;typeof r=="string"?(i=r,n=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,n=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),s?s.start():s=ja.md.sha1.create(),o||(o=s);var a=Math.ceil(t.n.bitLength()/8),c=a-2*s.digestLength-2;if(e.length>c){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=c,u}i||(i=""),s.update(i,"raw");for(var f=s.digest(),d="",h=c-e.length,p=0;p>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+o),i+=r.digest().getBytes()}return i.substring(0,e)}});var ej=m((Vst,w_)=>{l();var yf=yt();nr();gy();hf();(function(){if(yf.prime){w_.exports=yf.prime;return}var t=w_.exports=yf.prime=yf.prime||{},e=yf.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],i=new e(null);i.fromInt(30);var n=function(d,h){return d|h};t.generateProbablePrime=function(d,h,p){typeof h=="function"&&(p=h,h={}),h=h||{};var y=h.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var b=h.prng||yf.random,E={nextBytes:function(v){for(var A=b.getBytesSync(v.length),R=0;Rh&&(d=u(h,p)),d.isProbablePrime(b))return v(null,d);d.dAddOffset(r[y++%8],0)}while(E<0||+new Date-Ad&&(b=u(d,h));var S=b.toString(16);P.target.postMessage({hex:S,workLoad:v}),b.dAddOffset(A,0)}}}}function u(d,h){var p=new e(d,h),y=d-1;return p.testBit(y)||p.bitwiseTo(e.ONE.shiftLeft(y),n,p),p.dAddOffset(31-p.mod(i).byteValue(),0),p}function f(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})()});var my=m((zst,aj)=>{l();var ut=yt();Qc();gy();b0();Jq();ej();hf();nr();typeof Nt=="undefined"&&(Nt=ut.jsbn.BigInteger);var Nt,__=ut.util.isNodejs?E0():null,fe=ut.asn1,Xs=ut.util;ut.pki=ut.pki||{};aj.exports=ut.pki.rsa=ut.rsa=ut.rsa||{};var ft=ut.pki,U_e=[6,4,2,4,2,4,6,2],F_e={name:"PrivateKeyInfo",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:fe.Class.UNIVERSAL,type:fe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:fe.Class.UNIVERSAL,type:fe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},K_e={name:"RSAPrivateKey",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},V_e={name:"RSAPublicKey",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:fe.Class.UNIVERSAL,type:fe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},z_e=ut.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:fe.Class.UNIVERSAL,type:fe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:fe.Class.UNIVERSAL,type:fe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:fe.Class.UNIVERSAL,type:fe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},H_e=function(t){var e;if(t.algorithm in ft.oids)e=ft.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var i=fe.oidToDer(e).getBytes(),n=fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[]),s=fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[]);s.value.push(fe.create(fe.Class.UNIVERSAL,fe.Type.OID,!1,i)),s.value.push(fe.create(fe.Class.UNIVERSAL,fe.Type.NULL,!1,""));var o=fe.create(fe.Class.UNIVERSAL,fe.Type.OCTETSTRING,!1,t.digest().getBytes());return n.value.push(s),n.value.push(o),fe.toDer(n).getBytes()},tj=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Nt.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Nt.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var i;do i=new Nt(ut.util.bytesToHex(ut.random.getBytes(e.n.bitLength()/8)),16);while(i.compareTo(e.n)>=0||!i.gcd(e.n).equals(Nt.ONE));t=t.multiply(i.modPow(e.e,e.n)).mod(e.n);for(var n=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);n.compareTo(s)<0;)n=n.add(e.p);var o=n.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return o=o.multiply(i.modInverse(e.n)).mod(e.n),o};ft.rsa.encrypt=function(t,e,r){var i=r,n,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(i=r===2,n=rj(t,e,r)):(n=ut.util.createBuffer(),n.putBytes(t));for(var o=new Nt(n.toHex(),16),a=tj(o,e,i),c=a.toString(16),u=ut.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)u.putByte(0),--f;return u.putBytes(ut.util.hexToBytes(c)),u.getBytes()};ft.rsa.decrypt=function(t,e,r,i){var n=Math.ceil(e.n.bitLength()/8);if(t.length!==n){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=n,s}var o=new Nt(ut.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var a=tj(o,e,r),c=a.toString(16),u=ut.util.createBuffer(),f=n-Math.ceil(c.length/2);f>0;)u.putByte(0),--f;return u.putBytes(ut.util.hexToBytes(c)),i!==!1?J6(u.getBytes(),e,r):u.getBytes()};ft.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var i=r.prng||ut.random,n={nextBytes:function(a){for(var c=i.getBytesSync(a.length),u=0;u>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+s);return o};ft.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Nt(null);r.fromInt(30);for(var i=0,n=function(d,h){return d|h},s=+new Date,o,a=0;t.keys===null&&(e<=0||ac?t.pqState=0:t.num.isProbablePrime($_e(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(U_e[i++%8],0):t.pqState===2?t.pqState=t.num.subtract(Nt.ONE).gcd(t.e).compareTo(Nt.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(Nt.ONE),t.q1=t.q.subtract(Nt.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Nt.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:ft.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:ft.rsa.setPublicKey(t.n,t.e)}}o=+new Date,a+=o-s,s=o}return t.keys!==null};ft.rsa.generateKeyPair=function(t,e,r,i){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(i=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(i=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!ut.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(i){if(ij("generateKeyPair"))return __.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(a,c,u){if(a)return i(a);i(null,{privateKey:ft.privateKeyFromPem(u),publicKey:ft.publicKeyFromPem(c)})});if(nj("generateKey")&&nj("exportKey"))return Xs.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:oj(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(a){return Xs.globalScope.crypto.subtle.exportKey("pkcs8",a.privateKey)}).then(void 0,function(a){i(a)}).then(function(a){if(a){var c=ft.privateKeyFromAsn1(fe.fromDer(ut.util.createBuffer(a)));i(null,{privateKey:c,publicKey:ft.setRsaPublicKey(c.n,c.e)})}});if(sj("generateKey")&&sj("exportKey")){var n=Xs.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:oj(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);n.oncomplete=function(a){var c=a.target.result,u=Xs.globalScope.msCrypto.subtle.exportKey("pkcs8",c.privateKey);u.oncomplete=function(f){var d=f.target.result,h=ft.privateKeyFromAsn1(fe.fromDer(ut.util.createBuffer(d)));i(null,{privateKey:h,publicKey:ft.setRsaPublicKey(h.n,h.e)})},u.onerror=function(f){i(f)}},n.onerror=function(a){i(a)};return}}else if(ij("generateKeyPairSync")){var s=__.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:ft.privateKeyFromPem(s.privateKey),publicKey:ft.publicKeyFromPem(s.publicKey)}}}var o=ft.rsa.createKeyPairGenerationState(t,e,r);if(!i)return ft.rsa.stepKeyPairGenerationState(o,0),o.keys;G_e(o,r,i)};ft.setRsaPublicKey=ft.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(i,n,s){if(typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSAES-PKCS1-V1_5"),n==="RSAES-PKCS1-V1_5")n={encode:function(a,c,u){return rj(a,c,2).getBytes()}};else if(n==="RSA-OAEP"||n==="RSAES-OAEP")n={encode:function(a,c){return ut.pkcs1.encode_rsa_oaep(c,a,s)}};else if(["RAW","NONE","NULL",null].indexOf(n)!==-1)n={encode:function(a){return a}};else if(typeof n=="string")throw new Error('Unsupported encryption scheme: "'+n+'".');var o=n.encode(i,r,!0);return ft.rsa.encrypt(o,r,!0)},r.verify=function(i,n,s){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),s==="RSASSA-PKCS1-V1_5"?s={verify:function(a,c){c=J6(c,r,!0);var u=fe.fromDer(c);return a===u.value[1].value}}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:function(a,c){return c=J6(c,r,!0),a===c}});var o=ft.rsa.decrypt(n,r,!0,!1);return s.verify(i,o,r.n.bitLength())},r};ft.setRsaPrivateKey=ft.rsa.setPrivateKey=function(t,e,r,i,n,s,o,a){var c={n:t,e,d:r,p:i,q:n,dP:s,dQ:o,qInv:a};return c.decrypt=function(u,f,d){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var h=ft.rsa.decrypt(u,c,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:J6};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:function(p,y){return ut.pkcs1.decode_rsa_oaep(y,p,d)}};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:function(p){return p}};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(h,c,!1)},c.sign=function(u,f){var d=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:H_e},d=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:function(){return u}},d=1);var h=f.encode(u,c.n.bitLength());return ft.rsa.encrypt(h,c,d)},c};ft.wrapRsaPrivateKey=function(t){return fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,fe.integerToDer(0).getBytes()),fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.OID,!1,fe.oidToDer(ft.oids.rsaEncryption).getBytes()),fe.create(fe.Class.UNIVERSAL,fe.Type.NULL,!1,"")]),fe.create(fe.Class.UNIVERSAL,fe.Type.OCTETSTRING,!1,fe.toDer(t).getBytes())])};ft.privateKeyFromAsn1=function(t){var e={},r=[];if(fe.validate(t,F_e,e,r)&&(t=fe.fromDer(ut.util.createBuffer(e.privateKey))),e={},r=[],!fe.validate(t,K_e,e,r)){var i=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw i.errors=r,i}var n,s,o,a,c,u,f,d;return n=ut.util.createBuffer(e.privateKeyModulus).toHex(),s=ut.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=ut.util.createBuffer(e.privateKeyPrivateExponent).toHex(),a=ut.util.createBuffer(e.privateKeyPrime1).toHex(),c=ut.util.createBuffer(e.privateKeyPrime2).toHex(),u=ut.util.createBuffer(e.privateKeyExponent1).toHex(),f=ut.util.createBuffer(e.privateKeyExponent2).toHex(),d=ut.util.createBuffer(e.privateKeyCoefficient).toHex(),ft.setRsaPrivateKey(new Nt(n,16),new Nt(s,16),new Nt(o,16),new Nt(a,16),new Nt(c,16),new Nt(u,16),new Nt(f,16),new Nt(d,16))};ft.privateKeyToAsn1=ft.privateKeyToRSAPrivateKey=function(t){return fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,fe.integerToDer(0).getBytes()),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.n)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.e)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.d)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.p)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.q)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.dP)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.dQ)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.qInv))])};ft.publicKeyFromAsn1=function(t){var e={},r=[];if(fe.validate(t,z_e,e,r)){var i=fe.derToOid(e.publicKeyOid);if(i!==ft.oids.rsaEncryption){var n=new Error("Cannot read public key. Unknown OID.");throw n.oid=i,n}t=e.rsaPublicKey}if(r=[],!fe.validate(t,V_e,e,r)){var n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw n.errors=r,n}var s=ut.util.createBuffer(e.publicKeyModulus).toHex(),o=ut.util.createBuffer(e.publicKeyExponent).toHex();return ft.setRsaPublicKey(new Nt(s,16),new Nt(o,16))};ft.publicKeyToAsn1=ft.publicKeyToSubjectPublicKeyInfo=function(t){return fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.OID,!1,fe.oidToDer(ft.oids.rsaEncryption).getBytes()),fe.create(fe.Class.UNIVERSAL,fe.Type.NULL,!1,"")]),fe.create(fe.Class.UNIVERSAL,fe.Type.BITSTRING,!1,[ft.publicKeyToRSAPublicKey(t)])])};ft.publicKeyToRSAPublicKey=function(t){return fe.create(fe.Class.UNIVERSAL,fe.Type.SEQUENCE,!0,[fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.n)),fe.create(fe.Class.UNIVERSAL,fe.Type.INTEGER,!1,Ua(t.e))])};function rj(t,e,r){var i=ut.util.createBuffer(),n=Math.ceil(e.n.bitLength()/8);if(t.length>n-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=n-11,s}i.putByte(0),i.putByte(r);var o=n-3-t.length,a;if(r===0||r===1){a=r===0?0:255;for(var c=0;c0;){for(var u=0,f=ut.random.getBytes(o),c=0;c1;){if(s.getByte()!==255){--s.read;break}++c}else if(a===2)for(c=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++c}var f=s.getByte();if(f!==0||c!==n-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function G_e(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var i={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(i.prng=e.prng),n();function n(){s(t.pBits,function(a,c){if(a)return r(a);if(t.p=c,t.q!==null)return o(a,t.q);s(t.qBits,o)})}function s(a,c){ut.prime.generateProbablePrime(a,i,c)}function o(a,c){if(a)return r(a);if(t.q=c,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(Nt.ONE).gcd(t.e).compareTo(Nt.ONE)!==0){t.p=null,n();return}if(t.q.subtract(Nt.ONE).gcd(t.e).compareTo(Nt.ONE)!==0){t.q=null,s(t.qBits,o);return}if(t.p1=t.p.subtract(Nt.ONE),t.q1=t.q.subtract(Nt.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Nt.ONE)!==0){t.p=t.q=null,n();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,o);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:ft.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:ft.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Ua(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=ut.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)==0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)==128)?r.substr(1):r}function $_e(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function ij(t){return ut.util.isNodejs&&typeof __[t]=="function"}function nj(t){return typeof Xs.globalScope!="undefined"&&typeof Xs.globalScope.crypto=="object"&&typeof Xs.globalScope.crypto.subtle=="object"&&typeof Xs.globalScope.crypto.subtle[t]=="function"}function sj(t){return typeof Xs.globalScope!="undefined"&&typeof Xs.globalScope.msCrypto=="object"&&typeof Xs.globalScope.msCrypto.subtle=="object"&&typeof Xs.globalScope.msCrypto.subtle[t]=="function"}function oj(t){for(var e=ut.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i{l();var je=yt();_0();Qc();z6();df();b0();d_();W6();hf();Lq();my();nr();typeof cj=="undefined"&&(cj=je.jsbn.BigInteger);var cj,ye=je.asn1,ht=je.pki=je.pki||{};dj.exports=ht.pbe=je.pbe=je.pbe||{};var jl=ht.oids,W_e={name:"EncryptedPrivateKeyInfo",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Y_e={name:"PBES2Algorithms",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ye.Class.UNIVERSAL,type:ye.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ye.Class.UNIVERSAL,type:ye.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},X_e={name:"pkcs-12PbeParams",tagClass:ye.Class.UNIVERSAL,type:ye.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ye.Class.UNIVERSAL,type:ye.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ye.Class.UNIVERSAL,type:ye.Type.INTEGER,constructed:!1,capture:"iterations"}]};ht.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i=je.random.getBytesSync(r.saltSize),n=r.count,s=ye.integerToDer(n),o,a,c;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,f,d;switch(r.algorithm){case"aes128":o=16,u=16,f=jl["aes128-CBC"],d=je.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,f=jl["aes192-CBC"],d=je.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,f=jl["aes256-CBC"],d=je.aes.createEncryptionCipher;break;case"des":o=8,u=8,f=jl.desCBC,d=je.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var p="hmacWith"+r.prfAlgorithm.toUpperCase(),y=lj(p),b=je.pkcs5.pbkdf2(e,i,n,o,y),E=je.random.getBytesSync(u),v=d(b);v.start(E),v.update(ye.toDer(t)),v.finish(),c=v.output.getBytes();var A=Q_e(i,s,o,p);a=ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.OID,!1,ye.oidToDer(jl.pkcs5PBES2).getBytes()),ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.OID,!1,ye.oidToDer(jl.pkcs5PBKDF2).getBytes()),A]),ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.OID,!1,ye.oidToDer(f).getBytes()),ye.create(ye.Class.UNIVERSAL,ye.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){o=24;var R=new je.util.ByteBuffer(i),b=ht.pbe.generatePkcs12Key(e,R,1,n,o),E=ht.pbe.generatePkcs12Key(e,R,2,n,o),v=je.des.createEncryptionCipher(b);v.start(E),v.update(ye.toDer(t)),v.finish(),c=v.output.getBytes(),a=ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.OID,!1,ye.oidToDer(jl["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[ye.create(ye.Class.UNIVERSAL,ye.Type.OCTETSTRING,!1,i),ye.create(ye.Class.UNIVERSAL,ye.Type.INTEGER,!1,s.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=r.algorithm,h}var F=ye.create(ye.Class.UNIVERSAL,ye.Type.SEQUENCE,!0,[a,ye.create(ye.Class.UNIVERSAL,ye.Type.OCTETSTRING,!1,c)]);return F};ht.decryptPrivateKeyInfo=function(t,e){var r=null,i={},n=[];if(!ye.validate(t,W_e,i,n)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var o=ye.derToOid(i.encryptionOid),a=ht.pbe.getCipher(o,i.encryptionParams,e),c=je.util.createBuffer(i.encryptedData);return a.update(c),a.finish()&&(r=ye.fromDer(a.output)),r};ht.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:ye.toDer(t).getBytes()};return je.pem.encode(r,{maxline:e})};ht.encryptedPrivateKeyFromPem=function(t){var e=je.pem.decode(t)[0];if(e.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=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ye.fromDer(e.body)};ht.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var i=ht.wrapRsaPrivateKey(ht.privateKeyToAsn1(t));return i=ht.encryptPrivateKeyInfo(i,e,r),ht.encryptedPrivateKeyToPem(i)}var n,s,o,a;switch(r.algorithm){case"aes128":n="AES-128-CBC",o=16,s=je.random.getBytesSync(16),a=je.aes.createEncryptionCipher;break;case"aes192":n="AES-192-CBC",o=24,s=je.random.getBytesSync(16),a=je.aes.createEncryptionCipher;break;case"aes256":n="AES-256-CBC",o=32,s=je.random.getBytesSync(16),a=je.aes.createEncryptionCipher;break;case"3des":n="DES-EDE3-CBC",o=24,s=je.random.getBytesSync(8),a=je.des.createEncryptionCipher;break;case"des":n="DES-CBC",o=8,s=je.random.getBytesSync(8),a=je.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=je.pbe.opensslDeriveBytes(e,s.substr(0,8),o),f=a(u);f.start(s),f.update(ye.toDer(ht.privateKeyToAsn1(t))),f.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:n,parameters:je.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return je.pem.encode(d)};ht.decryptRsaPrivateKey=function(t,e){var r=null,i=je.pem.decode(t)[0];if(i.type!=="ENCRYPTED PRIVATE KEY"&&i.type!=="PRIVATE KEY"&&i.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw n.headerType=n,n}if(i.procType&&i.procType.type==="ENCRYPTED"){var s,o;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,o=je.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,o=je.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,o=je.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,o=je.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,o=je.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,o=function(d){return je.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":s=8,o=function(d){return je.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":s=16,o=function(d){return je.rc2.createDecryptionCipher(d,128)};break;default:var n=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".');throw n.algorithm=i.dekInfo.algorithm,n}var a=je.util.hexToBytes(i.dekInfo.parameters),c=je.pbe.opensslDeriveBytes(e,a.substr(0,8),s),u=o(c);if(u.start(a),u.update(je.util.createBuffer(i.body)),u.finish())r=u.output.getBytes();else return r}else r=i.body;return i.type==="ENCRYPTED PRIVATE KEY"?r=ht.decryptPrivateKeyInfo(ye.fromDer(r),e):r=ye.fromDer(r),r!==null&&(r=ht.privateKeyFromAsn1(r)),r};ht.pbe.generatePkcs12Key=function(t,e,r,i,n,s){var o,a;if(typeof s=="undefined"||s===null){if(!("sha1"in je.md))throw new Error('"sha1" hash algorithm unavailable.');s=je.md.sha1.create()}var c=s.digestLength,u=s.blockLength,f=new je.util.ByteBuffer,d=new je.util.ByteBuffer;if(t!=null){for(a=0;a=0;a--)w=w>>8,w+=W.at(a)+g.at(a),g.setAt(a,w&255);P.putBuffer(g)}R=P,f.putBuffer(B)}return f.truncate(f.length()-n),f};ht.pbe.getCipher=function(t,e,r){switch(t){case ht.oids.pkcs5PBES2:return ht.pbe.getCipherForPBES2(t,e,r);case ht.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ht.oids["pbewithSHAAnd40BitRC2-CBC"]:return ht.pbe.getCipherForPKCS12PBE(t,e,r);default:var i=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw i.oid=t,i.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],i}};ht.pbe.getCipherForPBES2=function(t,e,r){var i={},n=[];if(!ye.validate(e,Y_e,i,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}if(t=ye.derToOid(i.kdfOid),t!==ht.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=ye.derToOid(i.encOid),t!==ht.oids["aes128-CBC"]&&t!==ht.oids["aes192-CBC"]&&t!==ht.oids["aes256-CBC"]&&t!==ht.oids["des-EDE3-CBC"]&&t!==ht.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var o=i.kdfSalt,a=je.util.createBuffer(i.kdfIterationCount);a=a.getInt(a.length()<<3);var c,u;switch(ht.oids[t]){case"aes128-CBC":c=16,u=je.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,u=je.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,u=je.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,u=je.des.createDecryptionCipher;break;case"desCBC":c=8,u=je.des.createDecryptionCipher;break}var f=fj(i.prfOid),d=je.pkcs5.pbkdf2(r,o,a,c,f),h=i.encIv,p=u(d);return p.start(h),p};ht.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},n=[];if(!ye.validate(e,X_e,i,n)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=n,s}var o=je.util.createBuffer(i.salt),a=je.util.createBuffer(i.iterations);a=a.getInt(a.length()<<3);var c,u,f;switch(t){case ht.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,f=je.des.startDecrypting;break;case ht.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,f=function(b,E){var v=je.rc2.createDecryptionCipher(b,40);return v.start(E,null),v};break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var d=fj(i.prfOid),h=ht.pbe.generatePkcs12Key(r,o,1,a,c,d);d.start();var p=ht.pbe.generatePkcs12Key(r,o,2,a,u,d);return f(h,p)};ht.pbe.opensslDeriveBytes=function(t,e,r,i){if(typeof i=="undefined"||i===null){if(!("md5"in je.md))throw new Error('"md5" hash algorithm unavailable.');i=je.md.md5.create()}e===null&&(e="");for(var n=[uj(i,t+e)],s=16,o=1;s{l();"use strict";function hj(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Z_e(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return hj(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),hj(new n,r)}}pj.exports=Z_e});var by=m(yj=>{l();"use strict";yj.get=(t=self)=>{let e=t.crypto||t.msCrypto;if(!e||!e.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}});var S_=m((Wst,mj)=>{l();"use strict";var{concat:J_e}=(mn(),$s),{fromString:gj}=(dt(),bi),eEe=by();function tEe({algorithm:t="AES-GCM",nonceLength:e=12,keyLength:r=16,digest:i="SHA-256",saltLength:n=16,iterations:s=32767}={}){let o=eEe.get();r*=8;async function a(u,f){let d=o.getRandomValues(new Uint8Array(n)),h=o.getRandomValues(new Uint8Array(e)),p={name:t,iv:h},y={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},b=await o.subtle.importKey("raw",gj(f),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),E=await o.subtle.deriveKey(y,b,{name:t,length:r},!0,["encrypt"]),v=await o.subtle.encrypt(p,E,u);return J_e([d,p.iv,new Uint8Array(v)])}async function c(u,f){let d=u.slice(0,n),h=u.slice(n,n+e),p=u.slice(n+e),y={name:t,iv:h},b={name:"PBKDF2",salt:d,iterations:s,hash:{name:i}},E=await o.subtle.importKey("raw",gj(f),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),v=await o.subtle.deriveKey(b,E,{name:t,length:r},!0,["decrypt"]),A=await o.subtle.decrypt(y,v,p);return new Uint8Array(A)}return{encrypt:a,decrypt:c}}mj.exports={create:tEe}});var vj=m((Yst,bj)=>{l();"use strict";var{base64:rEe}=($2(),e0),iEe=S_();bj.exports={import:async function(t,e){let r=rEe.decode(t);return await iEe.create().decrypt(r,e)}}});var e4=m((Xst,Sj)=>{l();var Ar=yt();df();nr();var vy=Sj.exports=Ar.sha512=Ar.sha512||{};Ar.md.sha512=Ar.md.algorithms.sha512=vy;var wj=Ar.sha384=Ar.sha512.sha384=Ar.sha512.sha384||{};wj.create=function(){return vy.create("SHA-384")};Ar.md.sha384=Ar.md.algorithms.sha384=wj;Ar.sha512.sha256=Ar.sha512.sha256||{create:function(){return vy.create("SHA-512/256")}};Ar.md["sha512/256"]=Ar.md.algorithms["sha512/256"]=Ar.sha512.sha256;Ar.sha512.sha224=Ar.sha512.sha224||{create:function(){return vy.create("SHA-512/224")}};Ar.md["sha512/224"]=Ar.md.algorithms["sha512/224"]=Ar.sha512.sha224;vy.create=function(t){if(_j||nEe(),typeof t=="undefined"&&(t="SHA-512"),!(t in Ul))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=Ul[t],r=null,i=Ar.util.createBuffer(),n=new Array(80),s=0;s<80;++s)n[s]=new Array(2);var o=64;switch(t){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var a={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength128=[];for(var c=a.messageLengthSize/4,u=0;u>>0,f>>>0];for(var d=a.fullMessageLength.length-1;d>=0;--d)a.fullMessageLength[d]+=f[1],f[1]=f[0]+(a.fullMessageLength[d]/4294967296>>>0),a.fullMessageLength[d]=a.fullMessageLength[d]>>>0,f[0]=f[1]/4294967296>>>0;return i.putBytes(c),Ej(r,n,i),(i.read>2048||i.length()===0)&&i.compact(),a},a.digest=function(){var c=Ar.util.createBuffer();c.putBytes(i.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize,f=u&a.blockLength-1;c.putBytes(x_.substr(0,a.blockLength-f));for(var d,h,p=a.fullMessageLength[0]*8,y=0;y>>0,p+=h,c.putInt32(p>>>0),p=d>>>0;c.putInt32(p);for(var b=new Array(r.length),y=0;y=128;){for(L=0;L<16;++L)e[L][0]=r.getInt32()>>>0,e[L][1]=r.getInt32()>>>0;for(;L<80;++L)q=e[L-2],Y=q[0],V=q[1],i=((Y>>>19|V<<13)^(V>>>29|Y<<3)^Y>>>6)>>>0,n=((Y<<13|V>>>19)^(V<<3|Y>>>29)^(Y<<26|V>>>6))>>>0,j=e[L-15],Y=j[0],V=j[1],s=((Y>>>1|V<<31)^(Y>>>8|V<<24)^Y>>>7)>>>0,o=((Y<<31|V>>>1)^(Y<<24|V>>>8)^(Y<<25|V>>>7))>>>0,_=e[L-7],de=e[L-16],V=n+_[1]+o+de[1],e[L][0]=i+_[0]+s+de[0]+(V/4294967296>>>0)>>>0,e[L][1]=V>>>0;for(b=t[0][0],E=t[0][1],v=t[1][0],A=t[1][1],R=t[2][0],F=t[2][1],D=t[3][0],B=t[3][1],H=t[4][0],W=t[4][1],X=t[5][0],P=t[5][1],g=t[6][0],w=t[6][1],S=t[7][0],C=t[7][1],L=0;L<80;++L)u=((H>>>14|W<<18)^(H>>>18|W<<14)^(W>>>9|H<<23))>>>0,f=((H<<18|W>>>14)^(H<<14|W>>>18)^(W<<23|H>>>9))>>>0,d=(g^H&(X^g))>>>0,h=(w^W&(P^w))>>>0,a=((b>>>28|E<<4)^(E>>>2|b<<30)^(E>>>7|b<<25))>>>0,c=((b<<4|E>>>28)^(E<<30|b>>>2)^(E<<25|b>>>7))>>>0,p=(b&v|R&(b^v))>>>0,y=(E&A|F&(E^A))>>>0,V=C+f+h+A_[L][1]+e[L][1],i=S+u+d+A_[L][0]+e[L][0]+(V/4294967296>>>0)>>>0,n=V>>>0,V=c+y,s=a+p+(V/4294967296>>>0)>>>0,o=V>>>0,S=g,C=w,g=X,w=P,X=H,P=W,V=B+n,H=D+i+(V/4294967296>>>0)>>>0,W=V>>>0,D=R,B=F,R=v,F=A,v=b,A=E,V=n+o,b=i+s+(V/4294967296>>>0)>>>0,E=V>>>0;V=t[0][1]+E,t[0][0]=t[0][0]+b+(V/4294967296>>>0)>>>0,t[0][1]=V>>>0,V=t[1][1]+A,t[1][0]=t[1][0]+v+(V/4294967296>>>0)>>>0,t[1][1]=V>>>0,V=t[2][1]+F,t[2][0]=t[2][0]+R+(V/4294967296>>>0)>>>0,t[2][1]=V>>>0,V=t[3][1]+B,t[3][0]=t[3][0]+D+(V/4294967296>>>0)>>>0,t[3][1]=V>>>0,V=t[4][1]+W,t[4][0]=t[4][0]+H+(V/4294967296>>>0)>>>0,t[4][1]=V>>>0,V=t[5][1]+P,t[5][0]=t[5][0]+X+(V/4294967296>>>0)>>>0,t[5][1]=V>>>0,V=t[6][1]+w,t[6][0]=t[6][0]+g+(V/4294967296>>>0)>>>0,t[6][1]=V>>>0,V=t[7][1]+C,t[7][0]=t[7][0]+S+(V/4294967296>>>0)>>>0,t[7][1]=V>>>0,Q-=128}}});var xj=m(I_=>{l();var sEe=yt();Qc();var Yi=sEe.asn1;I_.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};I_.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Yi.Class.UNIVERSAL,type:Yi.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var N_=m((Zst,Mj)=>{l();var sn=yt();gy();hf();e4();nr();var Aj=xj(),oEe=Aj.publicKeyValidator,aEe=Aj.privateKeyValidator;typeof Ij=="undefined"&&(Ij=sn.jsbn.BigInteger);var Ij,T_=sn.util.ByteBuffer,es=typeof Buffer=="undefined"?Uint8Array:Buffer;sn.pki=sn.pki||{};Mj.exports=sn.pki.ed25519=sn.ed25519=sn.ed25519||{};var St=sn.ed25519;St.constants={};St.constants.PUBLIC_KEY_BYTE_LENGTH=32;St.constants.PRIVATE_KEY_BYTE_LENGTH=64;St.constants.SEED_BYTE_LENGTH=32;St.constants.SIGN_BYTE_LENGTH=64;St.constants.HASH_BYTE_LENGTH=64;St.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=sn.random.getBytesSync(St.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==St.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+St.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=tu({message:e,encoding:"binary"});for(var r=new es(St.constants.PUBLIC_KEY_BYTE_LENGTH),i=new es(St.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)i[n]=e[n];return lEe(r,i),{publicKey:r,privateKey:i}};St.privateKeyFromAsn1=function(t){var e={},r=[],i=sn.asn1.validate(t,aEe,e,r);if(!i){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=sn.asn1.derToOid(e.privateKeyOid),o=sn.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var a=e.privateKey,c=tu({message:sn.asn1.fromDer(a).value,encoding:"binary"});return{privateKeyBytes:c}};St.publicKeyFromAsn1=function(t){var e={},r=[],i=sn.asn1.validate(t,oEe,e,r);if(!i){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=sn.asn1.derToOid(e.publicKeyOid),o=sn.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var a=e.ed25519PublicKey;if(a.length!==St.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return tu({message:a,encoding:"binary"})};St.publicKeyFromPrivateKey=function(t){t=t||{};var e=tu({message:t.privateKey,encoding:"binary"});if(e.length!==St.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+St.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new es(St.constants.PUBLIC_KEY_BYTE_LENGTH),i=0;i=0};function tu(t){var e=t.message;if(e instanceof Uint8Array||e instanceof es)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer!="undefined")return Buffer.from(e,r);e=new T_(e,r)}else if(!(e instanceof T_))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new es(e.length()),n=0;n=32;--i){for(r=0,n=i-32,s=i-12;n>8,e[n]-=r*256;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;++n)e[n]+=r-(e[31]>>4)*P_[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;++n)e[n]-=r*P_[n];for(i=0;i<32;++i)e[i+1]+=e[i]>>8,t[i]=e[i]&255}function C_(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;Pj(t,e)}function O_(t,e){var r=Je(),i=Je(),n=Je(),s=Je(),o=Je(),a=Je(),c=Je(),u=Je(),f=Je();I0(r,t[1],t[0]),I0(f,e[1],e[0]),sr(r,r,f),A0(i,t[0],t[1]),A0(f,e[0],e[1]),sr(i,i,f),sr(n,t[3],e[3]),sr(n,n,uEe),sr(s,t[2],e[2]),A0(s,s,s),I0(o,i,r),I0(a,s,n),A0(c,s,n),A0(u,i,r),sr(t[0],o,a),sr(t[1],u,c),sr(t[2],c,a),sr(t[3],o,u)}function Cj(t,e,r){for(var i=0;i<4;++i)Nj(t[i],e[i],r)}function k_(t,e){var r=Je(),i=Je(),n=Je();bEe(n,e[2]),sr(r,e[0],n),sr(i,e[1],n),r4(t,i),t[31]^=Dj(r)<<7}function r4(t,e){var r,i,n,s=Je(),o=Je();for(r=0;r<16;++r)o[r]=e[r];for(B_(o),B_(o),B_(o),i=0;i<2;++i){for(s[0]=o[0]-65517,r=1;r<15;++r)s[r]=o[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),n=s[15]>>16&1,s[14]&=65535,Nj(o,s,1-n)}for(r=0;r<16;r++)t[2*r]=o[r]&255,t[2*r+1]=o[r]>>8}function pEe(t,e){var r=Je(),i=Je(),n=Je(),s=Je(),o=Je(),a=Je(),c=Je();return gf(t[2],t4),yEe(t[1],e),Fl(n,t[1]),sr(s,n,cEe),I0(n,n,t[2]),A0(s,t[2],s),Fl(o,s),Fl(a,o),sr(c,a,o),sr(r,c,n),sr(r,r,s),gEe(r,r),sr(r,r,n),sr(r,r,s),sr(r,r,s),sr(t[0],r,s),Fl(i,t[0]),sr(i,i,s),Oj(i,n)&&sr(t[0],t[0],fEe),Fl(i,t[0]),sr(i,i,s),Oj(i,n)?-1:(Dj(t[0])===e[31]>>7&&I0(t[0],R_,t[0]),sr(t[3],t[0],t[1]),0)}function yEe(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function gEe(t,e){var r=Je(),i;for(i=0;i<16;++i)r[i]=e[i];for(i=250;i>=0;--i)Fl(r,r),i!==1&&sr(r,r,e);for(i=0;i<16;++i)t[i]=r[i]}function Oj(t,e){var r=new es(32),i=new es(32);return r4(r,t),r4(i,e),kj(r,0,i,0)}function kj(t,e,r,i){return mEe(t,e,r,i,32)}function mEe(t,e,r,i,n){var s,o=0;for(s=0;s>>8)-1}function Dj(t){var e=new es(32);return r4(e,t),e[0]&1}function Bj(t,e,r){var i,n;for(gf(t[0],R_),gf(t[1],t4),gf(t[2],t4),gf(t[3],R_),n=255;n>=0;--n)i=r[n/8|0]>>(n&7)&1,Cj(t,e,i),O_(e,t),O_(t,t),Cj(t,e,i)}function D_(t,e){var r=[Je(),Je(),Je(),Je()];gf(r[0],Tj),gf(r[1],Rj),gf(r[2],t4),sr(r[3],Tj,Rj),Bj(t,r,e)}function gf(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}function bEe(t,e){var r=Je(),i;for(i=0;i<16;++i)r[i]=e[i];for(i=253;i>=0;--i)Fl(r,r),i!==2&&i!==4&&sr(r,r,e);for(i=0;i<16;++i)t[i]=r[i]}function B_(t){var e,r,i=1;for(e=0;e<16;++e)r=t[e]+i+65535,i=Math.floor(r/65536),t[e]=r-i*65536;t[0]+=i-1+37*(i-1)}function Nj(t,e,r){for(var i,n=~(r-1),s=0;s<16;++s)i=n&(t[s]^e[s]),t[s]^=i,e[s]^=i}function Je(t){var e,r=new Float64Array(16);if(t)for(e=0;e{l();"use strict";var i4=65536;function vEe(t){let e=new Uint8Array(t),r=0;if(t>0)if(t>i4)for(;rt?(crypto.getRandomValues(e.subarray(r,r+(t-r))),r+=t-r):(crypto.getRandomValues(e.subarray(r,r+i4)),r+=i4);else crypto.getRandomValues(e);return e}Lj.exports=vEe});var _y=m((eot,jj)=>{l();"use strict";var wEe=qj(),_Ee=zo();jj.exports=function(t){if(isNaN(t)||t<=0)throw _Ee(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return wEe(t)}});var n4=m(Ey=>{l();"use strict";nr();gy();var EEe=yt(),{fromString:SEe}=(dt(),bi),{toString:Uj}=(tt(),hr),{concat:Fj}=(mn(),$s);Ey.bigIntegerToUintBase64url=(t,e)=>{let r=Uint8Array.from(t.abs().toByteArray());if(r=r[0]===0?r.slice(1):r,e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Fj([new Uint8Array(e-r.length),r])}return Uj(r,"base64url")};Ey.base64urlToBigInteger=t=>{let e=Ey.base64urlToBuffer(t);return new EEe.jsbn.BigInteger(Uj(e,"base16"),16)};Ey.base64urlToBuffer=(t,e)=>{let r=SEe(t,"base64urlpad");if(e!=null){if(r.length>e)throw new Error("byte array longer than desired length");r=Fj([new Uint8Array(e-r.length),r])}return r}});var zj=m(Sy=>{l();"use strict";Qc();my();var mf=yt(),{bigIntegerToUintBase64url:Fa,base64urlToBigInteger:Ka}=n4(),{fromString:Kj}=(dt(),bi),{toString:Vj}=(tt(),hr);Sy.pkcs1ToJwk=function(t){let e=mf.asn1.fromDer(Vj(t,"ascii")),r=mf.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:Fa(r.n),e:Fa(r.e),d:Fa(r.d),p:Fa(r.p),q:Fa(r.q),dp:Fa(r.dP),dq:Fa(r.dQ),qi:Fa(r.qInv),alg:"RS256",kid:"2011-04-29"}};Sy.jwkToPkcs1=function(t){let e=mf.pki.privateKeyToAsn1({n:Ka(t.n),e:Ka(t.e),d:Ka(t.d),p:Ka(t.p),q:Ka(t.q),dP:Ka(t.dp),dQ:Ka(t.dq),qInv:Ka(t.qi)});return Kj(mf.asn1.toDer(e).getBytes(),"ascii")};Sy.pkixToJwk=function(t){let e=mf.asn1.fromDer(Vj(t,"ascii")),r=mf.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:Fa(r.n),e:Fa(r.e),alg:"RS256",kid:"2011-04-29"}};Sy.jwkToPkix=function(t){let e=mf.pki.publicKeyToAsn1({n:Ka(t.n),e:Ka(t.e)});return Kj(mf.asn1.toDer(e).getBytes(),"ascii")}});var Wj=m((iot,$j)=>{l();"use strict";my();var Hj=yt(),{base64urlToBigInteger:xEe}=n4();function Gj(t,e){return e.map(r=>xEe(t[r]))}function AEe(t){return Hj.pki.setRsaPrivateKey(...Gj(t,["n","e","d","p","q","dp","dq","qi"]))}function IEe(t){return Hj.pki.setRsaPublicKey(...Gj(t,["n","e"]))}$j.exports={jwk2pub:IEe,jwk2priv:AEe}});var Qj=m(iu=>{l();"use strict";var ru=by(),TEe=_y(),{toString:REe}=(tt(),hr),{fromString:PEe}=(dt(),bi);iu.utils=zj();iu.generateKey=async function(t){let e=await ru.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await Yj(e);return{privateKey:r[0],publicKey:r[1]}};iu.unmarshalPrivateKey=async function(t){let r=[await ru.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await CEe(t)],i=await Yj({privateKey:r[0],publicKey:r[1]});return{privateKey:i[0],publicKey:i[1]}};iu.getRandomValues=TEe;iu.hashAndSign=async function(t,e){let r=await ru.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await ru.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(i,i.byteOffset,i.byteLength)};iu.hashAndVerify=async function(t,e,r){let i=await ru.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return ru.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,e,r)};function Yj(t){return Promise.all([ru.get().subtle.exportKey("jwk",t.privateKey),ru.get().subtle.exportKey("jwk",t.publicKey)])}function CEe(t){return ru.get().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}var{jwk2pub:OEe,jwk2priv:kEe}=Wj();function Xj(t,e,r,i){let n=e?OEe(t):kEe(t),s=REe(Uint8Array.from(r),"ascii"),o=i(s,n);return PEe(o,"ascii")}iu.encrypt=function(t,e){return Xj(t,!0,e,(r,i)=>i.encrypt(r))};iu.decrypt=function(t,e){return Xj(t,!1,e,(r,i)=>i.decrypt(r))}});var s4=m((sot,Zj)=>{l();"use strict";var{base64:DEe}=($2(),e0),BEe=S_();Zj.exports={export:async function(t,e){let i=await BEe.create().encrypt(t,e);return DEe.encode(i)}}});var iU=m((oot,rU)=>{l();"use strict";var{sha256:Jj}=(di(),zs),eU=zo(),{equals:tU}=(wi(),bn),{toString:NEe}=(tt(),hr);e4();N_();var o4=yt(),Qs=Qj(),a4=M6(),MEe=s4(),c4=class{constructor(e){this._key=e}async verify(e,r){return Qs.hashAndVerify(this._key,r,e)}marshal(){return Qs.utils.jwkToPkix(this._key)}get bytes(){return a4.PublicKey.encode({Type:a4.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(e){return Qs.encrypt(this._key,e)}equals(e){return tU(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Jj.digest(this.bytes);return e}},xy=class{constructor(e,r){this._key=e,this._publicKey=r}genSecret(){return Qs.getRandomValues(16)}async sign(e){return Qs.hashAndSign(this._key,e)}get public(){if(!this._publicKey)throw eU(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new c4(this._publicKey)}decrypt(e){return Qs.decrypt(this._key,e)}marshal(){return Qs.utils.jwkToPkcs1(this._key)}get bytes(){return a4.PrivateKey.encode({Type:a4.KeyType.RSA,Data:this.marshal()}).finish()}equals(e){return tU(this.bytes,e.bytes)}async hash(){let{bytes:e}=await Jj.digest(this.bytes);return e}async id(){let e=await this.public.hash();return NEe(e,"base58btc")}async export(e,r="pkcs-8"){if(r==="pkcs-8"){let i=new o4.util.ByteBuffer(this.marshal()),n=o4.asn1.fromDer(i),s=o4.pki.privateKeyFromAsn1(n),o={algorithm:"aes256",count:1e4,saltSize:128/8,prfAlgorithm:"sha512"};return o4.pki.encryptRsaPrivateKey(s,e,o)}else{if(r==="libp2p-key")return MEe.export(this.bytes,e);throw eU(new Error(`export format '${r}' is not supported`),"ERR_INVALID_EXPORT_FORMAT")}}};async function LEe(t){let e=Qs.utils.pkcs1ToJwk(t),r=await Qs.unmarshalPrivateKey(e);return new xy(r.privateKey,r.publicKey)}function qEe(t){let e=Qs.utils.pkixToJwk(t);return new c4(e)}async function jEe(t){let e=await Qs.unmarshalPrivateKey(t);return new xy(e.privateKey,e.publicKey)}async function UEe(t){let e=await Qs.generateKey(t);return new xy(e.privateKey,e.publicKey)}rU.exports={RsaPublicKey:c4,RsaPrivateKey:xy,unmarshalRsaPublicKey:qEe,unmarshalRsaPrivateKey:LEe,generateKeyPair:UEe,fromJwk:jEe}});var nU=m(Kl=>{l();"use strict";N_();var T0=yt();Kl.publicKeyLength=T0.pki.ed25519.constants.PUBLIC_KEY_BYTE_LENGTH;Kl.privateKeyLength=T0.pki.ed25519.constants.PRIVATE_KEY_BYTE_LENGTH;Kl.generateKey=async function(){return T0.pki.ed25519.generateKeyPair()};Kl.generateKeyFromSeed=async function(t){return T0.pki.ed25519.generateKeyPair({seed:t})};Kl.hashAndSign=async function(t,e){return T0.pki.ed25519.sign({message:e,privateKey:t})};Kl.hashAndVerify=async function(t,e,r){return T0.pki.ed25519.verify({signature:e,message:r,publicKey:t})}});var uU=m((cot,cU)=>{l();"use strict";var sU=zo(),{equals:oU}=(wi(),bn),{sha256:aU}=(di(),zs),{base58btc:FEe}=(li(),Fs),{identity:KEe}=(Gc(),G2),Sn=nU(),u4=M6(),VEe=s4(),f4=class{constructor(e){this._key=P0(e,Sn.publicKeyLength)}async verify(e,r){return Sn.hashAndVerify(this._key,r,e)}marshal(){return this._key}get bytes(){return u4.PublicKey.encode({Type:u4.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return oU(this.bytes,e.bytes)}async hash(){let{bytes:e}=await aU.digest(this.bytes);return e}},R0=class{constructor(e,r){this._key=P0(e,Sn.privateKeyLength),this._publicKey=P0(r,Sn.publicKeyLength)}async sign(e){return Sn.hashAndSign(this._key,e)}get public(){return new f4(this._publicKey)}marshal(){return this._key}get bytes(){return u4.PrivateKey.encode({Type:u4.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return oU(this.bytes,e.bytes)}async hash(){let{bytes:e}=await aU.digest(this.bytes);return e}async id(){let e=await KEe.digest(this.public.bytes);return FEe.encode(e.bytes).substring(1)}async export(e,r="libp2p-key"){if(r==="libp2p-key")return VEe.export(this.bytes,e);throw sU(new Error(`export format '${r}' is not supported`),"ERR_INVALID_EXPORT_FORMAT")}};function zEe(t){if(t.length>Sn.privateKeyLength){t=P0(t,Sn.privateKeyLength+Sn.publicKeyLength);let i=t.slice(0,Sn.privateKeyLength),n=t.slice(Sn.privateKeyLength,t.length);return new R0(i,n)}t=P0(t,Sn.privateKeyLength);let e=t.slice(0,Sn.privateKeyLength),r=t.slice(Sn.publicKeyLength);return new R0(e,r)}function HEe(t){return t=P0(t,Sn.publicKeyLength),new f4(t)}async function GEe(){let{privateKey:t,publicKey:e}=await Sn.generateKey();return new R0(t,e)}async function $Ee(t){let{privateKey:e,publicKey:r}=await Sn.generateKeyFromSeed(t);return new R0(e,r)}function P0(t,e){if(t=Uint8Array.from(t||[]),t.length!==e)throw sU(new Error(`Key must be a Uint8Array of length ${e}, got ${t.length}`),"ERR_INVALID_KEY_TYPE");return t}cU.exports={Ed25519PublicKey:f4,Ed25519PrivateKey:R0,unmarshalEd25519PrivateKey:zEe,unmarshalEd25519PublicKey:HEe,generateKeyPair:GEe,generateKeyPairFromSeed:$Ee}});var lU=m((uot,fU)=>{l();var $t={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function Zs(t,e){if(!t)throw new Error(e)}function Mt(t,e,r){if(Zs(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),r!==void 0)if(Array.isArray(r)){let i=r.join(", "),n=`Expected ${t} to be an Uint8Array with length [${i}]`;Zs(r.includes(e.length),n)}else{let i=`Expected ${t} to be an Uint8Array with length ${r}`;Zs(e.length===r,i)}}function Vl(t){Zs(C0(t)==="Boolean","Expected compressed to be a Boolean")}function Ho(t=r=>new Uint8Array(r),e){return typeof t=="function"&&(t=t(e)),Mt("output",t,e),t}function C0(t){return Object.prototype.toString.call(t).slice(8,-1)}fU.exports=t=>({contextRandomize(e){switch(Zs(e===null||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),e!==null&&Mt("seed",e,32),t.contextRandomize(e)){case 1:throw new Error($t.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(e){return Mt("private key",e,32),t.privateKeyVerify(e)===0},privateKeyNegate(e){switch(Mt("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error($t.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(e,r){switch(Mt("private key",e,32),Mt("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error($t.TWEAK_ADD)}},privateKeyTweakMul(e,r){switch(Mt("private key",e,32),Mt("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error($t.TWEAK_MUL)}},publicKeyVerify(e){return Mt("public key",e,[33,65]),t.publicKeyVerify(e)===0},publicKeyCreate(e,r=!0,i){switch(Mt("private key",e,32),Vl(r),i=Ho(i,r?33:65),t.publicKeyCreate(i,e)){case 0:return i;case 1:throw new Error($t.SECKEY_INVALID);case 2:throw new Error($t.PUBKEY_SERIALIZE)}},publicKeyConvert(e,r=!0,i){switch(Mt("public key",e,[33,65]),Vl(r),i=Ho(i,r?33:65),t.publicKeyConvert(i,e)){case 0:return i;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.PUBKEY_SERIALIZE)}},publicKeyNegate(e,r=!0,i){switch(Mt("public key",e,[33,65]),Vl(r),i=Ho(i,r?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.IMPOSSIBLE_CASE);case 3:throw new Error($t.PUBKEY_SERIALIZE)}},publicKeyCombine(e,r=!0,i){Zs(Array.isArray(e),"Expected public keys to be an Array"),Zs(e.length>0,"Expected public keys array will have more than zero items");for(let n of e)Mt("public key",n,[33,65]);switch(Vl(r),i=Ho(i,r?33:65),t.publicKeyCombine(i,e)){case 0:return i;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.PUBKEY_COMBINE);case 3:throw new Error($t.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(e,r,i=!0,n){switch(Mt("public key",e,[33,65]),Mt("tweak",r,32),Vl(i),n=Ho(n,i?33:65),t.publicKeyTweakAdd(n,e,r)){case 0:return n;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.TWEAK_ADD)}},publicKeyTweakMul(e,r,i=!0,n){switch(Mt("public key",e,[33,65]),Mt("tweak",r,32),Vl(i),n=Ho(n,i?33:65),t.publicKeyTweakMul(n,e,r)){case 0:return n;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.TWEAK_MUL)}},signatureNormalize(e){switch(Mt("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error($t.SIG_PARSE)}},signatureExport(e,r){Mt("signature",e,64),r=Ho(r,72);let i={output:r,outputlen:72};switch(t.signatureExport(i,e)){case 0:return r.slice(0,i.outputlen);case 1:throw new Error($t.SIG_PARSE);case 2:throw new Error($t.IMPOSSIBLE_CASE)}},signatureImport(e,r){switch(Mt("signature",e),r=Ho(r,64),t.signatureImport(r,e)){case 0:return r;case 1:throw new Error($t.SIG_PARSE);case 2:throw new Error($t.IMPOSSIBLE_CASE)}},ecdsaSign(e,r,i={},n){Mt("message",e,32),Mt("private key",r,32),Zs(C0(i)==="Object","Expected options to be an Object"),i.data!==void 0&&Mt("options.data",i.data),i.noncefn!==void 0&&Zs(C0(i.noncefn)==="Function","Expected options.noncefn to be a Function"),n=Ho(n,64);let s={signature:n,recid:null};switch(t.ecdsaSign(s,e,r,i.data,i.noncefn)){case 0:return s;case 1:throw new Error($t.SIGN);case 2:throw new Error($t.IMPOSSIBLE_CASE)}},ecdsaVerify(e,r,i){switch(Mt("signature",e,64),Mt("message",r,32),Mt("public key",i,[33,65]),t.ecdsaVerify(e,r,i)){case 0:return!0;case 3:return!1;case 1:throw new Error($t.SIG_PARSE);case 2:throw new Error($t.PUBKEY_PARSE)}},ecdsaRecover(e,r,i,n=!0,s){switch(Mt("signature",e,64),Zs(C0(r)==="Number"&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),Mt("message",i,32),Vl(n),s=Ho(s,n?33:65),t.ecdsaRecover(s,e,r,i)){case 0:return s;case 1:throw new Error($t.SIG_PARSE);case 2:throw new Error($t.RECOVER);case 3:throw new Error($t.IMPOSSIBLE_CASE)}},ecdh(e,r,i={},n){switch(Mt("public key",e,[33,65]),Mt("private key",r,32),Zs(C0(i)==="Object","Expected options to be an Object"),i.data!==void 0&&Mt("options.data",i.data),i.hashfn!==void 0?(Zs(C0(i.hashfn)==="Function","Expected options.hashfn to be a Function"),i.xbuf!==void 0&&Mt("options.xbuf",i.xbuf,32),i.ybuf!==void 0&&Mt("options.ybuf",i.ybuf,32),Mt("output",n)):n=Ho(n,32),t.ecdh(n,e,r,i.data,i.hashfn,i.xbuf,i.ybuf)){case 0:return n;case 1:throw new Error($t.PUBKEY_PARSE);case 2:throw new Error($t.ECDH)}}})});var dU=m((fot,WEe)=>{WEe.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var hU=m(()=>{l()});var Va=m((pU,M_)=>{l();(function(t,e){"use strict";function r(P,g){if(!P)throw new Error(g||"Assertion failed")}function i(P,g){P.super_=g;var w=function(){};w.prototype=g.prototype,P.prototype=new w,P.prototype.constructor=P}function n(P,g,w){if(n.isBN(P))return P;this.negative=0,this.words=null,this.length=0,this.red=null,P!==null&&((g==="le"||g==="be")&&(w=g,g=10),this._init(P||0,g||10,w||"be"))}typeof t=="object"?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=hU().Buffer}catch(P){}n.isBN=function(g){return g instanceof n?!0:g!==null&&typeof g=="object"&&g.constructor.wordSize===n.wordSize&&Array.isArray(g.words)},n.max=function(g,w){return g.cmp(w)>0?g:w},n.min=function(g,w){return g.cmp(w)<0?g:w},n.prototype._init=function(g,w,S){if(typeof g=="number")return this._initNumber(g,w,S);if(typeof g=="object")return this._initArray(g,w,S);w==="hex"&&(w=16),r(w===(w|0)&&w>=2&&w<=36),g=g.toString().replace(/\s+/g,"");var C=0;g[0]==="-"&&(C++,this.negative=1),C=0;C-=3)Y=g[C]|g[C-1]<<8|g[C-2]<<16,this.words[L]|=Y<>>26-V&67108863,V+=24,V>=26&&(V-=26,L++);else if(S==="le")for(C=0,L=0;C>>26-V&67108863,V+=24,V>=26&&(V-=26,L++);return this.strip()};function o(P,g){var w=P.charCodeAt(g);return w>=65&&w<=70?w-55:w>=97&&w<=102?w-87:w-48&15}function a(P,g,w){var S=o(P,w);return w-1>=g&&(S|=o(P,w-1)<<4),S}n.prototype._parseHex=function(g,w,S){this.length=Math.ceil((g.length-w)/6),this.words=new Array(this.length);for(var C=0;C=w;C-=2)V=a(g,w,C)<=18?(L-=18,Y+=1,this.words[Y]|=V>>>26):L+=8;else{var q=g.length-w;for(C=q%2==0?w+1:w;C=18?(L-=18,Y+=1,this.words[Y]|=V>>>26):L+=8}this.strip()};function c(P,g,w,S){for(var C=0,L=Math.min(P.length,w),Y=g;Y=49?C+=V-49+10:V>=17?C+=V-17+10:C+=V}return C}n.prototype._parseBase=function(g,w,S){this.words=[0],this.length=1;for(var C=0,L=1;L<=67108863;L*=w)C++;C--,L=L/w|0;for(var Y=g.length-S,V=Y%C,q=Math.min(Y,Y-V)+S,_=0,j=S;j1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(g,w){g=g||10,w=w|0||1;var S;if(g===16||g==="hex"){S="";for(var C=0,L=0,Y=0;Y>>24-C&16777215,L!==0||Y!==this.length-1?S=u[6-q.length]+q+S:S=q+S,C+=2,C>=26&&(C-=26,Y--)}for(L!==0&&(S=L.toString(16)+S);S.length%w!=0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(g===(g|0)&&g>=2&&g<=36){var _=f[g],j=d[g];S="";var de=this.clone();for(de.negative=0;!de.isZero();){var Q=de.modn(j).toString(g);de=de.idivn(j),de.isZero()?S=Q+S:S=u[_-Q.length]+Q+S}for(this.isZero()&&(S="0"+S);S.length%w!=0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var g=this.words[0];return this.length===2?g+=this.words[1]*67108864:this.length===3&&this.words[2]===1?g+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-g:g},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(g,w){return r(typeof s!="undefined"),this.toArrayLike(s,g,w)},n.prototype.toArray=function(g,w){return this.toArrayLike(Array,g,w)},n.prototype.toArrayLike=function(g,w,S){var C=this.byteLength(),L=S||Math.max(1,C);r(C<=L,"byte array longer than desired length"),r(L>0,"Requested array length <= 0"),this.strip();var Y=w==="le",V=new g(L),q,_,j=this.clone();if(Y){for(_=0;!j.isZero();_++)q=j.andln(255),j.iushrn(8),V[_]=q;for(;_=4096&&(S+=13,w>>>=13),w>=64&&(S+=7,w>>>=7),w>=8&&(S+=4,w>>>=4),w>=2&&(S+=2,w>>>=2),S+w},n.prototype._zeroBits=function(g){if(g===0)return 26;var w=g,S=0;return(w&8191)==0&&(S+=13,w>>>=13),(w&127)==0&&(S+=7,w>>>=7),(w&15)==0&&(S+=4,w>>>=4),(w&3)==0&&(S+=2,w>>>=2),(w&1)==0&&S++,S},n.prototype.bitLength=function(){var g=this.words[this.length-1],w=this._countBits(g);return(this.length-1)*26+w};function h(P){for(var g=new Array(P.bitLength()),w=0;w>>C}return g}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var g=0,w=0;wg.length?this.clone().ior(g):g.clone().ior(this)},n.prototype.uor=function(g){return this.length>g.length?this.clone().iuor(g):g.clone().iuor(this)},n.prototype.iuand=function(g){var w;this.length>g.length?w=g:w=this;for(var S=0;Sg.length?this.clone().iand(g):g.clone().iand(this)},n.prototype.uand=function(g){return this.length>g.length?this.clone().iuand(g):g.clone().iuand(this)},n.prototype.iuxor=function(g){var w,S;this.length>g.length?(w=this,S=g):(w=g,S=this);for(var C=0;Cg.length?this.clone().ixor(g):g.clone().ixor(this)},n.prototype.uxor=function(g){return this.length>g.length?this.clone().iuxor(g):g.clone().iuxor(this)},n.prototype.inotn=function(g){r(typeof g=="number"&&g>=0);var w=Math.ceil(g/26)|0,S=g%26;this._expand(w),S>0&&w--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-S),this.strip()},n.prototype.notn=function(g){return this.clone().inotn(g)},n.prototype.setn=function(g,w){r(typeof g=="number"&&g>=0);var S=g/26|0,C=g%26;return this._expand(S+1),w?this.words[S]=this.words[S]|1<g.length?(S=this,C=g):(S=g,C=this);for(var L=0,Y=0;Y>>26;for(;L!==0&&Y>>26;if(this.length=S.length,L!==0)this.words[this.length]=L,this.length++;else if(S!==this)for(;Yg.length?this.clone().iadd(g):g.clone().iadd(this)},n.prototype.isub=function(g){if(g.negative!==0){g.negative=0;var w=this.iadd(g);return g.negative=1,w._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(g),this.negative=1,this._normSign();var S=this.cmp(g);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,L;S>0?(C=this,L=g):(C=g,L=this);for(var Y=0,V=0;V>26,this.words[V]=w&67108863;for(;Y!==0&&V>26,this.words[V]=w&67108863;if(Y===0&&V>>26,de=q&67108863,Q=Math.min(_,g.length-1),ue=Math.max(0,_-P.length+1);ue<=Q;ue++){var le=_-ue|0;C=P.words[le]|0,L=g.words[ue]|0,Y=C*L+de,j+=Y/67108864|0,de=Y&67108863}w.words[_]=de|0,q=j|0}return q!==0?w.words[_]=q|0:w.length--,w.strip()}var y=function(g,w,S){var C=g.words,L=w.words,Y=S.words,V=0,q,_,j,de=C[0]|0,Q=de&8191,ue=de>>>13,le=C[1]|0,me=le&8191,be=le>>>13,xe=C[2]|0,k=xe&8191,K=xe>>>13,$=C[3]|0,ee=$&8191,I=$>>>13,U=C[4]|0,z=U&8191,N=U>>>13,Z=C[5]|0,ie=Z&8191,te=Z>>>13,he=C[6]|0,we=he&8191,_e=he>>>13,Ke=C[7]|0,Pe=Ke&8191,Ve=Ke>>>13,et=C[8]|0,He=et&8191,ze=et>>>13,mt=C[9]|0,tr=mt&8191,fr=mt>>>13,Dn=L[0]|0,Xt=Dn&8191,Ot=Dn>>>13,ci=L[1]|0,nt=ci&8191,Dr=ci>>>13,w3=L[2]|0,Mr=w3&8191,Lr=w3>>>13,_3=L[3]|0,qr=_3&8191,jr=_3>>>13,E3=L[4]|0,Ur=E3&8191,Fr=E3>>>13,S3=L[5]|0,Kr=S3&8191,Vr=S3>>>13,x3=L[6]|0,zr=x3&8191,Hr=x3>>>13,A3=L[7]|0,Gr=A3&8191,$r=A3>>>13,I3=L[8]|0,Wr=I3&8191,Yr=I3>>>13,T3=L[9]|0,Xr=T3&8191,lr=T3>>>13;S.negative=g.negative^w.negative,S.length=19,q=Math.imul(Q,Xt),_=Math.imul(Q,Ot),_=_+Math.imul(ue,Xt)|0,j=Math.imul(ue,Ot);var Ch=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(Ch>>>26)|0,Ch&=67108863,q=Math.imul(me,Xt),_=Math.imul(me,Ot),_=_+Math.imul(be,Xt)|0,j=Math.imul(be,Ot),q=q+Math.imul(Q,nt)|0,_=_+Math.imul(Q,Dr)|0,_=_+Math.imul(ue,nt)|0,j=j+Math.imul(ue,Dr)|0;var l2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(l2>>>26)|0,l2&=67108863,q=Math.imul(k,Xt),_=Math.imul(k,Ot),_=_+Math.imul(K,Xt)|0,j=Math.imul(K,Ot),q=q+Math.imul(me,nt)|0,_=_+Math.imul(me,Dr)|0,_=_+Math.imul(be,nt)|0,j=j+Math.imul(be,Dr)|0,q=q+Math.imul(Q,Mr)|0,_=_+Math.imul(Q,Lr)|0,_=_+Math.imul(ue,Mr)|0,j=j+Math.imul(ue,Lr)|0;var d2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(d2>>>26)|0,d2&=67108863,q=Math.imul(ee,Xt),_=Math.imul(ee,Ot),_=_+Math.imul(I,Xt)|0,j=Math.imul(I,Ot),q=q+Math.imul(k,nt)|0,_=_+Math.imul(k,Dr)|0,_=_+Math.imul(K,nt)|0,j=j+Math.imul(K,Dr)|0,q=q+Math.imul(me,Mr)|0,_=_+Math.imul(me,Lr)|0,_=_+Math.imul(be,Mr)|0,j=j+Math.imul(be,Lr)|0,q=q+Math.imul(Q,qr)|0,_=_+Math.imul(Q,jr)|0,_=_+Math.imul(ue,qr)|0,j=j+Math.imul(ue,jr)|0;var h2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(h2>>>26)|0,h2&=67108863,q=Math.imul(z,Xt),_=Math.imul(z,Ot),_=_+Math.imul(N,Xt)|0,j=Math.imul(N,Ot),q=q+Math.imul(ee,nt)|0,_=_+Math.imul(ee,Dr)|0,_=_+Math.imul(I,nt)|0,j=j+Math.imul(I,Dr)|0,q=q+Math.imul(k,Mr)|0,_=_+Math.imul(k,Lr)|0,_=_+Math.imul(K,Mr)|0,j=j+Math.imul(K,Lr)|0,q=q+Math.imul(me,qr)|0,_=_+Math.imul(me,jr)|0,_=_+Math.imul(be,qr)|0,j=j+Math.imul(be,jr)|0,q=q+Math.imul(Q,Ur)|0,_=_+Math.imul(Q,Fr)|0,_=_+Math.imul(ue,Ur)|0,j=j+Math.imul(ue,Fr)|0;var p2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(p2>>>26)|0,p2&=67108863,q=Math.imul(ie,Xt),_=Math.imul(ie,Ot),_=_+Math.imul(te,Xt)|0,j=Math.imul(te,Ot),q=q+Math.imul(z,nt)|0,_=_+Math.imul(z,Dr)|0,_=_+Math.imul(N,nt)|0,j=j+Math.imul(N,Dr)|0,q=q+Math.imul(ee,Mr)|0,_=_+Math.imul(ee,Lr)|0,_=_+Math.imul(I,Mr)|0,j=j+Math.imul(I,Lr)|0,q=q+Math.imul(k,qr)|0,_=_+Math.imul(k,jr)|0,_=_+Math.imul(K,qr)|0,j=j+Math.imul(K,jr)|0,q=q+Math.imul(me,Ur)|0,_=_+Math.imul(me,Fr)|0,_=_+Math.imul(be,Ur)|0,j=j+Math.imul(be,Fr)|0,q=q+Math.imul(Q,Kr)|0,_=_+Math.imul(Q,Vr)|0,_=_+Math.imul(ue,Kr)|0,j=j+Math.imul(ue,Vr)|0;var y2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(y2>>>26)|0,y2&=67108863,q=Math.imul(we,Xt),_=Math.imul(we,Ot),_=_+Math.imul(_e,Xt)|0,j=Math.imul(_e,Ot),q=q+Math.imul(ie,nt)|0,_=_+Math.imul(ie,Dr)|0,_=_+Math.imul(te,nt)|0,j=j+Math.imul(te,Dr)|0,q=q+Math.imul(z,Mr)|0,_=_+Math.imul(z,Lr)|0,_=_+Math.imul(N,Mr)|0,j=j+Math.imul(N,Lr)|0,q=q+Math.imul(ee,qr)|0,_=_+Math.imul(ee,jr)|0,_=_+Math.imul(I,qr)|0,j=j+Math.imul(I,jr)|0,q=q+Math.imul(k,Ur)|0,_=_+Math.imul(k,Fr)|0,_=_+Math.imul(K,Ur)|0,j=j+Math.imul(K,Fr)|0,q=q+Math.imul(me,Kr)|0,_=_+Math.imul(me,Vr)|0,_=_+Math.imul(be,Kr)|0,j=j+Math.imul(be,Vr)|0,q=q+Math.imul(Q,zr)|0,_=_+Math.imul(Q,Hr)|0,_=_+Math.imul(ue,zr)|0,j=j+Math.imul(ue,Hr)|0;var Oo=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,q=Math.imul(Pe,Xt),_=Math.imul(Pe,Ot),_=_+Math.imul(Ve,Xt)|0,j=Math.imul(Ve,Ot),q=q+Math.imul(we,nt)|0,_=_+Math.imul(we,Dr)|0,_=_+Math.imul(_e,nt)|0,j=j+Math.imul(_e,Dr)|0,q=q+Math.imul(ie,Mr)|0,_=_+Math.imul(ie,Lr)|0,_=_+Math.imul(te,Mr)|0,j=j+Math.imul(te,Lr)|0,q=q+Math.imul(z,qr)|0,_=_+Math.imul(z,jr)|0,_=_+Math.imul(N,qr)|0,j=j+Math.imul(N,jr)|0,q=q+Math.imul(ee,Ur)|0,_=_+Math.imul(ee,Fr)|0,_=_+Math.imul(I,Ur)|0,j=j+Math.imul(I,Fr)|0,q=q+Math.imul(k,Kr)|0,_=_+Math.imul(k,Vr)|0,_=_+Math.imul(K,Kr)|0,j=j+Math.imul(K,Vr)|0,q=q+Math.imul(me,zr)|0,_=_+Math.imul(me,Hr)|0,_=_+Math.imul(be,zr)|0,j=j+Math.imul(be,Hr)|0,q=q+Math.imul(Q,Gr)|0,_=_+Math.imul(Q,$r)|0,_=_+Math.imul(ue,Gr)|0,j=j+Math.imul(ue,$r)|0;var g2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(g2>>>26)|0,g2&=67108863,q=Math.imul(He,Xt),_=Math.imul(He,Ot),_=_+Math.imul(ze,Xt)|0,j=Math.imul(ze,Ot),q=q+Math.imul(Pe,nt)|0,_=_+Math.imul(Pe,Dr)|0,_=_+Math.imul(Ve,nt)|0,j=j+Math.imul(Ve,Dr)|0,q=q+Math.imul(we,Mr)|0,_=_+Math.imul(we,Lr)|0,_=_+Math.imul(_e,Mr)|0,j=j+Math.imul(_e,Lr)|0,q=q+Math.imul(ie,qr)|0,_=_+Math.imul(ie,jr)|0,_=_+Math.imul(te,qr)|0,j=j+Math.imul(te,jr)|0,q=q+Math.imul(z,Ur)|0,_=_+Math.imul(z,Fr)|0,_=_+Math.imul(N,Ur)|0,j=j+Math.imul(N,Fr)|0,q=q+Math.imul(ee,Kr)|0,_=_+Math.imul(ee,Vr)|0,_=_+Math.imul(I,Kr)|0,j=j+Math.imul(I,Vr)|0,q=q+Math.imul(k,zr)|0,_=_+Math.imul(k,Hr)|0,_=_+Math.imul(K,zr)|0,j=j+Math.imul(K,Hr)|0,q=q+Math.imul(me,Gr)|0,_=_+Math.imul(me,$r)|0,_=_+Math.imul(be,Gr)|0,j=j+Math.imul(be,$r)|0,q=q+Math.imul(Q,Wr)|0,_=_+Math.imul(Q,Yr)|0,_=_+Math.imul(ue,Wr)|0,j=j+Math.imul(ue,Yr)|0;var m2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(m2>>>26)|0,m2&=67108863,q=Math.imul(tr,Xt),_=Math.imul(tr,Ot),_=_+Math.imul(fr,Xt)|0,j=Math.imul(fr,Ot),q=q+Math.imul(He,nt)|0,_=_+Math.imul(He,Dr)|0,_=_+Math.imul(ze,nt)|0,j=j+Math.imul(ze,Dr)|0,q=q+Math.imul(Pe,Mr)|0,_=_+Math.imul(Pe,Lr)|0,_=_+Math.imul(Ve,Mr)|0,j=j+Math.imul(Ve,Lr)|0,q=q+Math.imul(we,qr)|0,_=_+Math.imul(we,jr)|0,_=_+Math.imul(_e,qr)|0,j=j+Math.imul(_e,jr)|0,q=q+Math.imul(ie,Ur)|0,_=_+Math.imul(ie,Fr)|0,_=_+Math.imul(te,Ur)|0,j=j+Math.imul(te,Fr)|0,q=q+Math.imul(z,Kr)|0,_=_+Math.imul(z,Vr)|0,_=_+Math.imul(N,Kr)|0,j=j+Math.imul(N,Vr)|0,q=q+Math.imul(ee,zr)|0,_=_+Math.imul(ee,Hr)|0,_=_+Math.imul(I,zr)|0,j=j+Math.imul(I,Hr)|0,q=q+Math.imul(k,Gr)|0,_=_+Math.imul(k,$r)|0,_=_+Math.imul(K,Gr)|0,j=j+Math.imul(K,$r)|0,q=q+Math.imul(me,Wr)|0,_=_+Math.imul(me,Yr)|0,_=_+Math.imul(be,Wr)|0,j=j+Math.imul(be,Yr)|0,q=q+Math.imul(Q,Xr)|0,_=_+Math.imul(Q,lr)|0,_=_+Math.imul(ue,Xr)|0,j=j+Math.imul(ue,lr)|0;var b2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(b2>>>26)|0,b2&=67108863,q=Math.imul(tr,nt),_=Math.imul(tr,Dr),_=_+Math.imul(fr,nt)|0,j=Math.imul(fr,Dr),q=q+Math.imul(He,Mr)|0,_=_+Math.imul(He,Lr)|0,_=_+Math.imul(ze,Mr)|0,j=j+Math.imul(ze,Lr)|0,q=q+Math.imul(Pe,qr)|0,_=_+Math.imul(Pe,jr)|0,_=_+Math.imul(Ve,qr)|0,j=j+Math.imul(Ve,jr)|0,q=q+Math.imul(we,Ur)|0,_=_+Math.imul(we,Fr)|0,_=_+Math.imul(_e,Ur)|0,j=j+Math.imul(_e,Fr)|0,q=q+Math.imul(ie,Kr)|0,_=_+Math.imul(ie,Vr)|0,_=_+Math.imul(te,Kr)|0,j=j+Math.imul(te,Vr)|0,q=q+Math.imul(z,zr)|0,_=_+Math.imul(z,Hr)|0,_=_+Math.imul(N,zr)|0,j=j+Math.imul(N,Hr)|0,q=q+Math.imul(ee,Gr)|0,_=_+Math.imul(ee,$r)|0,_=_+Math.imul(I,Gr)|0,j=j+Math.imul(I,$r)|0,q=q+Math.imul(k,Wr)|0,_=_+Math.imul(k,Yr)|0,_=_+Math.imul(K,Wr)|0,j=j+Math.imul(K,Yr)|0,q=q+Math.imul(me,Xr)|0,_=_+Math.imul(me,lr)|0,_=_+Math.imul(be,Xr)|0,j=j+Math.imul(be,lr)|0;var v2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(v2>>>26)|0,v2&=67108863,q=Math.imul(tr,Mr),_=Math.imul(tr,Lr),_=_+Math.imul(fr,Mr)|0,j=Math.imul(fr,Lr),q=q+Math.imul(He,qr)|0,_=_+Math.imul(He,jr)|0,_=_+Math.imul(ze,qr)|0,j=j+Math.imul(ze,jr)|0,q=q+Math.imul(Pe,Ur)|0,_=_+Math.imul(Pe,Fr)|0,_=_+Math.imul(Ve,Ur)|0,j=j+Math.imul(Ve,Fr)|0,q=q+Math.imul(we,Kr)|0,_=_+Math.imul(we,Vr)|0,_=_+Math.imul(_e,Kr)|0,j=j+Math.imul(_e,Vr)|0,q=q+Math.imul(ie,zr)|0,_=_+Math.imul(ie,Hr)|0,_=_+Math.imul(te,zr)|0,j=j+Math.imul(te,Hr)|0,q=q+Math.imul(z,Gr)|0,_=_+Math.imul(z,$r)|0,_=_+Math.imul(N,Gr)|0,j=j+Math.imul(N,$r)|0,q=q+Math.imul(ee,Wr)|0,_=_+Math.imul(ee,Yr)|0,_=_+Math.imul(I,Wr)|0,j=j+Math.imul(I,Yr)|0,q=q+Math.imul(k,Xr)|0,_=_+Math.imul(k,lr)|0,_=_+Math.imul(K,Xr)|0,j=j+Math.imul(K,lr)|0;var w2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(w2>>>26)|0,w2&=67108863,q=Math.imul(tr,qr),_=Math.imul(tr,jr),_=_+Math.imul(fr,qr)|0,j=Math.imul(fr,jr),q=q+Math.imul(He,Ur)|0,_=_+Math.imul(He,Fr)|0,_=_+Math.imul(ze,Ur)|0,j=j+Math.imul(ze,Fr)|0,q=q+Math.imul(Pe,Kr)|0,_=_+Math.imul(Pe,Vr)|0,_=_+Math.imul(Ve,Kr)|0,j=j+Math.imul(Ve,Vr)|0,q=q+Math.imul(we,zr)|0,_=_+Math.imul(we,Hr)|0,_=_+Math.imul(_e,zr)|0,j=j+Math.imul(_e,Hr)|0,q=q+Math.imul(ie,Gr)|0,_=_+Math.imul(ie,$r)|0,_=_+Math.imul(te,Gr)|0,j=j+Math.imul(te,$r)|0,q=q+Math.imul(z,Wr)|0,_=_+Math.imul(z,Yr)|0,_=_+Math.imul(N,Wr)|0,j=j+Math.imul(N,Yr)|0,q=q+Math.imul(ee,Xr)|0,_=_+Math.imul(ee,lr)|0,_=_+Math.imul(I,Xr)|0,j=j+Math.imul(I,lr)|0;var _2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(_2>>>26)|0,_2&=67108863,q=Math.imul(tr,Ur),_=Math.imul(tr,Fr),_=_+Math.imul(fr,Ur)|0,j=Math.imul(fr,Fr),q=q+Math.imul(He,Kr)|0,_=_+Math.imul(He,Vr)|0,_=_+Math.imul(ze,Kr)|0,j=j+Math.imul(ze,Vr)|0,q=q+Math.imul(Pe,zr)|0,_=_+Math.imul(Pe,Hr)|0,_=_+Math.imul(Ve,zr)|0,j=j+Math.imul(Ve,Hr)|0,q=q+Math.imul(we,Gr)|0,_=_+Math.imul(we,$r)|0,_=_+Math.imul(_e,Gr)|0,j=j+Math.imul(_e,$r)|0,q=q+Math.imul(ie,Wr)|0,_=_+Math.imul(ie,Yr)|0,_=_+Math.imul(te,Wr)|0,j=j+Math.imul(te,Yr)|0,q=q+Math.imul(z,Xr)|0,_=_+Math.imul(z,lr)|0,_=_+Math.imul(N,Xr)|0,j=j+Math.imul(N,lr)|0;var E2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(E2>>>26)|0,E2&=67108863,q=Math.imul(tr,Kr),_=Math.imul(tr,Vr),_=_+Math.imul(fr,Kr)|0,j=Math.imul(fr,Vr),q=q+Math.imul(He,zr)|0,_=_+Math.imul(He,Hr)|0,_=_+Math.imul(ze,zr)|0,j=j+Math.imul(ze,Hr)|0,q=q+Math.imul(Pe,Gr)|0,_=_+Math.imul(Pe,$r)|0,_=_+Math.imul(Ve,Gr)|0,j=j+Math.imul(Ve,$r)|0,q=q+Math.imul(we,Wr)|0,_=_+Math.imul(we,Yr)|0,_=_+Math.imul(_e,Wr)|0,j=j+Math.imul(_e,Yr)|0,q=q+Math.imul(ie,Xr)|0,_=_+Math.imul(ie,lr)|0,_=_+Math.imul(te,Xr)|0,j=j+Math.imul(te,lr)|0;var S2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(S2>>>26)|0,S2&=67108863,q=Math.imul(tr,zr),_=Math.imul(tr,Hr),_=_+Math.imul(fr,zr)|0,j=Math.imul(fr,Hr),q=q+Math.imul(He,Gr)|0,_=_+Math.imul(He,$r)|0,_=_+Math.imul(ze,Gr)|0,j=j+Math.imul(ze,$r)|0,q=q+Math.imul(Pe,Wr)|0,_=_+Math.imul(Pe,Yr)|0,_=_+Math.imul(Ve,Wr)|0,j=j+Math.imul(Ve,Yr)|0,q=q+Math.imul(we,Xr)|0,_=_+Math.imul(we,lr)|0,_=_+Math.imul(_e,Xr)|0,j=j+Math.imul(_e,lr)|0;var x2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(x2>>>26)|0,x2&=67108863,q=Math.imul(tr,Gr),_=Math.imul(tr,$r),_=_+Math.imul(fr,Gr)|0,j=Math.imul(fr,$r),q=q+Math.imul(He,Wr)|0,_=_+Math.imul(He,Yr)|0,_=_+Math.imul(ze,Wr)|0,j=j+Math.imul(ze,Yr)|0,q=q+Math.imul(Pe,Xr)|0,_=_+Math.imul(Pe,lr)|0,_=_+Math.imul(Ve,Xr)|0,j=j+Math.imul(Ve,lr)|0;var Ti=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,q=Math.imul(tr,Wr),_=Math.imul(tr,Yr),_=_+Math.imul(fr,Wr)|0,j=Math.imul(fr,Yr),q=q+Math.imul(He,Xr)|0,_=_+Math.imul(He,lr)|0,_=_+Math.imul(ze,Xr)|0,j=j+Math.imul(ze,lr)|0;var A2=(V+q|0)+((_&8191)<<13)|0;V=(j+(_>>>13)|0)+(A2>>>26)|0,A2&=67108863,q=Math.imul(tr,Xr),_=Math.imul(tr,lr),_=_+Math.imul(fr,Xr)|0,j=Math.imul(fr,lr);var I2=(V+q|0)+((_&8191)<<13)|0;return V=(j+(_>>>13)|0)+(I2>>>26)|0,I2&=67108863,Y[0]=Ch,Y[1]=l2,Y[2]=d2,Y[3]=h2,Y[4]=p2,Y[5]=y2,Y[6]=Oo,Y[7]=g2,Y[8]=m2,Y[9]=b2,Y[10]=v2,Y[11]=w2,Y[12]=_2,Y[13]=E2,Y[14]=S2,Y[15]=x2,Y[16]=Ti,Y[17]=A2,Y[18]=I2,V!==0&&(Y[19]=V,S.length++),S};Math.imul||(y=p);function b(P,g,w){w.negative=g.negative^P.negative,w.length=P.length+g.length;for(var S=0,C=0,L=0;L>>26)|0,C+=Y>>>26,Y&=67108863}w.words[L]=V,S=Y,Y=C}return S!==0?w.words[L]=S:w.length--,w.strip()}function E(P,g,w){var S=new v;return S.mulp(P,g,w)}n.prototype.mulTo=function(g,w){var S,C=this.length+g.length;return this.length===10&&g.length===10?S=y(this,g,w):C<63?S=p(this,g,w):C<1024?S=b(this,g,w):S=E(this,g,w),S};function v(P,g){this.x=P,this.y=g}v.prototype.makeRBT=function(g){for(var w=new Array(g),S=n.prototype._countBits(g)-1,C=0;C>=1;return C},v.prototype.permute=function(g,w,S,C,L,Y){for(var V=0;V>>1)L++;return 1<>>13,S[2*Y+1]=L&8191,L=L>>>13;for(Y=2*w;Y>=26,w+=C/67108864|0,w+=L>>>26,this.words[S]=L&67108863}return w!==0&&(this.words[S]=w,this.length++),this},n.prototype.muln=function(g){return this.clone().imuln(g)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(g){var w=h(g);if(w.length===0)return new n(1);for(var S=this,C=0;C=0);var w=g%26,S=(g-w)/26,C=67108863>>>26-w<<26-w,L;if(w!==0){var Y=0;for(L=0;L>>26-w}Y&&(this.words[L]=Y,this.length++)}if(S!==0){for(L=this.length-1;L>=0;L--)this.words[L+S]=this.words[L];for(L=0;L=0);var C;w?C=(w-w%26)/26:C=0;var L=g%26,Y=Math.min((g-L)/26,this.length),V=67108863^67108863>>>L<Y)for(this.length-=Y,_=0;_=0&&(j!==0||_>=C);_--){var de=this.words[_]|0;this.words[_]=j<<26-L|de>>>L,j=de&V}return q&&j!==0&&(q.words[q.length++]=j),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(g,w,S){return r(this.negative===0),this.iushrn(g,w,S)},n.prototype.shln=function(g){return this.clone().ishln(g)},n.prototype.ushln=function(g){return this.clone().iushln(g)},n.prototype.shrn=function(g){return this.clone().ishrn(g)},n.prototype.ushrn=function(g){return this.clone().iushrn(g)},n.prototype.testn=function(g){r(typeof g=="number"&&g>=0);var w=g%26,S=(g-w)/26,C=1<=0);var w=g%26,S=(g-w)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(w!==0&&S++,this.length=Math.min(S,this.length),w!==0){var C=67108863^67108863>>>w<=67108864;w++)this.words[w]-=67108864,w===this.length-1?this.words[w+1]=1:this.words[w+1]++;return this.length=Math.max(this.length,w+1),this},n.prototype.isubn=function(g){if(r(typeof g=="number"),r(g<67108864),g<0)return this.iaddn(-g);if(this.negative!==0)return this.negative=0,this.iaddn(g),this.negative=1,this;if(this.words[0]-=g,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var w=0;w>26)-(q/67108864|0),this.words[L+S]=Y&67108863}for(;L>26,this.words[L+S]=Y&67108863;if(V===0)return this.strip();for(r(V===-1),V=0,L=0;L>26,this.words[L]=Y&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(g,w){var S=this.length-g.length,C=this.clone(),L=g,Y=L.words[L.length-1]|0,V=this._countBits(Y);S=26-V,S!==0&&(L=L.ushln(S),C.iushln(S),Y=L.words[L.length-1]|0);var q=C.length-L.length,_;if(w!=="mod"){_=new n(null),_.length=q+1,_.words=new Array(_.length);for(var j=0;j<_.length;j++)_.words[j]=0}var de=C.clone()._ishlnsubmul(L,1,q);de.negative===0&&(C=de,_&&(_.words[q]=1));for(var Q=q-1;Q>=0;Q--){var ue=(C.words[L.length+Q]|0)*67108864+(C.words[L.length+Q-1]|0);for(ue=Math.min(ue/Y|0,67108863),C._ishlnsubmul(L,ue,Q);C.negative!==0;)ue--,C.negative=0,C._ishlnsubmul(L,1,Q),C.isZero()||(C.negative^=1);_&&(_.words[Q]=ue)}return _&&_.strip(),C.strip(),w!=="div"&&S!==0&&C.iushrn(S),{div:_||null,mod:C}},n.prototype.divmod=function(g,w,S){if(r(!g.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var C,L,Y;return this.negative!==0&&g.negative===0?(Y=this.neg().divmod(g,w),w!=="mod"&&(C=Y.div.neg()),w!=="div"&&(L=Y.mod.neg(),S&&L.negative!==0&&L.iadd(g)),{div:C,mod:L}):this.negative===0&&g.negative!==0?(Y=this.divmod(g.neg(),w),w!=="mod"&&(C=Y.div.neg()),{div:C,mod:Y.mod}):(this.negative&g.negative)!=0?(Y=this.neg().divmod(g.neg(),w),w!=="div"&&(L=Y.mod.neg(),S&&L.negative!==0&&L.isub(g)),{div:Y.div,mod:L}):g.length>this.length||this.cmp(g)<0?{div:new n(0),mod:this}:g.length===1?w==="div"?{div:this.divn(g.words[0]),mod:null}:w==="mod"?{div:null,mod:new n(this.modn(g.words[0]))}:{div:this.divn(g.words[0]),mod:new n(this.modn(g.words[0]))}:this._wordDiv(g,w)},n.prototype.div=function(g){return this.divmod(g,"div",!1).div},n.prototype.mod=function(g){return this.divmod(g,"mod",!1).mod},n.prototype.umod=function(g){return this.divmod(g,"mod",!0).mod},n.prototype.divRound=function(g){var w=this.divmod(g);if(w.mod.isZero())return w.div;var S=w.div.negative!==0?w.mod.isub(g):w.mod,C=g.ushrn(1),L=g.andln(1),Y=S.cmp(C);return Y<0||L===1&&Y===0?w.div:w.div.negative!==0?w.div.isubn(1):w.div.iaddn(1)},n.prototype.modn=function(g){r(g<=67108863);for(var w=(1<<26)%g,S=0,C=this.length-1;C>=0;C--)S=(w*S+(this.words[C]|0))%g;return S},n.prototype.idivn=function(g){r(g<=67108863);for(var w=0,S=this.length-1;S>=0;S--){var C=(this.words[S]|0)+w*67108864;this.words[S]=C/g|0,w=C%g}return this.strip()},n.prototype.divn=function(g){return this.clone().idivn(g)},n.prototype.egcd=function(g){r(g.negative===0),r(!g.isZero());var w=this,S=g.clone();w.negative!==0?w=w.umod(g):w=w.clone();for(var C=new n(1),L=new n(0),Y=new n(0),V=new n(1),q=0;w.isEven()&&S.isEven();)w.iushrn(1),S.iushrn(1),++q;for(var _=S.clone(),j=w.clone();!w.isZero();){for(var de=0,Q=1;(w.words[0]&Q)==0&&de<26;++de,Q<<=1);if(de>0)for(w.iushrn(de);de-- >0;)(C.isOdd()||L.isOdd())&&(C.iadd(_),L.isub(j)),C.iushrn(1),L.iushrn(1);for(var ue=0,le=1;(S.words[0]&le)==0&&ue<26;++ue,le<<=1);if(ue>0)for(S.iushrn(ue);ue-- >0;)(Y.isOdd()||V.isOdd())&&(Y.iadd(_),V.isub(j)),Y.iushrn(1),V.iushrn(1);w.cmp(S)>=0?(w.isub(S),C.isub(Y),L.isub(V)):(S.isub(w),Y.isub(C),V.isub(L))}return{a:Y,b:V,gcd:S.iushln(q)}},n.prototype._invmp=function(g){r(g.negative===0),r(!g.isZero());var w=this,S=g.clone();w.negative!==0?w=w.umod(g):w=w.clone();for(var C=new n(1),L=new n(0),Y=S.clone();w.cmpn(1)>0&&S.cmpn(1)>0;){for(var V=0,q=1;(w.words[0]&q)==0&&V<26;++V,q<<=1);if(V>0)for(w.iushrn(V);V-- >0;)C.isOdd()&&C.iadd(Y),C.iushrn(1);for(var _=0,j=1;(S.words[0]&j)==0&&_<26;++_,j<<=1);if(_>0)for(S.iushrn(_);_-- >0;)L.isOdd()&&L.iadd(Y),L.iushrn(1);w.cmp(S)>=0?(w.isub(S),C.isub(L)):(S.isub(w),L.isub(C))}var de;return w.cmpn(1)===0?de=C:de=L,de.cmpn(0)<0&&de.iadd(g),de},n.prototype.gcd=function(g){if(this.isZero())return g.abs();if(g.isZero())return this.abs();var w=this.clone(),S=g.clone();w.negative=0,S.negative=0;for(var C=0;w.isEven()&&S.isEven();C++)w.iushrn(1),S.iushrn(1);do{for(;w.isEven();)w.iushrn(1);for(;S.isEven();)S.iushrn(1);var L=w.cmp(S);if(L<0){var Y=w;w=S,S=Y}else if(L===0||S.cmpn(1)===0)break;w.isub(S)}while(!0);return S.iushln(C)},n.prototype.invm=function(g){return this.egcd(g).a.umod(g)},n.prototype.isEven=function(){return(this.words[0]&1)==0},n.prototype.isOdd=function(){return(this.words[0]&1)==1},n.prototype.andln=function(g){return this.words[0]&g},n.prototype.bincn=function(g){r(typeof g=="number");var w=g%26,S=(g-w)/26,C=1<>>26,V&=67108863,this.words[Y]=V}return L!==0&&(this.words[Y]=L,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(g){var w=g<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;this.strip();var S;if(this.length>1)S=1;else{w&&(g=-g),r(g<=67108863,"Number is too big");var C=this.words[0]|0;S=C===g?0:Cg.length)return 1;if(this.length=0;S--){var C=this.words[S]|0,L=g.words[S]|0;if(C!==L){CL&&(w=1);break}}return w},n.prototype.gtn=function(g){return this.cmpn(g)===1},n.prototype.gt=function(g){return this.cmp(g)===1},n.prototype.gten=function(g){return this.cmpn(g)>=0},n.prototype.gte=function(g){return this.cmp(g)>=0},n.prototype.ltn=function(g){return this.cmpn(g)===-1},n.prototype.lt=function(g){return this.cmp(g)===-1},n.prototype.lten=function(g){return this.cmpn(g)<=0},n.prototype.lte=function(g){return this.cmp(g)<=0},n.prototype.eqn=function(g){return this.cmpn(g)===0},n.prototype.eq=function(g){return this.cmp(g)===0},n.red=function(g){return new W(g)},n.prototype.toRed=function(g){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),g.convertTo(this)._forceRed(g)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(g){return this.red=g,this},n.prototype.forceRed=function(g){return r(!this.red,"Already a number in reduction context"),this._forceRed(g)},n.prototype.redAdd=function(g){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,g)},n.prototype.redIAdd=function(g){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,g)},n.prototype.redSub=function(g){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,g)},n.prototype.redISub=function(g){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,g)},n.prototype.redShl=function(g){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,g)},n.prototype.redMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.mul(this,g)},n.prototype.redIMul=function(g){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.imul(this,g)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(g){return r(this.red&&!g.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,g)};var A={k256:null,p224:null,p192:null,p25519:null};function R(P,g){this.name=P,this.p=new n(g,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}R.prototype._tmp=function(){var g=new n(null);return g.words=new Array(Math.ceil(this.n/13)),g},R.prototype.ireduce=function(g){var w=g,S;do this.split(w,this.tmp),w=this.imulK(w),w=w.iadd(this.tmp),S=w.bitLength();while(S>this.n);var C=S0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},R.prototype.split=function(g,w){g.iushrn(this.n,0,w)},R.prototype.imulK=function(g){return g.imul(this.k)};function F(){R.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,R),F.prototype.split=function(g,w){for(var S=4194303,C=Math.min(g.length,9),L=0;L>>22,Y=V}Y>>>=22,g.words[L-10]=Y,Y===0&&g.length>10?g.length-=10:g.length-=9},F.prototype.imulK=function(g){g.words[g.length]=0,g.words[g.length+1]=0,g.length+=2;for(var w=0,S=0;S>>=26,g.words[S]=L,w=C}return w!==0&&(g.words[g.length++]=w),g},n._prime=function(g){if(A[g])return A[g];var w;if(g==="k256")w=new F;else if(g==="p224")w=new D;else if(g==="p192")w=new B;else if(g==="p25519")w=new H;else throw new Error("Unknown prime "+g);return A[g]=w,w};function W(P){if(typeof P=="string"){var g=n._prime(P);this.m=g.p,this.prime=g}else r(P.gtn(1),"modulus must be greater than 1"),this.m=P,this.prime=null}W.prototype._verify1=function(g){r(g.negative===0,"red works only with positives"),r(g.red,"red works only with red numbers")},W.prototype._verify2=function(g,w){r((g.negative|w.negative)==0,"red works only with positives"),r(g.red&&g.red===w.red,"red works only with red numbers")},W.prototype.imod=function(g){return this.prime?this.prime.ireduce(g)._forceRed(this):g.umod(this.m)._forceRed(this)},W.prototype.neg=function(g){return g.isZero()?g.clone():this.m.sub(g)._forceRed(this)},W.prototype.add=function(g,w){this._verify2(g,w);var S=g.add(w);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},W.prototype.iadd=function(g,w){this._verify2(g,w);var S=g.iadd(w);return S.cmp(this.m)>=0&&S.isub(this.m),S},W.prototype.sub=function(g,w){this._verify2(g,w);var S=g.sub(w);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},W.prototype.isub=function(g,w){this._verify2(g,w);var S=g.isub(w);return S.cmpn(0)<0&&S.iadd(this.m),S},W.prototype.shl=function(g,w){return this._verify1(g),this.imod(g.ushln(w))},W.prototype.imul=function(g,w){return this._verify2(g,w),this.imod(g.imul(w))},W.prototype.mul=function(g,w){return this._verify2(g,w),this.imod(g.mul(w))},W.prototype.isqr=function(g){return this.imul(g,g.clone())},W.prototype.sqr=function(g){return this.mul(g,g)},W.prototype.sqrt=function(g){if(g.isZero())return g.clone();var w=this.m.andln(3);if(r(w%2==1),w===3){var S=this.m.add(new n(1)).iushrn(2);return this.pow(g,S)}for(var C=this.m.subn(1),L=0;!C.isZero()&&C.andln(1)===0;)L++,C.iushrn(1);r(!C.isZero());var Y=new n(1).toRed(this),V=Y.redNeg(),q=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new n(2*_*_).toRed(this);this.pow(_,q).cmp(V)!==0;)_.redIAdd(V);for(var j=this.pow(_,C),de=this.pow(g,C.addn(1).iushrn(1)),Q=this.pow(g,C),ue=L;Q.cmp(Y)!==0;){for(var le=Q,me=0;le.cmp(Y)!==0;me++)le=le.redSqr();r(me=0;L--){for(var j=w.words[L],de=_-1;de>=0;de--){var Q=j>>de&1;if(Y!==C[0]&&(Y=this.sqr(Y)),Q===0&&V===0){q=0;continue}V<<=1,V|=Q,q++,!(q!==S&&(L!==0||de!==0))&&(Y=this.mul(Y,C[V]),q=0,V=0)}_=26}return Y},W.prototype.convertTo=function(g){var w=g.umod(this.m);return w===g?w.clone():w},W.prototype.convertFrom=function(g){var w=g.clone();return w.red=null,w},n.mont=function(g){return new X(g)};function X(P){W.call(this,P),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(X,W),X.prototype.convertTo=function(g){return this.imod(g.ushln(this.shift))},X.prototype.convertFrom=function(g){var w=this.imod(g.mul(this.rinv));return w.red=null,w},X.prototype.imul=function(g,w){if(g.isZero()||w.isZero())return g.words[0]=0,g.length=1,g;var S=g.imul(w),C=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=S.isub(C).iushrn(this.shift),Y=L;return L.cmp(this.m)>=0?Y=L.isub(this.m):L.cmpn(0)<0&&(Y=L.iadd(this.m)),Y._forceRed(this)},X.prototype.mul=function(g,w){if(g.isZero()||w.isZero())return new n(0)._forceRed(this);var S=g.mul(w),C=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=S.isub(C).iushrn(this.shift),Y=L;return L.cmp(this.m)>=0?Y=L.isub(this.m):L.cmpn(0)<0&&(Y=L.iadd(this.m)),Y._forceRed(this)},X.prototype.invm=function(g){var w=this.imod(g._invmp(this.m).mul(this.r2));return w._forceRed(this)}})(typeof M_=="undefined"||M_,pU)});var bf=m((hot,gU)=>{l();gU.exports=yU;function yU(t,e){if(!t)throw new Error(e||"Assertion failed")}yU.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)}});var L_=m(vU=>{l();"use strict";var l4=vU;function YEe(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var i=0;i>8,o=n&255;s?r.push(s,o):r.push(o)}return r}l4.toArray=YEe;function mU(t){return t.length===1?"0"+t:t}l4.zero2=mU;function bU(t){for(var e="",r=0;r{l();"use strict";var Go=wU,XEe=Va(),QEe=bf(),d4=L_();Go.assert=QEe;Go.toArray=d4.toArray;Go.zero2=d4.zero2;Go.toHex=d4.toHex;Go.encode=d4.encode;function ZEe(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?a=(n>>1)-c:a=c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i}Go.getNAF=ZEe;function JEe(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,n=0,s;t.cmpn(-i)>0||e.cmpn(-n)>0;){var o=t.andln(3)+i&3,a=e.andln(3)+n&3;o===3&&(o=-1),a===3&&(a=-1);var c;(o&1)==0?c=0:(s=t.andln(7)+i&7,(s===3||s===5)&&a===2?c=-o:c=o),r[0].push(c);var u;(a&1)==0?u=0:(s=e.andln(7)+n&7,(s===3||s===5)&&o===2?u=-a:u=a),r[1].push(u),2*i===c+1&&(i=1-i),2*n===u+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r}Go.getJSF=JEe;function eSe(t,e,r){var i="_"+e;t.prototype[e]=function(){return this[i]!==void 0?this[i]:this[i]=r.call(this)}}Go.cachedProperty=eSe;function tSe(t){return typeof t=="string"?Go.toArray(t,"hex"):t}Go.parseBytes=tSe;function rSe(t){return new XEe(t,"hex","le")}Go.intFromLE=rSe});var F_=m((got,U_)=>{l();var q_;U_.exports=function(e){return q_||(q_=new vf(null)),q_.generate(e)};function vf(t){this.rand=t}U_.exports.Rand=vf;vf.prototype.generate=function(e){return this._rand(e)};vf.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i{l();"use strict";var zl=Va(),Ay=Ss(),h4=Ay.getNAF,iSe=Ay.getJSF,p4=Ay.assert;function wf(t,e){this.type=t,this.p=new zl(e.p,16),this.red=e.prime?zl.red(e.prime):zl.mont(this.p),this.zero=new zl(0).toRed(this.red),this.one=new zl(1).toRed(this.red),this.two=new zl(2).toRed(this.red),this.n=e.n&&new zl(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}_U.exports=wf;wf.prototype.point=function(){throw new Error("Not implemented")};wf.prototype.validate=function(){throw new Error("Not implemented")};wf.prototype._fixedNafMul=function(e,r){p4(e.precomputed);var i=e._getDoubles(),n=h4(r,1,this._bitLength),s=(1<=a;u--)c=(c<<1)+n[u];o.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a=0;c--){for(var u=0;c>=0&&o[c]===0;c--)u++;if(c>=0&&u++,a=a.dblp(u),c<0)break;var f=o[c];p4(f!==0),e.type==="affine"?f>0?a=a.mixedAdd(s[f-1>>1]):a=a.mixedAdd(s[-f-1>>1].neg()):f>0?a=a.add(s[f-1>>1]):a=a.add(s[-f-1>>1].neg())}return e.type==="affine"?a.toP():a};wf.prototype._wnafMulAdd=function(e,r,i,n,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,u=0,f,d,h;for(f=0;f=1;f-=2){var y=f-1,b=f;if(o[y]!==1||o[b]!==1){c[y]=h4(i[y],o[y],this._bitLength),c[b]=h4(i[b],o[b],this._bitLength),u=Math.max(c[y].length,u),u=Math.max(c[b].length,u);continue}var E=[r[y],null,null,r[b]];r[y].y.cmp(r[b].y)===0?(E[1]=r[y].add(r[b]),E[2]=r[y].toJ().mixedAdd(r[b].neg())):r[y].y.cmp(r[b].y.redNeg())===0?(E[1]=r[y].toJ().mixedAdd(r[b]),E[2]=r[y].add(r[b].neg())):(E[1]=r[y].toJ().mixedAdd(r[b]),E[2]=r[y].toJ().mixedAdd(r[b].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],A=iSe(i[y],i[b]);for(u=Math.max(A[0].length,u),c[y]=new Array(u),c[b]=new Array(u),d=0;d=0;f--){for(var H=0;f>=0;){var W=!0;for(d=0;d=0&&H++,D=D.dblp(H),f<0)break;for(d=0;d0?h=a[d][X-1>>1]:X<0&&(h=a[d][-X-1>>1].neg()),h.type==="affine"?D=D.mixedAdd(h):D=D.add(h))}}for(f=0;f=Math.ceil((e.bitLength()+1)/r.step):!1};Js.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,s=0;s{l();typeof Object.create=="function"?K_.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:K_.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var SU=m((vot,EU)=>{l();"use strict";var nSe=Ss(),Zr=Va(),V_=on(),O0=Iy(),sSe=nSe.assert;function eo(t){O0.call(this,"short",t),this.a=new Zr(t.a,16).toRed(this.red),this.b=new Zr(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}V_(eo,O0);EU.exports=eo;eo.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new Zr(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new Zr(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?i=s[0]:(i=s[1],sSe(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var o;return e.basis?o=e.basis.map(function(a){return{a:new Zr(a.a,16),b:new Zr(a.b,16)}}):o=this._getEndoBasis(i),{beta:r,lambda:i,basis:o}}};eo.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Zr.mont(e),i=new Zr(2).toRed(r).redInvm(),n=i.redNeg(),s=new Zr(3).toRed(r).redNeg().redSqrt().redMul(i),o=n.redAdd(s).fromRed(),a=n.redSub(s).fromRed();return[o,a]};eo.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),s=new Zr(1),o=new Zr(0),a=new Zr(0),c=new Zr(1),u,f,d,h,p,y,b,E=0,v,A;i.cmpn(0)!==0;){var R=n.div(i);v=n.sub(R.mul(i)),A=a.sub(R.mul(s));var F=c.sub(R.mul(o));if(!d&&v.cmp(r)<0)u=b.neg(),f=s,d=v.neg(),h=A;else if(d&&++E==2)break;b=v,n=i,i=v,a=s,s=A,c=o,o=F}p=v.neg(),y=A;var D=d.sqr().add(h.sqr()),B=p.sqr().add(y.sqr());return B.cmp(D)>=0&&(p=u,y=f),d.negative&&(d=d.neg(),h=h.neg()),p.negative&&(p=p.neg(),y=y.neg()),[{a:d,b:h},{a:p,b:y}]};eo.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],s=n.b.mul(e).divRound(this.n),o=i.b.neg().mul(e).divRound(this.n),a=s.mul(i.a),c=o.mul(n.a),u=s.mul(i.b),f=o.mul(n.b),d=e.sub(a).sub(c),h=u.add(f).neg();return{k1:d,k2:h}};eo.prototype.pointFromX=function(e,r){e=new Zr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var s=n.fromRed().isOdd();return(r&&!s||!r&&s)&&(n=n.redNeg()),this.point(e,n)};eo.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(s).cmpn(0)===0};eo.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Xi.prototype.isInfinity=function(){return this.inf};Xi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Xi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Xi.prototype.getX=function(){return this.x.fromRed()};Xi.prototype.getY=function(){return this.y.fromRed()};Xi.prototype.mul=function(e){return e=new Zr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Xi.prototype.mulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s):this.curve._wnafMulAdd(1,n,s,2)};Xi.prototype.jmulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s,!0):this.curve._wnafMulAdd(1,n,s,2,!0)};Xi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Xi.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(s){return s.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r};Xi.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function an(t,e,r,i){O0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Zr(0)):(this.x=new Zr(e,16),this.y=new Zr(r,16),this.z=new Zr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}V_(an,O0.BasePoint);eo.prototype.jpoint=function(e,r,i){return new an(this,e,r,i)};an.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)};an.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};an.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),s=e.x.redMul(i),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),c=n.redSub(s),u=o.redSub(a);if(c.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),d=f.redMul(c),h=n.redMul(f),p=u.redSqr().redIAdd(d).redISub(h).redISub(h),y=u.redMul(h.redISub(p)).redISub(o.redMul(d)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(p,y,b)};an.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=i.redSub(n),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),d=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(s.redMul(f)),y=this.z.redMul(a);return this.curve.jpoint(h,p,y)};an.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r=0)return!1;if(i.redIAdd(s),this.x.cmp(i)===0)return!0}};an.prototype.inspect=function(){return this.isInfinity()?"":""};an.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var IU=m((wot,AU)=>{l();"use strict";var k0=Va(),xU=on(),y4=Iy(),oSe=Ss();function D0(t){y4.call(this,"mont",t),this.a=new k0(t.a,16).toRed(this.red),this.b=new k0(t.b,16).toRed(this.red),this.i4=new k0(4).toRed(this.red).redInvm(),this.two=new k0(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}xU(D0,y4);AU.exports=D0;D0.prototype.validate=function(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),s=n.redSqrt();return s.redSqr().cmp(n)===0};function Qi(t,e,r){y4.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new k0(e,16),this.z=new k0(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}xU(Qi,y4.BasePoint);D0.prototype.decodePoint=function(e,r){return this.point(oSe.toArray(e,r),1)};D0.prototype.point=function(e,r){return new Qi(this,e,r)};D0.prototype.pointFromJSON=function(e){return Qi.fromJSON(this,e)};Qi.prototype.precompute=function(){};Qi.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Qi.fromJSON=function(e,r){return new Qi(e,r[0],r[1]||e.one)};Qi.prototype.inspect=function(){return this.isInfinity()?"":""};Qi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Qi.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),s=r.redSub(n),o=r.redMul(n),a=s.redMul(n.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};Qi.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Qi.prototype.diffAdd=function(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(i),c=s.redMul(n),u=r.z.redMul(a.redAdd(c).redSqr()),f=r.x.redMul(a.redISub(c).redSqr());return this.curve.point(u,f)};Qi.prototype.mul=function(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(i=i.diffAdd(n,s),n=n.dbl()):(n=i.diffAdd(n,s),i=i.dbl());return n};Qi.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Qi.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Qi.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Qi.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Qi.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var PU=m((_ot,RU)=>{l();"use strict";var aSe=Ss(),nu=Va(),TU=on(),g4=Iy(),cSe=aSe.assert;function za(t){this.twisted=(t.a|0)!=1,this.mOneA=this.twisted&&(t.a|0)==-1,this.extended=this.mOneA,g4.call(this,"edwards",t),this.a=new nu(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nu(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nu(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),cSe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)==1}TU(za,g4);RU.exports=za;za.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};za.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};za.prototype.jpoint=function(e,r,i,n){return this.point(e,r,i,n)};za.prototype.pointFromX=function(e,r){e=new nu(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=n.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)};za.prototype.pointFromY=function(e,r){e=new nu(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};za.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(s)===0};function yr(t,e,r,i,n){g4.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new nu(e,16),this.y=new nu(r,16),this.z=i?new nu(i,16):this.curve.one,this.t=n&&new nu(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}TU(yr,g4.BasePoint);za.prototype.pointFromJSON=function(e){return yr.fromJSON(this,e)};za.prototype.point=function(e,r,i,n){return new yr(this,e,r,i,n)};yr.fromJSON=function(e,r){return new yr(e,r[0],r[1],r[2])};yr.prototype.inspect=function(){return this.isInfinity()?"":""};yr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};yr.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=n.redAdd(r),a=o.redSub(i),c=n.redSub(r),u=s.redMul(a),f=o.redMul(c),d=s.redMul(c),h=a.redMul(o);return this.curve.point(u,f,h,d)};yr.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,s,o,a,c,u;if(this.curve.twisted){a=this.curve._mulA(r);var f=a.redAdd(i);this.zOne?(n=e.redSub(r).redSub(i).redMul(f.redSub(this.curve.two)),s=f.redMul(a.redSub(i)),o=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),u=f.redSub(c).redISub(c),n=e.redSub(r).redISub(i).redMul(u),s=f.redMul(a.redSub(i)),o=f.redMul(u))}else a=r.redAdd(i),c=this.curve._mulC(this.z).redSqr(),u=a.redSub(c).redSub(c),n=this.curve._mulC(e.redISub(a)).redMul(u),s=this.curve._mulC(a).redMul(r.redISub(i)),o=a.redMul(u);return this.curve.point(n,s,o)};yr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};yr.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=i.redSub(r),a=s.redSub(n),c=s.redAdd(n),u=i.redAdd(r),f=o.redMul(a),d=c.redMul(u),h=o.redMul(u),p=a.redMul(c);return this.curve.point(f,d,p,h)};yr.prototype._projAdd=function(e){var r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(n).redMul(s),a=i.redSub(o),c=i.redAdd(o),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(s),f=r.redMul(a).redMul(u),d,h;return this.curve.twisted?(d=r.redMul(c).redMul(s.redSub(this.curve._mulA(n))),h=a.redMul(c)):(d=r.redMul(c).redMul(s.redSub(n)),h=this.curve._mulC(a).redMul(c)),this.curve.point(f,d,h)};yr.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};yr.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};yr.prototype.mulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)};yr.prototype.jmulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)};yr.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};yr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};yr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};yr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};yr.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};yr.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}};yr.prototype.toP=yr.prototype.normalize;yr.prototype.mixedAdd=yr.prototype.add});var z_=m(CU=>{l();"use strict";var m4=CU;m4.base=Iy();m4.short=SU();m4.mont=IU();m4.edwards=PU()});var $o=m(or=>{l();"use strict";var uSe=bf(),fSe=on();or.inherits=fSe;function lSe(t,e){return(t.charCodeAt(e)&64512)!=55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)==56320}function dSe(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=s&63|128):lSe(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}or.htonl=OU;function pSe(t,e){for(var r="",i=0;i>>0}return s}or.join32=ySe;function gSe(t,e){for(var r=new Array(t.length*4),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}or.split32=gSe;function mSe(t,e){return t>>>e|t<<32-e}or.rotr32=mSe;function bSe(t,e){return t<>>32-e}or.rotl32=bSe;function vSe(t,e){return t+e>>>0}or.sum32=vSe;function wSe(t,e,r){return t+e+r>>>0}or.sum32_3=wSe;function _Se(t,e,r,i){return t+e+r+i>>>0}or.sum32_4=_Se;function ESe(t,e,r,i,n){return t+e+r+i+n>>>0}or.sum32_5=ESe;function SSe(t,e,r,i){var n=t[e],s=t[e+1],o=i+s>>>0,a=(o>>0,t[e+1]=o}or.sum64=SSe;function xSe(t,e,r,i){var n=e+i>>>0,s=(n>>0}or.sum64_hi=xSe;function ASe(t,e,r,i){var n=e+i;return n>>>0}or.sum64_lo=ASe;function ISe(t,e,r,i,n,s,o,a){var c=0,u=e;u=u+i>>>0,c+=u>>0,c+=u>>0,c+=u>>0}or.sum64_4_hi=ISe;function TSe(t,e,r,i,n,s,o,a){var c=e+i+s+a;return c>>>0}or.sum64_4_lo=TSe;function RSe(t,e,r,i,n,s,o,a,c,u){var f=0,d=e;d=d+i>>>0,f+=d>>0,f+=d>>0,f+=d>>0,f+=d>>0}or.sum64_5_hi=RSe;function PSe(t,e,r,i,n,s,o,a,c,u){var f=e+i+s+a+u;return f>>>0}or.sum64_5_lo=PSe;function CSe(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}or.rotr64_hi=CSe;function OSe(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}or.rotr64_lo=OSe;function kSe(t,e,r){return t>>>r}or.shr64_hi=kSe;function DSe(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}or.shr64_lo=DSe});var B0=m(NU=>{l();"use strict";var BU=$o(),BSe=bf();function b4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}NU.BlockHash=b4;b4.prototype.update=function(e,r){if(e=BU.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=BU.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,n[s++]=e>>>16&255,n[s++]=e>>>8&255,n[s++]=e&255}else for(n[s++]=e&255,n[s++]=e>>>8&255,n[s++]=e>>>16&255,n[s++]=e>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,o=8;o{l();"use strict";var NSe=$o(),Ha=NSe.rotr32;function MSe(t,e,r,i){if(t===0)return MU(e,r,i);if(t===1||t===3)return qU(e,r,i);if(t===2)return LU(e,r,i)}su.ft_1=MSe;function MU(t,e,r){return t&e^~t&r}su.ch32=MU;function LU(t,e,r){return t&e^t&r^e&r}su.maj32=LU;function qU(t,e,r){return t^e^r}su.p32=qU;function LSe(t){return Ha(t,2)^Ha(t,13)^Ha(t,22)}su.s0_256=LSe;function qSe(t){return Ha(t,6)^Ha(t,11)^Ha(t,25)}su.s1_256=qSe;function jSe(t){return Ha(t,7)^Ha(t,18)^t>>>3}su.g0_256=jSe;function USe(t){return Ha(t,17)^Ha(t,19)^t>>>10}su.g1_256=USe});var FU=m((Iot,UU)=>{l();"use strict";var N0=$o(),FSe=B0(),KSe=H_(),G_=N0.rotl32,Ty=N0.sum32,VSe=N0.sum32_5,zSe=KSe.ft_1,jU=FSe.BlockHash,HSe=[1518500249,1859775393,2400959708,3395469782];function Ga(){if(!(this instanceof Ga))return new Ga;jU.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}N0.inherits(Ga,jU);UU.exports=Ga;Ga.blockSize=512;Ga.outSize=160;Ga.hmacStrength=80;Ga.padLength=64;Ga.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n{l();"use strict";var M0=$o(),GSe=B0(),L0=H_(),$Se=bf(),Wo=M0.sum32,WSe=M0.sum32_4,YSe=M0.sum32_5,XSe=L0.ch32,QSe=L0.maj32,ZSe=L0.s0_256,JSe=L0.s1_256,exe=L0.g0_256,txe=L0.g1_256,KU=GSe.BlockHash,rxe=[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];function $a(){if(!(this instanceof $a))return new $a;KU.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=rxe,this.W=new Array(64)}M0.inherits($a,KU);VU.exports=$a;$a.blockSize=512;$a.outSize=256;$a.hmacStrength=192;$a.padLength=64;$a.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n{l();"use strict";var W_=$o(),zU=$_();function ou(){if(!(this instanceof ou))return new ou;zU.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}W_.inherits(ou,zU);HU.exports=ou;ou.blockSize=512;ou.outSize=224;ou.hmacStrength=192;ou.padLength=64;ou.prototype._digest=function(e){return e==="hex"?W_.toHex32(this.h.slice(0,7),"big"):W_.split32(this.h.slice(0,7),"big")}});var Q_=m((Pot,XU)=>{l();"use strict";var ts=$o(),ixe=B0(),nxe=bf(),Wa=ts.rotr64_hi,Ya=ts.rotr64_lo,$U=ts.shr64_hi,WU=ts.shr64_lo,_f=ts.sum64,Y_=ts.sum64_hi,X_=ts.sum64_lo,sxe=ts.sum64_4_hi,oxe=ts.sum64_4_lo,axe=ts.sum64_5_hi,cxe=ts.sum64_5_lo,YU=ixe.BlockHash,uxe=[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];function Yo(){if(!(this instanceof Yo))return new Yo;YU.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=uxe,this.W=new Array(160)}ts.inherits(Yo,YU);XU.exports=Yo;Yo.blockSize=1024;Yo.outSize=512;Yo.hmacStrength=192;Yo.padLength=128;Yo.prototype._prepareBlock=function(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n{l();"use strict";var Z_=$o(),QU=Q_();function au(){if(!(this instanceof au))return new au;QU.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Z_.inherits(au,QU);ZU.exports=au;au.blockSize=1024;au.outSize=384;au.hmacStrength=192;au.padLength=128;au.prototype._digest=function(e){return e==="hex"?Z_.toHex32(this.h.slice(0,12),"big"):Z_.split32(this.h.slice(0,12),"big")}});var eF=m(q0=>{l();"use strict";q0.sha1=FU();q0.sha224=GU();q0.sha256=$_();q0.sha384=JU();q0.sha512=Q_()});var oF=m(sF=>{l();"use strict";var Hl=$o(),Exe=B0(),v4=Hl.rotl32,tF=Hl.sum32,Ry=Hl.sum32_3,rF=Hl.sum32_4,iF=Exe.BlockHash;function Xa(){if(!(this instanceof Xa))return new Xa;iF.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Hl.inherits(Xa,iF);sF.ripemd160=Xa;Xa.blockSize=512;Xa.outSize=160;Xa.hmacStrength=192;Xa.padLength=64;Xa.prototype._update=function(e,r){for(var i=this.h[0],n=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],c=i,u=n,f=s,d=o,h=a,p=0;p<80;p++){var y=tF(v4(rF(i,nF(p,n,s,o),e[Axe[p]+r],Sxe(p)),Txe[p]),a);i=a,a=o,o=v4(s,10),s=n,n=y,y=tF(v4(rF(c,nF(79-p,u,f,d),e[Ixe[p]+r],xxe(p)),Rxe[p]),h),c=h,h=d,d=v4(f,10),f=u,u=y}y=Ry(this.h[1],s,d),this.h[1]=Ry(this.h[2],o,h),this.h[2]=Ry(this.h[3],a,c),this.h[3]=Ry(this.h[4],i,u),this.h[4]=Ry(this.h[0],n,f),this.h[0]=y};Xa.prototype._digest=function(e){return e==="hex"?Hl.toHex32(this.h,"little"):Hl.split32(this.h,"little")};function nF(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function Sxe(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function xxe(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var Axe=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ixe=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Txe=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Rxe=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var cF=m((Dot,aF)=>{l();"use strict";var Pxe=$o(),Cxe=bf();function j0(t,e,r){if(!(this instanceof j0))return new j0(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Pxe.toArray(e,r))}aF.exports=j0;j0.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),Cxe(e.length<=this.blockSize);for(var r=e.length;r{l();var cn=uF;cn.utils=$o();cn.common=B0();cn.sha=eF();cn.ripemd=oF();cn.hmac=cF();cn.sha1=cn.sha.sha1;cn.sha256=cn.sha.sha256;cn.sha224=cn.sha.sha224;cn.sha384=cn.sha.sha384;cn.sha512=cn.sha.sha512;cn.ripemd160=cn.ripemd.ripemd160});var lF=m((Not,fF)=>{l();fF.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var _4=m(pF=>{l();"use strict";var J_=pF,Ef=w4(),eE=z_(),Oxe=Ss(),dF=Oxe.assert;function hF(t){t.type==="short"?this.curve=new eE.short(t):t.type==="edwards"?this.curve=new eE.edwards(t):this.curve=new eE.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,dF(this.g.validate(),"Invalid curve"),dF(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}J_.PresetCurve=hF;function Sf(t,e){Object.defineProperty(J_,t,{configurable:!0,enumerable:!0,get:function(){var r=new hF(e);return Object.defineProperty(J_,t,{configurable:!0,enumerable:!0,value:r}),r}})}Sf("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ef.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Sf("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ef.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Sf("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ef.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Sf("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ef.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Sf("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ef.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Sf("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ef.sha256,gRed:!1,g:["9"]});Sf("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ef.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var tE;try{tE=lF()}catch(t){tE=void 0}Sf("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ef.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",tE]})});var mF=m((Lot,gF)=>{l();"use strict";var kxe=w4(),Gl=L_(),yF=bf();function xf(t){if(!(this instanceof xf))return new xf(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Gl.toArray(t.entropy,t.entropyEnc||"hex"),r=Gl.toArray(t.nonce,t.nonceEnc||"hex"),i=Gl.toArray(t.pers,t.persEnc||"hex");yF(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}gF.exports=xf;xf.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};xf.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=Gl.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length{l();"use strict";var Dxe=Va(),Bxe=Ss(),rE=Bxe.assert;function xn(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}bF.exports=xn;xn.fromPublic=function(e,r,i){return r instanceof xn?r:new xn(e,{pub:r,pubEnc:i})};xn.fromPrivate=function(e,r,i){return r instanceof xn?r:new xn(e,{priv:r,privEnc:i})};xn.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};xn.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};xn.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};xn.prototype._importPrivate=function(e,r){this.priv=new Dxe(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};xn.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?rE(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&rE(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};xn.prototype.derive=function(e){return e.validate()||rE(e.validate(),"public point not validated"),e.mul(this.priv).getX()};xn.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)};xn.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};xn.prototype.inspect=function(){return""}});var EF=m((jot,_F)=>{l();"use strict";var E4=Va(),iE=Ss(),Nxe=iE.assert;function S4(t,e){if(t instanceof S4)return t;this._importDER(t,e)||(Nxe(t.r&&t.s,"Signature without r or s"),this.r=new E4(t.r,16),this.s=new E4(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}_F.exports=S4;function Mxe(){this.place=0}function nE(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return n<=127?!1:(e.place=o,n)}function wF(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}S4.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=wF(r),i=wF(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];sE(n,r.length),n=n.concat(r),n.push(2),sE(n,i.length);var s=n.concat(i),o=[48];return sE(o,s.length),o=o.concat(s),iE.encode(o,e)}});var IF=m((Uot,AF)=>{l();"use strict";var $l=Va(),SF=mF(),Lxe=Ss(),oE=_4(),qxe=F_(),xF=Lxe.assert,aE=vF(),x4=EF();function to(t){if(!(this instanceof to))return new to(t);typeof t=="string"&&(xF(Object.prototype.hasOwnProperty.call(oE,t),"Unknown curve "+t),t=oE[t]),t instanceof oE.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}AF.exports=to;to.prototype.keyPair=function(e){return new aE(this,e)};to.prototype.keyFromPrivate=function(e,r){return aE.fromPrivate(this,e,r)};to.prototype.keyFromPublic=function(e,r){return aE.fromPublic(this,e,r)};to.prototype.genKeyPair=function(e){e||(e={});for(var r=new SF({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||qxe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new $l(2));;){var s=new $l(r.generate(i));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}};to.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};to.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new $l(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new SF({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new $l(1)),f=0;;f++){var d=n.k?n.k(f):new $l(c.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(u)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var p=h.getX(),y=p.umod(this.n);if(y.cmpn(0)!==0){var b=d.invm(this.n).mul(y.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var E=(h.getY().isOdd()?1:0)|(p.cmp(y)!==0?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),E^=1),new x4({r:y,s:b,recoveryParam:E})}}}}}};to.prototype.verify=function(e,r,i,n){e=this._truncateToN(new $l(e,16)),i=this.keyFromPublic(i,n),r=new x4(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,i.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,i.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};to.prototype.recoverPubKey=function(t,e,r,i){xF((3&r)===r,"The recovery param is more than two bits"),e=new x4(e,i);var n=this.n,s=new $l(t),o=e.r,a=e.s,c=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var f=e.r.invm(n),d=n.sub(s).mul(f).umod(n),h=a.mul(f).umod(n);return this.g.mulAdd(d,o,h)};to.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new x4(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(o){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}});var CF=m((Fot,PF)=>{l();"use strict";var Py=Ss(),TF=Py.assert,RF=Py.parseBytes,U0=Py.cachedProperty;function Zi(t,e){this.eddsa=t,this._secret=RF(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=RF(e.pub)}Zi.fromPublic=function(e,r){return r instanceof Zi?r:new Zi(e,{pub:r})};Zi.fromSecret=function(e,r){return r instanceof Zi?r:new Zi(e,{secret:r})};Zi.prototype.secret=function(){return this._secret};U0(Zi,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});U0(Zi,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});U0(Zi,"privBytes",function(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});U0(Zi,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});U0(Zi,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});U0(Zi,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Zi.prototype.sign=function(e){return TF(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Zi.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Zi.prototype.getSecret=function(e){return TF(this._secret,"KeyPair is public only"),Py.encode(this.secret(),e)};Zi.prototype.getPublic=function(e){return Py.encode(this.pubBytes(),e)};PF.exports=Zi});var kF=m((Kot,OF)=>{l();"use strict";var jxe=Va(),A4=Ss(),Uxe=A4.assert,I4=A4.cachedProperty,Fxe=A4.parseBytes;function Wl(t,e){this.eddsa=t,typeof e!="object"&&(e=Fxe(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Uxe(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof jxe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}I4(Wl,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});I4(Wl,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});I4(Wl,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});I4(Wl,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Wl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Wl.prototype.toHex=function(){return A4.encode(this.toBytes(),"hex").toUpperCase()};OF.exports=Wl});var LF=m((Vot,MF)=>{l();"use strict";var Kxe=w4(),Vxe=_4(),F0=Ss(),zxe=F0.assert,DF=F0.parseBytes,BF=CF(),NF=kF();function rs(t){if(zxe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof rs))return new rs(t);t=Vxe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Kxe.sha512}MF.exports=rs;rs.prototype.sign=function(e,r){e=DF(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),s=this.g.mul(n),o=this.encodePoint(s),a=this.hashInt(o,i.pubBytes(),e).mul(i.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:c,Rencoded:o})};rs.prototype.verify=function(e,r,i){e=DF(e),r=this.makeSignature(r);var n=this.keyFromPublic(i),s=this.hashInt(r.Rencoded(),n.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(n.pub().mul(s));return a.eq(o)};rs.prototype.hashInt=function(){for(var e=this.hash(),r=0;r{l();"use strict";var Yl=qF;Yl.version=dU().version;Yl.utils=Ss();Yl.rand=F_();Yl.curve=z_();Yl.curves=_4();Yl.ec=IF();Yl.eddsa=LF()});var FF=m((Hot,UF)=>{l();var Hxe=jF().ec,Qa=new Hxe("secp256k1"),kt=Qa.curve,ar=kt.n.constructor;function Gxe(t,e){let r=new ar(e);if(r.cmp(kt.p)>=0)return null;r=r.toRed(kt.red);let i=r.redSqr().redIMul(r).redIAdd(kt.b).redSqrt();return t===3!==i.isOdd()&&(i=i.redNeg()),Qa.keyPair({pub:{x:r,y:i}})}function $xe(t,e,r){let i=new ar(e),n=new ar(r);if(i.cmp(kt.p)>=0||n.cmp(kt.p)>=0||(i=i.toRed(kt.red),n=n.toRed(kt.red),(t===6||t===7)&&n.isOdd()!==(t===7)))return null;let s=i.redSqr().redIMul(i);return n.redSqr().redISub(s.redIAdd(kt.b)).isZero()?Qa.keyPair({pub:{x:i,y:n}}):null}function Af(t){let e=t[0];switch(e){case 2:case 3:return t.length!==33?null:Gxe(e,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:$xe(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function Xl(t,e){let r=e.encode(null,t.length===33);for(let i=0;i=0||(r.iadd(new ar(t)),r.cmp(kt.n)>=0&&r.isub(kt.n),r.isZero()))return 1;let i=r.toArrayLike(Uint8Array,"be",32);return t.set(i),0},privateKeyTweakMul(t,e){let r=new ar(e);if(r.cmp(kt.n)>=0||r.isZero())return 1;r.imul(new ar(t)),r.cmp(kt.n)>=0&&(r=r.umod(kt.n));let i=r.toArrayLike(Uint8Array,"be",32);return t.set(i),0},publicKeyVerify(t){return Af(t)===null?1:0},publicKeyCreate(t,e){let r=new ar(e);if(r.cmp(kt.n)>=0||r.isZero())return 1;let i=Qa.keyFromPrivate(e).getPublic();return Xl(t,i),0},publicKeyConvert(t,e){let r=Af(e);if(r===null)return 1;let i=r.getPublic();return Xl(t,i),0},publicKeyNegate(t,e){let r=Af(e);if(r===null)return 1;let i=r.getPublic();return i.y=i.y.redNeg(),Xl(t,i),0},publicKeyCombine(t,e){let r=new Array(e.length);for(let n=0;n=0)return 2;let n=i.getPublic().add(kt.g.mul(r));return n.isInfinity()?2:(Xl(t,n),0)},publicKeyTweakMul(t,e,r){let i=Af(e);if(i===null)return 1;if(r=new ar(r),r.cmp(kt.n)>=0||r.isZero())return 2;let n=i.getPublic().mul(r);return Xl(t,n),0},signatureNormalize(t){let e=new ar(t.subarray(0,32)),r=new ar(t.subarray(32,64));return e.cmp(kt.n)>=0||r.cmp(kt.n)>=0?1:(r.cmp(Qa.nh)===1&&t.set(kt.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){let r=e.subarray(0,32),i=e.subarray(32,64);if(new ar(r).cmp(kt.n)>=0||new ar(i).cmp(kt.n)>=0)return 1;let{output:n}=t,s=n.subarray(4,4+33);s[0]=0,s.set(r,1);let o=33,a=0;for(;o>1&&s[a]===0&&!(s[a+1]&128);--o,++a);if(s=s.subarray(a),s[0]&128||o>1&&s[0]===0&&!(s[1]&128))return 1;let c=n.subarray(6+33,6+33+33);c[0]=0,c.set(i,1);let u=33,f=0;for(;u>1&&c[f]===0&&!(c[f+1]&128);--u,++f);return c=c.subarray(f),c[0]&128||u>1&&c[0]===0&&!(c[1]&128)?1:(t.outputlen=6+o+u,n[0]=48,n[1]=t.outputlen-2,n[2]=2,n[3]=s.length,n.set(s,4),n[4+o]=2,n[5+o]=c.length,n.set(c,6+o),0)},signatureImport(t,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;let r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;let i=e[5+r];if(i===0||6+r+i!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||i>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let n=e.subarray(4,4+r);if(n.length===33&&n[0]===0&&(n=n.subarray(1)),n.length>32)return 1;let s=e.subarray(6+r);if(s.length===33&&s[0]===0&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let o=new ar(n);o.cmp(kt.n)>=0&&(o=new ar(0));let a=new ar(e.subarray(6+r));return a.cmp(kt.n)>=0&&(a=new ar(0)),t.set(o.toArrayLike(Uint8Array,"be",32),0),t.set(a.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,i,n){if(n){let a=n;n=c=>{let u=a(e,r,null,i,c);if(!(u instanceof Uint8Array&&u.length===32))throw new Error("This is the way");return new ar(u)}}let s=new ar(r);if(s.cmp(kt.n)>=0||s.isZero())return 1;let o;try{o=Qa.sign(e,r,{canonical:!0,k:n,pers:i})}catch(a){return 1}return t.signature.set(o.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(o.s.toArrayLike(Uint8Array,"be",32),32),t.recid=o.recoveryParam,0},ecdsaVerify(t,e,r){let i={r:t.subarray(0,32),s:t.subarray(32,64)},n=new ar(i.r),s=new ar(i.s);if(n.cmp(kt.n)>=0||s.cmp(kt.n)>=0)return 1;if(s.cmp(Qa.nh)===1||n.isZero()||s.isZero())return 3;let o=Af(r);if(o===null)return 2;let a=o.getPublic();return Qa.verify(e,i,a)?0:3},ecdsaRecover(t,e,r,i){let n={r:e.slice(0,32),s:e.slice(32,64)},s=new ar(n.r),o=new ar(n.s);if(s.cmp(kt.n)>=0||o.cmp(kt.n)>=0)return 1;if(s.isZero()||o.isZero())return 2;let a;try{a=Qa.recoverPubKey(i,n,r)}catch(c){return 2}return Xl(t,a),0},ecdh(t,e,r,i,n,s,o){let a=Af(e);if(a===null)return 1;let c=new ar(r);if(c.cmp(kt.n)>=0||c.isZero())return 2;let u=a.getPublic().mul(c);if(n===void 0){let f=u.encode(null,!0),d=Qa.hash().update(f).digest();for(let h=0;h<32;++h)t[h]=d[h]}else{s||(s=new Uint8Array(32));let f=u.getX().toArray("be",32);for(let y=0;y<32;++y)s[y]=f[y];o||(o=new Uint8Array(32));let d=u.getY().toArray("be",32);for(let y=0;y<32;++y)o[y]=d[y];let h=n(s,o,i);if(!(h instanceof Uint8Array&&h.length===t.length))return 2;t.set(h)}return 0}}});var VF=m((Got,KF)=>{l();KF.exports=lU()(FF())});var GF=m(($ot,HF)=>{l();"use strict";var Xo=VF(),{sha256:zF}=(di(),zs);HF.exports=t=>{let e=32;function r(){let f;do f=t(32);while(!Xo.privateKeyVerify(f));return f}async function i(f,d){let{digest:h}=await zF.digest(d),p=Xo.ecdsaSign(h,f);return Xo.signatureExport(p.signature)}async function n(f,d,h){let{digest:p}=await zF.digest(h);return d=Xo.signatureImport(d),Xo.ecdsaVerify(d,p,f)}function s(f){if(!Xo.publicKeyVerify(f))throw new Error("Invalid public key");return Xo.publicKeyConvert(f,!0)}function o(f){return Xo.publicKeyConvert(f,!1)}function a(f){if(!Xo.privateKeyVerify(f))throw new Error("Invalid private key")}function c(f){if(!Xo.publicKeyVerify(f))throw new Error("Invalid public key")}function u(f){return a(f),Xo.publicKeyCreate(f)}return{generateKey:r,privateKeyLength:e,hashAndSign:i,hashAndVerify:n,compressPublicKey:s,decompressPublicKey:o,validatePrivateKey:a,validatePublicKey:c,computePublicKey:u}}});var XF=m((Wot,YF)=>{l();"use strict";var{sha256:$F}=(di(),zs),Wxe=zo(),{equals:WF}=(wi(),bn),{toString:Yxe}=(tt(),hr),Xxe=s4();YF.exports=(t,e,r)=>{r=r||GF()(e);class i{constructor(u){r.validatePublicKey(u),this._key=u}verify(u,f){return r.hashAndVerify(this._key,f,u)}marshal(){return r.compressPublicKey(this._key)}get bytes(){return t.PublicKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(u){return WF(this.bytes,u.bytes)}async hash(){let{bytes:u}=await $F.digest(this.bytes);return u}}class n{constructor(u,f){this._key=u,this._publicKey=f||r.computePublicKey(u),r.validatePrivateKey(this._key),r.validatePublicKey(this._publicKey)}sign(u){return r.hashAndSign(this._key,u)}get public(){return new i(this._publicKey)}marshal(){return this._key}get bytes(){return t.PrivateKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(u){return WF(this.bytes,u.bytes)}async hash(){let{bytes:u}=await $F.digest(this.bytes);return u}async id(){let u=await this.public.hash();return Yxe(u,"base58btc")}async export(u,f="libp2p-key"){if(f==="libp2p-key")return Xxe.export(this.bytes,u);throw Wxe(new Error(`export format '${f}' is not supported`),"ERR_INVALID_EXPORT_FORMAT")}}function s(c){return new n(c)}function o(c){return new i(c)}async function a(){let c=await r.generateKey();return new n(c)}return{Secp256k1PublicKey:i,Secp256k1PrivateKey:n,unmarshalSecp256k1PrivateKey:s,unmarshalSecp256k1PublicKey:o,generateKeyPair:a}}});var ZF=m((Yot,QF)=>{l();"use strict";QF.exports={SHA1:20,SHA256:32,SHA512:64}});var cE=m(eK=>{l();"use strict";var JF=by(),Qxe=ZF(),Zxe={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"},Jxe=async(t,e)=>{let r=await JF.get().subtle.sign({name:"HMAC"},t,e);return new Uint8Array(r,r.byteOffset,r.byteLength)};eK.create=async function(t,e){let r=Zxe[t],i=await JF.get().subtle.importKey("raw",e,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{async digest(n){return Jxe(i,n)},length:Qxe[t]}}});var sK=m((Qot,nK)=>{l();"use strict";var tK=zo(),{concat:rK}=(mn(),$s),{fromString:eAe}=(dt(),bi),tAe=cE(),iK={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};nK.exports=async(t,e,r)=>{let i=iK[t];if(!i){let A=Object.keys(iK).join(" / ");throw tK(new Error(`unknown cipher type '${t}'. Must be ${A}`),"ERR_INVALID_CIPHER_TYPE")}if(!e)throw tK(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");let n=i.keySize,s=i.ivSize,o=20,a=eAe("key expansion"),c=2*(s+n+o),u=await tAe.create(e,r),f=await u.digest(a),d=[],h=0;for(;hc&&(R=c-h),d.push(A),h+=R,f=await u.digest(f)}let p=c/2,y=rK(d),b=y.slice(0,p),E=y.slice(p,c),v=A=>({iv:A.slice(0,s),cipherKey:A.slice(s,s+n),macKey:A.slice(s+n)});return{k1:v(b),k2:v(E)}}});var aK=m((Zot,oK)=>{l();"use strict";var rAe=zo();oK.exports=function(t,e){if(!t.includes(e)){let r=t.join(" / ");throw rAe(new Error(`Unknown curve: ${e}. Must be ${r}`),"ERR_INVALID_CURVE")}}});var hK=m(dK=>{l();"use strict";var iAe=zo(),Cy=by(),{base64urlToBuffer:cK}=n4(),nAe=aK(),{toString:uE}=(tt(),hr),{concat:sAe}=(mn(),$s),{equals:oAe}=(wi(),bn),uK={"P-256":256,"P-384":384,"P-521":521};dK.generateEphmeralKeyPair=async function(t){nAe(Object.keys(uK),t);let e=await Cy.get().subtle.generateKey({name:"ECDH",namedCurve:t},!0,["deriveBits"]),r=async(n,s)=>{let o;s?o=await Cy.get().subtle.importKey("jwk",cAe(t,s),{name:"ECDH",namedCurve:t},!1,["deriveBits"]):o=e.privateKey;let a=[await Cy.get().subtle.importKey("jwk",lK(t,n),{name:"ECDH",namedCurve:t},!1,[]),o],c=await Cy.get().subtle.deriveBits({name:"ECDH",namedCurve:t,public:a[0]},a[1],uK[t]);return new Uint8Array(c,c.byteOffset,c.byteLength)},i=await Cy.get().subtle.exportKey("jwk",e.publicKey);return{key:aAe(i),genSharedKey:r}};var fK={"P-256":32,"P-384":48,"P-521":66};function aAe(t){let e=fK[t.crv];return sAe([Uint8Array.from([4]),cK(t.x,e),cK(t.y,e)],1+e*2)}function lK(t,e){let r=fK[t];if(oAe(!e.slice(0,1),Uint8Array.from([4])))throw iAe(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:t,x:uE(e.slice(1,r+1),"base64url"),y:uE(e.slice(1+r),"base64url"),ext:!0}}var cAe=(t,e)=>({...lK(t,e.public),d:uE(e.private,"base64url")})});var yK=m((eat,pK)=>{l();"use strict";var uAe=hK();pK.exports=async t=>uAe.generateEphmeralKeyPair(t)});var R4=m((tat,mK)=>{l();"use strict";var Za=M6();Qc();E_();var fE=yt(),Oy=zo(),{fromString:fAe}=(dt(),bi),lAe=vj(),ro={rsa:iU(),ed25519:uU(),secp256k1:XF()(Za,_y())},T4={message:"secp256k1 support requires libp2p-crypto-secp256k1 package",code:"ERR_MISSING_PACKAGE"};function K0(t){let e=ro[t.toLowerCase()];if(!e){let r=Object.keys(ro).join(" / ");throw Oy(new Error(`invalid or unsupported key type ${t}. Must be ${r}`),"ERR_UNSUPPORTED_KEY_TYPE")}return e}var dAe=async(t,e)=>K0(t).generateKeyPair(e),hAe=async(t,e,r)=>{let i=K0(t);if(t.toLowerCase()!=="ed25519")throw Oy(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return i.generateKeyPairFromSeed(e,r)},pAe=t=>{let e=Za.PublicKey.decode(t),r=e.Data;switch(e.Type){case Za.KeyType.RSA:return ro.rsa.unmarshalRsaPublicKey(r);case Za.KeyType.Ed25519:return ro.ed25519.unmarshalEd25519PublicKey(r);case Za.KeyType.Secp256k1:if(ro.secp256k1)return ro.secp256k1.unmarshalSecp256k1PublicKey(r);throw Oy(new Error(T4.message),T4.code);default:K0(e.Type)}},yAe=(t,e)=>(e=(e||"rsa").toLowerCase(),K0(e),t.bytes),gK=async t=>{let e=Za.PrivateKey.decode(t),r=e.Data;switch(e.Type){case Za.KeyType.RSA:return ro.rsa.unmarshalRsaPrivateKey(r);case Za.KeyType.Ed25519:return ro.ed25519.unmarshalEd25519PrivateKey(r);case Za.KeyType.Secp256k1:if(ro.secp256k1)return ro.secp256k1.unmarshalSecp256k1PrivateKey(r);throw Oy(new Error(T4.message),T4.code);default:K0(e.Type)}},gAe=(t,e)=>(e=(e||"rsa").toLowerCase(),K0(e),t.bytes),mAe=async(t,e)=>{try{let n=await lAe.import(t,e);return gK(n)}catch(n){}let r=fE.pki.decryptRsaPrivateKey(t,e);if(r===null)throw Oy(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let i=fE.asn1.toDer(fE.pki.privateKeyToAsn1(r));return i=fAe(i.getBytes(),"ascii"),ro.rsa.unmarshalRsaPrivateKey(i)};mK.exports={supportedKeys:ro,keysPBM:Za,keyStretcher:sK(),generateEphemeralKeyPair:yK(),generateKeyPair:dAe,generateKeyPairFromSeed:hAe,unmarshalPublicKey:pAe,marshalPublicKey:yAe,unmarshalPrivateKey:gK,marshalPrivateKey:gAe,import:mAe}});var P4=m((rat,lE)=>{l();"use strict";function bAe(t,{className:e,symbolName:r}){let i=Symbol.for(r),n={[e]:class extends t{constructor(...s){super(...s);Object.defineProperty(this,i,{value:!0})}get[Symbol.toStringTag](){return e}}}[e];return n[`is${e}`]=s=>!!(s&&s[i]),n}function vAe(t,{className:e,symbolName:r,withoutNew:i}){let n=Symbol.for(r),s={[e]:function(...o){if(i&&!(this instanceof s))return new s(...o);let a=t.call(this,...o)||this;return a&&!a[n]&&Object.defineProperty(a,n,{value:!0}),a}}[e];return s.prototype=Object.create(t.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,Symbol.toStringTag,{get(){return e}}),s[`is${e}`]=o=>!!(o&&o[n]),s}lE.exports=bAe;lE.exports.proto=vAe});var wK=m((iat,vK)=>{l();"use strict";var V0=Vi(),bK=V0.Reader,wAe=V0.Writer,Ci=V0.util,ky=V0.roots["libp2p-peer-id"]||(V0.roots["libp2p-peer-id"]={});ky.PeerIdProto=function(){function t(e){if(e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.id=r.bytes();break;case 2:s.pubKey=r.bytes();break;case 3:s.privKey=r.bytes();break;default:r.skipType(o&7);break}}if(!s.hasOwnProperty("id"))throw Ci.ProtocolError("missing required 'id'",{instance:s});return s},t.fromObject=function(r){if(r instanceof ky.PeerIdProto)return r;var i=new ky.PeerIdProto;return r.id!=null&&(typeof r.id=="string"?Ci.base64.decode(r.id,i.id=Ci.newBuffer(Ci.base64.length(r.id)),0):r.id.length&&(i.id=r.id)),r.pubKey!=null&&(typeof r.pubKey=="string"?Ci.base64.decode(r.pubKey,i.pubKey=Ci.newBuffer(Ci.base64.length(r.pubKey)),0):r.pubKey.length&&(i.pubKey=r.pubKey)),r.privKey!=null&&(typeof r.privKey=="string"?Ci.base64.decode(r.privKey,i.privKey=Ci.newBuffer(Ci.base64.length(r.privKey)),0):r.privKey.length&&(i.privKey=r.privKey)),i},t.toObject=function(r,i){i||(i={});var n={};return i.defaults&&(i.bytes===String?n.id="":(n.id=[],i.bytes!==Array&&(n.id=Ci.newBuffer(n.id))),i.bytes===String?n.pubKey="":(n.pubKey=[],i.bytes!==Array&&(n.pubKey=Ci.newBuffer(n.pubKey))),i.bytes===String?n.privKey="":(n.privKey=[],i.bytes!==Array&&(n.privKey=Ci.newBuffer(n.privKey)))),r.id!=null&&r.hasOwnProperty("id")&&(n.id=i.bytes===String?Ci.base64.encode(r.id,0,r.id.length):i.bytes===Array?Array.prototype.slice.call(r.id):r.id),r.pubKey!=null&&r.hasOwnProperty("pubKey")&&(n.pubKey=i.bytes===String?Ci.base64.encode(r.pubKey,0,r.pubKey.length):i.bytes===Array?Array.prototype.slice.call(r.pubKey):r.pubKey),r.privKey!=null&&r.hasOwnProperty("privKey")&&(n.privKey=i.bytes===String?Ci.base64.encode(r.privKey,0,r.privKey.length):i.bytes===Array?Array.prototype.slice.call(r.privKey):r.privKey),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,V0.util.toJSONOptions)},t}();vK.exports=ky});var it=m((An,RK)=>{l();"use strict";var{CID:dE}=(Te(),Xu),_Ae=(yn(),Yu),EAe=(i9(),c6),SAe=(li(),Fs),xAe=($2(),e0),{base58btc:hE}=(li(),Fs),{base32:AAe}=(yn(),Yu),{base16:_K}=(r9(),a6),Dy=(Bn(),Wh),Ja=R4(),IAe=P4(),{PeerIdProto:EK}=wK(),{equals:Ql}=(wi(),bn),{fromString:By}=(dt(),bi),{toString:TAe}=(tt(),hr),{identity:C4}=(Gc(),G2),SK={..._Ae,...EAe,...SAe,...xAe},RAe=Object.keys(SK).reduce((t,e)=>t.or(SK[e]),AAe.decoder),PAe=112,xK=114,AK=class{constructor(e,r,i){if(!(e instanceof Uint8Array))throw new Error("invalid id provided");if(r&&i&&!Ql(r.public.bytes,i.bytes))throw new Error("inconsistent arguments");this._id=e,this._idB58String=hE.encode(this.id).substring(1),this._privKey=r,this._pubKey=i}get id(){return this._id}set id(e){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(e){this._privKey=e}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{let e=Dy.decode(this.id);e.code===C4.code&&(this._pubKey=Ja.unmarshalPublicKey(e.digest))}catch(e){}return this._pubKey}set pubKey(e){this._pubKey=e}marshalPubKey(){if(this.pubKey)return Ja.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return Ja.marshalPrivateKey(this.privKey)}marshal(e){return EK.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}toPrint(){let e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));let r=6;return e.length"}toJSON(){return{id:this.toB58String(),privKey:TK(this.marshalPrivKey()),pubKey:TK(this.marshalPubKey())}}toHexString(){return _K.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){let e=dE.createV1(xK,Dy.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}equals(e){if(e instanceof Uint8Array)return Ql(this.id,e);if(e.id)return Ql(this.id,e.id);throw new Error("not valid Id")}isEqual(e){return this.equals(e)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&Ql(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(Dy.decode(this.id).code===C4.code)return!0}catch(e){}return!1}},ec=IAe(AK,{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});An=RK.exports=ec;var Ny=t=>t.bytes.length<=42?Dy.create(C4.code,t.bytes).bytes:t.hash(),pE=async(t,e)=>{let r=await Ny(e);return new ec(r,t,e)};An.create=async t=>{t=t||{},t.bits=t.bits||2048,t.keyType=t.keyType||"RSA";let e=await Ja.generateKeyPair(t.keyType,t.bits);return pE(e,e.public)};An.createFromHexString=t=>new ec(_K.decode("f"+t));An.createFromBytes=t=>{try{let e=dE.decode(t);if(!IK(e))throw new Error("Supplied PeerID CID is invalid");return An.createFromCID(e)}catch{if(Dy.decode(t).code!==C4.code)throw new Error("Supplied PeerID CID is invalid");return new ec(t)}};An.createFromB58String=t=>An.createFromBytes(hE.decode("z"+t));var IK=t=>t.code===xK||t.code===PAe;An.createFromCID=t=>{if(t=dE.asCID(t),!t||!IK(t))throw new Error("Supplied PeerID CID is invalid");return new ec(t.multihash.bytes)};An.createFromPubKey=async t=>{let e=t;if(typeof e=="string"&&(e=By(t,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");let r=await Ja.unmarshalPublicKey(e);return pE(void 0,r)};An.createFromPrivKey=async t=>{if(typeof t=="string"&&(t=By(t,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");let e=await Ja.unmarshalPrivateKey(t);return pE(e,e.public)};An.createFromJSON=async t=>{let e=hE.decode("z"+t.id),r=t.privKey&&By(t.privKey,"base64pad"),i=t.pubKey&&By(t.pubKey,"base64pad"),n=i&&await Ja.unmarshalPublicKey(i);if(!r)return new ec(e,void 0,n);let s=await Ja.unmarshalPrivateKey(r),o=await Ny(s.public),a;if(n&&(a=await Ny(n)),n&&!Ql(o,a))throw new Error("Public and private key do not match");if(e&&!Ql(o,e))throw new Error("Id and private key do not match");return new ec(e,s,n)};An.createFromProtobuf=async t=>{typeof t=="string"&&(t=By(t,"base16"));let{id:e,privKey:r,pubKey:i}=EK.decode(t);r=r?await Ja.unmarshalPrivateKey(r):!1,i=i?await Ja.unmarshalPublicKey(i):!1;let n,s;if(r&&(s=await Ny(r.public)),i&&(n=await Ny(i)),r){if(i&&!Ql(s,n))throw new Error("Public and private key do not match");return new ec(s,r,r.public)}if(i)return new ec(n,void 0,i);if(e)return new ec(e);throw new Error("Protobuf did not contain any usable key material")};An.parse=t=>((t.charAt(0)==="1"||t.charAt(0)==="Q")&&(t=`z${t}`),An.createFromBytes(RAe.decode(t)));An.isPeerId=t=>Boolean(typeof t=="object"&&t._id&&t._idB58String);function TK(t){if(t)return TAe(t,"base64pad")}});var is=m((cat,OK)=>{l();"use strict";var OAe=async t=>{let e;for await(let r of t)e=r;return e};OK.exports=OAe});var FK=m((Mat,UK)=>{l();"use strict";function jK(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function kAe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return jK(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),jK(new n,r)}}UK.exports=kAe});var bE={};zt(bE,{abortedError:()=>DAe,dbDeleteFailedError:()=>k4,dbOpenFailedError:()=>O4,dbWriteFailedError:()=>D4,notFoundError:()=>un});function O4(t){return t=t||new Error("Cannot open database"),(0,H0.default)(t,"ERR_DB_OPEN_FAILED")}function k4(t){return t=t||new Error("Delete failed"),(0,H0.default)(t,"ERR_DB_DELETE_FAILED")}function D4(t){return t=t||new Error("Write failed"),(0,H0.default)(t,"ERR_DB_WRITE_FAILED")}function un(t){return t=t||new Error("Not Found"),(0,H0.default)(t,"ERR_NOT_FOUND")}function DAe(t){return t=t||new Error("Aborted"),(0,H0.default)(t,"ERR_ABORTED")}var H0,Zo=bt(()=>{l();H0=M(FK())});var KK=m((qat,vE)=>{l();var Lat=function(){typeof vE!="undefined"&&(vE.exports=v);var t=24*3600,e=3200,r=(365*400+97)*e/400,i=t*r,n=i*1e3,s=1e3*1e4*1e4*t,o=16777216,a=65536*65536,c=1e3*1e3,u=1e3*1e3*1e3,f="000000000",d=Math.trunc||q,h=v.prototype;v.fromDate=X,v.fromInt64BE=Y(0,1,2,3,0,4),v.fromInt64LE=Y(3,2,1,0,4,0),v.fromString=W,v.fromTimeT=P,h.year=0,h.time=0,h.nano=0,h.addNano=B,h.getNano=H,h.getTimeT=w,h.getYear=A,h.toDate=F,h.toJSON=S,h.toString=C,h.writeInt64BE=L(0,1,2,3,0,4),h.writeInt64LE=L(3,2,1,0,4,0);var p="%Y-%m-%dT%H:%M:%S.%NZ",y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],E={"%":"%",F:"%Y-%m-%d",n:` `,R:"%H:%M",T:"%H:%M:%S",t:" ",X:"%T",Z:"GMT",z:"+0000"};return v;function v(Q,ue,le){var me=this;if(!(me instanceof v))return new v(Q,ue,le);me.time=+Q||0,me.nano=+ue||0,me.year=+le||0,R(me)}function A(){var Q=this.toDate().getUTCFullYear();return Q+this.year}function R(Q){var ue=Q.year,le=Q.time,me=Q.nano,be,xe;if(me<0||c<=me){var k=Math.floor(me/c);me-=k*c,le+=k,be=1}var K=ue%e;if(le<-s||s1?me[1]--:me[1]=0,le.time=ue=Date.UTC.apply(Date,me)-(ue||0),isNaN(ue))throw new TypeError("Invalid Date");return R(le)}function X(Q){return new v(+Q)}function P(Q){return g(Q,0)}function g(Q,ue){ue|=0,ue*=a,Q=+Q||0;var le=d(ue/i)+d(Q/i),me=ue%i+Q%i,be=d(me/i);return be&&(le+=be,me-=be*i),new v(me*1e3,0,le*e)}function w(){var Q=R(this),ue=Math.floor(Q.time/1e3),le=Q.year;return le&&(ue+=le*r*t/e),ue}function S(){return this.toString().replace(/0{1,6}Z$/,"Z")}function C(Q){var ue=this,le=ue.toDate(),me={H:ee,L:z,M:I,N,S:U,Y:xe,a:Z,b:ie,d:K,e:$,m:k};return be(Q||p);function be(te){return te.replace(/%./g,function(he){var we=he[1],_e=E[we],Ke=me[we];return _e?be(_e):Ke?Ke():he})}function xe(){var te=ue.getYear();return te>999999?"+"+te:te>9999?"+"+de(te,6):te>=0?de(te,4):te>=-999999?"-"+de(-te,6):te}function k(){return j(le.getUTCMonth()+1)}function K(){return j(le.getUTCDate())}function $(){return _(le.getUTCDate())}function ee(){return j(le.getUTCHours())}function I(){return j(le.getUTCMinutes())}function U(){return j(le.getUTCSeconds())}function z(){return de(le.getUTCMilliseconds(),3)}function N(){return de(ue.getNano(),9)}function Z(){return b[le.getUTCDay()]}function ie(){return y[le.getUTCMonth()]}}function L(Q,ue,le,me,be,xe){return k;function k($,ee){var I=R(this);$||($=new Array(8)),V($,ee|=0);var U=Math.floor(I.time/1e3),z=I.year*(r*t/e),N=d(z/a)+d(U/a),Z=z%a+U%a,ie=Math.floor(Z/a);return ie&&(N+=ie,Z-=ie*a),K($,ee+be,N),K($,ee+xe,Z),$}function K($,ee,I){$[ee+Q]=I>>24&255,$[ee+ue]=I>>16&255,$[ee+le]=I>>8&255,$[ee+me]=I&255}}function Y(Q,ue,le,me,be,xe){return k;function k($,ee){V($,ee|=0);var I=K($,ee+be),U=K($,ee+xe);return g(U,I)}function K($,ee){return $[ee+Q]*o+($[ee+ue]<<16|$[ee+le]<<8|$[ee+me])}}function V(Q,ue){var le=Q&&Q.length;if(le==null)throw new TypeError("Invalid Buffer");if(le9?"":" ")+(Q|0)}function j(Q){return(Q>9?"":"0")+(Q|0)}function de(Q,ue){return(f+(Q|0)).substr(-ue)}}()});var HK=m((jat,zK)=>{l();"use strict";_0();var B4=yt(),{toString:G0}=(tt(),hr),{fromString:VK}=(dt(),bi);zK.exports={createCipheriv:(t,e,r)=>{let i=B4.cipher.createCipher("AES-CTR",G0(e,"ascii"));return i.start({iv:G0(r,"ascii")}),{update:n=>(i.update(B4.util.createBuffer(G0(n,"ascii"))),VK(i.output.getBytes(),"ascii"))}},createDecipheriv:(t,e,r)=>{let i=B4.cipher.createDecipher("AES-CTR",G0(e,"ascii"));return i.start({iv:G0(r,"ascii")}),{update:n=>(i.update(B4.util.createBuffer(G0(n,"ascii"))),VK(i.output.getBytes(),"ascii"))}}}});var WK=m((Uat,$K)=>{l();"use strict";var BAe=zo(),GK={16:"aes-128-ctr",32:"aes-256-ctr"};$K.exports=function(t){let e=GK[t.length];if(!e){let r=Object.entries(GK).map(([i,n])=>`${i} (${n})`).join(" / ");throw BAe(new Error(`Invalid key length ${t.length} bytes. Must be ${r}`),"ERR_INVALID_KEY_LENGTH")}return e}});var QK=m(XK=>{l();"use strict";var YK=HK(),NAe=WK();XK.create=async function(t,e){let r=NAe(t),i=YK.createCipheriv(r,t,e),n=YK.createDecipheriv(r,t,e);return{async encrypt(o){return i.update(o)},async decrypt(o){return n.update(o)}}}});var eV=m((Kat,JK)=>{l();"use strict";var MAe=d_(),LAe=nr(),qAe=zo(),ZK={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};function jAe(t,e,r,i,n){let s=ZK[n];if(!s){let a=Object.keys(ZK).join(" / ");throw qAe(new Error(`Hash '${n}' is unknown or not supported. Must be ${a}`),"ERR_UNSUPPORTED_HASH_TYPE")}let o=MAe(t,e,r,i,s);return LAe.encode64(o)}JK.exports=jAe});var rc=m($0=>{l();"use strict";var UAe=cE(),FAe=QK(),KAe=R4();$0.aes=FAe;$0.hmac=UAe;$0.keys=KAe;$0.randomBytes=_y();$0.pbkdf2=eV()});var iV=m((zat,rV)=>{l();"use strict";function tV(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function VAe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return tV(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),tV(new n,r)}}rV.exports=VAe});var pV=m((Hat,hV)=>{l();hV.exports=gr;var io=null;try{io=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function gr(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}gr.prototype.__isLong__;Object.defineProperty(gr.prototype,"__isLong__",{value:!0});function ns(t){return(t&&t.__isLong__)===!0}gr.isLong=ns;var nV={},sV={};function Zl(t,e){var r,i,n;return e?(t>>>=0,(n=0<=t&&t<256)&&(i=sV[t],i)?i:(r=mr(t,(t|0)<0?-1:0,!0),n&&(sV[t]=r),r)):(t|=0,(n=-128<=t&&t<128)&&(i=nV[t],i)?i:(r=mr(t,t<0?-1:0,!1),n&&(nV[t]=r),r))}gr.fromInt=Zl;function no(t,e){if(isNaN(t))return e?Jl:so;if(e){if(t<0)return Jl;if(t>=aV)return dV}else{if(t<=-cV)return ss;if(t+1>=cV)return lV}return t<0?no(-t,e).neg():mr(t%W0|0,t/W0|0,e)}gr.fromNumber=no;function mr(t,e,r){return new gr(t,e,r)}gr.fromBits=mr;var N4=Math.pow;function wE(t,e,r){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return so;if(typeof e=="number"?(r=e,e=!1):e=!!e,r=r||10,r<2||360)throw Error("interior hyphen");if(i===0)return wE(t.substring(1),e,r).neg();for(var n=no(N4(r,8)),s=so,o=0;o>>0:this.low};Ce.toNumber=function(){return this.unsigned?(this.high>>>0)*W0+(this.low>>>0):this.high*W0+(this.low>>>0)};Ce.toString=function(e){if(e=e||10,e<2||36>>0,f=u.toString(e);if(o=c,o.isZero())return f+a;for(;f.length<6;)f="0"+f;a=""+f+a}};Ce.getHighBits=function(){return this.high};Ce.getHighBitsUnsigned=function(){return this.high>>>0};Ce.getLowBits=function(){return this.low};Ce.getLowBitsUnsigned=function(){return this.low>>>0};Ce.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ss)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&(e&1<=0};Ce.isOdd=function(){return(this.low&1)==1};Ce.isEven=function(){return(this.low&1)==0};Ce.equals=function(e){return ns(e)||(e=Jo(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low};Ce.eq=Ce.equals;Ce.notEquals=function(e){return!this.eq(e)};Ce.neq=Ce.notEquals;Ce.ne=Ce.notEquals;Ce.lessThan=function(e){return this.comp(e)<0};Ce.lt=Ce.lessThan;Ce.lessThanOrEqual=function(e){return this.comp(e)<=0};Ce.lte=Ce.lessThanOrEqual;Ce.le=Ce.lessThanOrEqual;Ce.greaterThan=function(e){return this.comp(e)>0};Ce.gt=Ce.greaterThan;Ce.greaterThanOrEqual=function(e){return this.comp(e)>=0};Ce.gte=Ce.greaterThanOrEqual;Ce.ge=Ce.greaterThanOrEqual;Ce.compare=function(e){if(ns(e)||(e=Jo(e)),this.eq(e))return 0;var r=this.isNegative(),i=e.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};Ce.comp=Ce.compare;Ce.negate=function(){return!this.unsigned&&this.eq(ss)?ss:this.not().add(Y0)};Ce.neg=Ce.negate;Ce.add=function(e){ns(e)||(e=Jo(e));var r=this.high>>>16,i=this.high&65535,n=this.low>>>16,s=this.low&65535,o=e.high>>>16,a=e.high&65535,c=e.low>>>16,u=e.low&65535,f=0,d=0,h=0,p=0;return p+=s+u,h+=p>>>16,p&=65535,h+=n+c,d+=h>>>16,h&=65535,d+=i+a,f+=d>>>16,d&=65535,f+=r+o,f&=65535,mr(h<<16|p,f<<16|d,this.unsigned)};Ce.subtract=function(e){return ns(e)||(e=Jo(e)),this.add(e.neg())};Ce.sub=Ce.subtract;Ce.multiply=function(e){if(this.isZero())return so;if(ns(e)||(e=Jo(e)),io){var r=io.mul(this.low,this.high,e.low,e.high);return mr(r,io.get_high(),this.unsigned)}if(e.isZero())return so;if(this.eq(ss))return e.isOdd()?ss:so;if(e.eq(ss))return this.isOdd()?ss:so;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(uV)&&e.lt(uV))return no(this.toNumber()*e.toNumber(),this.unsigned);var i=this.high>>>16,n=this.high&65535,s=this.low>>>16,o=this.low&65535,a=e.high>>>16,c=e.high&65535,u=e.low>>>16,f=e.low&65535,d=0,h=0,p=0,y=0;return y+=o*f,p+=y>>>16,y&=65535,p+=s*f,h+=p>>>16,p&=65535,p+=o*u,h+=p>>>16,p&=65535,h+=n*f,d+=h>>>16,h&=65535,h+=s*u,d+=h>>>16,h&=65535,h+=o*c,d+=h>>>16,h&=65535,d+=i*f+n*u+s*c+o*a,d&=65535,mr(p<<16|y,d<<16|h,this.unsigned)};Ce.mul=Ce.multiply;Ce.divide=function(e){if(ns(e)||(e=Jo(e)),e.isZero())throw Error("division by zero");if(io){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?io.div_u:io.div_s)(this.low,this.high,e.low,e.high);return mr(r,io.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Jl:so;var i,n,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Jl;if(e.gt(this.shru(1)))return fV;s=Jl}else{if(this.eq(ss)){if(e.eq(Y0)||e.eq(_E))return ss;if(e.eq(ss))return Y0;var o=this.shr(1);return i=o.div(e).shl(1),i.eq(so)?e.isNegative()?Y0:_E:(n=this.sub(e.mul(i)),s=i.add(n.div(e)),s)}else if(e.eq(ss))return this.unsigned?Jl:so;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=so}for(n=this;n.gte(e);){i=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),c=a<=48?1:N4(2,a-48),u=no(i),f=u.mul(e);f.isNegative()||f.gt(n);)i-=c,u=no(i,this.unsigned),f=u.mul(e);u.isZero()&&(u=Y0),s=s.add(u),n=n.sub(f)}return s};Ce.div=Ce.divide;Ce.modulo=function(e){if(ns(e)||(e=Jo(e)),io){var r=(this.unsigned?io.rem_u:io.rem_s)(this.low,this.high,e.low,e.high);return mr(r,io.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};Ce.mod=Ce.modulo;Ce.rem=Ce.modulo;Ce.not=function(){return mr(~this.low,~this.high,this.unsigned)};Ce.and=function(e){return ns(e)||(e=Jo(e)),mr(this.low&e.low,this.high&e.high,this.unsigned)};Ce.or=function(e){return ns(e)||(e=Jo(e)),mr(this.low|e.low,this.high|e.high,this.unsigned)};Ce.xor=function(e){return ns(e)||(e=Jo(e)),mr(this.low^e.low,this.high^e.high,this.unsigned)};Ce.shiftLeft=function(e){return ns(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?mr(this.low<>>32-e,this.unsigned):mr(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):mr(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};Ce.shr=Ce.shiftRight;Ce.shiftRightUnsigned=function(e){if(ns(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var i=this.low;return mr(i>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?mr(r,0,this.unsigned):mr(r>>>e-32,0,this.unsigned)};Ce.shru=Ce.shiftRightUnsigned;Ce.shr_u=Ce.shiftRightUnsigned;Ce.toSigned=function(){return this.unsigned?mr(this.low,this.high,!1):this};Ce.toUnsigned=function(){return this.unsigned?this:mr(this.low,this.high,!0)};Ce.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};Ce.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};Ce.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};gr.fromBytes=function(e,r,i){return i?gr.fromBytesLE(e,r):gr.fromBytesBE(e,r)};gr.fromBytesLE=function(e,r){return new gr(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};gr.fromBytesBE=function(e,r){return new gr(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)}});var nd=m((Tct,jV)=>{l();"use strict";var iIe=async t=>{let e=[];for await(let r of t)e.push(r);return e};jV.exports=iIe});var UV,z4,LE=bt(()=>{l();UV=M(nd()),z4=(t,e)=>async function*(){yield*(await(0,UV.default)(t)).sort(e)}()});var ic=m((Pct,FV)=>{l();"use strict";var nIe=async t=>{for await(let e of t);};FV.exports=nIe});var ea=m((Cct,KV)=>{l();"use strict";var sIe=async function*(t,e){for await(let r of t)await e(r)&&(yield r)};KV.exports=sIe});var Z0=m((Oct,VV)=>{l();"use strict";var oIe=async function*(t,e){let r=0;if(!(e<1)){for await(let i of t)if(yield i,r++,r===e)return}};VV.exports=oIe});var qE,sd,jE,As,od=bt(()=>{l();LE();qE=M(ic()),sd=M(ea()),jE=M(Z0()),As=class{open(){return Promise.reject(new Error(".open is not implemented"))}close(){return Promise.reject(new Error(".close is not implemented"))}put(e,r,i){return Promise.reject(new Error(".put is not implemented"))}get(e,r){return Promise.reject(new Error(".get is not implemented"))}has(e,r){return Promise.reject(new Error(".has is not implemented"))}delete(e,r){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e,r={}){for await(let{key:i,value:n}of e)await this.put(i,n,r),yield{key:i,value:n}}async*getMany(e,r={}){for await(let i of e)yield this.get(i,r)}async*deleteMany(e,r={}){for await(let i of e)await this.delete(i,r),yield i}batch(){let e=[],r=[];return{put(i,n){e.push({key:i,value:n})},delete(i){r.push(i)},commit:async i=>{await(0,qE.default)(this.putMany(e,i)),e=[],await(0,qE.default)(this.deleteMany(r,i)),r=[]}}}async*_all(e,r){throw new Error("._all is not implemented")}async*_allKeys(e,r){throw new Error("._allKeys is not implemented")}query(e,r){let i=this._all(e,r);if(e.prefix!=null&&(i=(0,sd.default)(i,n=>n.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(i=e.filters.reduce((n,s)=>(0,sd.default)(n,s),i)),Array.isArray(e.orders)&&(i=e.orders.reduce((n,s)=>z4(n,s),i)),e.offset!=null){let n=0;i=(0,sd.default)(i,()=>n++>=e.offset)}return e.limit!=null&&(i=(0,jE.default)(i,e.limit)),i}queryKeys(e,r){let i=this._allKeys(e,r);if(e.prefix!=null&&(i=(0,sd.default)(i,n=>n.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(i=e.filters.reduce((n,s)=>(0,sd.default)(n,s),i)),Array.isArray(e.orders)&&(i=e.orders.reduce((n,s)=>z4(n,s),i)),e.offset!=null){let n=0;i=(0,sd.default)(i,()=>n++>=e.offset)}return e.limit!=null&&(i=(0,jE.default)(i,e.limit)),i}}});var HV=m((Nct,zV)=>{l();zV.exports=class{constructor(e){if(!(e>0)||(e-1&e)!=0)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}}});var UE=m((Lct,$V)=>{l();var GV=HV();$V.exports=class{constructor(e){this.hwm=e||16,this.head=new GV(this.hwm),this.tail=this.head}push(e){if(!this.head.push(e)){let r=this.head;this.head=r.next=new GV(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next){let r=this.tail.next;return this.tail.next=null,this.tail=r,this.tail.shift()}return e}isEmpty(){return this.head.isEmpty()}}});var nc=m((qct,WV)=>{l();var FE=UE();WV.exports=t=>{t=t||{};let e;typeof t=="function"?(e=t,t={}):e=t.onEnd;let r=new FE,i,n,s,o=()=>{if(!r.isEmpty()){if(t.writev){let b,E=[];for(;!r.isEmpty();){if(b=r.shift(),b.error)throw b.error;E.push(b.value)}return{done:b.done,value:E}}let y=r.shift();if(y.error)throw y.error;return y}return s?{done:!0}:new Promise((y,b)=>{n=E=>(n=null,E.error?b(E.error):t.writev&&!E.done?y({done:E.done,value:[E.value]}):y(E),i)})},a=y=>n?n(y):(r.push(y),i),c=y=>(r=new FE,n?n({error:y}):(r.push({error:y}),i)),u=y=>s?i:a({done:!1,value:y}),f=y=>s?i:(s=!0,y?c(y):a({done:!0})),d=()=>(r=new FE,f(),{done:!0}),h=y=>(f(y),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:o,return:d,throw:h,push:u,end:f},!e)return i;let p=i;return i={[Symbol.asyncIterator](){return this},next(){return p.next()},throw(y){return p.throw(y),e&&(e(y),e=null),{done:!0}},return(){return p.return(),e&&(e(),e=null),{done:!0}},push:u,end(y){return p.end(y),e&&(e(y),e=null),i}},i}});var Vy=m((zE,HE)=>{l();(function(t,e){typeof zE=="object"&&typeof HE!="undefined"?HE.exports=function(r,i,n,s,o){for(i=i.split?i.split("."):i,s=0;sZE});var ZE,JE=bt(()=>{l();od();Br();Zo();ZE=class extends As{constructor(){super();this.data={}}open(){return Promise.resolve()}close(){return Promise.resolve()}async put(e,r){this.data[e.toString()]=r}async get(e){if(!await this.has(e))throw un();return this.data[e.toString()]}async has(e){return this.data[e.toString()]!==void 0}async delete(e){delete this.data[e.toString()]}async*_all(){yield*Object.entries(this.data).map(([e,r])=>({key:new qe(e),value:r}))}async*_allKeys(){yield*Object.entries(this.data).map(([e])=>new qe(e))}}});var oo=m((Zct,JV)=>{l();"use strict";var cIe=async function*(t,e){for await(let r of t)yield e(r)};JV.exports=cIe});var Nr=m((Jct,J0)=>{l();var ez=(...t)=>{let e;for(;t.length;)e=t.shift()(e);return e},eS=t=>t&&(typeof t[Symbol.asyncIterator]=="function"||typeof t[Symbol.iterator]=="function"||typeof t.next=="function"),W4=t=>t&&typeof t.sink=="function"&&eS(t.source),uIe=t=>e=>(t.sink(e),t.source),tz=(...t)=>{if(W4(t[0])){let e=t[0];t[0]=()=>e.source}else if(eS(t[0])){let e=t[0];t[0]=()=>e}if(t.length>1&&W4(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let e=1;e{l();"use strict";var dIe=nc(),hIe=async function*(...t){let e=dIe();setTimeout(async()=>{try{await Promise.all(t.map(async r=>{for await(let i of r)e.push(i)})),e.end()}catch(r){e.end(r)}},0),yield*e};rz.exports=hIe});var rS=m((Dut,nz)=>{l();"use strict";function iz(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function mIe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return iz(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),iz(new n,r)}}nz.exports=mIe});var uz=m((Wut,cz)=>{l();"use strict";var ip=Vi(),az=ip.Reader,bIe=ip.Writer,ao=ip.util,Gy=ip.roots["libp2p-record"]||(ip.roots["libp2p-record"]={});Gy.Record=function(){function t(e){if(e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.key=r.bytes();break;case 2:s.value=r.bytes();break;case 5:s.timeReceived=r.string();break;default:r.skipType(o&7);break}}return s},t.fromObject=function(r){if(r instanceof Gy.Record)return r;var i=new Gy.Record;return r.key!=null&&(typeof r.key=="string"?ao.base64.decode(r.key,i.key=ao.newBuffer(ao.base64.length(r.key)),0):r.key.length&&(i.key=r.key)),r.value!=null&&(typeof r.value=="string"?ao.base64.decode(r.value,i.value=ao.newBuffer(ao.base64.length(r.value)),0):r.value.length&&(i.value=r.value)),r.timeReceived!=null&&(i.timeReceived=String(r.timeReceived)),i},t.toObject=function(r,i){i||(i={});var n={};return i.defaults&&(i.bytes===String?n.key="":(n.key=[],i.bytes!==Array&&(n.key=ao.newBuffer(n.key))),i.bytes===String?n.value="":(n.value=[],i.bytes!==Array&&(n.value=ao.newBuffer(n.value))),n.timeReceived=""),r.key!=null&&r.hasOwnProperty("key")&&(n.key=i.bytes===String?ao.base64.encode(r.key,0,r.key.length):i.bytes===Array?Array.prototype.slice.call(r.key):r.key),r.value!=null&&r.hasOwnProperty("value")&&(n.value=i.bytes===String?ao.base64.encode(r.value,0,r.value.length):i.bytes===Array?Array.prototype.slice.call(r.value):r.value),r.timeReceived!=null&&r.hasOwnProperty("timeReceived")&&(n.timeReceived=r.timeReceived),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,ip.util.toJSONOptions)},t}();cz.exports=Gy});var fz=m((Yut,uS)=>{l();"use strict";uS.exports.toRFC3339=t=>{let e=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0"),n=String(t.getUTCHours()).padStart(2,"0"),s=String(t.getUTCMinutes()).padStart(2,"0"),o=String(t.getUTCSeconds()).padStart(2,"0"),c=t.getUTCMilliseconds()*1e3*1e3;return`${e}-${r}-${i}T${n}:${s}:${o}.${c}Z`};uS.exports.parseRFC3339=t=>{let e=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d+)Z"),r=String(t).trim().match(e);if(!r)throw new Error("Invalid format");let i=parseInt(r[1],10),n=parseInt(r[2],10)-1,s=parseInt(r[3],10),o=parseInt(r[4],10),a=parseInt(r[5],10),c=parseInt(r[6],10),u=parseInt(r[7].slice(0,-6),10);return new Date(Date.UTC(i,n,s,o,a,c,u))}});var hz=m((Xut,dz)=>{l();"use strict";var{Record:fS}=uz(),lz=fz(),$y=class{constructor(e,r,i){if(!(e instanceof Uint8Array))throw new Error("key must be a Uint8Array");if(!(r instanceof Uint8Array))throw new Error("value must be a Uint8Array");this.key=e,this.value=r,this.timeReceived=i}serialize(){return fS.encode(this.prepareSerialize()).finish()}prepareSerialize(){return{key:this.key,value:this.value,timeReceived:this.timeReceived&&lz.toRFC3339(this.timeReceived)}}static deserialize(e){let r=fS.decode(e);return $y.fromDeserialized(fS.toObject(r,{defaults:!1,arrays:!0,longs:Number,objects:!1}))}static fromDeserialized(e){let r;return e.timeReceived&&(r=lz.parseRFC3339(e.timeReceived)),new $y(e.key,e.value,r)}};dz.exports=$y});var X4=m((Qut,yz)=>{l();"use strict";function pz(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function vIe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return pz(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),pz(new n,r)}}yz.exports=vIe});var mz=m((Zut,gz)=>{l();"use strict";var{sha256:wIe}=(di(),zs),Q4=X4(),{toString:_Ie}=(tt(),hr),{equals:EIe}=(wi(),bn),SIe=async(t,e)=>{if(!(t instanceof Uint8Array))throw Q4(new Error('"key" must be a Uint8Array'),"ERR_INVALID_RECORD_KEY_NOT_BUFFER");if(t.byteLength<5)throw Q4(new Error("invalid public key record"),"ERR_INVALID_RECORD_KEY_TOO_SHORT");if(_Ie(t.subarray(0,4))!=="/pk/")throw Q4(new Error("key was not prefixed with /pk/"),"ERR_INVALID_RECORD_KEY_BAD_PREFIX");let i=t.slice(4),n=await wIe.digest(e);if(!EIe(i,n.bytes))throw Q4(new Error("public key does not match passed in key"),"ERR_INVALID_RECORD_HASH_MISMATCH")};gz.exports={func:SIe,sign:!1}});var vz=m((Jut,bz)=>{l();"use strict";bz.exports={pk:mz()}});var _z=m((eft,wz)=>{l();"use strict";var xIe=X4(),{toString:AIe}=(tt(),hr),IIe=(t,e)=>{let r=e.key,n=AIe(r).split("/");if(n.length<3)return;let s=t[n[1].toString()];if(!s){let o="Invalid record keytype";throw xIe(new Error(o),"ERR_INVALID_RECORD_KEY_TYPE")}return s.func(r,e.value)};wz.exports={verifyRecord:IIe,validators:vz()}});var Sz=m((tft,Ez)=>{l();"use strict";var TIe=(t,e)=>0;Ez.exports=TIe});var Az=m((rft,xz)=>{l();"use strict";xz.exports={pk:Sz()}});var Tz=m((ift,Iz)=>{l();"use strict";var lS=X4(),{toString:RIe}=(tt(),hr),PIe=(t,e,r)=>{if(r.length===0){let o="No records given";throw lS(new Error(o),"ERR_NO_RECORDS_RECEIVED")}let n=RIe(e).split("/");if(n.length<3){let o="Record key does not have a selector function";throw lS(new Error(o),"ERR_NO_SELECTOR_FUNCTION_FOR_RECORD_KEY")}let s=t[n[1].toString()];if(!s){let o=`Unrecognized key prefix: ${n[1]}`;throw lS(new Error(o),"ERR_UNRECOGNIZED_KEY_PREFIX")}return s(e,r)};Iz.exports={bestRecord:PIe,selectors:Az()}});var ad=m((nft,Rz)=>{l();"use strict";Rz.exports={Record:hz(),validator:_z(),selection:Tz()}});var Lz=m((Tft,Mz)=>{l();"use strict";var OIe=/^(?:[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?\.){0,126}(?:[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9]))\.?$/i;Mz.exports=function(e,r){if(r==null&&(r=!1),e.length<2||e.length>255)return!1;var i=e[e.length-1];if(r){if(i!==".")return!1}else if(i===".")return!1;return OIe.test(e)}});var fu=m((Hlt,fH)=>{l();"use strict";var UIe=()=>{let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t};fH.exports=UIe});var br=m((Glt,TS)=>{l();"use strict";var op=typeof Reflect=="object"?Reflect:null,lH=op&&typeof op.apply=="function"?op.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},rb;op&&typeof op.ownKeys=="function"?rb=op.ownKeys:Object.getOwnPropertySymbols?rb=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:rb=function(e){return Object.getOwnPropertyNames(e)};function FIe(t){console&&console.warn&&console.warn(t)}var dH=Number.isNaN||function(e){return e!==e};function ir(){ir.init.call(this)}TS.exports=ir;TS.exports.once=HIe;ir.EventEmitter=ir;ir.prototype._events=void 0;ir.prototype._eventsCount=0;ir.prototype._maxListeners=void 0;var hH=10;function ib(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(ir,"defaultMaxListeners",{enumerable:!0,get:function(){return hH},set:function(t){if(typeof t!="number"||t<0||dH(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");hH=t}});ir.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ir.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||dH(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function pH(t){return t._maxListeners===void 0?ir.defaultMaxListeners:t._maxListeners}ir.prototype.getMaxListeners=function(){return pH(this)};ir.prototype.emit=function(e){for(var r=[],i=1;i0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")lH(c,this,r);else for(var u=c.length,f=vH(c,u),i=0;i0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,FIe(a)}return t}ir.prototype.addListener=function(e,r){return yH(this,e,r,!1)};ir.prototype.on=ir.prototype.addListener;ir.prototype.prependListener=function(e,r){return yH(this,e,r,!0)};function KIe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function gH(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=KIe.bind(i);return n.listener=r,i.wrapFn=n,n}ir.prototype.once=function(e,r){return ib(r),this.on(e,gH(this,e,r)),this};ir.prototype.prependOnceListener=function(e,r){return ib(r),this.prependListener(e,gH(this,e,r)),this};ir.prototype.removeListener=function(e,r){var i,n,s,o,a;if(ib(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount==0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===r||i[o].listener===r){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():VIe(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};ir.prototype.off=ir.prototype.removeListener;ir.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n=0;n--)this.removeListener(e,r[n]);return this};function mH(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?zIe(n):vH(n,n.length)}ir.prototype.listeners=function(e){return mH(this,e,!0)};ir.prototype.rawListeners=function(e){return mH(this,e,!1)};ir.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):bH.call(t,e)};ir.prototype.listenerCount=bH;function bH(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ir.prototype.eventNames=function(){return this._eventsCount>0?rb(this._events):[]};function vH(t,e){for(var r=new Array(e),i=0;i{l();"use strict";var nb=fu(),$Ie=br().EventEmitter;async function*WIe(t,e=1){e<1&&(e=1);let r=new $Ie,i=[],n=nb(),s=!1,o=nb();for(r.on("task-complete",()=>{o.resolve(),o=nb()}),Promise.resolve().then(async()=>{try{for await(let a of t){i.length===e&&await n.promise;let c={done:!1};i.push(c),a().then(u=>{c.done=!0,c.ok=!0,c.value=u,r.emit("task-complete")},u=>{c.done=!0,c.err=u,r.emit("task-complete")})}s=!0}catch(a){r.emit("task-complete")}});;){for(await o.promise;i.length&&i[0].done;){let a=i[0];if(i.shift(),a.ok)yield a.value;else throw a.err;n.resolve(),n=nb()}if(s&&i.length===0)break}}_H.exports=WIe});var ob=m((cdt,kH)=>{l();"use strict";async function*XIe(t,e=1){let r=[];e<1&&(e=1);for await(let i of t)for(r.push(i);r.length>=e;)yield r.slice(0,e),r=r.slice(e);for(;r.length;)yield r.slice(0,e),r=r.slice(e)}kH.exports=XIe});var ab=m((udt,DH)=>{l();"use strict";var QIe=ob();async function*ZIe(t,e=1){for await(let r of QIe(t,e)){let i=r.map(n=>n().then(s=>({ok:!0,value:s}),s=>({ok:!1,err:s})));for(let n=0;n{l();(function(t,e){"use strict";var r={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function i(p){if(!Array.isArray(p)&&!ArrayBuffer.isView(p))return!1;for(var y=0;y255)return!1;return!0}function n(p,y){return(p&65535)*y+(((p>>>16)*y&65535)<<16)}function s(p,y){return p<>>32-y}function o(p){return p^=p>>>16,p=n(p,2246822507),p^=p>>>13,p=n(p,3266489909),p^=p>>>16,p}function a(p,y){p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535],y=[y[0]>>>16,y[0]&65535,y[1]>>>16,y[1]&65535];var b=[0,0,0,0];return b[3]+=p[3]+y[3],b[2]+=b[3]>>>16,b[3]&=65535,b[2]+=p[2]+y[2],b[1]+=b[2]>>>16,b[2]&=65535,b[1]+=p[1]+y[1],b[0]+=b[1]>>>16,b[1]&=65535,b[0]+=p[0]+y[0],b[0]&=65535,[b[0]<<16|b[1],b[2]<<16|b[3]]}function c(p,y){p=[p[0]>>>16,p[0]&65535,p[1]>>>16,p[1]&65535],y=[y[0]>>>16,y[0]&65535,y[1]>>>16,y[1]&65535];var b=[0,0,0,0];return b[3]+=p[3]*y[3],b[2]+=b[3]>>>16,b[3]&=65535,b[2]+=p[2]*y[3],b[1]+=b[2]>>>16,b[2]&=65535,b[2]+=p[3]*y[2],b[1]+=b[2]>>>16,b[2]&=65535,b[1]+=p[1]*y[3],b[0]+=b[1]>>>16,b[1]&=65535,b[1]+=p[2]*y[2],b[0]+=b[1]>>>16,b[1]&=65535,b[1]+=p[3]*y[1],b[0]+=b[1]>>>16,b[1]&=65535,b[0]+=p[0]*y[3]+p[1]*y[2]+p[2]*y[1]+p[3]*y[0],b[0]&=65535,[b[0]<<16|b[1],b[2]<<16|b[3]]}function u(p,y){return y%=64,y===32?[p[1],p[0]]:y<32?[p[0]<>>32-y,p[1]<>>32-y]:(y-=32,[p[1]<>>32-y,p[0]<>>32-y])}function f(p,y){return y%=64,y===0?p:y<32?[p[0]<>>32-y,p[1]<>>1]),p=c(p,[4283543511,3981806797]),p=d(p,[0,p[0]>>>1]),p=c(p,[3301882366,444984403]),p=d(p,[0,p[0]>>>1]),p}r.x86.hash32=function(p,y){if(r.inputValidation&&!i(p))return e;y=y||0;for(var b=p.length%4,E=p.length-b,v=y,A=0,R=3432918353,F=461845907,D=0;D>>0},r.x86.hash128=function(p,y){if(r.inputValidation&&!i(p))return e;y=y||0;for(var b=p.length%16,E=p.length-b,v=y,A=y,R=y,F=y,D=0,B=0,H=0,W=0,X=597399067,P=2869860233,g=951274213,w=2716044179,S=0;S>>0).toString(16)).slice(-8)+("00000000"+(A>>>0).toString(16)).slice(-8)+("00000000"+(R>>>0).toString(16)).slice(-8)+("00000000"+(F>>>0).toString(16)).slice(-8)},r.x64.hash128=function(p,y){if(r.inputValidation&&!i(p))return e;y=y||0;for(var b=p.length%16,E=p.length-b,v=[0,y],A=[0,y],R=[0,0],F=[0,0],D=[2277735313,289559509],B=[1291169091,658871167],H=0;H>>0).toString(16)).slice(-8)+("00000000"+(v[1]>>>0).toString(16)).slice(-8)+("00000000"+(A[0]>>>0).toString(16)).slice(-8)+("00000000"+(A[1]>>>0).toString(16)).slice(-8)},typeof Yy!="undefined"?(typeof cb!="undefined"&&cb.exports&&(Yy=cb.exports=r),Yy.murmurHash3=r):typeof define=="function"&&define.amd?define([],function(){return r}):(r._murmurHash3=t.murmurHash3,r.noConflict=function(){return t.murmurHash3=r._murmurHash3,r._murmurHash3=e,r.noConflict=e,r},t.murmurHash3=r)})(Yy)});var MH=m((fdt,NH)=>{l();NH.exports=BH()});var Xy=m((Idt,UH)=>{l();"use strict";function jH(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function nTe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return jH(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),jH(new n,r)}}UH.exports=nTe});var Rn=m((Kdt,eG)=>{l();"use strict";var{Buffer:ra}=Ht(),JH=Symbol.for("BufferList");function vr(t){if(!(this instanceof vr))return new vr(t);vr._init.call(this,t)}vr._init=function(e){Object.defineProperty(this,JH,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};vr.prototype._new=function(e){return new vr(e)};vr.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let i=0;ithis.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};vr.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};vr.prototype.copy=function(e,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||ra.alloc(0);let s=!!e,o=this._offset(i),a=n-i,c=a,u=s&&r||0,f=o[1];if(i===0&&n===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:ra.concat(this._bufs,this.length);for(let d=0;dh)this._bufs[d].copy(e,u,f),u+=h;else{this._bufs[d].copy(e,u,f,f+c),u+=h;break}c-=h,f&&(f=0)}return e.length>u?e.slice(0,u):e};vr.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let i=this._offset(e),n=this._offset(r),s=this._bufs.slice(i[0],n[0]+1);return n[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,n[1]),i[1]!==0&&(s[0]=s[0].slice(i[1])),this._new(s)};vr.prototype.toString=function(e,r,i){return this.slice(r,i).toString(e)};vr.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};vr.prototype.duplicate=function(){let e=this._new();for(let r=0;rthis.length?this.length:e;let i=this._offset(e),n=i[0],s=i[1];for(;n=t.length){let c=o.indexOf(t,s);if(c!==-1)return this._reverseOffset([n,c]);s=o.length-t.length+1}else{let c=this._reverseOffset([n,s]);if(this._match(c,t))return c;s++}s=0}return-1};vr.prototype._match=function(t,e){if(this.length-t{l();var tG=class{constructor(e,r=12,i=8*1024,n=32*1024,s=64,o){this.bits=r,this.min=i,this.max=n,this.asModule=e,this.rabin=new e.Rabin(r,i,n,s,o),this.polynomial=o}fingerprint(e){let{__retain:r,__release:i,__allocArray:n,__getInt32Array:s,Int32Array_ID:o,Uint8Array_ID:a}=this.asModule,c=new Int32Array(Math.ceil(e.length/this.min)),u=r(n(o,c)),f=r(n(a,e)),d=this.rabin.fingerprint(f,u),h=s(d);i(f),i(u);let p=h.indexOf(0);return p>=0?h.subarray(0,p):h}};rG.exports=tG});var gG=m(Jy=>{l();"use strict";var OS=-8,ub=-4,hTe=0,nG=1,sG=1<<0,fb=1<<1,zdt=1<<2,Hdt=1<<3,oG=5,Gdt=1<>>2]>>>1,s=e>>>1;if(n<=Zy)return String.fromCharCode.apply(String,i.subarray(s,s+n));let o=[];do{let a=i[s+Zy-1],c=a>=55296&&a<56320?Zy-1:Zy;o.push(String.fromCharCode.apply(String,i.subarray(s,s+=c))),n-=c}while(n>Zy);return o.join("")+String.fromCharCode.apply(String,i.subarray(s,s+n))}function DS(t){let e={};function r(n,s){return n?lG(n.buffer,s):""}let i=t.env=t.env||{};return i.abort=i.abort||function(s,o,a,c){let u=e.memory||i.memory;throw Error("abort: "+r(u,s)+" at "+r(u,o)+":"+a+":"+c)},i.trace=i.trace||function(s,o){let a=e.memory||i.memory;console.log("trace: "+r(a,s)+(o?" ":"")+Array.prototype.slice.call(arguments,2,2+o).join(", "))},t.Math=t.Math||Math,t.Date=t.Date||Date,e}function BS(t,e){let r=e.exports,i=r.memory,n=r.table,s=r.__alloc,o=r.__retain,a=r.__rtti_base||~0;function c(B){let H=new Uint32Array(i.buffer),W=H[a>>>2];if((B>>>=0)>=W)throw Error("invalid id: "+B);return H[(a+4>>>2)+B*2]}function u(B){let H=new Uint32Array(i.buffer),W=H[a>>>2];if((B>>>=0)>=W)throw Error("invalid id: "+B);return H[(a+4>>>2)+B*2+1]}function f(B){return 31-Math.clz32(B>>>oG&31)}function d(B){return 31-Math.clz32(B>>>uG&31)}function h(B){let H=B.length,W=s(H<<1,nG),X=new Uint16Array(i.buffer);for(var P=0,g=W>>>1;P>>2]!==nG)throw Error("not a string: "+B);return lG(H,B)}t.__getString=p;function y(B,H,W){let X=i.buffer;if(W)switch(B){case 2:return new Float32Array(X);case 3:return new Float64Array(X)}else switch(B){case 0:return new(H?Int8Array:Uint8Array)(X);case 1:return new(H?Int16Array:Uint16Array)(X);case 2:return new(H?Int32Array:Uint32Array)(X);case 3:return new(H?BigInt64Array:BigUint64Array)(X)}throw Error("unsupported align: "+B)}function b(B,H){let W=c(B);if(!(W&(sG|fb)))throw Error("not an array: "+B+" @ "+W);let X=f(W),P=H.length,g=s(P<>>2]=o(g),S[w+kS>>>2]=g,S[w+gTe>>>2]=P<>>2]=P);let C=y(X,W&aG,W&cG);if(W&pTe)for(let L=0;L>>X)+L]=o(H[L]);else C.set(H,g>>>X);return w}t.__allocArray=b;function E(B){let H=new Uint32Array(i.buffer),W=H[B+OS>>>2],X=c(W);if(!(X&sG))throw Error("not an array: "+W);let P=f(X);var g=H[B+kS>>>2];let w=X&fb?H[B+fG>>>2]:H[g+ub>>>2]>>>P;return y(P,X&aG,X&cG).subarray(g>>>=P,g+w)}t.__getArrayView=E;function v(B){let H=E(B),W=H.length,X=new Array(W);for(let P=0;P>>2];return H.slice(B,B+W)}t.__getArrayBuffer=A;function R(B,H,W){return new B(F(B,H,W))}function F(B,H,W){let X=i.buffer,P=new Uint32Array(X),g=P[W+kS>>>2];return new B(X,g,P[g+ub>>>2]>>>H)}t.__getInt8Array=R.bind(null,Int8Array,0),t.__getInt8ArrayView=F.bind(null,Int8Array,0),t.__getUint8Array=R.bind(null,Uint8Array,0),t.__getUint8ArrayView=F.bind(null,Uint8Array,0),t.__getUint8ClampedArray=R.bind(null,Uint8ClampedArray,0),t.__getUint8ClampedArrayView=F.bind(null,Uint8ClampedArray,0),t.__getInt16Array=R.bind(null,Int16Array,1),t.__getInt16ArrayView=F.bind(null,Int16Array,1),t.__getUint16Array=R.bind(null,Uint16Array,1),t.__getUint16ArrayView=F.bind(null,Uint16Array,1),t.__getInt32Array=R.bind(null,Int32Array,2),t.__getInt32ArrayView=F.bind(null,Int32Array,2),t.__getUint32Array=R.bind(null,Uint32Array,2),t.__getUint32ArrayView=F.bind(null,Uint32Array,2),vTe&&(t.__getInt64Array=R.bind(null,BigInt64Array,3),t.__getInt64ArrayView=F.bind(null,BigInt64Array,3),t.__getUint64Array=R.bind(null,BigUint64Array,3),t.__getUint64ArrayView=F.bind(null,BigUint64Array,3)),t.__getFloat32Array=R.bind(null,Float32Array,2),t.__getFloat32ArrayView=F.bind(null,Float32Array,2),t.__getFloat64Array=R.bind(null,Float64Array,3),t.__getFloat64ArrayView=F.bind(null,Float64Array,3);function D(B,H){let W=new Uint32Array(i.buffer);var X=W[B+OS>>>2];if(X<=W[a>>>2])do if(X==H)return!0;while(X=u(X));return!1}return t.__instanceof=D,t.memory=t.memory||i,t.table=t.table||n,yG(r,t)}function dG(t){return typeof Response!="undefined"&&t instanceof Response}async function hG(t,e){return dG(t=await t)?pG(t,e):BS(DS(e||(e={})),await WebAssembly.instantiate(t instanceof WebAssembly.Module?t:await WebAssembly.compile(t),e))}Jy.instantiate=hG;function wTe(t,e){return BS(DS(e||(e={})),new WebAssembly.Instance(t instanceof WebAssembly.Module?t:new WebAssembly.Module(t),e))}Jy.instantiateSync=wTe;async function pG(t,e){return WebAssembly.instantiateStreaming?BS(DS(e||(e={})),(await WebAssembly.instantiateStreaming(t,e)).instance):hG(dG(t=await t)?t.arrayBuffer():t,e)}Jy.instantiateStreaming=pG;function yG(t,e){var r=e?Object.create(e):{},i=t.__argumentsLength?function(n){t.__argumentsLength.value=n}:t.__setArgumentsLength||t.__setargc||function(){};for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=t[n],o=n.split("."),a=r;for(;o.length>1;){let f=o.shift();Object.prototype.hasOwnProperty.call(a,f)||(a[f]={}),a=a[f]}let c=o[0],u=c.indexOf("#");if(u>=0){let f=c.substring(0,u),d=a[f];if(typeof d=="undefined"||!d.prototype){let h=function(...p){return h.wrap(h.prototype.constructor(0,...p))};h.prototype={valueOf:function(){return this[Qy]}},h.wrap=function(p){return Object.create(h.prototype,{[Qy]:{value:p,writable:!1}})},d&&Object.getOwnPropertyNames(d).forEach(p=>Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(d,p))),a[f]=h}if(c=c.substring(u+1),a=a[f].prototype,/^(get|set):/.test(c)){if(!Object.prototype.hasOwnProperty.call(a,c=c.substring(4))){let h=t[n.replace("set:","get:")],p=t[n.replace("get:","set:")];Object.defineProperty(a,c,{get:function(){return h(this[Qy])},set:function(y){p(this[Qy],y)},enumerable:!0})}}else c==="constructor"?(a[c]=(...h)=>(i(h.length),s(...h))).original=s:(a[c]=function(...h){return i(h.length),s(this[Qy],...h)}).original=s}else/^(get|set):/.test(c)?Object.prototype.hasOwnProperty.call(a,c=c.substring(4))||Object.defineProperty(a,c,{get:t[n.replace("set:","get:")],set:t[n.replace("get:","set:")],enumerable:!0}):typeof s=="function"&&s!==i?(a[c]=(...f)=>(i(f.length),s(...f))).original=s:a[c]=s}return r}Jy.demangle=yG});var bG=m((eht,mG)=>{l();var{instantiate:_Te}=gG();NS.supported=typeof WebAssembly!="undefined";function NS(t={}){if(!NS.supported)return null;var e=new Uint8Array([0,97,115,109,1,0,0,0,1,78,14,96,2,127,126,0,96,1,127,1,126,96,2,127,127,0,96,1,127,1,127,96,1,127,0,96,2,127,127,1,127,96,3,127,127,127,1,127,96,0,0,96,3,127,127,127,0,96,0,1,127,96,4,127,127,127,127,0,96,5,127,127,127,127,127,1,127,96,1,126,1,127,96,2,126,126,1,126,2,13,1,3,101,110,118,5,97,98,111,114,116,0,10,3,54,53,2,2,8,9,3,5,2,8,6,5,3,4,2,6,9,12,13,2,5,11,3,2,3,2,3,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,6,7,7,4,4,5,3,1,0,1,6,47,9,127,1,65,0,11,127,1,65,0,11,127,0,65,3,11,127,0,65,4,11,127,1,65,0,11,127,1,65,0,11,127,1,65,0,11,127,0,65,240,2,11,127,0,65,6,11,7,240,5,41,6,109,101,109,111,114,121,2,0,7,95,95,97,108,108,111,99,0,10,8,95,95,114,101,116,97,105,110,0,11,9,95,95,114,101,108,101,97,115,101,0,12,9,95,95,99,111,108,108,101,99,116,0,51,11,95,95,114,116,116,105,95,98,97,115,101,3,7,13,73,110,116,51,50,65,114,114,97,121,95,73,68,3,2,13,85,105,110,116,56,65,114,114,97,121,95,73,68,3,3,6,100,101,103,114,101,101,0,16,3,109,111,100,0,17,5,82,97,98,105,110,3,8,16,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,0,21,16,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,0,22,21,82,97,98,105,110,35,103,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,23,21,82,97,98,105,110,35,115,101,116,58,119,105,110,100,111,119,95,115,105,122,101,0,24,14,82,97,98,105,110,35,103,101,116,58,119,112,111,115,0,25,14,82,97,98,105,110,35,115,101,116,58,119,112,111,115,0,26,15,82,97,98,105,110,35,103,101,116,58,99,111,117,110,116,0,27,15,82,97,98,105,110,35,115,101,116,58,99,111,117,110,116,0,28,13,82,97,98,105,110,35,103,101,116,58,112,111,115,0,29,13,82,97,98,105,110,35,115,101,116,58,112,111,115,0,30,15,82,97,98,105,110,35,103,101,116,58,115,116,97,114,116,0,31,15,82,97,98,105,110,35,115,101,116,58,115,116,97,114,116,0,32,16,82,97,98,105,110,35,103,101,116,58,100,105,103,101,115,116,0,33,16,82,97,98,105,110,35,115,101,116,58,100,105,103,101,115,116,0,34,21,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,35,21,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,115,116,97,114,116,0,36,22,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,37,22,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,108,101,110,103,116,104,0,38,31,82,97,98,105,110,35,103,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,39,31,82,97,98,105,110,35,115,101,116,58,99,104,117,110,107,95,99,117,116,95,102,105,110,103,101,114,112,114,105,110,116,0,40,20,82,97,98,105,110,35,103,101,116,58,112,111,108,121,110,111,109,105,97,108,0,41,20,82,97,98,105,110,35,115,101,116,58,112,111,108,121,110,111,109,105,97,108,0,42,17,82,97,98,105,110,35,103,101,116,58,109,105,110,115,105,122,101,0,43,17,82,97,98,105,110,35,115,101,116,58,109,105,110,115,105,122,101,0,44,17,82,97,98,105,110,35,103,101,116,58,109,97,120,115,105,122,101,0,45,17,82,97,98,105,110,35,115,101,116,58,109,97,120,115,105,122,101,0,46,14,82,97,98,105,110,35,103,101,116,58,109,97,115,107,0,47,14,82,97,98,105,110,35,115,101,116,58,109,97,115,107,0,48,17,82,97,98,105,110,35,99,111,110,115,116,114,117,99,116,111,114,0,20,17,82,97,98,105,110,35,102,105,110,103,101,114,112,114,105,110,116,0,49,8,1,50,10,165,31,53,199,1,1,4,127,32,1,40,2,0,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,3,65,4,107,118,65,16,115,33,4,32,3,65,7,107,11,33,3,32,1,40,2,20,33,2,32,1,40,2,16,34,5,4,64,32,5,32,2,54,2,20,11,32,2,4,64,32,2,32,5,54,2,16,11,32,1,32,0,32,4,32,3,65,4,116,106,65,2,116,106,40,2,96,70,4,64,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,2,54,2,96,32,2,69,4,64,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,65,127,115,113,34,1,54,2,4,32,1,69,4,64,32,0,32,0,40,2,0,65,1,32,3,116,65,127,115,113,54,2,0,11,11,11,11,226,2,1,6,127,32,1,40,2,0,33,3,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,34,5,65,1,113,4,64,32,3,65,124,113,65,16,106,32,5,65,124,113,106,34,2,65,240,255,255,255,3,73,4,64,32,0,32,4,16,1,32,1,32,2,32,3,65,3,113,114,34,3,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,34,4,40,2,0,33,5,11,11,32,3,65,2,113,4,64,32,1,65,4,107,40,2,0,34,2,40,2,0,34,6,65,124,113,65,16,106,32,3,65,124,113,106,34,7,65,240,255,255,255,3,73,4,64,32,0,32,2,16,1,32,2,32,7,32,6,65,3,113,114,34,3,54,2,0,32,2,33,1,11,11,32,4,32,5,65,2,114,54,2,0,32,4,65,4,107,32,1,54,2,0,32,0,32,3,65,124,113,34,2,65,128,2,73,4,127,32,2,65,4,118,33,4,65,0,5,32,2,65,31,32,2,103,107,34,2,65,4,107,118,65,16,115,33,4,32,2,65,7,107,11,34,3,65,4,116,32,4,106,65,2,116,106,40,2,96,33,2,32,1,65,0,54,2,16,32,1,32,2,54,2,20,32,2,4,64,32,2,32,1,54,2,16,11,32,0,32,4,32,3,65,4,116,106,65,2,116,106,32,1,54,2,96,32,0,32,0,40,2,0,65,1,32,3,116,114,54,2,0,32,0,32,3,65,2,116,106,32,0,32,3,65,2,116,106,40,2,4,65,1,32,4,116,114,54,2,4,11,119,1,1,127,32,2,2,127,32,0,40,2,160,12,34,2,4,64,32,2,32,1,65,16,107,70,4,64,32,2,40,2,0,33,3,32,1,65,16,107,33,1,11,11,32,1,11,107,34,2,65,48,73,4,64,15,11,32,1,32,3,65,2,113,32,2,65,32,107,65,1,114,114,54,2,0,32,1,65,0,54,2,16,32,1,65,0,54,2,20,32,1,32,2,106,65,16,107,34,2,65,2,54,2,0,32,0,32,2,54,2,160,12,32,0,32,1,16,2,11,155,1,1,3,127,35,0,34,0,69,4,64,65,1,63,0,34,0,74,4,127,65,1,32,0,107,64,0,65,0,72,5,65,0,11,4,64,0,11,65,176,3,34,0,65,0,54,2,0,65,208,15,65,0,54,2,0,3,64,32,1,65,23,73,4,64,32,1,65,2,116,65,176,3,106,65,0,54,2,4,65,0,33,2,3,64,32,2,65,16,73,4,64,32,1,65,4,116,32,2,106,65,2,116,65,176,3,106,65,0,54,2,96,32,2,65,1,106,33,2,12,1,11,11,32,1,65,1,106,33,1,12,1,11,11,65,176,3,65,224,15,63,0,65,16,116,16,3,65,176,3,36,0,11,32,0,11,45,0,32,0,65,240,255,255,255,3,79,4,64,65,32,65,224,0,65,201,3,65,29,16,0,0,11,32,0,65,15,106,65,112,113,34,0,65,16,32,0,65,16,75,27,11,169,1,1,1,127,32,0,32,1,65,128,2,73,4,127,32,1,65,4,118,33,1,65,0,5,32,1,65,248,255,255,255,1,73,4,64,32,1,65,1,65,27,32,1,103,107,116,106,65,1,107,33,1,11,32,1,65,31,32,1,103,107,34,2,65,4,107,118,65,16,115,33,1,32,2,65,7,107,11,34,2,65,2,116,106,40,2,4,65,127,32,1,116,113,34,1,4,127,32,0,32,1,104,32,2,65,4,116,106,65,2,116,106,40,2,96,5,32,0,40,2,0,65,127,32,2,65,1,106,116,113,34,1,4,127,32,0,32,0,32,1,104,34,0,65,2,116,106,40,2,4,104,32,0,65,4,116,106,65,2,116,106,40,2,96,5,65,0,11,11,11,111,1,1,127,63,0,34,2,32,1,65,248,255,255,255,1,73,4,127,32,1,65,1,65,27,32,1,103,107,116,65,1,107,106,5,32,1,11,65,16,32,0,40,2,160,12,32,2,65,16,116,65,16,107,71,116,106,65,255,255,3,106,65,128,128,124,113,65,16,118,34,1,32,2,32,1,74,27,64,0,65,0,72,4,64,32,1,64,0,65,0,72,4,64,0,11,11,32,0,32,2,65,16,116,63,0,65,16,116,16,3,11,113,1,2,127,32,1,40,2,0,34,3,65,124,113,32,2,107,34,4,65,32,79,4,64,32,1,32,2,32,3,65,2,113,114,54,2,0,32,2,32,1,65,16,106,106,34,1,32,4,65,16,107,65,1,114,54,2,0,32,0,32,1,16,2,5,32,1,32,3,65,126,113,54,2,0,32,1,65,16,106,32,1,40,2,0,65,124,113,106,32,1,65,16,106,32,1,40,2,0,65,124,113,106,40,2,0,65,125,113,54,2,0,11,11,91,1,2,127,32,0,32,1,16,5,34,4,16,6,34,3,69,4,64,65,1,36,1,65,0,36,1,32,0,32,4,16,6,34,3,69,4,64,32,0,32,4,16,7,32,0,32,4,16,6,33,3,11,11,32,3,65,0,54,2,4,32,3,32,2,54,2,8,32,3,32,1,54,2,12,32,0,32,3,16,1,32,0,32,3,32,4,16,8,32,3,11,13,0,16,4,32,0,32,1,16,9,65,16,106,11,33,1,1,127,32,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,18,0,32,0,65,172,3,75,4,64,32,0,65,16,107,16,52,11,11,140,3,1,1,127,2,64,32,1,69,13,0,32,0,65,0,58,0,0,32,0,32,1,106,65,1,107,65,0,58,0,0,32,1,65,2,77,13,0,32,0,65,1,106,65,0,58,0,0,32,0,65,2,106,65,0,58,0,0,32,0,32,1,106,34,2,65,2,107,65,0,58,0,0,32,2,65,3,107,65,0,58,0,0,32,1,65,6,77,13,0,32,0,65,3,106,65,0,58,0,0,32,0,32,1,106,65,4,107,65,0,58,0,0,32,1,65,8,77,13,0,32,1,65,0,32,0,107,65,3,113,34,1,107,33,2,32,0,32,1,106,34,0,65,0,54,2,0,32,0,32,2,65,124,113,34,1,106,65,4,107,65,0,54,2,0,32,1,65,8,77,13,0,32,0,65,4,106,65,0,54,2,0,32,0,65,8,106,65,0,54,2,0,32,0,32,1,106,34,2,65,12,107,65,0,54,2,0,32,2,65,8,107,65,0,54,2,0,32,1,65,24,77,13,0,32,0,65,12,106,65,0,54,2,0,32,0,65,16,106,65,0,54,2,0,32,0,65,20,106,65,0,54,2,0,32,0,65,24,106,65,0,54,2,0,32,0,32,1,106,34,2,65,28,107,65,0,54,2,0,32,2,65,24,107,65,0,54,2,0,32,2,65,20,107,65,0,54,2,0,32,2,65,16,107,65,0,54,2,0,32,0,32,0,65,4,113,65,24,106,34,2,106,33,0,32,1,32,2,107,33,1,3,64,32,1,65,32,79,4,64,32,0,66,0,55,3,0,32,0,65,8,106,66,0,55,3,0,32,0,65,16,106,66,0,55,3,0,32,0,65,24,106,66,0,55,3,0,32,1,65,32,107,33,1,32,0,65,32,106,33,0,12,1,11,11,11,11,178,1,1,3,127,32,1,65,240,255,255,255,3,32,2,118,75,4,64,65,144,1,65,192,1,65,23,65,56,16,0,0,11,32,1,32,2,116,34,3,65,0,16,10,34,2,32,3,16,13,32,0,69,4,64,65,12,65,2,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,2,34,1,32,0,40,2,0,34,4,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,32,4,16,12,11,32,0,32,1,54,2,0,32,0,32,2,54,2,4,32,0,32,3,54,2,8,32,0,11,46,1,2,127,65,12,65,5,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,65,128,2,65,3,16,14,11,9,0,65,63,32,0,121,167,107,11,49,1,2,127,65,63,32,1,121,167,107,33,2,3,64,65,63,32,0,121,167,107,32,2,107,34,3,65,0,78,4,64,32,0,32,1,32,3,172,134,133,33,0,12,1,11,11,32,0,11,40,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,163,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,65,0,58,0,0,11,38,0,32,1,32,0,40,2,8,79,4,64,65,128,2,65,192,2,65,152,1,65,44,16,0,0,11,32,1,32,0,40,2,4,106,45,0,0,11,254,5,2,1,127,4,126,32,0,69,4,64,65,232,0,65,6,16,10,34,0,65,172,3,75,4,64,32,0,65,16,107,34,5,32,5,40,2,4,65,1,106,54,2,4,11,11,32,0,65,0,54,2,0,32,0,65,0,54,2,4,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,24,32,0,66,0,55,3,32,32,0,66,0,55,3,40,32,0,66,0,55,3,48,32,0,66,0,55,3,56,32,0,66,0,55,3,64,32,0,66,0,55,3,72,32,0,66,0,55,3,80,32,0,66,0,55,3,88,32,0,66,0,55,3,96,32,0,32,2,173,55,3,80,32,0,32,3,173,55,3,88,65,12,65,4,16,10,34,2,65,172,3,75,4,64,32,2,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,32,4,65,0,16,14,33,2,32,0,40,2,0,16,12,32,0,32,2,54,2,0,32,0,32,4,54,2,4,32,0,66,1,32,1,173,134,66,1,125,55,3,96,32,0,66,243,130,183,218,216,230,232,30,55,3,72,35,4,69,4,64,65,0,33,2,3,64,32,2,65,128,2,72,4,64,32,2,65,255,1,113,173,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,65,0,33,4,3,64,32,4,32,0,40,2,4,65,1,107,72,4,64,32,6,66,8,134,33,6,32,0,41,3,72,34,7,33,8,65,63,32,7,121,167,107,33,1,3,64,65,63,32,6,121,167,107,32,1,107,34,3,65,0,78,4,64,32,6,32,8,32,3,172,134,133,33,6,12,1,11,11,32,4,65,1,106,33,4,12,1,11,11,35,6,40,2,4,32,2,65,3,116,106,32,6,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,63,32,0,41,3,72,121,167,107,172,33,7,65,0,33,2,3,64,32,2,65,128,2,72,4,64,35,5,33,1,32,2,172,32,7,134,34,8,33,6,65,63,32,0,41,3,72,34,9,121,167,107,33,3,3,64,65,63,32,6,121,167,107,32,3,107,34,4,65,0,78,4,64,32,6,32,9,32,4,172,134,133,33,6,12,1,11,11,32,1,40,2,4,32,2,65,3,116,106,32,6,32,8,132,55,3,0,32,2,65,1,106,33,2,12,1,11,11,65,1,36,4,11,32,0,66,0,55,3,24,32,0,66,0,55,3,32,65,0,33,2,3,64,32,2,32,0,40,2,4,72,4,64,32,0,40,2,0,32,2,16,18,32,2,65,1,106,33,2,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,6,66,45,136,167,65,3,116,106,41,3,0,32,6,66,8,134,66,1,132,133,55,3,40,32,0,11,38,1,1,127,32,0,40,2,0,34,0,65,172,3,75,4,64,32,0,65,16,107,34,1,32,1,40,2,4,65,1,106,54,2,4,11,32,0,11,55,1,2,127,32,1,32,0,40,2,0,34,2,71,4,64,32,1,65,172,3,75,4,64,32,1,65,16,107,34,3,32,3,40,2,4,65,1,106,54,2,4,11,32,2,16,12,11,32,0,32,1,54,2,0,11,7,0,32,0,40,2,4,11,9,0,32,0,32,1,54,2,4,11,7,0,32,0,40,2,8,11,9,0,32,0,32,1,54,2,8,11,7,0,32,0,41,3,16,11,9,0,32,0,32,1,55,3,16,11,7,0,32,0,41,3,24,11,9,0,32,0,32,1,55,3,24,11,7,0,32,0,41,3,32,11,9,0,32,0,32,1,55,3,32,11,7,0,32,0,41,3,40,11,9,0,32,0,32,1,55,3,40,11,7,0,32,0,41,3,48,11,9,0,32,0,32,1,55,3,48,11,7,0,32,0,41,3,56,11,9,0,32,0,32,1,55,3,56,11,7,0,32,0,41,3,64,11,9,0,32,0,32,1,55,3,64,11,7,0,32,0,41,3,72,11,9,0,32,0,32,1,55,3,72,11,7,0,32,0,41,3,80,11,9,0,32,0,32,1,55,3,80,11,7,0,32,0,41,3,88,11,9,0,32,0,32,1,55,3,88,11,7,0,32,0,41,3,96,11,9,0,32,0,32,1,55,3,96,11,172,4,2,5,127,1,126,32,2,65,172,3,75,4,64,32,2,65,16,107,34,4,32,4,40,2,4,65,1,106,54,2,4,11,32,2,33,4,65,0,33,2,32,1,40,2,8,33,5,32,1,40,2,4,33,6,3,64,2,127,65,0,33,3,3,64,32,3,32,5,72,4,64,32,3,32,6,106,45,0,0,33,1,32,0,40,2,0,32,0,40,2,8,16,19,33,7,32,0,40,2,8,32,0,40,2,0,40,2,4,106,32,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,7,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,1,173,32,8,66,8,134,132,133,55,3,40,32,0,32,0,41,3,16,66,1,124,55,3,16,32,0,32,0,41,3,24,66,1,124,55,3,24,32,0,41,3,16,32,0,41,3,80,90,4,127,32,0,41,3,40,32,0,41,3,96,131,80,5,65,0,11,4,127,65,1,5,32,0,41,3,16,32,0,41,3,88,90,11,4,64,32,0,32,0,41,3,32,55,3,48,32,0,32,0,41,3,16,55,3,56,32,0,32,0,41,3,40,55,3,64,65,0,33,1,3,64,32,1,32,0,40,2,4,72,4,64,32,0,40,2,0,32,1,16,18,32,1,65,1,106,33,1,12,1,11,11,32,0,66,0,55,3,40,32,0,65,0,54,2,8,32,0,66,0,55,3,16,32,0,66,0,55,3,40,32,0,40,2,0,32,0,40,2,8,16,19,33,1,32,0,40,2,8,32,0,40,2,0,40,2,4,106,65,1,58,0,0,32,0,32,0,41,3,40,35,6,40,2,4,32,1,65,3,116,106,41,3,0,133,55,3,40,32,0,32,0,40,2,8,65,1,106,32,0,40,2,4,111,54,2,8,32,0,35,5,40,2,4,32,0,41,3,40,34,8,66,45,136,167,65,3,116,106,41,3,0,32,8,66,8,134,66,1,132,133,55,3,40,32,3,65,1,106,12,3,11,32,3,65,1,106,33,3,12,1,11,11,65,127,11,34,1,65,0,78,4,64,32,5,32,1,107,33,5,32,1,32,6,106,33,6,32,2,34,1,65,1,106,33,2,32,4,40,2,4,32,1,65,2,116,106,32,0,41,3,56,62,2,0,12,1,11,11,32,4,11,10,0,16,15,36,5,16,15,36,6,11,3,0,1,11,73,1,2,127,32,0,40,2,4,34,1,65,255,255,255,255,0,113,34,2,65,1,70,4,64,32,0,65,16,106,16,53,32,0,32,0,40,2,0,65,1,114,54,2,0,35,0,32,0,16,2,5,32,0,32,2,65,1,107,32,1,65,128,128,128,128,127,113,114,54,2,4,11,11,58,0,2,64,2,64,2,64,32,0,65,8,107,40,2,0,14,7,0,0,1,1,1,1,1,2,11,15,11,32,0,40,2,0,34,0,4,64,32,0,65,172,3,79,4,64,32,0,65,16,107,16,52,11,11,15,11,0,11,11,137,3,7,0,65,16,11,55,40,0,0,0,1,0,0,0,1,0,0,0,40,0,0,0,97,0,108,0,108,0,111,0,99,0,97,0,116,0,105,0,111,0,110,0,32,0,116,0,111,0,111,0,32,0,108,0,97,0,114,0,103,0,101,0,65,208,0,11,45,30,0,0,0,1,0,0,0,1,0,0,0,30,0,0,0,126,0,108,0,105,0,98,0,47,0,114,0,116,0,47,0,116,0,108,0,115,0,102,0,46,0,116,0,115,0,65,128,1,11,43,28,0,0,0,1,0,0,0,1,0,0,0,28,0,0,0,73,0,110,0,118,0,97,0,108,0,105,0,100,0,32,0,108,0,101,0,110,0,103,0,116,0,104,0,65,176,1,11,53,38,0,0,0,1,0,0,0,1,0,0,0,38,0,0,0,126,0,108,0,105,0,98,0,47,0,97,0,114,0,114,0,97,0,121,0,98,0,117,0,102,0,102,0,101,0,114,0,46,0,116,0,115,0,65,240,1,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,73,0,110,0,100,0,101,0,120,0,32,0,111,0,117,0,116,0,32,0,111,0,102,0,32,0,114,0,97,0,110,0,103,0,101,0,65,176,2,11,51,36,0,0,0,1,0,0,0,1,0,0,0,36,0,0,0,126,0,108,0,105,0,98,0,47,0,116,0,121,0,112,0,101,0,100,0,97,0,114,0,114,0,97,0,121,0,46,0,116,0,115,0,65,240,2,11,53,7,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,145,4,0,0,2,0,0,0,49,0,0,0,2,0,0,0,17,1,0,0,2,0,0,0,16,0,34,16,115,111,117,114,99,101,77,97,112,112,105,110,103,85,82,76,16,46,47,114,97,98,105,110,46,119,97,115,109,46,109,97,112]);return _Te(new Response(new Blob([e],{type:"application/wasm"})),t)}mG.exports=NS});var _G=m((tht,wG)=>{l();var vG=iG(),ETe=bG(),STe=async(t,e,r,i,n)=>{let s=await ETe();return new vG(s,t,e,r,i,n)};wG.exports={Rabin:vG,create:STe}});var kG=m((vht,OG)=>{l();"use strict";var db=7;OG.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(e,r){let i=this._internalPositionFor(e,!1);if(r===void 0)i!==-1&&(this._unsetInternalPos(i),this._unsetBit(e),this._changedLength=!0,this._changedData=!0);else{let n=!1;i===-1?(i=this._data.length,this._setBit(e),this._changedData=!0):n=!0,this._setInternalPos(i,e,r,n),this._changedLength=!0}}unset(e){this.set(e,void 0)}get(e){this._sortData();let r=this._internalPositionFor(e,!0);if(r!==-1)return this._data[r][1]}push(e){return this.set(this.length,e),this.length}get length(){if(this._sortData(),this._changedLength){let e=this._data[this._data.length-1];this._length=e?e[0]+1:0,this._changedLength=!1}return this._length}forEach(e){let r=0;for(;r=this._bitArrays.length)return-1;let n=this._bitArrays[i],s=e-i*db;if(!((n&1<0))return-1;let a=this._bitArrays.slice(0,i).reduce(kTe,0),c=~(4294967295<=r)s.push(o);else if(s[0][0]<=r)s.unshift(o);else{let a=Math.round(s.length/2);this._data=s.slice(0,a).concat(o).concat(s.slice(a))}else this._data.push(o);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(e){this._data.splice(e,1)}_sortData(){this._changedData&&this._data.sort(DTe),this._changedData=!1}bitField(){let e=[],r=8,i=0,n=0,s,o=this._bitArrays.slice();for(;o.length||i;){i===0&&(s=o.shift(),i=7);let c=Math.min(i,r),u=~(255<>>c,i-=c,r-=c,(!r||!i&&!o.length)&&(e.push(n),n=0,r=8)}for(var a=e.length-1;a>0&&e[a]===0;a--)e.pop();return e}compactArray(){return this._sortData(),this._data.map(BTe)}};function kTe(t,e){return t+CG(e)}function CG(t){let e=t;return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}function DTe(t,e){return t[0]-e[0]}function BTe(t){return t[1]}});var NG=m((wht,BG)=>{l();"use strict";var NTe=kG(),{fromString:MTe}=(dt(),bi),ia=class{constructor(e,r,i=0){this._options=e,this._popCount=0,this._parent=r,this._posAtParent=i,this._children=new NTe,this.key=null}async put(e,r){let i=await this._findNewBucketAndPos(e);await i.bucket._putAt(i,e,r)}async get(e){let r=await this._findChild(e);if(r)return r.value}async del(e){let r=await this._findPlace(e),i=r.bucket._at(r.pos);i&&i.key===e&&r.bucket._delAt(r.pos)}leafCount(){return this._children.compactArray().reduce((r,i)=>i instanceof ia?r+i.leafCount():r+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){let e=this._children.compactArray();for(let r of e)r instanceof ia?yield*r.eachLeafSeries():yield r;return[]}serialize(e,r){let i=[];return r(this._children.reduce((n,s,o)=>(s&&(s instanceof ia?n.push(s.serialize(e,r)):n.push(e(s,o))),n),i))}asyncTransform(e,r){return DG(this,e,r)}toJSON(){return this.serialize(qTe,jTe)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(e){let r=await this._findPlace(e),i=r.bucket._at(r.pos);if(!(i instanceof ia)&&i&&i.key===e)return i}async _findPlace(e){let r=this._options.hash(typeof e=="string"?MTe(e):e),i=await r.take(this._options.bits),n=this._children.get(i);return n instanceof ia?n._findPlace(r):{bucket:this,pos:i,hash:r,existingChild:n}}async _findNewBucketAndPos(e){let r=await this._findPlace(e);if(r.existingChild&&r.existingChild.key!==e){let i=new ia(this._options,r.bucket,r.pos);r.bucket._putObjectAt(r.pos,i);let n=await i._findPlace(r.existingChild.hash);return n.bucket._putAt(n,r.existingChild.key,r.existingChild.value),i._findNewBucketAndPos(r.hash)}return r}_putAt(e,r,i){this._putObjectAt(e.pos,{key:r,value:i,hash:e.hash})}_putObjectAt(e,r){this._children.get(e)||this._popCount++,this._children.set(e,r)}_delAt(e){if(e===-1)throw new Error("Invalid position");this._children.get(e)&&this._popCount--,this._children.unset(e),this._level()}_level(){if(this._parent&&this._popCount<=1)if(this._popCount===1){let e=this._children.find(LTe);if(e&&!(e instanceof ia)){let r=e.hash;r.untake(this._options.bits);let i={pos:this._posAtParent,hash:r,bucket:this._parent};this._parent._putAt(i,e.key,e.value)}}else this._parent._delAt(this._posAtParent)}_at(e){return this._children.get(e)}};function LTe(t){return Boolean(t)}function qTe(t,e){return t.key}function jTe(t){return t}async function DG(t,e,r){let i=[];for(let n of t._children.compactArray())if(n instanceof ia)await DG(n,e,r);else{let s=await e(n);i.push({bitField:t._children.bitField(),children:s})}return r(i)}BG.exports=ia});var LG=m((Eht,MG)=>{l();"use strict";var UTe=[255,254,252,248,240,224,192,128],FTe=[1,3,7,15,31,63,127,255];MG.exports=class{constructor(e){this._value=e,this._currentBytePos=e.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(e){let r=e,i=0;for(;r&&this._haveBits();){let n=this._value[this._currentBytePos],s=this._currentBitPos+1,o=Math.min(s,r),a=KTe(n,s-o,o);i=(i<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function KTe(t,e,r){let i=VTe(e,r);return(t&i)>>>e}function VTe(t,e){return UTe[t]&FTe[Math.min(e+t-1,7)]}});var qG=m((Sht,jS)=>{l();"use strict";var zTe=LG(),{concat:HTe}=(mn(),$s);function GTe(t){function e(r){return r instanceof hb?r:new hb(r,t)}return e}var hb=class{constructor(e,r){if(!(e instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=e,this._hashFn=r,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(e){let r=e;for(;this._availableBits0;){let n=this._buffers[this._currentBufferIndex],s=Math.min(n.availableBits(),r),o=n.take(s);i=(i<0;){let i=this._buffers[this._currentBufferIndex],n=Math.min(i.totalBits()-i.availableBits(),r);i.untake(n),r-=n,this._availableBits+=n,this._currentBufferIndex>0&&i.totalBits()===i.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;let e=this._depth?HTe([this._value,Uint8Array.from([this._depth])]):this._value,r=await this._hashFn(e),i=new zTe(r);this._buffers.push(i),this._availableBits+=i.availableBits()}};jS.exports=GTe;jS.exports.InfiniteHash=hb});var tg=m((xht,UG)=>{l();"use strict";var jG=NG(),$Te=qG();function WTe(t){if(!t||!t.hashFn)throw new Error("please define an options.hashFn");let e={bits:t.bits||8,hash:$Te(t.hashFn)};return new jG(e)}UG.exports={createHAMT:WTe,Bucket:jG}});var rg=m((Vht,XG)=>{l();"use strict";async function*JTe(t,e={}){let r=t.getReader();try{for(;;){let i=await r.read();if(i.done)return;yield i.value}}finally{e.preventCancel!==!0&&r.cancel(),r.releaseLock()}}XG.exports=JTe});var JG=m((zht,ZG)=>{l();"use strict";var QG=rg();function eRe(t){return typeof t.stream=="function"?QG(t.stream()):QG(new Response(t).body)}ZG.exports=eRe});var ig=m((Hht,e$)=>{l();"use strict";function tRe(t){let[e,r]=t[Symbol.asyncIterator]?[t[Symbol.asyncIterator](),Symbol.asyncIterator]:[t[Symbol.iterator](),Symbol.iterator],i=[];return{peek:()=>e.next(),push:n=>{i.push(n)},next:()=>i.length?{done:!1,value:i.shift()}:e.next(),[r](){return this}}}e$.exports=tRe});var du=m((u0t,y$)=>{l();"use strict";function p$(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function cRe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return p$(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),p$(new n,r)}}y$.exports=cRe});var L$=m(xb=>{l();var{Buffer:GS}=Ht(),up=Rn(),RRe="0".charCodeAt(0),PRe=GS.from("ustar\0","binary"),CRe=GS.from("ustar ","binary"),ORe=GS.from(" \0","binary"),Sb=257,N$=263,kRe=function(t,e,r){return typeof t!="number"?r:(t=~~t,t>=e?e:t>=0||(t+=e,t>=0)?t:0)},DRe=function(t){switch(t){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},M$=function(t,e,r,i){for(;r0;o--){let a=t.get(o);e?i.push(a):r&&a===0?i.push(0):r?(r=!1,i.push(256-a)):i.push(255-a)}let n=0,s=i.length;for(let o=0;o{l();var $S=Rn();q$.exports=t=>{let e=async function*(){let r=yield,i=new $S;for await(let n of t){if(!r){r=yield i.append(n),i=new $S;continue}for(i.append(n);i.length>=r;){let s=i.shallowSlice(0,r);if(i.consume(r),r=yield s,!r){i.length&&(r=yield i,i=new $S);break}}}if(r)throw Object.assign(new Error(`stream ended before ${r} bytes became available`),{code:"ERR_UNDER_READ",buffer:i})}();return e.next(),e}});var U$=m((apt,j$)=>{l();var WS=Rn(),MRe=Ab();j$.exports=function(e){let r=MRe(e),i,n={[Symbol.asyncIterator]:()=>n,async next(s){if(i){let o;if(s==null||i.length===s)o=i,i=null;else if(i.length>s)o=i.shallowSlice(0,s),i=i.shallowSlice(s);else if(i.length{l();var LRe=fu(),ng=L$(),qRe=U$();function jRe(t){return t&=511,t&&512-t}async function sg(t,e){let r=jRe(e);r&&await t.next(r)}F$.exports=t=>(t=t||{},t.highWaterMark=t.highWaterMark||1024*16,e=>async function*(){let r=qRe(e),i,n,s,o;try{for(;;){let a;try{let{done:p,value:y}=await r.next(512);if(p)return;a=y}catch(p){if(p.code==="ERR_UNDER_READ")return;throw p}let c=ng.decode(a,t.filenameEncoding);if(!c)continue;if(c.type==="gnu-long-path"){let{done:p,value:y}=await r.next(c.size);if(p)return;i=ng.decodeLongPath(y,t.filenameEncoding),await sg(r,c.size);continue}if(c.type==="gnu-long-link-path"){let{done:p,value:y}=await r.next(c.size);if(p)return;n=ng.decodeLongPath(y,t.filenameEncoding),await sg(r,c.size);continue}if(c.type==="pax-global-header"){let{done:p,value:y}=await r.next(c.size);if(p)return;s=ng.decodePax(y,t.filenameEncoding),await sg(r,c.size);continue}if(c.type==="pax-header"){let{done:p,value:y}=await r.next(c.size);if(p)return;o=ng.decodePax(y,t.filenameEncoding),s&&(o={...s,...o}),await sg(r,c.size);continue}if(i&&(c.name=i,i=null),n&&(c.linkname=n,n=null),o&&(o.path&&(c.name=o.path),o.linkpath&&(c.linkname=o.linkpath),o.size&&(c.size=parseInt(o.size,10)),c.pax=o,o=null),!c.size||c.type==="directory"){yield{header:c,body:async function*(){}()};continue}let u=c.size,f=LRe(),d=await r.nextLte(Math.min(u,t.highWaterMark));u-=d.value.length,u||f.resolve();let h=async function*(){try{for(yield d.value;u;){let{done:p,value:y}=await r.nextLte(u);if(p){u=0;return}u-=y.length,yield y}}finally{f.resolve()}}();if(yield{header:c,body:h},await f.promise,u)for await(let p of h);await sg(r,c.size)}}finally{await r.return()}}())});var z$=m((upt,V$)=>{l();"use strict";V$.exports={RTLD_LAZY:1,RTLD_NOW:2,RTLD_GLOBAL:8,RTLD_LOCAL:4,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,PRIORITY_LOW:19,PRIORITY_BELOW_NORMAL:10,PRIORITY_NORMAL:0,PRIORITY_ABOVE_NORMAL:-7,PRIORITY_HIGH:-14,PRIORITY_HIGHEST:-20,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGINFO:29,SIGSYS:12,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,O_RDONLY:0,O_WRONLY:1,O_RDWR:2,UV_DIRENT_UNKNOWN:0,UV_DIRENT_FILE:1,UV_DIRENT_DIR:2,UV_DIRENT_LINK:3,UV_DIRENT_FIFO:4,UV_DIRENT_SOCKET:5,UV_DIRENT_CHAR:6,UV_DIRENT_BLOCK:7,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,UV_FS_O_FILEMAP:0,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_DSYNC:4194304,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_COPYFILE_EXCL:1,COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_FICLONE_FORCE:4,OPENSSL_VERSION_NUMBER:269488319,SSL_OP_ALL:2147485780,SSL_OP_ALLOW_NO_DHE_KEX:1024,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:0,SSL_OP_MICROSOFT_SESS_ID_BUG:0,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:0,SSL_OP_NETSCAPE_CHALLENGE_BUG:0,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:0,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:0,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_ENCRYPT_THEN_MAC:524288,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_RENEGOTIATION:1073741824,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:0,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_NO_TLSv1_3:536870912,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_PRIORITIZE_CHACHA:2097152,SSL_OP_SINGLE_DH_USE:0,SSL_OP_SINGLE_ECDH_USE:0,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:0,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:0,SSL_OP_TLS_D5_BUG:0,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_RSA:1,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_EC:2048,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,RSA_PSS_SALTLEN_DIGEST:-1,RSA_PSS_SALTLEN_MAX_SIGN:-2,RSA_PSS_SALTLEN_AUTO:-2,defaultCoreCipherList:"TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA",TLS1_VERSION:769,TLS1_1_VERSION:770,TLS1_2_VERSION:771,TLS1_3_VERSION:772,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var G$=m((fpt,H$)=>{l();var URe=Rn(),YS={string:()=>"",buffer:()=>URe()};H$.exports=async(t,e)=>{if(e=e||{},e.type&&!YS[e.type])throw new Error(`invalid type "${e.type}"`);let r,i;for await(let n of t)r||(i=e.type||(typeof n=="string"?"string":"buffer"),r=YS[i]()),i==="string"?r+=n:r.append(n);return r||YS[e.type||"buffer"]()}});var $$=m(QS=>{l();var{Buffer:sc}=Ht(),FRe=sc.alloc,KRe="0000000000000000000",VRe="7777777777777777777",zRe="0".charCodeAt(0),HRe=sc.from("ustar\0","binary"),GRe=sc.from("00","binary"),$Re=parseInt("7777",8),WRe=257,YRe=263,XRe=function(t){switch(t){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},QRe=function(t){let e=8*32;for(let r=0;r<148;r++)e+=t[r];for(let r=156;r<512;r++)e+=t[r];return e},Pf=function(t,e){return t=t.toString(8),t.length>e?VRe.slice(0,e)+" ":KRe.slice(0,e-t.length)+t+" "},XS=function(t){let e=sc.byteLength(t),r=Math.floor(Math.log(e)/Math.log(10))+1;return e+r>=Math.pow(10,r)&&r++,e+r+t};QS.encodePax=function(t){let e="";t.name&&(e+=XS(" path="+t.name+` `)),t.linkname&&(e+=XS(" linkpath="+t.linkname+` `));let r=t.pax;if(r)for(let i in r)e+=XS(" "+i+"="+r[i]+` `);return sc.from(e)};QS.encode=function(t){let e=FRe(512),r=t.name,i="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),sc.byteLength(r)!==r.length)return null;for(;sc.byteLength(r)>100;){let n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return sc.byteLength(r)>100||sc.byteLength(i)>155||t.linkname&&sc.byteLength(t.linkname)>100?null:(e.write(r),e.write(Pf(t.mode&$Re,6),100),e.write(Pf(t.uid,6),108),e.write(Pf(t.gid,6),116),e.write(Pf(t.size,11),124),e.write(Pf(t.mtime.getTime()/1e3|0,11),136),e[156]=zRe+XRe(t.type),t.linkname&&e.write(t.linkname,157),HRe.copy(e,WRe),GRe.copy(e,YRe),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Pf(t.devmajor||0,6),329),e.write(Pf(t.devminor||0,6),337),i&&e.write(i,345),e.write(Pf(QRe(e),6),148),e)}});var X$=m((dpt,Y$)=>{l();var{Buffer:ZS}=Ht(),hd=Rn(),{S_IFMT:ZRe,S_IFBLK:JRe,S_IFCHR:ePe,S_IFDIR:tPe,S_IFIFO:rPe,S_IFLNK:iPe}=z$(),nPe=G$(),Ib=$$(),sPe=parseInt("755",8),oPe=parseInt("644",8),W$=ZS.alloc(1024);function aPe(t){switch(t&ZRe){case JRe:return"block-device";case ePe:return"character-device";case tPe:return"directory";case rPe:return"fifo";case iPe:return"symlink"}return"file"}function JS(t){if(t&=511,t)return new hd(W$.slice(0,512-t))}function ex(t){if(!t.pax){let e=Ib.encode(t);if(e)return e}return cPe(t)}function cPe(t){let e=Ib.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:"PaxHeader",mode:t.mode,uid:t.uid,gid:t.gid,size:e.length,mtime:t.mtime,type:"pax-header",linkname:t.linkname&&"PaxHeader",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};return new hd([Ib.encode(r),e,JS(e.length),Ib.encode({...r,size:t.size,type:t.type})])}Y$.exports=()=>async function*(t){for await(let{header:e,body:r}of t){if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=aPe(e.mode)),e.mode||(e.mode=e.type==="directory"?sPe:oPe),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof r=="string"&&(r=ZS.from(r)),ZS.isBuffer(r)||hd.isBufferList(r)){e.size=r.length,yield new hd([ex(e),r,JS(e.size)]);continue}if(e.type==="symlink"&&!e.linkname){e.linkname=(await nPe(r)).toString(),yield ex(e);continue}if(yield ex(e),e.type!=="file"&&e.type!=="contiguous-file")continue;let i=0;for await(let s of r)i+=s.length,yield hd.isBufferList(s)?s:new hd(s);if(i!==e.size)throw new Error("size mismatch");let n=JS(e.size);n&&(yield n)}yield new hd(W$)}});var Q$=m(tx=>{l();tx.extract=K$();tx.pack=X$()});var hu=m(Kn=>{l();"use strict";var uPe=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function fPe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Kn.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)fPe(r,i)&&(t[i]=r[i])}}return t};Kn.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var lPe={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s{l();"use strict";var hPe=hu(),pPe=4,Z$=0,J$=1,yPe=2;function lp(t){for(var e=t.length;--e>=0;)t[e]=0}var gPe=0,eW=1,mPe=2,bPe=3,vPe=258,rx=29,og=256,ag=og+1+rx,dp=30,ix=19,tW=2*ag+1,pd=15,nx=16,wPe=7,sx=256,rW=16,iW=17,nW=18,ox=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Tb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_Pe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],sW=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],EPe=512,pu=new Array((ag+2)*2);lp(pu);var cg=new Array(dp*2);lp(cg);var ug=new Array(EPe);lp(ug);var fg=new Array(vPe-bPe+1);lp(fg);var ax=new Array(rx);lp(ax);var Rb=new Array(dp);lp(Rb);function cx(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var oW,aW,cW;function ux(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function uW(t){return t<256?ug[t]:ug[256+(t>>>7)]}function lg(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function os(t,e,r){t.bi_valid>nx-r?(t.bi_buf|=e<>nx-t.bi_valid,t.bi_valid+=r-nx):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function SPe(t){t.bi_valid===16?(lg(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function xPe(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,c=e.stat_desc.max_length,u,f,d,h,p,y,b=0;for(h=0;h<=pd;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;uc&&(h=c,b++),r[f*2+1]=h,!(f>i)&&(t.bl_count[h]++,p=0,f>=a&&(p=o[f-a]),y=r[f*2],t.opt_len+=y*(h+p),s&&(t.static_len+=y*(n[f*2+1]+p)));if(b!==0){do{for(h=c-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(h=c;h!==0;h--)for(f=t.bl_count[h];f!==0;)d=t.heap[--u],!(d>i)&&(r[d*2+1]!==h&&(t.opt_len+=(h-r[d*2+1])*r[d*2],r[d*2+1]=h),f--)}}function lW(t,e,r){var i=new Array(pd+1),n=0,s,o;for(s=1;s<=pd;s++)i[s]=n=n+r[s-1]<<1;for(o=0;o<=e;o++){var a=t[o*2+1];a!==0&&(t[o*2]=fW(i[a]++,a))}}function APe(){var t,e,r,i,n,s=new Array(pd+1);for(r=0,i=0;i>=7;i8?lg(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function IPe(t,e,r,i){hW(t),i&&(lg(t,r),lg(t,~r)),hPe.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function pW(t,e,r,i){var n=e*2,s=r*2;return t[n]>1;o>=1;o--)fx(t,r,o);u=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],fx(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,r[u*2]=r[o*2]+r[a*2],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,r[o*2+1]=r[a*2+1]=u,t.heap[1]=u++,fx(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],xPe(t,e),lW(r,c,t.bl_count)}function gW(t,e,r){var i,n=-1,s,o=e[0*2+1],a=0,c=7,u=4;for(o===0&&(c=138,u=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)s=o,o=e[(i+1)*2+1],!(++a=3&&t.bl_tree[sW[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function RPe(t,e,r,i){var n;for(os(t,e-257,5),os(t,r-1,5),os(t,i-4,4),n=0;n>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Z$;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return J$;for(r=32;r0?(t.strm.data_type===yPe&&(t.strm.data_type=PPe(t)),lx(t,t.l_desc),lx(t,t.d_desc),o=TPe(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?vW(t,e,r,i):t.strategy===pPe||s===n?(os(t,(eW<<1)+(i?1:0),3),yW(t,pu,cg)):(os(t,(mPe<<1)+(i?1:0),3),RPe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),yW(t,t.dyn_ltree,t.dyn_dtree)),dW(t),i&&hW(t)}function DPe(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(fg[r]+og+1)*2]++,t.dyn_dtree[uW(e)*2]++),t.last_lit===t.lit_bufsize-1}hp._tr_init=CPe;hp._tr_stored_block=vW;hp._tr_flush_block=kPe;hp._tr_tally=DPe;hp._tr_align=OPe});var dx=m((gpt,_W)=>{l();"use strict";function BPe(t,e,r,i){for(var n=t&65535|0,s=t>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,s=s+n|0;while(--o);n%=65521,s%=65521}return n|s<<16|0}_W.exports=BPe});var hx=m((mpt,EW)=>{l();"use strict";function NPe(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var MPe=NPe();function LPe(t,e,r,i){var n=MPe,s=i+r;t^=-1;for(var o=i;o>>8^n[(t^e[o])&255];return t^-1}EW.exports=LPe});var Pb=m((bpt,SW)=>{l();"use strict";SW.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var kW=m(uc=>{l();"use strict";var Vn=hu(),co=wW(),xW=dx(),Cf=hx(),qPe=Pb(),yd=0,jPe=1,UPe=3,Of=4,AW=5,ac=0,IW=1,uo=-2,FPe=-3,px=-5,KPe=-1,VPe=1,Cb=2,zPe=3,HPe=4,GPe=0,$Pe=2,Ob=8,WPe=9,YPe=15,XPe=8,QPe=29,ZPe=256,yx=ZPe+1+QPe,JPe=30,eCe=19,tCe=2*yx+1,rCe=15,Dt=3,kf=258,na=kf+Dt+1,iCe=32,kb=42,gx=69,Db=73,Bb=91,Nb=103,gd=113,dg=666,Di=1,hg=2,md=3,pp=4,nCe=3;function Df(t,e){return t.msg=qPe[e],e}function TW(t){return(t<<1)-(t>4?9:0)}function Bf(t){for(var e=t.length;--e>=0;)t[e]=0}function Nf(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Vn.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function ln(t,e){co._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Nf(t.strm)}function Wt(t,e){t.pending_buf[t.pending++]=e}function pg(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function sCe(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Vn.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=xW(t.adler,e,n,r):t.state.wrap===2&&(t.adler=Cf(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function RW(t,e){var r=t.max_chain_length,i=t.strstart,n,s,o=t.prev_length,a=t.nice_match,c=t.strstart>t.w_size-na?t.strstart-(t.w_size-na):0,u=t.window,f=t.w_mask,d=t.prev,h=t.strstart+kf,p=u[i+o-1],y=u[i+o];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(n=e,!(u[n+o]!==y||u[n+o-1]!==p||u[n]!==u[i]||u[++n]!==u[i+1])){i+=2,n++;do;while(u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&u[++i]===u[++n]&&io){if(t.match_start=e,o=s,s>=a)break;p=u[i+o-1],y=u[i+o]}}while((e=d[e&f])>c&&--r!=0);return o<=t.lookahead?o:t.lookahead}function bd(t){var e=t.w_size,r,i,n,s,o;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-na)){Vn.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);s+=e}if(t.strm.avail_in===0)break;if(i=sCe(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=Dt)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(bd(t),t.lookahead===0&&e===yd)return Di;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,ln(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-na&&(ln(t,!1),t.strm.avail_out===0))return Di}return t.insert=0,e===Of?(ln(t,!0),t.strm.avail_out===0?md:pp):(t.strstart>t.block_start&&(ln(t,!1),t.strm.avail_out===0),Di)}function mx(t,e){for(var r,i;;){if(t.lookahead=Dt&&(t.ins_h=(t.ins_h<=Dt)if(i=co._tr_tally(t,t.strstart-t.match_start,t.match_length-Dt),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Dt){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=Dt&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=Dt-1)),t.prev_length>=Dt&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Dt,i=co._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Dt),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=Dt&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){s=t.strstart+kf;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Dt?(r=co._tr_tally(t,1,t.match_length-Dt),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=co._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ln(t,!1),t.strm.avail_out===0))return Di}return t.insert=0,e===Of?(ln(t,!0),t.strm.avail_out===0?md:pp):t.last_lit&&(ln(t,!1),t.strm.avail_out===0)?Di:hg}function cCe(t,e){for(var r;;){if(t.lookahead===0&&(bd(t),t.lookahead===0)){if(e===yd)return Di;break}if(t.match_length=0,r=co._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ln(t,!1),t.strm.avail_out===0))return Di}return t.insert=0,e===Of?(ln(t,!0),t.strm.avail_out===0?md:pp):t.last_lit&&(ln(t,!1),t.strm.avail_out===0)?Di:hg}function cc(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var gp;gp=[new cc(0,0,0,0,oCe),new cc(4,4,8,4,mx),new cc(4,5,16,8,mx),new cc(4,6,32,32,mx),new cc(4,4,16,16,yp),new cc(8,16,32,32,yp),new cc(8,16,128,128,yp),new cc(8,32,128,256,yp),new cc(32,128,258,1024,yp),new cc(32,258,258,4096,yp)];function uCe(t){t.window_size=2*t.w_size,Bf(t.head),t.max_lazy_match=gp[t.level].max_lazy,t.good_match=gp[t.level].good_length,t.nice_match=gp[t.level].nice_length,t.max_chain_length=gp[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Dt-1,t.match_available=0,t.ins_h=0}function fCe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ob,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Vn.Buf16(tCe*2),this.dyn_dtree=new Vn.Buf16((2*JPe+1)*2),this.bl_tree=new Vn.Buf16((2*eCe+1)*2),Bf(this.dyn_ltree),Bf(this.dyn_dtree),Bf(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Vn.Buf16(rCe+1),this.heap=new Vn.Buf16(2*yx+1),Bf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Vn.Buf16(2*yx+1),Bf(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function PW(t){var e;return!t||!t.state?Df(t,uo):(t.total_in=t.total_out=0,t.data_type=$Pe,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?kb:gd,t.adler=e.wrap===2?0:1,e.last_flush=yd,co._tr_init(e),ac)}function CW(t){var e=PW(t);return e===ac&&uCe(t.state),e}function lCe(t,e){return!t||!t.state||t.state.wrap!==2?uo:(t.state.gzhead=e,ac)}function OW(t,e,r,i,n,s){if(!t)return uo;var o=1;if(e===KPe&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>WPe||r!==Ob||i<8||i>15||e<0||e>9||s<0||s>HPe)return Df(t,uo);i===8&&(i=9);var a=new fCe;return t.state=a,a.strm=t,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<AW||e<0)return t?Df(t,uo):uo;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===dg&&e!==Of)return Df(t,t.avail_out===0?px:uo);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===kb)if(i.wrap===2)t.adler=0,Wt(i,31),Wt(i,139),Wt(i,8),i.gzhead?(Wt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Wt(i,i.gzhead.time&255),Wt(i,i.gzhead.time>>8&255),Wt(i,i.gzhead.time>>16&255),Wt(i,i.gzhead.time>>24&255),Wt(i,i.level===9?2:i.strategy>=Cb||i.level<2?4:0),Wt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Wt(i,i.gzhead.extra.length&255),Wt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=Cf(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=gx):(Wt(i,0),Wt(i,0),Wt(i,0),Wt(i,0),Wt(i,0),Wt(i,i.level===9?2:i.strategy>=Cb||i.level<2?4:0),Wt(i,nCe),i.status=gd);else{var o=Ob+(i.w_bits-8<<4)<<8,a=-1;i.strategy>=Cb||i.level<2?a=0:i.level<6?a=1:i.level===6?a=2:a=3,o|=a<<6,i.strstart!==0&&(o|=iCe),o+=31-o%31,i.status=gd,pg(i,o),i.strstart!==0&&(pg(i,t.adler>>>16),pg(i,t.adler&65535)),t.adler=1}if(i.status===gx)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),Nf(t),n=i.pending,i.pending===i.pending_buf_size));)Wt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Db)}else i.status=Db;if(i.status===Db)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),Nf(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.gzindex=0,i.status=Bb)}else i.status=Bb;if(i.status===Bb)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),Nf(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=Cf(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.status=Nb)}else i.status=Nb;if(i.status===Nb&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Nf(t),i.pending+2<=i.pending_buf_size&&(Wt(i,t.adler&255),Wt(i,t.adler>>8&255),t.adler=0,i.status=gd)):i.status=gd),i.pending!==0){if(Nf(t),t.avail_out===0)return i.last_flush=-1,ac}else if(t.avail_in===0&&TW(e)<=TW(r)&&e!==Of)return Df(t,px);if(i.status===dg&&t.avail_in!==0)return Df(t,px);if(t.avail_in!==0||i.lookahead!==0||e!==yd&&i.status!==dg){var c=i.strategy===Cb?cCe(i,e):i.strategy===zPe?aCe(i,e):gp[i.level].func(i,e);if((c===md||c===pp)&&(i.status=dg),c===Di||c===md)return t.avail_out===0&&(i.last_flush=-1),ac;if(c===hg&&(e===jPe?co._tr_align(i):e!==AW&&(co._tr_stored_block(i,0,0,!1),e===UPe&&(Bf(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Nf(t),t.avail_out===0))return i.last_flush=-1,ac}return e!==Of?ac:i.wrap<=0?IW:(i.wrap===2?(Wt(i,t.adler&255),Wt(i,t.adler>>8&255),Wt(i,t.adler>>16&255),Wt(i,t.adler>>24&255),Wt(i,t.total_in&255),Wt(i,t.total_in>>8&255),Wt(i,t.total_in>>16&255),Wt(i,t.total_in>>24&255)):(pg(i,t.adler>>>16),pg(i,t.adler&65535)),Nf(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?ac:IW)}function pCe(t){var e;return!t||!t.state?uo:(e=t.state.status,e!==kb&&e!==gx&&e!==Db&&e!==Bb&&e!==Nb&&e!==gd&&e!==dg?Df(t,uo):(t.state=null,e===gd?Df(t,FPe):ac))}function yCe(t,e){var r=e.length,i,n,s,o,a,c,u,f;if(!t||!t.state||(i=t.state,o=i.wrap,o===2||o===1&&i.status!==kb||i.lookahead))return uo;for(o===1&&(t.adler=xW(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(o===0&&(Bf(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new Vn.Buf8(i.w_size),Vn.arraySet(f,e,r-i.w_size,i.w_size,0),e=f,r=i.w_size),a=t.avail_in,c=t.next_in,u=t.input,t.avail_in=r,t.next_in=0,t.input=e,bd(i);i.lookahead>=Dt;){n=i.strstart,s=i.lookahead-(Dt-1);do i.ins_h=(i.ins_h<{l();"use strict";var Mb=hu(),DW=!0,BW=!0;try{String.fromCharCode.apply(null,[0])}catch(t){DW=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){BW=!1}var yg=new Mb.Buf8(256);for(yu=0;yu<256;yu++)yg[yu]=yu>=252?6:yu>=248?5:yu>=240?4:yu>=224?3:yu>=192?2:1;var yu;yg[254]=yg[254]=1;mp.string2buf=function(t){var e,r,i,n,s,o=t.length,a=0;for(n=0;n>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function NW(t,e){if(e<65534&&(t.subarray&&BW||!t.subarray&&DW))return String.fromCharCode.apply(null,Mb.shrinkBuf(t,e));for(var r="",i=0;i4){a[i++]=65533,r+=s-1;continue}for(n&=s===2?31:s===3?15:7;s>1&&r1){a[i++]=65533;continue}n<65536?a[i++]=n:(n-=65536,a[i++]=55296|n>>10&1023,a[i++]=56320|n&1023)}return NW(a,i)};mp.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)==128;)r--;return r<0||r===0?e:r+yg[t[r]]>e?r:e}});var vx=m((_pt,MW)=>{l();"use strict";function gCe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}MW.exports=gCe});var UW=m(bg=>{l();"use strict";var gg=kW(),mg=hu(),wx=bx(),_x=Pb(),mCe=vx(),LW=Object.prototype.toString,bCe=0,Ex=4,bp=0,qW=1,jW=2,vCe=-1,wCe=0,_Ce=8;function vd(t){if(!(this instanceof vd))return new vd(t);this.options=mg.assign({level:vCe,method:_Ce,chunkSize:16384,windowBits:15,memLevel:8,strategy:wCe,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mCe,this.strm.avail_out=0;var r=gg.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==bp)throw new Error(_x[r]);if(e.header&&gg.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=wx.string2buf(e.dictionary):LW.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=gg.deflateSetDictionary(this.strm,i),r!==bp)throw new Error(_x[r]);this._dict_set=!0}}vd.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Ex:bCe,typeof t=="string"?r.input=wx.string2buf(t):LW.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new mg.Buf8(i),r.next_out=0,r.avail_out=i),n=gg.deflate(r,s),n!==qW&&n!==bp)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Ex||s===jW))&&(this.options.to==="string"?this.onData(wx.buf2binstring(mg.shrinkBuf(r.output,r.next_out))):this.onData(mg.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==qW);return s===Ex?(n=gg.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===bp):(s===jW&&(this.onEnd(bp),r.avail_out=0),!0)};vd.prototype.onData=function(t){this.chunks.push(t)};vd.prototype.onEnd=function(t){t===bp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=mg.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Sx(t,e){var r=new vd(e);if(r.push(t,!0),r.err)throw r.msg||_x[r.err];return r.result}function ECe(t,e){return e=e||{},e.raw=!0,Sx(t,e)}function SCe(t,e){return e=e||{},e.gzip=!0,Sx(t,e)}bg.Deflate=vd;bg.deflate=Sx;bg.deflateRaw=ECe;bg.gzip=SCe});var KW=m((Spt,FW)=>{l();"use strict";var Lb=30,xCe=12;FW.exports=function(e,r){var i,n,s,o,a,c,u,f,d,h,p,y,b,E,v,A,R,F,D,B,H,W,X,P,g;i=e.state,n=e.next_in,P=e.input,s=n+(e.avail_in-5),o=e.next_out,g=e.output,a=o-(r-e.avail_out),c=o+(e.avail_out-257),u=i.dmax,f=i.wsize,d=i.whave,h=i.wnext,p=i.window,y=i.hold,b=i.bits,E=i.lencode,v=i.distcode,A=(1<>>24,y>>>=D,b-=D,D=F>>>16&255,D===0)g[o++]=F&65535;else if(D&16){B=F&65535,D&=15,D&&(b>>=D,b-=D),b<15&&(y+=P[n++]<>>24,y>>>=D,b-=D,D=F>>>16&255,D&16){if(H=F&65535,D&=15,bu){e.msg="invalid distance too far back",i.mode=Lb;break e}if(y>>>=D,b-=D,D=o-a,H>D){if(D=H-D,D>d&&i.sane){e.msg="invalid distance too far back",i.mode=Lb;break e}if(W=0,X=p,h===0){if(W+=f-D,D2;)g[o++]=X[W++],g[o++]=X[W++],g[o++]=X[W++],B-=3;B&&(g[o++]=X[W++],B>1&&(g[o++]=X[W++]))}else{W=o-H;do g[o++]=g[W++],g[o++]=g[W++],g[o++]=g[W++],B-=3;while(B>2);B&&(g[o++]=g[W++],B>1&&(g[o++]=g[W++]))}}else if((D&64)==0){F=v[(F&65535)+(y&(1<>3,n-=B,b-=B<<3,y&=(1<{l();"use strict";var VW=hu(),vp=15,zW=852,HW=592,GW=0,xx=1,$W=2,ACe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],ICe=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],TCe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],RCe=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];WW.exports=function(e,r,i,n,s,o,a,c){var u=c.bits,f=0,d=0,h=0,p=0,y=0,b=0,E=0,v=0,A=0,R=0,F,D,B,H,W,X=null,P=0,g,w=new VW.Buf16(vp+1),S=new VW.Buf16(vp+1),C=null,L=0,Y,V,q;for(f=0;f<=vp;f++)w[f]=0;for(d=0;d=1&&w[p]===0;p--);if(y>p&&(y=p),p===0)return s[o++]=1<<24|64<<16|0,s[o++]=1<<24|64<<16|0,c.bits=1,0;for(h=1;h0&&(e===GW||p!==1))return-1;for(S[1]=0,f=1;fzW||e===$W&&A>HW)return 1;for(;;){Y=f-E,a[d]g?(V=C[L+a[d]],q=X[P+a[d]]):(V=32+64,q=0),F=1<>E)+D]=Y<<24|V<<16|q|0;while(D!==0);for(F=1<>=1;if(F!==0?(R&=F-1,R+=F):R=0,d++,--w[f]==0){if(f===p)break;f=r[i+a[d]]}if(f>y&&(R&H)!==B){for(E===0&&(E=y),W+=h,b=f-E,v=1<zW||e===$W&&A>HW)return 1;B=R&H,s[B]=y<<24|b<<16|W-o|0}}return R!==0&&(s[W+R]=f-E<<24|64<<16|0),c.bits=y,0}});var CY=m(sa=>{l();"use strict";var Ts=hu(),Ax=dx(),fc=hx(),PCe=KW(),vg=YW(),CCe=0,XW=1,QW=2,ZW=4,OCe=5,qb=6,wd=0,kCe=1,DCe=2,fo=-2,JW=-3,Ix=-4,BCe=-5,eY=8,tY=1,rY=2,iY=3,nY=4,sY=5,oY=6,aY=7,cY=8,uY=9,fY=10,jb=11,gu=12,Tx=13,lY=14,Rx=15,dY=16,hY=17,pY=18,yY=19,Ub=20,Fb=21,gY=22,mY=23,bY=24,vY=25,wY=26,Px=27,_Y=28,EY=29,Rr=30,Cx=31,NCe=32,MCe=852,LCe=592,qCe=15,jCe=qCe;function SY(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function UCe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ts.Buf16(320),this.work=new Ts.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function xY(t){var e;return!t||!t.state?fo:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=tY,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ts.Buf32(MCe),e.distcode=e.distdyn=new Ts.Buf32(LCe),e.sane=1,e.back=-1,wd)}function AY(t){var e;return!t||!t.state?fo:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,xY(t))}function IY(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?fo:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,AY(t))}function TY(t,e){var r,i;return t?(i=new UCe,t.state=i,i.window=null,r=IY(t,e),r!==wd&&(t.state=null),r):fo}function FCe(t){return TY(t,jCe)}var RY=!0,Ox,kx;function KCe(t){if(RY){var e;for(Ox=new Ts.Buf32(512),kx=new Ts.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(vg(XW,t.lens,0,288,Ox,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;vg(QW,t.lens,0,32,kx,0,t.work,{bits:5}),RY=!1}t.lencode=Ox,t.lenbits=9,t.distcode=kx,t.distbits=5}function PY(t,e,r,i){var n,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(Ts.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),Ts.arraySet(s.window,e,r-i,n,s.wnext),i-=n,i?(Ts.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=fc(r.check,X,2,0),u=0,f=0,r.mode=rY;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=Rr;break}if((u&15)!==eY){t.msg="unknown compression method",r.mode=Rr;break}if(u>>>=4,f-=4,H=(u&15)+8,r.wbits===0)r.wbits=H;else if(H>r.wbits){t.msg="invalid window size",r.mode=Rr;break}r.dmax=1<>8&1),r.flags&512&&(X[0]=u&255,X[1]=u>>>8&255,r.check=fc(r.check,X,2,0)),u=0,f=0,r.mode=iY;case iY:for(;f<32;){if(a===0)break e;a--,u+=i[s++]<>>8&255,X[2]=u>>>16&255,X[3]=u>>>24&255,r.check=fc(r.check,X,4,0)),u=0,f=0,r.mode=nY;case nY:for(;f<16;){if(a===0)break e;a--,u+=i[s++]<>8),r.flags&512&&(X[0]=u&255,X[1]=u>>>8&255,r.check=fc(r.check,X,2,0)),u=0,f=0,r.mode=sY;case sY:if(r.flags&1024){for(;f<16;){if(a===0)break e;a--,u+=i[s++]<>>8&255,r.check=fc(r.check,X,2,0)),u=0,f=0}else r.head&&(r.head.extra=null);r.mode=oY;case oY:if(r.flags&1024&&(p=r.length,p>a&&(p=a),p&&(r.head&&(H=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ts.arraySet(r.head.extra,i,s,p,H)),r.flags&512&&(r.check=fc(r.check,i,p,s)),a-=p,s+=p,r.length-=p),r.length))break e;r.length=0,r.mode=aY;case aY:if(r.flags&2048){if(a===0)break e;p=0;do H=i[s+p++],r.head&&H&&r.length<65536&&(r.head.name+=String.fromCharCode(H));while(H&&p>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=gu;break;case fY:for(;f<32;){if(a===0)break e;a--,u+=i[s++]<>>=f&7,f-=f&7,r.mode=Px;break}for(;f<3;){if(a===0)break e;a--,u+=i[s++]<>>=1,f-=1,u&3){case 0:r.mode=lY;break;case 1:if(KCe(r),r.mode=Ub,e===qb){u>>>=2,f-=2;break e}break;case 2:r.mode=hY;break;case 3:t.msg="invalid block type",r.mode=Rr}u>>>=2,f-=2;break;case lY:for(u>>>=f&7,f-=f&7;f<32;){if(a===0)break e;a--,u+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Rr;break}if(r.length=u&65535,u=0,f=0,r.mode=Rx,e===qb)break e;case Rx:r.mode=dY;case dY:if(p=r.length,p){if(p>a&&(p=a),p>c&&(p=c),p===0)break e;Ts.arraySet(n,i,s,p,o),a-=p,s+=p,c-=p,o+=p,r.length-=p;break}r.mode=gu;break;case hY:for(;f<14;){if(a===0)break e;a--,u+=i[s++]<>>=5,f-=5,r.ndist=(u&31)+1,u>>>=5,f-=5,r.ncode=(u&15)+4,u>>>=4,f-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Rr;break}r.have=0,r.mode=pY;case pY:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[w[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},W=vg(CCe,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,W){t.msg="invalid code lengths set",r.mode=Rr;break}r.have=0,r.mode=yY;case yY:for(;r.have>>24,A=E>>>16&255,R=E&65535,!(v<=f);){if(a===0)break e;a--,u+=i[s++]<>>=v,f-=v,r.lens[r.have++]=R;else{if(R===16){for(g=v+2;f>>=v,f-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=Rr;break}H=r.lens[r.have-1],p=3+(u&3),u>>>=2,f-=2}else if(R===17){for(g=v+3;f>>=v,f-=v,H=0,p=3+(u&7),u>>>=3,f-=3}else{for(g=v+7;f>>=v,f-=v,H=0,p=11+(u&127),u>>>=7,f-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Rr;break}for(;p--;)r.lens[r.have++]=H}}if(r.mode===Rr)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Rr;break}if(r.lenbits=9,P={bits:r.lenbits},W=vg(XW,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,W){t.msg="invalid literal/lengths set",r.mode=Rr;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},W=vg(QW,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,W){t.msg="invalid distances set",r.mode=Rr;break}if(r.mode=Ub,e===qb)break e;case Ub:r.mode=Fb;case Fb:if(a>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=a,r.hold=u,r.bits=f,PCe(t,h),o=t.next_out,n=t.output,c=t.avail_out,s=t.next_in,i=t.input,a=t.avail_in,u=r.hold,f=r.bits,r.mode===gu&&(r.back=-1);break}for(r.back=0;E=r.lencode[u&(1<>>24,A=E>>>16&255,R=E&65535,!(v<=f);){if(a===0)break e;a--,u+=i[s++]<>F)],v=E>>>24,A=E>>>16&255,R=E&65535,!(F+v<=f);){if(a===0)break e;a--,u+=i[s++]<>>=F,f-=F,r.back+=F}if(u>>>=v,f-=v,r.back+=v,r.length=R,A===0){r.mode=wY;break}if(A&32){r.back=-1,r.mode=gu;break}if(A&64){t.msg="invalid literal/length code",r.mode=Rr;break}r.extra=A&15,r.mode=gY;case gY:if(r.extra){for(g=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=mY;case mY:for(;E=r.distcode[u&(1<>>24,A=E>>>16&255,R=E&65535,!(v<=f);){if(a===0)break e;a--,u+=i[s++]<>F)],v=E>>>24,A=E>>>16&255,R=E&65535,!(F+v<=f);){if(a===0)break e;a--,u+=i[s++]<>>=F,f-=F,r.back+=F}if(u>>>=v,f-=v,r.back+=v,A&64){t.msg="invalid distance code",r.mode=Rr;break}r.offset=R,r.extra=A&15,r.mode=bY;case bY:if(r.extra){for(g=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Rr;break}r.mode=vY;case vY:if(c===0)break e;if(p=h-c,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Rr;break}p>r.wnext?(p-=r.wnext,y=r.wsize-p):y=r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=n,y=o-r.offset,p=r.length;p>c&&(p=c),c-=p,r.length-=p;do n[o++]=b[y++];while(--p);r.length===0&&(r.mode=Fb);break;case wY:if(c===0)break e;n[o++]=r.length,c--,r.mode=Fb;break;case Px:if(r.wrap){for(;f<32;){if(a===0)break e;a--,u|=i[s++]<{l();"use strict";OY.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var DY=m((Tpt,kY)=>{l();"use strict";function $Ce(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}kY.exports=$Ce});var NY=m(_g=>{l();"use strict";var wp=CY(),wg=hu(),Kb=bx(),hi=Dx(),Bx=Pb(),WCe=vx(),YCe=DY(),BY=Object.prototype.toString;function _d(t){if(!(this instanceof _d))return new _d(t);this.options=wg.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new WCe,this.strm.avail_out=0;var r=wp.inflateInit2(this.strm,e.windowBits);if(r!==hi.Z_OK)throw new Error(Bx[r]);if(this.header=new YCe,wp.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Kb.string2buf(e.dictionary):BY.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=wp.inflateSetDictionary(this.strm,e.dictionary),r!==hi.Z_OK)))throw new Error(Bx[r])}_d.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,s,o,a,c,u,f=!1;if(this.ended)return!1;o=e===~~e?e:e===!0?hi.Z_FINISH:hi.Z_NO_FLUSH,typeof t=="string"?r.input=Kb.binstring2buf(t):BY.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new wg.Buf8(i),r.next_out=0,r.avail_out=i),s=wp.inflate(r,hi.Z_NO_FLUSH),s===hi.Z_NEED_DICT&&n&&(s=wp.inflateSetDictionary(this.strm,n)),s===hi.Z_BUF_ERROR&&f===!0&&(s=hi.Z_OK,f=!1),s!==hi.Z_STREAM_END&&s!==hi.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===hi.Z_STREAM_END||r.avail_in===0&&(o===hi.Z_FINISH||o===hi.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Kb.utf8border(r.output,r.next_out),c=r.next_out-a,u=Kb.buf2string(r.output,a),r.next_out=c,r.avail_out=i-c,c&&wg.arraySet(r.output,r.output,a,c,0),this.onData(u)):this.onData(wg.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(f=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==hi.Z_STREAM_END);return s===hi.Z_STREAM_END&&(o=hi.Z_FINISH),o===hi.Z_FINISH?(s=wp.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===hi.Z_OK):(o===hi.Z_SYNC_FLUSH&&(this.onEnd(hi.Z_OK),r.avail_out=0),!0)};_d.prototype.onData=function(t){this.chunks.push(t)};_d.prototype.onEnd=function(t){t===hi.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=wg.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Nx(t,e){var r=new _d(e);if(r.push(t,!0),r.err)throw r.msg||Bx[r.err];return r.result}function XCe(t,e){return e=e||{},e.raw=!0,Nx(t,e)}_g.Inflate=_d;_g.inflate=Nx;_g.inflateRaw=XCe;_g.ungzip=Nx});var qY=m((Ppt,LY)=>{l();"use strict";var QCe=hu().assign,ZCe=UW(),JCe=NY(),eOe=Dx(),MY={};QCe(MY,ZCe,JCe,eOe);LY.exports=MY});var UY=m((Cpt,jY)=>{l();"use strict";var{concat:tOe}=(mn(),$s);async function rOe(t){let e=new Uint8Array(0);for await(let r of t)e=tOe([e,r],e.length+r.length);return e}jY.exports=rOe});var Kx=m((r1t,ZY)=>{l();ZY.exports=iOe;function iOe(t,e,r){var i,n;if(Array.isArray(e)&&(i=e.slice(0)),typeof e=="string"&&(i=e.split(".")),typeof e=="symbol"&&(i=[e]),!Array.isArray(i))throw new Error("props arg must be an array, a string or a symbol");if(n=i.pop(),!n)return!1;QY(n);for(var s;s=i.shift();)if(QY(s),typeof t[s]=="undefined"&&(t[s]={}),t=t[s],!t||typeof t!="object")return!1;return t[n]=r,!0}function QY(t){if(t==="__proto__"||t==="constructor"||t==="prototype")throw new Error("setting of prototype values not supported")}});var Sd=m((C1t,dX)=>{l();"use strict";var yOe=async t=>{for await(let e of t)return e};dX.exports=yOe});var Yb=m((Z1t,RX)=>{l();var{Multiaddr:mOe}=rt(),Wb=(t,e)=>e,bOe=(t,e,r,i)=>{if(i&&i.assumeHttp===!1)return`tcp://${t}:${e}`;let n="tcp",s=`:${e}`;return r[r.length-1].protocol==="tcp"&&(n=e==="443"?"https":"http",s=e==="443"||e==="80"?"":s),`${n}://${t}${s}`},vOe={ip4:Wb,ip6:(t,e,r,i)=>i.length===1&&i[0].protocol==="ip6"?e:`[${e}]`,tcp:(t,e,r,i,n)=>i.some(s=>["http","https","ws","wss"].includes(s.protocol))?`${t}:${e}`:bOe(t,e,i,n),udp:(t,e)=>`udp://${t}:${e}`,dnsaddr:Wb,dns4:Wb,dns6:Wb,ipfs:(t,e)=>`${t}/ipfs/${e}`,p2p:(t,e)=>`${t}/p2p/${e}`,http:t=>`http://${t}`,https:t=>`https://${t}`,ws:t=>`ws://${t}`,wss:t=>`wss://${t}`,"p2p-websocket-star":t=>`${t}/p2p-websocket-star`,"p2p-webrtc-star":t=>`${t}/p2p-webrtc-star`,"p2p-webrtc-direct":t=>`${t}/p2p-webrtc-direct`};RX.exports=(t,e)=>{let r=new mOe(t),i=t.toString().split("/").slice(1);return r.tuples().map(n=>({protocol:i.shift(),content:n[1]?i.shift():null})).reduce((n,s,o,a)=>{let c=vOe[s.protocol];if(!c)throw new Error(`Unsupported protocol ${s.protocol}`);return c(n,s.content,o,a,e)},"")}});var CX=m((J1t,PX)=>{l();"use strict";PX.exports=t=>{if(!Array.isArray(t))throw new TypeError(`Expected an array, got ${typeof t}`);t=[...t];for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}});var tA=m((n2t,jX)=>{l();jX.exports={WORKER_REQUEST_READ_LOCK:"lock:worker:request-read",WORKER_RELEASE_READ_LOCK:"lock:worker:release-read",MASTER_GRANT_READ_LOCK:"lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK:"lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK:"lock:worker:release-write",MASTER_GRANT_WRITE_LOCK:"lock:master:grant-write"}});var UX=m(()=>{l()});var XX=m((a2t,YX)=>{l();var SOe=br().EventEmitter,{nanoid:xOe}=(S6(),B9),{WORKER_REQUEST_READ_LOCK:FX,WORKER_RELEASE_READ_LOCK:KX,MASTER_GRANT_READ_LOCK:VX,WORKER_REQUEST_WRITE_LOCK:zX,WORKER_RELEASE_WRITE_LOCK:HX,MASTER_GRANT_WRITE_LOCK:GX}=tA(),Sg,$X=(t,e,r,i,n)=>(s,o)=>{o&&o.type===r&&t.emit(e,o.name,()=>(s.send({type:n,name:o.name,identifier:o.identifier}),new Promise(a=>{let c=u=>{u&&u.type===i&&u.identifier===o.identifier&&(s.removeListener("message",c),a())};s.on("message",c)})))},WX=(t,e,r,i)=>()=>{let n=xOe();return process.send({type:e,identifier:n,name:t}),new Promise(s=>{let o=a=>{a&&a.type===r&&a.identifier===n&&(process.removeListener("message",o),s(()=>{process.send({type:i,identifier:n,name:t})}))};process.on("message",o)})};YX.exports=t=>{try{if(Sg=UX(),!Object.keys(Sg).length)return}catch(e){return}if(Sg.isMaster||t.singleProcess){let e=new SOe;return Sg.on("message",$X(e,"requestReadLock",FX,KX,VX)),Sg.on("message",$X(e,"requestWriteLock",zX,HX,GX)),e}return{isWorker:!0,readLock:e=>WX(e,FX,VX,KX),writeLock:e=>WX(e,zX,GX,HX)}}});var rA=m((c2t,QX)=>{l();var Lf={},Ip=t=>{t.addEventListener("message",e=>{Ip.dispatchEvent("message",t,e)}),t.port&&t.port.addEventListener("message",e=>{Ip.dispatchEvent("message",t,e)})};Ip.addEventListener=(t,e)=>{Lf[t]||(Lf[t]=[]),Lf[t].push(e)};Ip.removeEventListener=(t,e)=>{!Lf[t]||(Lf[t]=Lf[t].filter(r=>r===e))};Ip.dispatchEvent=function(){let t=Array.prototype.slice.call(arguments),e=t.shift();!Lf[e]||Lf[e].forEach(r=>r.apply(null,t))};QX.exports=Ip});var cQ=m((u2t,aQ)=>{l();var AOe=br().EventEmitter,{nanoid:IOe}=(S6(),B9),{WORKER_REQUEST_READ_LOCK:ZX,WORKER_RELEASE_READ_LOCK:JX,MASTER_GRANT_READ_LOCK:eQ,WORKER_REQUEST_WRITE_LOCK:tQ,WORKER_RELEASE_WRITE_LOCK:rQ,MASTER_GRANT_WRITE_LOCK:iQ}=tA(),nQ=rA(),sQ=(t,e,r,i,n)=>(s,o)=>{if(!o||!o.data||o.data.type!==r)return;let a={type:o.data.type,name:o.data.name,identifier:o.data.identifier};t.emit(e,a.name,()=>(s.postMessage({type:n,name:a.name,identifier:a.identifier}),new Promise(c=>{let u=f=>{if(!f||!f.data)return;let d={type:f.data.type,name:f.data.name,identifier:f.data.identifier};d&&d.type===i&&d.identifier===a.identifier&&(s.removeEventListener("message",u),c())};s.addEventListener("message",u)})))},oQ=(t,e,r,i)=>()=>{let n=IOe();return globalThis.postMessage({type:e,identifier:n,name:t}),new Promise(s=>{let o=a=>{if(!a||!a.data)return;let c={type:a.data.type,identifier:a.data.identifier};c&&c.type===r&&c.identifier===n&&(globalThis.removeEventListener("message",o),s(()=>{globalThis.postMessage({type:i,identifier:n,name:t})}))};globalThis.addEventListener("message",o)})},TOe={singleProcess:!1};aQ.exports=t=>{if(t=Object.assign({},TOe,t),!!globalThis.document||t.singleProcess){let r=new AOe;return nQ.addEventListener("message",sQ(r,"requestReadLock",ZX,JX,eQ)),nQ.addEventListener("message",sQ(r,"requestWriteLock",tQ,rQ,iQ)),r}return{isWorker:!0,readLock:r=>oQ(r,ZX,eQ,JX),writeLock:r=>oQ(r,tQ,iQ,rQ)}}});var uQ=m((l2t,iA)=>{l();"use strict";var Zb,f2t=iA.exports.timeout=function(t,e){var r=new Zb,i;return Promise.race([t,new Promise(function(n,s){i=setTimeout(function(){s(r)},e)})]).then(function(n){return clearTimeout(i),n},function(n){throw clearTimeout(i),n})};Zb=iA.exports.TimeoutError=function(){Error.call(this),this.stack=Error().stack,this.message="Timeout"};Zb.prototype=Object.create(Error.prototype);Zb.prototype.name="TimeoutError"});var oA=m((d2t,sA)=>{l();var ROe=XX(),POe=cQ(),{default:fQ}=Yc(),{timeout:COe}=uQ(),OOe=rA(),xd={},qf;function nA(t,e){let r,i=new Promise(n=>{r=n});return t.add(()=>COe((()=>new Promise(n=>{r(()=>{n()})}))(),e.timeout)),i}var kOe=(t,e)=>{if(qf.isWorker)return{readLock:qf.readLock(t,e),writeLock:qf.writeLock(t,e)};let r=new fQ({concurrency:1}),i=null;return{readLock:()=>{if(i)return nA(i,e);i=new fQ({concurrency:e.concurrency,autoStart:!1});let n=i,s=nA(i,e);return r.add(()=>(n.start(),n.onIdle().then(()=>{i===n&&(i=null)}))),s},writeLock:()=>(i=null,nA(r,e))}},DOe={concurrency:1/0,timeout:846e5,global:globalThis,singleProcess:!1};sA.exports=(t,e)=>(e||(e={}),typeof t=="object"&&(e=t,t="lock"),t||(t="lock"),e=Object.assign({},DOe,e),qf||(qf=ROe(e)||POe(e),qf.isWorker||(qf.on("requestReadLock",(r,i)=>{!xd[r]||xd[r].readLock().then(n=>i().finally(()=>n()))}),qf.on("requestWriteLock",async(r,i)=>{!xd[r]||xd[r].writeLock().then(n=>i().finally(()=>n()))}))),xd[t]||(xd[t]=kOe(t,e)),xd[t]);sA.exports.Worker=function(t,e){e=e||globalThis.Worker;let r;try{r=new e(t)}catch(i){i.message.includes("not a constructor")&&(r=e(t))}if(!r)throw new Error("Could not create Worker from",e);return OOe(r),r}});var EA=m((o6t,DZ)=>{l();DZ.exports=Pke;function Pke(t,e,r){if(!t)return r;var i,n;if(Array.isArray(e)&&(i=e.slice(0)),typeof e=="string"&&(i=e.split(".")),typeof e=="symbol"&&(i=[e]),!Array.isArray(i))throw new Error("props arg must be an array, a string or a symbol");for(;i.length;)if(n=i.shift(),!t||(t=t[n],t===void 0))return r;return t}});var Rd=m((a6t,NZ)=>{l();"use strict";function BZ(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Cke(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return BZ(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),BZ(new n,r)}}NZ.exports=Cke});var c5=m((c6t,MZ)=>{l();"use strict";var Oke=async t=>{let e=0;for await(let r of t)e++;return e};MZ.exports=Oke});var HZ=m((m6t,zZ)=>{l();SA.BASE=2166136261;function SA(t){for(var e=SA.BASE,r=0,i=t.length;r>>0}zZ.exports=SA});var TA={};zt(TA,{compare:()=>IA});function IA(t,e){for(let r=0;re[r])return 1}return t.byteLength>e.byteLength?1:t.byteLength{l()});var lJ=m((p4t,g5)=>{l();"use strict";g5.exports=Qke;g5.exports.format=uJ;g5.exports.parse=fJ;var Wke=/\B(?=(\d{3})+(?!\d))/g,Yke=/(?:\.0*|(\.[^0]+)0+)$/,zf={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Xke=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Qke(t,e){return typeof t=="string"?fJ(t):typeof t=="number"?uJ(t,e):null}function uJ(t,e){if(!Number.isFinite(t))return null;var r=Math.abs(t),i=e&&e.thousandsSeparator||"",n=e&&e.unitSeparator||"",s=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,o=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!zf[a.toLowerCase()])&&(r>=zf.pb?a="PB":r>=zf.tb?a="TB":r>=zf.gb?a="GB":r>=zf.mb?a="MB":r>=zf.kb?a="KB":a="B");var c=t/zf[a.toLowerCase()],u=c.toFixed(s);return o||(u=u.replace(Yke,"$1")),i&&(u=u.replace(Wke,i)),u+n+a}function fJ(t){if(typeof t=="number"&&!isNaN(t))return t;if(typeof t!="string")return null;var e=Xke.exec(t),r,i="b";return e?(r=parseFloat(e[1]),i=e[4].toLowerCase()):(r=parseInt(t,10),i="b"),Math.floor(zf[i]*r)}});var _J=m((P4t,wJ)=>{l();"use strict";wJ.exports=t=>{if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}});var SJ=m((C4t,EJ)=>{l();"use strict";var MA=_J();EJ.exports=(t,e={})=>{if(!MA(t)&&!Array.isArray(t))throw new TypeError("Expected a plain object or array");let{deep:r}=e,i=[],n=[],s=a=>{let c=i.indexOf(a);if(c!==-1)return n[c];let u=[];return i.push(a),n.push(u),u.push(...a.map(f=>Array.isArray(f)?s(f):MA(f)?o(f):f)),u},o=a=>{let c=i.indexOf(a);if(c!==-1)return n[c];let u={},f=Object.keys(a).sort(e.compare);i.push(a),n.push(u);for(let d of f){let h=a[d],p;r&&Array.isArray(h)?p=s(h):p=r&&MA(h)?o(h):h,Object.defineProperty(u,d,{...Object.getOwnPropertyDescriptor(a,d),value:p})}return u};return Array.isArray(t)?r?s(t):t.slice():o(t)}});var ree=m((Obt,tee)=>{l();"use strict";var hDe=nd(),pDe=async function*(t,e){yield*(await hDe(t)).sort(e)};tee.exports=pDe});var HA=m((kbt,iee)=>{l();"use strict";iee.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}});var Fg=m((Dbt,nee)=>{l();"use strict";var yDe=HA();nee.exports=function(){return yDe()&&!!Symbol.toStringTag}});var aee=m((Bbt,oee)=>{l();"use strict";var see=typeof Symbol!="undefined"&&Symbol,gDe=HA();oee.exports=function(){return typeof see!="function"||typeof Symbol!="function"||typeof see("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:gDe()}});var uee=m((Nbt,cee)=>{l();"use strict";var mDe="Function.prototype.bind called on incompatible ",GA=Array.prototype.slice,bDe=Object.prototype.toString,vDe="[object Function]";cee.exports=function(e){var r=this;if(typeof r!="function"||bDe.call(r)!==vDe)throw new TypeError(mDe+r);for(var i=GA.call(arguments,1),n,s=function(){if(this instanceof n){var f=r.apply(this,i.concat(GA.call(arguments)));return Object(f)===f?f:this}else return r.apply(e,i.concat(GA.call(arguments)))},o=Math.max(0,r.length-i.length),a=[],c=0;c{l();"use strict";var wDe=uee();fee.exports=Function.prototype.bind||wDe});var dee=m((Lbt,lee)=>{l();"use strict";var _De=S5();lee.exports=_De.call(Function.call,Object.prototype.hasOwnProperty)});var T5=m((qbt,gee)=>{l();"use strict";var Lt,Kg=SyntaxError,hee=Function,Lp=TypeError,$A=function(t){try{return hee('"use strict"; return ('+t+").constructor;")()}catch(e){}},Nd=Object.getOwnPropertyDescriptor;if(Nd)try{Nd({},"")}catch(t){Nd=null}var WA=function(){throw new Lp},EDe=Nd?function(){try{return arguments.callee,WA}catch(t){try{return Nd(arguments,"callee").get}catch(e){return WA}}}():WA,qp=aee()(),Gf=Object.getPrototypeOf||function(t){return t.__proto__},jp={},SDe=typeof Uint8Array=="undefined"?Lt:Gf(Uint8Array),Up={"%AggregateError%":typeof AggregateError=="undefined"?Lt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Lt:ArrayBuffer,"%ArrayIteratorPrototype%":qp?Gf([][Symbol.iterator]()):Lt,"%AsyncFromSyncIteratorPrototype%":Lt,"%AsyncFunction%":jp,"%AsyncGenerator%":jp,"%AsyncGeneratorFunction%":jp,"%AsyncIteratorPrototype%":jp,"%Atomics%":typeof Atomics=="undefined"?Lt:Atomics,"%BigInt%":typeof BigInt=="undefined"?Lt:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Lt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?Lt:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Lt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Lt:FinalizationRegistry,"%Function%":hee,"%GeneratorFunction%":jp,"%Int8Array%":typeof Int8Array=="undefined"?Lt:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Lt:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Lt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qp?Gf(Gf([][Symbol.iterator]())):Lt,"%JSON%":typeof JSON=="object"?JSON:Lt,"%Map%":typeof Map=="undefined"?Lt:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!qp?Lt:Gf(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Lt:Promise,"%Proxy%":typeof Proxy=="undefined"?Lt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?Lt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Lt:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!qp?Lt:Gf(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Lt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qp?Gf(""[Symbol.iterator]()):Lt,"%Symbol%":qp?Symbol:Lt,"%SyntaxError%":Kg,"%ThrowTypeError%":EDe,"%TypedArray%":SDe,"%TypeError%":Lp,"%Uint8Array%":typeof Uint8Array=="undefined"?Lt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Lt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Lt:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Lt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?Lt:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Lt:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Lt:WeakSet},xDe=function t(e){var r;if(e==="%AsyncFunction%")r=$A("async function () {}");else if(e==="%GeneratorFunction%")r=$A("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=$A("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&(r=Gf(n.prototype))}return Up[e]=r,r},pee={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x5=S5(),A5=dee(),ADe=x5.call(Function.call,Array.prototype.concat),IDe=x5.call(Function.apply,Array.prototype.splice),yee=x5.call(Function.call,String.prototype.replace),I5=x5.call(Function.call,String.prototype.slice),TDe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,RDe=/\\(\\)?/g,PDe=function(e){var r=I5(e,0,1),i=I5(e,-1);if(r==="%"&&i!=="%")throw new Kg("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new Kg("invalid intrinsic syntax, expected opening `%`");var n=[];return yee(e,TDe,function(s,o,a,c){n[n.length]=a?yee(c,RDe,"$1"):o||s}),n},CDe=function(e,r){var i=e,n;if(A5(pee,i)&&(n=pee[i],i="%"+n[0]+"%"),A5(Up,i)){var s=Up[i];if(s===jp&&(s=xDe(i)),typeof s=="undefined"&&!r)throw new Lp("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new Kg("intrinsic "+e+" does not exist!")};gee.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Lp("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Lp('"allowMissing" argument must be a boolean');var i=PDe(e),n=i.length>0?i[0]:"",s=CDe("%"+n+"%",r),o=s.name,a=s.value,c=!1,u=s.alias;u&&(n=u[0],IDe(i,ADe([0,1],u)));for(var f=1,d=!0;f=i.length){var b=Nd(a,h);d=!!b,d&&"get"in b&&!("originalValue"in b.get)?a=b.get:a=a[h]}else d=A5(a,h),a=a[h];d&&!c&&(Up[o]=a)}}return a}});var Eee=m((jbt,R5)=>{l();"use strict";var YA=S5(),Fp=T5(),mee=Fp("%Function.prototype.apply%"),bee=Fp("%Function.prototype.call%"),vee=Fp("%Reflect.apply%",!0)||YA.call(bee,mee),wee=Fp("%Object.getOwnPropertyDescriptor%",!0),Md=Fp("%Object.defineProperty%",!0),ODe=Fp("%Math.max%");if(Md)try{Md({},"a",{value:1})}catch(t){Md=null}R5.exports=function(e){var r=vee(YA,bee,arguments);if(wee&&Md){var i=wee(r,"length");i.configurable&&Md(r,"length",{value:1+ODe(0,e.length-(arguments.length-1))})}return r};var _ee=function(){return vee(YA,mee,arguments)};Md?Md(R5.exports,"apply",{value:_ee}):R5.exports.apply=_ee});var P5=m((Ubt,Aee)=>{l();"use strict";var See=T5(),xee=Eee(),kDe=xee(See("String.prototype.indexOf"));Aee.exports=function(e,r){var i=See(e,!!r);return typeof i=="function"&&kDe(e,".prototype.")>-1?xee(i):i}});var Ree=m((Fbt,Tee)=>{l();"use strict";var DDe=Fg()(),BDe=P5(),XA=BDe("Object.prototype.toString"),C5=function(e){return DDe&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:XA(e)==="[object Arguments]"},Iee=function(e){return C5(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&XA(e)!=="[object Array]"&&XA(e.callee)==="[object Function]"},NDe=function(){return C5(arguments)}();C5.isLegacyArguments=Iee;Tee.exports=NDe?C5:Iee});var Oee=m((Kbt,Cee)=>{l();"use strict";var MDe=Object.prototype.toString,LDe=Function.prototype.toString,qDe=/^\s*(?:function)?\*/,Pee=Fg()(),QA=Object.getPrototypeOf,jDe=function(){if(!Pee)return!1;try{return Function("return function*() {}")()}catch(t){}},ZA;Cee.exports=function(e){if(typeof e!="function")return!1;if(qDe.test(LDe.call(e)))return!0;if(!Pee){var r=MDe.call(e);return r==="[object GeneratorFunction]"}if(!QA)return!1;if(typeof ZA=="undefined"){var i=jDe();ZA=i?QA(i):!1}return QA(e)===ZA}});var JA=m((Vbt,kee)=>{l();var UDe=Object.prototype.hasOwnProperty,FDe=Object.prototype.toString;kee.exports=function(e,r,i){if(FDe.call(r)!=="[object Function]")throw new TypeError("iterator must be a function");var n=e.length;if(n===+n)for(var s=0;s{l();"use strict";var eI=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],KDe=(typeof globalThis=="undefined",globalThis);Dee.exports=function(){for(var e=[],r=0;r{l();"use strict";var VDe=T5(),O5=VDe("%Object.getOwnPropertyDescriptor%");if(O5)try{O5([],"length")}catch(t){O5=null}Bee.exports=O5});var sI=m((Gbt,jee)=>{l();"use strict";var Nee=JA(),zDe=tI(),iI=P5(),HDe=iI("Object.prototype.toString"),Mee=Fg()(),GDe=(typeof globalThis=="undefined",globalThis),Lee=zDe(),$De=iI("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1}return k5?YDe(e):!1}});var Gee=m(($bt,Hee)=>{l();"use strict";var Uee=JA(),XDe=tI(),Fee=P5(),QDe=Fee("Object.prototype.toString"),Kee=Fg()(),Vee=(typeof globalThis=="undefined",globalThis),ZDe=XDe(),JDe=Fee("String.prototype.slice"),zee={},oI=rI(),aI=Object.getPrototypeOf;Kee&&oI&&aI&&Uee(ZDe,function(t){if(typeof Vee[t]=="function"){var e=new Vee[t];if(Symbol.toStringTag in e){var r=aI(e),i=oI(r,Symbol.toStringTag);if(!i){var n=aI(r);i=oI(n,Symbol.toStringTag)}zee[t]=i.get}}});var eBe=function(e){var r=!1;return Uee(zee,function(i,n){if(!r)try{var s=i.call(e);s===n&&(r=s)}catch(o){}}),r},tBe=sI();Hee.exports=function(e){return tBe(e)?!Kee||!(Symbol.toStringTag in e)?JDe(QDe(e),8,-1):eBe(e):!1}});var ote=m(xt=>{l();"use strict";var rBe=Ree(),iBe=Oee(),aa=Gee(),$ee=sI();function Kp(t){return t.call.bind(t)}var Wee=typeof BigInt!="undefined",Yee=typeof Symbol!="undefined",yo=Kp(Object.prototype.toString),nBe=Kp(Number.prototype.valueOf),sBe=Kp(String.prototype.valueOf),oBe=Kp(Boolean.prototype.valueOf);Wee&&(Xee=Kp(BigInt.prototype.valueOf));var Xee;Yee&&(Qee=Kp(Symbol.prototype.valueOf));var Qee;function Vg(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch(r){return!1}}xt.isArgumentsObject=rBe;xt.isGeneratorFunction=iBe;xt.isTypedArray=$ee;function aBe(t){return typeof Promise!="undefined"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"}xt.isPromise=aBe;function cBe(t){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(t):$ee(t)||Jee(t)}xt.isArrayBufferView=cBe;function uBe(t){return aa(t)==="Uint8Array"}xt.isUint8Array=uBe;function fBe(t){return aa(t)==="Uint8ClampedArray"}xt.isUint8ClampedArray=fBe;function lBe(t){return aa(t)==="Uint16Array"}xt.isUint16Array=lBe;function dBe(t){return aa(t)==="Uint32Array"}xt.isUint32Array=dBe;function hBe(t){return aa(t)==="Int8Array"}xt.isInt8Array=hBe;function pBe(t){return aa(t)==="Int16Array"}xt.isInt16Array=pBe;function yBe(t){return aa(t)==="Int32Array"}xt.isInt32Array=yBe;function gBe(t){return aa(t)==="Float32Array"}xt.isFloat32Array=gBe;function mBe(t){return aa(t)==="Float64Array"}xt.isFloat64Array=mBe;function bBe(t){return aa(t)==="BigInt64Array"}xt.isBigInt64Array=bBe;function vBe(t){return aa(t)==="BigUint64Array"}xt.isBigUint64Array=vBe;function D5(t){return yo(t)==="[object Map]"}D5.working=typeof Map!="undefined"&&D5(new Map);function wBe(t){return typeof Map=="undefined"?!1:D5.working?D5(t):t instanceof Map}xt.isMap=wBe;function B5(t){return yo(t)==="[object Set]"}B5.working=typeof Set!="undefined"&&B5(new Set);function _Be(t){return typeof Set=="undefined"?!1:B5.working?B5(t):t instanceof Set}xt.isSet=_Be;function N5(t){return yo(t)==="[object WeakMap]"}N5.working=typeof WeakMap!="undefined"&&N5(new WeakMap);function EBe(t){return typeof WeakMap=="undefined"?!1:N5.working?N5(t):t instanceof WeakMap}xt.isWeakMap=EBe;function cI(t){return yo(t)==="[object WeakSet]"}cI.working=typeof WeakSet!="undefined"&&cI(new WeakSet);function SBe(t){return cI(t)}xt.isWeakSet=SBe;function M5(t){return yo(t)==="[object ArrayBuffer]"}M5.working=typeof ArrayBuffer!="undefined"&&M5(new ArrayBuffer);function Zee(t){return typeof ArrayBuffer=="undefined"?!1:M5.working?M5(t):t instanceof ArrayBuffer}xt.isArrayBuffer=Zee;function L5(t){return yo(t)==="[object DataView]"}L5.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&L5(new DataView(new ArrayBuffer(1),0,1));function Jee(t){return typeof DataView=="undefined"?!1:L5.working?L5(t):t instanceof DataView}xt.isDataView=Jee;var uI=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:void 0;function zg(t){return yo(t)==="[object SharedArrayBuffer]"}function ete(t){return typeof uI=="undefined"?!1:(typeof zg.working=="undefined"&&(zg.working=zg(new uI)),zg.working?zg(t):t instanceof uI)}xt.isSharedArrayBuffer=ete;function xBe(t){return yo(t)==="[object AsyncFunction]"}xt.isAsyncFunction=xBe;function ABe(t){return yo(t)==="[object Map Iterator]"}xt.isMapIterator=ABe;function IBe(t){return yo(t)==="[object Set Iterator]"}xt.isSetIterator=IBe;function TBe(t){return yo(t)==="[object Generator]"}xt.isGeneratorObject=TBe;function RBe(t){return yo(t)==="[object WebAssembly.Module]"}xt.isWebAssemblyCompiledModule=RBe;function tte(t){return Vg(t,nBe)}xt.isNumberObject=tte;function rte(t){return Vg(t,sBe)}xt.isStringObject=rte;function ite(t){return Vg(t,oBe)}xt.isBooleanObject=ite;function nte(t){return Wee&&Vg(t,Xee)}xt.isBigIntObject=nte;function ste(t){return Yee&&Vg(t,Qee)}xt.isSymbolObject=ste;function PBe(t){return tte(t)||rte(t)||ite(t)||nte(t)||ste(t)}xt.isBoxedPrimitive=PBe;function CBe(t){return typeof Uint8Array!="undefined"&&(Zee(t)||ete(t))}xt.isAnyArrayBuffer=CBe;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(xt,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})});var cte=m((Ybt,ate)=>{l();ate.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var pte=m(At=>{l();var ute=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),i={},n=0;n=n)return a;switch(a){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(c){return"[Circular]"}default:return a}}),o=i[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),dI(e)?r.showHidden=e:e&&At._extend(r,e),Ld(r.showHidden)&&(r.showHidden=!1),Ld(r.depth)&&(r.depth=2),Ld(r.colors)&&(r.colors=!1),Ld(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=kBe),U5(r,t,r.depth)}At.inspect=$f;$f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};$f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function kBe(t,e){var r=$f.styles[e];return r?"["+$f.colors[r][0]+"m"+t+"["+$f.colors[r][1]+"m":t}function DBe(t,e){return t}function BBe(t){var e={};return t.forEach(function(r,i){e[r]=!0}),e}function U5(t,e,r){if(t.customInspect&&e&&z5(e.inspect)&&e.inspect!==At.inspect&&!(e.constructor&&e.constructor.prototype===e)){var i=e.inspect(r,t);return K5(i)||(i=U5(t,i,r)),i}var n=NBe(t,e);if(n)return n;var s=Object.keys(e),o=BBe(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),Gg(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return fI(e);if(s.length===0){if(z5(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Hg(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(V5(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Gg(e))return fI(e)}var c="",u=!1,f=["{","}"];if(lte(e)&&(u=!0,f=["[","]"]),z5(e)){var d=e.name?": "+e.name:"";c=" [Function"+d+"]"}if(Hg(e)&&(c=" "+RegExp.prototype.toString.call(e)),V5(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Gg(e)&&(c=" "+fI(e)),s.length===0&&(!u||e.length==0))return f[0]+c+f[1];if(r<0)return Hg(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var h;return u?h=MBe(t,e,r,o,s):h=s.map(function(p){return lI(t,e,r,o,p,u)}),t.seen.pop(),LBe(h,c,f)}function NBe(t,e){if(Ld(e))return t.stylize("undefined","undefined");if(K5(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(dte(e))return t.stylize(""+e,"number");if(dI(e))return t.stylize(""+e,"boolean");if(F5(e))return t.stylize("null","null")}function fI(t){return"["+Error.prototype.toString.call(t)+"]"}function MBe(t,e,r,i,n){for(var s=[],o=0,a=e.length;o-1&&(s?a=a.split(` `).map(function(u){return" "+u}).join(` `).substr(2):a=` `+a.split(` `).map(function(u){return" "+u}).join(` `))):a=t.stylize("[Circular]","special")),Ld(o)){if(s&&n.match(/^\d+$/))return a;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function LBe(t,e,r){var i=0,n=t.reduce(function(s,o){return i++,o.indexOf(` `)>=0&&i++,s+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+` `)+" "+t.join(`, `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}At.types=ote();function lte(t){return Array.isArray(t)}At.isArray=lte;function dI(t){return typeof t=="boolean"}At.isBoolean=dI;function F5(t){return t===null}At.isNull=F5;function qBe(t){return t==null}At.isNullOrUndefined=qBe;function dte(t){return typeof t=="number"}At.isNumber=dte;function K5(t){return typeof t=="string"}At.isString=K5;function jBe(t){return typeof t=="symbol"}At.isSymbol=jBe;function Ld(t){return t===void 0}At.isUndefined=Ld;function Hg(t){return Vp(t)&&hI(t)==="[object RegExp]"}At.isRegExp=Hg;At.types.isRegExp=Hg;function Vp(t){return typeof t=="object"&&t!==null}At.isObject=Vp;function V5(t){return Vp(t)&&hI(t)==="[object Date]"}At.isDate=V5;At.types.isDate=V5;function Gg(t){return Vp(t)&&(hI(t)==="[object Error]"||t instanceof Error)}At.isError=Gg;At.types.isNativeError=Gg;function z5(t){return typeof t=="function"}At.isFunction=z5;function UBe(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t=="undefined"}At.isPrimitive=UBe;At.isBuffer=cte();function hI(t){return Object.prototype.toString.call(t)}function pI(t){return t<10?"0"+t.toString(10):t.toString(10)}var FBe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function KBe(){var t=new Date,e=[pI(t.getHours()),pI(t.getMinutes()),pI(t.getSeconds())].join(":");return[t.getDate(),FBe[t.getMonth()],e].join(" ")}At.log=function(){console.log("%s - %s",KBe(),At.format.apply(At,arguments))};At.inherits=on();At._extend=function(t,e){if(!e||!Vp(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};function hte(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var qd=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;At.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(qd&&e[qd]){var r=e[qd];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,qd,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var i,n,s=new Promise(function(c,u){i=c,n=u}),o=[],a=0;a{l();"use strict";yte.exports=function(...e){let r=e.reduce((i,n)=>Object.assign(i,n),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,status:r.status||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:r.encodings||!1,additionalMethods:Object.assign({},r.additionalMethods)})}});var gI=m((Zbt,gte)=>{l();gte.exports=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}});var H5=m((Jbt,bte)=>{l();var mte;bte.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window!="undefined"?window:globalThis):t=>(mte||(mte=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var G5=m((e5t,wte)=>{l();"use strict";var vte=H5();wte.exports=function(t,...e){e.length===0?vte(t):vte(()=>t(...e))}});var mI=m((t5t,_te)=>{l();"use strict";function Wf(t){if(typeof t!="object"||t===null)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}Wf.prototype.next=function(t){if(typeof t!="function")throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),this):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),this):(this._nexting=!0,this._next((e,...r)=>{this._nexting=!1,t(e,...r)}),this)};Wf.prototype._next=function(t){this._nextTick(t)};Wf.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)};Wf.prototype._seek=function(t){};Wf.prototype.end=function(t){if(typeof t!="function")throw new Error("end() requires a callback argument");if(this._ended)return this._nextTick(t,new Error("end() already called on iterator"));this._ended=!0,this._end(t)};Wf.prototype._end=function(t){this._nextTick(t)};Wf.prototype._nextTick=G5();_te.exports=Wf});var bI=m((r5t,Ste)=>{l();"use strict";var Ete=Object.freeze({});function ca(t){if(typeof t!="object"||t===null)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}ca.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")};ca.prototype.put=function(t,e,r){this._checkWritten();let i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,r??Ete),this};ca.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})};ca.prototype.del=function(t,e){this._checkWritten();let r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,e??Ete),this};ca.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})};ca.prototype.clear=function(){return this._checkWritten(),this._clear(),this};ca.prototype._clear=function(){this._operations=[]};ca.prototype.write=function(t,e){if(this._checkWritten(),typeof t=="function"&&(e=t),typeof e!="function")throw new Error("write() requires a callback argument");(typeof t!="object"||t===null)&&(t={}),this._written=!0,this._write(t,e)};ca.prototype._write=function(t,e){this.db._batch(this._operations,t,e)};ca.prototype._nextTick=G5();Ste.exports=ca});var Ite=m((i5t,Ate)=>{l();"use strict";var HBe=yI(),GBe=gI(),$Be=mI(),WBe=bI(),YBe=Object.prototype.hasOwnProperty,XBe=["lt","lte","gt","gte"];function Pr(t){this.status="new",this.supports=HBe(t,{status:!0})}Pr.prototype.open=function(t,e){let r=this.status;if(typeof t=="function"&&(e=t),typeof e!="function")throw new Error("open() requires a callback argument");(typeof t!="object"||t===null)&&(t={}),t.createIfMissing=t.createIfMissing!==!1,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,i=>{if(i)return this.status=r,e(i);this.status="open",e()})};Pr.prototype._open=function(t,e){this._nextTick(e)};Pr.prototype.close=function(t){let e=this.status;if(typeof t!="function")throw new Error("close() requires a callback argument");this.status="closing",this._close(r=>{if(r)return this.status=e,t(r);this.status="closed",t()})};Pr.prototype._close=function(t){this._nextTick(t)};Pr.prototype.get=function(t,e,r){if(typeof e=="function"&&(r=e),typeof r!="function")throw new Error("get() requires a callback argument");let i=this._checkKey(t);if(i)return this._nextTick(r,i);t=this._serializeKey(t),(typeof e!="object"||e===null)&&(e={}),e.asBuffer=e.asBuffer!==!1,this._get(t,e,r)};Pr.prototype._get=function(t,e,r){this._nextTick(function(){r(new Error("NotFound"))})};Pr.prototype.put=function(t,e,r,i){if(typeof r=="function"&&(i=r),typeof i!="function")throw new Error("put() requires a callback argument");let n=this._checkKey(t)||this._checkValue(e);if(n)return this._nextTick(i,n);t=this._serializeKey(t),e=this._serializeValue(e),(typeof r!="object"||r===null)&&(r={}),this._put(t,e,r,i)};Pr.prototype._put=function(t,e,r,i){this._nextTick(i)};Pr.prototype.del=function(t,e,r){if(typeof e=="function"&&(r=e),typeof r!="function")throw new Error("del() requires a callback argument");let i=this._checkKey(t);if(i)return this._nextTick(r,i);t=this._serializeKey(t),(typeof e!="object"||e===null)&&(e={}),this._del(t,e,r)};Pr.prototype._del=function(t,e,r){this._nextTick(r)};Pr.prototype.batch=function(t,e,r){if(!arguments.length)return this._chainedBatch();if(typeof e=="function"&&(r=e),typeof t=="function"&&(r=t),typeof r!="function")throw new Error("batch(array) requires a callback argument");if(!Array.isArray(t))return this._nextTick(r,new Error("batch(array) requires an array argument"));if(t.length===0)return this._nextTick(r);(typeof e!="object"||e===null)&&(e={});let i=new Array(t.length);for(let n=0;n{if(s)return r.end(function(){e(s)});r.next((o,a)=>{if(o)return n(o);if(a===void 0)return r.end(e);this._del(a,i,n)})};n()};Pr.prototype._setupIteratorOptions=function(t){return t=xte(this,t),t.reverse=!!t.reverse,t.keys=t.keys!==!1,t.values=t.values!==!1,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=t.keyAsBuffer!==!1,t.valueAsBuffer=t.valueAsBuffer!==!1,t};function xte(t,e){let r={};for(let i in e){if(!YBe.call(e,i))continue;if(i==="start"||i==="end")throw new Error('Legacy range options ("start" and "end") have been removed');let n=e[i];QBe(i)&&(n=t._serializeKey(n)),r[i]=n}return r}function QBe(t){return XBe.indexOf(t)!==-1}Pr.prototype.iterator=function(t){return(typeof t!="object"||t===null)&&(t={}),t=this._setupIteratorOptions(t),this._iterator(t)};Pr.prototype._iterator=function(t){return new $Be(this)};Pr.prototype._chainedBatch=function(){return new WBe(this)};Pr.prototype._serializeKey=function(t){return t};Pr.prototype._serializeValue=function(t){return t};Pr.prototype._checkKey=function(t){if(t==null)return new Error("key cannot be `null` or `undefined`");if(GBe(t)&&t.length===0)return new Error("key cannot be an empty Buffer");if(t==="")return new Error("key cannot be an empty String");if(Array.isArray(t)&&t.length===0)return new Error("key cannot be an empty Array")};Pr.prototype._checkValue=function(t){if(t==null)return new Error("value cannot be `null` or `undefined`")};Pr.prototype._nextTick=G5();Ate.exports=Pr});var Yf=m($5=>{l();"use strict";$5.AbstractLevelDOWN=Ite();$5.AbstractIterator=mI();$5.AbstractChainedBatch=bI()});var Pte=m((s5t,Rte)=>{l();"use strict";var Tte=Yf().AbstractIterator,ZBe=on();function zp(t,e){Tte.call(this,t),this._options=e,this._iterator=null,this._operations=[]}ZBe(zp,Tte);zp.prototype.setDb=function(t){let e=this._iterator=t.iterator(this._options);for(let r of this._operations)e[r.method](...r.args)};zp.prototype._operation=function(t,e){if(this._iterator)return this._iterator[t](...e);this._operations.push({method:t,args:e})};for(let t of["next","end"])zp.prototype["_"+t]=function(...e){this._operation(t,e)};zp.prototype.seek=function(...t){this._operation("seek",t)};Rte.exports=zp});var Bte=m((o5t,vI)=>{l();"use strict";var Cte=Yf().AbstractLevelDOWN,JBe=on(),Ote=Pte(),kte="put get del batch clear".split(" "),eNe="approximateSize compactRange".split(" ");function jd(t){Cte.call(this,t.supports||{});for(let e of eNe)typeof t[e]=="function"&&!this.supports.additionalMethods[e]&&(this.supports.additionalMethods[e]=!0);this._db=t,this._operations=[],Dte(this)}JBe(jd,Cte);jd.prototype.type="deferred-leveldown";jd.prototype._open=function(t,e){this._db.open(t,r=>{if(r)return e(r);for(let i of this._operations)i.iterator?i.iterator.setDb(this._db):this._db[i.method](...i.args);this._operations=[],tNe(this),e()})};jd.prototype._close=function(t){this._db.close(e=>{if(e)return t(e);Dte(this),t()})};function tNe(t){for(let e of kte.concat("iterator"))t["_"+e]=function(...r){return this._db[e](...r)};for(let e of Object.keys(t.supports.additionalMethods))t[e]=function(...r){return this._db[e](...r)}}function Dte(t){for(let e of kte)t["_"+e]=function(...r){this._operations.push({method:e,args:r})};for(let e of Object.keys(t.supports.additionalMethods))t[e]=function(...r){this._operations.push({method:e,args:r})};t._iterator=function(e){let r=new Ote(t,e);return this._operations.push({iterator:r}),r}}jd.prototype._serializeKey=function(t){return t};jd.prototype._serializeValue=function(t){return t};vI.exports=jd;vI.exports.DeferredIterator=Ote});var wI=m((a5t,Nte)=>{l();Nte.exports=br().EventEmitter});var _I=m(()=>{l()});var jte=m((f5t,qte)=>{l();"use strict";function Mte(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function rNe(t){for(var e=1;e0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return W5.alloc(0);for(var i=W5.allocUnsafe(r>>>0),n=this.head,s=0;n;)uNe(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return ro.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=W5.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:cNe,value:function(r,i){return EI(this,rNe({},i,{depth:0,customInspect:!1}))}}]),t}()});var xI=m((l5t,Fte)=>{l();"use strict";function fNe(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(SI,this,t)):process.nextTick(SI,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Y5,r):(r._writableState.errorEmitted=!0,process.nextTick(Ute,r,s)):process.nextTick(Ute,r,s):e?(process.nextTick(Y5,r),e(s)):process.nextTick(Y5,r)}),this)}function Ute(t,e){SI(t,e),Y5(t)}function Y5(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function lNe(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function SI(t,e){t.emit("error",e)}function dNe(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Fte.exports={destroy:fNe,undestroy:lNe,errorOrDestroy:dNe}});var Ud=m((d5t,zte)=>{l();"use strict";function hNe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Kte={};function go(t,e,r){r||(r=Error);function i(s,o,a){return typeof e=="string"?e:e(s,o,a)}var n=function(s){hNe(o,s);function o(a,c,u){return s.call(this,i(a,c,u))||this}return o}(r);n.prototype.name=r.name,n.prototype.code=t,Kte[t]=n}function Vte(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function pNe(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function yNe(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function gNe(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}go("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);go("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&pNe(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(yNe(t," argument"))n="The ".concat(t," ").concat(i," ").concat(Vte(e,"type"));else{var s=gNe(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(Vte(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);go("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");go("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});go("ERR_STREAM_PREMATURE_CLOSE","Premature close");go("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});go("ERR_MULTIPLE_CALLBACK","Callback called multiple times");go("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");go("ERR_STREAM_WRITE_AFTER_END","write after end");go("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);go("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);go("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");zte.exports.codes=Kte});var AI=m((h5t,Hte)=>{l();"use strict";var mNe=Ud().codes.ERR_INVALID_OPT_VALUE;function bNe(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function vNe(t,e,r,i){var n=bNe(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new mNe(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Hte.exports={getHighWaterMark:vNe}});var $te=m((p5t,Gte)=>{l();Gte.exports=wNe;function wNe(t,e){if(II("noDeprecation"))return t;var r=!1;function i(){if(!r){if(II("throwDeprecation"))throw new Error(e);II("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return i}function II(t){try{if(!globalThis.localStorage)return!1}catch(r){return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var PI=m((y5t,Jte)=>{l();"use strict";Jte.exports=ti;function Wte(t){var e=this;this.next=null,this.entry=null,this.finish=function(){$Ne(e,t)}}var Hp;ti.WritableState=$g;var _Ne={deprecate:$te()},Yte=wI(),X5=Ht().Buffer,ENe=globalThis.Uint8Array||function(){};function SNe(t){return X5.from(t)}function xNe(t){return X5.isBuffer(t)||t instanceof ENe}var TI=xI(),ANe=AI(),INe=ANe.getHighWaterMark,Xf=Ud().codes,TNe=Xf.ERR_INVALID_ARG_TYPE,RNe=Xf.ERR_METHOD_NOT_IMPLEMENTED,PNe=Xf.ERR_MULTIPLE_CALLBACK,CNe=Xf.ERR_STREAM_CANNOT_PIPE,ONe=Xf.ERR_STREAM_DESTROYED,kNe=Xf.ERR_STREAM_NULL_VALUES,DNe=Xf.ERR_STREAM_WRITE_AFTER_END,BNe=Xf.ERR_UNKNOWN_ENCODING,Gp=TI.errorOrDestroy;on()(ti,Yte);function NNe(){}function $g(t,e,r){Hp=Hp||Fd(),t=t||{},typeof r!="boolean"&&(r=e instanceof Hp),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=INe(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){KNe(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Wte(this)}$g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty($g.prototype,"buffer",{get:_Ne.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}})();var Q5;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Q5=Function.prototype[Symbol.hasInstance],Object.defineProperty(ti,Symbol.hasInstance,{value:function(e){return Q5.call(this,e)?!0:this!==ti?!1:e&&e._writableState instanceof $g}})):Q5=function(e){return e instanceof this};function ti(t){Hp=Hp||Fd();var e=this instanceof Hp;if(!e&&!Q5.call(ti,this))return new ti(t);this._writableState=new $g(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Yte.call(this)}ti.prototype.pipe=function(){Gp(this,new CNe)};function MNe(t,e){var r=new DNe;Gp(t,r),process.nextTick(e,r)}function LNe(t,e,r,i){var n;return r===null?n=new kNe:typeof r!="string"&&!e.objectMode&&(n=new TNe("chunk",["string","Buffer"],r)),n?(Gp(t,n),process.nextTick(i,n),!1):!0}ti.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&xNe(t);return s&&!X5.isBuffer(t)&&(t=SNe(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=NNe),i.ending?MNe(this,r):(s||LNe(this,i,t,r))&&(i.pendingcb++,n=jNe(this,i,s,t,e,r)),n};ti.prototype.cork=function(){this._writableState.corked++};ti.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Qte(this,t))};ti.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new BNe(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(ti.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function qNe(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=X5.from(e,r)),e}Object.defineProperty(ti.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function jNe(t,e,r,i,n,s){if(!r){var o=qNe(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var c=e.length{l();"use strict";var WNe=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};tre.exports=mc;var ere=kI(),CI=PI();on()(mc,ere);for(OI=WNe(CI.prototype),Z5=0;Z5{l();var e8=Ht(),bu=e8.Buffer;function rre(t,e){for(var r in t)e[r]=t[r]}bu.from&&bu.alloc&&bu.allocUnsafe&&bu.allocUnsafeSlow?ire.exports=e8:(rre(e8,DI),DI.Buffer=$p);function $p(t,e,r){return bu(t,e,r)}rre(bu,$p);$p.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return bu(t,e,r)};$p.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=bu(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};$p.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return bu(t)};$p.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return e8.SlowBuffer(t)}});var MI=m(ore=>{l();"use strict";var BI=nre().Buffer,sre=BI.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function QNe(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function ZNe(t){var e=QNe(t);if(typeof e!="string"&&(BI.isEncoding===sre||!sre(t)))throw new Error("Unknown encoding: "+t);return e||t}ore.StringDecoder=Yg;function Yg(t){this.encoding=ZNe(t);var e;switch(this.encoding){case"utf16le":this.text=nMe,this.end=sMe,e=4;break;case"utf8":this.fillLast=tMe,e=4;break;case"base64":this.text=oMe,this.end=aMe,e=3;break;default:this.write=cMe,this.end=uMe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=BI.allocUnsafe(e)}Yg.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function JNe(t,e,r){var i=e.length-1;if(i=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function eMe(t,e,r){if((e[0]&192)!=128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!=128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!=128)return t.lastNeed=2,"\uFFFD"}}function tMe(t){var e=this.lastTotal-this.lastNeed,r=eMe(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function rMe(t,e){var r=JNe(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function iMe(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function nMe(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function sMe(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function oMe(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function aMe(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function cMe(t){return t.toString(this.encoding)}function uMe(t){return t&&t.length?this.write(t):""}});var t8=m((b5t,ure)=>{l();"use strict";var are=Ud().codes.ERR_STREAM_PREMATURE_CLOSE;function fMe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n{l();"use strict";var r8;function Qf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var hMe=t8(),Zf=Symbol("lastResolve"),Kd=Symbol("lastReject"),Xg=Symbol("error"),i8=Symbol("ended"),Vd=Symbol("lastPromise"),LI=Symbol("handlePromise"),zd=Symbol("stream");function Jf(t,e){return{value:t,done:e}}function pMe(t){var e=t[Zf];if(e!==null){var r=t[zd].read();r!==null&&(t[Vd]=null,t[Zf]=null,t[Kd]=null,e(Jf(r,!1)))}}function yMe(t){process.nextTick(pMe,t)}function gMe(t,e){return function(r,i){t.then(function(){if(e[i8]){r(Jf(void 0,!0));return}e[LI](r,i)},i)}}var mMe=Object.getPrototypeOf(function(){}),bMe=Object.setPrototypeOf((r8={get stream(){return this[zd]},next:function(){var e=this,r=this[Xg];if(r!==null)return Promise.reject(r);if(this[i8])return Promise.resolve(Jf(void 0,!0));if(this[zd].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[Xg]?a(e[Xg]):o(Jf(void 0,!0))})});var i=this[Vd],n;if(i)n=new Promise(gMe(i,this));else{var s=this[zd].read();if(s!==null)return Promise.resolve(Jf(s,!1));n=new Promise(this[LI])}return this[Vd]=n,n}},Qf(r8,Symbol.asyncIterator,function(){return this}),Qf(r8,"return",function(){var e=this;return new Promise(function(r,i){e[zd].destroy(null,function(n){if(n){i(n);return}r(Jf(void 0,!0))})})}),r8),mMe),vMe=function(e){var r,i=Object.create(bMe,(r={},Qf(r,zd,{value:e,writable:!0}),Qf(r,Zf,{value:null,writable:!0}),Qf(r,Kd,{value:null,writable:!0}),Qf(r,Xg,{value:null,writable:!0}),Qf(r,i8,{value:e._readableState.endEmitted,writable:!0}),Qf(r,LI,{value:function(s,o){var a=i[zd].read();a?(i[Vd]=null,i[Zf]=null,i[Kd]=null,s(Jf(a,!1))):(i[Zf]=s,i[Kd]=o)},writable:!0}),r));return i[Vd]=null,hMe(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[Kd];s!==null&&(i[Vd]=null,i[Zf]=null,i[Kd]=null,s(n)),i[Xg]=n;return}var o=i[Zf];o!==null&&(i[Vd]=null,i[Zf]=null,i[Kd]=null,o(Jf(void 0,!0))),i[i8]=!0}),e.on("readable",yMe.bind(null,i)),i};fre.exports=vMe});var hre=m((w5t,dre)=>{l();dre.exports=function(){throw new Error("Readable.from is not available in the browser")}});var kI=m((E5t,Sre)=>{l();"use strict";Sre.exports=Ft;var Wp;Ft.ReadableState=yre;var _5t=br().EventEmitter,pre=function(e,r){return e.listeners(r).length},Qg=wI(),n8=Ht().Buffer,wMe=globalThis.Uint8Array||function(){};function _Me(t){return n8.from(t)}function EMe(t){return n8.isBuffer(t)||t instanceof wMe}var qI=_I(),wt;qI&&qI.debuglog?wt=qI.debuglog("stream"):wt=function(){};var SMe=jte(),jI=xI(),xMe=AI(),AMe=xMe.getHighWaterMark,s8=Ud().codes,IMe=s8.ERR_INVALID_ARG_TYPE,TMe=s8.ERR_STREAM_PUSH_AFTER_EOF,RMe=s8.ERR_METHOD_NOT_IMPLEMENTED,PMe=s8.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Yp,UI,FI;on()(Ft,Qg);var Zg=jI.errorOrDestroy,KI=["error","close","destroy","pause","resume"];function CMe(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function yre(t,e,r){Wp=Wp||Fd(),t=t||{},typeof r!="boolean"&&(r=e instanceof Wp),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=AMe(this,t,"readableHighWaterMark",r),this.buffer=new SMe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Yp||(Yp=MI().StringDecoder),this.decoder=new Yp(t.encoding),this.encoding=t.encoding)}function Ft(t){if(Wp=Wp||Fd(),!(this instanceof Ft))return new Ft(t);var e=this instanceof Wp;this._readableState=new yre(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Qg.call(this)}Object.defineProperty(Ft.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Ft.prototype.destroy=jI.destroy;Ft.prototype._undestroy=jI.undestroy;Ft.prototype._destroy=function(t,e){e(t)};Ft.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=n8.from(t,e),e=""),i=!0),gre(this,t,e,!1,i)};Ft.prototype.unshift=function(t){return gre(this,t,null,!0,!1)};function gre(t,e,r,i,n){wt("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,DMe(t,s);else{var o;if(n||(o=OMe(s,e)),o)Zg(t,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==n8.prototype&&(e=_Me(e)),i)s.endEmitted?Zg(t,new PMe):VI(t,s,e,!0);else if(s.ended)Zg(t,new TMe);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?VI(t,s,e,!1):zI(t,s)):VI(t,s,e,!1)}else i||(s.reading=!1,zI(t,s))}return!s.ended&&(s.length=mre?t=mre:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function bre(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=kMe(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Ft.prototype.read=function(t){wt("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return wt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?GI(this):o8(this),null;if(t=bre(t,e),t===0&&e.ended)return e.length===0&&GI(this),null;var i=e.needReadable;wt("need readable",i),(e.length===0||e.length-t0?n=_re(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&GI(this)),n!==null&&this.emit("data",n),n};function DMe(t,e){if(wt("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?o8(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,vre(t)))}}function o8(t){var e=t._readableState;wt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(wt("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(vre,t))}function vre(t){var e=t._readableState;wt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,HI(t)}function zI(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(BMe,t,e))}function BMe(t,e){for(;!e.reading&&!e.ended&&(e.length1&&Ere(i.pipes,t)!==-1)&&!u&&(wt("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(E){wt("onerror",E),b(),t.removeListener("error",h),pre(t,"error")===0&&Zg(t,E)}CMe(t,"error",h);function p(){t.removeListener("finish",y),b()}t.once("close",p);function y(){wt("onfinish"),t.removeListener("close",p),b()}t.once("finish",y);function b(){wt("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(wt("pipe resume"),r.resume()),t};function NMe(t){return function(){var r=t._readableState;wt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&pre(t,"data")&&(r.flowing=!0,HI(t))}}Ft.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,wt("on readable",i.length,i.reading),i.length?o8(this):i.reading||process.nextTick(MMe,this)),r};Ft.prototype.addListener=Ft.prototype.on;Ft.prototype.removeListener=function(t,e){var r=Qg.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(wre,this),r};Ft.prototype.removeAllListeners=function(t){var e=Qg.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(wre,this),e};function wre(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function MMe(t){wt("readable nexttick read 0"),t.read(0)}Ft.prototype.resume=function(){var t=this._readableState;return t.flowing||(wt("resume"),t.flowing=!t.readableListening,LMe(this,t)),t.paused=!1,this};function LMe(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(qMe,t,e))}function qMe(t,e){wt("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),HI(t),e.flowing&&!e.reading&&t.read(0)}Ft.prototype.pause=function(){return wt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(wt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function HI(t){var e=t._readableState;for(wt("flow",e.flowing);e.flowing&&t.read()!==null;);}Ft.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(wt("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(wt("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(a){return function(){return t[a].apply(t,arguments)}}(n));for(var s=0;s=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function GI(t){var e=t._readableState;wt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(jMe,e,t))}function jMe(t,e){if(wt("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Ft.from=function(t,e){return FI===void 0&&(FI=hre()),FI(Ft,t,e)});function Ere(t,e){for(var r=0,i=t.length;r{l();"use strict";Are.exports=vu;var a8=Ud().codes,UMe=a8.ERR_METHOD_NOT_IMPLEMENTED,FMe=a8.ERR_MULTIPLE_CALLBACK,KMe=a8.ERR_TRANSFORM_ALREADY_TRANSFORMING,VMe=a8.ERR_TRANSFORM_WITH_LENGTH_0,c8=Fd();on()(vu,c8);function zMe(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new FMe);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{l();"use strict";Tre.exports=Jg;var Ire=$I();on()(Jg,Ire);function Jg(t){if(!(this instanceof Jg))return new Jg(t);Ire.call(this,t)}Jg.prototype._transform=function(t,e,r){r(null,t)}});var Dre=m((A5t,kre)=>{l();"use strict";var WI;function GMe(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Pre=Ud().codes,$Me=Pre.ERR_MISSING_ARGS,WMe=Pre.ERR_STREAM_DESTROYED;function Cre(t){if(t)throw t}function YMe(t){return t.setHeader&&typeof t.abort=="function"}function XMe(t,e,r,i){i=GMe(i);var n=!1;t.on("close",function(){n=!0}),WI===void 0&&(WI=t8()),WI(t,{readable:e,writable:r},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,YMe(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(o||new WMe("pipe"))}}}function Ore(t){t()}function QMe(t,e){return t.pipe(e)}function ZMe(t){return!t.length||typeof t[t.length-1]!="function"?Cre:t.pop()}function JMe(){for(var t=arguments.length,e=new Array(t),r=0;r0;return XMe(o,c,u,function(f){n||(n=f),f&&s.forEach(Ore),!c&&(s.forEach(Ore),i(n))})});return e.reduce(QMe)}kre.exports=JMe});var YI=m((mo,Bre)=>{l();mo=Bre.exports=kI();mo.Stream=mo;mo.Readable=mo;mo.Writable=PI();mo.Duplex=Fd();mo.Transform=$I();mo.PassThrough=Rre();mo.finished=t8();mo.pipeline=Dre()});var Lre=m((I5t,Mre)=>{l();"use strict";var eLe=on(),{Readable:Nre}=YI();Mre.exports=Xp;eLe(Xp,Nre);function Xp(t,e){if(!(this instanceof Xp))return new Xp(t,e);e=e||{},Nre.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}Xp.prototype._read=function(){this.destroyed||this._iterator.next((t,e,r)=>{if(!this.destroyed){if(t)return this.destroy(t);e===void 0&&r===void 0?this.push(null):this._options.keys!==!1&&this._options.values===!1?this.push(e):this._options.keys===!1&&this._options.values!==!1?this.push(r):this.push({key:e,value:r})}})};Xp.prototype._destroy=function(t,e){this._iterator.end(function(r){e(t||r)})}});var jre=m((qre,u8)=>{l();(function(t,e,r){typeof u8!="undefined"&&u8.exports?u8.exports=r():e[t]=r()})("prr",qre,function(){var t=typeof Object.defineProperty=="function"?function(i,n,s){return Object.defineProperty(i,n,s),i}:function(i,n,s){return i[n]=s.value,i},e=function(i,n){var s=typeof n=="object",o=!s&&typeof n=="string",a=function(c){return s?!!n[c]:o?n.indexOf(c[0])>-1:!1};return{enumerable:a("enumerable"),configurable:a("configurable"),writable:a("writable"),value:i}},r=function(i,n,s,o){var a;if(o=e(s,o),typeof n=="object"){for(a in n)Object.hasOwnProperty.call(n,a)&&(o.value=n[a],t(i,a,o));return i}return t(i,n,o)};return r})});var Kre=m((T5t,Fre)=>{l();var tLe=jre();function Ure(t,e,r){!!e&&typeof e!="string"&&(e=e.message||e.name),tLe(this,{type:t,name:t,cause:typeof e!="string"?e:r,message:e},"ewr")}function XI(t,e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),Ure.call(this,"CustomError",t,e)}XI.prototype=new Error;function rLe(t,e,r){var i=function(n,s){Ure.call(this,e,n,s),e=="FilesystemError"&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(t.errno[this.cause.errno]?t.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,i)};return i.prototype=r?new r:new XI,i}Fre.exports=function(t){var e=function(r,i){return rLe(t,r,i)};return{CustomError:XI,FilesystemError:e("FilesystemError"),createError:e}}});var Vre=m((R5t,bc)=>{l();var iLe=bc.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];bc.exports.errno={};bc.exports.code={};iLe.forEach(function(t){bc.exports.errno[t.errno]=t,bc.exports.code[t.code]=t});bc.exports.custom=Kre()(bc.exports);bc.exports.create=bc.exports.custom.createError});var f8=m((P5t,zre)=>{l();"use strict";var Hd=Vre().create,Gd=Hd("LevelUPError"),QI=Hd("NotFoundError",Gd);QI.prototype.notFound=!0;QI.prototype.status=404;zre.exports={LevelUPError:Gd,InitializationError:Hd("InitializationError",Gd),OpenError:Hd("OpenError",Gd),ReadError:Hd("ReadError",Gd),WriteError:Hd("WriteError",Gd),NotFoundError:QI,EncodingError:Hd("EncodingError",Gd)}});var JI=m(ZI=>{l();"use strict";ZI.fromCallback=function(t){if(t===void 0){var e=new Promise(function(r,i){t=function(n,s){n?i(n):r(s)}});t.promise=e}return t};ZI.fromPromise=function(t,e){if(e===void 0)return t;t.then(function(r){process.nextTick(e,null,r)}).catch(function(r){process.nextTick(e,r)})}});var em=m(eT=>{l();"use strict";eT.getCallback=function(t,e){return typeof t=="function"?t:e};eT.getOptions=function(t){return typeof t=="object"&&t!==null?t:{}}});var Gre=m((k5t,Hre)=>{l();"use strict";var tm=f8().WriteError,nLe=JI(),sLe=em().getCallback,oLe=em().getOptions;function rm(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}rm.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(i){throw new tm(i)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this};rm.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(r){throw new tm(r)}return this.ops.push({...e,type:"del",key:t}),this.length++,this};rm.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new tm(t)}return this.ops=[],this.length=0,this};rm.prototype.write=function(t,e){let r=this.db,i=this.ops;e=sLe(t,e),e=nLe.fromCallback(e),t=oLe(t);try{this.batch.write(t,function(n){if(n)return e(new tm(n));r.emit("batch",i),e()})}catch(n){throw new tm(n)}return e.promise};Hre.exports=rm});var Yre=m((D5t,Wre)=>{l();"use strict";var $re=H5();Wre.exports=function(t,...e){e.length===0?$re(t):$re(()=>t(...e))}});var Jre=m((B5t,Zre)=>{l();"use strict";var l8=br().EventEmitter,aLe=pte().inherits,Xre=Bte(),cLe=Lre(),uLe=Gre(),Qp=f8(),fLe=yI(),$d=JI(),im=em().getCallback,Zp=em().getOptions,d8=Yre(),h8=Qp.WriteError,Qre=Qp.ReadError,lLe=Qp.NotFoundError,dLe=Qp.OpenError,hLe=Qp.InitializationError;function wr(t,e,r){if(!(this instanceof wr))return new wr(t,e,r);let i;if(l8.call(this),this.setMaxListeners(1/0),typeof e=="function"&&(r=e,e={}),e=e||{},!t||typeof t!="object"){if(i=new hLe("First argument must be an abstract-leveldown compliant store"),typeof r=="function")return d8(r,i);throw i}if(typeof t.status!="string")throw new Error(".status required, old abstract-leveldown");this.options=Zp(e),this._db=t,this.db=new Xre(t),this.open(r||(n=>{n&&this.emit("error",n)})),this.supports=fLe(this.db.supports,{status:!1,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(let n of Object.keys(this.supports.additionalMethods))this[n]==null&&(this[n]=function(...s){return this.db[n](...s)})}wr.prototype.emit=l8.prototype.emit;wr.prototype.once=l8.prototype.once;aLe(wr,l8);wr.prototype.open=function(t,e){return typeof t=="function"&&(e=t,t=null),e=$d.fromCallback(e),t||(t=this.options),this.isOpen()?(d8(e,null,this),e.promise):this._isOpening()?(this.once("open",()=>{e(null,this)}),e.promise):(this.emit("opening"),this.db.open(t,r=>{if(r)return e(new dLe(r));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")}),e.promise)};wr.prototype.close=function(t){return t=$d.fromCallback(t),this.isOpen()?(this.db.close((e,...r)=>{this.emit("closed"),t(e,...r)}),this.emit("closing"),this.db=new Xre(this._db)):this.isClosed()?d8(t):this.db.status==="closing"?this.once("closed",t):this._isOpening()&&this.once("open",()=>{this.close(t)}),t.promise};wr.prototype.isOpen=function(){return this.db.status==="open"};wr.prototype._isOpening=function(){return this.db.status==="opening"};wr.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)};wr.prototype.get=function(t,e,r){return r=im(e,r),r=$d.fromCallback(r),nm(this,r)||(e=Zp(e),this.db.get(t,e,function(i,n){if(i)return/notfound/i.test(i)||i.notFound?i=new lLe("Key not found in database ["+t+"]",i):i=new Qre(i),r(i);r(null,n)})),r.promise};wr.prototype.put=function(t,e,r,i){return i=im(r,i),i=$d.fromCallback(i),nm(this,i)||(r=Zp(r),this.db.put(t,e,r,n=>{if(n)return i(new h8(n));this.emit("put",t,e),i()})),i.promise};wr.prototype.del=function(t,e,r){return r=im(e,r),r=$d.fromCallback(r),nm(this,r)||(e=Zp(e),this.db.del(t,e,i=>{if(i)return r(new h8(i));this.emit("del",t),r()})),r.promise};wr.prototype.batch=function(t,e,r){return arguments.length?(typeof t=="function"?r=t:r=im(e,r),r=$d.fromCallback(r),nm(this,r)||(e=Zp(e),this.db.batch(t,e,i=>{if(i)return r(new h8(i));this.emit("batch",t),r()})),r.promise):new uLe(this)};wr.prototype.iterator=function(t){return this.db.iterator(t)};wr.prototype.clear=function(t,e){return e=im(t,e),t=Zp(t),e=$d.fromCallback(e),nm(this,e)||this.db.clear(t,r=>{if(r)return e(new h8(r));this.emit("clear",t),e()}),e.promise};wr.prototype.readStream=wr.prototype.createReadStream=function(t){return t=Object.assign({keys:!0,values:!0},t),typeof t.limit!="number"&&(t.limit=-1),new cLe(this.db.iterator(t),t)};wr.prototype.keyStream=wr.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))};wr.prototype.valueStream=wr.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))};wr.prototype.toString=function(){return"LevelUP"};wr.prototype.type="levelup";function nm(t,e){if(!t._isOpening()&&!t.isOpen())return d8(e,new Qre("Database is not open")),!0}wr.errors=Qp;Zre.exports=wr});var eie=m(wu=>{l();"use strict";var{Buffer:tT}=Ht();wu.utf8=wu["utf-8"]={encode:function(t){return rT(t)?t:String(t)},decode:p8,buffer:!1,type:"utf8"};wu.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"};wu.binary={encode:function(t){return rT(t)?t:tT.from(t)},decode:p8,buffer:!0,type:"binary"};wu.none={encode:p8,decode:p8,buffer:!1,type:"id"};wu.id=wu.none;var pLe=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(let t of pLe)wu[t]={encode:function(e){return rT(e)?e:tT.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function p8(t){return t}function rT(t){return t==null||tT.isBuffer(t)}});var rie=m((M5t,tie)=>{l();"use strict";var iT=eie(),yLe=new Set(["lt","gt","lte","gte"]);tie.exports=zn;function zn(t){if(!(this instanceof zn))return new zn(t);this.opts=t||{},this.encodings=iT}zn.prototype._encoding=function(t){return typeof t=="string"&&(t=iT[t]),t||(t=iT.id),t};zn.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)};zn.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)};zn.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)};zn.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)};zn.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)};zn.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)};zn.prototype.encodeBatch=function(t,e){return t.map(r=>{let i={type:r.type,key:this.encodeKey(r.key,e,r)};return this.keyAsBuffer(e,r)&&(i.keyEncoding="binary"),r.prefix&&(i.prefix=r.prefix),"value"in r&&(i.value=this.encodeValue(r.value,e,r),this.valueAsBuffer(e,r)&&(i.valueEncoding="binary")),i})};zn.prototype.encodeLtgt=function(t){let e={};for(let r of Object.keys(t)){if(r==="start"||r==="end")throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=yLe.has(r)?this.encodeKey(t[r],t):t[r]}return e};zn.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}};zn.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer};zn.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}});var cie=m((L5t,aie)=>{l();"use strict";var iie=Yf().AbstractLevelDOWN,nie=Yf().AbstractChainedBatch,sie=Yf().AbstractIterator,nT=on(),gLe=rie(),oie=f8().EncodingError,mLe=["approximateSize","compactRange"];aie.exports=Pn;function Pn(t,e){if(!(this instanceof Pn))return new Pn(t,e);let r=t.supports||{},i=r.additionalMethods||{};iie.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},mLe.forEach(function(n){let s=typeof t[n]=="function";(i[n]||s)&&(this.supports.additionalMethods[n]=!0,this[n]=function(o,a,c,u){return o=this.codec.encodeKey(o,c),a=this.codec.encodeKey(a,c),this.db[n](o,a,c,u)})},this),e=e||{},typeof e.keyEncoding=="undefined"&&(e.keyEncoding="utf8"),typeof e.valueEncoding=="undefined"&&(e.valueEncoding="utf8"),this.db=t,this.codec=new gLe(e)}nT(Pn,iie);Pn.prototype.type="encoding-down";Pn.prototype._serializeKey=Pn.prototype._serializeValue=function(t){return t};Pn.prototype._open=function(t,e){this.db.open(t,e)};Pn.prototype._close=function(t){this.db.close(t)};Pn.prototype._put=function(t,e,r,i){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,i)};Pn.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,(i,n)=>{if(i)return r(i);try{n=this.codec.decodeValue(n,e)}catch(s){return r(new oie(s))}r(null,n)})};Pn.prototype._del=function(t,e,r){t=this.codec.encodeKey(t,e),this.db.del(t,e,r)};Pn.prototype._chainedBatch=function(){return new Jp(this)};Pn.prototype._batch=function(t,e,r){t=this.codec.encodeBatch(t,e),this.db.batch(t,e,r)};Pn.prototype._iterator=function(t){return t.keyAsBuffer=this.codec.keyAsBuffer(t),t.valueAsBuffer=this.codec.valueAsBuffer(t),new sm(this,t)};Pn.prototype._clear=function(t,e){t=this.codec.encodeLtgt(t),this.db.clear(t,e)};function sm(t,e){sie.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}nT(sm,sie);sm.prototype._next=function(t){this.it.next((e,r,i)=>{if(e)return t(e);try{this.keys&&typeof r!="undefined"?r=this.codec.decodeKey(r,this.opts):r=void 0,this.values&&typeof i!="undefined"?i=this.codec.decodeValue(i,this.opts):i=void 0}catch(n){return t(new oie(n))}t(null,r,i)})};sm.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)};sm.prototype._end=function(t){this.it.end(t)};function Jp(t,e){nie.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}nT(Jp,nie);Jp.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)};Jp.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)};Jp.prototype._clear=function(){this.batch.clear()};Jp.prototype._write=function(t,e){this.batch.write(t,e)}});var lie=m((q5t,fie)=>{l();"use strict";var uie=Jre(),bLe=cie();function vLe(t){function e(i,n,s){return typeof i=="function"?s=i:typeof n=="function"&&(s=n),r(n)||(n=r(i)?i:{}),uie(bLe(t(i,n),n),n,s)}function r(i){return typeof i=="object"&&i!==null}for(let i of["destroy","repair"])typeof t[i]=="function"&&(e[i]=function(...n){t[i](...n)});return e.errors=uie.errors,e}fie.exports=vLe});var hie=m(pi=>{l();pi.compare=function(t,e){if(Buffer.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};function die(t){return t!==void 0&&t!==""}function e1(t,e){return Object.hasOwnProperty.call(t,e)}function vc(t,e){return Object.hasOwnProperty.call(t,e)&&e}var wLe=pi.lowerBoundKey=function(t){return vc(t,"gt")||vc(t,"gte")||vc(t,"min")||(t.reverse?vc(t,"end"):vc(t,"start"))||void 0},sT=pi.lowerBound=function(t,e){var r=wLe(t);return r?t[r]:e},oT=pi.lowerBoundInclusive=function(t){return!e1(t,"gt")},aT=pi.upperBoundInclusive=function(t){return!e1(t,"lt")},_Le=pi.lowerBoundExclusive=function(t){return!oT(t)},ELe=pi.upperBoundExclusive=function(t){return!aT(t)},SLe=pi.upperBoundKey=function(t){return vc(t,"lt")||vc(t,"lte")||vc(t,"max")||(t.reverse?vc(t,"start"):vc(t,"end"))||void 0},cT=pi.upperBound=function(t,e){var r=SLe(t);return r?t[r]:e};pi.start=function(t,e){return t.reverse?cT(t,e):sT(t,e)};pi.end=function(t,e){return t.reverse?sT(t,e):cT(t,e)};pi.startInclusive=function(t){return t.reverse?aT(t):oT(t)};pi.endInclusive=function(t){return t.reverse?oT(t):aT(t)};function xLe(t){return t}pi.toLtgt=function(t,e,r,i,n){e=e||{},r=r||xLe;var s=arguments.length>3,o=pi.lowerBoundKey(t),a=pi.upperBoundKey(t);return o?o==="gt"?e.gt=r(t.gt,!1):e.gte=r(t[o],!1):s&&(e.gte=r(i,!1)),a?a==="lt"?e.lt=r(t.lt,!0):e.lte=r(t[a],!0):s&&(e.lte=r(n,!0)),t.reverse!=null&&(e.reverse=!!t.reverse),e1(e,"max")&&delete e.max,e1(e,"min")&&delete e.min,e1(e,"start")&&delete e.start,e1(e,"end")&&delete e.end,e};pi.contains=function(t,e,r){r=r||pi.compare;var i=sT(t);if(die(i)){var n=r(e,i);if(n<0||n===0&&_Le(t))return!1}var s=cT(t);if(die(s)){var n=r(e,s);if(n>0||n===0&&ELe(t))return!1}return!0};pi.filter=function(t,e){return function(r){return pi.contains(t,r,e)}}});var uT=m((U5t,pie)=>{l();"use strict";var y8=hie(),el=Symbol("none");pie.exports=function(e){let r=y8.lowerBound(e,el),i=y8.upperBound(e,el),n=y8.lowerBoundExclusive(e,el),s=y8.upperBoundExclusive(e,el);return r!==el&&i!==el?IDBKeyRange.bound(r,i,n,s):r!==el?IDBKeyRange.lowerBound(r,n):i!==el?IDBKeyRange.upperBound(i,s):null}});var fT=m((F5t,gie)=>{l();"use strict";var g8=Ht().Buffer,ALe=function(){if(globalThis.TextDecoder){let t=new TextDecoder("utf-8");return t.decode.bind(t)}else return function(e){return yie(e).toString()}}(),ILe=function(){if(globalThis.TextDecoder){let t=new TextDecoder("utf-8");return t.decode.bind(t)}else return function(e){return g8.from(e).toString()}}();function yie(t){let e=g8.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}gie.exports=function(t,e){return t instanceof Uint8Array?e?yie(t):ALe(t):t instanceof ArrayBuffer?e?g8.from(t):ILe(t):e?g8.from(String(t)):String(t)}});var wie=m((K5t,vie)=>{l();"use strict";var TLe=on(),mie=Yf().AbstractIterator,RLe=uT(),bie=fT(),PLe=function(){};vie.exports=ua;function ua(t,e,r){if(mie.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,this._limit===0){this._completed=!0;return}let i;try{i=RLe(r)}catch(n){this._completed=!0;return}this.createIterator(e,i,r.reverse)}TLe(ua,mie);ua.prototype.createIterator=function(t,e,r){let i=this.db.db.transaction([t],"readonly"),s=i.objectStore(t).openCursor(e,r?"prev":"next");s.onsuccess=o=>{let a=o.target.result;a&&this.onItem(a)},this._transaction=i,i.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},i.oncomplete=()=>{this.onComplete()}};ua.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();this._keys&&e!==void 0?e=this._deserializeKey(e,this._keyAsBuffer):e=void 0,this._values&&r!==void 0?r=this._deserializeValue(r,this._valueAsBuffer):r=void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t};ua.prototype._deserializeKey=bie;ua.prototype._deserializeValue=bie;ua.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=PLe,this.onAbort=t,this.onComplete=t}});var Sie=m((V5t,Eie)=>{l();"use strict";var _ie=Ht().Buffer,CLe=function(){if(globalThis.TextEncoder){let t=new TextEncoder("utf-8");return t.encode.bind(t)}else return _ie.from}();Eie.exports=function(t,e){return e?_ie.isBuffer(t)?t:CLe(String(t)):String(t)}});var xie=m(m8=>{l();"use strict";var OLe=Ht().Buffer;m8.test=function(t){return function(r){try{return r.cmp(t,0),!0}catch(i){return!1}}};m8.bufferKeys=m8.test(OLe.alloc(0))});var Iie=m((H5t,Aie)=>{l();"use strict";Aie.exports=function(e,r,i,n,s){if(n.limit===0)return e._nextTick(s);let o=e.db.transaction([r],"readwrite"),a=o.objectStore(r),c=0;o.oncomplete=function(){s()},o.onabort=function(){s(o.error||new Error("aborted by user"))};let u=a.openKeyCursor?"openKeyCursor":"openCursor",f=n.reverse?"prev":"next";a[u](i,f).onsuccess=function(d){let h=d.target.result;h&&(a.delete(h.key).onsuccess=function(){(n.limit<=0||++c{l();"use strict";Cie.exports=Bi;var Tie=Yf().AbstractLevelDOWN,kLe=on(),DLe=wie(),Rie=Sie(),lT=fT(),BLe=xie(),NLe=Iie(),MLe=uT(),Pie="level-js-";function Bi(t,e){if(!(this instanceof Bi))return new Bi(t,e);if(Tie.call(this,{bufferKeys:BLe.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0}),e=e||{},typeof t!="string")throw new Error("constructor requires a location string argument");this.location=t,this.prefix=e.prefix==null?Pie:e.prefix,this.version=parseInt(e.version||1,10)}kLe(Bi,Tie);Bi.prototype.type="level-js";Bi.prototype._open=function(t,e){let r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=i=>{let n=i.target.result;n.objectStoreNames.contains(this.location)||n.createObjectStore(this.location)}};Bi.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)};Bi.prototype.await=function(t,e){let r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}};Bi.prototype._get=function(t,e,r){let i=this.store("readonly"),n;try{n=i.get(t)}catch(s){return this._nextTick(r,s)}this.await(n,function(s,o){if(s)return r(s);if(o===void 0)return r(new Error("NotFound"));r(null,lT(o,e.asBuffer))})};Bi.prototype._del=function(t,e,r){let i=this.store("readwrite"),n;try{n=i.delete(t)}catch(s){return this._nextTick(r,s)}this.await(n,r)};Bi.prototype._put=function(t,e,r,i){let n=this.store("readwrite"),s;try{s=n.put(e,t)}catch(o){return this._nextTick(i,o)}this.await(s,i)};Bi.prototype._serializeKey=function(t){return Rie(t,this.supports.bufferKeys)};Bi.prototype._serializeValue=function(t){return Rie(t,!0)};Bi.prototype._iterator=function(t){return new DLe(this,this.location,t)};Bi.prototype._batch=function(t,e,r){if(t.length===0)return this._nextTick(r);let i=this.store("readwrite"),n=i.transaction,s=0,o;n.onabort=function(){r(o||n.error||new Error("aborted by user"))},n.oncomplete=function(){r()};function a(){let c=t[s++],u=c.key,f;try{f=c.type==="del"?i.delete(u):i.put(c.value,u)}catch(d){o=d,n.abort();return}s=0)return NLe(this,this.location,r,t,e);try{let n=this.store("readwrite");i=r?n.delete(r):n.clear()}catch(n){return this._nextTick(e,n)}this.await(i,e)};Bi.prototype._close=function(t){this.db.close(),this._nextTick(t)};Bi.prototype.upgrade=function(t){if(this.status!=="open")return this._nextTick(t,new Error("cannot upgrade() before open()"));let e=this.iterator(),r={},i=this;e._deserializeKey=e._deserializeValue=a,n();function n(c){if(c)return o(c);e.next(s)}function s(c,u,f){if(c||u===void 0)return o(c);let d=i._serializeKey(lT(u,!0)),h=i._serializeValue(lT(f,!0));i._batch([{type:"del",key:u},{type:"put",key:d,value:h}],r,n)}function o(c){e.end(function(u){t(c||u)})}function a(c){return c}};Bi.destroy=function(t,e,r){typeof e=="function"&&(r=e,e=Pie);let i=indexedDB.deleteDatabase(e+t);i.onsuccess=function(){r()},i.onerror=function(n){r(n)}}});var Die=m(($5t,kie)=>{l();kie.exports=lie()(Oie())});var qie=m((Q5t,Lie)=>{l();"use strict";function Mie(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function qLe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Mie(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),Mie(new n,r)}}Lie.exports=qLe});var wT=m((d8t,zie)=>{l();"use strict";function Vie(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function FLe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Vie(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),Vie(new n,r)}}zie.exports=FLe});var _T=m((h8t,Wie)=>{l();"use strict";var Hie=()=>{},Gie=Symbol.for("@libp2p/js-interfaces/topology"),$ie=class{constructor({min:e=0,max:r=1/0,handlers:i={}}){this.min=e,this.max=r,this._onConnect=i.onConnect||Hie,this._onDisconnect=i.onDisconnect||Hie,this.peers=new Set}get[Symbol.toStringTag](){return"Topology"}get[Gie](){return!0}static isTopology(e){return Boolean(e&&e[Gie])}set registrar(e){this._registrar=e}disconnect(e){this._onDisconnect(e)}};Wie.exports=$ie});var b8=m((p8t,Qie)=>{l();"use strict";var KLe=_T(),Yie=Symbol.for("@libp2p/js-interfaces/topology/multicodec-topology"),Xie=class extends KLe{constructor({min:e,max:r,multicodecs:i,handlers:n}){super({min:e,max:r,handlers:n});if(!i)throw new Error("one or more multicodec should be provided");if(!n)throw new Error("the handlers should be provided");if(typeof n.onConnect!="function")throw new Error("the 'onConnect' handler must be provided");if(typeof n.onDisconnect!="function")throw new Error("the 'onDisconnect' handler must be provided");this.multicodecs=Array.isArray(i)?i:[i],this._registrar=void 0,this._onProtocolChange=this._onProtocolChange.bind(this),this._onPeerConnect=this._onPeerConnect.bind(this)}get[Symbol.toStringTag](){return"Topology"}get[Yie](){return!0}static isMulticodecTopology(e){return Boolean(e&&e[Yie])}set registrar(e){this._registrar=e,this._registrar.peerStore.on("change:protocols",this._onProtocolChange),this._registrar.connectionManager.on("peer:connect",this._onPeerConnect),this._updatePeers(this._registrar.peerStore.peers.values())}_updatePeers(e){for(let{id:r,protocols:i}of e)if(this.multicodecs.filter(n=>i.includes(n)).length){this.peers.add(r.toB58String());let n=this._registrar.getConnection(r);n&&this._onConnect(r,n)}else this.peers.delete(r.toB58String())}_onProtocolChange({peerId:e,protocols:r}){let i=this.peers.has(e.toB58String()),n=r.filter(s=>this.multicodecs.includes(s));i&&n.length===0&&this._onDisconnect(e);for(let s of r)if(this.multicodecs.includes(s)){let o=this._registrar.peerStore.get(e);this._updatePeers([o]);return}}_onPeerConnect(e){let r=e.remotePeer,i=this._registrar.peerStore.protoBook.get(r);!i||this.multicodecs.find(n=>i.includes(n))&&(this.peers.add(r.toB58String()),this._onConnect(r,e))}};Qie.exports=Xie});var v8=m(Zie=>{l();"use strict";Zie.codes={ERR_INVALID_SIGNATURE_POLICY:"ERR_INVALID_SIGNATURE_POLICY",ERR_UNHANDLED_SIGNATURE_POLICY:"ERR_UNHANDLED_SIGNATURE_POLICY",ERR_MISSING_SIGNATURE:"ERR_MISSING_SIGNATURE",ERR_MISSING_SEQNO:"ERR_MISSING_SEQNO",ERR_INVALID_SIGNATURE:"ERR_INVALID_SIGNATURE",ERR_UNEXPECTED_FROM:"ERR_UNEXPECTED_FROM",ERR_UNEXPECTED_SIGNATURE:"ERR_UNEXPECTED_SIGNATURE",ERR_UNEXPECTED_KEY:"ERR_UNEXPECTED_KEY",ERR_UNEXPECTED_SEQNO:"ERR_UNEXPECTED_SEQNO"}});var ST=m((g8t,Jie)=>{l();"use strict";var rl=Vi(),r1=rl.Reader,ET=rl.Writer,It=rl.util,Ni=rl.roots["libp2p-pubsub-rpc"]||(rl.roots["libp2p-pubsub-rpc"]={});Ni.RPC=function(){function t(e){if(this.subscriptions=[],this.msgs=[],e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.subscriptions&&s.subscriptions.length||(s.subscriptions=[]),s.subscriptions.push(Ni.RPC.SubOpts.decode(r,r.uint32()));break;case 2:s.msgs&&s.msgs.length||(s.msgs=[]),s.msgs.push(Ni.RPC.Message.decode(r,r.uint32()));break;default:r.skipType(o&7);break}}return s},t.fromObject=function(r){if(r instanceof Ni.RPC)return r;var i=new Ni.RPC;if(r.subscriptions){if(!Array.isArray(r.subscriptions))throw TypeError(".RPC.subscriptions: array expected");i.subscriptions=[];for(var n=0;n>>3){case 1:a.subscribe=n.bool();break;case 2:a.topicID=n.string();break;default:n.skipType(c&7);break}}return a},e.fromObject=function(n){if(n instanceof Ni.RPC.SubOpts)return n;var s=new Ni.RPC.SubOpts;return n.subscribe!=null&&(s.subscribe=Boolean(n.subscribe)),n.topicID!=null&&(s.topicID=String(n.topicID)),s},e.toObject=function(n,s){s||(s={});var o={};return n.subscribe!=null&&n.hasOwnProperty("subscribe")&&(o.subscribe=n.subscribe,s.oneofs&&(o._subscribe="subscribe")),n.topicID!=null&&n.hasOwnProperty("topicID")&&(o.topicID=n.topicID,s.oneofs&&(o._topicID="topicID")),o},e.prototype.toJSON=function(){return this.constructor.toObject(this,rl.util.toJSONOptions)},e}(),t.Message=function(){function e(i){if(this.topicIDs=[],i)for(var n=Object.keys(i),s=0;s>>3){case 1:a.from=n.bytes();break;case 2:a.data=n.bytes();break;case 3:a.seqno=n.bytes();break;case 4:a.topicIDs&&a.topicIDs.length||(a.topicIDs=[]),a.topicIDs.push(n.string());break;case 5:a.signature=n.bytes();break;case 6:a.key=n.bytes();break;default:n.skipType(c&7);break}}return a},e.fromObject=function(n){if(n instanceof Ni.RPC.Message)return n;var s=new Ni.RPC.Message;if(n.from!=null&&(typeof n.from=="string"?It.base64.decode(n.from,s.from=It.newBuffer(It.base64.length(n.from)),0):n.from.length&&(s.from=n.from)),n.data!=null&&(typeof n.data=="string"?It.base64.decode(n.data,s.data=It.newBuffer(It.base64.length(n.data)),0):n.data.length&&(s.data=n.data)),n.seqno!=null&&(typeof n.seqno=="string"?It.base64.decode(n.seqno,s.seqno=It.newBuffer(It.base64.length(n.seqno)),0):n.seqno.length&&(s.seqno=n.seqno)),n.topicIDs){if(!Array.isArray(n.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");s.topicIDs=[];for(var o=0;o{l();"use strict";var ene=Es(),{Buffer:VLe}=Ht(),tne=(t,e,r)=>{let i=ene.encode(t,e,r);return tne.bytes=ene.encode.bytes,e||VLe.from(i)};rne.exports=tne});var cne=m((b8t,w8)=>{l();"use strict";var{Buffer:ine}=Ht(),nne=Rn(),sne=xT(),AT=8,one=10*1024;function ane(t){t=t||{};let e=Math.max(t.poolSize||one,t.minPoolSize||AT),r=t.lengthEncoder||sne;return async function*(n){let s=ine.alloc(e),o=0;for await(let a of n){r(a.length,s,o);let c=s.slice(o,o+r.bytes);o+=r.bytes,s.length-o{e=e||{};let r=e.lengthEncoder||sne;return new nne([r(t.length),t.slice()])};w8.exports=ane;w8.exports.MIN_POOL_SIZE=AT;w8.exports.DEFAULT_POOL_SIZE=one});var IT=m((v8t,lne)=>{l();"use strict";var une=Es(),{Buffer:zLe}=Ht(),HLe=t=>new Proxy({},{get:(e,r)=>r[0]==="l"?t[r]:t.get(parseInt(r))}),fne=t=>{let e=une.decode(zLe.isBuffer(t)?t:HLe(t));return fne.bytes=une.decode.bytes,e};lne.exports=fne});var yne=m((w8t,_8)=>{l();"use strict";var{Buffer:GLe}=Ht(),TT=Rn(),$Le=IT(),dne=8,hne=1024*1024*4,pne=GLe.alloc(0),il={LENGTH:"readLength",DATA:"readData"},WLe={[il.LENGTH]:(t,e,r,i)=>{e=e.append(t);let n;try{n=i.lengthDecoder(e)}catch(s){if(e.length>i.maxLengthLength)throw Object.assign(s,{message:"message length too long",code:"ERR_MSG_LENGTH_TOO_LONG"});if(s instanceof RangeError)return{mode:il.LENGTH,buffer:e,chunk:void 0,state:void 0,data:void 0};throw s}if(n>i.maxDataLength)throw Object.assign(new Error("message data too long"),{code:"ERR_MSG_DATA_TOO_LONG"});return t=e.shallowSlice(i.lengthDecoder.bytes),e=new TT,i.onLength&&i.onLength(n),n<=0?(i.onData&&i.onData(pne),{mode:il.LENGTH,chunk:t,buffer:e,data:pne}):{mode:il.DATA,chunk:t,buffer:e,state:{dataLength:n},data:void 0}},[il.DATA]:(t,e,r,i)=>{if(e=e.append(t),!r)throw new Error("state is required");if(e.lengthn?e.shallowSlice(n):void 0;return e=new TT,i.onData&&i.onData(s),{mode:il.LENGTH,chunk:o,buffer:e,state:void 0,data:s}}};function RT(t){t=t||{};let e={lengthDecoder:t.lengthDecoder||$Le,maxLengthLength:t.maxLengthLength||dne,maxDataLength:t.maxDataLength||hne,onLength:t.onLength,onData:t.onData};return async function*(i){let n=new TT,s=il.LENGTH,o;for await(let a of i){let c=a;for(;c;){let u=WLe[s](c,n,o,e);s=u.mode,c=u.chunk,n=u.buffer,o=u.state,u.data&&(yield u.data)}}if(n.length)throw Object.assign(new Error("unexpected end of input"),{code:"ERR_UNEXPECTED_EOF"})}}RT.fromReader=(t,e)=>{let r=1,i={[Symbol.asyncIterator](){return this},next:async()=>{try{return await t.next(r)}catch(s){if(s.code==="ERR_UNDER_READ")return{done:!0,value:null};throw s}finally{r=1}}};return RT({...e||{},onLength:s=>{r=s}})(i)};_8.exports=RT;_8.exports.MAX_LENGTH_LENGTH=dne;_8.exports.MAX_DATA_LENGTH=hne});var bne=m((_8t,mne)=>{l();"use strict";var{Buffer:YLe}=Ht(),gne=(t,e,r)=>(e=e||YLe.allocUnsafe(4),e.writeInt32BE(t,r),e);gne.bytes=4;mne.exports=gne});var _ne=m((E8t,wne)=>{l();"use strict";var vne=t=>{if(t.length<4)throw RangeError("Could not decode int32BE");return t.readInt32BE(0)};vne.bytes=4;wne.exports=vne});var fa=m(Xd=>{l();"use strict";Xd.encode=cne();Xd.decode=yne();Xd.varintEncode=xT();Xd.varintDecode=IT();Xd.int32BEEncode=bne();Xd.int32BEDecode=_ne()});var E8=m((x8t,Ene)=>{l();Ene.exports=function(e){if(e){if(typeof e[Symbol.iterator]=="function")return e[Symbol.iterator]();if(typeof e[Symbol.asyncIterator]=="function")return e[Symbol.asyncIterator]();if(typeof e.next=="function")return e}throw new Error("argument is not an iterator or iterable")}});var xne=m((I8t,Sne)=>{l();Sne.exports=class extends Error{constructor(e,r){super(e||"The operation was aborted");this.type="aborted",this.code=r||"ABORT_ERR"}}});var wc=m((T8t,Qd)=>{l();var XLe=E8(),PT=xne(),Ane=(t,e,r)=>CT(t,Array.isArray(e)?e:[{signal:e,options:r}]),CT=(t,e)=>{t=XLe(t),e=e.map(({signal:i,options:n})=>({signal:i,options:n||{}}));async function*r(){let i,n=()=>{i&&i()};for(let{signal:s}of e)s.addEventListener("abort",n);for(;;){let s;try{for(let{signal:a,options:c}of e)if(a.aborted){let{abortMessage:u,abortCode:f}=c;throw new PT(u,f)}let o=new Promise((a,c)=>{i=()=>{let{options:u}=e.find(({signal:h})=>h.aborted),{abortMessage:f,abortCode:d}=u;c(new PT(f,d))}});s=await Promise.race([o,t.next()]),i=null}catch(o){for(let{signal:u}of e)u.removeEventListener("abort",n);let a=e.find(({signal:u})=>u.aborted),c=o.type==="aborted"&&a;if(c&&a.options.onAbort&&await a.options.onAbort(t),typeof t.return=="function"&&await t.return(),c&&a.options.returnOnAbort)return;throw o}if(s.done)break;yield s.value}for(let{signal:s}of e)s.removeEventListener("abort",n)}return r()},Ine=(t,e,r)=>Tne(t,Array.isArray(e)?e:[{signal:e,options:r}]),Tne=(t,e)=>r=>t(CT(r,e)),QLe=(t,e,r)=>ZLe(t,Array.isArray(e)?e:[{signal:e,options:r}]),ZLe=(t,e)=>({sink:Tne(t.sink,e),source:CT(t.source,e)});Qd.exports=Ane;Qd.exports.AbortError=PT;Qd.exports.source=Ane;Qd.exports.sink=Ine;Qd.exports.transform=Ine;Qd.exports.duplex=QLe});var Dne=m((R8t,kne)=>{l();"use strict";var Rne=Ee(),JLe=Object.assign(Rne("libp2p-pubsub:peer-streams"),{error:Rne("libp2p-pubsub:peer-streams:err")}),{EventEmitter:eqe}=br(),Pne=fa(),tqe=nc(),{pipe:Cne}=Nr(),{source:rqe}=wc(),iqe=h0().default,One=class extends eqe{constructor({id:e,protocol:r}){super();this.id=e,this.protocol=r,this._rawOutboundStream=null,this._rawInboundStream=null,this._inboundAbortController=new iqe,this.outboundStream=null,this.inboundStream=null}get isReadable(){return Boolean(this.inboundStream)}get isWritable(){return Boolean(this.outboundStream)}write(e){if(!this.outboundStream){let r=this.id.toB58String();throw new Error("No writable connection to "+r)}this.outboundStream.push(e)}attachInboundStream(e){return this._rawInboundStream=e,this.inboundStream=rqe(Cne(this._rawInboundStream,Pne.decode()),this._inboundAbortController.signal,{returnOnAbort:!0}),this.emit("stream:inbound"),this.inboundStream}async attachOutboundStream(e){let r=this.outboundStream;this.outboundStream&&await this.outboundStream.end(),this._rawOutboundStream=e,this.outboundStream=tqe({onEnd:i=>{this._rawOutboundStream&&this._rawOutboundStream.reset&&this._rawOutboundStream.reset(),this._rawOutboundStream=null,this.outboundStream=null,i&&this.emit("close")}}),Cne(this.outboundStream,Pne.encode(),this._rawOutboundStream).catch(i=>{JLe.error(i)}),r||this.emit("stream:outbound")}close(){this.outboundStream&&this.outboundStream.end(),this.inboundStream&&this._inboundAbortController.abort(),this._rawOutboundStream=null,this.outboundStream=null,this._rawInboundStream=null,this.inboundStream=null,this.emit("close")}};kne.exports=One});var Nne=m(Bne=>{l();"use strict";var nqe={StrictSign:"StrictSign",StrictNoSign:"StrictNoSign"};Bne.SignaturePolicy=nqe});var OT=m((C8t,qne)=>{l();"use strict";var sqe=_y(),{toString:oqe}=(tt(),hr),{fromString:Mne}=(dt(),bi),Lne=it(),{sha256:aqe}=(di(),zs),cqe=()=>sqe(8),uqe=(t,e)=>{let r;t instanceof Uint8Array?r=Lne.createFromBytes(t).id:r=Lne.parse(t).id;let i=new Uint8Array(r.length+e.length);return i.set(r,0),i.set(e,r.length),i},fqe=t=>aqe.encode(t),lqe=(t,e)=>{let r;Array.isArray(e)?r=i=>e.indexOf(i)>-1:r=i=>e.has(i);for(let i of t)if(r(i))return!0;return!1},dqe=t=>Array.isArray(t)?t:[t],hqe=(t,e)=>{let r=Object.assign({},t);return t.from instanceof Uint8Array&&(r.from=oqe(t.from,"base58btc")),e&&(r.receivedFrom=e),r},pqe=t=>{let e=Object.assign({},t);return typeof t.from=="string"&&(e.from=Mne(t.from,"base58btc")),typeof t.data=="string"&&(e.data=Mne(t.data)),e};qne.exports={randomSeqno:cqe,msgId:uqe,noSignMsgId:fqe,anyMatch:lqe,ensureArray:dqe,normalizeInRpcMessage:hqe,normalizeOutRpcMessage:pqe}});var Vne=m((O8t,Kne)=>{l();"use strict";var kT=it(),{RPC:jne}=ST(),{concat:Une}=(mn(),$s),{fromString:yqe}=(dt(),bi),DT=yqe("libp2p-pubsub:"),{normalizeOutRpcMessage:gqe}=OT();async function mqe(t,e){let r=Une([DT,jne.Message.encode(gqe(e)).finish()]),i=await t.privKey.sign(r);return{...e,signature:i,key:t.pubKey.bytes}}async function bqe(t){if(!t.signature)throw new Error("Message must contain a signature to be verified");if(!t.from)throw new Error("Message must contain a from property to be verified");let e=Une([DT,jne.Message.encode({...t,from:kT.createFromB58String(t.from).toBytes(),signature:void 0,key:void 0}).finish()]);return(await Fne(t)).verify(e,t.signature)}async function Fne(t){if(!t.from)throw new Error("Could not get the public key from the originator id");let e=kT.createFromB58String(t.from);if(t.key){let r=await kT.createFromPubKey(t.key);if(r.equals(e))return r.pubKey;throw new Error("Public Key does not match the originator")}else{if(e.pubKey)return e.pubKey;throw new Error("Could not get the public key from the originator id")}}Kne.exports={messagePublicKey:Fne,signMessage:mqe,SignPrefix:DT,verifySignature:bqe}});var $ne=m((k8t,Gne)=>{l();"use strict";var zne=Ee(),{EventEmitter:vqe}=br(),us=wT(),{pipe:wqe}=Nr(),_qe=b8(),{codes:la}=v8(),{RPC:Hne}=ST(),Eqe=Dne(),{SignaturePolicy:Eu}=Nne(),nl=OT(),{signMessage:Sqe,verifySignature:xqe}=Vne(),S8=class extends vqe{constructor({debugName:e,multicodecs:r,libp2p:i,globalSignaturePolicy:n=Eu.StrictSign,canRelayMessage:s=!1,emitSelf:o=!1}){if(typeof e!="string")throw new Error("a debugname `string` is required");if(!r)throw new Error("multicodecs are required");if(!i)throw new Error("libp2p is required");super();if(this.log=Object.assign(zne(e),{err:zne(`${e}:error`)}),this.multicodecs=nl.ensureArray(r),this._libp2p=i,this.registrar=i.registrar,this.peerId=i.peerId,this.started=!1,this.topics=new Map,this.subscriptions=new Set,this.peers=new Map,!Eu[n])throw us(new Error("Invalid global signature policy"),la.ERR_INVALID_SIGNATURE_POLICY);this.globalSignaturePolicy=n,this.canRelayMessage=s,this.emitSelf=o,this.topicValidators=new Map,this._registrarId=void 0,this._onIncomingStream=this._onIncomingStream.bind(this),this._onPeerConnected=this._onPeerConnected.bind(this),this._onPeerDisconnected=this._onPeerDisconnected.bind(this)}start(){if(this.started)return;this.log("starting"),this.registrar.handle(this.multicodecs,this._onIncomingStream);let e=new _qe({multicodecs:this.multicodecs,handlers:{onConnect:this._onPeerConnected,onDisconnect:this._onPeerDisconnected}});this._registrarId=this.registrar.register(e),this.log("started"),this.started=!0}stop(){!this.started||(this.registrar.unregister(this._registrarId),this.log("stopping"),this.peers.forEach(e=>e.close()),this.peers=new Map,this.subscriptions=new Set,this.started=!1,this.log("stopped"))}_onIncomingStream({protocol:e,stream:r,connection:i}){let n=i.remotePeer,s=n.toB58String(),o=this._addPeer(n,e),a=o.attachInboundStream(r);this._processMessages(s,a,o)}async _onPeerConnected(e,r){let i=e.toB58String();this.log("connected",i);try{let{stream:n,protocol:s}=await r.newStream(this.multicodecs);await this._addPeer(e,s).attachOutboundStream(n)}catch(n){this.log.err(n)}this._sendSubscriptions(i,Array.from(this.subscriptions),!0)}_onPeerDisconnected(e,r){let i=e.toB58String();this.log("connection ended",i,r?r.message:""),this._removePeer(e)}_addPeer(e,r){let i=e.toB58String(),n=this.peers.get(i);if(n)return n;this.log("new peer",i);let s=new Eqe({id:e,protocol:r});return this.peers.set(i,s),s.once("close",()=>this._removePeer(e)),s}_removePeer(e){if(!e)return;let r=e.toB58String(),i=this.peers.get(r);if(!!i){i.removeAllListeners(),i.close(),this.log("delete peer",r),this.peers.delete(r);for(let n of this.topics.values())n.delete(r);return i}}async _processMessages(e,r,i){try{await wqe(r,async n=>{for await(let s of n){let o=s instanceof Uint8Array?s:s.slice(),a=this._decodeRpc(o);await this._processRpc(e,i,a)}})}catch(n){this._onPeerDisconnected(i.id,n)}}async _processRpc(e,r,i){this.log("rpc from",e);let n=i.subscriptions,s=i.msgs;if(n.length&&(n.forEach(o=>{this._processRpcSubOpt(e,o)}),this.emit("pubsub:subscription-change",r.id,n)),!this._acceptFrom(e))return this.log("received message from unacceptable peer %s",e),!1;if(s.length)for(let o of s){if(!(this.canRelayMessage||o.topicIDs&&o.topicIDs.some(c=>this.subscriptions.has(c)))){this.log("received message we didn't subscribe to. Dropping.");continue}let a=nl.normalizeInRpcMessage(o,e);await this._processRpcMessage(a)}return!0}_processRpcSubOpt(e,r){let i=r.topicID;if(!i)return;let n=this.topics.get(i);n||(n=new Set,this.topics.set(i,n)),r.subscribe?n.add(e):n.delete(e)}async _processRpcMessage(e){if(!(this.peerId.toB58String()===e.from&&!this.emitSelf)){try{await this.validate(e)}catch(r){this.log("Message is invalid, dropping it. %O",r);return}return this._emitMessage(e),this._publish(nl.normalizeOutRpcMessage(e))}}_emitMessage(e){e.topicIDs.forEach(r=>{this.subscriptions.has(r)&&this.emit(r,e)})}getMsgId(e){let r=this.globalSignaturePolicy;switch(r){case Eu.StrictSign:return nl.msgId(e.from,e.seqno);case Eu.StrictNoSign:return nl.noSignMsgId(e.data);default:throw us(new Error("Cannot get message id: unhandled signature policy: "+r),la.ERR_UNHANDLED_SIGNATURE_POLICY)}}_acceptFrom(e){return!0}_decodeRpc(e){return Hne.decode(e)}_encodeRpc(e){return Hne.encode(e).finish()}_sendRpc(e,r){let i=this.peers.get(e);if(!i||!i.isWritable){let n=`Cannot send RPC to ${e} as there is no open stream to it available`;this.log.err(n);return}i.write(this._encodeRpc(r))}_sendSubscriptions(e,r,i){return this._sendRpc(e,{subscriptions:r.map(n=>({topicID:n,subscribe:i}))})}async validate(e){let r=this.globalSignaturePolicy;switch(r){case Eu.StrictNoSign:if(e.from)throw us(new Error("StrictNoSigning: from should not be present"),la.ERR_UNEXPECTED_FROM);if(e.signature)throw us(new Error("StrictNoSigning: signature should not be present"),la.ERR_UNEXPECTED_SIGNATURE);if(e.key)throw us(new Error("StrictNoSigning: key should not be present"),la.ERR_UNEXPECTED_KEY);if(e.seqno)throw us(new Error("StrictNoSigning: seqno should not be present"),la.ERR_UNEXPECTED_SEQNO);break;case Eu.StrictSign:if(!e.signature)throw us(new Error("StrictSigning: Signing required and no signature was present"),la.ERR_MISSING_SIGNATURE);if(!e.seqno)throw us(new Error("StrictSigning: Signing required and no seqno was present"),la.ERR_MISSING_SEQNO);if(!await xqe(e))throw us(new Error("StrictSigning: Invalid message signature"),la.ERR_INVALID_SIGNATURE);break;default:throw us(new Error("Cannot validate message: unhandled signature policy: "+r),la.ERR_UNHANDLED_SIGNATURE_POLICY)}for(let i of e.topicIDs){let n=this.topicValidators.get(i);n&&await n(i,e)}}_buildMessage(e){let r=this.globalSignaturePolicy;switch(r){case Eu.StrictSign:return e.from=this.peerId.toB58String(),e.seqno=nl.randomSeqno(),Sqe(this.peerId,e);case Eu.StrictNoSign:return Promise.resolve(e);default:throw us(new Error("Cannot build message: unhandled signature policy: "+r),la.ERR_UNHANDLED_SIGNATURE_POLICY)}}getSubscribers(e){if(!this.started)throw us(new Error("not started yet"),"ERR_NOT_STARTED_YET");if(!e||typeof e!="string")throw us(new Error("a string topic must be provided"),"ERR_NOT_VALID_TOPIC");let r=this.topics.get(e);return r?Array.from(r):[]}async publish(e,r){if(!this.started)throw new Error("Pubsub has not started");this.log("publish",e,r);let n={receivedFrom:this.peerId.toB58String(),data:r,topicIDs:[e]},s=await this._buildMessage(n),o=nl.normalizeInRpcMessage(s);this.emitSelf&&this._emitMessage(o),await this._publish(o)}_publish(e){throw us(new Error("publish must be implemented by the subclass"),"ERR_NOT_IMPLEMENTED")}subscribe(e){if(!this.started)throw new Error("Pubsub has not started");this.subscriptions.has(e)||(this.subscriptions.add(e),this.peers.forEach((r,i)=>this._sendSubscriptions(i,[e],!0)))}unsubscribe(e){if(!this.started)throw new Error("Pubsub is not started");this.subscriptions.has(e)&&this.listenerCount(e)===0&&(this.subscriptions.delete(e),this.peers.forEach((r,i)=>this._sendSubscriptions(i,[e],!1)))}getTopics(){if(!this.started)throw new Error("Pubsub is not started");return Array.from(this.subscriptions)}};S8.utils=nl;S8.SignaturePolicy=Eu;Gne.exports=S8});var Wne=m(x8=>{l();"use strict";Object.defineProperty(x8,"__esModule",{value:!0});x8.createGossipRpc=void 0;function Aqe(t=[],e={}){return{subscriptions:[],msgs:t,control:Object.assign({ihave:[],iwant:[],graft:[],prune:[]},e)}}x8.createGossipRpc=Aqe});var Yne=m(A8=>{l();"use strict";Object.defineProperty(A8,"__esModule",{value:!0});A8.shuffle=void 0;function Iqe(t){if(t.length<=1)return t;let e=()=>Math.floor(Math.random()*Math.floor(t.length));for(let r=0;r{l();"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ERR_TOPIC_VALIDATOR_IGNORE=Oe.ERR_TOPIC_VALIDATOR_REJECT=Oe.TimeCacheDuration=Oe.GossipsubIWantFollowupTime=Oe.GossipsubMaxIHaveMessages=Oe.GossipsubMaxIHaveLength=Oe.GossipsubGraftFloodThreshold=Oe.GossipsubOpportunisticGraftPeers=Oe.GossipsubOpportunisticGraftTicks=Oe.GossipsubDirectConnectInitialDelay=Oe.GossipsubDirectConnectTicks=Oe.GossipsubConnectionTimeout=Oe.GossipsubMaxPendingConnections=Oe.GossipsubConnectors=Oe.GossipsubPruneBackoffTicks=Oe.GossipsubPruneBackoff=Oe.GossipsubPrunePeers=Oe.GossipsubFanoutTTL=Oe.GossipsubHeartbeatInterval=Oe.GossipsubHeartbeatInitialDelay=Oe.GossipsubGossipRetransmission=Oe.GossipsubGossipFactor=Oe.GossipsubDlazy=Oe.GossipsubHistoryGossip=Oe.GossipsubHistoryLength=Oe.GossipsubDout=Oe.GossipsubDscore=Oe.GossipsubDhi=Oe.GossipsubDlo=Oe.GossipsubD=Oe.GossipsubIDv11=Oe.GossipsubIDv10=Oe.FloodsubID=Oe.minute=Oe.second=void 0;Oe.second=1e3;Oe.minute=60*Oe.second;Oe.FloodsubID="/floodsub/1.0.0";Oe.GossipsubIDv10="/meshsub/1.0.0";Oe.GossipsubIDv11="/meshsub/1.1.0";Oe.GossipsubD=6;Oe.GossipsubDlo=4;Oe.GossipsubDhi=12;Oe.GossipsubDscore=4;Oe.GossipsubDout=2;Oe.GossipsubHistoryLength=5;Oe.GossipsubHistoryGossip=3;Oe.GossipsubDlazy=6;Oe.GossipsubGossipFactor=.25;Oe.GossipsubGossipRetransmission=3;Oe.GossipsubHeartbeatInitialDelay=100;Oe.GossipsubHeartbeatInterval=Oe.second;Oe.GossipsubFanoutTTL=Oe.minute;Oe.GossipsubPrunePeers=16;Oe.GossipsubPruneBackoff=Oe.minute;Oe.GossipsubPruneBackoffTicks=15;Oe.GossipsubConnectors=8;Oe.GossipsubMaxPendingConnections=128;Oe.GossipsubConnectionTimeout=30*Oe.second;Oe.GossipsubDirectConnectTicks=300;Oe.GossipsubDirectConnectInitialDelay=Oe.second;Oe.GossipsubOpportunisticGraftTicks=60;Oe.GossipsubOpportunisticGraftPeers=2;Oe.GossipsubGraftFloodThreshold=10*Oe.second;Oe.GossipsubMaxIHaveLength=5e3;Oe.GossipsubMaxIHaveMessages=10;Oe.GossipsubIWantFollowupTime=3*Oe.second;Oe.TimeCacheDuration=120*1e3;Oe.ERR_TOPIC_VALIDATOR_REJECT="ERR_TOPIC_VALIDATOR_REJECT";Oe.ERR_TOPIC_VALIDATOR_IGNORE="ERR_TOPIC_VALIDATOR_IGNORE"});var Qne=m(I8=>{l();"use strict";Object.defineProperty(I8,"__esModule",{value:!0});I8.hasGossipProtocol=void 0;var Xne=Zd();function Tqe(t){return t===Xne.GossipsubIDv10||t===Xne.GossipsubIDv11}I8.hasGossipProtocol=Tqe});var Zne=m(T8=>{l();"use strict";Object.defineProperty(T8,"__esModule",{value:!0});T8.messageIdToString=void 0;var Rqe=(tt(),hr);function Pqe(t){return Rqe.toString(t,"base64")}T8.messageIdToString=Pqe});var Jd=m(_c=>{l();"use strict";var Cqe=_c&&_c.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),R8=_c&&_c.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cqe(e,t,r)};Object.defineProperty(_c,"__esModule",{value:!0});R8(Wne(),_c);R8(Yne(),_c);R8(Qne(),_c);R8(Zne(),_c)});var ese=m(i1=>{l();"use strict";var Oqe=i1&&i1.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(i1,"__esModule",{value:!0});i1.MessageCache=void 0;var P8=Jd(),Jne=class{constructor(e,r,i){this.msgs=new Map,this.peertx=new Map,this.history=[];for(let n=0;n{for(let s of n.topics)if(s===e){r.push(n.msgID);break}});return r}shift(){this.history[this.history.length-1].forEach(r=>{let i=P8.messageIdToString(r.msgID);this.msgs.delete(i),this.peertx.delete(i)}),this.history.pop(),this.history.unshift([])}};i1.MessageCache=Jne});var rse=m((tse,am)=>{l();(function(t,e){typeof define=="function"&&define.amd?define(["protobufjs/minimal"],e):typeof Ea=="function"&&typeof am=="object"&&am&&am.exports&&(am.exports=e(Vi()))})(tse,function(t){"use strict";var e=t.Reader,r=t.Writer,i=t.util,n=t.roots.default||(t.roots.default={});return n.RPC=function(){function s(a){if(this.subscriptions=[],this.msgs=[],a)for(var c=Object.keys(a),u=0;u>>3){case 1:d.subscriptions&&d.subscriptions.length||(d.subscriptions=[]),d.subscriptions.push(n.RPC.SubOpts.decode(c,c.uint32()));break;case 2:d.msgs&&d.msgs.length||(d.msgs=[]),d.msgs.push(n.RPC.Message.decode(c,c.uint32()));break;case 3:d.control=n.RPC.ControlMessage.decode(c,c.uint32());break;default:c.skipType(h&7);break}}return d},s.fromObject=function(c){if(c instanceof n.RPC)return c;var u=new n.RPC;if(c.subscriptions){if(!Array.isArray(c.subscriptions))throw TypeError(".RPC.subscriptions: array expected");u.subscriptions=[];for(var f=0;f>>3){case 1:p.subscribe=f.bool();break;case 2:p.topicID=f.string();break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.SubOpts)return f;var d=new n.RPC.SubOpts;return f.subscribe!=null&&(d.subscribe=Boolean(f.subscribe)),f.topicID!=null&&(d.topicID=String(f.topicID)),d},a.toObject=function(f,d){d||(d={});var h={};return f.subscribe!=null&&f.hasOwnProperty("subscribe")&&(h.subscribe=f.subscribe,d.oneofs&&(h._subscribe="subscribe")),f.topicID!=null&&f.hasOwnProperty("topicID")&&(h.topicID=f.topicID,d.oneofs&&(h._topicID="topicID")),h},a.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},a}(),s.Message=function(){function a(u){if(this.topicIDs=[],u)for(var f=Object.keys(u),d=0;d>>3){case 1:p.from=f.bytes();break;case 2:p.data=f.bytes();break;case 3:p.seqno=f.bytes();break;case 4:p.topicIDs&&p.topicIDs.length||(p.topicIDs=[]),p.topicIDs.push(f.string());break;case 5:p.signature=f.bytes();break;case 6:p.key=f.bytes();break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.Message)return f;var d=new n.RPC.Message;if(f.from!=null&&(typeof f.from=="string"?i.base64.decode(f.from,d.from=i.newBuffer(i.base64.length(f.from)),0):f.from.length&&(d.from=f.from)),f.data!=null&&(typeof f.data=="string"?i.base64.decode(f.data,d.data=i.newBuffer(i.base64.length(f.data)),0):f.data.length&&(d.data=f.data)),f.seqno!=null&&(typeof f.seqno=="string"?i.base64.decode(f.seqno,d.seqno=i.newBuffer(i.base64.length(f.seqno)),0):f.seqno.length&&(d.seqno=f.seqno)),f.topicIDs){if(!Array.isArray(f.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");d.topicIDs=[];for(var h=0;h>>3){case 1:h.ihave&&h.ihave.length||(h.ihave=[]),h.ihave.push(n.RPC.ControlIHave.decode(u,u.uint32()));break;case 2:h.iwant&&h.iwant.length||(h.iwant=[]),h.iwant.push(n.RPC.ControlIWant.decode(u,u.uint32()));break;case 3:h.graft&&h.graft.length||(h.graft=[]),h.graft.push(n.RPC.ControlGraft.decode(u,u.uint32()));break;case 4:h.prune&&h.prune.length||(h.prune=[]),h.prune.push(n.RPC.ControlPrune.decode(u,u.uint32()));break;default:u.skipType(p&7);break}}return h},a.fromObject=function(u){if(u instanceof n.RPC.ControlMessage)return u;var f=new n.RPC.ControlMessage;if(u.ihave){if(!Array.isArray(u.ihave))throw TypeError(".RPC.ControlMessage.ihave: array expected");f.ihave=[];for(var d=0;d>>3){case 1:p.topicID=f.string();break;case 2:p.messageIDs&&p.messageIDs.length||(p.messageIDs=[]),p.messageIDs.push(f.bytes());break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.ControlIHave)return f;var d=new n.RPC.ControlIHave;if(f.topicID!=null&&(d.topicID=String(f.topicID)),f.messageIDs){if(!Array.isArray(f.messageIDs))throw TypeError(".RPC.ControlIHave.messageIDs: array expected");d.messageIDs=[];for(var h=0;h>>3){case 1:h.messageIDs&&h.messageIDs.length||(h.messageIDs=[]),h.messageIDs.push(u.bytes());break;default:u.skipType(p&7);break}}return h},a.fromObject=function(u){if(u instanceof n.RPC.ControlIWant)return u;var f=new n.RPC.ControlIWant;if(u.messageIDs){if(!Array.isArray(u.messageIDs))throw TypeError(".RPC.ControlIWant.messageIDs: array expected");f.messageIDs=[];for(var d=0;d>>3){case 1:p.topicID=f.string();break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.ControlGraft)return f;var d=new n.RPC.ControlGraft;return f.topicID!=null&&(d.topicID=String(f.topicID)),d},a.toObject=function(f,d){d||(d={});var h={};return f.topicID!=null&&f.hasOwnProperty("topicID")&&(h.topicID=f.topicID,d.oneofs&&(h._topicID="topicID")),h},a.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},a}(),s.ControlPrune=function(){function a(u){if(this.peers=[],u)for(var f=Object.keys(u),d=0;d>>3){case 1:p.topicID=f.string();break;case 2:p.peers&&p.peers.length||(p.peers=[]),p.peers.push(n.RPC.PeerInfo.decode(f,f.uint32()));break;case 3:p.backoff=f.uint64();break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.ControlPrune)return f;var d=new n.RPC.ControlPrune;if(f.topicID!=null&&(d.topicID=String(f.topicID)),f.peers){if(!Array.isArray(f.peers))throw TypeError(".RPC.ControlPrune.peers: array expected");d.peers=[];for(var h=0;h>>0,f.backoff.high>>>0).toNumber(!0))),d},a.toObject=function(f,d){d||(d={});var h={};if((d.arrays||d.defaults)&&(h.peers=[]),f.topicID!=null&&f.hasOwnProperty("topicID")&&(h.topicID=f.topicID,d.oneofs&&(h._topicID="topicID")),f.peers&&f.peers.length){h.peers=[];for(var p=0;p>>0,f.backoff.high>>>0).toNumber(!0):f.backoff,d.oneofs&&(h._backoff="backoff")),h},a.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},a}(),s.PeerInfo=function(){function a(u){if(u)for(var f=Object.keys(u),d=0;d>>3){case 1:p.peerID=f.bytes();break;case 2:p.signedPeerRecord=f.bytes();break;default:f.skipType(y&7);break}}return p},a.fromObject=function(f){if(f instanceof n.RPC.PeerInfo)return f;var d=new n.RPC.PeerInfo;return f.peerID!=null&&(typeof f.peerID=="string"?i.base64.decode(f.peerID,d.peerID=i.newBuffer(i.base64.length(f.peerID)),0):f.peerID.length&&(d.peerID=f.peerID)),f.signedPeerRecord!=null&&(typeof f.signedPeerRecord=="string"?i.base64.decode(f.signedPeerRecord,d.signedPeerRecord=i.newBuffer(i.base64.length(f.signedPeerRecord)),0):f.signedPeerRecord.length&&(d.signedPeerRecord=f.signedPeerRecord)),d},a.toObject=function(f,d){d||(d={});var h={};return f.peerID!=null&&f.hasOwnProperty("peerID")&&(h.peerID=d.bytes===String?i.base64.encode(f.peerID,0,f.peerID.length):d.bytes===Array?Array.prototype.slice.call(f.peerID):f.peerID,d.oneofs&&(h._peerID="peerID")),f.signedPeerRecord!=null&&f.hasOwnProperty("signedPeerRecord")&&(h.signedPeerRecord=d.bytes===String?i.base64.encode(f.signedPeerRecord,0,f.signedPeerRecord.length):d.bytes===Array?Array.prototype.slice.call(f.signedPeerRecord):f.signedPeerRecord,d.oneofs&&(h._signedPeerRecord="signedPeerRecord")),h},a.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},a}(),s}(),n})});var BT=m(C8=>{l();"use strict";Object.defineProperty(C8,"__esModule",{value:!0});C8.getGossipPeers=void 0;var ise=Jd();function kqe(t,e,r,i=()=>!0){let n=t.topics.get(e);if(!n)return new Set;let s=[];return n.forEach(o=>{let a=t.peers.get(o);!a||ise.hasGossipProtocol(a.protocol)&&i(o)&&s.push(o)}),s=ise.shuffle(s),r>0&&s.length>r&&(s=s.slice(0,r)),new Set(s)}C8.getGossipPeers=kqe});var sse=m(Ec=>{l();"use strict";var Dqe=Ec&&Ec.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Bqe=Ec&&Ec.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Nqe=Ec&&Ec.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Dqe(e,t,r);return Bqe(e,t),e};Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Heartbeat=void 0;var cm=Nqe(Zd()),O8=BT(),Mqe=Jd(),nse=class{constructor(e){this.gossipsub=e}start(){if(this._heartbeatTimer)return;let e=this._heartbeat.bind(this),r=setTimeout(()=>{e(),this._heartbeatTimer.runPeriodically(e,cm.GossipsubHeartbeatInterval)},cm.GossipsubHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:(i,n)=>{this._heartbeatTimer._intervalId=setInterval(i,n)},cancel:()=>{clearTimeout(r),clearInterval(this._heartbeatTimer._intervalId)}}}stop(){!this._heartbeatTimer||(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}_heartbeat(){let{D:e,Dlo:r,Dhi:i,Dscore:n,Dout:s}=this.gossipsub._options;this.gossipsub.heartbeatTicks++;let o=new Map,a=h=>{let p=o.get(h);return p===void 0&&(p=this.gossipsub.score.score(h),o.set(h,p)),p},c=new Map,u=new Map,f=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach((h,p)=>{let y=E=>{this.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",E,p),this.gossipsub.score.prune(E,p),this.gossipsub._addBackoff(E,p),h.delete(E);let v=u.get(E);v?v.push(p):u.set(E,[p])},b=E=>{this.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",E,p),this.gossipsub.score.graft(E,p),h.add(E);let v=c.get(E);v?v.push(p):c.set(E,[p])};if(h.forEach(E=>{let v=a(E);v<0&&(this.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",E,v,p),y(E),f.set(E,!0))}),h.size!h.has(R)&&!this.gossipsub.direct.has(R)&&(!E||!E.has(R))&&a(R)>=0).forEach(b)}if(h.size>i){let E=Array.from(h);E.sort((A,R)=>a(R)-a(A)),E=E.slice(0,n).concat(Mqe.shuffle(E.slice(n)));let v=0;if(E.slice(0,e).forEach(A=>{this.gossipsub.outbound.get(A)&&v++}),v{let D=E[F];for(let B=F;B>0;B--)E[B]=E[B-1];E[0]=D};if(v>0){let F=v;for(let D=1;D0;D++)this.gossipsub.outbound.get(E[D])&&(A(D),F--)}let R=e-v;for(let F=e;F0;F++)this.gossipsub.outbound.get(E[F])&&(A(F),R--)}E.slice(e).forEach(y)}if(h.size>=r){let E=0;if(h.forEach(v=>{this.gossipsub.outbound.get(v)&&E++}),E!h.has(R)&&!this.gossipsub.direct.has(R)&&(!A||!A.has(R))&&a(R)>=0).forEach(b)}}if(this.gossipsub.heartbeatTicks%cm.GossipsubOpportunisticGraftTicks==0&&h.size>1){let E=Array.from(h).sort((R,F)=>a(R)-a(F)),v=h.size/2,A=a(E[v]);if(Ah.has(D)&&!this.gossipsub.direct.has(D)&&(!R||!R.has(D))&&a(D)>A).forEach(D=>{this.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",D,p),b(D)})}}this.gossipsub._emitGossip(p,h)});let d=this.gossipsub._now();this.gossipsub.lastpub.forEach((h,p)=>{h+cm.GossipsubFanoutTTL{let y=this.gossipsub.topics.get(p);if(h.forEach(b=>{(!y.has(b)||a(b)!h.has(v)&&!this.gossipsub.direct.has(v)&&a(v)>=this.gossipsub._options.scoreThresholds.publishThreshold).forEach(v=>{h.add(v)})}this.gossipsub._emitGossip(p,h)}),this.gossipsub._sendGraftPrune(c,u,f),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}};Ec.Heartbeat=nse});var NT=m(n1=>{l();"use strict";Object.defineProperty(n1,"__esModule",{value:!0});n1.ERR_INVALID_PEER_SCORE_THRESHOLDS=n1.ERR_INVALID_PEER_SCORE_PARAMS=void 0;n1.ERR_INVALID_PEER_SCORE_PARAMS="ERR_INVALID_PEER_SCORE_PARAMS";n1.ERR_INVALID_PEER_SCORE_THRESHOLDS="ERR_INVALID_PEER_SCORE_THRESHOLDS"});var MT=m((V8t,ase)=>{l();"use strict";function ose(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Lqe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return ose(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),ose(new n,r)}}ase.exports=Lqe});var LT=m(Cn=>{l();"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.validateTopicScoreParams=Cn.validatePeerScoreParams=Cn.createTopicScoreParams=Cn.createPeerScoreParams=Cn.defaultTopicScoreParams=Cn.defaultPeerScoreParams=void 0;var cr=NT(),ur=MT();Cn.defaultPeerScoreParams={topics:{},topicScoreCap:10,appSpecificScore:()=>0,appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:3600*1e3};Cn.defaultTopicScoreParams={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3};function qqe(t={}){return Object.assign(Object.assign(Object.assign({},Cn.defaultPeerScoreParams),t),{topics:t.topics?Object.entries(t.topics).reduce((e,[r,i])=>(e[r]=cse(i),e),{}):{}})}Cn.createPeerScoreParams=qqe;function cse(t={}){return Object.assign(Object.assign({},Cn.defaultTopicScoreParams),t)}Cn.createTopicScoreParams=cse;function jqe(t){for(let[e,r]of Object.entries(t.topics))try{use(r)}catch(i){throw ur(new Error(`invalid score parameters for topic ${e}: ${i.message}`),cr.ERR_INVALID_PEER_SCORE_PARAMS)}if(t.topicScoreCap<0)throw ur(new Error("invalid topic score cap; must be positive (or 0 for no cap)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.appSpecificScore===null||t.appSpecificScore===void 0)throw ur(new Error("missing application specific score function"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.IPColocationFactorWeight>0)throw ur(new Error("invalid IPColocationFactorWeight; must be negative (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.IPColocationFactorWeight!==0&&t.IPColocationFactorThreshold<1)throw ur(new Error("invalid IPColocationFactorThreshold; must be at least 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.behaviourPenaltyWeight>0)throw ur(new Error("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.behaviourPenaltyWeight!==0&&(t.behaviourPenaltyDecay<=0||t.behaviourPenaltyDecay>=1))throw ur(new Error("invalid BehaviourPenaltyDecay; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.decayInterval<1e3)throw ur(new Error("invalid DecayInterval; must be at least 1s"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.decayToZero<=0||t.decayToZero>=1)throw ur(new Error("invalid DecayToZero; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS)}Cn.validatePeerScoreParams=jqe;function use(t){if(t.topicWeight<0)throw ur(new Error("invalid topic weight; must be >= 0"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.timeInMeshQuantum===0)throw ur(new Error("invalid TimeInMeshQuantum; must be non zero"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.timeInMeshWeight<0)throw ur(new Error("invalid TimeInMeshWeight; must be positive (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.timeInMeshWeight!==0&&t.timeInMeshQuantum<=0)throw ur(new Error("invalid TimeInMeshQuantum; must be positive"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.timeInMeshWeight!==0&&t.timeInMeshCap<=0)throw ur(new Error("invalid TimeInMeshCap; must be positive"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.firstMessageDeliveriesWeight<0)throw ur(new Error("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.firstMessageDeliveriesWeight!==0&&(t.firstMessageDeliveriesDecay<=0||t.firstMessageDeliveriesDecay>=1))throw ur(new Error("invalid FirstMessageDeliveriesDecay; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.firstMessageDeliveriesWeight!==0&&t.firstMessageDeliveriesCap<=0)throw ur(new Error("invalid FirstMessageDeliveriesCap; must be positive"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight>0)throw ur(new Error("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight!==0&&(t.meshMessageDeliveriesDecay<=0||t.meshMessageDeliveriesDecay>=1))throw ur(new Error("invalid MeshMessageDeliveriesDecay; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight!==0&&t.meshMessageDeliveriesCap<=0)throw ur(new Error("invalid MeshMessageDeliveriesCap; must be positive"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight!==0&&t.meshMessageDeliveriesThreshold<=0)throw ur(new Error("invalid MeshMessageDeliveriesThreshold; must be positive"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWindow<0)throw ur(new Error("invalid MeshMessageDeliveriesWindow; must be non-negative"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight!==0&&t.meshMessageDeliveriesActivation<1e3)throw ur(new Error("invalid MeshMessageDeliveriesActivation; must be at least 1s"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshFailurePenaltyWeight>0)throw ur(new Error("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshFailurePenaltyWeight!==0&&(t.meshFailurePenaltyDecay<=0||t.meshFailurePenaltyDecay>=1))throw ur(new Error("invalid MeshFailurePenaltyDecay; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.invalidMessageDeliveriesWeight>0)throw ur(new Error("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)"),cr.ERR_INVALID_PEER_SCORE_PARAMS);if(t.invalidMessageDeliveriesDecay<=0||t.invalidMessageDeliveriesDecay>=1)throw ur(new Error("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1"),cr.ERR_INVALID_PEER_SCORE_PARAMS)}Cn.validateTopicScoreParams=use});var fse=m(Su=>{l();"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.validatePeerScoreThresholds=Su.createPeerScoreThresholds=Su.defaultPeerScoreThresholds=void 0;var um=NT(),fm=MT();Su.defaultPeerScoreThresholds={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20};function Uqe(t={}){return Object.assign(Object.assign({},Su.defaultPeerScoreThresholds),t)}Su.createPeerScoreThresholds=Uqe;function Fqe(t){if(t.gossipThreshold>0)throw fm(new Error("invalid gossip threshold; it must be <= 0"),um.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.publishThreshold>0||t.publishThreshold>t.gossipThreshold)throw fm(new Error("invalid publish threshold; it must be <= 0 and <= gossip threshold"),um.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.graylistThreshold>0||t.graylistThreshold>t.publishThreshold)throw fm(new Error("invalid graylist threshold; it must be <= 0 and <= publish threshold"),um.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.acceptPXThreshold<0)throw fm(new Error("invalid accept PX threshold; it must be >= 0"),um.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.opportunisticGraftThreshold<0)throw fm(new Error("invalid opportunistic grafting threshold; it must be >= 0"),um.ERR_INVALID_PEER_SCORE_THRESHOLDS)}Su.validatePeerScoreThresholds=Fqe});var lse=m(sl=>{l();"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.ensureTopicStats=sl.createTopicStats=sl.createPeerStats=void 0;function Kqe(t={}){return Object.assign(Object.assign({connected:!1,expire:0,ips:[],behaviourPenalty:0},t),{topics:t.topics?Object.entries(t.topics).reduce((e,[r,i])=>(e[r]=qT(i),e),{}):{}})}sl.createPeerStats=Kqe;function qT(t={}){return Object.assign({inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},t)}sl.createTopicStats=qT;function Vqe(t,e,r){let i=e.topics[t];if(i)return i;if(!!r.topics[t])return e.topics[t]=i=qT(),i}sl.ensureTopicStats=Vqe});var dse=m(k8=>{l();"use strict";Object.defineProperty(k8,"__esModule",{value:!0});k8.computeScore=void 0;function zqe(t,e,r,i){let n=0;return Object.entries(e.topics).forEach(([a,c])=>{let u=r.topics[a];if(!u)return;let f=0;if(c.inMesh){let y=c.meshTime/u.timeInMeshQuantum;y>u.timeInMeshCap&&(y=u.timeInMeshCap),f+=y*u.timeInMeshWeight}if(f+=c.firstMessageDeliveries*u.firstMessageDeliveriesWeight,c.meshMessageDeliveriesActive&&c.meshMessageDeliveries0&&n>r.topicScoreCap&&(n=r.topicScoreCap),n+=r.appSpecificScore(t)*r.appSpecificWeight,e.ips.forEach(a=>{if(r.IPColocationFactorWhitelist.has(a))return;let c=i.get(a),u=c?c.size:0;if(u>r.IPColocationFactorThreshold){let f=u-r.IPColocationFactorThreshold;n+=f*f*r.IPColocationFactorWeight}}),n+=e.behaviourPenalty*e.behaviourPenalty*r.behaviourPenaltyWeight,n}k8.computeScore=zqe});var pse=m((W8t,hse)=>{l();"use strict";function ri(t,e){var e=e||{};this._head=0,this._tail=0,this._capacity=e.capacity,this._capacityMask=3,this._list=new Array(4),Array.isArray(t)&&this._fromArray(t)}ri.prototype.peekAt=function(e){var r=e;if(r===(r|0)){var i=this.size();if(!(r>=i||r<-i))return r<0&&(r+=i),r=this._head+r&this._capacityMask,this._list[r]}};ri.prototype.get=function(e){return this.peekAt(e)};ri.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]};ri.prototype.peekFront=function(){return this.peek()};ri.prototype.peekBack=function(){return this.peekAt(-1)};Object.defineProperty(ri.prototype,"length",{get:function(){return this.size()}});ri.prototype.size=function(){return this._head===this._tail?0:this._headthis._capacity&&this.pop(),this._head1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),r}};ri.prototype.push=function(e){if(e===void 0)return this.size();var r=this._tail;return this._list[r]=e,this._tail=r+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head1e4&&e<=r>>>2&&this._shrinkArray(),i}};ri.prototype.removeOne=function(e){var r=e;if(r===(r|0)&&this._head!==this._tail){var i=this.size(),n=this._list.length;if(!(r>=i||r<-i)){r<0&&(r+=i),r=this._head+r&this._capacityMask;var s=this._list[r],o;if(e0;o--)this._list[r]=this._list[r=r-1+n&this._capacityMask];this._list[r]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(o=i-1-e;o>0;o--)this._list[r]=this._list[r=r+1+n&this._capacityMask];this._list[r]=void 0,this._tail=this._tail-1+n&this._capacityMask}return s}}};ri.prototype.remove=function(e,r){var i=e,n,s=r;if(i===(i|0)&&this._head!==this._tail){var o=this.size(),a=this._list.length;if(!(i>=o||i<-o||r<1)){if(i<0&&(i+=o),r===1||!r)return n=new Array(1),n[0]=this.removeOne(i),n;if(i===0&&i+r>=o)return n=this.toArray(),this.clear(),n;i+r>o&&(r=o-i);var c;for(n=new Array(r),c=0;c0;c--)this._list[i=i+1+a&this._capacityMask]=void 0;return n}if(e===0){for(this._head=this._head+r+a&this._capacityMask,c=r-1;c>0;c--)this._list[i=i+1+a&this._capacityMask]=void 0;return n}if(i0;c--)this.unshift(this._list[i=i-1+a&this._capacityMask]);for(i=this._head-1+a&this._capacityMask;s>0;)this._list[i=i-1+a&this._capacityMask]=void 0,s--;e<0&&(this._tail=i)}else{for(this._tail=i,i=i+r+a&this._capacityMask,c=o-(r+e);c>0;c--)this.push(this._list[i++]);for(i=this._tail;s>0;)this._list[i=i+1+a&this._capacityMask]=void 0,s--}return this._head<2&&this._tail>1e4&&this._tail<=a>>>2&&this._shrinkArray(),n}}};ri.prototype.splice=function(e,r){var i=e;if(i===(i|0)){var n=this.size();if(i<0&&(i+=n),!(i>n))if(arguments.length>2){var s,o,a,c=arguments.length,u=this._list.length,f=2;if(!n||i0&&(this._head=this._head+i+u&this._capacityMask)):(a=this.remove(i,r),this._head=this._head+i+u&this._capacityMask);c>f;)this.unshift(arguments[--c]);for(s=i;s>0;s--)this.unshift(o[s-1])}else{o=new Array(n-(i+r));var d=o.length;for(s=0;sthis._tail){for(s=this._head;s>>=1,this._capacityMask>>>=1};hse.exports=ri});var mse=m(xu=>{l();"use strict";var Hqe=xu&&xu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xu,"__esModule",{value:!0});xu.MessageDeliveries=xu.DeliveryRecordStatus=void 0;var Gqe=Zd(),$qe=Hqe(pse()),Wqe=Jd(),yse;(function(t){t[t.unknown=0]="unknown",t[t.valid=1]="valid",t[t.invalid=2]="invalid",t[t.ignored=3]="ignored"})(yse=xu.DeliveryRecordStatus||(xu.DeliveryRecordStatus={}));var gse=class{constructor(){this.records=new Map,this.queue=new $qe.default}ensureRecord(e){let r=Wqe.messageIdToString(e),i=this.records.get(r);if(i)return i;i={status:yse.unknown,firstSeen:Date.now(),validated:0,peers:new Set},this.records.set(r,i);let n={msgId:r,expire:Date.now()+Gqe.TimeCacheDuration};return this.queue.push(n),i}gc(){let e=Date.now(),r=this.queue.peekFront();for(;r&&r.expire{l();"use strict";var D8=ol&&ol.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})},Yqe=ol&&ol.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ol,"__esModule",{value:!0});ol.PeerScore=void 0;var Xqe=LT(),s1=lse(),Qqe=dse(),da=mse(),Zqe=Zd(),Jqe=Yqe(it()),eje=Ee(),tje=v8(),{ERR_INVALID_SIGNATURE:rje,ERR_MISSING_SIGNATURE:ije}=tje.codes,o1=eje("libp2p:gossipsub:score"),bse=class{constructor(e,r,i){Xqe.validatePeerScoreParams(e),this.params=e,this._connectionManager=r,this.peerStats=new Map,this.peerIPs=new Map,this.deliveryRecords=new da.MessageDeliveries,this.msgId=i}start(){if(this._backgroundInterval){o1("Peer score already running");return}this._backgroundInterval=setInterval(()=>this.background(),this.params.decayInterval),o1("started")}stop(){if(!this._backgroundInterval){o1("Peer score already stopped");return}clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),o1("stopped")}background(){this._refreshScores(),this._updateIPs(),this.deliveryRecords.gc()}_refreshScores(){let e=Date.now(),r=this.params.decayToZero;this.peerStats.forEach((i,n)=>{if(!i.connected){e>i.expire&&(this._removeIPs(n,i.ips),this.peerStats.delete(n));return}Object.entries(i.topics).forEach(([s,o])=>{let a=this.params.topics[s];!a||(o.firstMessageDeliveries*=a.firstMessageDeliveriesDecay,o.firstMessageDeliveriesa.meshMessageDeliveriesActivation&&(o.meshMessageDeliveriesActive=!0)))}),i.behaviourPenalty*=this.params.behaviourPenaltyDecay,i.behaviourPenalty0){this._removeIPs(e,r.ips),this.peerStats.delete(e);return}Object.entries(r.topics).forEach(([i,n])=>{n.firstMessageDeliveries=0;let s=this.params.topics[i].meshMessageDeliveriesThreshold;if(n.inMesh&&n.meshMessageDeliveriesActive&&n.meshMessageDeliveries{s!==r&&this._markDuplicateMessageDelivery(s,e)})})}rejectMessage(e,r){return D8(this,void 0,void 0,function*(){let i=e.receivedFrom;switch(r){case ije:case rje:this._markInvalidMessageDelivery(i,e);return}let n=this.deliveryRecords.ensureRecord(yield this.msgId(e));if(n.status!==da.DeliveryRecordStatus.unknown){o1("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",i,Date.now()-n.firstSeen,da.DeliveryRecordStatus[n.status]);return}switch(r){case Zqe.ERR_TOPIC_VALIDATOR_IGNORE:n.status=da.DeliveryRecordStatus.ignored;return}n.status=da.DeliveryRecordStatus.invalid,this._markInvalidMessageDelivery(i,e),n.peers.forEach(s=>{this._markInvalidMessageDelivery(s,e)})})}duplicateMessage(e){return D8(this,void 0,void 0,function*(){let r=e.receivedFrom,i=this.deliveryRecords.ensureRecord(yield this.msgId(e));if(!i.peers.has(r))switch(i.status){case da.DeliveryRecordStatus.unknown:i.peers.add(r);break;case da.DeliveryRecordStatus.valid:i.peers.add(r),this._markDuplicateMessageDelivery(r,e,i.validated);break;case da.DeliveryRecordStatus.invalid:this._markInvalidMessageDelivery(r,e);break}})}_markInvalidMessageDelivery(e,r){let i=this.peerStats.get(e);!i||r.topicIDs.forEach(n=>{let s=s1.ensureTopicStats(n,i,this.params);!s||(s.invalidMessageDeliveries+=1)})}_markFirstMessageDelivery(e,r){let i=this.peerStats.get(e);!i||r.topicIDs.forEach(n=>{let s=s1.ensureTopicStats(n,i,this.params);if(!s)return;let o=this.params.topics[n].firstMessageDeliveriesCap;s.firstMessageDeliveries+=1,s.firstMessageDeliveries>o&&(s.firstMessageDeliveries=o),!!s.inMesh&&(o=this.params.topics[n].meshMessageDeliveriesCap,s.meshMessageDeliveries+=1,s.meshMessageDeliveries>o&&(s.meshMessageDeliveries=o))})}_markDuplicateMessageDelivery(e,r,i=0){let n=this.peerStats.get(e);if(!n)return;let s=i?Date.now():0;r.topicIDs.forEach(o=>{let a=s1.ensureTopicStats(o,n,this.params);if(!a||!a.inMesh)return;let c=this.params.topics[o];if(i&&s>i+c.meshMessageDeliveriesWindow)return;let u=c.meshMessageDeliveriesCap;a.meshMessageDeliveries+=1,a.meshMessageDeliveries>u&&(a.meshMessageDeliveries=u)})}_getIPs(e){return this._connectionManager.getAll(Jqe.default.createFromB58String(e)).map(r=>r.remoteAddr.toOptions().host)}_setIPs(e,r,i){e:for(let n of r){for(let o of i)if(n===o)continue e;let s=this.peerIPs.get(n);s||(s=new Set,this.peerIPs.set(n,s)),s.add(e)}e:for(let n of i){for(let o of r)if(n===o)continue e;let s=this.peerIPs.get(n);!s||(s.delete(e),s.size||this.peerIPs.delete(n))}}_removeIPs(e,r){r.forEach(i=>{let n=this.peerIPs.get(i);!n||(n.delete(e),n.size||this.peerIPs.delete(i))})}_updateIPs(){this.peerStats.forEach((e,r)=>{let i=this._getIPs(r);this._setIPs(r,i,e.ips),e.ips=i})}};ol.PeerScore=bse});var wse=m(Au=>{l();"use strict";var nje=Au&&Au.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),jT=Au&&Au.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nje(e,t,r)};Object.defineProperty(Au,"__esModule",{value:!0});jT(LT(),Au);jT(fse(),Au);jT(vse(),Au)});var Sse=m(a1=>{l();"use strict";var _se=a1&&a1.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(a1,"__esModule",{value:!0});a1.IWantTracer=void 0;var sje=Zd(),UT=Jd(),oje=v8(),{ERR_INVALID_SIGNATURE:aje,ERR_MISSING_SIGNATURE:cje}=oje.codes,Ese=class{constructor(e){this.getMsgId=e,this.promises=new Map}addPromise(e,r){let i=Math.floor(Math.random()*r.length),n=r[i],s=UT.messageIdToString(n),o=this.promises.get(s);o||(o=new Map,this.promises.set(s,o)),o.has(e)||o.set(e,Date.now()+sje.GossipsubIWantFollowupTime)}getBrokenPromises(){let e=Date.now(),r=new Map;return this.promises.forEach((i,n)=>{i.forEach((s,o)=>{s{l();var xse="Expected a function",Ase=0/0,uje="[object Symbol]",fje=/^\s+|\s+$/g,lje=/^[-+]0x[0-9a-f]+$/i,dje=/^0b[01]+$/i,hje=/^0o[0-7]+$/i,pje=parseInt,yje=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,gje=typeof self=="object"&&self&&self.Object===Object&&self,mje=yje||gje||Function("return this")(),bje=Object.prototype,vje=bje.toString,wje=Math.max,_je=Math.min,FT=function(){return mje.Date.now()};function Eje(t,e,r){var i,n,s,o,a,c,u=0,f=!1,d=!1,h=!0;if(typeof t!="function")throw new TypeError(xse);e=Ise(e)||0,B8(r)&&(f=!!r.leading,d="maxWait"in r,s=d?wje(Ise(r.maxWait)||0,e):s,h="trailing"in r?!!r.trailing:h);function p(B){var H=i,W=n;return i=n=void 0,u=B,o=t.apply(W,H),o}function y(B){return u=B,a=setTimeout(v,e),f?p(B):o}function b(B){var H=B-c,W=B-u,X=e-H;return d?_je(X,s-W):X}function E(B){var H=B-c,W=B-u;return c===void 0||H>=e||H<0||d&&W>=s}function v(){var B=FT();if(E(B))return A(B);a=setTimeout(v,b(B))}function A(B){return a=void 0,h&&i?p(B):(i=n=void 0,o)}function R(){a!==void 0&&clearTimeout(a),u=0,i=c=n=a=void 0}function F(){return a===void 0?o:A(FT())}function D(){var B=FT(),H=E(B);if(i=arguments,n=this,c=B,H){if(a===void 0)return y(c);if(d)return a=setTimeout(v,e),p(c)}return a===void 0&&(a=setTimeout(v,e)),o}return D.cancel=R,D.flush=F,D}function Sje(t,e,r){var i=!0,n=!0;if(typeof t!="function")throw new TypeError(xse);return B8(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),Eje(t,e,{leading:i,maxWait:e,trailing:n})}function B8(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function xje(t){return!!t&&typeof t=="object"}function Aje(t){return typeof t=="symbol"||xje(t)&&vje.call(t)==uje}function Ise(t){if(typeof t=="number")return t;if(Aje(t))return Ase;if(B8(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=B8(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(fje,"");var r=dje.test(t);return r||hje.test(t)?pje(t.slice(2),r?2:8):lje.test(t)?Ase:+t}Tse.exports=Sje});var Ose=m((Pse,Cse)=>{l();"use strict";var Ije=Rse();Pse=Cse.exports=KT;function KT(t){if(!(this instanceof KT))return new KT(t);t=t||{};let e=t.validity||30,r=new Map,i=Ije(()=>{r.forEach((n,s)=>{let o=n.validity||e;Tje(n.timestamp)>o&&r.delete(s)})},200);this.put=(n,s,o)=>{this.has(n)||r.set(n,{value:s,timestamp:new Date,validity:o}),i()},this.get=n=>{if(r.has(n))return r.get(n).value;throw new Error("key does not exist")},this.has=n=>r.has(n)}function Tje(t){let r=new Date().getTime()-t.getTime();return Math.floor(r/1e3)}});var _r=m((evt,Dse)=>{l();"use strict";function kse(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Rje(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return kse(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),kse(new n,r)}}Dse.exports=Rje});var _i=m(VT=>{l();"use strict";VT.messages={NOT_STARTED_YET:"The libp2p node is not started yet",DHT_DISABLED:"DHT is not available",CONN_ENCRYPTION_REQUIRED:"At least one connection encryption module is required"};VT.codes={DHT_DISABLED:"ERR_DHT_DISABLED",PUBSUB_NOT_STARTED:"ERR_PUBSUB_NOT_STARTED",DHT_NOT_STARTED:"ERR_DHT_NOT_STARTED",CONN_ENCRYPTION_REQUIRED:"ERR_CONN_ENCRYPTION_REQUIRED",ERR_INVALID_PROTOCOLS_FOR_STREAM:"ERR_INVALID_PROTOCOLS_FOR_STREAM",ERR_CONNECTION_ENDED:"ERR_CONNECTION_ENDED",ERR_CONNECTION_FAILED:"ERR_CONNECTION_FAILED",ERR_NODE_NOT_STARTED:"ERR_NODE_NOT_STARTED",ERR_ALREADY_ABORTED:"ERR_ALREADY_ABORTED",ERR_TOO_MANY_ADDRESSES:"ERR_TOO_MANY_ADDRESSES",ERR_NO_VALID_ADDRESSES:"ERR_NO_VALID_ADDRESSES",ERR_RELAYED_DIAL:"ERR_RELAYED_DIAL",ERR_DIALED_SELF:"ERR_DIALED_SELF",ERR_DISCOVERED_SELF:"ERR_DISCOVERED_SELF",ERR_DUPLICATE_TRANSPORT:"ERR_DUPLICATE_TRANSPORT",ERR_ENCRYPTION_FAILED:"ERR_ENCRYPTION_FAILED",ERR_HOP_REQUEST_FAILED:"ERR_HOP_REQUEST_FAILED",ERR_INVALID_KEY:"ERR_INVALID_KEY",ERR_INVALID_MESSAGE:"ERR_INVALID_MESSAGE",ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS",ERR_INVALID_PEER:"ERR_INVALID_PEER",ERR_MUXER_UNAVAILABLE:"ERR_MUXER_UNAVAILABLE",ERR_TIMEOUT:"ERR_TIMEOUT",ERR_TRANSPORT_UNAVAILABLE:"ERR_TRANSPORT_UNAVAILABLE",ERR_TRANSPORT_DIAL_FAILED:"ERR_TRANSPORT_DIAL_FAILED",ERR_UNSUPPORTED_PROTOCOL:"ERR_UNSUPPORTED_PROTOCOL",ERR_INVALID_MULTIADDR:"ERR_INVALID_MULTIADDR",ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID"}});var Mse=m((rvt,Nse)=>{l();"use strict";var c1=Vi(),Bse=c1.Reader,Pje=c1.Writer,Cr=c1.util,lm=c1.roots["libp2p-envelope"]||(c1.roots["libp2p-envelope"]={});lm.Envelope=function(){function t(e){if(e)for(var r=Object.keys(e),i=0;i>>3){case 1:s.publicKey=r.bytes();break;case 2:s.payloadType=r.bytes();break;case 3:s.payload=r.bytes();break;case 5:s.signature=r.bytes();break;default:r.skipType(o&7);break}}return s},t.fromObject=function(r){if(r instanceof lm.Envelope)return r;var i=new lm.Envelope;return r.publicKey!=null&&(typeof r.publicKey=="string"?Cr.base64.decode(r.publicKey,i.publicKey=Cr.newBuffer(Cr.base64.length(r.publicKey)),0):r.publicKey.length&&(i.publicKey=r.publicKey)),r.payloadType!=null&&(typeof r.payloadType=="string"?Cr.base64.decode(r.payloadType,i.payloadType=Cr.newBuffer(Cr.base64.length(r.payloadType)),0):r.payloadType.length&&(i.payloadType=r.payloadType)),r.payload!=null&&(typeof r.payload=="string"?Cr.base64.decode(r.payload,i.payload=Cr.newBuffer(Cr.base64.length(r.payload)),0):r.payload.length&&(i.payload=r.payload)),r.signature!=null&&(typeof r.signature=="string"?Cr.base64.decode(r.signature,i.signature=Cr.newBuffer(Cr.base64.length(r.signature)),0):r.signature.length&&(i.signature=r.signature)),i},t.toObject=function(r,i){i||(i={});var n={};return i.defaults&&(i.bytes===String?n.publicKey="":(n.publicKey=[],i.bytes!==Array&&(n.publicKey=Cr.newBuffer(n.publicKey))),i.bytes===String?n.payloadType="":(n.payloadType=[],i.bytes!==Array&&(n.payloadType=Cr.newBuffer(n.payloadType))),i.bytes===String?n.payload="":(n.payload=[],i.bytes!==Array&&(n.payload=Cr.newBuffer(n.payload))),i.bytes===String?n.signature="":(n.signature=[],i.bytes!==Array&&(n.signature=Cr.newBuffer(n.signature)))),r.publicKey!=null&&r.hasOwnProperty("publicKey")&&(n.publicKey=i.bytes===String?Cr.base64.encode(r.publicKey,0,r.publicKey.length):i.bytes===Array?Array.prototype.slice.call(r.publicKey):r.publicKey),r.payloadType!=null&&r.hasOwnProperty("payloadType")&&(n.payloadType=i.bytes===String?Cr.base64.encode(r.payloadType,0,r.payloadType.length):i.bytes===Array?Array.prototype.slice.call(r.payloadType):r.payloadType),r.payload!=null&&r.hasOwnProperty("payload")&&(n.payload=i.bytes===String?Cr.base64.encode(r.payload,0,r.payload.length):i.bytes===Array?Array.prototype.slice.call(r.payload):r.payload),r.signature!=null&&r.hasOwnProperty("signature")&&(n.signature=i.bytes===String?Cr.base64.encode(r.signature,0,r.signature.length):i.bytes===Array?Array.prototype.slice.call(r.signature):r.signature),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,c1.util.toJSONOptions)},t}();Nse.exports=lm});var dm=m((ivt,jse)=>{l();"use strict";var Cje=_r(),{concat:Oje}=(mn(),$s),{fromString:kje}=(dt(),bi),Dje=R4(),Bje=it(),zT=Es(),{equals:N8}=(wi(),bn),{codes:Nje}=_i(),{Envelope:Lse}=Mse(),al=class{constructor({peerId:e,payloadType:r,payload:i,signature:n}){this.peerId=e,this.payloadType=r,this.payload=i,this.signature=n,this._marshal=void 0}marshal(){if(this._marshal)return this._marshal;let e=Dje.marshalPublicKey(this.peerId.pubKey);return this._marshal=Lse.encode({publicKey:e,payloadType:this.payloadType,payload:this.payload,signature:this.signature}).finish(),this._marshal}equals(e){return N8(this.peerId.pubKey.bytes,e.peerId.pubKey.bytes)&&N8(this.payloadType,e.payloadType)&&N8(this.payload,e.payload)&&N8(this.signature,e.signature)}validate(e){let r=qse(e,this.payloadType,this.payload);return this.peerId.pubKey.verify(r,this.signature)}},qse=(t,e,r)=>{let i=kje(t),n=zT.encode(i.byteLength),s=zT.encode(e.length),o=zT.encode(r.length);return Oje([new Uint8Array(n),i,new Uint8Array(s),e,new Uint8Array(o),r])};al.createFromProtobuf=async t=>{let e=Lse.decode(t),r=await Bje.createFromPubKey(e.publicKey);return new al({peerId:r,payloadType:e.payloadType,payload:e.payload,signature:e.signature})};al.seal=async(t,e)=>{let r=t.domain,i=t.codec,n=t.marshal(),s=qse(r,i,n),o=await e.privKey.sign(s);return new al({peerId:e,payloadType:i,payload:n,signature:o})};al.openAndCertify=async(t,e)=>{let r=await al.createFromProtobuf(t);if(!await r.validate(e))throw Cje(new Error("envelope signature is not valid for the given domain"),Nje.ERR_SIGNATURE_NOT_VALID);return r};jse.exports=al});var XT=m((Iu,Fse)=>{l();"use strict";var Mje=Iu&&Iu.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Lje=Iu&&Iu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Use=Iu&&Iu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mje(e,t,r);return Lje(e,t),e},u1=Iu&&Iu.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})},HT=Use($ne()),qje=ese(),GT=rse(),Kt=Use(Zd()),jje=sse(),M8=BT(),Ji=Jd(),$T=wse(),Uje=Sse(),Fje=Ose(),WT=it(),Kje=dm(),YT=class extends HT.default{constructor(e,r={}){let i=[Kt.GossipsubIDv11,Kt.GossipsubIDv10],n=Object.assign(Object.assign({gossipIncoming:!0,fallbackToFloodsub:!0,floodPublish:!0,doPX:!1,directPeers:[],D:Kt.GossipsubD,Dlo:Kt.GossipsubDlo,Dhi:Kt.GossipsubDhi,Dscore:Kt.GossipsubDscore,Dout:Kt.GossipsubDout,Dlazy:Kt.GossipsubDlazy},r),{scoreParams:$T.createPeerScoreParams(r.scoreParams),scoreThresholds:$T.createPeerScoreThresholds(r.scoreThresholds)});n.fallbackToFloodsub&&i.push(Kt.FloodsubID);super(Object.assign({debugName:"libp2p:gossipsub",multicodecs:i,libp2p:e},n));this._options=n,this.direct=new Set(n.directPeers.map(s=>s.id.toB58String())),n.directPeers.forEach(s=>{e.peerStore.addressBook.add(s.id,s.addrs)}),this.seenCache=new Fje,this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.messageCache=r.messageCache||new qje.MessageCache(Kt.GossipsubHistoryGossip,Kt.GossipsubHistoryLength,this.getMsgId.bind(this)),this.heartbeat=new jje.Heartbeat(this),this.heartbeatTicks=0,this.gossipTracer=new Uje.IWantTracer(this.getMsgId.bind(this)),this._libp2p=e,this.score=new $T.PeerScore(this._options.scoreParams,e.connectionManager,this.getMsgId.bind(this))}_decodeRpc(e){return GT.RPC.decode(e)}_encodeRpc(e){return GT.RPC.encode(e).finish()}_addPeer(e,r){let i=super._addPeer(e,r);this.score.addPeer(e.toB58String());let n=!1;for(let s of this._libp2p.connectionManager.getAll(e))if(s.stat.direction==="outbound"&&Array.from(s.registry.values()).some(o=>r===o.protocol)){n=!0;break}return this.outbound.set(i.id.toB58String(),n),i}_removePeer(e){let r=super._removePeer(e),i=e.toB58String();for(let n of this.mesh.values())n.delete(i);for(let n of this.fanout.values())n.delete(i);return this.gossip.delete(i),this.control.delete(i),this.outbound.delete(i),this.score.removePeer(i),r}_processRpc(e,r,i){let n=Object.create(null,{_processRpc:{get:()=>super._processRpc}});return u1(this,void 0,void 0,function*(){return(yield n._processRpc.call(this,e,r,i))?(i.control&&this._processRpcControlMessage(e,i.control),!0):!1})}_processRpcControlMessage(e,r){if(!r)return;let i=r.ihave?this._handleIHave(e,r.ihave):[],n=r.iwant?this._handleIWant(e,r.iwant):[],s=r.graft?this._handleGraft(e,r.graft):[];if(r.prune&&this._handlePrune(e,r.prune),!i.length&&!n.length&&!s.length)return;let o=Ji.createGossipRpc(n,{iwant:i,prune:s});this._sendRpc(e,o)}_processRpcMessage(e){let r=Object.create(null,{_processRpcMessage:{get:()=>super._processRpcMessage}});return u1(this,void 0,void 0,function*(){let i=yield this.getMsgId(e),n=Ji.messageIdToString(i);if(this.seenCache.has(n)){this.score.duplicateMessage(e);return}this.seenCache.put(n),yield this.score.validateMessage(e),yield r._processRpcMessage.call(this,e)})}_acceptFrom(e){return this.direct.has(e)||this.score.score(e)>=this._options.scoreThresholds.graylistThreshold}validate(e){let r=Object.create(null,{validate:{get:()=>super.validate}});return u1(this,void 0,void 0,function*(){try{yield r.validate.call(this,e)}catch(i){throw this.score.rejectMessage(e,i.code),this.gossipTracer.rejectMessage(e,i.code),i}})}_handleIHave(e,r){if(!r.length)return[];let i=this.score.score(e);if(iKt.GossipsubMaxIHaveMessages)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",e,n),[];let s=this.iasked.get(e)||0;if(s>=Kt.GossipsubMaxIHaveLength)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",e,s),[];let o=new Map;if(r.forEach(({topicID:u,messageIDs:f})=>{!u||!f||!this.mesh.has(u)||f.forEach(d=>{let h=Ji.messageIdToString(d);this.seenCache.has(h)||o.set(h,d)})}),!o.size)return[];let a=o.size;a+s>Kt.GossipsubMaxIHaveLength&&(a=Kt.GossipsubMaxIHaveLength-s),this.log("IHAVE: Asking for %d out of %d messages from %s",a,o.size,e);let c=Array.from(o.values());return Ji.shuffle(c),c=c.slice(0,a),this.iasked.set(e,s+a),this.gossipTracer.addPromise(e,c),[{messageIDs:c}]}_handleIWant(e,r){if(!r.length)return[];let i=this.score.score(e);if(i{s&&s.forEach(o=>{let[a,c]=this.messageCache.getForPeer(o,e);if(!!a){if(c>Kt.GossipsubGossipRetransmission){this.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",e,o);return}n.set(Ji.messageIdToString(o),a)}})}),n.size?(this.log("IWANT: Sending %d messages to %s",n.size,e),Array.from(n.values()).map(HT.utils.normalizeOutRpcMessage)):[]}_handleGraft(e,r){let i=[],n=this.score.score(e),s=this._now(),o=this._options.doPX;return r.forEach(({topicID:a})=>{var c;if(!a)return;let u=this.mesh.get(a);if(!u){o=!1;return}if(u.has(e))return;if(this.direct.has(e)){this.log("GRAFT: ignoring request from direct peer %s",e),i.push(a),o=!1;return}let f=(c=this.backoff.get(a))===null||c===void 0?void 0:c.get(e);if(typeof f=="number"&&s=this._options.Dhi&&!this.outbound.get(e)){i.push(a),this._addBackoff(e,a);return}this.log("GRAFT: Add mesh link from %s in %s",e,a),this.score.graft(e,a),u.add(e)}),i.length?i.map(a=>this._makePrune(e,a,o)):[]}_handlePrune(e,r){let i=this.score.score(e);r.forEach(({topicID:n,backoff:s,peers:o})=>{if(!n)return;let a=this.mesh.get(n);if(!!a&&(this.log("PRUNE: Remove mesh link to %s in %s",e,n),this.score.prune(e,n),a.delete(e),typeof s=="number"&&s>0?this._doAddBackoff(e,n,s*1e3):this._addBackoff(e,n),o&&o.length)){if(i{this.log("peer %s didn't follow up in %d IWANT requests; adding penalty",r,e),this.score.addPenalty(r,e)})}_clearBackoff(){if(this.heartbeatTicks%Kt.GossipsubPruneBackoffTicks!=0)return;let e=this._now();this.backoff.forEach((r,i)=>{r.forEach((n,s)=>{n{let i=this.peers.get(r);(!i||!i.isWritable)&&e.push(r)}),e.length&&e.forEach(r=>{this._connect(r)})}_pxConnect(e){return u1(this,void 0,void 0,function*(){e.length>Kt.GossipsubPrunePeers&&(Ji.shuffle(e),e=e.slice(0,Kt.GossipsubPrunePeers));let r=[];yield Promise.all(e.map(i=>u1(this,void 0,void 0,function*(){if(!i.peerID)return;let s=WT.createFromBytes(i.peerID).toB58String();if(!this.peers.has(s)){if(!i.signedPeerRecord){r.push(s);return}try{let o=yield Kje.openAndCertify(i.signedPeerRecord,"libp2p-peer-record"),a=o.peerId.toB58String();if(s!==a){this.log("bogus peer record obtained through px: peer ID %s doesn't match expected peer %s",a,s);return}if(!this._libp2p.peerStore.addressBook.consumePeerRecord(o)){this.log("bogus peer record obtained through px: could not add peer record to address book");return}r.push(s)}catch(o){this.log("bogus peer record obtained through px: invalid signature or not a peer record")}}}))),!!r.length&&r.forEach(i=>this._connect(i))})}start(){super.start(),this.heartbeat.start(),this.score.start(),this._directPeerInitial=setTimeout(()=>{this.direct.forEach(e=>{this._connect(e)})},Kt.GossipsubDirectConnectInitialDelay)}stop(){super.stop(),this.heartbeat.stop(),this.score.stop(),this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.gossipTracer.clear(),clearTimeout(this._directPeerInitial)}_connect(e){this.log("Initiating connection with %s",e),this._libp2p.dialProtocol(WT.createFromB58String(e),this.multicodecs)}subscribe(e){super.subscribe(e),this.join(e)}unsubscribe(e){super.unsubscribe(e),this.leave(e)}join(e){if(!this.started)throw new Error("Gossipsub has not started");this.log("JOIN %s",e);let r=this.fanout.get(e);if(r)r.forEach(i=>{this.score.score(i)<0&&r.delete(i)}),r.size!r.has(i)&&!this.direct.has(i)&&this.score.score(i)>=0).forEach(i=>r.add(i)),this.mesh.set(e,r),this.fanout.delete(e),this.lastpub.delete(e);else{let i=M8.getGossipPeers(this,e,this._options.D,n=>!this.direct.has(n)&&this.score.score(n)>=0);this.mesh.set(e,i)}this.mesh.get(e).forEach(i=>{this.log("JOIN: Add mesh link to %s in %s",i,e),this._sendGraft(i,e)})}leave(e){if(!this.started)throw new Error("Gossipsub has not started");this.log("LEAVE %s",e);let r=this.mesh.get(e);r&&(r.forEach(i=>{this.log("LEAVE: Remove mesh link to %s in %s",i,e),this._sendPrune(i,e)}),this.mesh.delete(e))}_publish(e){return u1(this,void 0,void 0,function*(){e.receivedFrom!==this.peerId.toB58String()&&(this.score.deliverMessage(e),this.gossipTracer.deliverMessage(e));let r=yield this.getMsgId(e),i=Ji.messageIdToString(r);this.seenCache.put(i),this.messageCache.put(e);let n=new Set;e.topicIDs.forEach(o=>{let a=this.topics.get(o);if(!!a)if(this._options.floodPublish&&e.from===this.peerId.toB58String())a.forEach(c=>{(this.direct.has(c)||this.score.score(c)>=this._options.scoreThresholds.publishThreshold)&&n.add(c)});else{this.direct.forEach(u=>{n.add(u)}),a.forEach(u=>{let f=this.score.score(u),d=this.peers.get(u);!d||d.protocol===Kt.FloodsubID&&f>=this._options.scoreThresholds.publishThreshold&&n.add(u)});let c=this.mesh.get(o);if(!c||!c.size){if(c=this.fanout.get(o),!c){let u=M8.getGossipPeers(this,o,this._options.D,f=>this.score.score(f)>=this._options.scoreThresholds.publishThreshold);u.size>0?(c=u,this.fanout.set(o,u)):c=new Set}this.lastpub.set(o,this._now())}c.forEach(u=>{n.add(u)})}});let s=Ji.createGossipRpc([HT.utils.normalizeOutRpcMessage(e)]);n.forEach(o=>{o!==e.from&&this._sendRpc(o,s)})})}_sendGraft(e,r){let i=[{topicID:r}],n=Ji.createGossipRpc([],{graft:i});this._sendRpc(e,n)}_sendPrune(e,r){let i=[this._makePrune(e,r,this._options.doPX)],n=Ji.createGossipRpc([],{prune:i});this._sendRpc(e,n)}_sendRpc(e,r){let i=this.peers.get(e);if(!i||!i.isWritable)return;let n=this.control.get(e);n&&(this._piggybackControl(e,r,n),this.control.delete(e));let s=this.gossip.get(e);s&&(this._piggybackGossip(e,r,s),this.gossip.delete(e)),i.write(GT.RPC.encode(r).finish())}_piggybackControl(e,r,i){let n=(i.graft||[]).filter(({topicID:o})=>(o&&this.mesh.get(o)||new Set).has(e)),s=(i.prune||[]).filter(({topicID:o})=>!(o&&this.mesh.get(o)||new Set).has(e));!n.length&&!s.length||(r.control?(r.control.graft=r.control.graft&&r.control.graft.concat(n),r.control.prune=r.control.prune&&r.control.prune.concat(s)):r.control={ihave:[],iwant:[],graft:n,prune:s})}_piggybackGossip(e,r,i){r.control||(r.control={ihave:[],iwant:[],graft:[],prune:[]}),r.control.ihave=i}_sendGraftPrune(e,r,i){let n=this._options.doPX;for(let[s,o]of e){let a=o.map(d=>({topicID:d})),c=[],u=r.get(s);u&&(c=u.map(d=>this._makePrune(s,d,n&&!i.get(s))),r.delete(s));let f=Ji.createGossipRpc([],{graft:a,prune:c});this._sendRpc(s,f)}for(let[s,o]of r){let a=o.map(u=>this._makePrune(s,u,n&&!i.get(s))),c=Ji.createGossipRpc([],{prune:a});this._sendRpc(s,c)}}_emitGossip(e,r){let i=this.messageCache.getGossipIDs(e);if(!i.length)return;Ji.shuffle(i),i.length>Kt.GossipsubMaxIHaveLength&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",i.length);let n=[],s=this.topics.get(e);if(!s)return;s.forEach(c=>{let u=this.peers.get(c);!u||!r.has(c)&&!this.direct.has(c)&&Ji.hasGossipProtocol(u.protocol)&&this.score.score(c)>=this._options.scoreThresholds.gossipThreshold&&n.push(c)});let o=this._options.Dlazy,a=Kt.GossipsubGossipFactor*n.length;a>o&&(o=a),o>n.length?o=n.length:Ji.shuffle(n),n.slice(0,o).forEach(c=>{let u=i;i.length>Kt.GossipsubMaxIHaveLength&&(u=Ji.shuffle(u.slice()).slice(0,Kt.GossipsubMaxIHaveLength)),this._pushGossip(c,{topicID:e,messageIDs:u})})}_flush(){for(let[e,r]of this.gossip.entries()){this.gossip.delete(e);let i=Ji.createGossipRpc([],{ihave:r});this._sendRpc(e,i)}for(let[e,r]of this.control.entries()){this.control.delete(e);let i=Ji.createGossipRpc([],{graft:r.graft,prune:r.prune});this._sendRpc(e,i)}}_pushGossip(e,r){this.log("Add gossip to %s",e);let i=this.gossip.get(e)||[];this.gossip.set(e,i.concat(r))}_now(){return Date.now()}_makePrune(e,r,i){if(this.peers.get(e).protocol===Kt.GossipsubIDv10)return{topicID:r,peers:[]};let n=Kt.GossipsubPruneBackoff/1e3,s=[];return i&&M8.getGossipPeers(this,r,Kt.GossipsubPrunePeers,a=>a!==e&&this.score.score(a)>=0).forEach(a=>{let c=WT.createFromB58String(a);s.push({peerID:c.toBytes(),signedPeerRecord:this._libp2p.peerStore.addressBook.getRawEnvelope(c)})}),{topicID:r,peers:s,backoff:n}}};YT.multicodec=Kt.GossipsubIDv11;Fse.exports=YT});var Wse=m((svt,$se)=>{l();"use strict";var ZT=it(),{base58btc:Vje}=(li(),Fs),{default:zje}=Yc(),Vse=fu(),zse=Ee(),cl=zse("libp2p-delegated-peer-routing");cl.error=zse("libp2p-delegated-peer-routing:error");var Hse=3e4,Hje=4,Gse=class{constructor(e){if(e==null)throw new Error("missing ipfs http client");this._client=e,this._httpQueue=new zje({concurrency:Hje});let{protocol:r,host:i,port:n}=e.getEndpointConfig();cl(`enabled DelegatedPeerRouting via ${r}://${i}:${n}`)}async findPeer(e,r={}){let i=e;ZT.isPeerId(i)&&(i=e.toB58String()),cl("findPeer starts: "+e),r.timeout=r.timeout||Hse;try{return await this._httpQueue.add(async()=>{let{addrs:n}=await this._client.dht.findPeer(i,{timeout:r.timeout});return{id:e,multiaddrs:n}})}catch(n){if(n.message.includes("not found"))return;throw n}finally{cl("findPeer finished: "+e)}}async*getClosestPeers(e,r={}){let i=Vje.encode(e).substring(1);cl("getClosestPeers starts:",i),r.timeout=r.timeout||Hse;let n=Vse(),s=Vse();this._httpQueue.add(()=>(n.resolve(),s.promise));try{await n.promise;let o=new Map;for await(let a of this._client.dht.query(i,{timeout:r.timeout}))switch(a.type){case 1:a.responses.forEach(c=>{o.set(c.id,{id:ZT.parse(c.id),multiaddrs:c.addrs})});break;case 2:yield o.get(a.id.string)||{id:ZT.createFromCID(a.id),multiaddrs:[]};break;default:cl("getClosestPeers unhandled response",a)}}catch(o){throw cl.error("getClosestPeers errored:",o),o}finally{s.resolve(),cl("getClosestPeers finished:",i)}}};$se.exports=Gse});var eoe=m((ovt,Jse)=>{l();"use strict";var Yse=Ee(),Gje=it(),$je=ic(),{default:Xse}=Yc(),Qse=fu(),eh=Yse("libp2p-delegated-content-routing");eh.error=Yse("libp2p-delegated-content-routing:error");var Wje=3e4,Yje=4,Zse=class{constructor(e,r){if(e==null)throw new Error("missing self peerId");if(r==null)throw new Error("missing ipfs http client");this._client=r,this.peerId=e;let i={concurrency:Yje};this._httpQueue=new Xse(i),this._httpQueueRefs=new Xse(Object.assign({},i,{concurrency:2}));let{protocol:n,host:s,port:o}=r.getEndpointConfig();eh(`enabled DelegatedContentRouting via ${n}://${s}:${o}`)}async*findProviders(e,r={}){eh(`findProviders starts: ${e}`),r.timeout=r.timeout||Wje;let i=0,n=Qse(),s=Qse();this._httpQueue.add(()=>(n.resolve(),s.promise));try{await n.promise;for await(let{id:o,addrs:a}of this._client.dht.findProvs(e,{numProviders:r.numProviders,timeout:r.timeout}))yield{id:Gje.parse(o),multiaddrs:a},i++}catch(o){throw eh.error("findProviders errored:",o),o}finally{s.resolve(),eh(`findProviders finished: ${e} found ${i} providers`)}}async provide(e){eh(`provide starts: ${e}`),await this._httpQueueRefs.add(async()=>{await this._client.block.stat(e),await $je(this._client.dht.provide(e))}),eh(`provide finished: ${e}`)}};Jse.exports=Zse});var ih=m((_vt,coe)=>{l();"use strict";function aoe(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function aUe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return aoe(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),aoe(new n,r)}}coe.exports=aUe});var mm=m((w_t,Oae)=>{l();Oae.exports=t=>{if(t[Symbol.asyncIterator])return t;if(t.getReader)return async function*(){let e=t.getReader();try{for(;;){let{done:r,value:i}=await e.read();if(r)return;yield i}}finally{e.releaseLock()}}();throw new Error("unknown stream")}});var nR=m(()=>{l()});var sR=m((JTt,Cue)=>{l();"use strict";var _Ue=ly(),EUe=(t,e)=>({path:decodeURIComponent(new URL(t).pathname.split("/").pop()||""),content:SUe(t,e)});async function*SUe(t,e){yield*(await new _Ue().get(t,e)).iterator()}Cue.exports=EUe});var kue=m(()=>{l()});var Bue=m((VRt,Due)=>{l();Due.exports=typeof WebSocket=="undefined"?kue():WebSocket});var Mue=m(Y8=>{l();"use strict";Object.defineProperty(Y8,"__esModule",{value:!0});var Nue=class{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(e){if(this.isStopped)return;let r={value:e,done:!1};if(this.pullQueue.length){let i=this.pullQueue.shift();i&&i.resolve(r)}else this.pushQueue.push(Promise.resolve(r)),this.highWaterMark!==void 0&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn(`EventIterator queue reached ${this.pushQueue.length} items`))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(let e of this.pullQueue)e.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(e){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(let r of this.pullQueue)r.reject(e);this.pullQueue.length=0}else{let r=Promise.reject(e);r.catch(()=>{}),this.pushQueue.push(r)}}remove(){Promise.resolve().then(()=>{this.removeCallback&&this.removeCallback()})}[Symbol.asyncIterator](){return{next:e=>{let r=this.pushQueue.shift();return r?(this.lowWaterMark!==void 0&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),r):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise((i,n)=>{this.pullQueue.push({resolve:i,reject:n})})},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}},oR=class{constructor(e,{highWaterMark:r=100,lowWaterMark:i=1}={}){let n=new Nue;n.highWaterMark=r,n.lowWaterMark=i,n.removeCallback=e({push:s=>n.push(s),stop:()=>n.stop(),fail:s=>n.fail(s),on:(s,o)=>{n.eventHandlers[s]=o}})||(()=>{}),this[Symbol.asyncIterator]=()=>n[Symbol.asyncIterator](),Object.freeze(this)}};Y8.EventIterator=oR;Y8.default=oR});var Lue=m(bm=>{l();"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var aR=Mue();bm.EventIterator=aR.EventIterator;function TUe(t,e,r){return new aR.EventIterator(({push:i})=>(this.addEventListener(t,i,e),()=>this.removeEventListener(t,i,e)),r)}bm.subscribe=TUe;bm.default=aR.EventIterator});var jue=m((GRt,que)=>{l();var{Buffer:RUe}=Ht(),{EventIterator:PUe}=Lue();function CUe(t){return t instanceof ArrayBuffer||t!=null&&t.constructor!=null&&t.constructor.name==="ArrayBuffer"&&typeof t.byteLength=="number"}que.exports=t=>{let e=t.removeEventListener||t.removeListener,r=async function*(){let s=new PUe(({push:o,stop:a,fail:c})=>(t.addEventListener("message",o),t.addEventListener("error",c),t.addEventListener("close",a),()=>{e.call(t,"message",o),e.call(t,"error",c),e.call(t,"close",a)}),{highWaterMark:1/0});for await(let{data:o}of s)yield CUe(o)?RUe.from(o):o}(),i=t.readyState===1,n;return t.addEventListener("open",()=>{i=!0,n=null}),t.addEventListener("close",()=>{i=!1,n=null}),t.addEventListener("error",s=>{i||(n=s)}),r.connected=()=>new Promise((s,o)=>{if(i)return s();if(n)return o(n);let a=f=>{e.call(t,"open",c),e.call(t,"error",u),f()},c=()=>a(s),u=f=>a(()=>o(f));t.addEventListener("open",c),t.addEventListener("error",u)}),r}});var Fue=m(($Rt,Uue)=>{l();Uue.exports=async t=>{if(t.readyState>=2)throw new Error("socket closed");if(t.readyState!==1)return new Promise((e,r)=>{let i=t&&(t.removeEventListener||t.removeListener);function n(){typeof i=="function"&&(i.call(t,"open",s),i.call(t,"error",o))}function s(){n(),e()}function o(a){n(),r(a)}t.addEventListener("open",s),t.addEventListener("error",o)})}});var Vue=m((WRt,Kue)=>{l();var OUe=Fue();Kue.exports=(t,e)=>(e=e||{},e.closeOnEnd=e.closeOnEnd!==!1,async r=>{for await(let i of r){try{await OUe(t)}catch(n){if(n.message==="socket closed")break;throw n}t.send(i)}if(e.closeOnEnd&&t.readyState<=1)return new Promise((i,n)=>{t.addEventListener("close",s=>{if(s.wasClean||s.code===1006)i();else{let o=Object.assign(new Error("ws error"),{event:s});n(o)}}),setTimeout(()=>t.close())})})});var Hue=m((YRt,zue)=>{l();var kUe=jue(),DUe=Vue();zue.exports=(t,e)=>{e=e||{},e.binaryType?t.binaryType=e.binaryType:e.binary&&(t.binaryType="arraybuffer");let r={sink:DUe(t,e),source:kUe(t,e),connected:()=>r.source.connected()};return r}});var $ue=m((XRt,Gue)=>{l();var{relative:BUe}=_6(),NUe={http:"ws",https:"wss"},MUe="ws";Gue.exports=(t,e)=>BUe(t,e,NUe,MUe)});var Wue=m((QRt,X8)=>{l();"use strict";var LUe=Bue(),qUe=Hue(),jUe=$ue();X8.exports=function(t,e={}){let r=typeof window=="undefined"?{}:window.location,i=jUe(t,r),n=new LUe(i,e.websocket),s=qUe(n,e);return s.remoteAddress=i,s.close=()=>new Promise((o,a)=>{n.addEventListener("close",o),n.close()}),s.destroy=()=>{n.terminate?n.terminate():n.close()},s.socket=n,s};X8.exports.connect=X8.exports});var Xue=m((ZRt,Yue)=>{l();"use strict";Yue.exports=function(){throw new Error("WebSocket Servers can not be created in the browser!")}});var cR=m(nh=>{l();"use strict";nh.CODE_P2P=421;nh.CODE_CIRCUIT=290;nh.CODE_TCP=6;nh.CODE_WS=477;nh.CODE_WSS=478;nh.CLOSE_TIMEOUT=2e3});var Jue=m((ePt,Zue)=>{l();"use strict";function Que(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function UUe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Que(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),Que(new n,r)}}Zue.exports=UUe});var uR=m(l1=>{l();"use strict";Object.defineProperty(l1,"__esModule",{value:!0});l1.isCorrect=l1.isInSubnet=void 0;function FUe(t){return this.subnetMask{l();"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.RE_SUBNET_STRING=xc.RE_ADDRESS=xc.GROUPS=xc.BITS=void 0;xc.BITS=32;xc.GROUPS=4;xc.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;xc.RE_SUBNET_STRING=/\/\d{1,2}$/});var Q8=m(d1=>{l();"use strict";var VUe=d1&&d1.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(d1,"__esModule",{value:!0});d1.AddressError=void 0;var zUe=function(t){VUe(e,t);function e(r,i){var n=t.call(this,r)||this;return n.name="AddressError",i!==null&&(n.parseMessage=i),n}return e}(Error);d1.AddressError=zUe});var lR=m((Z8,efe)=>{l();(function(){var t,e=244837814094590,r=(e&16777215)==15715070;function i(x,T,G){x!=null&&(typeof x=="number"?this.fromNumber(x,T,G):T==null&&typeof x!="string"?this.fromString(x,256):this.fromString(x,T))}function n(){return new i(null)}function s(x,T,G,ae,ve,Ae){for(;--Ae>=0;){var Ne=T*this[x++]+G[ae]+ve;ve=Math.floor(Ne/67108864),G[ae++]=Ne&67108863}return ve}function o(x,T,G,ae,ve,Ae){for(var Ne=T&32767,Ue=T>>15;--Ae>=0;){var xr=this[x]&32767,Ui=this[x++]>>15,Ls=Ue*xr+Ui*Ne;xr=Ne*xr+((Ls&32767)<<15)+G[ae]+(ve&1073741823),ve=(xr>>>30)+(Ls>>>15)+Ue*Ui+(ve>>>30),G[ae++]=xr&1073741823}return ve}function a(x,T,G,ae,ve,Ae){for(var Ne=T&16383,Ue=T>>14;--Ae>=0;){var xr=this[x]&16383,Ui=this[x++]>>14,Ls=Ue*xr+Ui*Ne;xr=Ne*xr+((Ls&16383)<<14)+G[ae]+ve,ve=(xr>>28)+(Ls>>14)+Ue*Ui,G[ae++]=xr&268435455}return ve}var c=typeof navigator!="undefined";c&&r&&navigator.appName=="Microsoft Internet Explorer"?(i.prototype.am=o,t=30):c&&r&&navigator.appName!="Netscape"?(i.prototype.am=s,t=26):(i.prototype.am=a,t=28),i.prototype.DB=t,i.prototype.DM=(1<=0;--T)x[T]=this[T];x.t=this.t,x.s=this.s}function v(x){this.t=1,this.s=x<0?-1:0,x>0?this[0]=x:x<-1?this[0]=x+this.DV:this.t=0}function A(x){var T=n();return T.fromInt(x),T}function R(x,T){var G;if(T==16)G=4;else if(T==8)G=3;else if(T==256)G=8;else if(T==2)G=1;else if(T==32)G=5;else if(T==4)G=2;else{this.fromRadix(x,T);return}this.t=0,this.s=0;for(var ae=x.length,ve=!1,Ae=0;--ae>=0;){var Ne=G==8?x[ae]&255:b(x,ae);if(Ne<0){x.charAt(ae)=="-"&&(ve=!0);continue}ve=!1,Ae==0?this[this.t++]=Ne:Ae+G>this.DB?(this[this.t-1]|=(Ne&(1<>this.DB-Ae):this[this.t-1]|=Ne<=this.DB&&(Ae-=this.DB)}G==8&&(x[0]&128)!=0&&(this.s=-1,Ae>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==x;)--this.t}function D(x){if(this.s<0)return"-"+this.negate().toString(x);var T;if(x==16)T=4;else if(x==8)T=3;else if(x==2)T=1;else if(x==32)T=5;else if(x==4)T=2;else return this.toRadix(x);var G=(1<0)for(Ue>Ue)>0&&(ve=!0,Ae=y(ae));Ne>=0;)Ue>(Ue+=this.DB-T)):(ae=this[Ne]>>(Ue-=T)&G,Ue<=0&&(Ue+=this.DB,--Ne)),ae>0&&(ve=!0),ve&&(Ae+=y(ae));return ve?Ae:"0"}function B(){var x=n();return i.ZERO.subTo(this,x),x}function H(){return this.s<0?this.negate():this}function W(x){var T=this.s-x.s;if(T!=0)return T;var G=this.t;if(T=G-x.t,T!=0)return this.s<0?-T:T;for(;--G>=0;)if((T=this[G]-x[G])!=0)return T;return 0}function X(x){var T=1,G;return(G=x>>>16)!=0&&(x=G,T+=16),(G=x>>8)!=0&&(x=G,T+=8),(G=x>>4)!=0&&(x=G,T+=4),(G=x>>2)!=0&&(x=G,T+=2),(G=x>>1)!=0&&(x=G,T+=1),T}function P(){return this.t<=0?0:this.DB*(this.t-1)+X(this[this.t-1]^this.s&this.DM)}function g(x,T){var G;for(G=this.t-1;G>=0;--G)T[G+x]=this[G];for(G=x-1;G>=0;--G)T[G]=0;T.t=this.t+x,T.s=this.s}function w(x,T){for(var G=x;G=0;--Ue)T[Ue+Ae+1]=this[Ue]>>ae|Ne,Ne=(this[Ue]&ve)<=0;--Ue)T[Ue]=0;T[Ae]=Ne,T.t=this.t+Ae+1,T.s=this.s,T.clamp()}function C(x,T){T.s=this.s;var G=Math.floor(x/this.DB);if(G>=this.t){T.t=0;return}var ae=x%this.DB,ve=this.DB-ae,Ae=(1<>ae;for(var Ne=G+1;Ne>ae;ae>0&&(T[this.t-G-1]|=(this.s&Ae)<>=this.DB;if(x.t>=this.DB;ae+=this.s}else{for(ae+=this.s;G>=this.DB;ae-=x.s}T.s=ae<0?-1:0,ae<-1?T[G++]=this.DV+ae:ae>0&&(T[G++]=ae),T.t=G,T.clamp()}function Y(x,T){var G=this.abs(),ae=x.abs(),ve=G.t;for(T.t=ve+ae.t;--ve>=0;)T[ve]=0;for(ve=0;ve=0;)x[G]=0;for(G=0;G=T.DV&&(x[G+T.t]-=T.DV,x[G+T.t+1]=1)}x.t>0&&(x[x.t-1]+=T.am(G,T[G],x,2*G,0,1)),x.s=0,x.clamp()}function q(x,T,G){var ae=x.abs();if(!(ae.t<=0)){var ve=this.abs();if(ve.t0?(ae.lShiftTo(xr,Ae),ve.lShiftTo(xr,G)):(ae.copyTo(Ae),ve.copyTo(G));var Ui=Ae.t,Ls=Ae[Ui-1];if(Ls!=0){var ys=Ls*(1<1?Ae[Ui-2]>>this.F2:0),jc=this.FV/ys,P3=(1<=0&&(G[G.t++]=1,G.subTo(Ku,G)),i.ONE.dlShiftTo(Ui,Ku),Ku.subTo(Ae,Ae);Ae.t=0;){var rw=G[--Bo]==Ls?this.DM:Math.floor(G[Bo]*jc+(G[Bo-1]+Do)*P3);if((G[Bo]+=Ae.am(0,rw,G,C3,0,Ui))0&&G.rShiftTo(xr,G),Ne<0&&i.ZERO.subTo(G,G)}}}function _(x){var T=n();return this.abs().divRemTo(x,null,T),this.s<0&&T.compareTo(i.ZERO)>0&&x.subTo(T,T),T}function j(x){this.m=x}function de(x){return x.s<0||x.compareTo(this.m)>=0?x.mod(this.m):x}function Q(x){return x}function ue(x){x.divRemTo(this.m,null,x)}function le(x,T,G){x.multiplyTo(T,G),this.reduce(G)}function me(x,T){x.squareTo(T),this.reduce(T)}j.prototype.convert=de,j.prototype.revert=Q,j.prototype.reduce=ue,j.prototype.mulTo=le,j.prototype.sqrTo=me;function be(){if(this.t<1)return 0;var x=this[0];if((x&1)==0)return 0;var T=x&3;return T=T*(2-(x&15)*T)&15,T=T*(2-(x&255)*T)&255,T=T*(2-((x&65535)*T&65535))&65535,T=T*(2-x*T%this.DV)%this.DV,T>0?this.DV-T:-T}function xe(x){this.m=x,this.mp=x.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(T,T),T}function K(x){var T=n();return x.copyTo(T),this.reduce(T),T}function $(x){for(;x.t<=this.mt2;)x[x.t++]=0;for(var T=0;T>15)*this.mpl&this.um)<<15)&x.DM;for(G=T+this.m.t,x[G]+=this.m.am(0,ae,x,T,0,this.m.t);x[G]>=x.DV;)x[G]-=x.DV,x[++G]++}x.clamp(),x.drShiftTo(this.m.t,x),x.compareTo(this.m)>=0&&x.subTo(this.m,x)}function ee(x,T){x.squareTo(T),this.reduce(T)}function I(x,T,G){x.multiplyTo(T,G),this.reduce(G)}xe.prototype.convert=k,xe.prototype.revert=K,xe.prototype.reduce=$,xe.prototype.mulTo=I,xe.prototype.sqrTo=ee;function U(){return(this.t>0?this[0]&1:this.s)==0}function z(x,T){if(x>4294967295||x<1)return i.ONE;var G=n(),ae=n(),ve=T.convert(this),Ae=X(x)-1;for(ve.copyTo(G);--Ae>=0;)if(T.sqrTo(G,ae),(x&1<0)T.mulTo(ae,ve,G);else{var Ne=G;G=ae,ae=Ne}return T.revert(G)}function N(x,T){var G;return x<256||T.isEven()?G=new j(T):G=new xe(T),this.exp(x,G)}i.prototype.copyTo=E,i.prototype.fromInt=v,i.prototype.fromString=R,i.prototype.clamp=F,i.prototype.dlShiftTo=g,i.prototype.drShiftTo=w,i.prototype.lShiftTo=S,i.prototype.rShiftTo=C,i.prototype.subTo=L,i.prototype.multiplyTo=Y,i.prototype.squareTo=V,i.prototype.divRemTo=q,i.prototype.invDigit=be,i.prototype.isEven=U,i.prototype.exp=z,i.prototype.toString=D,i.prototype.negate=B,i.prototype.abs=H,i.prototype.compareTo=W,i.prototype.bitLength=P,i.prototype.mod=_,i.prototype.modPowInt=N,i.ZERO=A(0),i.ONE=A(1);function Z(){var x=n();return this.copyTo(x),x}function ie(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function he(){return this.t==0?this.s:this[0]<<16>>16}function we(x){return Math.floor(Math.LN2*this.DB/Math.log(x))}function _e(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Ke(x){if(x==null&&(x=10),this.signum()==0||x<2||x>36)return"0";var T=this.chunkSize(x),G=Math.pow(x,T),ae=A(G),ve=n(),Ae=n(),Ne="";for(this.divRemTo(ae,ve,Ae);ve.signum()>0;)Ne=(G+Ae.intValue()).toString(x).substr(1)+Ne,ve.divRemTo(ae,ve,Ae);return Ae.intValue().toString(x)+Ne}function Pe(x,T){this.fromInt(0),T==null&&(T=10);for(var G=this.chunkSize(T),ae=Math.pow(T,G),ve=!1,Ae=0,Ne=0,Ue=0;Ue=G&&(this.dMultiply(ae),this.dAddOffset(Ne,0),Ae=0,Ne=0)}Ae>0&&(this.dMultiply(Math.pow(T,Ae)),this.dAddOffset(Ne,0)),ve&&i.ZERO.subTo(this,this)}function Ve(x,T,G){if(typeof T=="number")if(x<2)this.fromInt(1);else for(this.fromNumber(x,G),this.testBit(x-1)||this.bitwiseTo(i.ONE.shiftLeft(x-1),Xt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(T);)this.dAddOffset(2,0),this.bitLength()>x&&this.subTo(i.ONE.shiftLeft(x-1),this);else{var ae=new Array,ve=x&7;ae.length=(x>>3)+1,T.nextBytes(ae),ve>0?ae[0]&=(1<0)for(G>G)!=(this.s&this.DM)>>G&&(T[ve++]=ae|this.s<=0;)G<8?(ae=(this[x]&(1<>(G+=this.DB-8)):(ae=this[x]>>(G-=8)&255,G<=0&&(G+=this.DB,--x)),(ae&128)!=0&&(ae|=-256),ve==0&&(this.s&128)!=(ae&128)&&++ve,(ve>0||ae!=this.s)&&(T[ve++]=ae);return T}function He(x){return this.compareTo(x)==0}function ze(x){return this.compareTo(x)<0?this:x}function mt(x){return this.compareTo(x)>0?this:x}function tr(x,T,G){var ae,ve,Ae=Math.min(x.t,this.t);for(ae=0;ae>=16,T+=16),(x&255)==0&&(x>>=8,T+=8),(x&15)==0&&(x>>=4,T+=4),(x&3)==0&&(x>>=2,T+=2),(x&1)==0&&++T,T}function jr(){for(var x=0;x=this.t?this.s!=0:(this[T]&1<>=this.DB;if(x.t>=this.DB;ae+=this.s}else{for(ae+=this.s;G>=this.DB;ae+=x.s}T.s=ae<0?-1:0,ae>0?T[G++]=ae:ae<-1&&(T[G++]=this.DV+ae),T.t=G,T.clamp()}function Hr(x){var T=n();return this.addTo(x,T),T}function A3(x){var T=n();return this.subTo(x,T),T}function Gr(x){var T=n();return this.multiplyTo(x,T),T}function $r(){var x=n();return this.squareTo(x),x}function I3(x){var T=n();return this.divRemTo(x,T,null),T}function Wr(x){var T=n();return this.divRemTo(x,null,T),T}function Yr(x){var T=n(),G=n();return this.divRemTo(x,T,G),new Array(T,G)}function T3(x){this[this.t]=this.am(0,x-1,this,0,0,this.t),++this.t,this.clamp()}function Xr(x,T){if(x!=0){for(;this.t<=T;)this[this.t++]=0;for(this[T]+=x;this[T]>=this.DV;)this[T]-=this.DV,++T>=this.t&&(this[this.t++]=0),++this[T]}}function lr(){}function Ch(x){return x}function l2(x,T,G){x.multiplyTo(T,G)}function d2(x,T){x.squareTo(T)}lr.prototype.convert=Ch,lr.prototype.revert=Ch,lr.prototype.mulTo=l2,lr.prototype.sqrTo=d2;function h2(x){return this.exp(x,new lr)}function p2(x,T,G){var ae=Math.min(this.t+x.t,T);for(G.s=0,G.t=ae;ae>0;)G[--ae]=0;var ve;for(ve=G.t-this.t;ae=0;)G[ae]=0;for(ae=Math.max(T-this.t,0);ae2*this.m.t)return x.mod(this.m);if(x.compareTo(this.m)<0)return x;var T=n();return x.copyTo(T),this.reduce(T),T}function m2(x){return x}function b2(x){for(x.drShiftTo(this.m.t-1,this.r2),x.t>this.m.t+1&&(x.t=this.m.t+1,x.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);x.compareTo(this.r2)<0;)x.dAddOffset(1,this.m.t+1);for(x.subTo(this.r2,x);x.compareTo(this.m)>=0;)x.subTo(this.m,x)}function v2(x,T){x.squareTo(T),this.reduce(T)}function w2(x,T,G){x.multiplyTo(T,G),this.reduce(G)}Oo.prototype.convert=g2,Oo.prototype.revert=m2,Oo.prototype.reduce=b2,Oo.prototype.mulTo=w2,Oo.prototype.sqrTo=v2;function _2(x,T){var G=x.bitLength(),ae,ve=A(1),Ae;if(G<=0)return ve;G<18?ae=1:G<48?ae=3:G<144?ae=4:G<768?ae=5:ae=6,G<8?Ae=new j(T):T.isEven()?Ae=new Oo(T):Ae=new xe(T);var Ne=new Array,Ue=3,xr=ae-1,Ui=(1<1){var Ls=n();for(Ae.sqrTo(Ne[1],Ls);Ue<=Ui;)Ne[Ue]=n(),Ae.mulTo(Ls,Ne[Ue-2],Ne[Ue]),Ue+=2}var ys=x.t-1,jc,P3=!0,Do=n(),Bo;for(G=X(x[ys])-1;ys>=0;){for(G>=xr?jc=x[ys]>>G-xr&Ui:(jc=(x[ys]&(1<0&&(jc|=x[ys-1]>>this.DB+G-xr)),Ue=ae;(jc&1)==0;)jc>>=1,--Ue;if((G-=Ue)<0&&(G+=this.DB,--ys),P3)Ne[jc].copyTo(ve),P3=!1;else{for(;Ue>1;)Ae.sqrTo(ve,Do),Ae.sqrTo(Do,ve),Ue-=2;Ue>0?Ae.sqrTo(ve,Do):(Bo=ve,ve=Do,Do=Bo),Ae.mulTo(Do,Ne[jc],ve)}for(;ys>=0&&(x[ys]&1<0&&(T.rShiftTo(Ae,T),G.rShiftTo(Ae,G));T.signum()>0;)(ve=T.getLowestSetBit())>0&&T.rShiftTo(ve,T),(ve=G.getLowestSetBit())>0&&G.rShiftTo(ve,G),T.compareTo(G)>=0?(T.subTo(G,T),T.rShiftTo(1,T)):(G.subTo(T,G),G.rShiftTo(1,G));return Ae>0&&G.lShiftTo(Ae,G),G}function S2(x){if(x<=0)return 0;var T=this.DV%x,G=this.s<0?x-1:0;if(this.t>0)if(T==0)G=this[0]%x;else for(var ae=this.t-1;ae>=0;--ae)G=(T*G+this[ae])%x;return G}function x2(x){var T=x.isEven();if(this.isEven()&&T||x.signum()==0)return i.ZERO;for(var G=x.clone(),ae=this.clone(),ve=A(1),Ae=A(0),Ne=A(0),Ue=A(1);G.signum()!=0;){for(;G.isEven();)G.rShiftTo(1,G),T?((!ve.isEven()||!Ae.isEven())&&(ve.addTo(this,ve),Ae.subTo(x,Ae)),ve.rShiftTo(1,ve)):Ae.isEven()||Ae.subTo(x,Ae),Ae.rShiftTo(1,Ae);for(;ae.isEven();)ae.rShiftTo(1,ae),T?((!Ne.isEven()||!Ue.isEven())&&(Ne.addTo(this,Ne),Ue.subTo(x,Ue)),Ne.rShiftTo(1,Ne)):Ue.isEven()||Ue.subTo(x,Ue),Ue.rShiftTo(1,Ue);G.compareTo(ae)>=0?(G.subTo(ae,G),T&&ve.subTo(Ne,ve),Ae.subTo(Ue,Ae)):(ae.subTo(G,ae),T&&Ne.subTo(ve,Ne),Ue.subTo(Ae,Ue))}if(ae.compareTo(i.ONE)!=0)return i.ZERO;if(Ue.compareTo(x)>=0)return Ue.subtract(x);if(Ue.signum()<0)Ue.addTo(x,Ue);else return Ue;return Ue.signum()<0?Ue.add(x):Ue}var Ti=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A2=(1<<26)/Ti[Ti.length-1];function I2(x){var T,G=this.abs();if(G.t==1&&G[0]<=Ti[Ti.length-1]){for(T=0;T>1,x>Ti.length&&(x=Ti.length);for(var ve=n(),Ae=0;Ae>8&255,ps[ji++]^=x>>16&255,ps[ji++]^=x>>24&255,ji>=tw&&(ji-=tw)}function $O(){dbe(new Date().getTime())}if(ps==null){ps=new Array,ji=0;var ko;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var WO=new Uint8Array(32);for(window.crypto.getRandomValues(WO),ko=0;ko<32;++ko)ps[ji++]=WO[ko]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var YO=window.crypto.random(32);for(ko=0;ko>>8,ps[ji++]=ko&255;ji=0,$O()}function hbe(){if(R3==null){for($O(),R3=mbe(),R3.init(ps),ji=0;ji{l();(function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(o){return i(s(o),arguments)}function r(o,a){return e.apply(null,[o].concat(a||[]))}function i(o,a){var c=1,u=o.length,f,d="",h,p,y,b,E,v,A,R;for(h=0;h=0),y.type){case"b":f=parseInt(f,10).toString(2);break;case"c":f=String.fromCharCode(parseInt(f,10));break;case"d":case"i":f=parseInt(f,10);break;case"j":f=JSON.stringify(f,null,y.width?parseInt(y.width):0);break;case"e":f=y.precision?parseFloat(f).toExponential(y.precision):parseFloat(f).toExponential();break;case"f":f=y.precision?parseFloat(f).toFixed(y.precision):parseFloat(f);break;case"g":f=y.precision?String(Number(f.toPrecision(y.precision))):parseFloat(f);break;case"o":f=(parseInt(f,10)>>>0).toString(8);break;case"s":f=String(f),f=y.precision?f.substring(0,y.precision):f;break;case"t":f=String(!!f),f=y.precision?f.substring(0,y.precision):f;break;case"T":f=Object.prototype.toString.call(f).slice(8,-1).toLowerCase(),f=y.precision?f.substring(0,y.precision):f;break;case"u":f=parseInt(f,10)>>>0;break;case"v":f=f.valueOf(),f=y.precision?f.substring(0,y.precision):f;break;case"x":f=(parseInt(f,10)>>>0).toString(16);break;case"X":f=(parseInt(f,10)>>>0).toString(16).toUpperCase();break}t.json.test(y.type)?d+=f:(t.number.test(y.type)&&(!A||y.sign)?(R=A?"+":"-",f=f.toString().replace(t.sign,"")):R="",E=y.pad_char?y.pad_char==="0"?"0":y.pad_char.charAt(1):" ",v=y.width-(R+f).length,b=y.width&&v>0?E.repeat(v):"",d+=y.align?R+f+b:E==="0"?R+b+f:b+R+f)}return d}var n=Object.create(null);function s(o){if(n[o])return n[o];for(var a=o,c,u=[],f=0;a;){if((c=t.text.exec(a))!==null)u.push(c[0]);else if((c=t.modulo.exec(a))!==null)u.push("%");else if((c=t.placeholder.exec(a))!==null){if(c[2]){f|=1;var d=[],h=c[2],p=[];if((p=t.key.exec(h))!==null)for(d.push(p[1]);(h=h.substring(p[0].length))!=="";)if((p=t.key_access.exec(h))!==null)d.push(p[1]);else if((p=t.index_access.exec(h))!==null)d.push(p[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");c[2]=d}else f|=2;if(f===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:c[0],param_no:c[1],keys:c[2],sign:c[3],pad_char:c[4],align:c[5],width:c[6],precision:c[7],type:c[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(c[0].length)}return n[o]=u}typeof J8!="undefined"&&(J8.sprintf=e,J8.vsprintf=r),typeof window!="undefined"&&(window.sprintf=e,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:e,vsprintf:r}}))})()});var dR=m(Ac=>{l();"use strict";var HUe=Ac&&Ac.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),GUe=Ac&&Ac.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tfe=Ac&&Ac.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HUe(e,t,r);return GUe(e,t),e};Object.defineProperty(Ac,"__esModule",{value:!0});Ac.Address4=void 0;var rfe=tfe(uR()),ha=tfe(fR()),ife=Q8(),wm=lR(),h1=vm(),$Ue=function(){function t(e){this.groups=ha.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=rfe.isCorrect(ha.BITS),this.isInSubnet=rfe.isInSubnet,this.address=e;var r=ha.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,this.subnetMask<0||this.subnetMask>ha.BITS)throw new ife.AddressError("Invalid subnet mask.");e=e.replace(ha.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}return t.isValid=function(e){try{return new t(e),!0}catch(r){return!1}},t.prototype.parse=function(e){var r=e.split(".");if(!e.match(ha.RE_ADDRESS))throw new ife.AddressError("Invalid IPv4 address.");return r},t.prototype.correctForm=function(){return this.parsedAddress.map(function(e){return parseInt(e,10)}).join(".")},t.fromHex=function(e){var r=e.replace(/:/g,"").padStart(8,"0"),i=[],n;for(n=0;n<8;n+=2){var s=r.slice(n,n+2);i.push(parseInt(s,16))}return new t(i.join("."))},t.fromInteger=function(e){return t.fromHex(e.toString(16))},t.fromArpa=function(e){var r=e.replace(/(\.in-addr\.arpa)?\.$/,""),i=r.split(".").reverse().join(".");return new t(i)},t.prototype.toHex=function(){return this.parsedAddress.map(function(e){return h1.sprintf("%02x",parseInt(e,10))}).join(":")},t.prototype.toArray=function(){return this.parsedAddress.map(function(e){return parseInt(e,10)})},t.prototype.toGroup6=function(){var e=[],r;for(r=0;r%s.%s',e.slice(0,2).join("."),e.slice(2,4).join(".")))},t}();Ac.Address4=$Ue});var hR=m(ii=>{l();"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.RE_URL_WITH_PORT=ii.RE_URL=ii.RE_ZONE_STRING=ii.RE_SUBNET_STRING=ii.RE_BAD_ADDRESS=ii.RE_BAD_CHARACTERS=ii.TYPES=ii.SCOPES=ii.GROUPS=ii.BITS=void 0;ii.BITS=128;ii.GROUPS=8;ii.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};ii.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};ii.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;ii.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;ii.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;ii.RE_ZONE_STRING=/%.*$/;ii.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);ii.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var pR=m(Ic=>{l();"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.simpleGroup=Ic.spanLeadingZeroes=Ic.spanAll=Ic.spanAllZeroes=void 0;var nfe=vm();function sfe(t){return t.replace(/(0+)/g,'$1')}Ic.spanAllZeroes=sfe;function WUe(t,e){e===void 0&&(e=0);var r=t.split("");return r.map(function(i,n){return nfe.sprintf('%s',i,n+e,sfe(i))}).join("")}Ic.spanAll=WUe;function ofe(t){return t.replace(/^(0+)/,'$1')}function YUe(t){var e=t.split(":");return e.map(function(r){return ofe(r)}).join(":")}Ic.spanLeadingZeroes=YUe;function XUe(t,e){e===void 0&&(e=0);var r=t.split(":");return r.map(function(i,n){return/group-v4/.test(i)?i:nfe.sprintf('%s',n+e,ofe(i))})}Ic.simpleGroup=XUe});var afe=m(en=>{l();"use strict";var QUe=en&&en.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),ZUe=en&&en.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JUe=en&&en.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QUe(e,t,r);return ZUe(e,t),e};Object.defineProperty(en,"__esModule",{value:!0});en.possibleElisions=en.simpleRegularExpression=en.ADDRESS_BOUNDARY=en.padGroup=en.groupPossibilities=void 0;var eFe=JUe(hR()),p1=vm();function ev(t){return p1.sprintf("(%s)",t.join("|"))}en.groupPossibilities=ev;function tv(t){return t.length<4?p1.sprintf("0{0,%d}%s",4-t.length,t):t}en.padGroup=tv;en.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function tFe(t){var e=[];t.forEach(function(i,n){var s=parseInt(i,16);s===0&&e.push(n)});var r=e.map(function(i){return t.map(function(n,s){if(s===i){var o=s===0||s===eFe.GROUPS-1?":":"";return ev([tv(n),o])}return tv(n)}).join(":")});return r.push(t.map(tv).join(":")),ev(r)}en.simpleRegularExpression=tFe;function rFe(t,e,r){var i=e?"":":",n=r?"":":",s=[];!e&&!r&&s.push("::"),e&&r&&s.push(""),(r&&!e||!r&&e)&&s.push(":"),s.push(p1.sprintf("%s(:0{1,4}){1,%d}",i,t-1)),s.push(p1.sprintf("(0{1,4}:){1,%d}%s",t-1,n)),s.push(p1.sprintf("(0{1,4}:){%d}0{1,4}",t-1));for(var o=1;o{l();"use strict";var iFe=bo&&bo.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),nFe=bo&&bo.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rv=bo&&bo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iFe(e,t,r);return nFe(e,t),e},cfe=bo&&bo.__spreadArray||function(t,e){for(var r=0,i=e.length,n=t.length;r$1$2'),t=t.replace(/^(0{1,})(0)$/,'$1$2'),t}function aFe(t,e){var r=[],i=[],n;for(n=0;ne[1]&&i.push(t[n]);return r.concat(["compact"]).concat(i)}function ffe(t){return Gn.sprintf("%04x",parseInt(t,16))}function lfe(t){return t&255}var cFe=function(){function t(e,r){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=ufe.isInSubnet,this.isCorrect=ufe.isCorrect(Er.BITS),r===void 0?this.groups=Er.GROUPS:this.groups=r,this.address=e;var i=Er.RE_SUBNET_STRING.exec(e);if(i){if(this.parsedSubnet=i[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>Er.BITS)throw new Tu.AddressError("Invalid subnet mask.");e=e.replace(Er.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new Tu.AddressError("Invalid subnet mask.");var n=Er.RE_ZONE_STRING.exec(e);n&&(this.zone=n[0],e=e.replace(Er.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}return t.isValid=function(e){try{return new t(e),!0}catch(r){return!1}},t.fromBigInteger=function(e){var r=e.toString(16).padStart(32,"0"),i=[],n;for(n=0;n65536)&&(i=null)):i=null,{address:new t(r),port:i}},t.fromAddress4=function(e){var r=new sh.Address4(e),i=Er.BITS-(yR.BITS-r.subnetMask);return new t("::ffff:"+r.correctForm()+"/"+i)},t.fromArpa=function(e){var r=e.replace(/(\.ip6\.arpa)?\.$/,""),i=7;if(r.length!==63)throw new Tu.AddressError("Invalid 'ip6.arpa' form.");for(var n=r.split(".").reverse(),s=i;s>0;s--){var o=s*4;n.splice(o,0,":")}return r=n.join(""),new t(r)},t.prototype.microsoftTranscription=function(){return Gn.sprintf("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))},t.prototype.mask=function(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)},t.prototype.possibleSubnets=function(e){e===void 0&&(e=128);var r=Er.BITS-this.subnetMask,i=Math.abs(e-Er.BITS),n=r-i;return n<0?"0":sFe(new Hn.BigInteger("2",10).pow(n).toString(10))},t.prototype._startAddress=function(){return new Hn.BigInteger(this.mask()+"0".repeat(Er.BITS-this.subnetMask),2)},t.prototype.startAddress=function(){return t.fromBigInteger(this._startAddress())},t.prototype.startAddressExclusive=function(){var e=new Hn.BigInteger("1");return t.fromBigInteger(this._startAddress().add(e))},t.prototype._endAddress=function(){return new Hn.BigInteger(this.mask()+"1".repeat(Er.BITS-this.subnetMask),2)},t.prototype.endAddress=function(){return t.fromBigInteger(this._endAddress())},t.prototype.endAddressExclusive=function(){var e=new Hn.BigInteger("1");return t.fromBigInteger(this._endAddress().subtract(e))},t.prototype.getScope=function(){var e=Er.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"},t.prototype.getType=function(){for(var e=0,r=Object.keys(Er.TYPES);e0?e.omitSuffix?i:Gn.sprintf("%s.ip6.arpa.",i):e.omitSuffix?"":"ip6.arpa."},t.prototype.correctForm=function(){var e,r=[],i=0,n=[];for(e=0;e0&&(i>1&&n.push([e-i,e-1]),i=0)}i>1&&n.push([this.parsedAddress.length-i,this.parsedAddress.length-1]);var o=n.map(function(u){return u[1]-u[0]+1});if(n.length>0){var a=o.indexOf(Math.max.apply(Math,o));r=aFe(this.parsedAddress,n[a])}else r=this.parsedAddress;for(e=0;e1?"s":"",r.join("")),e.replace(Er.RE_BAD_CHARACTERS,'$1'));var i=e.match(Er.RE_BAD_ADDRESS);if(i)throw new Tu.AddressError(Gn.sprintf("Address failed regex: %s",i.join("")),e.replace(Er.RE_BAD_ADDRESS,'$1'));var n=[],s=e.split("::");if(s.length===2){var o=s[0].split(":"),a=s[1].split(":");o.length===1&&o[0]===""&&(o=[]),a.length===1&&a[0]===""&&(a=[]);var c=this.groups-(o.length+a.length);if(!c)throw new Tu.AddressError("Error parsing groups");this.elidedGroups=c,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(var u=0;u=0;s--)i=i.add(n.multiply(new Hn.BigInteger(e[s].toString(10),10))),n=n.multiply(r);return t.fromBigInteger(i)},t.prototype.isCanonical=function(){return this.addressMinusSuffix===this.canonicalForm()},t.prototype.isLinkLocal=function(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"},t.prototype.isMulticast=function(){return this.getType()==="Multicast"},t.prototype.is4=function(){return this.v4},t.prototype.isTeredo=function(){return this.isInSubnet(new t("2001::/32"))},t.prototype.is6to4=function(){return this.isInSubnet(new t("2002::/16"))},t.prototype.isLoopback=function(){return this.getType()==="Loopback"},t.prototype.href=function(e){return e===void 0?e="":e=Gn.sprintf(":%s",e),Gn.sprintf("http://[%s]%s/",this.correctForm(),e)},t.prototype.link=function(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);var r=this.correctForm;return e.v4&&(r=this.to4in6),e.className?Gn.sprintf('%2$s',e.prefix,r.call(this),e.className):Gn.sprintf('%2$s',e.prefix,r.call(this))},t.prototype.group=function(){if(this.elidedGroups===0)return gR.simpleGroup(this.address).join(":");iv(typeof this.elidedGroups=="number"),iv(typeof this.elisionBegin=="number");var e=[],r=this.address.split("::"),i=r[0],n=r[1];i.length?e.push.apply(e,gR.simpleGroup(i)):e.push("");for(var s=["hover-group"],o=this.elisionBegin;o',s.join(" "))),n.length?e.push.apply(e,gR.simpleGroup(n,this.elisionEnd)):e.push(""),this.is4()&&(iv(this.address4 instanceof sh.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")},t.prototype.regularExpressionString=function(e){e===void 0&&(e=!1);var r=[],i=new t(this.correctForm());if(i.elidedGroups===0)r.push(oh.simpleRegularExpression(i.parsedAddress));else if(i.elidedGroups===Er.GROUPS)r.push(oh.possibleElisions(Er.GROUPS));else{var n=i.address.split("::");n[0].length&&r.push(oh.simpleRegularExpression(n[0].split(":"))),iv(typeof i.elidedGroups=="number"),r.push(oh.possibleElisions(i.elidedGroups,n[0].length!==0,n[1].length!==0)),n[1].length&&r.push(oh.simpleRegularExpression(n[1].split(":"))),r=[r.join(":")]}return e||(r=cfe(cfe(["(?=^|",oh.ADDRESS_BOUNDARY,"|[^\\w\\:])("],r),[")(?=[^\\w\\:]|",oh.ADDRESS_BOUNDARY,"|$)"])),r.join("")},t.prototype.regularExpression=function(e){return e===void 0&&(e=!1),new RegExp(this.regularExpressionString(e),"i")},t}();bo.Address6=cFe});var hfe=m(On=>{l();"use strict";var uFe=On&&On.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),fFe=On&&On.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lFe=On&&On.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uFe(e,t,r);return fFe(e,t),e};Object.defineProperty(On,"__esModule",{value:!0});On.v6=On.AddressError=On.Address6=On.Address4=void 0;var dFe=dR();Object.defineProperty(On,"Address4",{enumerable:!0,get:function(){return dFe.Address4}});var hFe=dfe();Object.defineProperty(On,"Address6",{enumerable:!0,get:function(){return hFe.Address6}});var pFe=Q8();Object.defineProperty(On,"AddressError",{enumerable:!0,get:function(){return pFe.AddressError}});var yFe=lFe(pR());On.v6={helpers:yFe}});var wR=m((lPt,vR)=>{l();"use strict";var pfe=Ee(),gFe=Object.assign(pfe("libp2p:ip-port-to-multiaddr"),{error:pfe("libp2p:ip-port-to-multiaddr:err")}),{Multiaddr:mR}=rt(),bR=Jue(),{Address4:mFe,Address6:bFe}=hfe(),nv={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function vFe(t,e){if(typeof t!="string")throw bR(new Error(`invalid ip provided: ${t}`),nv.ERR_INVALID_IP_PARAMETER);if(typeof e=="string"&&(e=parseInt(e)),isNaN(e))throw bR(new Error(`invalid port provided: ${e}`),nv.ERR_INVALID_PORT_PARAMETER);try{return new mFe(t),new mR(`/ip4/${t}/tcp/${e}`)}catch{}try{let r=new bFe(t);return r.is4()?new mR(`/ip4/${r.to4().correctForm()}/tcp/${e}`):new mR(`/ip6/${t}/tcp/${e}`)}catch(r){let i=`invalid ip:port for creating a multiaddr: ${t}:${e}`;throw gFe.error(i),bR(new Error(i),nv.ERR_INVALID_IP)}}vR.exports=vFe;vR.exports.Errors=nv});var gfe=m((dPt,sv)=>{l();"use strict";var _R=class extends Error{constructor(e){super(e);this.name="TimeoutError"}},yfe=(t,e,r,i)=>{let n,s=new Promise((o,a)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){o(t);return}i={customTimers:{setTimeout,clearTimeout},...i},n=i.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{o(r())}catch(f){a(f)}return}let c=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,u=r instanceof Error?r:new _R(c);typeof t.cancel=="function"&&t.cancel(),a(u)},e),(async()=>{try{o(await t)}catch(c){a(c)}finally{i.customTimers.clearTimeout.call(void 0,n)}})()});return s.clear=()=>{clearTimeout(n),n=void 0},s};sv.exports=yfe;sv.exports.default=yfe;sv.exports.TimeoutError=_R});var _fe=m((hPt,wfe)=>{l();"use strict";var mfe=wc(),{CLOSE_TIMEOUT:wFe}=cR(),bfe=wR(),_Fe=gfe(),vfe=Ee(),ER=vfe("libp2p:websockets:socket");ER.error=vfe("libp2p:websockets:socket:error");wfe.exports=(t,e={})=>{let r={async sink(i){e.signal&&(i=mfe(i,e.signal));try{await t.sink(async function*(){for await(let n of i)yield n instanceof Uint8Array?n:n.slice()}())}catch(n){n.type!=="aborted"&&ER.error(n)}},source:e.signal?mfe(t.source,e.signal):t.source,conn:t,localAddr:e.localAddr||(t.localAddress&&t.localPort?bfe(t.localAddress,t.localPort):void 0),remoteAddr:e.remoteAddr||bfe(t.remoteAddress,t.remotePort),timeline:{open:Date.now()},async close(){let i=Date.now();try{await _Fe(t.close(),wFe)}catch(n){let{host:s,port:o}=r.remoteAddr.toOptions();ER("timeout closing stream to %s:%s after %dms, destroying it manually",s,o,Date.now()-i),t.destroy()}finally{r.timeline.close=Date.now()}}};return t.socket.once&&t.socket.once("close",()=>{r.timeline.close||(r.timeline.close=Date.now())}),r}});var xfe=m((pPt,Sfe)=>{l();"use strict";var ul=Bl(),{CODE_CIRCUIT:SR,CODE_P2P:xR,CODE_TCP:AR,CODE_WS:EFe,CODE_WSS:Efe}=cR();Sfe.exports={all:t=>t.filter(e=>{if(e.protoCodes().includes(SR))return!1;let r=e.decapsulateCode(xR);return ul.WebSockets.matches(r)||ul.WebSocketsSecure.matches(r)}),dnsWss:t=>t.filter(e=>{if(e.protoCodes().includes(SR))return!1;let r=e.decapsulateCode(xR);return ul.WebSocketsSecure.matches(r)&&ul.DNS.matches(r.decapsulateCode(AR).decapsulateCode(Efe))}),dnsWsOrWss:t=>t.filter(e=>{if(e.protoCodes().includes(SR))return!1;let r=e.decapsulateCode(xR);return ul.WebSockets.matches(r)?ul.DNS.matches(r.decapsulateCode(AR).decapsulateCode(EFe)):ul.WebSocketsSecure.matches(r)&&ul.DNS.matches(r.decapsulateCode(AR).decapsulateCode(Efe))})}});var Ofe=m((yPt,Cfe)=>{l();"use strict";var SFe=Wue(),xFe=P4(),AFe=Yb(),{AbortError:Afe}=wc(),IFe=fu(),Ife=Ee(),fl=Ife("libp2p:websockets");fl.error=Ife("libp2p:websockets:error");var Tfe=P2(),TFe=Xue(),RFe=_fe(),Rfe=xfe(),Pfe=class{constructor({upgrader:e,filter:r}){if(!e)throw new Error("An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.");this._upgrader=e,this._filter=r}async dial(e,r={}){fl("dialing %s",e);let i=await this._connect(e,r),n=RFe(i,{remoteAddr:e,signal:r.signal});fl("new outbound connection %s",n.remoteAddr);let s=await this._upgrader.upgradeOutbound(n);return fl("outbound connection %s upgraded",n.remoteAddr),s}async _connect(e,r={}){if(r.signal&&r.signal.aborted)throw new Afe;let i=e.toOptions();fl("dialing %s:%s",i.host,i.port);let n=IFe(),s=u=>{let f=`connection error: ${u.message}`;fl.error(f),n.reject(u)},o=SFe(AFe(e),Object.assign({binary:!0},r));if(o.socket.on?o.socket.on("error",s):o.socket.onerror=s,!r.signal)return await Promise.race([o.connected(),n.promise]),fl("connected %s",e),o;let a,c=new Promise((u,f)=>{if(a=()=>{f(new Afe),setTimeout(()=>{o.close()})},r.signal.aborted)return a();r.signal.addEventListener("abort",a)});try{await Promise.race([c,n.promise,o.connected()])}finally{r.signal.removeEventListener("abort",a)}return fl("connected %s",e),o}createListener(e={},r){return typeof e=="function"&&(r=e,e={}),TFe({handler:r,upgrader:this._upgrader},e)}filter(e){return e=Array.isArray(e)?e:[e],this._filter?this._filter(e):Tfe.isBrowser||Tfe.isWebWorker?Rfe.dnsWss(e):Rfe.all(e)}};Cfe.exports=xFe(Pfe,{className:"WebSockets",symbolName:"@libp2p/js-libp2p-websockets/websockets"})});var IR=m((gPt,Dfe)=>{l();"use strict";function kfe(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function PFe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return kfe(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),kfe(new n,r)}}Dfe.exports=PFe});var Nfe=m((mPt,Bfe)=>{l();Bfe.exports=function(){if(typeof globalThis=="undefined")return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}});var qfe=m((TR,Lfe)=>{l();var ov=Ht(),Tc=ov.Buffer;function Mfe(t,e){for(var r in t)e[r]=t[r]}Tc.from&&Tc.alloc&&Tc.allocUnsafe&&Tc.allocUnsafeSlow?Lfe.exports=ov:(Mfe(ov,TR),TR.Buffer=ah);function ah(t,e,r){return Tc(t,e,r)}ah.prototype=Object.create(Tc.prototype);Mfe(Tc,ah);ah.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Tc(t,e,r)};ah.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Tc(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ah.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Tc(t)};ah.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ov.SlowBuffer(t)}});var CR=m((bPt,PR)=>{l();"use strict";var RR=65536,CFe=4294967295;function OFe(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}var kFe=qfe().Buffer,av=globalThis.crypto||globalThis.msCrypto;av&&av.getRandomValues?PR.exports=DFe:PR.exports=OFe;function DFe(t,e){if(t>CFe)throw new RangeError("requested too many random bytes");var r=kFe.allocUnsafe(t);if(t>0)if(t>RR)for(var i=0;i{l();"use strict";function jfe(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function BFe(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=void 0),e!=null&&(r.code=e);try{return jfe(t,r)}catch(i){r.message=t.message,r.stack=t.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),jfe(new n,r)}}Ufe.exports=BFe});var DR=m((wPt,Hfe)=>{l();var NFe=Ee()("simple-peer"),Kfe=Nfe(),Vfe=CR(),MFe=YI(),OR=H5(),Sr=Ffe(),kR=64*1024,LFe=5*1e3,qFe=5*1e3;function zfe(t){return t.replace(/a=ice-options:trickle\s\n/g,"")}function jFe(t){console.warn(t)}var ll=class extends MFe.Duplex{constructor(e){e=Object.assign({allowHalfOpen:!1},e);super(e);if(this._id=Vfe(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||Vfe(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||ll.channelConfig,this.negotiated=this.channelConfig.negotiated,this.config=Object.assign({},ll.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(r=>r),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=e.trickle!==void 0?e.trickle:!0,this.allowHalfTrickle=e.allowHalfTrickle!==void 0?e.allowHalfTrickle:!1,this.iceCompleteTimeout=e.iceCompleteTimeout||LFe,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&typeof e.wrtc=="object"?e.wrtc:Kfe(),!this._wrtc)throw typeof window=="undefined"?Sr(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):Sr(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=this.negotiated?!1:!this.initiator,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._firstStable=!0,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(r){OR(()=>this.destroy(Sr(r,"ERR_PC_CONSTRUCTOR")));return}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=r=>{this._onIceCandidate(r)},this.initiator||this.negotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=r=>{this._setupData(r)},this.streams&&this.streams.forEach(r=>{this.addStream(r)}),this._pc.ontrack=r=>{this._onTrack(r)},this.initiator&&this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(this.destroyed)throw Sr(new Error("cannot signal after peer is destroyed"),"ERR_SIGNALING");if(typeof e=="string")try{e=JSON.parse(e)}catch(r){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(r=>{this._addIceCandidate(r)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(r=>{this.destroy(Sr(r,"ERR_SET_REMOTE_DESCRIPTION"))}),!e.sdp&&!e.candidate&&!e.renegotiate&&!e.transceiverRequest&&this.destroy(Sr(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}_addIceCandidate(e){var r=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(r).catch(i=>{!r.address||r.address.endsWith(".local")?jFe("Ignoring unsupported ICE candidate."):this.destroy(Sr(i,"ERR_ADD_ICE_CANDIDATE"))})}send(e){this._channel.send(e)}addTransceiver(e,r){if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,r),this._needsNegotiation()}catch(i){this.destroy(Sr(i,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{transceiverRequest:{kind:e,init:r}})}addStream(e){this._debug("addStream()"),e.getTracks().forEach(r=>{this.addTrack(r,e)})}addTrack(e,r){this._debug("addTrack()");var i=this._senderMap.get(e)||new Map,n=i.get(r);if(!n)n=this._pc.addTrack(e,r),i.set(r,n),this._senderMap.set(e,i),this._needsNegotiation();else throw n.removed?Sr(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):Sr(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(e,r,i){this._debug("replaceTrack()");var n=this._senderMap.get(e),s=n?n.get(i):null;if(!s)throw Sr(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");r&&this._senderMap.set(r,n),s.replaceTrack!=null?s.replaceTrack(r):this.destroy(Sr(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,r){this._debug("removeSender()");var i=this._senderMap.get(e),n=i?i.get(r):null;if(!n)throw Sr(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(s){s.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(n):this.destroy(Sr(s,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){this._debug("removeSenders()"),e.getTracks().forEach(r=>{this.removeTrack(r,e)})}_needsNegotiation(){this._debug("_needsNegotiation"),!this._batchedNegotiation&&(this._batchedNegotiation=!0,OR(()=>{this._batchedNegotiation=!1,this._debug("starting batched negotiation"),this.negotiate()}))}negotiate(){this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{renegotiate:!0})),this._isNegotiating=!0}_destroy(e,r){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(i){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(i){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,r(e)}_setupData(e){if(!e.channel)return this.destroy(Sr(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=kR),this.channelName=this._channel.label,this._channel.onmessage=i=>{this._onChannelMessage(i)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=i=>{this.destroy(Sr(i,"ERR_DATA_CHANNEL"))};var r=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(r&&this._onChannelClose(),r=!0):r=!1},qFe)}_read(){}_write(e,r,i){if(this.destroyed)return i(Sr(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(n){return this.destroy(Sr(n,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>kR?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=e,this._cb=i}_onFinish(){if(this.destroyed)return;let e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;!this.trickle&&!this.allowHalfTrickle&&(e.sdp=zfe(e.sdp)),e.sdp=this.sdpTransform(e.sdp);let r=()=>{if(!this.destroyed){var s=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:s.type,sdp:s.sdp})}},i=()=>{this._debug("createOffer success"),!this.destroyed&&(this.trickle||this._iceComplete?r():this.once("_iceComplete",r))},n=s=>{this.destroy(Sr(s,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(e).then(i).catch(n)}).catch(e=>{this.destroy(Sr(e,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{!e.mid&&e.sender.track&&!e.requested&&(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;!this.trickle&&!this.allowHalfTrickle&&(e.sdp=zfe(e.sdp)),e.sdp=this.sdpTransform(e.sdp);let r=()=>{if(!this.destroyed){var s=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:s.type,sdp:s.sdp}),this.initiator||this._requestMissingTransceivers()}},i=()=>{this.destroyed||(this.trickle||this._iceComplete?r():this.once("_iceComplete",r))},n=s=>{this.destroy(Sr(s,"ERR_SET_LOCAL_DESCRIPTION"))};this._pc.setLocalDescription(e).then(i).catch(n)}).catch(e=>{this.destroy(Sr(e,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(Sr(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(!this.destroyed){var e=this._pc.iceConnectionState,r=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,r),this.emit("iceStateChange",e,r),(e==="connected"||e==="completed")&&(this._pcReady=!0,this._maybeReady()),e==="failed"&&this.destroy(Sr(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),e==="closed"&&this.destroy(Sr(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}}getStats(e){let r=i=>(Object.prototype.toString.call(i.values)==="[object Array]"&&i.values.forEach(n=>{Object.assign(i,n)}),i);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(i=>{var n=[];i.forEach(s=>{n.push(r(s))}),e(null,n)},i=>e(i)):this._pc.getStats.length>0?this._pc.getStats(i=>{if(!this.destroyed){var n=[];i.result().forEach(s=>{var o={};s.names().forEach(a=>{o[a]=s.stat(a)}),o.id=s.id,o.type=s.type,o.timestamp=s.timestamp,n.push(r(o))}),e(null,n)}},i=>e(i)):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;let e=()=>{this.destroyed||this.getStats((r,i)=>{if(this.destroyed)return;r&&(i=[]);var n={},s={},o={},a=!1;i.forEach(f=>{(f.type==="remotecandidate"||f.type==="remote-candidate")&&(n[f.id]=f),(f.type==="localcandidate"||f.type==="local-candidate")&&(s[f.id]=f),(f.type==="candidatepair"||f.type==="candidate-pair")&&(o[f.id]=f)});let c=f=>{a=!0;var d=s[f.localCandidateId];d&&(d.ip||d.address)?(this.localAddress=d.ip||d.address,this.localPort=Number(d.port)):d&&d.ipAddress?(this.localAddress=d.ipAddress,this.localPort=Number(d.portNumber)):typeof f.googLocalAddress=="string"&&(d=f.googLocalAddress.split(":"),this.localAddress=d[0],this.localPort=Number(d[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");var h=n[f.remoteCandidateId];h&&(h.ip||h.address)?(this.remoteAddress=h.ip||h.address,this.remotePort=Number(h.port)):h&&h.ipAddress?(this.remoteAddress=h.ipAddress,this.remotePort=Number(h.portNumber)):typeof f.googRemoteAddress=="string"&&(h=f.googRemoteAddress.split(":"),this.remoteAddress=h[0],this.remotePort=Number(h[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(i.forEach(f=>{f.type==="transport"&&f.selectedCandidatePairId&&c(o[f.selectedCandidatePairId]),(f.type==="googCandidatePair"&&f.googActiveConnection==="true"||(f.type==="candidatepair"||f.type==="candidate-pair")&&f.selected)&&c(f)}),!a&&(!Object.keys(o).length||Object.keys(s).length)){setTimeout(e,100);return}else this._connecting=!1,this._connected=!0;if(this._chunk){try{this.send(this._chunk)}catch(f){return this.destroy(Sr(f,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');var u=this._cb;this._cb=null,u(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>kR||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&!this._firstStable&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation&&(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()),this._debug("negotiate"),this.emit("negotiate")),this._firstStable=!1,this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(!this.destroyed){var r=e.data;r instanceof ArrayBuffer&&(r=new Uint8Array(r)),this.push(r)}}_onChannelBufferedAmountLow(){if(!(this.destroyed||!this._cb)){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);var e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(r=>{this._debug("on track"),this.emit("track",e.track,r),this._remoteTracks.push({track:e.track,stream:r}),!this._remoteStreams.some(i=>i.id===r.id)&&(this._remoteStreams.push(r),OR(()=>{this.emit("stream",r)}))})}_debug(){var e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],NFe.apply(null,e)}};ll.WEBRTC_SUPPORT=!!Kfe();ll.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"};ll.channelConfig={};Hfe.exports=ll});var $fe=m((_Pt,Gfe)=>{l();"use strict";Gfe.exports={supportsFileReader:typeof self!="undefined"&&"FileReader"in self,supportsWebRTC:"RTCPeerConnection"in globalThis&&typeof navigator!="undefined"&&typeof navigator.mediaDevices!="undefined"&&"getUserMedia"in navigator.mediaDevices,supportsWebRTCDataChannels:"RTCPeerConnection"in globalThis}});var uv=m(cv=>{l();"use strict";cv.CODE_P2P=421;cv.CODE_CIRCUIT=290;cv.CLOSE_TIMEOUT=2e3});var BR=m((SPt,Wfe)=>{l();var UFe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,FFe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];Wfe.exports=function(e){var r=e,i=e.indexOf("["),n=e.indexOf("]");i!=-1&&n!=-1&&(e=e.substring(0,i)+e.substring(i,n).replace(/:/g,";")+e.substring(n,e.length));for(var s=UFe.exec(e||""),o={},a=14;a--;)o[FFe[a]]=s[a]||"";return i!=-1&&n!=-1&&(o.source=r,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=KFe(o,o.path),o.queryKey=VFe(o,o.query),o};function KFe(t,e){var r=/\/{2,9}/g,i=e.replace(r,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&i.splice(0,1),e.substr(e.length-1,1)=="/"&&i.splice(i.length-1,1),i}function VFe(t,e){var r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,n,s){n&&(r[n]=s)}),r}});var Xfe=m(fv=>{l();"use strict";Object.defineProperty(fv,"__esModule",{value:!0});fv.url=void 0;var zFe=BR(),Yfe=Ee()("socket.io-client:url");function HFe(t,e="",r){let i=t;r=r||typeof location!="undefined"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(Yfe("protocol-less url %s",t),typeof r!="undefined"?t=r.protocol+"//"+t:t="https://"+t),Yfe("parse %s",t),i=zFe(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let s=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+s+":"+i.port+e,i.href=i.protocol+"://"+s+(r&&r.port===i.port?"":":"+i.port),i}fv.url=HFe});var Qfe=m((APt,NR)=>{l();try{NR.exports=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(t){NR.exports=!1}});var y1=m((IPt,Zfe)=>{l();Zfe.exports=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())()});var MR=m((TPt,Jfe)=>{l();var GFe=Qfe(),$Fe=y1();Jfe.exports=function(t){let e=t.xdomain,r=t.xscheme,i=t.enablesXDR;try{if(typeof XMLHttpRequest!="undefined"&&(!e||GFe))return new XMLHttpRequest}catch(n){}try{if(typeof XDomainRequest!="undefined"&&!r&&i)return new XDomainRequest}catch(n){}if(!e)try{return new $Fe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(n){}}});var LR=m((RPt,tle)=>{l();var Rc=Object.create(null);Rc.open="0";Rc.close="1";Rc.ping="2";Rc.pong="3";Rc.message="4";Rc.upgrade="5";Rc.noop="6";var ele=Object.create(null);Object.keys(Rc).forEach(t=>{ele[Rc[t]]=t});var WFe={type:"error",data:"parser error"};tle.exports={PACKET_TYPES:Rc,PACKET_TYPES_REVERSE:ele,ERROR_PACKET:WFe}});var nle=m((PPt,ile)=>{l();var{PACKET_TYPES:YFe}=LR(),XFe=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",QFe=typeof ArrayBuffer=="function",ZFe=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,JFe=({type:t,data:e},r,i)=>XFe&&e instanceof Blob?r?i(e):rle(e,i):QFe&&(e instanceof ArrayBuffer||ZFe(e))?r?i(e):rle(new Blob([e]),i):i(YFe[t]+(e||"")),rle=(t,e)=>{let r=new FileReader;return r.onload=function(){let i=r.result.split(",")[1];e("b"+i)},r.readAsDataURL(t)};ile.exports=JFe});var sle=m(qR=>{l();(function(t){"use strict";qR.encode=function(e){var r=new Uint8Array(e),i,n=r.length,s="";for(i=0;i>2],s+=t[(r[i]&3)<<4|r[i+1]>>4],s+=t[(r[i+1]&15)<<2|r[i+2]>>6],s+=t[r[i+2]&63];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s},qR.decode=function(e){var r=e.length*.75,i=e.length,n,s=0,o,a,c,u;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var f=new ArrayBuffer(r),d=new Uint8Array(f);for(n=0;n>4,d[s++]=(a&15)<<4|c>>2,d[s++]=(c&3)<<6|u&63;return f}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")});var cle=m((OPt,ale)=>{l();var{PACKET_TYPES_REVERSE:jR,ERROR_PACKET:eKe}=LR(),tKe=typeof ArrayBuffer=="function",UR;tKe&&(UR=sle());var rKe=(t,e)=>{if(typeof t!="string")return{type:"message",data:ole(t,e)};let r=t.charAt(0);return r==="b"?{type:"message",data:iKe(t.substring(1),e)}:jR[r]?t.length>1?{type:jR[r],data:t.substring(1)}:{type:jR[r]}:eKe},iKe=(t,e)=>{if(UR){let r=UR.decode(t);return ole(r,e)}else return{base64:!0,data:t}},ole=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}};ale.exports=rKe});var g1=m((kPt,dle)=>{l();var ule=nle(),fle=cle(),lle=String.fromCharCode(30),nKe=(t,e)=>{let r=t.length,i=new Array(r),n=0;t.forEach((s,o)=>{ule(s,!1,a=>{i[o]=a,++n===r&&e(i.join(lle))})})},sKe=(t,e)=>{let r=t.split(lle),i=[];for(let n=0;n{l();typeof FR!="undefined"&&(FR.exports=Cs);function Cs(t){if(t)return oKe(t)}function oKe(t){for(var e in Cs.prototype)t[e]=Cs.prototype[e];return t}Cs.prototype.on=Cs.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Cs.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};Cs.prototype.off=Cs.prototype.removeListener=Cs.prototype.removeAllListeners=Cs.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n{l();var lv=y1();KR.exports.pick=(t,...e)=>e.reduce((r,i)=>(t.hasOwnProperty(i)&&(r[i]=t[i]),r),{});var aKe=setTimeout,cKe=clearTimeout;KR.exports.installTimerFunctions=(t,e)=>{e.useNativeTimers?(t.setTimeoutFn=aKe.bind(lv),t.clearTimeoutFn=cKe.bind(lv)):(t.setTimeoutFn=setTimeout.bind(lv),t.clearTimeoutFn=clearTimeout.bind(lv))}});var dv=m((NPt,ple)=>{l();var uKe=g1(),fKe=m1(),{installTimerFunctions:lKe}=b1(),dKe=Ee()("engine.io-client:transport"),hle=class extends fKe{constructor(e){super();lKe(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,r){let i=new Error(e);return i.type="TransportError",i.description=r,this.emit("error",i),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):dKe("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,this.emit("open")}onData(e){let r=uKe.decodePacket(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){this.emit("packet",e)}onClose(){this.readyState="closed",this.emit("close")}};ple.exports=hle});var hv=m(VR=>{l();VR.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e};VR.decode=function(t){for(var e={},r=t.split("&"),i=0,n=r.length;i{l();"use strict";var yle="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pv=64,gle={},mle=0,dl=0,ble;function zR(t){var e="";do e=yle[t%pv]+e,t=Math.floor(t/pv);while(t>0);return e}function hKe(t){var e=0;for(dl=0;dl{l();var pKe=dv(),yKe=hv(),wle=g1(),gKe=GR(),pa=Ee()("engine.io-client:polling"),_le=class extends pKe{get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let r=()=>{pa("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(pa("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){pa("pre-pause polling complete"),--i||r()})),this.writable||(pa("we are currently writing - waiting to pause"),i++,this.once("drain",function(){pa("pre-pause writing complete"),--i||r()}))}else r()}poll(){pa("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}onData(e){pa("polling got data %s",e);let r=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose(),!1;this.onPacket(i)};wle.decodePayload(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():pa('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{pa("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(pa("transport open - closing"),e()):(pa("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,wle.encodePayload(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emit("drain")})})}uri(){let e=this.query||{},r=this.opts.secure?"https":"http",i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=gKe()),!this.supportsBinary&&!e.sid&&(e.b64=1),e=yKe.encode(e),this.opts.port&&(r==="https"&&Number(this.opts.port)!==443||r==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),e.length&&(e="?"+e);let n=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(n?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+e}};Ele.exports=_le});var Tle=m((jPt,YR)=>{l();var Sle=MR(),mKe=$R(),bKe=m1(),{pick:vKe,installTimerFunctions:wKe}=b1(),_Ke=y1(),WR=Ee()("engine.io-client:polling-xhr");function xle(){}var EKe=function(){return new Sle({xdomain:!1}).responseType!=null}(),Ale=class extends mKe{constructor(e){super(e);if(typeof location!="undefined"){let i=location.protocol==="https:",n=location.port;n||(n=i?443:80),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==i}let r=e&&e.forceBase64;this.supportsBinary=EKe&&!r}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new vo(this.uri(),e)}doWrite(e,r){let i=this.request({method:"POST",data:e});i.on("success",r),i.on("error",n=>{this.onError("xhr post error",n)})}doPoll(){WR("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",r=>{this.onError("xhr poll error",r)}),this.pollXhr=e}},vo=class extends bKe{constructor(e,r){super();wKe(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.create()}create(){let e=vKe(this.opts,"agent","enablesXDR","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let r=this.xhr=new Sle(e);try{WR("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch(i){}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(i){}try{r.setRequestHeader("Accept","*/*")}catch(i){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),this.hasXDR()?(r.onload=()=>{this.onLoad()},r.onerror=()=>{this.onError(r.responseText)}):r.onreadystatechange=()=>{r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},WR("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document!="undefined"&&(this.index=vo.requestsCount++,vo.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(e){this.emit("data",e),this.onSuccess()}onError(e){this.emit("error",e),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=xle:this.xhr.onreadystatechange=xle,e)try{this.xhr.abort()}catch(r){}typeof document!="undefined"&&delete vo.requests[this.index],this.xhr=null}}onLoad(){let e=this.xhr.responseText;e!==null&&this.onData(e)}hasXDR(){return typeof XDomainRequest!="undefined"&&!this.xs&&this.enablesXDR}abort(){this.cleanup()}};vo.requestsCount=0;vo.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",Ile);else if(typeof addEventListener=="function"){let t="onpagehide"in _Ke?"pagehide":"unload";addEventListener(t,Ile,!1)}}function Ile(){for(let t in vo.requests)vo.requests.hasOwnProperty(t)&&vo.requests[t].abort()}YR.exports=Ale;YR.exports.Request=vo});var Ole=m((UPt,Cle)=>{l();var SKe=$R(),Rle=y1(),xKe=/\n/g,AKe=/\\n/g,yv,Ple=class extends SKe{constructor(e){super(e);this.query=this.query||{},yv||(yv=Rle.___eio=Rle.___eio||[]),this.index=yv.length,yv.push(this.onData.bind(this)),this.query.j=this.index}get supportsBinary(){return!1}doClose(){this.script&&(this.script.onerror=()=>{},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),super.doClose()}doPoll(){let e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=n=>{this.onError("jsonp poll error",n)};let r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,typeof navigator!="undefined"&&/gecko/i.test(navigator.userAgent)&&this.setTimeoutFn(function(){let n=document.createElement("iframe");document.body.appendChild(n),document.body.removeChild(n)},100)}doWrite(e,r){let i;if(!this.form){let o=document.createElement("form"),a=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=c,o.method="POST",o.setAttribute("accept-charset","utf-8"),a.name="d",o.appendChild(a),document.body.appendChild(o),this.form=o,this.area=a}this.form.action=this.uri();function n(){s(),r()}let s=()=>{if(this.iframe)try{this.form.removeChild(this.iframe)}catch(o){this.onError("jsonp polling iframe removal error",o)}try{let o='