@libp2p/ping 1.0.6-178fe2671 → 1.0.6-4e0135c7d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +14 -14
- package/package.json +6 -6
package/dist/index.min.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PPing = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PPing=(()=>{var
|
|
3
|
-
`)}return n};cr.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=Nn[e];if(!r){r=Nn[e]=[];for(var n=0;n<e.length;++n)r[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");for(var i=e.length,a=e.charAt(0),o=[0],n=0;n<t.length;n++){var s=r[t.charCodeAt(n)];if(s===void 0)return;for(var f=0,u=s;f<o.length;++f)u+=o[f]*i,o[f]=u&255,u>>=8;for(;u>0;)o.push(u&255),u>>=8}for(var c=0;t[c]===a&&c<t.length-1;++c)o.push(0);return typeof Buffer<"u"?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function Ja(t,e){var r=0,n=e.length,i=e.charAt(0),a=[0];for(r=0;r<t.length();++r){for(var o=0,s=t.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var f="";for(r=0;t.at(r)===0&&r<t.length()-1;++r)f+=i;for(r=a.length-1;r>=0;--r)f+=e[a[r]];return f}});var Y=q((xc,On)=>{var Pn=F(),Kn=kn(),d=On.exports=Pn.util=Pn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){d.nextTick=process.nextTick,typeof setImmediate=="function"?d.setImmediate=setImmediate:d.setImmediate=d.nextTick;return}if(typeof setImmediate=="function"){d.setImmediate=function(){return setImmediate.apply(void 0,arguments)},d.nextTick=function(s){return setImmediate(s)};return}if(d.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(f){if(f.source===window&&f.data===t){f.stopPropagation();var u=e.slice();e.length=0,u.forEach(function(c){c()})}};var o=s,t="forge.setImmediate",e=[];d.setImmediate=function(f){e.push(f),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var f=e.slice();e.length=0,f.forEach(function(u){u()})}).observe(i,{attributes:!0});var a=d.setImmediate;d.setImmediate=function(f){Date.now()-r>15?(r=Date.now(),a(f)):(e.push(f),e.length===1&&i.setAttribute("a",n=!n))}}d.nextTick=d.setImmediate})();d.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;d.globalScope=function(){return d.isNodejs?globalThis:typeof self>"u"?window:self}();d.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};d.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};d.isArrayBufferView=function(t){return t&&d.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function ue(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}d.ByteBuffer=hr;function hr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(d.isArrayBuffer(t)||d.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof hr||typeof t=="object"&&typeof t.data=="string"&&typeof t.read=="number")&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}d.ByteStringBuffer=hr;var Za=4096;d.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>Za&&(this.data.substr(0,1),this._constructedStringLength=0)};d.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};d.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};d.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};d.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};d.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};d.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(d.encodeUtf8(t))};d.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};d.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};d.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))};d.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};d.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};d.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))};d.ByteStringBuffer.prototype.putInt=function(t,e){ue(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};d.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)};d.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())};d.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};d.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t};d.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t};d.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t};d.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t};d.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t};d.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t};d.ByteStringBuffer.prototype.getInt=function(t){ue(t);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),t-=8;while(t>0);return e};d.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};d.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};d.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};d.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};d.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};d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};d.ByteStringBuffer.prototype.copy=function(){var t=d.createBuffer(this.data);return t.read=this.read,t};d.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};d.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};d.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};d.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};function ja(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=d.isArrayBuffer(t),n=d.isArrayBufferView(t);if(r||n){r?this.data=new DataView(t):this.data=new DataView(t.buffer,t.byteOffset,t.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,t!=null&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}d.DataBuffer=ja;d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};d.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};d.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};d.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this};d.DataBuffer.prototype.putBytes=function(t,e){if(d.isArrayBufferView(t)){var r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(d.isArrayBuffer(t)){var r=new Uint8Array(t);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(t instanceof d.DataBuffer||typeof t=="object"&&typeof t.read=="number"&&typeof t.write=="number"&&d.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length());this.accommodate(r.byteLength);var i=new Uint8Array(t.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(t instanceof d.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary",typeof t=="string"){var a;if(e==="hex")return this.accommodate(Math.ceil(t.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(t,a,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(t.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.base64.decode(t,a,this.write),this;if(e==="utf8"&&(t=d.encodeUtf8(t),e="binary"),e==="binary"||e==="raw")return this.accommodate(t.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.raw.decode(a),this;if(e==="utf16")return this.accommodate(t.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=d.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)};d.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this};d.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")};d.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this};d.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};d.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};d.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};d.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};d.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};d.DataBuffer.prototype.putInt=function(t,e){ue(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};d.DataBuffer.prototype.putSignedInt=function(t,e){return ue(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)};d.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};d.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t};d.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t};d.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t};d.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t};d.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t};d.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t};d.DataBuffer.prototype.getInt=function(t){ue(t);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),t-=8;while(t>0);return e};d.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e};d.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};d.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};d.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};d.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)};d.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};d.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};d.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};d.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t};d.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if(t=t||"utf8",t==="binary"||t==="raw")return d.binary.raw.encode(e);if(t==="hex")return d.binary.hex.encode(e);if(t==="base64")return d.binary.base64.encode(e);if(t==="utf8")return d.text.utf8.decode(e);if(t==="utf16")return d.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)};d.createBuffer=function(t,e){return e=e||"raw",t!==void 0&&e==="utf8"&&(t=d.encodeUtf8(t)),new d.ByteBuffer(t)};d.fillString=function(t,e){for(var r="";e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};d.xorBytes=function(t,e,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a,n};d.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e};d.bytesToHex=function(t){return d.createBuffer(t).toHex()};d.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_t=[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],Un="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";d.encode64=function(t,e){for(var r="",n="",i,a,o,s=0;s<t.length;)i=t.charCodeAt(s++),a=t.charCodeAt(s++),o=t.charCodeAt(s++),r+=It.charAt(i>>2),r+=It.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=It.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":It.charAt(o&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r
|
|
4
|
-
`,r=r.substr(
|
|
5
|
-
`,r=r.substr(e));return n+=r,n};d.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,o,s,f=0,u=r;f<t.length;)i=_t[t.charCodeAt(f++)-43],a=_t[t.charCodeAt(f++)-43],o=_t[t.charCodeAt(f++)-43],s=_t[t.charCodeAt(f++)-43],n[u++]=i<<2|a>>4,o!==64&&(n[u++]=(a&15)<<4|o>>2,s!==64&&(n[u++]=(o&3)<<6|s));return e?u-r:n.subarray(0,u)};d.binary.base58.encode=function(t,e){return d.binary.baseN.encode(t,Un,e)};d.binary.base58.decode=function(t,e){return d.binary.baseN.decode(t,Un,e)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(t,e,r){t=d.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var i=r,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n};d.text.utf8.decode=function(t){return d.decodeUtf8(String.fromCharCode.apply(null,t))};d.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,o=r,s=0;s<t.length;++s)i[o++]=t.charCodeAt(s),a+=2;return e?a-r:n};d.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))};d.deflate=function(t,e,r){if(e=d.decode64(t.deflate(d.encode64(e)).rval),r){var n=2,i=e.charCodeAt(1);i&32&&(n=6),e=e.substring(n,e.length-4)}return e};d.inflate=function(t,e,r){var n=t.inflate(d.encode64(e)).rval;return n===null?null:d.decode64(n)};var lr=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(r===null?n=t.removeItem(e):(r=d.encode64(JSON.stringify(r)),n=t.setItem(e,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},pr=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(d.decode64(r))),r},t0=function(t,e,r,n){var i=pr(t,e);i===null&&(i={}),i[r]=n,lr(t,e,i)},e0=function(t,e,r){var n=pr(t,e);return n!==null&&(n=r in n?n[r]:null),n},r0=function(t,e,r){var n=pr(t,e);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),lr(t,e,n)}},n0=function(t,e){lr(t,e,null)},Ae=function(t,e,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if(i==="flash"||i==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),a=i==="flash"}(i==="web"||i==="both")&&(e[0]=localStorage,n=t.apply(this,e),a=!0)}catch(f){o=f}if(a)break}if(!a)throw o;return n};d.setItem=function(t,e,r,n,i){Ae(t0,arguments,i)};d.getItem=function(t,e,r,n){return Ae(e0,arguments,n)};d.removeItem=function(t,e,r,n){Ae(r0,arguments,n)};d.clearItems=function(t,e,r){Ae(n0,arguments,r)};d.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};d.format=function(t){for(var e=/%./g,r,n,i=0,a=[],o=0;r=e.exec(t);){n=t.substring(o,e.lastIndex-2),n.length>0&&a.push(n),o=e.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(t.substring(o)),a.join("")};d.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,o=r===void 0?",":r,s=n===void 0?".":n,f=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=u.length>3?u.length%3:0;return f+(c?u.substr(0,c)+s:"")+u.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-u).toFixed(a).slice(2):"")};d.formatSize=function(t){return t>=1073741824?t=d.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=d.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=d.formatNumber(t/1024,0)+" KiB":t=d.formatNumber(t,0)+" bytes",t};d.bytesFromIP=function(t){return t.indexOf(".")!==-1?d.bytesFromIPv4(t):t.indexOf(":")!==-1?d.bytesFromIPv6(t):null};d.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=d.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};d.bytesFromIPv6=function(t){var e=0;t=t.split(":").filter(function(o){return o.length===0&&++e,!0});for(var r=(8-t.length+e)*2,n=d.createBuffer(),i=0;i<8;++i){if(!t[i]||t[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=d.hexToBytes(t[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};d.bytesToIP=function(t){return t.length===4?d.bytesToIPv4(t):t.length===16?d.bytesToIPv6(t):null};d.bytesToIPv4=function(t){if(t.length!==4)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")};d.bytesToIPv6=function(t){if(t.length!==16)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var a=d.bytesToHex(t[i]+t[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var o=r[r.length-1],s=e.length;!o||s!==o.end+1?r.push({start:s,end:s}):(o.end=s,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1))}e.push(a)}if(r.length>0){var f=r[n];f.end-f.start>0&&(e.splice(f.start,f.end-f.start+1,""),f.start===0&&e.unshift(""),f.end===7&&e.push(""))}return e.join(":")};d.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in d&&!t.update)return e(null,d.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return d.cores=navigator.hardwareConcurrency,e(null,d.cores);if(typeof Worker>"u")return d.cores=1,e(null,d.cores);if(typeof Blob>"u")return d.cores=2,e(null,d.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var s=Date.now(),f=s+4;Date.now()<f;);self.postMessage({st:s,et:f})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(o,s,f){if(s===0){var u=Math.floor(o.reduce(function(c,h){return c+h},0)/o.length);return d.cores=Math.max(1,u),URL.revokeObjectURL(r),e(null,d.cores)}i(f,function(c,h){o.push(a(f,h)),n(o,s-1,f)})}function i(o,s){for(var f=[],u=[],c=0;c<o;++c){var h=new Worker(r);h.addEventListener("message",function(p){if(u.push(p.data),u.length===o){for(var g=0;g<o;++g)f[g].terminate();s(null,u)}}),f.push(h)}for(var c=0;c<o;++c)f[c].postMessage(c)}function a(o,s){for(var f=[],u=0;u<o;++u)for(var c=s[u],h=f[u]=[],p=0;p<o;++p)if(u!==p){var g=s[p];(c.st>g.st&&c.st<g.et||g.st>c.st&&g.st<c.et)&&h.push(p)}return f.reduce(function(l,x){return Math.max(l,x.length)},0)}}});var yr=q((gc,Mn)=>{var X=F();Y();Mn.exports=X.cipher=X.cipher||{};X.cipher.algorithms=X.cipher.algorithms||{};X.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=X.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new X.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};X.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=X.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new X.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};X.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),X.cipher.algorithms[t]=e};X.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in X.cipher.algorithms?X.cipher.algorithms[t]:null};var dr=X.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)};dr.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=X.util.createBuffer(),this.output=t.output||X.util.createBuffer(),this.mode.start(e)};dr.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()};dr.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 gr=q((mc,Fn)=>{var J=F();Y();J.cipher=J.cipher||{};var k=Fn.exports=J.cipher.modes=J.cipher.modes||{};k.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)};k.ecb.prototype.start=function(t){};k.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};k.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};k.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};k.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};k.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)};k.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=Ce(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};k.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};k.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};k.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0};k.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};k.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=J.util.createBuffer(),this._partialBytes=0};k.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ce(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};k.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};k.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};k.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=J.util.createBuffer(),this._partialBytes=0};k.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ce(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};k.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};k.ofb.prototype.decrypt=k.ofb.prototype.encrypt;k.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=J.util.createBuffer(),this._partialBytes=0};k.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Ce(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};k.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Te(this._inBlock)};k.ctr.prototype.decrypt=k.ctr.prototype.encrypt;k.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=J.util.createBuffer(),this._partialBytes=0,this._R=3774873600};k.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=J.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=J.util.createBuffer(t.additionalData):r=J.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=J.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 n=e.length();if(n===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(xr(n*8)))}this._inBlock=this._j0.slice(0),Te(this._inBlock),this._partialBytes=0,r=J.util.createBuffer(r),this._aDataLength=xr(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};k.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Te(this._inBlock)};k.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Te(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 i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};k.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=J.util.createBuffer();var n=this._aDataLength.concat(xr(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};k.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){var a=t[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};k.gcm.prototype.pow=function(t,e){for(var r=t[3]&1,n=3;n>0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};k.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=t[n]>>>(7-r%8)*4&15,a=this._m[r][i];e[0]^=a[0],e[1]^=a[1],e[2]^=a[2],e[3]^=a[3]}return e};k.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)};k.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],f=o/n|0,u=(n-1-o%n)*e;s[f]=1<<e-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,t),e)}return a};k.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],f=i[o];i[a+o]=[s[0]^f[0],s[1]^f[1],s[2]^f[2],s[3]^f[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[t[0]^u[0],t[1]^u[1],t[2]^u[2],t[3]^u[3]]}return i};function Ce(t,e){if(typeof t=="string"&&(t=J.util.createBuffer(t)),J.util.isArray(t)&&t.length>4){var r=t;t=J.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!J.util.isArray(t)){for(var i=[],a=e/4,n=0;n<a;++n)i.push(t.getInt32());t=i}return t}function Te(t){t[t.length-1]=t[t.length-1]+1&4294967295}function xr(t){return[t/4294967296|0,t&4294967295]}});var _e=q((vc,Hn)=>{var V=F();yr();gr();Y();Hn.exports=V.aes=V.aes||{};V.aes.startEncrypting=function(t,e,r,n){var i=Ie({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i};V.aes.createEncryptionCipher=function(t,e){return Ie({key:t,output:null,decrypt:!1,mode:e})};V.aes.startDecrypting=function(t,e,r,n){var i=Ie({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i};V.aes.createDecryptionCipher=function(t,e){return Ie({key:t,output:null,decrypt:!0,mode:e})};V.aes.Algorithm=function(t,e){br||qn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(n,i){return vr(r._w,n,i,!1)},decrypt:function(n,i){return vr(r._w,n,i,!0)}}}),r._init=!1};V.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=V.util.createBuffer(e);else if(V.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=V.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(!V.util.isArray(e)){r=e,e=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)e.push(r.getInt32())}}if(!V.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,o=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=zn(e,t.decrypt&&!o),this._init=!0}};V.aes._expandKey=function(t,e){return br||qn(),zn(t,e)};V.aes._updateBlock=vr;Wt("AES-ECB",V.cipher.modes.ecb);Wt("AES-CBC",V.cipher.modes.cbc);Wt("AES-CFB",V.cipher.modes.cfb);Wt("AES-OFB",V.cipher.modes.ofb);Wt("AES-CTR",V.cipher.modes.ctr);Wt("AES-GCM",V.cipher.modes.gcm);function Wt(t,e){var r=function(){return new V.aes.Algorithm(t,e)};V.cipher.registerAlgorithm(t,r)}var br=!1,Gt=4,nt,mr,Vn,kt,dt;function qn(){br=!0,Vn=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;nt=new Array(256),mr=new Array(256),kt=new Array(4),dt=new Array(4);for(var e=0;e<4;++e)kt[e]=new Array(256),dt[e]=new Array(256);for(var r=0,n=0,i,a,o,s,f,u,c,e=0;e<256;++e){s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^s&255^99,nt[r]=s,mr[s]=r,f=t[s],i=t[r],a=t[i],o=t[a],u=f<<24^s<<16^s<<8^(s^f),c=(i^a^o)<<24^(r^o)<<16^(r^a^o)<<8^(r^i^o);for(var h=0;h<4;++h)kt[h][r]=u,dt[h][s]=c,u=u<<24|u>>>8,c=c<<24|c>>>8;r===0?r=n=1:(r=i^t[t[t[i^o]]],n^=t[t[n]])}}function zn(t,e){for(var r=t.slice(0),n,i=1,a=r.length,o=a+6+1,s=Gt*o,f=a;f<s;++f)n=r[f-1],f%a===0?(n=nt[n>>>16&255]<<24^nt[n>>>8&255]<<16^nt[n&255]<<8^nt[n>>>24]^Vn[i]<<24,i++):a>6&&f%a===4&&(n=nt[n>>>24]<<24^nt[n>>>16&255]<<16^nt[n>>>8&255]<<8^nt[n&255]),r[f]=r[f-a]^n;if(e){var u,c=dt[0],h=dt[1],p=dt[2],g=dt[3],l=r.slice(0);s=r.length;for(var f=0,x=s-Gt;f<s;f+=Gt,x-=Gt)if(f===0||f===s-Gt)l[f]=r[x],l[f+1]=r[x+3],l[f+2]=r[x+2],l[f+3]=r[x+1];else for(var m=0;m<Gt;++m)u=r[x+m],l[f+(3&-m)]=c[nt[u>>>24]]^h[nt[u>>>16&255]]^p[nt[u>>>8&255]]^g[nt[u&255]];r=l}return r}function vr(t,e,r,n){var i=t.length/4-1,a,o,s,f,u;n?(a=dt[0],o=dt[1],s=dt[2],f=dt[3],u=mr):(a=kt[0],o=kt[1],s=kt[2],f=kt[3],u=nt);var c,h,p,g,l,x,m;c=e[0]^t[0],h=e[n?3:1]^t[1],p=e[2]^t[2],g=e[n?1:3]^t[3];for(var b=3,w=1;w<i;++w)l=a[c>>>24]^o[h>>>16&255]^s[p>>>8&255]^f[g&255]^t[++b],x=a[h>>>24]^o[p>>>16&255]^s[g>>>8&255]^f[c&255]^t[++b],m=a[p>>>24]^o[g>>>16&255]^s[c>>>8&255]^f[h&255]^t[++b],g=a[g>>>24]^o[c>>>16&255]^s[h>>>8&255]^f[p&255]^t[++b],c=l,h=x,p=m;r[0]=u[c>>>24]<<24^u[h>>>16&255]<<16^u[p>>>8&255]<<8^u[g&255]^t[++b],r[n?3:1]=u[h>>>24]<<24^u[p>>>16&255]<<16^u[g>>>8&255]<<8^u[c&255]^t[++b],r[2]=u[p>>>24]<<24^u[g>>>16&255]<<16^u[c>>>8&255]<<8^u[h&255]^t[++b],r[n?1:3]=u[g>>>24]<<24^u[c>>>16&255]<<16^u[h>>>8&255]<<8^u[p&255]^t[++b]}function Ie(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=V.cipher.createDecipher(r,t.key):n=V.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof V.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var De=q((Ah,di)=>{var de=F();de.pki=de.pki||{};var Gr=di.exports=de.pki.oids=de.oids=de.oids||{};function E(t,e){Gr[t]=e,Gr[e]=t}function M(t,e){Gr[t]=e}E("1.2.840.113549.1.1.1","rsaEncryption");E("1.2.840.113549.1.1.4","md5WithRSAEncryption");E("1.2.840.113549.1.1.5","sha1WithRSAEncryption");E("1.2.840.113549.1.1.7","RSAES-OAEP");E("1.2.840.113549.1.1.8","mgf1");E("1.2.840.113549.1.1.9","pSpecified");E("1.2.840.113549.1.1.10","RSASSA-PSS");E("1.2.840.113549.1.1.11","sha256WithRSAEncryption");E("1.2.840.113549.1.1.12","sha384WithRSAEncryption");E("1.2.840.113549.1.1.13","sha512WithRSAEncryption");E("1.3.101.112","EdDSA25519");E("1.2.840.10040.4.3","dsa-with-sha1");E("1.3.14.3.2.7","desCBC");E("1.3.14.3.2.26","sha1");E("1.3.14.3.2.29","sha1WithRSASignature");E("2.16.840.1.101.3.4.2.1","sha256");E("2.16.840.1.101.3.4.2.2","sha384");E("2.16.840.1.101.3.4.2.3","sha512");E("2.16.840.1.101.3.4.2.4","sha224");E("2.16.840.1.101.3.4.2.5","sha512-224");E("2.16.840.1.101.3.4.2.6","sha512-256");E("1.2.840.113549.2.2","md2");E("1.2.840.113549.2.5","md5");E("1.2.840.113549.1.7.1","data");E("1.2.840.113549.1.7.2","signedData");E("1.2.840.113549.1.7.3","envelopedData");E("1.2.840.113549.1.7.4","signedAndEnvelopedData");E("1.2.840.113549.1.7.5","digestedData");E("1.2.840.113549.1.7.6","encryptedData");E("1.2.840.113549.1.9.1","emailAddress");E("1.2.840.113549.1.9.2","unstructuredName");E("1.2.840.113549.1.9.3","contentType");E("1.2.840.113549.1.9.4","messageDigest");E("1.2.840.113549.1.9.5","signingTime");E("1.2.840.113549.1.9.6","counterSignature");E("1.2.840.113549.1.9.7","challengePassword");E("1.2.840.113549.1.9.8","unstructuredAddress");E("1.2.840.113549.1.9.14","extensionRequest");E("1.2.840.113549.1.9.20","friendlyName");E("1.2.840.113549.1.9.21","localKeyId");E("1.2.840.113549.1.9.22.1","x509Certificate");E("1.2.840.113549.1.12.10.1.1","keyBag");E("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");E("1.2.840.113549.1.12.10.1.3","certBag");E("1.2.840.113549.1.12.10.1.4","crlBag");E("1.2.840.113549.1.12.10.1.5","secretBag");E("1.2.840.113549.1.12.10.1.6","safeContentsBag");E("1.2.840.113549.1.5.13","pkcs5PBES2");E("1.2.840.113549.1.5.12","pkcs5PBKDF2");E("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");E("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");E("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");E("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");E("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");E("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");E("1.2.840.113549.2.7","hmacWithSHA1");E("1.2.840.113549.2.8","hmacWithSHA224");E("1.2.840.113549.2.9","hmacWithSHA256");E("1.2.840.113549.2.10","hmacWithSHA384");E("1.2.840.113549.2.11","hmacWithSHA512");E("1.2.840.113549.3.7","des-EDE3-CBC");E("2.16.840.1.101.3.4.1.2","aes128-CBC");E("2.16.840.1.101.3.4.1.22","aes192-CBC");E("2.16.840.1.101.3.4.1.42","aes256-CBC");E("2.5.4.3","commonName");E("2.5.4.4","surname");E("2.5.4.5","serialNumber");E("2.5.4.6","countryName");E("2.5.4.7","localityName");E("2.5.4.8","stateOrProvinceName");E("2.5.4.9","streetAddress");E("2.5.4.10","organizationName");E("2.5.4.11","organizationalUnitName");E("2.5.4.12","title");E("2.5.4.13","description");E("2.5.4.15","businessCategory");E("2.5.4.17","postalCode");E("2.5.4.42","givenName");E("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");E("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");E("2.16.840.1.113730.1.1","nsCertType");E("2.16.840.1.113730.1.13","nsComment");M("2.5.29.1","authorityKeyIdentifier");M("2.5.29.2","keyAttributes");M("2.5.29.3","certificatePolicies");M("2.5.29.4","keyUsageRestriction");M("2.5.29.5","policyMapping");M("2.5.29.6","subtreesConstraint");M("2.5.29.7","subjectAltName");M("2.5.29.8","issuerAltName");M("2.5.29.9","subjectDirectoryAttributes");M("2.5.29.10","basicConstraints");M("2.5.29.11","nameConstraints");M("2.5.29.12","policyConstraints");M("2.5.29.13","basicConstraints");E("2.5.29.14","subjectKeyIdentifier");E("2.5.29.15","keyUsage");M("2.5.29.16","privateKeyUsagePeriod");E("2.5.29.17","subjectAltName");E("2.5.29.18","issuerAltName");E("2.5.29.19","basicConstraints");M("2.5.29.20","cRLNumber");M("2.5.29.21","cRLReason");M("2.5.29.22","expirationDate");M("2.5.29.23","instructionCode");M("2.5.29.24","invalidityDate");M("2.5.29.25","cRLDistributionPoints");M("2.5.29.26","issuingDistributionPoint");M("2.5.29.27","deltaCRLIndicator");M("2.5.29.28","issuingDistributionPoint");M("2.5.29.29","certificateIssuer");M("2.5.29.30","nameConstraints");E("2.5.29.31","cRLDistributionPoints");E("2.5.29.32","certificatePolicies");M("2.5.29.33","policyMappings");M("2.5.29.34","policyConstraints");E("2.5.29.35","authorityKeyIdentifier");M("2.5.29.36","policyConstraints");E("2.5.29.37","extKeyUsage");M("2.5.29.46","freshestCRL");M("2.5.29.54","inhibitAnyPolicy");E("1.3.6.1.4.1.11129.2.4.2","timestampList");E("1.3.6.1.5.5.7.1.1","authorityInfoAccess");E("1.3.6.1.5.5.7.3.1","serverAuth");E("1.3.6.1.5.5.7.3.2","clientAuth");E("1.3.6.1.5.5.7.3.3","codeSigning");E("1.3.6.1.5.5.7.3.4","emailProtection");E("1.3.6.1.5.5.7.3.8","timeStamping")});var xe=q((Ch,xi)=>{var z=F();Y();De();var A=xi.exports=z.asn1=z.asn1||{};A.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};A.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};A.create=function(t,e,r,n,i){if(z.util.isArray(n)){for(var a=[],o=0;o<n.length;++o)n[o]!==void 0&&a.push(n[o]);n=a}var s={tagClass:t,type:e,constructed:r,composed:r||z.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=A.copy(s)),s};A.copy=function(t,e){var r;if(z.util.isArray(t)){r=[];for(var n=0;n<t.length;++n)r.push(A.copy(t[n],e));return r}return typeof t=="string"?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:A.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)};A.equals=function(t,e,r){if(z.util.isArray(t)){if(!z.util.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!A.equals(t[n],e[n]))return!1;return!0}if(typeof t!=typeof e)return!1;if(typeof t=="string")return t===e;var i=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&A.equals(t.value,e.value);return r&&r.includeBitStringContents&&(i=i&&t.bitStringContents===e.bitStringContents),i};A.getBerValueLength=function(t){var e=t.getByte();if(e!==128){var r,n=e&128;return n?r=t.getInt((e&127)<<3):r=e,r}};function ye(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}var lo=function(t,e){var r=t.getByte();if(e--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;ye(t,e,a),n=t.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};A.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof t=="string"&&(t=z.util.createBuffer(t));var r=t.length(),n=ke(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=t.length(),i}return n};function ke(t,e,r,n){var i;ye(t,e,2);var a=t.getByte();e--;var o=a&192,s=a&31;i=t.length();var f=lo(t,e);if(e-=i-t.length(),f!==void 0&&f>e){if(n.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=t.length(),u.remaining=e,u.requested=f,u}f=e}var c,h,p=(a&32)===32;if(p)if(c=[],f===void 0)for(;;){if(ye(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}i=t.length(),c.push(ke(t,e,r+1,n)),e-=i-t.length()}else for(;f>0;)i=t.length(),c.push(ke(t,f,r+1,n)),e-=i-t.length(),f-=i-t.length();if(c===void 0&&o===A.Class.UNIVERSAL&&s===A.Type.BITSTRING&&(h=t.bytes(f)),c===void 0&&n.decodeBitStrings&&o===A.Class.UNIVERSAL&&s===A.Type.BITSTRING&&f>1){var g=t.read,l=e,x=0;if(s===A.Type.BITSTRING&&(ye(t,e,1),x=t.getByte(),e--),x===0)try{i=t.length();var m={strict:!0,decodeBitStrings:!0},b=ke(t,e,r+1,m),w=i-t.length();e-=w,s==A.Type.BITSTRING&&w++;var B=b.tagClass;w===f&&(B===A.Class.UNIVERSAL||B===A.Class.CONTEXT_SPECIFIC)&&(c=[b])}catch{}c===void 0&&(t.read=g,e=l)}if(c===void 0){if(f===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=e}if(s===A.Type.BMPSTRING)for(c="";f>0;f-=2)ye(t,e,2),c+=String.fromCharCode(t.getInt16()),e-=2;else c=t.getBytes(f),e-=f}var L=h===void 0?null:{bitStringContents:h};return A.create(o,s,p,c,L)}A.toDer=function(t){var e=z.util.createBuffer(),r=t.tagClass|t.type,n=z.util.createBuffer(),i=!1;if("bitStringContents"in t&&(i=!0,t.original&&(i=A.equals(t,t.original))),i)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var a=0;a<t.value.length;++a)t.value[a]!==void 0&&n.putBuffer(A.toDer(t.value[a]))}else if(t.type===A.Type.BMPSTRING)for(var a=0;a<t.value.length;++a)n.putInt16(t.value.charCodeAt(a));else t.type===A.Type.INTEGER&&t.value.length>1&&(t.value.charCodeAt(0)===0&&!(t.value.charCodeAt(1)&128)||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var o=n.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);e.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)e.putByte(s.charCodeAt(a))}return e.putBuffer(n),e};A.oidToDer=function(t){var e=t.split("."),r=z.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,i,a,o,s=2;s<e.length;++s){n=!0,i=[],a=parseInt(e[s],10);do o=a&127,a=a>>>7,n||(o|=128),i.push(o),n=!1;while(a>0);for(var f=i.length-1;f>=0;--f)r.putByte(i[f])}return r};A.derToOid=function(t){var e;typeof t=="string"&&(t=z.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)r=t.getByte(),n=n<<7,r&128?n+=r&127:(e+="."+(n+r),n=0);return e};A.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var f=t.charAt(10),u=10;f!=="+"&&f!=="-"&&(s=parseInt(t.substr(10,2),10),u+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,0),u&&(f=t.charAt(u),f==="+"||f==="-")){var c=parseInt(t.substr(u+1,2),10),h=parseInt(t.substr(u+4,2),10),p=c*60+h;p*=6e4,f==="+"?e.setTime(+e-p):e.setTime(+e+p)}return e};A.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),f=0,u=0,c=!1;t.charAt(t.length-1)==="Z"&&(c=!0);var h=t.length-5,p=t.charAt(h);if(p==="+"||p==="-"){var g=parseInt(t.substr(h+1,2),10),l=parseInt(t.substr(h+4,2),10);u=g*60+l,u*=6e4,p==="+"&&(u*=-1),c=!0}return t.charAt(14)==="."&&(f=parseFloat(t.substr(14),10)*1e3),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,f),e.setTime(+e+u)):(e.setFullYear(r,n,i),e.setHours(a,o,s,f)),e};A.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 n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};A.dateToGeneralizedTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z",e};A.integerToDer=function(t){var e=z.util.createBuffer();if(t>=-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};A.derToInteger=function(t){typeof t=="string"&&(t=z.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)};A.validate=function(t,e,r,n){var i=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(i=!0,e.value&&z.util.isArray(e.value))for(var a=0,o=0;i&&o<e.value.length;++o)i=e.value[o].optional||!1,t.value[a]&&(i=A.validate(t.value[a],e.value[o],r,n),i?++a:e.value[o].optional&&(i=!0)),!i&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(i&&r&&(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)){var s;if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{var f=t.bitStringContents.charCodeAt(0);if(f!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');else n&&(t.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));return i};var yi=/[^\\u0000-\\u00ff]/;A.prettyPrint=function(t,e,r){var n="";e=e||0,r=r||2,e>0&&(n+=`
|
|
6
|
-
`);for(var i="",a=0;a<
|
|
7
|
-
`,n+=i+"Constructed: "+
|
|
8
|
-
`,t.composed){for(var o=0,s="",a=0;a<t.value.length;++a)t.value[a]!==void 0&&(o+=1,s+=A.prettyPrint(t.value[a],e+1,r),a+1<t.value.length&&(s+=","));n+=i+"Sub values: "+o+s}else{if(n+=i+"Value: ",t.type===A.Type.OID){var f=A.derToOid(t.value);n+=f,z.pki&&z.pki.oids&&f in z.pki.oids&&(n+=" ("+z.pki.oids[f]+") ")}if(t.type===A.Type.INTEGER)try{n+=A.derToInteger(t.value)}catch{n+="0x"+z.util.bytesToHex(t.value)}else if(t.type===A.Type.BITSTRING){if(t.value.length>1?n+="0x"+z.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var u=t.value.charCodeAt(0);u==1?n+=" (1 unused bit shown)":u>1&&(n+=" ("+u+" unused bits shown)")}}else if(t.type===A.Type.OCTETSTRING)yi.test(t.value)||(n+="("+t.value+") "),n+="0x"+z.util.bytesToHex(t.value);else if(t.type===A.Type.UTF8)try{n+=z.util.decodeUtf8(t.value)}catch(c){if(c.message==="URI malformed")n+="0x"+z.util.bytesToHex(t.value)+" (malformed UTF8)";else throw c}else t.type===A.Type.PRINTABLESTRING||t.type===A.Type.IA5String?n+=t.value:yi.test(t.value)?n+="0x"+z.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var vi=q((Th,mi)=>{var G=F();yr();gr();Y();mi.exports=G.des=G.des||{};G.des.startEncrypting=function(t,e,r,n){var i=Pe({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};G.des.createEncryptionCipher=function(t,e){return Pe({key:t,output:null,decrypt:!1,mode:e})};G.des.startDecrypting=function(t,e,r,n){var i=Pe({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return i.start(e),i};G.des.createDecryptionCipher=function(t,e){return Pe({key:t,output:null,decrypt:!0,mode:e})};G.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(n,i){return gi(r._keys,n,i,!1)},decrypt:function(n,i){return gi(r._keys,n,i,!0)}}}),r._init=!1};G.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=G.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=Eo(e),this._init=!0}};mt("DES-ECB",G.cipher.modes.ecb);mt("DES-CBC",G.cipher.modes.cbc);mt("DES-CFB",G.cipher.modes.cfb);mt("DES-OFB",G.cipher.modes.ofb);mt("DES-CTR",G.cipher.modes.ctr);mt("3DES-ECB",G.cipher.modes.ecb);mt("3DES-CBC",G.cipher.modes.cbc);mt("3DES-CFB",G.cipher.modes.cfb);mt("3DES-OFB",G.cipher.modes.ofb);mt("3DES-CTR",G.cipher.modes.ctr);function mt(t,e){var r=function(){return new G.des.Algorithm(t,e)};G.cipher.registerAlgorithm(t,r)}var po=[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],yo=[-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],xo=[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],go=[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],mo=[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],vo=[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],bo=[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],So=[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 Eo(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],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],x=t.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,B,L=0;L<x;L++){var I=t.getInt32(),T=t.getInt32();B=(I>>>4^T)&252645135,T^=B,I^=B<<4,B=(T>>>-16^I)&65535,I^=B,T^=B<<-16,B=(I>>>2^T)&858993459,T^=B,I^=B<<2,B=(T>>>-16^I)&65535,I^=B,T^=B<<-16,B=(I>>>1^T)&1431655765,T^=B,I^=B<<1,B=(T>>>8^I)&16711935,I^=B,T^=B<<8,B=(I>>>1^T)&1431655765,T^=B,I^=B<<1,B=I<<8|T>>>20&240,I=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=B;for(var P=0;P<b.length;++P){b[P]?(I=I<<2|I>>>26,T=T<<2|T>>>26):(I=I<<1|I>>>27,T=T<<1|T>>>27),I&=-15,T&=-15;var O=e[I>>>28]|r[I>>>24&15]|n[I>>>20&15]|i[I>>>16&15]|a[I>>>12&15]|o[I>>>8&15]|s[I>>>4&15],j=f[T>>>28]|u[T>>>24&15]|c[T>>>20&15]|h[T>>>16&15]|p[T>>>12&15]|g[T>>>8&15]|l[T>>>4&15];B=(j>>>16^O)&65535,m[w++]=O^B,m[w++]=j^B<<16}}return m}function gi(t,e,r,n){var i=t.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=e[0],f=e[1];o=(s>>>4^f)&252645135,f^=o,s^=o<<4,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,s=s<<1|s>>>31,f=f<<1|f>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],h=a[u+2],p=a[u];p!=c;p+=h){var g=f^t[p],l=(f>>>4|f<<28)^t[p+1];o=s,s=f,f=o^(yo[g>>>24&63]|go[g>>>16&63]|vo[g>>>8&63]|So[g&63]|po[l>>>24&63]|xo[l>>>16&63]|mo[l>>>8&63]|bo[l&63])}o=s,s=f,f=o}s=s>>>1|s<<31,f=f>>>1|f<<31,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(s>>>4^f)&252645135,f^=o,s^=o<<4,r[0]=s,r[1]=f}function Pe(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=G.cipher.createDecipher(r,t.key):n=G.cipher.createCipher(r,t.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof G.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var Kt=q((Ih,bi)=>{var Ke=F();bi.exports=Ke.md=Ke.md||{};Ke.md.algorithms=Ke.md.algorithms||{}});var Ei=q((_h,Si)=>{var At=F();Kt();Y();var Bo=Si.exports=At.hmac=At.hmac||{};Bo.create=function(){var t=null,e=null,r=null,n=null,i={};return i.start=function(a,o){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in At.md.algorithms)e=At.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else e=a;if(o===null)o=t;else{if(typeof o=="string")o=At.util.createBuffer(o);else if(At.util.isArray(o)){var s=o;o=At.util.createBuffer();for(var f=0;f<s.length;++f)o.putByte(s[f])}var u=o.length();u>e.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=At.util.createBuffer(),n=At.util.createBuffer(),u=o.length();for(var f=0;f<u;++f){var s=o.at(f);r.putByte(54^s),n.putByte(92^s)}if(u<e.blockLength)for(var s=e.blockLength-u,f=0;f<s;++f)r.putByte(54),n.putByte(92);t=o,r=r.bytes(),n=n.bytes()}e.start(),e.update(r)},i.update=function(a){e.update(a)},i.getMac=function(){var a=e.digest().bytes();return e.start(),e.update(n),e.update(a),e.digest()},i.digest=i.getMac,i}});var Ue=q(()=>{});var Wr=q((Nh,Bi)=>{var it=F();Ei();Kt();Y();var wo=it.pkcs5=it.pkcs5||{},Ct;it.util.isNodejs&&!it.options.usePureJavaScript&&(Ct=Ue());Bi.exports=it.pbkdf2=wo.pbkdf2=function(t,e,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),it.util.isNodejs&&!it.options.usePureJavaScript&&Ct.pbkdf2&&(i===null||typeof i!="object")&&(Ct.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?Ct.pbkdf2Sync.length===4?Ct.pbkdf2(t,e,r,n,function(B,L){if(B)return a(B);a(null,L.toString("binary"))}):Ct.pbkdf2(t,e,r,n,i,function(B,L){if(B)return a(B);a(null,L.toString("binary"))}):Ct.pbkdf2Sync.length===4?Ct.pbkdf2Sync(t,e,r,n).toString("binary"):Ct.pbkdf2Sync(t,e,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in it.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=it.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var f=Math.ceil(n/o),u=n-(f-1)*o,c=it.hmac.create();c.start(i,t);var h="",p,g,l;if(!a){for(var x=1;x<=f;++x){c.start(null,null),c.update(e),c.update(it.util.int32ToBytes(x)),p=l=c.digest().getBytes();for(var m=2;m<=r;++m)c.start(null,null),c.update(l),g=c.digest().getBytes(),p=it.util.xorBytes(p,g,o),l=g;h+=x<f?p:p.substr(0,u)}return h}var x=1,m;function b(){if(x>f)return a(null,h);c.start(null,null),c.update(e),c.update(it.util.int32ToBytes(x)),p=l=c.digest().getBytes(),m=2,w()}function w(){if(m<=r)return c.start(null,null),c.update(l),g=c.digest().getBytes(),p=it.util.xorBytes(p,g,o),l=g,++m,it.util.setImmediate(w);h+=x<f?p:p.substr(0,u),++x,b()}b()}});var Ci=q((Dh,Ai)=>{var Me=F();Y();var wi=Ai.exports=Me.pem=Me.pem||{};wi.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r
|
|
9
|
-
`,n;if(
|
|
10
|
-
`),r+=
|
|
11
|
-
`,r+="-----END "+
|
|
12
|
-
`,r};
|
|
13
|
-
`;for(var a=0,o=-1,i=0;i<
|
|
14
|
-
`+
|
|
15
|
-
`+s+e.substr(o+1),a=i-o-1,o=-1,++i}else(e[i]===" "||e[i]===" "||e[i]===",")&&(o=i);return e}function Ao(t){return t.replace(/^\s+/,"")}});var Ni=q((kh,Li)=>{var vt=F();Kt();Y();var Ii=Li.exports=vt.sha256=vt.sha256||{};vt.md.sha256=vt.md.algorithms.sha256=Ii;Ii.create=function(){_i||Co();var t=null,e=vt.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=vt.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=vt.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Ti(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=vt.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(Yr.substr(0,n.blockLength-o));for(var s,f,u=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)s=n.fullMessageLength[c+1]*8,f=s/4294967296>>>0,u+=f,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Ti(h,r,i);var p=vt.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},n};var Yr=null,_i=!1,Ri=null;function Co(){Yr="\x80",Yr+=vt.util.fillString("\0",64),Ri=[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],_i=!0}function Ti(t,e,r){for(var n,i,a,o,s,f,u,c,h,p,g,l,x,m,b,w=r.length();w>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=e[u-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=e[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(c=t.h0,h=t.h1,p=t.h2,g=t.h3,l=t.h4,x=t.h5,m=t.h6,b=t.h7,u=0;u<64;++u)o=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),s=m^l&(x^m),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),f=c&h|p&(c^h),n=b+o+s+Ri[u]+e[u],i=a+f,b=m,m=x,x=l,l=g+n>>>0,g=p,p=h,h=c,c=n+i>>>0;t.h0=t.h0+c|0,t.h1=t.h1+h|0,t.h2=t.h2+p|0,t.h3=t.h3+g|0,t.h4=t.h4+l|0,t.h5=t.h5+x|0,t.h6=t.h6+m|0,t.h7=t.h7+b|0,w-=64}}});var ki=q((Ph,Di)=>{var bt=F();Y();var Fe=null;bt.util.isNodejs&&!bt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Fe=Ue());var To=Di.exports=bt.prng=bt.prng||{};To.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();e.pools=n,e.pool=0,e.generate=function(u,c){if(!c)return e.generateSync(u);var h=e.plugin.cipher,p=e.plugin.increment,g=e.plugin.formatKey,l=e.plugin.formatSeed,x=bt.util.createBuffer();e.key=null,m();function m(b){if(b)return c(b);if(x.length()>=u)return c(null,x.getBytes(u));if(e.generated>1048575&&(e.key=null),e.key===null)return bt.util.nextTick(function(){a(m)});var w=h(e.key,e.seed);e.generated+=w.length,x.putBytes(w),e.key=g(h(e.key,p(e.seed))),e.seed=l(h(e.key,e.seed)),bt.util.setImmediate(m)}},e.generateSync=function(u){var c=e.plugin.cipher,h=e.plugin.increment,p=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var l=bt.util.createBuffer();l.length()<u;){e.generated>1048575&&(e.key=null),e.key===null&&o();var x=c(e.key,e.seed);e.generated+=x.length,l.putBytes(x),e.key=p(c(e.key,h(e.seed))),e.seed=g(c(e.key,e.seed))}return l.getBytes(u)};function a(u){if(e.pools[0].messageLength>=32)return s(),u();var c=32-e.pools[0].messageLength<<5;e.seedFile(c,function(h,p){if(h)return u(h);e.collect(p),s(),u()})}function o(){if(e.pools[0].messageLength>=32)return s();var u=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(u)),s()}function s(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var u=e.plugin.md.create();u.update(e.keyBytes);for(var c=1,h=0;h<32;++h)e.reseeds%c===0&&(u.update(e.pools[h].digest().getBytes()),e.pools[h].start()),c=c<<1;e.keyBytes=u.digest().getBytes(),u.start(),u.update(e.keyBytes);var p=u.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(p),e.generated=0}function f(u){var c=null,h=bt.util.globalScope,p=h.crypto||h.msCrypto;p&&p.getRandomValues&&(c=function(I){return p.getRandomValues(I)});var g=bt.util.createBuffer();if(c)for(;g.length()<u;){var l=Math.max(1,Math.min(u-g.length(),65536)/4),x=new Uint32Array(Math.floor(l));try{c(x);for(var m=0;m<x.length;++m)g.putInt32(x[m])}catch(I){if(!(typeof QuotaExceededError<"u"&&I instanceof QuotaExceededError))throw I}}if(g.length()<u)for(var b,w,B,L=Math.floor(Math.random()*65536);g.length()<u;){w=16807*(L&65535),b=16807*(L>>16),w+=(b&32767)<<16,w+=b>>15,w=(w&2147483647)+(w>>31),L=w&4294967295;for(var m=0;m<3;++m)B=L>>>(m<<3),B^=Math.floor(Math.random()*256),g.putByte(B&255)}return g.getBytes(u)}return Fe?(e.seedFile=function(u,c){Fe.randomBytes(u,function(h,p){if(h)return c(h);c(null,p.toString())})},e.seedFileSync=function(u){return Fe.randomBytes(u).toString()}):(e.seedFile=function(u,c){try{c(null,f(u))}catch(h){c(h)}},e.seedFileSync=f),e.collect=function(u){for(var c=u.length,h=0;h<c;++h)e.pools[e.pool].update(u.substr(h,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(u,c){for(var h="",p=0;p<c;p+=8)h+=String.fromCharCode(u>>p&255);e.collect(h)},e.registerWorker=function(u){if(u===self)e.seedFile=function(h,p){function g(l){var x=l.data;x.forge&&x.forge.prng&&(self.removeEventListener("message",g),p(x.forge.prng.err,x.forge.prng.bytes))}self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var c=function(h){var p=h.data;p.forge&&p.forge.prng&&e.seedFile(p.forge.prng.needed,function(g,l){u.postMessage({forge:{prng:{err:g,bytes:l}}})})};u.addEventListener("message",c)}},e}});var ge=q((Kh,Qr)=>{var Z=F();_e();Ni();ki();Y();(function(){if(Z.random&&Z.random.getBytes){Qr.exports=Z.random;return}(function(t){var e={},r=new Array(4),n=Z.util.createBuffer();e.formatKey=function(h){var p=Z.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),Z.aes._expandKey(h,!1)},e.formatSeed=function(h){var p=Z.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),h},e.cipher=function(h,p){return Z.aes._updateBlock(h,p,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=Z.md.sha256;function i(){var h=Z.prng.create(e);return h.getBytes=function(p,g){return h.generate(p,g)},h.getBytesSync=function(p){return h.generate(p)},h}var a=i(),o=null,s=Z.util.globalScope,f=s.crypto||s.msCrypto;if(f&&f.getRandomValues&&(o=function(h){return f.getRandomValues(h)}),Z.options.usePureJavaScript||!Z.util.isNodejs&&!o){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}t&&(t().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),t().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!Z.random)Z.random=a;else for(var c in a)Z.random[c]=a[c];Z.random.createInstance=i,Qr.exports=Z.random})(typeof jQuery<"u"?jQuery:null)})()});var Oi=q((Uh,Ui)=>{var ot=F();Y();var $r=[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],Pi=[1,2,3,5],Io=function(t,e){return t<<e&65535|(t&65535)>>16-e},_o=function(t,e){return(t&65535)>>e|t<<16-e&65535};Ui.exports=ot.rc2=ot.rc2||{};ot.rc2.expandKey=function(t,e){typeof t=="string"&&(t=ot.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),i=e,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=n;s<128;s++)r.putByte($r[r.at(s-1)+r.at(s-n)&255]);for(r.setAt(128-a,$r[r.at(128-a)&o]),s=127-a;s>=0;s--)r.setAt(s,$r[r.at(s+1)^r.at(s+a)]);return r};var Ki=function(t,e,r){var n=!1,i=null,a=null,o=null,s,f,u,c,h=[];for(t=ot.rc2.expandKey(t,e),u=0;u<64;u++)h.push(t.getInt16Le());r?(s=function(l){for(u=0;u<4;u++)l[u]+=h[c]+(l[(u+3)%4]&l[(u+2)%4])+(~l[(u+3)%4]&l[(u+1)%4]),l[u]=Io(l[u],Pi[u]),c++},f=function(l){for(u=0;u<4;u++)l[u]+=h[l[(u+3)%4]&63]}):(s=function(l){for(u=3;u>=0;u--)l[u]=_o(l[u],Pi[u]),l[u]-=h[c]+(l[(u+3)%4]&l[(u+2)%4])+(~l[(u+3)%4]&l[(u+1)%4]),c--},f=function(l){for(u=3;u>=0;u--)l[u]-=h[l[(u+3)%4]&63]});var p=function(l){var x=[];for(u=0;u<4;u++){var m=i.getInt16Le();o!==null&&(r?m^=o.getInt16Le():o.putInt16Le(m)),x.push(m&65535)}c=r?0:63;for(var b=0;b<l.length;b++)for(var w=0;w<l[b][0];w++)l[b][1](x);for(u=0;u<4;u++)o!==null&&(r?o.putInt16Le(x[u]):x[u]^=o.getInt16Le()),a.putInt16Le(x[u])},g=null;return g={start:function(l,x){l&&typeof l=="string"&&(l=ot.util.createBuffer(l)),n=!1,i=ot.util.createBuffer(),a=x||new ot.util.createBuffer,o=l,g.output=a},update:function(l){for(n||i.putBuffer(l);i.length()>=8;)p([[5,s],[1,f],[6,s],[1,f],[5,s]])},finish:function(l){var x=!0;if(r)if(l)x=l(8,i,!r);else{var m=i.length()===8?8:8-i.length();i.fillWithByte(m,m)}if(x&&(n=!0,g.update()),!r&&(x=i.length()===0,x))if(l)x=l(8,a,!r);else{var b=a.length(),w=a.at(b-1);w>b?x=!1:a.truncate(w)}return x}},g};ot.rc2.startEncrypting=function(t,e,r){var n=ot.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};ot.rc2.createEncryptionCipher=function(t,e){return Ki(t,e,!0)};ot.rc2.startDecrypting=function(t,e,r){var n=ot.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};ot.rc2.createDecryptionCipher=function(t,e){return Ki(t,e,!1)}});var ze=q((Oh,Wi)=>{var Xr=F();Wi.exports=Xr.jsbn=Xr.jsbn||{};var Tt,Ro=0xdeadbeefcafe,Mi=(Ro&16777215)==15715070;function S(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))}Xr.jsbn.BigInteger=S;function U(){return new S(null)}function Lo(t,e,r,n,i,a){for(;--a>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function No(t,e,r,n,i,a){for(var o=e&32767,s=e>>15;--a>=0;){var f=this.data[t]&32767,u=this.data[t++]>>15,c=s*f+u*o;f=o*f+((c&32767)<<15)+r.data[n]+(i&1073741823),i=(f>>>30)+(c>>>15)+s*u+(i>>>30),r.data[n++]=f&1073741823}return i}function Fi(t,e,r,n,i,a){for(var o=e&16383,s=e>>14;--a>=0;){var f=this.data[t]&16383,u=this.data[t++]>>14,c=s*f+u*o;f=o*f+((c&16383)<<14)+r.data[n]+i,i=(f>>28)+(c>>14)+s*u,r.data[n++]=f&268435455}return i}typeof navigator>"u"?(S.prototype.am=Fi,Tt=28):Mi&&navigator.appName=="Microsoft Internet Explorer"?(S.prototype.am=No,Tt=30):Mi&&navigator.appName!="Netscape"?(S.prototype.am=Lo,Tt=26):(S.prototype.am=Fi,Tt=28);S.prototype.DB=Tt;S.prototype.DM=(1<<Tt)-1;S.prototype.DV=1<<Tt;var Jr=52;S.prototype.FV=Math.pow(2,Jr);S.prototype.F1=Jr-Tt;S.prototype.F2=2*Tt-Jr;var Do="0123456789abcdefghijklmnopqrstuvwxyz",Ve=new Array,ee,ct;ee=48;for(ct=0;ct<=9;++ct)Ve[ee++]=ct;ee=97;for(ct=10;ct<36;++ct)Ve[ee++]=ct;ee=65;for(ct=10;ct<36;++ct)Ve[ee++]=ct;function Vi(t){return Do.charAt(t)}function qi(t,e){var r=Ve[t.charCodeAt(e)];return r??-1}function ko(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function Po(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 Lt(t){var e=U();return e.fromInt(t),e}function Ko(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 n=t.length,i=!1,a=0;--n>=0;){var o=r==8?t[n]&255:qi(t,n);if(o<0){t.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&t[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&S.ZERO.subTo(this,this)}function Uo(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t}function Oo(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<<e)-1,n,i=!1,a="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0)for(s<this.DB&&(n=this.data[o]>>s)>0&&(i=!0,a=Vi(n));o>=0;)s<e?(n=(this.data[o]&(1<<s)-1)<<e-s,n|=this.data[--o]>>(s+=this.DB-e)):(n=this.data[o]>>(s-=e)&r,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(a+=Vi(n));return i?a:"0"}function Mo(){var t=U();return S.ZERO.subTo(this,t),t}function Fo(){return this.s<0?this.negate():this}function Vo(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 qe(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 qo(){return this.t<=0?0:this.DB*(this.t-1)+qe(this.data[this.t-1]^this.s&this.DM)}function zo(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 Ho(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s}function Go(t,e){var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(t/this.DB),o=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)e.data[s+a+1]=this.data[s]>>n|o,o=(this.data[s]&i)<<r;for(s=a-1;s>=0;--s)e.data[s]=0;e.data[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function Wo(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)e.data[o-r-1]|=(this.data[o]&a)<<i,e.data[o-r]=this.data[o]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}function Yo(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]-t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}function Qo(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i<n.t;++i)e.data[i+r.t]=r.am(0,n.data[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&S.ZERO.subTo(e,e)}function $o(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,n,e.t-r-1))>=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 Xo(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=U());var a=U(),o=this.s,s=t.s,f=this.DB-qe(n.data[n.t-1]);f>0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,c=a.data[u-1];if(c!=0){var h=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),p=this.FV/h,g=(1<<this.F1)/h,l=1<<this.F2,x=r.t,m=x-u,b=e??U();for(a.dlShiftTo(m,b),r.compareTo(b)>=0&&(r.data[r.t++]=1,r.subTo(b,r)),S.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var w=r.data[--x]==c?this.DM:Math.floor(r.data[x]*p+(r.data[x-1]+l)*g);if((r.data[x]+=a.am(0,w,r,m,0,u))<w)for(a.dlShiftTo(m,b),r.subTo(b,r);r.data[x]<--w;)r.subTo(b,r)}e!=null&&(r.drShiftTo(u,e),o!=s&&S.ZERO.subTo(e,e)),r.t=u,r.clamp(),f>0&&r.rShiftTo(f,r),o<0&&S.ZERO.subTo(r,r)}}}function Jo(t){var e=U();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(S.ZERO)>0&&t.subTo(e,e),e}function Ut(t){this.m=t}function Zo(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function jo(t){return t}function ts(t){t.divRemTo(this.m,null,t)}function es(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function rs(t,e){t.squareTo(e),this.reduce(e)}Ut.prototype.convert=Zo;Ut.prototype.revert=jo;Ut.prototype.reduce=ts;Ut.prototype.mulTo=es;Ut.prototype.sqrTo=rs;function ns(){if(this.t<1)return 0;var t=this.data[0];if(!(t&1))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 Ot(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function is(t){var e=U();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(S.ZERO)>0&&this.m.subTo(e,e),e}function as(t){var e=U();return t.copyTo(e),this.reduce(e),e}function os(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t.data[e]&32767,n=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,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 ss(t,e){t.squareTo(e),this.reduce(e)}function us(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Ot.prototype.convert=is;Ot.prototype.revert=as;Ot.prototype.reduce=os;Ot.prototype.mulTo=us;Ot.prototype.sqrTo=ss;function fs(){return(this.t>0?this.data[0]&1:this.s)==0}function cs(t,e){if(t>4294967295||t<1)return S.ONE;var r=U(),n=U(),i=e.convert(this),a=qe(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)}function hs(t,e){var r;return t<256||e.isEven()?r=new Ut(e):r=new Ot(e),this.exp(t,r)}S.prototype.copyTo=ko;S.prototype.fromInt=Po;S.prototype.fromString=Ko;S.prototype.clamp=Uo;S.prototype.dlShiftTo=zo;S.prototype.drShiftTo=Ho;S.prototype.lShiftTo=Go;S.prototype.rShiftTo=Wo;S.prototype.subTo=Yo;S.prototype.multiplyTo=Qo;S.prototype.squareTo=$o;S.prototype.divRemTo=Xo;S.prototype.invDigit=ns;S.prototype.isEven=fs;S.prototype.exp=cs;S.prototype.toString=Oo;S.prototype.negate=Mo;S.prototype.abs=Fo;S.prototype.compareTo=Vo;S.prototype.bitLength=qo;S.prototype.mod=Jo;S.prototype.modPowInt=hs;S.ZERO=Lt(0);S.ONE=Lt(1);function ls(){var t=U();return this.copyTo(t),t}function ps(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function ds(){return this.t==0?this.s:this.data[0]<<24>>24}function ys(){return this.t==0?this.s:this.data[0]<<16>>16}function xs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function gs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function ms(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),n=Lt(r),i=U(),a=U(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o}function vs(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,o=0,s=0;s<t.length;++s){var f=qi(t,s);if(f<0){t.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=e*o+f,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(o,0)),i&&S.ZERO.subTo(this,this)}function bs(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(S.ONE.shiftLeft(t-1),Zr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(S.ONE.shiftLeft(t-1),this);else{var n=new Array,i=t&7;n.length=(t>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function Ss(){var t=this.t,e=new Array;e[0]=this.s;var r=this.DB-t*this.DB%8,n,i=0;if(t-- >0)for(r<this.DB&&(n=this.data[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this.data[t]&(1<<r)-1)<<8-r,n|=this.data[--t]>>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function Es(t){return this.compareTo(t)==0}function Bs(t){return this.compareTo(t)<0?this:t}function ws(t){return this.compareTo(t)>0?this:t}function As(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r.data[n]=e(i,t.data[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}function Cs(t,e){return t&e}function Ts(t){var e=U();return this.bitwiseTo(t,Cs,e),e}function Zr(t,e){return t|e}function Is(t){var e=U();return this.bitwiseTo(t,Zr,e),e}function zi(t,e){return t^e}function _s(t){var e=U();return this.bitwiseTo(t,zi,e),e}function Hi(t,e){return t&~e}function Rs(t){var e=U();return this.bitwiseTo(t,Hi,e),e}function Ls(){for(var t=U(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t}function Ns(t){var e=U();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function Ds(t){var e=U();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function ks(t){if(t==0)return-1;var e=0;return t&65535||(t>>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function Ps(){for(var t=0;t<this.t;++t)if(this.data[t]!=0)return t*this.DB+ks(this.data[t]);return this.s<0?this.t*this.DB:-1}function Ks(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function Us(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=Ks(this.data[r]^e);return t}function Os(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<t%this.DB)!=0}function Ms(t,e){var r=S.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}function Fs(t){return this.changeBit(t,Zr)}function Vs(t){return this.changeBit(t,Hi)}function qs(t){return this.changeBit(t,zi)}function zs(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]+t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}function Hs(t){var e=U();return this.addTo(t,e),e}function Gs(t){var e=U();return this.subTo(t,e),e}function Ws(t){var e=U();return this.multiplyTo(t,e),e}function Ys(t){var e=U();return this.divRemTo(t,e,null),e}function Qs(t){var e=U();return this.divRemTo(t,null,e),e}function $s(t){var e=U(),r=U();return this.divRemTo(t,e,r),new Array(e,r)}function Xs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Js(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 me(){}function Gi(t){return t}function Zs(t,e,r){t.multiplyTo(e,r)}function js(t,e){t.squareTo(e)}me.prototype.convert=Gi;me.prototype.revert=Gi;me.prototype.mulTo=Zs;me.prototype.sqrTo=js;function tu(t){return this.exp(t,new me)}function eu(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,t.data[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t.data[n],r,n,0,e-n);r.clamp()}function ru(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r.data[this.t+n-e]=this.am(e-n,t.data[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}function re(t){this.r2=U(),this.q3=U(),S.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function nu(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=U();return t.copyTo(e),this.reduce(e),e}function iu(t){return t}function au(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 ou(t,e){t.squareTo(e),this.reduce(e)}function su(t,e,r){t.multiplyTo(e,r),this.reduce(r)}re.prototype.convert=nu;re.prototype.revert=iu;re.prototype.reduce=au;re.prototype.mulTo=su;re.prototype.sqrTo=ou;function uu(t,e){var r=t.bitLength(),n,i=Lt(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new Ut(e):e.isEven()?a=new re(e):a=new Ot(e);var o=new Array,s=3,f=n-1,u=(1<<n)-1;if(o[1]=a.convert(this),n>1){var c=U();for(a.sqrTo(o[1],c);s<=u;)o[s]=U(),a.mulTo(c,o[s-2],o[s]),s+=2}var h=t.t-1,p,g=!0,l=U(),x;for(r=qe(t.data[h])-1;h>=0;){for(r>=f?p=t.data[h]>>r-f&u:(p=(t.data[h]&(1<<r+1)-1)<<f-r,h>0&&(p|=t.data[h-1]>>this.DB+r-f)),s=n;!(p&1);)p>>=1,--s;if((r-=s)<0&&(r+=this.DB,--h),g)o[p].copyTo(i),g=!1;else{for(;s>1;)a.sqrTo(i,l),a.sqrTo(l,i),s-=2;s>0?a.sqrTo(i,l):(x=i,i=l,l=x),a.mulTo(l,o[p],i)}for(;h>=0&&!(t.data[h]&1<<r);)a.sqrTo(i,l),x=i,i=l,l=x,--r<0&&(r=this.DB-1,--h)}return a.revert(i)}function fu(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function cu(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 n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}function hu(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return S.ZERO;for(var r=t.clone(),n=this.clone(),i=Lt(1),a=Lt(0),o=Lt(0),s=Lt(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),e&&o.subTo(i,o),s.subTo(a,s))}if(n.compareTo(S.ONE)!=0)return S.ZERO;if(s.compareTo(t)>=0)return s.subtract(t);if(s.signum()<0)s.addTo(t,s);else return s;return s.signum()<0?s.add(t):s}var xt=[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],lu=(1<<26)/xt[xt.length-1];function pu(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=xt[xt.length-1]){for(e=0;e<xt.length;++e)if(r.data[0]==xt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<xt.length;){for(var n=xt[e],i=e+1;i<xt.length&&n<lu;)n*=xt[i++];for(n=r.modInt(n);e<i;)if(n%xt[e++]==0)return!1}return r.millerRabin(t)}function du(t){var e=this.subtract(S.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n=e.shiftRight(r),i=yu(),a,o=0;o<t;++o){do a=new S(this.bitLength(),i);while(a.compareTo(S.ONE)<=0||a.compareTo(e)>=0);var s=a.modPow(n,this);if(s.compareTo(S.ONE)!=0&&s.compareTo(e)!=0){for(var f=1;f++<r&&s.compareTo(e)!=0;)if(s=s.modPowInt(2,this),s.compareTo(S.ONE)==0)return!1;if(s.compareTo(e)!=0)return!1}}return!0}function yu(){return{nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(Math.random()*256)}}}S.prototype.chunkSize=xs;S.prototype.toRadix=ms;S.prototype.fromRadix=vs;S.prototype.fromNumber=bs;S.prototype.bitwiseTo=As;S.prototype.changeBit=Ms;S.prototype.addTo=zs;S.prototype.dMultiply=Xs;S.prototype.dAddOffset=Js;S.prototype.multiplyLowerTo=eu;S.prototype.multiplyUpperTo=ru;S.prototype.modInt=cu;S.prototype.millerRabin=du;S.prototype.clone=ls;S.prototype.intValue=ps;S.prototype.byteValue=ds;S.prototype.shortValue=ys;S.prototype.signum=gs;S.prototype.toByteArray=Ss;S.prototype.equals=Es;S.prototype.min=Bs;S.prototype.max=ws;S.prototype.and=Ts;S.prototype.or=Is;S.prototype.xor=_s;S.prototype.andNot=Rs;S.prototype.not=Ls;S.prototype.shiftLeft=Ns;S.prototype.shiftRight=Ds;S.prototype.getLowestSetBit=Ps;S.prototype.bitCount=Us;S.prototype.testBit=Os;S.prototype.setBit=Fs;S.prototype.clearBit=Vs;S.prototype.flipBit=qs;S.prototype.add=Hs;S.prototype.subtract=Gs;S.prototype.multiply=Ws;S.prototype.divide=Ys;S.prototype.remainder=Qs;S.prototype.divideAndRemainder=$s;S.prototype.modPow=uu;S.prototype.modInverse=hu;S.prototype.pow=tu;S.prototype.gcd=fu;S.prototype.isProbablePrime=pu});var Ji=q((Mh,Xi)=>{var St=F();Kt();Y();var Qi=Xi.exports=St.sha1=St.sha1||{};St.md.sha1=St.md.algorithms.sha1=Qi;Qi.create=function(){$i||xu();var t=null,e=St.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return e=St.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=St.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(i),Yi(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var i=St.util.createBuffer();i.putBytes(e.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(jr.substr(0,n.blockLength-o));for(var s,f,u=n.fullMessageLength[0]*8,c=0;c<n.fullMessageLength.length-1;++c)s=n.fullMessageLength[c+1]*8,f=s/4294967296>>>0,u+=f,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};Yi(h,r,i);var p=St.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},n};var jr=null,$i=!1;function xu(){jr="\x80",jr+=St.util.fillString("\0",64),$i=!0}function Yi(t,e,r){for(var n,i,a,o,s,f,u,c,h=r.length();h>=64;){for(i=t.h0,a=t.h1,o=t.h2,s=t.h3,f=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,u=s^a&(o^s),n=(i<<5|i>>>27)+u+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,u=s^a&(o^s),n=(i<<5|i>>>27)+u+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=e[c-3]^e[c-8]^e[c-14]^e[c-16],n=n<<1|n>>>31,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a&o|s&(a^o),n=(i<<5|i>>>27)+u+f+2400959708+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=e[c-6]^e[c-16]^e[c-28]^e[c-32],n=n<<2|n>>>30,e[c]=n,u=a^o^s,n=(i<<5|i>>>27)+u+f+3395469782+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,t.h4=t.h4+f|0,h-=64}}});var ta=q((Fh,ji)=>{var Et=F();Y();ge();Ji();var Zi=ji.exports=Et.pkcs1=Et.pkcs1||{};Zi.encode_rsa_oaep=function(t,e,r){var n,i,a,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),a?a.start():a=Et.md.sha1.create(),o||(o=a);var s=Math.ceil(t.n.bitLength()/8),f=s-2*a.digestLength-2;if(e.length>f){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=e.length,u.maxLength=f,u}n||(n=""),a.update(n,"raw");for(var c=a.digest(),h="",p=f-e.length,g=0;g<p;g++)h+="\0";var l=c.getBytes()+h+""+e;if(!i)i=Et.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var x=He(i,s-a.digestLength-1,o),m=Et.util.xorBytes(l,x,l.length),b=He(m,a.digestLength,o),w=Et.util.xorBytes(i,b,i.length);return"\0"+w+m};Zi.decode_rsa_oaep=function(t,e,r){var n,i,a;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var m=new Error("RSAES-OAEP encoded message length is invalid.");throw m.length=e.length,m.expectedLength=o,m}if(i===void 0?i=Et.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var s=i.digest().getBytes(),f=e.charAt(0),u=e.substring(1,i.digestLength+1),c=e.substring(1+i.digestLength),h=He(c,i.digestLength,a),p=Et.util.xorBytes(u,h,u.length),g=He(p,o-i.digestLength-1,a),l=Et.util.xorBytes(c,g,c.length),x=l.substring(0,i.digestLength),m=f!=="\0",b=0;b<i.digestLength;++b)m|=s.charAt(b)!==x.charAt(b);for(var w=1,B=i.digestLength,L=i.digestLength;L<l.length;L++){var I=l.charCodeAt(L),T=I&1^1,P=w?65534:0;m|=I&P,w=w&T,B+=w}if(m||l.charCodeAt(B)!==1)throw new Error("Invalid RSAES-OAEP padding.");return l.substring(B+1)};function He(t,e,r){r||(r=Et.md.sha1.create());for(var n="",i=Math.ceil(e/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}});var ea=q((Vh,tn)=>{var Nt=F();Y();ze();ge();(function(){if(Nt.prime){tn.exports=Nt.prime;return}var t=tn.exports=Nt.prime=Nt.prime||{},e=Nt.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var i=function(h,p){return h|p};t.generateProbablePrime=function(h,p,g){typeof p=="function"&&(g=p,p={}),p=p||{};var l=p.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var x=p.prng||Nt.random,m={nextBytes:function(b){for(var w=x.getBytesSync(b.length),B=0;B<b.length;++B)b[B]=w.charCodeAt(B)}};if(l.name==="PRIMEINC")return a(h,m,l.options,g);throw new Error("Invalid prime generation algorithm: "+l.name)};function a(h,p,g,l){return"workers"in g?f(h,p,g,l):o(h,p,g,l)}function o(h,p,g,l){var x=u(h,p),m=0,b=c(x.bitLength());"millerRabinTests"in g&&(b=g.millerRabinTests);var w=10;"maxBlockTime"in g&&(w=g.maxBlockTime),s(x,h,p,m,b,w,l)}function s(h,p,g,l,x,m,b){var w=+new Date;do{if(h.bitLength()>p&&(h=u(p,g)),h.isProbablePrime(x))return b(null,h);h.dAddOffset(r[l++%8],0)}while(m<0||+new Date-w<m);Nt.util.setImmediate(function(){s(h,p,g,l,x,m,b)})}function f(h,p,g,l){if(typeof Worker>"u")return o(h,p,g,l);var x=u(h,p),m=g.workers,b=g.workLoad||100,w=b*30/8,B=g.workerScript||"forge/prime.worker.js";if(m===-1)return Nt.util.estimateCores(function(I,T){I&&(T=2),m=T-1,L()});L();function L(){m=Math.max(1,m);for(var I=[],T=0;T<m;++T)I[T]=new Worker(B);for(var P=m,T=0;T<m;++T)I[T].addEventListener("message",j);var O=!1;function j(pt){if(!O){--P;var ut=pt.data;if(ut.found){for(var rt=0;rt<I.length;++rt)I[rt].terminate();return O=!0,l(null,new e(ut.prime,16))}x.bitLength()>h&&(x=u(h,p));var Ht=x.toString(16);pt.target.postMessage({hex:Ht,workLoad:b}),x.dAddOffset(w,0)}}}}function u(h,p){var g=new e(h,p),l=h-1;return g.testBit(l)||g.bitwiseTo(e.ONE.shiftLeft(l),i,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}function c(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var We=q((qh,ua)=>{var _=F();xe();ze();De();ta();ea();ge();Y();typeof K>"u"&&(K=_.jsbn.BigInteger);var K,en=_.util.isNodejs?Ue():null,y=_.asn1,ht=_.util;_.pki=_.pki||{};ua.exports=_.pki.rsa=_.rsa=_.rsa||{};var N=_.pki,gu=[6,4,2,4,2,4,6,2],mu={name:"PrivateKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},vu={name:"RSAPrivateKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},bu={name:"RSAPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:y.Class.UNIVERSAL,type:y.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Su=_.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Eu={name:"DigestInfo",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:y.Class.UNIVERSAL,type:y.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:y.Class.UNIVERSAL,type:y.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:y.Class.UNIVERSAL,type:y.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:y.Class.UNIVERSAL,type:y.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Bu=function(t){var e;if(t.algorithm in N.oids)e=N.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=y.oidToDer(e).getBytes(),i=y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[]),a=y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[]);a.value.push(y.create(y.Class.UNIVERSAL,y.Type.OID,!1,n)),a.value.push(y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,""));var o=y.create(y.Class.UNIVERSAL,y.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(o),y.toDer(i).getBytes()},oa=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(K.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(K.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new K(_.util.bytesToHex(_.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(K.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var i=t.mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(a)<0;)i=i.add(e.p);var o=i.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return o=o.multiply(n.modInverse(e.n)).mod(e.n),o};N.rsa.encrypt=function(t,e,r){var n=r,i,a=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=sa(t,e,r)):(i=_.util.createBuffer(),i.putBytes(t));for(var o=new K(i.toHex(),16),s=oa(o,e,n),f=s.toString(16),u=_.util.createBuffer(),c=a-Math.ceil(f.length/2);c>0;)u.putByte(0),--c;return u.putBytes(_.util.hexToBytes(f)),u.getBytes()};N.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=i,a}var o=new K(_.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=oa(o,e,r),f=s.toString(16),u=_.util.createBuffer(),c=i-Math.ceil(f.length/2);c>0;)u.putByte(0),--c;return u.putBytes(_.util.hexToBytes(f)),n!==!1?Ge(u.getBytes(),e,r):u.getBytes()};N.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||_.random,i={nextBytes:function(s){for(var f=n.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=f.charCodeAt(u)}},a=r.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:t,rng:i,eInt:e||65537,e:new K(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};N.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new K(null);r.fromInt(30);for(var n=0,i=function(h,p){return h|p},a=+new Date,o,s=0;t.keys===null&&(e<=0||s<e);){if(t.state===0){var f=t.p===null?t.pBits:t.qBits,u=f-1;t.pqState===0?(t.num=new K(f,t.rng),t.num.testBit(u)||t.num.bitwiseTo(K.ONE.shiftLeft(u),i,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),n=0,++t.pqState):t.pqState===1?t.num.bitLength()>f?t.pqState=0:t.num.isProbablePrime(Au(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(gu[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(K.ONE).gcd(t.e).compareTo(K.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(K.ONE),t.q1=t.q.subtract(K.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(K.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 c=t.e.modInverse(t.phi);t.keys={privateKey:N.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:N.rsa.setPublicKey(t.n,t.e)}}o=+new Date,s+=o-a,a=o}return t.keys!==null};N.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!_.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(ra("generateKeyPair"))return en.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,f,u){if(s)return n(s);n(null,{privateKey:N.privateKeyFromPem(u),publicKey:N.publicKeyFromPem(f)})});if(na("generateKey")&&na("exportKey"))return ht.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:aa(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return ht.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){n(s)}).then(function(s){if(s){var f=N.privateKeyFromAsn1(y.fromDer(_.util.createBuffer(s)));n(null,{privateKey:f,publicKey:N.setRsaPublicKey(f.n,f.e)})}});if(ia("generateKey")&&ia("exportKey")){var i=ht.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:aa(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var f=s.target.result,u=ht.globalScope.msCrypto.subtle.exportKey("pkcs8",f.privateKey);u.oncomplete=function(c){var h=c.target.result,p=N.privateKeyFromAsn1(y.fromDer(_.util.createBuffer(h)));n(null,{privateKey:p,publicKey:N.setRsaPublicKey(p.n,p.e)})},u.onerror=function(c){n(c)}},i.onerror=function(s){n(s)};return}}else if(ra("generateKeyPairSync")){var a=en.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:N.privateKeyFromPem(a.privateKey),publicKey:N.publicKeyFromPem(a.publicKey)}}}var o=N.rsa.createKeyPairGenerationState(t,e,r);if(!n)return N.rsa.stepKeyPairGenerationState(o,0),o.keys;wu(o,r,n)};N.setRsaPublicKey=N.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,f,u){return sa(s,f,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,f){return _.pkcs1.encode_rsa_oaep(f,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return N.rsa.encrypt(o,r,!0)},r.verify=function(n,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(f,u){u=Ge(u,r,!0);var c=y.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),h={},p=[];if(!y.validate(c,Eu,h,p)){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=p,g}var l=y.derToOid(h.algorithmIdentifier);if(!(l===_.oids.md2||l===_.oids.md5||l===_.oids.sha1||l===_.oids.sha224||l===_.oids.sha256||l===_.oids.sha384||l===_.oids.sha512||l===_.oids["sha512-224"]||l===_.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=l,g}if((l===_.oids.md2||l===_.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return f===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(f,u){return u=Ge(u,r,!0),f===u}});var s=N.rsa.decrypt(i,r,!0,!1);return a.verify(n,s,r.n.bitLength())},r};N.setRsaPrivateKey=N.rsa.setPrivateKey=function(t,e,r,n,i,a,o,s){var f={n:t,e,d:r,p:n,q:i,dP:a,dQ:o,qInv:s};return f.decrypt=function(u,c,h){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var p=N.rsa.decrypt(u,f,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:Ge};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(g,l){return _.pkcs1.decode_rsa_oaep(l,g,h)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(g){return g}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(p,f,!1)},f.sign=function(u,c){var h=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:Bu},h=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},h=1);var p=c.encode(u,f.n.bitLength());return N.rsa.encrypt(p,f,h)},f};N.wrapRsaPrivateKey=function(t){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,y.integerToDer(0).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.OID,!1,y.oidToDer(N.oids.rsaEncryption).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,"")]),y.create(y.Class.UNIVERSAL,y.Type.OCTETSTRING,!1,y.toDer(t).getBytes())])};N.privateKeyFromAsn1=function(t){var e={},r=[];if(y.validate(t,mu,e,r)&&(t=y.fromDer(_.util.createBuffer(e.privateKey))),e={},r=[],!y.validate(t,vu,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,o,s,f,u,c,h;return i=_.util.createBuffer(e.privateKeyModulus).toHex(),a=_.util.createBuffer(e.privateKeyPublicExponent).toHex(),o=_.util.createBuffer(e.privateKeyPrivateExponent).toHex(),s=_.util.createBuffer(e.privateKeyPrime1).toHex(),f=_.util.createBuffer(e.privateKeyPrime2).toHex(),u=_.util.createBuffer(e.privateKeyExponent1).toHex(),c=_.util.createBuffer(e.privateKeyExponent2).toHex(),h=_.util.createBuffer(e.privateKeyCoefficient).toHex(),N.setRsaPrivateKey(new K(i,16),new K(a,16),new K(o,16),new K(s,16),new K(f,16),new K(u,16),new K(c,16),new K(h,16))};N.privateKeyToAsn1=N.privateKeyToRSAPrivateKey=function(t){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,y.integerToDer(0).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.n)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.e)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.d)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.p)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.q)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.dP)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.dQ)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.qInv))])};N.publicKeyFromAsn1=function(t){var e={},r=[];if(y.validate(t,Su,e,r)){var n=y.derToOid(e.publicKeyOid);if(n!==N.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}t=e.rsaPublicKey}if(r=[],!y.validate(t,bu,e,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=_.util.createBuffer(e.publicKeyModulus).toHex(),o=_.util.createBuffer(e.publicKeyExponent).toHex();return N.setRsaPublicKey(new K(a,16),new K(o,16))};N.publicKeyToAsn1=N.publicKeyToSubjectPublicKeyInfo=function(t){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.OID,!1,y.oidToDer(N.oids.rsaEncryption).getBytes()),y.create(y.Class.UNIVERSAL,y.Type.NULL,!1,"")]),y.create(y.Class.UNIVERSAL,y.Type.BITSTRING,!1,[N.publicKeyToRSAPublicKey(t)])])};N.publicKeyToRSAPublicKey=function(t){return y.create(y.Class.UNIVERSAL,y.Type.SEQUENCE,!0,[y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.n)),y.create(y.Class.UNIVERSAL,y.Type.INTEGER,!1,Bt(t.e))])};function sa(t,e,r){var n=_.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o=i-3-t.length,s;if(r===0||r===1){s=r===0?0:255;for(var f=0;f<o;++f)n.putByte(s)}else for(;o>0;){for(var u=0,c=_.random.getBytes(o),f=0;f<o;++f)s=c.charCodeAt(f),s===0?++u:n.putByte(s);o=u}return n.putByte(0),n.putBytes(t),n}function Ge(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8),a=_.util.createBuffer(t),o=a.getByte(),s=a.getByte();if(o!==0||r&&s!==0&&s!==1||!r&&s!=2||r&&s===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var f=0;if(s===0){f=i-3-n;for(var u=0;u<f;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(f=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++f}else if(s===2)for(f=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++f}var c=a.getByte();if(c!==0||f!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function wu(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),i();function i(){a(t.pBits,function(s,f){if(s)return r(s);if(t.p=f,t.q!==null)return o(s,t.q);a(t.qBits,o)})}function a(s,f){_.prime.generateProbablePrime(s,n,f)}function o(s,f){if(s)return r(s);if(t.q=f,t.p.compareTo(t.q)<0){var u=t.p;t.p=t.q,t.q=u}if(t.p.subtract(K.ONE).gcd(t.e).compareTo(K.ONE)!==0){t.p=null,i();return}if(t.q.subtract(K.ONE).gcd(t.e).compareTo(K.ONE)!==0){t.q=null,a(t.qBits,o);return}if(t.p1=t.p.subtract(K.ONE),t.q1=t.q.subtract(K.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(K.ONE)!==0){t.p=t.q=null,i();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,a(t.qBits,o);return}var c=t.e.modInverse(t.phi);t.keys={privateKey:N.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:N.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function Bt(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=_.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function Au(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 ra(t){return _.util.isNodejs&&typeof en[t]=="function"}function na(t){return typeof ht.globalScope<"u"&&typeof ht.globalScope.crypto=="object"&&typeof ht.globalScope.crypto.subtle=="object"&&typeof ht.globalScope.crypto.subtle[t]=="function"}function ia(t){return typeof ht.globalScope<"u"&&typeof ht.globalScope.msCrypto=="object"&&typeof ht.globalScope.msCrypto.subtle=="object"&&typeof ht.globalScope.msCrypto.subtle[t]=="function"}function aa(t){for(var e=_.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}});var da=q((zh,pa)=>{var C=F();_e();xe();vi();Kt();De();Wr();Ci();ge();Oi();We();Y();typeof fa>"u"&&(fa=C.jsbn.BigInteger);var fa,v=C.asn1,D=C.pki=C.pki||{};pa.exports=D.pbe=C.pbe=C.pbe||{};var Mt=D.oids,Cu={name:"EncryptedPrivateKeyInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Tu={name:"PBES2Algorithms",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Iu={name:"pkcs-12PbeParams",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"iterations"}]};D.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 n=C.random.getBytesSync(r.saltSize),i=r.count,a=v.integerToDer(i),o,s,f;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var u,c,h;switch(r.algorithm){case"aes128":o=16,u=16,c=Mt["aes128-CBC"],h=C.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=Mt["aes192-CBC"],h=C.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=Mt["aes256-CBC"],h=C.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=Mt.desCBC,h=C.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),l=la(g),x=C.pkcs5.pbkdf2(e,n,i,o,l),m=C.random.getBytesSync(u),b=h(x);b.start(m),b.update(v.toDer(t)),b.finish(),f=b.output.getBytes();var w=_u(n,a,o,g);s=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(Mt.pkcs5PBES2).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(Mt.pkcs5PBKDF2).getBytes()),w]),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(c).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,m)])])])}else if(r.algorithm==="3des"){o=24;var B=new C.util.ByteBuffer(n),x=D.pbe.generatePkcs12Key(e,B,1,i,o),m=D.pbe.generatePkcs12Key(e,B,2,i,o),b=C.des.createEncryptionCipher(x);b.start(m),b.update(v.toDer(t)),b.finish(),f=b.output.getBytes(),s=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(Mt["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,n),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,a.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var L=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[s,v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,f)]);return L};D.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!v.validate(t,Cu,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=v.derToOid(n.encryptionOid),s=D.pbe.getCipher(o,n.encryptionParams,e),f=C.util.createBuffer(n.encryptedData);return s.update(f),s.finish()&&(r=v.fromDer(s.output)),r};D.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:v.toDer(t).getBytes()};return C.pem.encode(r,{maxline:e})};D.encryptedPrivateKeyFromPem=function(t){var e=C.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 v.fromDer(e.body)};D.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=D.wrapRsaPrivateKey(D.privateKeyToAsn1(t));return n=D.encryptPrivateKeyInfo(n,e,r),D.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=C.random.getBytesSync(16),s=C.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=C.random.getBytesSync(16),s=C.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=C.random.getBytesSync(16),s=C.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=C.random.getBytesSync(8),s=C.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=C.random.getBytesSync(8),s=C.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var u=C.pbe.opensslDeriveBytes(e,a.substr(0,8),o),c=s(u);c.start(a),c.update(v.toDer(D.privateKeyToAsn1(t))),c.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:C.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return C.pem.encode(h)};D.decryptRsaPrivateKey=function(t,e){var r=null,n=C.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,o;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,o=C.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=C.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=C.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=C.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=C.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(h){return C.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,o=function(h){return C.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,o=function(h){return C.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var s=C.util.hexToBytes(n.dekInfo.parameters),f=C.pbe.opensslDeriveBytes(e,s.substr(0,8),a),u=o(f);if(u.start(s),u.update(C.util.createBuffer(n.body)),u.finish())r=u.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=D.decryptPrivateKeyInfo(v.fromDer(r),e):r=v.fromDer(r),r!==null&&(r=D.privateKeyFromAsn1(r)),r};D.pbe.generatePkcs12Key=function(t,e,r,n,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in C.md))throw new Error('"sha1" hash algorithm unavailable.');a=C.md.sha1.create()}var f=a.digestLength,u=a.blockLength,c=new C.util.ByteBuffer,h=new C.util.ByteBuffer;if(t!=null){for(s=0;s<t.length;s++)h.putInt16(t.charCodeAt(s));h.putInt16(0)}var p=h.length(),g=e.length(),l=new C.util.ByteBuffer;l.fillWithByte(r,u);var x=u*Math.ceil(g/u),m=new C.util.ByteBuffer;for(s=0;s<x;s++)m.putByte(e.at(s%g));var b=u*Math.ceil(p/u),w=new C.util.ByteBuffer;for(s=0;s<b;s++)w.putByte(h.at(s%p));var B=m;B.putBuffer(w);for(var L=Math.ceil(i/f),I=1;I<=L;I++){var T=new C.util.ByteBuffer;T.putBytes(l.bytes()),T.putBytes(B.bytes());for(var P=0;P<n;P++)a.start(),a.update(T.getBytes()),T=a.digest();var O=new C.util.ByteBuffer;for(s=0;s<u;s++)O.putByte(T.at(s%f));var j=Math.ceil(g/u)+Math.ceil(p/u),pt=new C.util.ByteBuffer;for(o=0;o<j;o++){var ut=new C.util.ByteBuffer(B.getBytes(u)),rt=511;for(s=O.length()-1;s>=0;s--)rt=rt>>8,rt+=O.at(s)+ut.at(s),ut.setAt(s,rt&255);pt.putBuffer(ut)}B=pt,c.putBuffer(T)}return c.truncate(c.length()-i),c};D.pbe.getCipher=function(t,e,r){switch(t){case D.oids.pkcs5PBES2:return D.pbe.getCipherForPBES2(t,e,r);case D.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case D.oids["pbewithSHAAnd40BitRC2-CBC"]:return D.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};D.pbe.getCipherForPBES2=function(t,e,r){var n={},i=[];if(!v.validate(e,Tu,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(t=v.derToOid(n.kdfOid),t!==D.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=t,a.supportedOids=["pkcs5PBKDF2"],a}if(t=v.derToOid(n.encOid),t!==D.oids["aes128-CBC"]&&t!==D.oids["aes192-CBC"]&&t!==D.oids["aes256-CBC"]&&t!==D.oids["des-EDE3-CBC"]&&t!==D.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=t,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=n.kdfSalt,s=C.util.createBuffer(n.kdfIterationCount);s=s.getInt(s.length()<<3);var f,u;switch(D.oids[t]){case"aes128-CBC":f=16,u=C.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,u=C.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,u=C.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,u=C.des.createDecryptionCipher;break;case"desCBC":f=8,u=C.des.createDecryptionCipher;break}var c=ha(n.prfOid),h=C.pkcs5.pbkdf2(r,o,s,f,c),p=n.encIv,g=u(h);return g.start(p),g};D.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!v.validate(e,Iu,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=C.util.createBuffer(n.salt),s=C.util.createBuffer(n.iterations);s=s.getInt(s.length()<<3);var f,u,c;switch(t){case D.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,u=8,c=C.des.startDecrypting;break;case D.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,u=8,c=function(x,m){var b=C.rc2.createDecryptionCipher(x,40);return b.start(m,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=t,a}var h=ha(n.prfOid),p=D.pbe.generatePkcs12Key(r,o,1,s,f,h);h.start();var g=D.pbe.generatePkcs12Key(r,o,2,s,u,h);return c(p,g)};D.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in C.md))throw new Error('"md5" hash algorithm unavailable.');n=C.md.md5.create()}e===null&&(e="");for(var i=[ca(n,t+e)],a=16,o=1;a<r;++o,a+=16)i.push(ca(n,i[o-1]+t+e));return i.join("").substr(0,r)};function ca(t,e){return t.start().update(e).digest().getBytes()}function ha(t){var e;if(!t)e="hmacWithSHA1";else if(e=D.oids[v.derToOid(t)],!e){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return la(e)}function la(t){var e=C.md;switch(t){case"hmacWithSHA224":e=C.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}function _u(t,e,r,n){var i=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,t),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,C.util.hexToBytes(r.toString(16))),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(D.oids[n]).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")])),i}});var ka=q((Cp,Da)=>{var H=F();Kt();Y();var Ee=Da.exports=H.sha512=H.sha512||{};H.md.sha512=H.md.algorithms.sha512=Ee;var La=H.sha384=H.sha512.sha384=H.sha512.sha384||{};La.create=function(){return Ee.create("SHA-384")};H.md.sha384=H.md.algorithms.sha384=La;H.sha512.sha256=H.sha512.sha256||{create:function(){return Ee.create("SHA-512/256")}};H.md["sha512/256"]=H.md.algorithms["sha512/256"]=H.sha512.sha256;H.sha512.sha224=H.sha512.sha224||{create:function(){return Ee.create("SHA-512/224")}};H.md["sha512/224"]=H.md.algorithms["sha512/224"]=H.sha512.sha224;Ee.create=function(t){if(Na||Wu(),typeof t>"u"&&(t="SHA-512"),!(t in zt))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=zt[t],r=null,n=H.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=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 s={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var f=s.messageLengthSize/4,u=0;u<f;++u)s.fullMessageLength.push(0);n=H.util.createBuffer(),r=new Array(e.length);for(var u=0;u<e.length;++u)r[u]=e[u].slice(0);return s},s.start(),s.update=function(f,u){u==="utf8"&&(f=H.util.encodeUtf8(f));var c=f.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var h=s.fullMessageLength.length-1;h>=0;--h)s.fullMessageLength[h]+=c[1],c[1]=c[0]+(s.fullMessageLength[h]/4294967296>>>0),s.fullMessageLength[h]=s.fullMessageLength[h]>>>0,c[0]=c[1]/4294967296>>>0;return n.putBytes(f),Ra(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),s},s.digest=function(){var f=H.util.createBuffer();f.putBytes(n.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;f.putBytes(bn.substr(0,s.blockLength-c));for(var h,p,g=s.fullMessageLength[0]*8,l=0;l<s.fullMessageLength.length-1;++l)h=s.fullMessageLength[l+1]*8,p=h/4294967296>>>0,g+=p,f.putInt32(g>>>0),g=h>>>0;f.putInt32(g);for(var x=new Array(r.length),l=0;l<r.length;++l)x[l]=r[l].slice(0);Ra(x,i,f);var m=H.util.createBuffer(),b;t==="SHA-512"?b=x.length:t==="SHA-384"?b=x.length-2:b=x.length-4;for(var l=0;l<b;++l)m.putInt32(x[l][0]),(l!==b-1||t!=="SHA-512/224")&&m.putInt32(x[l][1]);return m},s};var bn=null,Na=!1,Sn=null,zt=null;function Wu(){bn="\x80",bn+=H.util.fillString("\0",128),Sn=[[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]],zt={},zt["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],zt["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],zt["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],zt["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],Na=!0}function Ra(t,e,r){for(var n,i,a,o,s,f,u,c,h,p,g,l,x,m,b,w,B,L,I,T,P,O,j,pt,ut,rt,Ht,Be,Q,at,R,ar,or,sr,ur,Cn=r.length();Cn>=128;){for(Q=0;Q<16;++Q)e[Q][0]=r.getInt32()>>>0,e[Q][1]=r.getInt32()>>>0;for(;Q<80;++Q)ar=e[Q-2],at=ar[0],R=ar[1],n=((at>>>19|R<<13)^(R>>>29|at<<3)^at>>>6)>>>0,i=((at<<13|R>>>19)^(R<<3|at>>>29)^(at<<26|R>>>6))>>>0,sr=e[Q-15],at=sr[0],R=sr[1],a=((at>>>1|R<<31)^(at>>>8|R<<24)^at>>>7)>>>0,o=((at<<31|R>>>1)^(at<<24|R>>>8)^(at<<25|R>>>7))>>>0,or=e[Q-7],ur=e[Q-16],R=i+or[1]+o+ur[1],e[Q][0]=n+or[0]+a+ur[0]+(R/4294967296>>>0)>>>0,e[Q][1]=R>>>0;for(x=t[0][0],m=t[0][1],b=t[1][0],w=t[1][1],B=t[2][0],L=t[2][1],I=t[3][0],T=t[3][1],P=t[4][0],O=t[4][1],j=t[5][0],pt=t[5][1],ut=t[6][0],rt=t[6][1],Ht=t[7][0],Be=t[7][1],Q=0;Q<80;++Q)u=((P>>>14|O<<18)^(P>>>18|O<<14)^(O>>>9|P<<23))>>>0,c=((P<<18|O>>>14)^(P<<14|O>>>18)^(O<<23|P>>>9))>>>0,h=(ut^P&(j^ut))>>>0,p=(rt^O&(pt^rt))>>>0,s=((x>>>28|m<<4)^(m>>>2|x<<30)^(m>>>7|x<<25))>>>0,f=((x<<4|m>>>28)^(m<<30|x>>>2)^(m<<25|x>>>7))>>>0,g=(x&b|B&(x^b))>>>0,l=(m&w|L&(m^w))>>>0,R=Be+c+p+Sn[Q][1]+e[Q][1],n=Ht+u+h+Sn[Q][0]+e[Q][0]+(R/4294967296>>>0)>>>0,i=R>>>0,R=f+l,a=s+g+(R/4294967296>>>0)>>>0,o=R>>>0,Ht=ut,Be=rt,ut=j,rt=pt,j=P,pt=O,R=T+i,P=I+n+(R/4294967296>>>0)>>>0,O=R>>>0,I=B,T=L,B=b,L=w,b=x,w=m,R=i+o,x=n+a+(R/4294967296>>>0)>>>0,m=R>>>0;R=t[0][1]+m,t[0][0]=t[0][0]+x+(R/4294967296>>>0)>>>0,t[0][1]=R>>>0,R=t[1][1]+w,t[1][0]=t[1][0]+b+(R/4294967296>>>0)>>>0,t[1][1]=R>>>0,R=t[2][1]+L,t[2][0]=t[2][0]+B+(R/4294967296>>>0)>>>0,t[2][1]=R>>>0,R=t[3][1]+T,t[3][0]=t[3][0]+I+(R/4294967296>>>0)>>>0,t[3][1]=R>>>0,R=t[4][1]+O,t[4][0]=t[4][0]+P+(R/4294967296>>>0)>>>0,t[4][1]=R>>>0,R=t[5][1]+pt,t[5][0]=t[5][0]+j+(R/4294967296>>>0)>>>0,t[5][1]=R>>>0,R=t[6][1]+rt,t[6][0]=t[6][0]+ut+(R/4294967296>>>0)>>>0,t[6][1]=R>>>0,R=t[7][1]+Be,t[7][0]=t[7][0]+Ht+(R/4294967296>>>0)>>>0,t[7][1]=R>>>0,Cn-=128}}});var mf={};ft(mf,{PING_PROTOCOL:()=>Va,ping:()=>gf});var bf=Symbol.for("@libp2p/connection");var Ef=Symbol.for("@libp2p/content-routing");var Af=Symbol.for("@libp2p/peer-discovery");var Tf=Symbol.for("@libp2p/peer-id");var _f=Symbol.for("@libp2p/peer-routing");var In;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(In||(In={}));var Df=Symbol.for("@libp2p/transport");var _n;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(_n||(_n={}));var $=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var Rn="ERR_TIMEOUT";var fr=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Kf=globalThis.CustomEvent??fr;var ph=tt(_e(),1),fo=tt(F(),1);function Re(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var Ar={};ft(Ar,{base10:()=>f0});function i0(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,f=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var x=0,m=0,b=0,w=l.length;b!==w&&l[b]===0;)b++,x++;for(var B=(w-b)*c+1>>>0,L=new Uint8Array(B);b!==w;){for(var I=l[b],T=0,P=B-1;(I!==0||T<m)&&P!==-1;P--,T++)I+=256*L[P]>>>0,L[P]=I%s>>>0,I=I/s>>>0;if(I!==0)throw new Error("Non-zero carry");m=T,b++}for(var O=B-m;O!==B&&L[O]===0;)O++;for(var j=f.repeat(x);O<B;++O)j+=t.charAt(L[O]);return j}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var x=0;if(l[x]!==" "){for(var m=0,b=0;l[x]===f;)m++,x++;for(var w=(l.length-x)*u+1>>>0,B=new Uint8Array(w);l[x];){var L=r[l.charCodeAt(x)];if(L===255)return;for(var I=0,T=w-1;(L!==0||I<b)&&T!==-1;T--,I++)L+=s*B[T]>>>0,B[T]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");b=I,x++}if(l[x]!==" "){for(var P=w-b;P!==w&&B[P]===0;)P++;for(var O=new Uint8Array(m+(w-P)),j=m;P!==w;)O[j++]=B[P++];return O}}}function g(l){var x=p(l);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:p,decode:g}}var a0=i0,o0=a0,Gn=o0;var Ec=new Uint8Array(0);var Wn=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},wt=t=>{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")};var Yn=t=>new TextEncoder().encode(t),Qn=t=>new TextDecoder().decode(t);var Sr=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Er=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xn(this,e)}},Br=class{constructor(e){this.decoders=e}or(e){return Xn(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Xn=(t,e)=>new Br({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),wr=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Sr(e,r,n),this.decoder=new Er(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Yt=({name:t,prefix:e,encode:r,decode:n})=>new wr(t,e,r,n),Rt=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Gn(r,e);return Yt({prefix:t,name:e,encode:n,decode:a=>wt(i(a))})},s0=(t,e,r,n)=>{let i={};for(let c=0;c<e.length;++c)i[e[c]]=c;let a=t.length;for(;t[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,u=0;for(let c=0;c<a;++c){let h=i[t[c]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[u++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},u0=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<t.length;++f)for(s=s<<8|t[f],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},W=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yt({prefix:e,name:t,encode(i){return u0(i,n,r)},decode(i){return s0(i,n,r,t)}});var f0=Rt({prefix:"9",name:"base10",alphabet:"0123456789"});var Cr={};ft(Cr,{base16:()=>c0,base16upper:()=>h0});var c0=W({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),h0=W({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Tr={};ft(Tr,{base2:()=>l0});var l0=W({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ir={};ft(Ir,{base256emoji:()=>g0});var Jn=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),p0=Jn.reduce((t,e,r)=>(t[r]=e,t),[]),d0=Jn.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function y0(t){return t.reduce((e,r)=>(e+=p0[r],e),"")}function x0(t){let e=[];for(let r of t){let n=d0[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var g0=Yt({prefix:"\u{1F680}",name:"base256emoji",encode:y0,decode:x0});var _r={};ft(_r,{base32:()=>Qt,base32hex:()=>S0,base32hexpad:()=>B0,base32hexpadupper:()=>w0,base32hexupper:()=>E0,base32pad:()=>v0,base32padupper:()=>b0,base32upper:()=>m0,base32z:()=>A0});var Qt=W({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),m0=W({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),v0=W({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),b0=W({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),S0=W({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),E0=W({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),B0=W({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),w0=W({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),A0=W({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Rr={};ft(Rr,{base36:()=>C0,base36upper:()=>T0});var C0=Rt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),T0=Rt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Lr={};ft(Lr,{base58btc:()=>yt,base58flickr:()=>I0});var yt=Rt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),I0=Rt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Dr={};ft(Dr,{base64:()=>Nr,base64pad:()=>_0,base64url:()=>R0,base64urlpad:()=>L0});var Nr=W({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_0=W({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),R0=W({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),L0=W({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var kr={};ft(kr,{base8:()=>N0});var N0=W({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pr={};ft(Pr,{identity:()=>D0});var D0=Yt({prefix:"\0",name:"identity",encode:t=>Qn(t),decode:t=>Yn(t)});var Uc=new TextEncoder,Oc=new TextDecoder;var Ur={};ft(Ur,{identity:()=>ai});var K0=ti,Zn=128,U0=127,O0=~U0,M0=Math.pow(2,31);function ti(t,e,r){e=e||[],r=r||0;for(var n=r;t>=M0;)e[r++]=t&255|Zn,t/=128;for(;t&O0;)e[r++]=t&255|Zn,t>>>=7;return e[r]=t|0,ti.bytes=r-n+1,e}var F0=Kr,V0=128,jn=127;function Kr(t,n){var r=0,n=n||0,i=0,a=n,o,s=t.length;do{if(a>=s)throw Kr.bytes=0,new RangeError("Could not decode varint");o=t[a++],r+=i<28?(o&jn)<<i:(o&jn)*Math.pow(2,i),i+=7}while(o>=V0);return Kr.bytes=a-n,r}var q0=Math.pow(2,7),z0=Math.pow(2,14),H0=Math.pow(2,21),G0=Math.pow(2,28),W0=Math.pow(2,35),Y0=Math.pow(2,42),Q0=Math.pow(2,49),$0=Math.pow(2,56),X0=Math.pow(2,63),J0=function(t){return t<q0?1:t<z0?2:t<H0?3:t<G0?4:t<W0?5:t<Y0?6:t<Q0?7:t<$0?8:t<X0?9:10},Z0={encode:K0,decode:F0,encodingLength:J0},j0=Z0,fe=j0;var ce=(t,e=0)=>[fe.decode(t,e),fe.decode.bytes],$t=(t,e,r=0)=>(fe.encode(t,e,r),e),Xt=t=>fe.encodingLength(t);var Pt=(t,e)=>{let r=e.byteLength,n=Xt(t),i=n+Xt(r),a=new Uint8Array(i+r);return $t(t,a,0),$t(r,a,n),a.set(e,i),new Jt(t,r,e,a)},ei=t=>{let e=wt(t),[r,n]=ce(e),[i,a]=ce(e.subarray(n)),o=e.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new Jt(r,i,o,e)},ri=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Wn(t.bytes,r.bytes)}},Jt=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var ni=0,to="identity",ii=wt,eo=t=>Pt(ni,ii(t)),ai={code:ni,name:to,encode:ii,digest:eo};var Fr={};ft(Fr,{sha256:()=>le,sha512:()=>ro});var Mr=({name:t,code:e,encode:r})=>new Or(t,e,r),Or=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Pt(this.code,r):r.then(n=>Pt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var si=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),le=Mr({name:"sha2-256",code:18,encode:si("SHA-256")}),ro=Mr({name:"sha2-512",code:19,encode:si("SHA-512")});var ui=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return io(r,Vr(t),e||yt.encoder);default:return ao(r,Vr(t),e||Qt.encoder)}};var fi=new WeakMap,Vr=t=>{let e=fi.get(t);if(e==null){let r=new Map;return fi.set(t,r),r}return e},Ne=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==pe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==oo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Pt(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&ri(e.multihash,n.multihash)}toString(e){return ui(this,e)}toJSON(){return{"/":ui(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new t(n,i,a,o||ci(n,i,a.bytes))}else if(r[so]===!0){let{version:n,multihash:i,code:a}=r,o=ei(i);return t.create(n,a,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==pe)throw new Error(`Version 0 CID must use dag-pb (code: ${pe}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=ci(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,pe,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=wt(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new Jt(r.multihashCode,r.digestSize,a,i);return[r.version===0?t.createV0(o):t.createV1(r.codec,o),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,p]=ce(e.subarray(r));return r+=p,h},i=n(),a=pe;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),u=r+f,c=u-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:c,size:u}}static parse(e,r){let[n,i]=no(e,r),a=t.decode(i);if(a.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Vr(a).set(n,e),a}},no=(t,e)=>{switch(t[0]){case"Q":{let r=e||yt;return[yt.prefix,r.decode(`${yt.prefix}${t}`)]}case yt.prefix:{let r=e||yt;return[yt.prefix,r.decode(t)]}case Qt.prefix:{let r=e||Qt;return[Qt.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)]}}},io=(t,e,r)=>{let{prefix:n}=r;if(n!==yt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},ao=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},pe=112,oo=18,ci=(t,e,r)=>{let n=Xt(t),i=n+Xt(e),a=new Uint8Array(i+r.byteLength);return $t(t,a,0),$t(e,a,n),a.set(r,i),a},so=Symbol.for("@ipld/js-cid/CID");var Zt={...Pr,...Tr,...kr,...Ar,...Cr,..._r,...Rr,...Lr,...Dr,...Ir},th={...Fr,...Ur};function qr(t=0){return globalThis.Buffer?.allocUnsafe!=null?Re(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function li(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var hi=li("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),zr=li("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=qr(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),oh={utf8:hi,"utf-8":hi,hex:Zt.base16,latin1:zr,ascii:zr,binary:zr,...Zt};var Id=tt(xe(),1),_d=tt(da(),1);var ef=tt(F(),1);var Qh=tt(Y(),1),$h=tt(ze(),1),Ru=tt(F(),1);var Ye=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Lu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Lu)throw new Error("Non little-endian hardware is not supported");var rl={}.toString;function ya(t=32){if(Ye&&typeof Ye.getRandomValues=="function")return Ye.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var nn=new Float32Array([-0]),Dt=new Uint8Array(nn.buffer);function ga(t,e,r){nn[0]=t,e[r]=Dt[0],e[r+1]=Dt[1],e[r+2]=Dt[2],e[r+3]=Dt[3]}function ma(t,e){return Dt[0]=t[e],Dt[1]=t[e+1],Dt[2]=t[e+2],Dt[3]=t[e+3],nn[0]}var an=new Float64Array([-0]),et=new Uint8Array(an.buffer);function va(t,e,r){an[0]=t,e[r]=et[0],e[r+1]=et[1],e[r+2]=et[2],e[r+3]=et[3],e[r+4]=et[4],e[r+5]=et[5],e[r+6]=et[6],e[r+7]=et[7]}function ba(t,e){return et[0]=t[e],et[1]=t[e+1],et[2]=t[e+2],et[3]=t[e+3],et[4]=t[e+4],et[5]=t[e+5],et[6]=t[e+6],et[7]=t[e+7],an[0]}var ku=BigInt(Number.MAX_SAFE_INTEGER),Pu=BigInt(Number.MIN_SAFE_INTEGER),st=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return Ft;if(e<ku&&e>Pu)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,i=e-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>Sa&&(i=0n,++n>Sa&&(n=0n))),new t(Number(i),Number(n))}static fromNumber(e){if(e===0)return Ft;let r=e<0;r&&(e=-e);let n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new t(n,i)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):Ft}},Ft=new st(0,0);Ft.toBigInt=function(){return 0n};Ft.zzEncode=Ft.zzDecode=function(){return this};Ft.length=function(){return 1};var Sa=4294967296n;function Ea(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Ba(t,e,r){if(r-e<1)return"";let i,a=[],o=0,s;for(;e<r;)s=t[e++],s<128?a[o++]=s:s>191&&s<224?a[o++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,a[o++]=55296+(s>>10),a[o++]=56320+(s&1023)):a[o++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))}function on(t,e,r){let n=r,i,a;for(let o=0;o<t.length;++o)i=t.charCodeAt(o),i<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=i&63|128):(i&64512)===55296&&((a=t.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128);return r-n}function gt(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Qe(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var sn=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=e,this.pos=0,this.len=e.length}uint32(){let e=4294967295;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,gt(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw gt(this,4);return Qe(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw gt(this,4);return Qe(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw gt(this,4);let e=ma(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw gt(this,4);let e=ba(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw gt(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return Ba(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw gt(this,e);this.pos+=e}else do if(this.pos>=this.len)throw gt(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new st(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw gt(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw gt(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw gt(this,8);let e=Qe(this.buf,this.pos+=4),r=Qe(this.buf,this.pos+=4);return new st(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function un(t){return new sn(t instanceof Uint8Array?t:t.subarray())}function $e(t,e){let r=un(t);return e.decode(r)}function Xe(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Vt(t=0){return globalThis.Buffer?.allocUnsafe!=null?Xe(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Ca(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Aa=Ca("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fn=Ca("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Vt(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Ku={utf8:Aa,"utf-8":Aa,hex:Zt.base16,latin1:fn,ascii:fn,binary:fn,...Zt},Ta=Ku;function Ia(t,e="utf8"){let r=Ta[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Xe(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function cn(t){let e=t??8192,r=e>>>1,n,i=e;return function(o){if(o<1||o>r)return Vt(o);i+o>e&&(n=Vt(e),i=0);let s=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),s}}var qt=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function hn(){}var pn=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},Uu=cn();function Ou(t){return globalThis.Buffer!=null?Vt(t):Uu(t)}var Se=class{len;head;tail;states;constructor(){this.len=0,this.head=new qt(hn,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new qt(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new dn((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(ve,10,st.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=st.fromBigInt(e);return this._push(ve,r.length(),r)}uint64Number(e){let r=st.fromNumber(e);return this._push(ve,r.length(),r)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=st.fromBigInt(e).zzEncode();return this._push(ve,r.length(),r)}sint64Number(e){let r=st.fromNumber(e).zzEncode();return this._push(ve,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(ln,1,e?1:0)}fixed32(e){return this._push(be,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=st.fromBigInt(e);return this._push(be,4,r.lo)._push(be,4,r.hi)}fixed64Number(e){let r=st.fromNumber(e);return this._push(be,4,r.lo)._push(be,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(ga,4,e)}double(e){return this._push(va,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(ln,1,0):this.uint32(r)._push(Fu,r,e)}string(e){let r=Ea(e);return r!==0?this.uint32(r)._push(on,r,e):this._push(ln,1,0)}fork(){return this.states=new pn(this),this.head=this.tail=new qt(hn,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new qt(hn,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Ou(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function ln(t,e,r){e[r]=t&255}function Mu(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var dn=class extends qt{next;constructor(e,r){super(Mu,e,r),this.next=void 0}};function ve(t,e,r){for(;t.hi!==0;)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}function be(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 Fu(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(Se.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Vu,e,t),this},Se.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(qu,e,t),this});function Vu(t,e,r){e.set(t,r)}function qu(t,e,r){t.length<40?on(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Ia(t),r)}function yn(){return new Se}function Je(t,e){let r=yn();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}var ne;(function(t){t[t.VARINT=0]="VARINT",t[t.BIT64=1]="BIT64",t[t.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",t[t.START_GROUP=3]="START_GROUP",t[t.END_GROUP=4]="END_GROUP",t[t.BIT32=5]="BIT32"})(ne||(ne={}));function Ze(t,e,r,n){return{name:t,type:e,encode:r,decode:n}}function xn(t){function e(i){if(t[i.toString()]==null)throw new Error("Invalid enum value");return t[i]}let r=function(a,o){let s=e(a);o.int32(s)},n=function(a){let o=a.int32();return e(o)};return Ze("enum",ne.VARINT,r,n)}function je(t,e){return Ze("message",ne.LENGTH_DELIMITED,t,e)}var lt;(function(t){t.RSA="RSA",t.Ed25519="Ed25519",t.Secp256k1="Secp256k1"})(lt||(lt={}));var gn;(function(t){t[t.RSA=0]="RSA",t[t.Ed25519=1]="Ed25519",t[t.Secp256k1=2]="Secp256k1"})(gn||(gn={}));(function(t){t.codec=()=>xn(gn)})(lt||(lt={}));var ie;(function(t){let e;t.codec=()=>(e==null&&(e=je((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),lt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=lt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Je(r,t.codec()),t.decode=r=>$e(r,t.codec())})(ie||(ie={}));var ae;(function(t){let e;t.codec=()=>(e==null&&(e=je((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),lt.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=lt.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),e),t.encode=r=>Je(r,t.codec()),t.decode=r=>$e(r,t.codec())})(ae||(ae={}));var Hu={"P-256":256,"P-384":384,"P-521":521},Gu=Object.keys(Hu),dp=Gu.join(" / ");var Ju=tt(F(),1);var id=tt(ka(),1);function oe(t){if(isNaN(t)||t<=0)throw new $("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return ya(t)}var Rp=tt(We(),1),Qu=tt(F(),1);var kp=tt(xe(),1),Pp=tt(We(),1);var $u=tt(F(),1);var nf=tt(Wr(),1),af=tt(Y(),1);function of(t){return t[Symbol.asyncIterator]!=null}function sf(t){if(of(t))return(async()=>{for await(let e of t)return e})();for(let e of t)return e}var Ka=sf;function er(){let t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}var rr=class{buffer;mask;top;btm;next;constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},se=class{size;hwm;head;tail;constructor(e={}){this.hwm=e.splitLimit??16,this.head=new rr(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let r=this.head;this.head=r.next=new rr(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};var En=class extends Error{type;code;constructor(e,r){super(e??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function nr(t={}){return uf(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},t)}function uf(t,e){e=e??{};let r=e.onEnd,n=new se,i,a,o,s=er(),f=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((m,b)=>{a=w=>{a=null,n.push(w);try{m(t(n))}catch(B){b(B)}return i}}):t(n)}finally{n.isEmpty()&&queueMicrotask(()=>{s.resolve(),s=er()})}},u=m=>a!=null?a(m):(n.push(m),i),c=m=>(n=new se,a!=null?a({error:m}):(n.push({error:m}),i)),h=m=>{if(o)return i;if(e?.objectMode!==!0&&m?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:m})},p=m=>o?i:(o=!0,m!=null?c(m):u({done:!0})),g=()=>(n=new se,p(),{done:!0}),l=m=>(p(m),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:f,return:g,throw:l,push:h,end:p,get readableLength(){return n.size},onEmpty:async m=>{let b=m?.signal;if(b?.throwIfAborted(),n.isEmpty())return;let w,B;b!=null&&(w=new Promise((L,I)=>{B=()=>{I(new En)},b.addEventListener("abort",B)}));try{await Promise.race([s.promise,w])}finally{B!=null&&b!=null&&b?.removeEventListener("abort",B)}}},r==null)return i;let x=i;return i={[Symbol.asyncIterator](){return this},next(){return x.next()},throw(m){return x.throw(m),r!=null&&(r(m),r=void 0),{done:!0}},return(){return x.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(m){return x.end(m),r!=null&&(r(m),r=void 0),i},get readableLength(){return x.readableLength},onEmpty:m=>x.onEmpty(m)},i}function ff(t){return t[Symbol.asyncIterator]!=null}function cf(...t){let e=[];for(let r of t)ff(r)||e.push(r);return e.length===t.length?function*(){for(let r of e)yield*r}():async function*(){let r=nr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(t.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var Ua=cf;function wn(t,...e){if(t==null)throw new Error("Empty pipeline");if(Bn(t)){let n=t;t=()=>n.source}else if(Ma(t)||Oa(t)){let n=t;t=()=>n}let r=[t,...e];if(r.length>1&&Bn(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)Bn(r[n])&&(r[n]=lf(r[n]));return hf(...r)}var hf=(...t)=>{let e;for(;t.length>0;)e=t.shift()(e);return e},Oa=t=>t?.[Symbol.asyncIterator]!=null,Ma=t=>t?.[Symbol.iterator]!=null,Bn=t=>t==null?!1:t.sink!=null&&t.source!=null,lf=t=>e=>{let r=t.sink(e);if(r?.then!=null){let n=nr({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,a=t.source;if(Oa(a))i=async function*(){yield*a,n.end()};else if(Ma(a))i=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return Ua(n,i())}return t.source};function Fa(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}var Va="/ipfs/ping/1.0.0";var qa="1.0.0",za="ping",Ha="ipfs";var An="ERR_WRONG_PING_ACK";var ir=class{protocol;components;started;timeout;maxInboundStreams;maxOutboundStreams;runOnTransientConnection;log;constructor(e,r={}){this.components=e,this.log=e.logger.forComponent("libp2p:ping"),this.started=!1,this.protocol=`/${r.protocolPrefix??Ha}/${za}/${qa}`,this.timeout=r.timeout??1e4,this.maxInboundStreams=r.maxInboundStreams??2,this.maxOutboundStreams=r.maxOutboundStreams??1,this.runOnTransientConnection=r.runOnTransientConnection??!0,this.handleMessage=this.handleMessage.bind(this)}async start(){await this.components.registrar.handle(this.protocol,this.handleMessage,{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnTransientConnection:this.runOnTransientConnection}),this.started=!0}async stop(){await this.components.registrar.unhandle(this.protocol),this.started=!1}isStarted(){return this.started}handleMessage(e){this.log("incoming ping from %p",e.connection.remotePeer);let{stream:r}=e,n=Date.now();wn(r,r).catch(i=>{this.log.error("incoming ping from %p failed with error",e.connection.remotePeer,i)}).finally(()=>{let i=Date.now()-n;this.log("incoming ping from %p complete in %dms",e.connection.remotePeer,i)})}async ping(e,r={}){this.log("pinging %p",e);let n=Date.now(),i=oe(32),a=await this.components.connectionManager.openConnection(e,r),o,s=()=>{};if(r.signal==null){let f=AbortSignal.timeout(this.timeout);r={...r,signal:f}}try{o=await a.newStream(this.protocol,{...r,runOnTransientConnection:this.runOnTransientConnection}),s=()=>{o?.abort(new $("ping timeout",Rn))},r.signal?.addEventListener("abort",s,{once:!0});let f=await wn([i],o,async c=>Ka(c)),u=Date.now()-n;if(f==null)throw new $(`Did not receive a ping ack after ${u}ms`,An);if(!Fa(i,f.subarray()))throw new $(`Received wrong ping ack after ${u}ms`,An);return this.log("ping %p complete in %dms",a.remotePeer,u),u}catch(f){throw this.log.error("error while pinging %p",a.remotePeer,f),o?.abort(f),f}finally{r.signal?.removeEventListener("abort",s),o!=null&&await o.close()}}};function gf(t={}){return e=>new ir(e,t)}return Xa(mf);})();
|
|
2
|
+
"use strict";var Libp2PPing=(()=>{var xs=Object.create;var Kt=Object.defineProperty;var gs=Object.getOwnPropertyDescriptor;var ms=Object.getOwnPropertyNames;var vs=Object.getPrototypeOf,bs=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G=(e,t)=>{for(var r in t)Kt(e,r,{get:t[r],enumerable:!0})},Ai=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ms(t))!bs.call(e,i)&&i!==r&&Kt(e,i,{get:()=>t[i],enumerable:!(n=gs(t,i))||n.enumerable});return e};var re=(e,t,r)=>(r=e!=null?xs(vs(e)):{},Ai(t||!e||!e.__esModule?Kt(r,"default",{value:e,enumerable:!0}):r,e)),Ss=e=>Ai(Kt({},"__esModule",{value:!0}),e);var F=z((vp,Ii)=>{Ii.exports={options:{usePureJavaScript:!1}}});var Di=z((bp,Ri)=>{var Ir={};Ri.exports=Ir;var _i={};Ir.encode=function(e,t,r){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(e instanceof Uint8Array))n=Es(e,t);else{var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var f=0,c=e[i];f<s.length;++f)c+=s[f]<<8,s[f]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;e[i]===0&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
|
|
3
|
+
`)}return n};Ir.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=_i[t];if(!r){r=_i[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");for(var i=t.length,a=t.charAt(0),o=[0],n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(s===void 0)return;for(var f=0,c=s;f<o.length;++f)c+=o[f]*i,o[f]=c&255,c>>=8;for(;c>0;)o.push(c&255),c>>=8}for(var u=0;e[u]===a&&u<e.length-1;++u)o.push(0);return typeof Buffer<"u"?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function Es(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var f="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)f+=i;for(r=a.length-1;r>=0;--r)f+=t[a[r]];return f}});var J=z((Sp,Pi)=>{var Ni=F(),Li=Di(),d=Pi.exports=Ni.util=Ni.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){d.nextTick=process.nextTick,typeof setImmediate=="function"?d.setImmediate=setImmediate:d.setImmediate=d.nextTick;return}if(typeof setImmediate=="function"){d.setImmediate=function(){return setImmediate.apply(void 0,arguments)},d.nextTick=function(s){return setImmediate(s)};return}if(d.setImmediate=function(s){setTimeout(s,0)},typeof window<"u"&&typeof window.postMessage=="function"){let s=function(f){if(f.source===window&&f.data===e){f.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(u){u()})}};var o=s,e="forge.setImmediate",t=[];d.setImmediate=function(f){t.push(f),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var f=t.slice();t.length=0,f.forEach(function(c){c()})}).observe(i,{attributes:!0});var a=d.setImmediate;d.setImmediate=function(f){Date.now()-r>15?(r=Date.now(),a(f)):(t.push(f),t.length===1&&i.setAttribute("a",n=!n))}}d.nextTick=d.setImmediate})();d.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;d.globalScope=function(){return d.isNodejs?globalThis:typeof self>"u"?window:self}();d.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};d.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};d.isArrayBufferView=function(e){return e&&d.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function gt(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}d.ByteBuffer=_r;function _r(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(d.isArrayBuffer(e)||d.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof _r||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}d.ByteStringBuffer=_r;var ws=4096;d.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>ws&&(this.data.substr(0,1),this._constructedStringLength=0)};d.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};d.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};d.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};d.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this};d.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};d.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(d.encodeUtf8(e))};d.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};d.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};d.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};d.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};d.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};d.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};d.ByteStringBuffer.prototype.putInt=function(e,t){gt(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)};d.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};d.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};d.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};d.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};d.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};d.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};d.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};d.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};d.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};d.ByteStringBuffer.prototype.getInt=function(e){gt(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};d.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};d.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};d.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};d.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};d.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};d.ByteStringBuffer.prototype.copy=function(){var e=d.createBuffer(this.data);return e.read=this.read,e};d.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};d.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};d.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};d.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};function As(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=d.isArrayBuffer(e),n=d.isArrayBufferView(e);if(r||n){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}d.DataBuffer=As;d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};d.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this};d.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};d.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this};d.DataBuffer.prototype.putBytes=function(e,t){if(d.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(d.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof d.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&d.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(e instanceof d.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var a;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(e,a,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.base64.decode(e,a,this.write),this;if(t==="utf8"&&(e=d.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.raw.decode(a),this;if(t==="utf16")return this.accommodate(e.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=d.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};d.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};d.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};d.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};d.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};d.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};d.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};d.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};d.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};d.DataBuffer.prototype.putInt=function(e,t){gt(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};d.DataBuffer.prototype.putSignedInt=function(e,t){return gt(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};d.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};d.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};d.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};d.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};d.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};d.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};d.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};d.DataBuffer.prototype.getInt=function(e){gt(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};d.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};d.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};d.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};d.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};d.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)};d.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};d.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};d.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};d.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e};d.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return d.binary.raw.encode(t);if(e==="hex")return d.binary.hex.encode(t);if(e==="base64")return d.binary.base64.encode(t);if(e==="utf8")return d.text.utf8.decode(t);if(e==="utf16")return d.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};d.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=d.encodeUtf8(e)),new d.ByteBuffer(e)};d.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r};d.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a,n};d.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t};d.bytesToHex=function(e){return d.createBuffer(e).toHex()};d.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ne=[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],ki="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";d.encode64=function(e,t){for(var r="",n="",i,a,o,s=0;s<e.length;)i=e.charCodeAt(s++),a=e.charCodeAt(s++),o=e.charCodeAt(s++),r+=De.charAt(i>>2),r+=De.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=De.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":De.charAt(o&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
|
|
4
|
+
`,r=r.substr(t));return n+=r,n};d.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,a,o=0;o<e.length;)r=Ne[e.charCodeAt(o++)-43],n=Ne[e.charCodeAt(o++)-43],i=Ne[e.charCodeAt(o++)-43],a=Ne[e.charCodeAt(o++)-43],t+=String.fromCharCode(r<<2|n>>4),i!==64&&(t+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(t+=String.fromCharCode((i&3)<<6|a)));return t};d.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};d.decodeUtf8=function(e){return decodeURIComponent(escape(e))};d.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Li.encode,decode:Li.decode}};d.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};d.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var i=0,a=r;for(e.length&1&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n};d.binary.base64.encode=function(e,t){for(var r="",n="",i,a,o,s=0;s<e.byteLength;)i=e[s++],a=e[s++],o=e[s++],r+=De.charAt(i>>2),r+=De.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=De.charAt((a&15)<<2|o>>6),r+=isNaN(o)?"=":De.charAt(o&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
|
|
5
|
+
`,r=r.substr(t));return n+=r,n};d.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,o,s,f=0,c=r;f<e.length;)i=Ne[e.charCodeAt(f++)-43],a=Ne[e.charCodeAt(f++)-43],o=Ne[e.charCodeAt(f++)-43],s=Ne[e.charCodeAt(f++)-43],n[c++]=i<<2|a>>4,o!==64&&(n[c++]=(a&15)<<4|o>>2,s!==64&&(n[c++]=(o&3)<<6|s));return t?c-r:n.subarray(0,c)};d.binary.base58.encode=function(e,t){return d.binary.baseN.encode(e,ki,t)};d.binary.base58.decode=function(e,t){return d.binary.baseN.decode(e,ki,t)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(e,t,r){e=d.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};d.text.utf8.decode=function(e){return d.decodeUtf8(String.fromCharCode.apply(null,e))};d.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n};d.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};d.deflate=function(e,t,r){if(t=d.decode64(e.deflate(d.encode64(t)).rval),r){var n=2,i=t.charCodeAt(1);i&32&&(n=6),t=t.substring(n,t.length-4)}return t};d.inflate=function(e,t,r){var n=e.inflate(d.encode64(t)).rval;return n===null?null:d.decode64(n)};var Rr=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(r===null?n=e.removeItem(t):(r=d.encode64(JSON.stringify(r)),n=e.setItem(t,r)),typeof n<"u"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},Dr=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(d.decode64(r))),r},Bs=function(e,t,r,n){var i=Dr(e,t);i===null&&(i={}),i[r]=n,Rr(e,t,i)},Cs=function(e,t,r){var n=Dr(e,t);return n!==null&&(n=r in n?n[r]:null),n},Ts=function(e,t,r){var n=Dr(e,t);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),Rr(e,t,n)}},Is=function(e,t){Rr(e,t,null)},Mt=function(e,t,r){var n=null;typeof r>"u"&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");n=e.apply(this,t),a=i==="flash"}(i==="web"||i==="both")&&(t[0]=localStorage,n=e.apply(this,t),a=!0)}catch(f){o=f}if(a)break}if(!a)throw o;return n};d.setItem=function(e,t,r,n,i){Mt(Bs,arguments,i)};d.getItem=function(e,t,r,n){return Mt(Cs,arguments,n)};d.removeItem=function(e,t,r,n){Mt(Ts,arguments,n)};d.clearItems=function(e,t,r){Mt(Is,arguments,r)};d.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};d.format=function(e){for(var t=/%./g,r,n,i=0,a=[],o=0;r=t.exec(e);){n=e.substring(o,t.lastIndex-2),n.length>0&&a.push(n),o=t.lastIndex;var s=r[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")};d.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=r===void 0?",":r,s=n===void 0?".":n,f=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",u=c.length>3?c.length%3:0;return f+(u?c.substr(0,u)+s:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")};d.formatSize=function(e){return e>=1073741824?e=d.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=d.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=d.formatNumber(e/1024,0)+" KiB":e=d.formatNumber(e,0)+" bytes",e};d.bytesFromIP=function(e){return e.indexOf(".")!==-1?d.bytesFromIPv4(e):e.indexOf(":")!==-1?d.bytesFromIPv6(e):null};d.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=d.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()};d.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(o){return o.length===0&&++t,!0});for(var r=(8-e.length+t)*2,n=d.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=d.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};d.bytesToIP=function(e){return e.length===4?d.bytesToIPv4(e):e.length===16?d.bytesToIPv6(e):null};d.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")};d.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=d.bytesToHex(e[i]+e[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var o=r[r.length-1],s=t.length;!o||s!==o.end+1?r.push({start:s,end:s}):(o.end=s,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1))}t.push(a)}if(r.length>0){var f=r[n];f.end-f.start>0&&(t.splice(f.start,f.end-f.start+1,""),f.start===0&&t.unshift(""),f.end===7&&t.push(""))}return t.join(":")};d.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in d&&!e.update)return t(null,d.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return d.cores=navigator.hardwareConcurrency,t(null,d.cores);if(typeof Worker>"u")return d.cores=1,t(null,d.cores);if(typeof Blob>"u")return d.cores=2,t(null,d.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(o){for(var s=Date.now(),f=s+4;Date.now()<f;);self.postMessage({st:s,et:f})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(o,s,f){if(s===0){var c=Math.floor(o.reduce(function(u,h){return u+h},0)/o.length);return d.cores=Math.max(1,c),URL.revokeObjectURL(r),t(null,d.cores)}i(f,function(u,h){o.push(a(f,h)),n(o,s-1,f)})}function i(o,s){for(var f=[],c=[],u=0;u<o;++u){var h=new Worker(r);h.addEventListener("message",function(p){if(c.push(p.data),c.length===o){for(var m=0;m<o;++m)f[m].terminate();s(null,c)}}),f.push(h)}for(var u=0;u<o;++u)f[u].postMessage(u)}function a(o,s){for(var f=[],c=0;c<o;++c)for(var u=s[c],h=f[c]=[],p=0;p<o;++p)if(c!==p){var m=s[p];(u.st>m.st&&u.st<m.et||m.st>u.st&&m.st<u.et)&&h.push(p)}return f.reduce(function(l,y){return Math.max(l,y.length)},0)}}});var Lr=z((Ep,Ui)=>{var j=F();J();Ui.exports=j.cipher=j.cipher||{};j.cipher.algorithms=j.cipher.algorithms||{};j.cipher.createCipher=function(e,t){var r=e;if(typeof r=="string"&&(r=j.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})};j.cipher.createDecipher=function(e,t){var r=e;if(typeof r=="string"&&(r=j.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})};j.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),j.cipher.algorithms[e]=t};j.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in j.cipher.algorithms?j.cipher.algorithms[e]:null};var Nr=j.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Nr.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=j.util.createBuffer(),this.output=e.output||j.util.createBuffer(),this.mode.start(t)};Nr.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Nr.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return e(this.blockSize,r,!1)},this.mode.unpad=function(r){return e(this.blockSize,r,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}});var Pr=z((wp,Ki)=>{var ee=F();J();ee.cipher=ee.cipher||{};var U=Ki.exports=ee.cipher.modes=ee.cipher.modes||{};U.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};U.ecb.prototype.start=function(e){};U.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};U.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};U.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};U.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};U.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};U.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Ot(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};U.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock};U.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};U.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};U.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};U.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=ee.util.createBuffer(),this._partialBytes=0};U.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Ot(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};U.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};U.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};U.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ee.util.createBuffer(),this._partialBytes=0};U.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Ot(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};U.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};U.ofb.prototype.decrypt=U.ofb.prototype.encrypt;U.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=ee.util.createBuffer(),this._partialBytes=0};U.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Ot(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};U.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Ft(this._inBlock)};U.ctr.prototype.decrypt=U.ctr.prototype.encrypt;U.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=ee.util.createBuffer(),this._partialBytes=0,this._R=3774873600};U.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=ee.util.createBuffer(e.iv);this._cipherLength=0;var r;if("additionalData"in e?r=ee.util.createBuffer(e.additionalData):r=ee.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=ee.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=t.length();if(n===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(kr(n*8)))}this._inBlock=this._j0.slice(0),Ft(this._inBlock),this._partialBytes=0,r=ee.util.createBuffer(r),this._aDataLength=kr(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};U.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Ft(this._inBlock)};U.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ft(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};U.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=ee.util.createBuffer();var n=this._aDataLength.concat(kr(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};U.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var a=e[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};U.gcm.prototype.pow=function(e,t){for(var r=e[3]&1,n=3;n>0;--n)t[n]=e[n]>>>1|(e[n-1]&1)<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)};U.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=e[n]>>>(7-r%8)*4&15,a=this._m[r][i];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t};U.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)};U.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],f=o/n|0,c=(n-1-o%n)*t;s[f]=1<<t-1<<c,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a};U.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],f=i[o];i[a+o]=[s[0]^f[0],s[1]^f[1],s[2]^f[2],s[3]^f[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i};function Ot(e,t){if(typeof e=="string"&&(e=ee.util.createBuffer(e)),ee.util.isArray(e)&&e.length>4){var r=e;e=ee.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!ee.util.isArray(e)){for(var i=[],a=t/4,n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function Ft(e){e[e.length-1]=e[e.length-1]+1&4294967295}function kr(e){return[e/4294967296|0,e&4294967295]}});var qt=z((Ap,Vi)=>{var q=F();Lr();Pr();J();Vi.exports=q.aes=q.aes||{};q.aes.startEncrypting=function(e,t,r,n){var i=Vt({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i};q.aes.createEncryptionCipher=function(e,t){return Vt({key:e,output:null,decrypt:!1,mode:t})};q.aes.startDecrypting=function(e,t,r,n){var i=Vt({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i};q.aes.createDecryptionCipher=function(e,t){return Vt({key:e,output:null,decrypt:!0,mode:t})};q.aes.Algorithm=function(e,t){Mr||Oi();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(n,i){return Kr(r._w,n,i,!1)},decrypt:function(n,i){return Kr(r._w,n,i,!0)}}}),r._init=!1};q.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=q.util.createBuffer(t);else if(q.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=q.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(!q.util.isArray(t)){r=t,t=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)t.push(r.getInt32())}}if(!q.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,o=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=Fi(t,e.decrypt&&!o),this._init=!0}};q.aes._expandKey=function(e,t){return Mr||Oi(),Fi(e,t)};q.aes._updateBlock=Kr;Xe("AES-ECB",q.cipher.modes.ecb);Xe("AES-CBC",q.cipher.modes.cbc);Xe("AES-CFB",q.cipher.modes.cfb);Xe("AES-OFB",q.cipher.modes.ofb);Xe("AES-CTR",q.cipher.modes.ctr);Xe("AES-GCM",q.cipher.modes.gcm);function Xe(e,t){var r=function(){return new q.aes.Algorithm(e,t)};q.cipher.registerAlgorithm(e,r)}var Mr=!1,Je=4,ae,Ur,Mi,Me,ye;function Oi(){Mr=!0,Mi=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;ae=new Array(256),Ur=new Array(256),Me=new Array(4),ye=new Array(4);for(var t=0;t<4;++t)Me[t]=new Array(256),ye[t]=new Array(256);for(var r=0,n=0,i,a,o,s,f,c,u,t=0;t<256;++t){s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^s&255^99,ae[r]=s,Ur[s]=r,f=e[s],i=e[r],a=e[i],o=e[a],c=f<<24^s<<16^s<<8^(s^f),u=(i^a^o)<<24^(r^o)<<16^(r^a^o)<<8^(r^i^o);for(var h=0;h<4;++h)Me[h][r]=c,ye[h][s]=u,c=c<<24|c>>>8,u=u<<24|u>>>8;r===0?r=n=1:(r=i^e[e[e[i^o]]],n^=e[e[n]])}}function Fi(e,t){for(var r=e.slice(0),n,i=1,a=r.length,o=a+6+1,s=Je*o,f=a;f<s;++f)n=r[f-1],f%a===0?(n=ae[n>>>16&255]<<24^ae[n>>>8&255]<<16^ae[n&255]<<8^ae[n>>>24]^Mi[i]<<24,i++):a>6&&f%a===4&&(n=ae[n>>>24]<<24^ae[n>>>16&255]<<16^ae[n>>>8&255]<<8^ae[n&255]),r[f]=r[f-a]^n;if(t){var c,u=ye[0],h=ye[1],p=ye[2],m=ye[3],l=r.slice(0);s=r.length;for(var f=0,y=s-Je;f<s;f+=Je,y-=Je)if(f===0||f===s-Je)l[f]=r[y],l[f+1]=r[y+3],l[f+2]=r[y+2],l[f+3]=r[y+1];else for(var g=0;g<Je;++g)c=r[y+g],l[f+(3&-g)]=u[ae[c>>>24]]^h[ae[c>>>16&255]]^p[ae[c>>>8&255]]^m[ae[c&255]];r=l}return r}function Kr(e,t,r,n){var i=e.length/4-1,a,o,s,f,c;n?(a=ye[0],o=ye[1],s=ye[2],f=ye[3],c=Ur):(a=Me[0],o=Me[1],s=Me[2],f=Me[3],c=ae);var u,h,p,m,l,y,g;u=t[0]^e[0],h=t[n?3:1]^e[1],p=t[2]^e[2],m=t[n?1:3]^e[3];for(var v=3,w=1;w<i;++w)l=a[u>>>24]^o[h>>>16&255]^s[p>>>8&255]^f[m&255]^e[++v],y=a[h>>>24]^o[p>>>16&255]^s[m>>>8&255]^f[u&255]^e[++v],g=a[p>>>24]^o[m>>>16&255]^s[u>>>8&255]^f[h&255]^e[++v],m=a[m>>>24]^o[u>>>16&255]^s[h>>>8&255]^f[p&255]^e[++v],u=l,h=y,p=g;r[0]=c[u>>>24]<<24^c[h>>>16&255]<<16^c[p>>>8&255]<<8^c[m&255]^e[++v],r[n?3:1]=c[h>>>24]<<24^c[p>>>16&255]<<16^c[m>>>8&255]<<8^c[u&255]^e[++v],r[2]=c[p>>>24]<<24^c[m>>>16&255]<<16^c[u>>>8&255]<<8^c[h&255]^e[++v],r[n?1:3]=c[m>>>24]<<24^c[u>>>16&255]<<16^c[h>>>8&255]<<8^c[p&255]^e[++v]}function Vt(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="AES-"+t,n;e.decrypt?n=q.cipher.createDecipher(r,e.key):n=q.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof q.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var Wt=z((Rd,ua)=>{var Et=F();Et.pki=Et.pki||{};var un=ua.exports=Et.pki.oids=Et.oids=Et.oids||{};function A(e,t){un[e]=t,un[t]=e}function O(e,t){un[e]=t}A("1.2.840.113549.1.1.1","rsaEncryption");A("1.2.840.113549.1.1.4","md5WithRSAEncryption");A("1.2.840.113549.1.1.5","sha1WithRSAEncryption");A("1.2.840.113549.1.1.7","RSAES-OAEP");A("1.2.840.113549.1.1.8","mgf1");A("1.2.840.113549.1.1.9","pSpecified");A("1.2.840.113549.1.1.10","RSASSA-PSS");A("1.2.840.113549.1.1.11","sha256WithRSAEncryption");A("1.2.840.113549.1.1.12","sha384WithRSAEncryption");A("1.2.840.113549.1.1.13","sha512WithRSAEncryption");A("1.3.101.112","EdDSA25519");A("1.2.840.10040.4.3","dsa-with-sha1");A("1.3.14.3.2.7","desCBC");A("1.3.14.3.2.26","sha1");A("1.3.14.3.2.29","sha1WithRSASignature");A("2.16.840.1.101.3.4.2.1","sha256");A("2.16.840.1.101.3.4.2.2","sha384");A("2.16.840.1.101.3.4.2.3","sha512");A("2.16.840.1.101.3.4.2.4","sha224");A("2.16.840.1.101.3.4.2.5","sha512-224");A("2.16.840.1.101.3.4.2.6","sha512-256");A("1.2.840.113549.2.2","md2");A("1.2.840.113549.2.5","md5");A("1.2.840.113549.1.7.1","data");A("1.2.840.113549.1.7.2","signedData");A("1.2.840.113549.1.7.3","envelopedData");A("1.2.840.113549.1.7.4","signedAndEnvelopedData");A("1.2.840.113549.1.7.5","digestedData");A("1.2.840.113549.1.7.6","encryptedData");A("1.2.840.113549.1.9.1","emailAddress");A("1.2.840.113549.1.9.2","unstructuredName");A("1.2.840.113549.1.9.3","contentType");A("1.2.840.113549.1.9.4","messageDigest");A("1.2.840.113549.1.9.5","signingTime");A("1.2.840.113549.1.9.6","counterSignature");A("1.2.840.113549.1.9.7","challengePassword");A("1.2.840.113549.1.9.8","unstructuredAddress");A("1.2.840.113549.1.9.14","extensionRequest");A("1.2.840.113549.1.9.20","friendlyName");A("1.2.840.113549.1.9.21","localKeyId");A("1.2.840.113549.1.9.22.1","x509Certificate");A("1.2.840.113549.1.12.10.1.1","keyBag");A("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");A("1.2.840.113549.1.12.10.1.3","certBag");A("1.2.840.113549.1.12.10.1.4","crlBag");A("1.2.840.113549.1.12.10.1.5","secretBag");A("1.2.840.113549.1.12.10.1.6","safeContentsBag");A("1.2.840.113549.1.5.13","pkcs5PBES2");A("1.2.840.113549.1.5.12","pkcs5PBKDF2");A("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");A("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");A("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");A("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");A("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");A("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");A("1.2.840.113549.2.7","hmacWithSHA1");A("1.2.840.113549.2.8","hmacWithSHA224");A("1.2.840.113549.2.9","hmacWithSHA256");A("1.2.840.113549.2.10","hmacWithSHA384");A("1.2.840.113549.2.11","hmacWithSHA512");A("1.2.840.113549.3.7","des-EDE3-CBC");A("2.16.840.1.101.3.4.1.2","aes128-CBC");A("2.16.840.1.101.3.4.1.22","aes192-CBC");A("2.16.840.1.101.3.4.1.42","aes256-CBC");A("2.5.4.3","commonName");A("2.5.4.4","surname");A("2.5.4.5","serialNumber");A("2.5.4.6","countryName");A("2.5.4.7","localityName");A("2.5.4.8","stateOrProvinceName");A("2.5.4.9","streetAddress");A("2.5.4.10","organizationName");A("2.5.4.11","organizationalUnitName");A("2.5.4.12","title");A("2.5.4.13","description");A("2.5.4.15","businessCategory");A("2.5.4.17","postalCode");A("2.5.4.42","givenName");A("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");A("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");A("2.16.840.1.113730.1.1","nsCertType");A("2.16.840.1.113730.1.13","nsComment");O("2.5.29.1","authorityKeyIdentifier");O("2.5.29.2","keyAttributes");O("2.5.29.3","certificatePolicies");O("2.5.29.4","keyUsageRestriction");O("2.5.29.5","policyMapping");O("2.5.29.6","subtreesConstraint");O("2.5.29.7","subjectAltName");O("2.5.29.8","issuerAltName");O("2.5.29.9","subjectDirectoryAttributes");O("2.5.29.10","basicConstraints");O("2.5.29.11","nameConstraints");O("2.5.29.12","policyConstraints");O("2.5.29.13","basicConstraints");A("2.5.29.14","subjectKeyIdentifier");A("2.5.29.15","keyUsage");O("2.5.29.16","privateKeyUsagePeriod");A("2.5.29.17","subjectAltName");A("2.5.29.18","issuerAltName");A("2.5.29.19","basicConstraints");O("2.5.29.20","cRLNumber");O("2.5.29.21","cRLReason");O("2.5.29.22","expirationDate");O("2.5.29.23","instructionCode");O("2.5.29.24","invalidityDate");O("2.5.29.25","cRLDistributionPoints");O("2.5.29.26","issuingDistributionPoint");O("2.5.29.27","deltaCRLIndicator");O("2.5.29.28","issuingDistributionPoint");O("2.5.29.29","certificateIssuer");O("2.5.29.30","nameConstraints");A("2.5.29.31","cRLDistributionPoints");A("2.5.29.32","certificatePolicies");O("2.5.29.33","policyMappings");O("2.5.29.34","policyConstraints");A("2.5.29.35","authorityKeyIdentifier");O("2.5.29.36","policyConstraints");A("2.5.29.37","extKeyUsage");O("2.5.29.46","freshestCRL");O("2.5.29.54","inhibitAnyPolicy");A("1.3.6.1.4.1.11129.2.4.2","timestampList");A("1.3.6.1.5.5.7.1.1","authorityInfoAccess");A("1.3.6.1.5.5.7.3.1","serverAuth");A("1.3.6.1.5.5.7.3.2","clientAuth");A("1.3.6.1.5.5.7.3.3","codeSigning");A("1.3.6.1.5.5.7.3.4","emailProtection");A("1.3.6.1.5.5.7.3.8","timeStamping")});var At=z((Dd,la)=>{var H=F();J();Wt();var T=la.exports=H.asn1=H.asn1||{};T.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};T.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};T.create=function(e,t,r,n,i){if(H.util.isArray(n)){for(var a=[],o=0;o<n.length;++o)n[o]!==void 0&&a.push(n[o]);n=a}var s={tagClass:e,type:t,constructed:r,composed:r||H.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=T.copy(s)),s};T.copy=function(e,t){var r;if(H.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(T.copy(e[n],t));return r}return typeof e=="string"?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:T.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)};T.equals=function(e,t,r){if(H.util.isArray(e)){if(!H.util.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!T.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&T.equals(e.value,t.value);return r&&r.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i};T.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var r,n=t&128;return n?r=e.getInt((t&127)<<3):r=t,r}};function wt(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}var F0=function(e,t){var r=e.getByte();if(t--,r!==128){var n,i=r&128;if(!i)n=r;else{var a=r&127;wt(e,t,a),n=e.getInt(a<<3)}if(n<0)throw new Error("Negative length: "+n);return n}};T.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=H.util.createBuffer(e));var r=e.length(),n=$t(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=r,i.remaining=e.length(),i}return n};function $t(e,t,r,n){var i;wt(e,t,2);var a=e.getByte();t--;var o=a&192,s=a&31;i=e.length();var f=F0(e,t);if(t-=i-e.length(),f!==void 0&&f>t){if(n.strict){var c=new Error("Too few bytes to read ASN.1 value.");throw c.available=e.length(),c.remaining=t,c.requested=f,c}f=t}var u,h,p=(a&32)===32;if(p)if(u=[],f===void 0)for(;;){if(wt(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}i=e.length(),u.push($t(e,t,r+1,n)),t-=i-e.length()}else for(;f>0;)i=e.length(),u.push($t(e,f,r+1,n)),t-=i-e.length(),f-=i-e.length();if(u===void 0&&o===T.Class.UNIVERSAL&&s===T.Type.BITSTRING&&(h=e.bytes(f)),u===void 0&&n.decodeBitStrings&&o===T.Class.UNIVERSAL&&s===T.Type.BITSTRING&&f>1){var m=e.read,l=t,y=0;if(s===T.Type.BITSTRING&&(wt(e,t,1),y=e.getByte(),t--),y===0)try{i=e.length();var g={strict:!0,decodeBitStrings:!0},v=$t(e,t,r+1,g),w=i-e.length();t-=w,s==T.Type.BITSTRING&&w++;var S=v.tagClass;w===f&&(S===T.Class.UNIVERSAL||S===T.Class.CONTEXT_SPECIFIC)&&(u=[v])}catch{}u===void 0&&(e.read=m,t=l)}if(u===void 0){if(f===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=t}if(s===T.Type.BMPSTRING)for(u="";f>0;f-=2)wt(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(f),t-=f}var I=h===void 0?null:{bitStringContents:h};return T.create(o,s,p,u,I)}T.toDer=function(e){var t=H.util.createBuffer(),r=e.tagClass|e.type,n=H.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=T.equals(e,e.original))),i)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var a=0;a<e.value.length;++a)e.value[a]!==void 0&&n.putBuffer(T.toDer(e.value[a]))}else if(e.type===T.Type.BMPSTRING)for(var a=0;a<e.value.length;++a)n.putInt16(e.value.charCodeAt(a));else e.type===T.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),n.length()<=127)t.putByte(n.length()&127);else{var o=n.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);t.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)t.putByte(s.charCodeAt(a))}return t.putBuffer(n),t};T.oidToDer=function(e){var t=e.split("."),r=H.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var n,i,a,o,s=2;s<t.length;++s){n=!0,i=[],a=parseInt(t[s],10);do o=a&127,a=a>>>7,n||(o|=128),i.push(o),n=!1;while(a>0);for(var f=i.length-1;f>=0;--f)r.putByte(i[f])}return r};T.derToOid=function(e){var t;typeof e=="string"&&(e=H.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)r=e.getByte(),n=n<<7,r&128?n+=r&127:(t+="."+(n+r),n=0);return t};T.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var f=e.charAt(10),c=10;f!=="+"&&f!=="-"&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&(f=e.charAt(c),f==="+"||f==="-")){var u=parseInt(e.substr(c+1,2),10),h=parseInt(e.substr(c+4,2),10),p=u*60+h;p*=6e4,f==="+"?t.setTime(+t-p):t.setTime(+t+p)}return t};T.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),f=0,c=0,u=!1;e.charAt(e.length-1)==="Z"&&(u=!0);var h=e.length-5,p=e.charAt(h);if(p==="+"||p==="-"){var m=parseInt(e.substr(h+1,2),10),l=parseInt(e.substr(h+4,2),10);c=m*60+l,c*=6e4,p==="+"&&(c*=-1),u=!0}return e.charAt(14)==="."&&(f=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,f),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,f)),t};T.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};T.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z",t};T.integerToDer=function(e){var t=H.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r};T.derToInteger=function(e){typeof e=="string"&&(e=H.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};T.validate=function(e,t,r,n){var i=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(i=!0,t.value&&H.util.isArray(t.value))for(var a=0,o=0;i&&o<t.value.length;++o)i=t.value[o].optional||!1,e.value[a]&&(i=T.validate(e.value[a],t.value[o],r,n),i?++a:t.value[o].optional&&(i=!0)),!i&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){var s;if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{var f=e.bitStringContents.charCodeAt(0);if(f!==0)throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return i};var ha=/[^\\u0000-\\u00ff]/;T.prettyPrint=function(e,t,r){var n="";t=t||0,r=r||2,t>0&&(n+=`
|
|
6
|
+
`);for(var i="",a=0;a<t*r;++a)i+=" ";switch(n+=i+"Tag: ",e.tagClass){case T.Class.UNIVERSAL:n+="Universal:";break;case T.Class.APPLICATION:n+="Application:";break;case T.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case T.Class.PRIVATE:n+="Private:";break}if(e.tagClass===T.Class.UNIVERSAL)switch(n+=e.type,e.type){case T.Type.NONE:n+=" (None)";break;case T.Type.BOOLEAN:n+=" (Boolean)";break;case T.Type.INTEGER:n+=" (Integer)";break;case T.Type.BITSTRING:n+=" (Bit string)";break;case T.Type.OCTETSTRING:n+=" (Octet string)";break;case T.Type.NULL:n+=" (Null)";break;case T.Type.OID:n+=" (Object Identifier)";break;case T.Type.ODESC:n+=" (Object Descriptor)";break;case T.Type.EXTERNAL:n+=" (External or Instance of)";break;case T.Type.REAL:n+=" (Real)";break;case T.Type.ENUMERATED:n+=" (Enumerated)";break;case T.Type.EMBEDDED:n+=" (Embedded PDV)";break;case T.Type.UTF8:n+=" (UTF8)";break;case T.Type.ROID:n+=" (Relative Object Identifier)";break;case T.Type.SEQUENCE:n+=" (Sequence)";break;case T.Type.SET:n+=" (Set)";break;case T.Type.PRINTABLESTRING:n+=" (Printable String)";break;case T.Type.IA5String:n+=" (IA5String (ASCII))";break;case T.Type.UTCTIME:n+=" (UTC time)";break;case T.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case T.Type.BMPSTRING:n+=" (BMP String)";break}else n+=e.type;if(n+=`
|
|
7
|
+
`,n+=i+"Constructed: "+e.constructed+`
|
|
8
|
+
`,e.composed){for(var o=0,s="",a=0;a<e.value.length;++a)e.value[a]!==void 0&&(o+=1,s+=T.prettyPrint(e.value[a],t+1,r),a+1<e.value.length&&(s+=","));n+=i+"Sub values: "+o+s}else{if(n+=i+"Value: ",e.type===T.Type.OID){var f=T.derToOid(e.value);n+=f,H.pki&&H.pki.oids&&f in H.pki.oids&&(n+=" ("+H.pki.oids[f]+") ")}if(e.type===T.Type.INTEGER)try{n+=T.derToInteger(e.value)}catch{n+="0x"+H.util.bytesToHex(e.value)}else if(e.type===T.Type.BITSTRING){if(e.value.length>1?n+="0x"+H.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var c=e.value.charCodeAt(0);c==1?n+=" (1 unused bit shown)":c>1&&(n+=" ("+c+" unused bits shown)")}}else if(e.type===T.Type.OCTETSTRING)ha.test(e.value)||(n+="("+e.value+") "),n+="0x"+H.util.bytesToHex(e.value);else if(e.type===T.Type.UTF8)try{n+=H.util.decodeUtf8(e.value)}catch(u){if(u.message==="URI malformed")n+="0x"+H.util.bytesToHex(e.value)+" (malformed UTF8)";else throw u}else e.type===T.Type.PRINTABLESTRING||e.type===T.Type.IA5String?n+=e.value:ha.test(e.value)?n+="0x"+H.util.bytesToHex(e.value):e.value.length===0?n+="[null]":n+=e.value}return n}});var ya=z((Nd,da)=>{var $=F();Lr();Pr();J();da.exports=$.des=$.des||{};$.des.startEncrypting=function(e,t,r,n){var i=Yt({key:e,output:r,decrypt:!1,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};$.des.createEncryptionCipher=function(e,t){return Yt({key:e,output:null,decrypt:!1,mode:t})};$.des.startDecrypting=function(e,t,r,n){var i=Yt({key:e,output:r,decrypt:!0,mode:n||(t===null?"ECB":"CBC")});return i.start(t),i};$.des.createDecryptionCipher=function(e,t){return Yt({key:e,output:null,decrypt:!0,mode:t})};$.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(n,i){return pa(r._keys,n,i,!1)},decrypt:function(n,i){return pa(r._keys,n,i,!0)}}}),r._init=!1};$.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=$.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=Q0(t),this._init=!0}};ve("DES-ECB",$.cipher.modes.ecb);ve("DES-CBC",$.cipher.modes.cbc);ve("DES-CFB",$.cipher.modes.cfb);ve("DES-OFB",$.cipher.modes.ofb);ve("DES-CTR",$.cipher.modes.ctr);ve("3DES-ECB",$.cipher.modes.ecb);ve("3DES-CBC",$.cipher.modes.cbc);ve("3DES-CFB",$.cipher.modes.cfb);ve("3DES-OFB",$.cipher.modes.ofb);ve("3DES-CTR",$.cipher.modes.ctr);function ve(e,t){var r=function(){return new $.des.Algorithm(e,t)};$.cipher.registerAlgorithm(e,r)}var V0=[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],q0=[-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],z0=[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],G0=[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],H0=[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],W0=[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],$0=[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],Y0=[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 Q0(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],f=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],l=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,g=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,S,I=0;I<y;I++){var B=e.getInt32(),C=e.getInt32();S=(B>>>4^C)&252645135,C^=S,B^=S<<4,S=(C>>>-16^B)&65535,B^=S,C^=S<<-16,S=(B>>>2^C)&858993459,C^=S,B^=S<<2,S=(C>>>-16^B)&65535,B^=S,C^=S<<-16,S=(B>>>1^C)&1431655765,C^=S,B^=S<<1,S=(C>>>8^B)&16711935,B^=S,C^=S<<8,S=(B>>>1^C)&1431655765,C^=S,B^=S<<1,S=B<<8|C>>>20&240,B=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=S;for(var R=0;R<v.length;++R){v[R]?(B=B<<2|B>>>26,C=C<<2|C>>>26):(B=B<<1|B>>>27,C=C<<1|C>>>27),B&=-15,C&=-15;var N=t[B>>>28]|r[B>>>24&15]|n[B>>>20&15]|i[B>>>16&15]|a[B>>>12&15]|o[B>>>8&15]|s[B>>>4&15],V=f[C>>>28]|c[C>>>24&15]|u[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|m[C>>>8&15]|l[C>>>4&15];S=(V>>>16^N)&65535,g[w++]=N^S,g[w++]=V^S<<16}}return g}function pa(e,t,r,n){var i=e.length===32?3:9,a;i===3?a=n?[30,-2,-2]:[0,32,2]:a=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],f=t[1];o=(s>>>4^f)&252645135,f^=o,s^=o<<4,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,s=s<<1|s>>>31,f=f<<1|f>>>31;for(var c=0;c<i;c+=3){for(var u=a[c+1],h=a[c+2],p=a[c];p!=u;p+=h){var m=f^e[p],l=(f>>>4|f<<28)^e[p+1];o=s,s=f,f=o^(q0[m>>>24&63]|G0[m>>>16&63]|W0[m>>>8&63]|Y0[m&63]|V0[l>>>24&63]|z0[l>>>16&63]|H0[l>>>8&63]|$0[l&63])}o=s,s=f,f=o}s=s>>>1|s<<31,f=f>>>1|f<<31,o=(s>>>1^f)&1431655765,f^=o,s^=o<<1,o=(f>>>8^s)&16711935,s^=o,f^=o<<8,o=(f>>>2^s)&858993459,s^=o,f^=o<<2,o=(s>>>16^f)&65535,f^=o,s^=o<<16,o=(s>>>4^f)&252645135,f^=o,s^=o<<4,r[0]=s,r[1]=f}function Yt(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="DES-"+t,n;e.decrypt?n=$.cipher.createDecipher(r,e.key):n=$.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(a,o){var s=null;o instanceof $.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(n,o)},n}});var Fe=z((Ld,xa)=>{var Qt=F();xa.exports=Qt.md=Qt.md||{};Qt.md.algorithms=Qt.md.algorithms||{}});var ma=z((kd,ga)=>{var Te=F();Fe();J();var J0=ga.exports=Te.hmac=Te.hmac||{};J0.create=function(){var e=null,t=null,r=null,n=null,i={};return i.start=function(a,o){if(a!==null)if(typeof a=="string")if(a=a.toLowerCase(),a in Te.md.algorithms)t=Te.md.algorithms[a].create();else throw new Error('Unknown hash algorithm "'+a+'"');else t=a;if(o===null)o=e;else{if(typeof o=="string")o=Te.util.createBuffer(o);else if(Te.util.isArray(o)){var s=o;o=Te.util.createBuffer();for(var f=0;f<s.length;++f)o.putByte(s[f])}var c=o.length();c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=Te.util.createBuffer(),n=Te.util.createBuffer(),c=o.length();for(var f=0;f<c;++f){var s=o.at(f);r.putByte(54^s),n.putByte(92^s)}if(c<t.blockLength)for(var s=t.blockLength-c,f=0;f<s;++f)r.putByte(54),n.putByte(92);e=o,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},i.update=function(a){t.update(a)},i.getMac=function(){var a=t.digest().bytes();return t.start(),t.update(n),t.update(a),t.digest()},i.digest=i.getMac,i}});var Jt=z(()=>{});var hn=z((Kd,va)=>{var oe=F();ma();Fe();J();var X0=oe.pkcs5=oe.pkcs5||{},Ie;oe.util.isNodejs&&!oe.options.usePureJavaScript&&(Ie=Jt());va.exports=oe.pbkdf2=X0.pbkdf2=function(e,t,r,n,i,a){if(typeof i=="function"&&(a=i,i=null),oe.util.isNodejs&&!oe.options.usePureJavaScript&&Ie.pbkdf2&&(i===null||typeof i!="object")&&(Ie.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?Ie.pbkdf2Sync.length===4?Ie.pbkdf2(e,t,r,n,function(S,I){if(S)return a(S);a(null,I.toString("binary"))}):Ie.pbkdf2(e,t,r,n,i,function(S,I){if(S)return a(S);a(null,I.toString("binary"))}):Ie.pbkdf2Sync.length===4?Ie.pbkdf2Sync(e,t,r,n).toString("binary"):Ie.pbkdf2Sync(e,t,r,n,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in oe.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=oe.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var f=Math.ceil(n/o),c=n-(f-1)*o,u=oe.hmac.create();u.start(i,e);var h="",p,m,l;if(!a){for(var y=1;y<=f;++y){u.start(null,null),u.update(t),u.update(oe.util.int32ToBytes(y)),p=l=u.digest().getBytes();for(var g=2;g<=r;++g)u.start(null,null),u.update(l),m=u.digest().getBytes(),p=oe.util.xorBytes(p,m,o),l=m;h+=y<f?p:p.substr(0,c)}return h}var y=1,g;function v(){if(y>f)return a(null,h);u.start(null,null),u.update(t),u.update(oe.util.int32ToBytes(y)),p=l=u.digest().getBytes(),g=2,w()}function w(){if(g<=r)return u.start(null,null),u.update(l),m=u.digest().getBytes(),p=oe.util.xorBytes(p,m,o),l=m,++g,oe.util.setImmediate(w);h+=y<f?p:p.substr(0,c),++y,v()}v()}});var Ea=z((Md,Sa)=>{var Zt=F();J();var ba=Sa.exports=Zt.pem=Zt.pem||{};ba.encode=function(e,t){t=t||{};var r="-----BEGIN "+e.type+`-----\r
|
|
9
|
+
`,n;if(e.procType&&(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},r+=Xt(n)),e.contentDomain&&(n={name:"Content-Domain",values:[e.contentDomain]},r+=Xt(n)),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),r+=Xt(n)),e.headers)for(var i=0;i<e.headers.length;++i)r+=Xt(e.headers[i]);return e.procType&&(r+=`\r
|
|
10
|
+
`),r+=Zt.util.encode64(e.body,t.maxline||64)+`\r
|
|
11
|
+
`,r+="-----END "+e.type+`-----\r
|
|
12
|
+
`,r};ba.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=r.exec(e),!!a;){var o=a[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var s={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Zt.util.decode64(a[3])};if(t.push(s),!!a[2]){for(var f=a[2].split(i),c=0;a&&c<f.length;){for(var u=f[c].replace(/\s+$/,""),h=c+1;h<f.length;++h){var p=f[h];if(!/\s/.test(p[0]))break;u+=p,c=h}if(a=u.match(n),a){for(var m={name:a[1],values:[]},l=a[2].split(","),y=0;y<l.length;++y)m.values.push(Z0(l[y]));if(s.procType)if(!s.contentDomain&&m.name==="Content-Domain")s.contentDomain=l[0]||"";else if(!s.dekInfo&&m.name==="DEK-Info"){if(m.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:l[0],parameters:l[1]||null}}else s.headers.push(m);else{if(m.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(m.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:l[0],type:l[1]}}}++c}if(s.procType==="ENCRYPTED"&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Xt(e){for(var t=e.name+": ",r=[],n=function(f,c){return" "+c},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+`\r
|
|
13
|
+
`;for(var a=0,o=-1,i=0;i<t.length;++i,++a)if(a>65&&o!==-1){var s=t[o];s===","?(++o,t=t.substr(0,o)+`\r
|
|
14
|
+
`+t.substr(o)):t=t.substr(0,o)+`\r
|
|
15
|
+
`+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function Z0(e){return e.replace(/^\s+/,"")}});var Ia=z((Od,Ta)=>{var be=F();Fe();J();var Aa=Ta.exports=be.sha256=be.sha256||{};be.md.sha256=be.md.algorithms.sha256=Aa;Aa.create=function(){Ba||j0();var e=null,t=be.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return t=be.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=be.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),wa(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=be.util.createBuffer();i.putBytes(t.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(ln.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)s=n.fullMessageLength[u+1]*8,f=s/4294967296>>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};wa(h,r,i);var p=be.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},n};var ln=null,Ba=!1,Ca=null;function j0(){ln="\x80",ln+=be.util.fillString("\0",64),Ca=[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],Ba=!0}function wa(e,t,r){for(var n,i,a,o,s,f,c,u,h,p,m,l,y,g,v,w=r.length();w>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=t[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=t[c-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,h=e.h1,p=e.h2,m=e.h3,l=e.h4,y=e.h5,g=e.h6,v=e.h7,c=0;c<64;++c)o=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),s=g^l&(y^g),a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),f=u&h|p&(u^h),n=v+o+s+Ca[c]+t[c],i=a+f,v=g,g=y,y=l,l=m+n>>>0,m=p,p=h,h=u,u=n+i>>>0;e.h0=e.h0+u|0,e.h1=e.h1+h|0,e.h2=e.h2+p|0,e.h3=e.h3+m|0,e.h4=e.h4+l|0,e.h5=e.h5+y|0,e.h6=e.h6+g|0,e.h7=e.h7+v|0,w-=64}}});var Ra=z((Fd,_a)=>{var Se=F();J();var jt=null;Se.util.isNodejs&&!Se.options.usePureJavaScript&&!process.versions["node-webkit"]&&(jt=Jt());var ef=_a.exports=Se.prng=Se.prng||{};ef.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),i=0;i<32;++i)n[i]=r.create();t.pools=n,t.pool=0,t.generate=function(c,u){if(!u)return t.generateSync(c);var h=t.plugin.cipher,p=t.plugin.increment,m=t.plugin.formatKey,l=t.plugin.formatSeed,y=Se.util.createBuffer();t.key=null,g();function g(v){if(v)return u(v);if(y.length()>=c)return u(null,y.getBytes(c));if(t.generated>1048575&&(t.key=null),t.key===null)return Se.util.nextTick(function(){a(g)});var w=h(t.key,t.seed);t.generated+=w.length,y.putBytes(w),t.key=m(h(t.key,p(t.seed))),t.seed=l(h(t.key,t.seed)),Se.util.setImmediate(g)}},t.generateSync=function(c){var u=t.plugin.cipher,h=t.plugin.increment,p=t.plugin.formatKey,m=t.plugin.formatSeed;t.key=null;for(var l=Se.util.createBuffer();l.length()<c;){t.generated>1048575&&(t.key=null),t.key===null&&o();var y=u(t.key,t.seed);t.generated+=y.length,l.putBytes(y),t.key=p(u(t.key,h(t.seed))),t.seed=m(u(t.key,t.seed))}return l.getBytes(c)};function a(c){if(t.pools[0].messageLength>=32)return s(),c();var u=32-t.pools[0].messageLength<<5;t.seedFile(u,function(h,p){if(h)return c(h);t.collect(p),s(),c()})}function o(){if(t.pools[0].messageLength>=32)return s();var c=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(c)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var c=t.plugin.md.create();c.update(t.keyBytes);for(var u=1,h=0;h<32;++h)t.reseeds%u===0&&(c.update(t.pools[h].digest().getBytes()),t.pools[h].start()),u=u<<1;t.keyBytes=c.digest().getBytes(),c.start(),c.update(t.keyBytes);var p=c.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(p),t.generated=0}function f(c){var u=null,h=Se.util.globalScope,p=h.crypto||h.msCrypto;p&&p.getRandomValues&&(u=function(B){return p.getRandomValues(B)});var m=Se.util.createBuffer();if(u)for(;m.length()<c;){var l=Math.max(1,Math.min(c-m.length(),65536)/4),y=new Uint32Array(Math.floor(l));try{u(y);for(var g=0;g<y.length;++g)m.putInt32(y[g])}catch(B){if(!(typeof QuotaExceededError<"u"&&B instanceof QuotaExceededError))throw B}}if(m.length()<c)for(var v,w,S,I=Math.floor(Math.random()*65536);m.length()<c;){w=16807*(I&65535),v=16807*(I>>16),w+=(v&32767)<<16,w+=v>>15,w=(w&2147483647)+(w>>31),I=w&4294967295;for(var g=0;g<3;++g)S=I>>>(g<<3),S^=Math.floor(Math.random()*256),m.putByte(S&255)}return m.getBytes(c)}return jt?(t.seedFile=function(c,u){jt.randomBytes(c,function(h,p){if(h)return u(h);u(null,p.toString())})},t.seedFileSync=function(c){return jt.randomBytes(c).toString()}):(t.seedFile=function(c,u){try{u(null,f(c))}catch(h){u(h)}},t.seedFileSync=f),t.collect=function(c){for(var u=c.length,h=0;h<u;++h)t.pools[t.pool].update(c.substr(h,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(c,u){for(var h="",p=0;p<u;p+=8)h+=String.fromCharCode(c>>p&255);t.collect(h)},t.registerWorker=function(c){if(c===self)t.seedFile=function(h,p){function m(l){var y=l.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",m),p(y.forge.prng.err,y.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:h}}})};else{var u=function(h){var p=h.data;p.forge&&p.forge.prng&&t.seedFile(p.forge.prng.needed,function(m,l){c.postMessage({forge:{prng:{err:m,bytes:l}}})})};c.addEventListener("message",u)}},t}});var Bt=z((Vd,pn)=>{var te=F();qt();Ia();Ra();J();(function(){if(te.random&&te.random.getBytes){pn.exports=te.random;return}(function(e){var t={},r=new Array(4),n=te.util.createBuffer();t.formatKey=function(h){var p=te.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),te.aes._expandKey(h,!1)},t.formatSeed=function(h){var p=te.util.createBuffer(h);return h=new Array(4),h[0]=p.getInt32(),h[1]=p.getInt32(),h[2]=p.getInt32(),h[3]=p.getInt32(),h},t.cipher=function(h,p){return te.aes._updateBlock(h,p,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},t.increment=function(h){return++h[3],h},t.md=te.md.sha256;function i(){var h=te.prng.create(t);return h.getBytes=function(p,m){return h.generate(p,m)},h.getBytesSync=function(p){return h.generate(p)},h}var a=i(),o=null,s=te.util.globalScope,f=s.crypto||s.msCrypto;if(f&&f.getRandomValues&&(o=function(h){return f.getRandomValues(h)}),te.options.usePureJavaScript||!te.util.isNodejs&&!o){if(typeof window>"u"||window.document,a.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var u in navigator)try{typeof navigator[u]=="string"&&(c+=navigator[u])}catch{}a.collect(c),c=null}e&&(e().mousemove(function(h){a.collectInt(h.clientX,16),a.collectInt(h.clientY,16)}),e().keypress(function(h){a.collectInt(h.charCode,8)}))}if(!te.random)te.random=a;else for(var u in a)te.random[u]=a[u];te.random.createInstance=i,pn.exports=te.random})(typeof jQuery<"u"?jQuery:null)})()});var ka=z((qd,La)=>{var fe=F();J();var dn=[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],Da=[1,2,3,5],tf=function(e,t){return e<<t&65535|(e&65535)>>16-t},rf=function(e,t){return(e&65535)>>t|e<<16-t&65535};La.exports=fe.rc2=fe.rc2||{};fe.rc2.expandKey=function(e,t){typeof e=="string"&&(e=fe.util.createBuffer(e)),t=t||128;var r=e,n=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=n;s<128;s++)r.putByte(dn[r.at(s-1)+r.at(s-n)&255]);for(r.setAt(128-a,dn[r.at(128-a)&o]),s=127-a;s>=0;s--)r.setAt(s,dn[r.at(s+1)^r.at(s+a)]);return r};var Na=function(e,t,r){var n=!1,i=null,a=null,o=null,s,f,c,u,h=[];for(e=fe.rc2.expandKey(e,t),c=0;c<64;c++)h.push(e.getInt16Le());r?(s=function(l){for(c=0;c<4;c++)l[c]+=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),l[c]=tf(l[c],Da[c]),u++},f=function(l){for(c=0;c<4;c++)l[c]+=h[l[(c+3)%4]&63]}):(s=function(l){for(c=3;c>=0;c--)l[c]=rf(l[c],Da[c]),l[c]-=h[u]+(l[(c+3)%4]&l[(c+2)%4])+(~l[(c+3)%4]&l[(c+1)%4]),u--},f=function(l){for(c=3;c>=0;c--)l[c]-=h[l[(c+3)%4]&63]});var p=function(l){var y=[];for(c=0;c<4;c++){var g=i.getInt16Le();o!==null&&(r?g^=o.getInt16Le():o.putInt16Le(g)),y.push(g&65535)}u=r?0:63;for(var v=0;v<l.length;v++)for(var w=0;w<l[v][0];w++)l[v][1](y);for(c=0;c<4;c++)o!==null&&(r?o.putInt16Le(y[c]):y[c]^=o.getInt16Le()),a.putInt16Le(y[c])},m=null;return m={start:function(l,y){l&&typeof l=="string"&&(l=fe.util.createBuffer(l)),n=!1,i=fe.util.createBuffer(),a=y||new fe.util.createBuffer,o=l,m.output=a},update:function(l){for(n||i.putBuffer(l);i.length()>=8;)p([[5,s],[1,f],[6,s],[1,f],[5,s]])},finish:function(l){var y=!0;if(r)if(l)y=l(8,i,!r);else{var g=i.length()===8?8:8-i.length();i.fillWithByte(g,g)}if(y&&(n=!0,m.update()),!r&&(y=i.length()===0,y))if(l)y=l(8,a,!r);else{var v=a.length(),w=a.at(v-1);w>v?y=!1:a.truncate(w)}return y}},m};fe.rc2.startEncrypting=function(e,t,r){var n=fe.rc2.createEncryptionCipher(e,128);return n.start(t,r),n};fe.rc2.createEncryptionCipher=function(e,t){return Na(e,t,!0)};fe.rc2.startDecrypting=function(e,t,r){var n=fe.rc2.createDecryptionCipher(e,128);return n.start(t,r),n};fe.rc2.createDecryptionCipher=function(e,t){return Na(e,t,!1)}});var rr=z((zd,qa)=>{var yn=F();qa.exports=yn.jsbn=yn.jsbn||{};var _e,nf=0xdeadbeefcafe,Pa=(nf&16777215)==15715070;function E(e,t,r){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}yn.jsbn.BigInteger=E;function M(){return new E(null)}function af(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=o&67108863}return i}function of(e,t,r,n,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var f=this.data[e]&32767,c=this.data[e++]>>15,u=s*f+c*o;f=o*f+((u&32767)<<15)+r.data[n]+(i&1073741823),i=(f>>>30)+(u>>>15)+s*c+(i>>>30),r.data[n++]=f&1073741823}return i}function Ua(e,t,r,n,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var f=this.data[e]&16383,c=this.data[e++]>>14,u=s*f+c*o;f=o*f+((u&16383)<<14)+r.data[n]+i,i=(f>>28)+(u>>14)+s*c,r.data[n++]=f&268435455}return i}typeof navigator>"u"?(E.prototype.am=Ua,_e=28):Pa&&navigator.appName=="Microsoft Internet Explorer"?(E.prototype.am=of,_e=30):Pa&&navigator.appName!="Netscape"?(E.prototype.am=af,_e=26):(E.prototype.am=Ua,_e=28);E.prototype.DB=_e;E.prototype.DM=(1<<_e)-1;E.prototype.DV=1<<_e;var xn=52;E.prototype.FV=Math.pow(2,xn);E.prototype.F1=xn-_e;E.prototype.F2=2*_e-xn;var sf="0123456789abcdefghijklmnopqrstuvwxyz",er=new Array,at,he;at=48;for(he=0;he<=9;++he)er[at++]=he;at=97;for(he=10;he<36;++he)er[at++]=he;at=65;for(he=10;he<36;++he)er[at++]=he;function Ka(e){return sf.charAt(e)}function Ma(e,t){var r=er[e.charCodeAt(t)];return r??-1}function ff(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function cf(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function ke(e){var t=M();return t.fromInt(e),t}function uf(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var o=r==8?e[n]&255:Ma(e,n);if(o<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&E.ZERO.subTo(this,this)}function hf(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function lf(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(n=this.data[o]>>s)>0&&(i=!0,a=Ka(n));o>=0;)s<t?(n=(this.data[o]&(1<<s)-1)<<t-s,n|=this.data[--o]>>(s+=this.DB-t)):(n=this.data[o]>>(s-=t)&r,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(a+=Ka(n));return i?a:"0"}function pf(){var e=M();return E.ZERO.subTo(this,e),e}function df(){return this.s<0?this.negate():this}function yf(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this.data[r]-e.data[r])!=0)return t;return 0}function tr(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function xf(){return this.t<=0?0:this.DB*(this.t-1)+tr(this.data[this.t-1]^this.s&this.DM)}function gf(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s}function mf(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s}function vf(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>n|o,o=(this.data[s]&i)<<r;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function bf(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}function Sf(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()}function Ef(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&E.ZERO.subTo(t,t)}function wf(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()}function Af(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=M());var a=M(),o=this.s,s=e.s,f=this.DB-tr(n.data[n.t-1]);f>0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,u=a.data[c-1];if(u!=0){var h=u*(1<<this.F1)+(c>1?a.data[c-2]>>this.F2:0),p=this.FV/h,m=(1<<this.F1)/h,l=1<<this.F2,y=r.t,g=y-c,v=t??M();for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r.data[r.t++]=1,r.subTo(v,r)),E.ONE.dlShiftTo(c,v),v.subTo(a,a);a.t<c;)a.data[a.t++]=0;for(;--g>=0;){var w=r.data[--y]==u?this.DM:Math.floor(r.data[y]*p+(r.data[y-1]+l)*m);if((r.data[y]+=a.am(0,w,r,g,0,c))<w)for(a.dlShiftTo(g,v),r.subTo(v,r);r.data[y]<--w;)r.subTo(v,r)}t!=null&&(r.drShiftTo(c,t),o!=s&&E.ZERO.subTo(t,t)),r.t=c,r.clamp(),f>0&&r.rShiftTo(f,r),o<0&&E.ZERO.subTo(r,r)}}}function Bf(e){var t=M();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(E.ZERO)>0&&e.subTo(t,t),t}function Ve(e){this.m=e}function Cf(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Tf(e){return e}function If(e){e.divRemTo(this.m,null,e)}function _f(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Rf(e,t){e.squareTo(t),this.reduce(t)}Ve.prototype.convert=Cf;Ve.prototype.revert=Tf;Ve.prototype.reduce=If;Ve.prototype.mulTo=_f;Ve.prototype.sqrTo=Rf;function Df(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function qe(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Nf(e){var t=M();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(E.ZERO)>0&&this.m.subTo(t,t),t}function Lf(e){var t=M();return e.copyTo(t),this.reduce(t),t}function kf(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e.data[t]&32767,n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Pf(e,t){e.squareTo(t),this.reduce(t)}function Uf(e,t,r){e.multiplyTo(t,r),this.reduce(r)}qe.prototype.convert=Nf;qe.prototype.revert=Lf;qe.prototype.reduce=kf;qe.prototype.mulTo=Uf;qe.prototype.sqrTo=Pf;function Kf(){return(this.t>0?this.data[0]&1:this.s)==0}function Mf(e,t){if(e>4294967295||e<1)return E.ONE;var r=M(),n=M(),i=t.convert(this),a=tr(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var o=r;r=n,n=o}return t.revert(r)}function Of(e,t){var r;return e<256||t.isEven()?r=new Ve(t):r=new qe(t),this.exp(e,r)}E.prototype.copyTo=ff;E.prototype.fromInt=cf;E.prototype.fromString=uf;E.prototype.clamp=hf;E.prototype.dlShiftTo=gf;E.prototype.drShiftTo=mf;E.prototype.lShiftTo=vf;E.prototype.rShiftTo=bf;E.prototype.subTo=Sf;E.prototype.multiplyTo=Ef;E.prototype.squareTo=wf;E.prototype.divRemTo=Af;E.prototype.invDigit=Df;E.prototype.isEven=Kf;E.prototype.exp=Mf;E.prototype.toString=lf;E.prototype.negate=pf;E.prototype.abs=df;E.prototype.compareTo=yf;E.prototype.bitLength=xf;E.prototype.mod=Bf;E.prototype.modPowInt=Of;E.ZERO=ke(0);E.ONE=ke(1);function Ff(){var e=M();return this.copyTo(e),e}function Vf(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function qf(){return this.t==0?this.s:this.data[0]<<24>>24}function zf(){return this.t==0?this.s:this.data[0]<<16>>16}function Gf(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Hf(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Wf(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=ke(r),i=M(),a=M(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o}function $f(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,s=0;s<e.length;++s){var f=Ma(e,s);if(f<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+f,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&E.ZERO.subTo(this,this)}function Yf(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(E.ONE.shiftLeft(e-1),gn,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(E.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function Qf(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this.data[e]&(1<<r)-1)<<8-r,n|=this.data[--e]>>(r+=this.DB-8)):(n=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),n&128&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}function Jf(e){return this.compareTo(e)==0}function Xf(e){return this.compareTo(e)<0?this:e}function Zf(e){return this.compareTo(e)>0?this:e}function jf(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function ec(e,t){return e&t}function tc(e){var t=M();return this.bitwiseTo(e,ec,t),t}function gn(e,t){return e|t}function rc(e){var t=M();return this.bitwiseTo(e,gn,t),t}function Oa(e,t){return e^t}function nc(e){var t=M();return this.bitwiseTo(e,Oa,t),t}function Fa(e,t){return e&~t}function ic(e){var t=M();return this.bitwiseTo(e,Fa,t),t}function ac(){for(var e=M(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function oc(e){var t=M();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function sc(e){var t=M();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function fc(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function cc(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+fc(this.data[e]);return this.s<0?this.t*this.DB:-1}function uc(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function hc(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=uc(this.data[r]^t);return e}function lc(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function pc(e,t){var r=E.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function dc(e){return this.changeBit(e,gn)}function yc(e){return this.changeBit(e,Fa)}function xc(e){return this.changeBit(e,Oa)}function gc(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()}function mc(e){var t=M();return this.addTo(e,t),t}function vc(e){var t=M();return this.subTo(e,t),t}function bc(e){var t=M();return this.multiplyTo(e,t),t}function Sc(e){var t=M();return this.divRemTo(e,t,null),t}function Ec(e){var t=M();return this.divRemTo(e,null,t),t}function wc(e){var t=M(),r=M();return this.divRemTo(e,t,r),new Array(t,r)}function Ac(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Bc(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Ct(){}function Va(e){return e}function Cc(e,t,r){e.multiplyTo(t,r)}function Tc(e,t){e.squareTo(t)}Ct.prototype.convert=Va;Ct.prototype.revert=Va;Ct.prototype.mulTo=Cc;Ct.prototype.sqrTo=Tc;function Ic(e){return this.exp(e,new Ct)}function _c(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()}function Rc(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function ot(e){this.r2=M(),this.q3=M(),E.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Dc(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=M();return e.copyTo(t),this.reduce(t),t}function Nc(e){return e}function Lc(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function kc(e,t){e.squareTo(t),this.reduce(t)}function Pc(e,t,r){e.multiplyTo(t,r),this.reduce(r)}ot.prototype.convert=Dc;ot.prototype.revert=Nc;ot.prototype.reduce=Lc;ot.prototype.mulTo=Pc;ot.prototype.sqrTo=kc;function Uc(e,t){var r=e.bitLength(),n,i=ke(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new Ve(t):t.isEven()?a=new ot(t):a=new qe(t);var o=new Array,s=3,f=n-1,c=(1<<n)-1;if(o[1]=a.convert(this),n>1){var u=M();for(a.sqrTo(o[1],u);s<=c;)o[s]=M(),a.mulTo(u,o[s-2],o[s]),s+=2}var h=e.t-1,p,m=!0,l=M(),y;for(r=tr(e.data[h])-1;h>=0;){for(r>=f?p=e.data[h]>>r-f&c:(p=(e.data[h]&(1<<r+1)-1)<<f-r,h>0&&(p|=e.data[h-1]>>this.DB+r-f)),s=n;!(p&1);)p>>=1,--s;if((r-=s)<0&&(r+=this.DB,--h),m)o[p].copyTo(i),m=!1;else{for(;s>1;)a.sqrTo(i,l),a.sqrTo(l,i),s-=2;s>0?a.sqrTo(i,l):(y=i,i=l,l=y),a.mulTo(l,o[p],i)}for(;h>=0&&!(e.data[h]&1<<r);)a.sqrTo(i,l),y=i,i=l,l=y,--r<0&&(r=this.DB-1,--h)}return a.revert(i)}function Kc(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}function Mc(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r}function Oc(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return E.ZERO;for(var r=e.clone(),n=this.clone(),i=ke(1),a=ke(0),o=ke(0),s=ke(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),t&&o.subTo(i,o),s.subTo(a,s))}if(n.compareTo(E.ONE)!=0)return E.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var xe=[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],Fc=(1<<26)/xe[xe.length-1];function Vc(e){var t,r=this.abs();if(r.t==1&&r.data[0]<=xe[xe.length-1]){for(t=0;t<xe.length;++t)if(r.data[0]==xe[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<xe.length;){for(var n=xe[t],i=t+1;i<xe.length&&n<Fc;)n*=xe[i++];for(n=r.modInt(n);t<i;)if(n%xe[t++]==0)return!1}return r.millerRabin(e)}function qc(e){var t=this.subtract(E.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n=t.shiftRight(r),i=zc(),a,o=0;o<e;++o){do a=new E(this.bitLength(),i);while(a.compareTo(E.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(n,this);if(s.compareTo(E.ONE)!=0&&s.compareTo(t)!=0){for(var f=1;f++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(E.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function zc(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}E.prototype.chunkSize=Gf;E.prototype.toRadix=Wf;E.prototype.fromRadix=$f;E.prototype.fromNumber=Yf;E.prototype.bitwiseTo=jf;E.prototype.changeBit=pc;E.prototype.addTo=gc;E.prototype.dMultiply=Ac;E.prototype.dAddOffset=Bc;E.prototype.multiplyLowerTo=_c;E.prototype.multiplyUpperTo=Rc;E.prototype.modInt=Mc;E.prototype.millerRabin=qc;E.prototype.clone=Ff;E.prototype.intValue=Vf;E.prototype.byteValue=qf;E.prototype.shortValue=zf;E.prototype.signum=Hf;E.prototype.toByteArray=Qf;E.prototype.equals=Jf;E.prototype.min=Xf;E.prototype.max=Zf;E.prototype.and=tc;E.prototype.or=rc;E.prototype.xor=nc;E.prototype.andNot=ic;E.prototype.not=ac;E.prototype.shiftLeft=oc;E.prototype.shiftRight=sc;E.prototype.getLowestSetBit=cc;E.prototype.bitCount=hc;E.prototype.testBit=lc;E.prototype.setBit=dc;E.prototype.clearBit=yc;E.prototype.flipBit=xc;E.prototype.add=mc;E.prototype.subtract=vc;E.prototype.multiply=bc;E.prototype.divide=Sc;E.prototype.remainder=Ec;E.prototype.divideAndRemainder=wc;E.prototype.modPow=Uc;E.prototype.modInverse=Oc;E.prototype.pow=Ic;E.prototype.gcd=Kc;E.prototype.isProbablePrime=Vc});var $a=z((Gd,Wa)=>{var Ee=F();Fe();J();var Ga=Wa.exports=Ee.sha1=Ee.sha1||{};Ee.md.sha1=Ee.md.algorithms.sha1=Ga;Ga.create=function(){Ha||Gc();var e=null,t=Ee.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var i=n.messageLengthSize/4,a=0;a<i;++a)n.fullMessageLength.push(0);return t=Ee.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(i,a){a==="utf8"&&(i=Ee.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=n.fullMessageLength.length-1;s>=0;--s)n.fullMessageLength[s]+=o[1],o[1]=o[0]+(n.fullMessageLength[s]/4294967296>>>0),n.fullMessageLength[s]=n.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),za(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),n},n.digest=function(){var i=Ee.util.createBuffer();i.putBytes(t.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,o=a&n.blockLength-1;i.putBytes(mn.substr(0,n.blockLength-o));for(var s,f,c=n.fullMessageLength[0]*8,u=0;u<n.fullMessageLength.length-1;++u)s=n.fullMessageLength[u+1]*8,f=s/4294967296>>>0,c+=f,i.putInt32(c>>>0),c=s>>>0;i.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};za(h,r,i);var p=Ee.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},n};var mn=null,Ha=!1;function Gc(){mn="\x80",mn+=Ee.util.fillString("\0",64),Ha=!0}function za(e,t,r){for(var n,i,a,o,s,f,c,u,h=r.length();h>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,f=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,c=s^a&(o^s),n=(i<<5|i>>>27)+c+f+1518500249+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=t[u-3]^t[u-8]^t[u-14]^t[u-16],n=n<<1|n>>>31,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+1859775393+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a&o|s&(a^o),n=(i<<5|i>>>27)+c+f+2400959708+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=t[u-6]^t[u-16]^t[u-28]^t[u-32],n=n<<2|n>>>30,t[u]=n,c=a^o^s,n=(i<<5|i>>>27)+c+f+3395469782+n,f=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+f|0,h-=64}}});var Ja=z((Hd,Qa)=>{var we=F();J();Bt();$a();var Ya=Qa.exports=we.pkcs1=we.pkcs1||{};Ya.encode_rsa_oaep=function(e,t,r){var n,i,a,o;typeof r=="string"?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md)),a?a.start():a=we.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),f=s-2*a.digestLength-2;if(t.length>f){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=t.length,c.maxLength=f,c}n||(n=""),a.update(n,"raw");for(var u=a.digest(),h="",p=f-t.length,m=0;m<p;m++)h+="\0";var l=u.getBytes()+h+""+t;if(!i)i=we.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var c=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw c.seedLength=i.length,c.digestLength=a.digestLength,c}var y=nr(i,s-a.digestLength-1,o),g=we.util.xorBytes(l,y,l.length),v=nr(g,a.digestLength,o),w=we.util.xorBytes(i,v,i.length);return"\0"+w+g};Ya.decode_rsa_oaep=function(e,t,r){var n,i,a;typeof r=="string"?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var g=new Error("RSAES-OAEP encoded message length is invalid.");throw g.length=t.length,g.expectedLength=o,g}if(i===void 0?i=we.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var s=i.digest().getBytes(),f=t.charAt(0),c=t.substring(1,i.digestLength+1),u=t.substring(1+i.digestLength),h=nr(u,i.digestLength,a),p=we.util.xorBytes(c,h,c.length),m=nr(p,o-i.digestLength-1,a),l=we.util.xorBytes(u,m,u.length),y=l.substring(0,i.digestLength),g=f!=="\0",v=0;v<i.digestLength;++v)g|=s.charAt(v)!==y.charAt(v);for(var w=1,S=i.digestLength,I=i.digestLength;I<l.length;I++){var B=l.charCodeAt(I),C=B&1^1,R=w?65534:0;g|=B&R,w=w&C,S+=w}if(g||l.charCodeAt(S)!==1)throw new Error("Invalid RSAES-OAEP padding.");return l.substring(S+1)};function nr(e,t,r){r||(r=we.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}});var Xa=z((Wd,vn)=>{var Pe=F();J();rr();Bt();(function(){if(Pe.prime){vn.exports=Pe.prime;return}var e=vn.exports=Pe.prime=Pe.prime||{},t=Pe.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new t(null);n.fromInt(30);var i=function(h,p){return h|p};e.generateProbablePrime=function(h,p,m){typeof p=="function"&&(m=p,p={}),p=p||{};var l=p.algorithm||"PRIMEINC";typeof l=="string"&&(l={name:l}),l.options=l.options||{};var y=p.prng||Pe.random,g={nextBytes:function(v){for(var w=y.getBytesSync(v.length),S=0;S<v.length;++S)v[S]=w.charCodeAt(S)}};if(l.name==="PRIMEINC")return a(h,g,l.options,m);throw new Error("Invalid prime generation algorithm: "+l.name)};function a(h,p,m,l){return"workers"in m?f(h,p,m,l):o(h,p,m,l)}function o(h,p,m,l){var y=c(h,p),g=0,v=u(y.bitLength());"millerRabinTests"in m&&(v=m.millerRabinTests);var w=10;"maxBlockTime"in m&&(w=m.maxBlockTime),s(y,h,p,g,v,w,l)}function s(h,p,m,l,y,g,v){var w=+new Date;do{if(h.bitLength()>p&&(h=c(p,m)),h.isProbablePrime(y))return v(null,h);h.dAddOffset(r[l++%8],0)}while(g<0||+new Date-w<g);Pe.util.setImmediate(function(){s(h,p,m,l,y,g,v)})}function f(h,p,m,l){if(typeof Worker>"u")return o(h,p,m,l);var y=c(h,p),g=m.workers,v=m.workLoad||100,w=v*30/8,S=m.workerScript||"forge/prime.worker.js";if(g===-1)return Pe.util.estimateCores(function(B,C){B&&(C=2),g=C-1,I()});I();function I(){g=Math.max(1,g);for(var B=[],C=0;C<g;++C)B[C]=new Worker(S);for(var R=g,C=0;C<g;++C)B[C].addEventListener("message",V);var N=!1;function V(de){if(!N){--R;var ue=de.data;if(ue.found){for(var ie=0;ie<B.length;++ie)B[ie].terminate();return N=!0,l(null,new t(ue.prime,16))}y.bitLength()>h&&(y=c(h,p));var Qe=y.toString(16);de.target.postMessage({hex:Qe,workLoad:v}),y.dAddOffset(w,0)}}}}function c(h,p){var m=new t(h,p),l=h-1;return m.testBit(l)||m.bitwiseTo(t.ONE.shiftLeft(l),i,m),m.dAddOffset(31-m.mod(n).byteValue(),0),m}function u(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}})()});var ar=z(($d,io)=>{var D=F();At();rr();Wt();Ja();Xa();Bt();J();typeof K>"u"&&(K=D.jsbn.BigInteger);var K,bn=D.util.isNodejs?Jt():null,x=D.asn1,le=D.util;D.pki=D.pki||{};io.exports=D.pki.rsa=D.rsa=D.rsa||{};var k=D.pki,Hc=[6,4,2,4,2,4,6,2],Wc={name:"PrivateKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$c={name:"RSAPrivateKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Yc={name:"RSAPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:x.Class.UNIVERSAL,type:x.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Qc=D.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Jc={name:"DigestInfo",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:x.Class.UNIVERSAL,type:x.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:x.Class.UNIVERSAL,type:x.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:x.Class.UNIVERSAL,type:x.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:x.Class.UNIVERSAL,type:x.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},Xc=function(e){var t;if(e.algorithm in k.oids)t=k.oids[e.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var n=x.oidToDer(t).getBytes(),i=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[]),a=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[]);a.value.push(x.create(x.Class.UNIVERSAL,x.Type.OID,!1,n)),a.value.push(x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,""));var o=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),x.toDer(i).getBytes()},ro=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(K.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(K.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var n;do n=new K(D.util.bytesToHex(D.random.getBytes(t.n.bitLength()/8)),16);while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(K.ONE));e=e.multiply(n.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(n.modInverse(t.n)).mod(t.n),o};k.rsa.encrypt=function(e,t,r){var n=r,i,a=Math.ceil(t.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,i=no(e,t,r)):(i=D.util.createBuffer(),i.putBytes(e));for(var o=new K(i.toHex(),16),s=ro(o,t,n),f=s.toString(16),c=D.util.createBuffer(),u=a-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(D.util.hexToBytes(f)),c.getBytes()};k.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new K(D.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=ro(o,t,r),f=s.toString(16),c=D.util.createBuffer(),u=i-Math.ceil(f.length/2);u>0;)c.putByte(0),--u;return c.putBytes(D.util.hexToBytes(f)),n!==!1?ir(c.getBytes(),t,r):c.getBytes()};k.rsa.createKeyPairGenerationState=function(e,t,r){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,r=r||{};var n=r.prng||D.random,i={nextBytes:function(s){for(var f=n.getBytesSync(s.length),c=0;c<s.length;++c)s[c]=f.charCodeAt(c)}},a=r.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new K(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};k.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new K(null);r.fromInt(30);for(var n=0,i=function(h,p){return h|p},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var f=e.p===null?e.pBits:e.qBits,c=f-1;e.pqState===0?(e.num=new K(f,e.rng),e.num.testBit(c)||e.num.bitwiseTo(K.ONE.shiftLeft(c),i,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),n=0,++e.pqState):e.pqState===1?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(jc(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Hc[n++%8],0):e.pqState===2?e.pqState=e.num.subtract(K.ONE).gcd(e.e).compareTo(K.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(K.ONE),e.q1=e.q.subtract(K.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(K.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var u=e.e.modInverse(e.phi);e.keys={privateKey:k.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:k.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};k.rsa.generateKeyPair=function(e,t,r,n){if(arguments.length===1?typeof e=="object"?(r=e,e=void 0):typeof e=="function"&&(n=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(n=t,t=void 0):typeof t!="number"&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},e===void 0&&(e=r.bits||2048),t===void 0&&(t=r.e||65537),!D.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(n){if(Za("generateKeyPair"))return bn.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,f,c){if(s)return n(s);n(null,{privateKey:k.privateKeyFromPem(c),publicKey:k.publicKeyFromPem(f)})});if(ja("generateKey")&&ja("exportKey"))return le.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:to(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return le.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){n(s)}).then(function(s){if(s){var f=k.privateKeyFromAsn1(x.fromDer(D.util.createBuffer(s)));n(null,{privateKey:f,publicKey:k.setRsaPublicKey(f.n,f.e)})}});if(eo("generateKey")&&eo("exportKey")){var i=le.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:to(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var f=s.target.result,c=le.globalScope.msCrypto.subtle.exportKey("pkcs8",f.privateKey);c.oncomplete=function(u){var h=u.target.result,p=k.privateKeyFromAsn1(x.fromDer(D.util.createBuffer(h)));n(null,{privateKey:p,publicKey:k.setRsaPublicKey(p.n,p.e)})},c.onerror=function(u){n(u)}},i.onerror=function(s){n(s)};return}}else if(Za("generateKeyPairSync")){var a=bn.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:k.privateKeyFromPem(a.privateKey),publicKey:k.publicKeyFromPem(a.publicKey)}}}var o=k.rsa.createKeyPairGenerationState(e,t,r);if(!n)return k.rsa.stepKeyPairGenerationState(o,0),o.keys;Zc(o,r,n)};k.setRsaPublicKey=k.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(n,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,f,c){return no(s,f,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,f){return D.pkcs1.encode_rsa_oaep(f,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(n,r,!0);return k.rsa.encrypt(o,r,!0)},r.verify=function(n,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(f,c){c=ir(c,r,!0);var u=x.fromDer(c,{parseAllBytes:o._parseAllDigestBytes}),h={},p=[];if(!x.validate(u,Jc,h,p)){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=p,m}var l=x.derToOid(h.algorithmIdentifier);if(!(l===D.oids.md2||l===D.oids.md5||l===D.oids.sha1||l===D.oids.sha224||l===D.oids.sha256||l===D.oids.sha384||l===D.oids.sha512||l===D.oids["sha512-224"]||l===D.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=l,m}if((l===D.oids.md2||l===D.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return f===h.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(f,c){return c=ir(c,r,!0),f===c}});var s=k.rsa.decrypt(i,r,!0,!1);return a.verify(n,s,r.n.bitLength())},r};k.setRsaPrivateKey=k.rsa.setPrivateKey=function(e,t,r,n,i,a,o,s){var f={n:e,e:t,d:r,p:n,q:i,dP:a,dQ:o,qInv:s};return f.decrypt=function(c,u,h){typeof u=="string"?u=u.toUpperCase():u===void 0&&(u="RSAES-PKCS1-V1_5");var p=k.rsa.decrypt(c,f,!1,!1);if(u==="RSAES-PKCS1-V1_5")u={decode:ir};else if(u==="RSA-OAEP"||u==="RSAES-OAEP")u={decode:function(m,l){return D.pkcs1.decode_rsa_oaep(l,m,h)}};else if(["RAW","NONE","NULL",null].indexOf(u)!==-1)u={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+u+'".');return u.decode(p,f,!1)},f.sign=function(c,u){var h=!1;typeof u=="string"&&(u=u.toUpperCase()),u===void 0||u==="RSASSA-PKCS1-V1_5"?(u={encode:Xc},h=1):(u==="NONE"||u==="NULL"||u===null)&&(u={encode:function(){return c}},h=1);var p=u.encode(c,f.n.bitLength());return k.rsa.encrypt(p,f,h)},f};k.wrapRsaPrivateKey=function(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(0).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(k.oids.rsaEncryption).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,x.toDer(e).getBytes())])};k.privateKeyFromAsn1=function(e){var t={},r=[];if(x.validate(e,Wc,t,r)&&(e=x.fromDer(D.util.createBuffer(t.privateKey))),t={},r=[],!x.validate(e,$c,t,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var i,a,o,s,f,c,u,h;return i=D.util.createBuffer(t.privateKeyModulus).toHex(),a=D.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=D.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=D.util.createBuffer(t.privateKeyPrime1).toHex(),f=D.util.createBuffer(t.privateKeyPrime2).toHex(),c=D.util.createBuffer(t.privateKeyExponent1).toHex(),u=D.util.createBuffer(t.privateKeyExponent2).toHex(),h=D.util.createBuffer(t.privateKeyCoefficient).toHex(),k.setRsaPrivateKey(new K(i,16),new K(a,16),new K(o,16),new K(s,16),new K(f,16),new K(c,16),new K(u,16),new K(h,16))};k.privateKeyToAsn1=k.privateKeyToRSAPrivateKey=function(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(0).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.n)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.e)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.d)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.p)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.q)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.dP)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.dQ)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.qInv))])};k.publicKeyFromAsn1=function(e){var t={},r=[];if(x.validate(e,Qc,t,r)){var n=x.derToOid(t.publicKeyOid);if(n!==k.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=n,i}e=t.rsaPublicKey}if(r=[],!x.validate(e,Yc,t,r)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=r,i}var a=D.util.createBuffer(t.publicKeyModulus).toHex(),o=D.util.createBuffer(t.publicKeyExponent).toHex();return k.setRsaPublicKey(new K(a,16),new K(o,16))};k.publicKeyToAsn1=k.publicKeyToSubjectPublicKeyInfo=function(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(k.oids.rsaEncryption).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.BITSTRING,!1,[k.publicKeyToRSAPublicKey(e)])])};k.publicKeyToRSAPublicKey=function(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.n)),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,Ae(e.e))])};function no(e,t,r){var n=D.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o=i-3-e.length,s;if(r===0||r===1){s=r===0?0:255;for(var f=0;f<o;++f)n.putByte(s)}else for(;o>0;){for(var c=0,u=D.random.getBytes(o),f=0;f<o;++f)s=u.charCodeAt(f),s===0?++c:n.putByte(s);o=c}return n.putByte(0),n.putBytes(e),n}function ir(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=D.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||r&&s!==0&&s!==1||!r&&s!=2||r&&s===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var f=0;if(s===0){f=i-3-n;for(var c=0;c<f;++c)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(f=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++f}else if(s===2)for(f=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++f}var u=a.getByte();if(u!==0||f!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function Zc(e,t,r){typeof t=="function"&&(r=t,t={}),t=t||{};var n={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(n.prng=t.prng),i();function i(){a(e.pBits,function(s,f){if(s)return r(s);if(e.p=f,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,f){D.prime.generateProbablePrime(s,n,f)}function o(s,f){if(s)return r(s);if(e.q=f,e.p.compareTo(e.q)<0){var c=e.p;e.p=e.q,e.q=c}if(e.p.subtract(K.ONE).gcd(e.e).compareTo(K.ONE)!==0){e.p=null,i();return}if(e.q.subtract(K.ONE).gcd(e.e).compareTo(K.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(K.ONE),e.q1=e.q.subtract(K.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(K.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:k.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:k.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}}function Ae(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=D.util.hexToBytes(t);return r.length>1&&(r.charCodeAt(0)===0&&!(r.charCodeAt(1)&128)||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function jc(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function Za(e){return D.util.isNodejs&&typeof bn[e]=="function"}function ja(e){return typeof le.globalScope<"u"&&typeof le.globalScope.crypto=="object"&&typeof le.globalScope.crypto.subtle=="object"&&typeof le.globalScope.crypto.subtle[e]=="function"}function eo(e){return typeof le.globalScope<"u"&&typeof le.globalScope.msCrypto=="object"&&typeof le.globalScope.msCrypto.subtle=="object"&&typeof le.globalScope.msCrypto.subtle[e]=="function"}function to(e){for(var t=D.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}});var uo=z((Yd,co)=>{var _=F();qt();At();ya();Fe();Wt();hn();Ea();Bt();ka();ar();J();typeof ao>"u"&&(ao=_.jsbn.BigInteger);var ao,b=_.asn1,P=_.pki=_.pki||{};co.exports=P.pbe=_.pbe=_.pbe||{};var ze=P.oids,eu={name:"EncryptedPrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},tu={name:"PBES2Algorithms",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},ru={name:"pkcs-12PbeParams",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"iterations"}]};P.encryptPrivateKeyInfo=function(e,t,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=_.random.getBytesSync(r.saltSize),i=r.count,a=b.integerToDer(i),o,s,f;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var c,u,h;switch(r.algorithm){case"aes128":o=16,c=16,u=ze["aes128-CBC"],h=_.aes.createEncryptionCipher;break;case"aes192":o=24,c=16,u=ze["aes192-CBC"],h=_.aes.createEncryptionCipher;break;case"aes256":o=32,c=16,u=ze["aes256-CBC"],h=_.aes.createEncryptionCipher;break;case"des":o=8,c=8,u=ze.desCBC,h=_.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),l=fo(m),y=_.pkcs5.pbkdf2(t,n,i,o,l),g=_.random.getBytesSync(c),v=h(y);v.start(g),v.update(b.toDer(e)),v.finish(),f=v.output.getBytes();var w=nu(n,a,o,m);s=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ze.pkcs5PBES2).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ze.pkcs5PBKDF2).getBytes()),w]),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(u).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,g)])])])}else if(r.algorithm==="3des"){o=24;var S=new _.util.ByteBuffer(n),y=P.pbe.generatePkcs12Key(t,S,1,i,o),g=P.pbe.generatePkcs12Key(t,S,2,i,o),v=_.des.createEncryptionCipher(y);v.start(g),v.update(b.toDer(e)),v.finish(),f=v.output.getBytes(),s=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ze["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,n),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,a.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=r.algorithm,p}var I=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[s,b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,f)]);return I};P.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!b.validate(e,eu,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=b.derToOid(n.encryptionOid),s=P.pbe.getCipher(o,n.encryptionParams,t),f=_.util.createBuffer(n.encryptedData);return s.update(f),s.finish()&&(r=b.fromDer(s.output)),r};P.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:b.toDer(e).getBytes()};return _.pem.encode(r,{maxline:t})};P.encryptedPrivateKeyFromPem=function(e){var t=_.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return b.fromDer(t.body)};P.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var n=P.wrapRsaPrivateKey(P.privateKeyToAsn1(e));return n=P.encryptPrivateKeyInfo(n,t,r),P.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=_.random.getBytesSync(16),s=_.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=_.random.getBytesSync(16),s=_.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=_.random.getBytesSync(16),s=_.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=_.random.getBytesSync(8),s=_.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=_.random.getBytesSync(8),s=_.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var c=_.pbe.opensslDeriveBytes(t,a.substr(0,8),o),u=s(c);u.start(a),u.update(b.toDer(P.privateKeyToAsn1(e))),u.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:_.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return _.pem.encode(h)};P.decryptRsaPrivateKey=function(e,t){var r=null,n=_.pem.decode(e)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(n.procType&&n.procType.type==="ENCRYPTED"){var a,o;switch(n.dekInfo.algorithm){case"DES-CBC":a=8,o=_.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=_.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=_.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=_.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=_.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(h){return _.rc2.createDecryptionCipher(h,40)};break;case"RC2-64-CBC":a=8,o=function(h){return _.rc2.createDecryptionCipher(h,64)};break;case"RC2-128-CBC":a=16,o=function(h){return _.rc2.createDecryptionCipher(h,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw i.algorithm=n.dekInfo.algorithm,i}var s=_.util.hexToBytes(n.dekInfo.parameters),f=_.pbe.opensslDeriveBytes(t,s.substr(0,8),a),c=o(f);if(c.start(s),c.update(_.util.createBuffer(n.body)),c.finish())r=c.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=P.decryptPrivateKeyInfo(b.fromDer(r),t):r=b.fromDer(r),r!==null&&(r=P.privateKeyFromAsn1(r)),r};P.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in _.md))throw new Error('"sha1" hash algorithm unavailable.');a=_.md.sha1.create()}var f=a.digestLength,c=a.blockLength,u=new _.util.ByteBuffer,h=new _.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)h.putInt16(e.charCodeAt(s));h.putInt16(0)}var p=h.length(),m=t.length(),l=new _.util.ByteBuffer;l.fillWithByte(r,c);var y=c*Math.ceil(m/c),g=new _.util.ByteBuffer;for(s=0;s<y;s++)g.putByte(t.at(s%m));var v=c*Math.ceil(p/c),w=new _.util.ByteBuffer;for(s=0;s<v;s++)w.putByte(h.at(s%p));var S=g;S.putBuffer(w);for(var I=Math.ceil(i/f),B=1;B<=I;B++){var C=new _.util.ByteBuffer;C.putBytes(l.bytes()),C.putBytes(S.bytes());for(var R=0;R<n;R++)a.start(),a.update(C.getBytes()),C=a.digest();var N=new _.util.ByteBuffer;for(s=0;s<c;s++)N.putByte(C.at(s%f));var V=Math.ceil(m/c)+Math.ceil(p/c),de=new _.util.ByteBuffer;for(o=0;o<V;o++){var ue=new _.util.ByteBuffer(S.getBytes(c)),ie=511;for(s=N.length()-1;s>=0;s--)ie=ie>>8,ie+=N.at(s)+ue.at(s),ue.setAt(s,ie&255);de.putBuffer(ue)}S=de,u.putBuffer(C)}return u.truncate(u.length()-i),u};P.pbe.getCipher=function(e,t,r){switch(e){case P.oids.pkcs5PBES2:return P.pbe.getCipherForPBES2(e,t,r);case P.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case P.oids["pbewithSHAAnd40BitRC2-CBC"]:return P.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};P.pbe.getCipherForPBES2=function(e,t,r){var n={},i=[];if(!b.validate(t,tu,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=b.derToOid(n.kdfOid),e!==P.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=b.derToOid(n.encOid),e!==P.oids["aes128-CBC"]&&e!==P.oids["aes192-CBC"]&&e!==P.oids["aes256-CBC"]&&e!==P.oids["des-EDE3-CBC"]&&e!==P.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=n.kdfSalt,s=_.util.createBuffer(n.kdfIterationCount);s=s.getInt(s.length()<<3);var f,c;switch(P.oids[e]){case"aes128-CBC":f=16,c=_.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,c=_.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,c=_.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,c=_.des.createDecryptionCipher;break;case"desCBC":f=8,c=_.des.createDecryptionCipher;break}var u=so(n.prfOid),h=_.pkcs5.pbkdf2(r,o,s,f,u),p=n.encIv,m=c(h);return m.start(p),m};P.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!b.validate(t,ru,n,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=_.util.createBuffer(n.salt),s=_.util.createBuffer(n.iterations);s=s.getInt(s.length()<<3);var f,c,u;switch(e){case P.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,c=8,u=_.des.startDecrypting;break;case P.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,c=8,u=function(y,g){var v=_.rc2.createDecryptionCipher(y,40);return v.start(g,null),v};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var h=so(n.prfOid),p=P.pbe.generatePkcs12Key(r,o,1,s,f,h);h.start();var m=P.pbe.generatePkcs12Key(r,o,2,s,c,h);return u(p,m)};P.pbe.opensslDeriveBytes=function(e,t,r,n){if(typeof n>"u"||n===null){if(!("md5"in _.md))throw new Error('"md5" hash algorithm unavailable.');n=_.md.md5.create()}t===null&&(t="");for(var i=[oo(n,e+t)],a=16,o=1;a<r;++o,a+=16)i.push(oo(n,i[o-1]+e+t));return i.join("").substr(0,r)};function oo(e,t){return e.start().update(t).digest().getBytes()}function so(e){var t;if(!e)t="hmacWithSHA1";else if(t=P.oids[b.derToOid(e)],!t){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}return fo(t)}function fo(e){var t=_.md;switch(e){case"hmacWithSHA224":t=_.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function nu(e,t,r,n){var i=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,e),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,t.getBytes())]);return n!=="hmacWithSHA1"&&i.value.push(b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,_.util.hexToBytes(r.toString(16))),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(P.oids[n]).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")])),i}});var as=z((Mx,is)=>{var W=F();Fe();J();var Pt=is.exports=W.sha512=W.sha512||{};W.md.sha512=W.md.algorithms.sha512=Pt;var rs=W.sha384=W.sha512.sha384=W.sha512.sha384||{};rs.create=function(){return Pt.create("SHA-384")};W.md.sha384=W.md.algorithms.sha384=rs;W.sha512.sha256=W.sha512.sha256||{create:function(){return Pt.create("SHA-512/256")}};W.md["sha512/256"]=W.md.algorithms["sha512/256"]=W.sha512.sha256;W.sha512.sha224=W.sha512.sha224||{create:function(){return Pt.create("SHA-512/224")}};W.md["sha512/224"]=W.md.algorithms["sha512/224"]=W.sha512.sha224;Pt.create=function(e){if(ns||Zh(),typeof e>"u"&&(e="SHA-512"),!(e in Ye))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ye[e],r=null,n=W.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var f=s.messageLengthSize/4,c=0;c<f;++c)s.fullMessageLength.push(0);n=W.util.createBuffer(),r=new Array(t.length);for(var c=0;c<t.length;++c)r[c]=t[c].slice(0);return s},s.start(),s.update=function(f,c){c==="utf8"&&(f=W.util.encodeUtf8(f));var u=f.length;s.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var h=s.fullMessageLength.length-1;h>=0;--h)s.fullMessageLength[h]+=u[1],u[1]=u[0]+(s.fullMessageLength[h]/4294967296>>>0),s.fullMessageLength[h]=s.fullMessageLength[h]>>>0,u[0]=u[1]/4294967296>>>0;return n.putBytes(f),ts(r,i,n),(n.read>2048||n.length()===0)&&n.compact(),s},s.digest=function(){var f=W.util.createBuffer();f.putBytes(n.bytes());var c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,u=c&s.blockLength-1;f.putBytes(gi.substr(0,s.blockLength-u));for(var h,p,m=s.fullMessageLength[0]*8,l=0;l<s.fullMessageLength.length-1;++l)h=s.fullMessageLength[l+1]*8,p=h/4294967296>>>0,m+=p,f.putInt32(m>>>0),m=h>>>0;f.putInt32(m);for(var y=new Array(r.length),l=0;l<r.length;++l)y[l]=r[l].slice(0);ts(y,i,f);var g=W.util.createBuffer(),v;e==="SHA-512"?v=y.length:e==="SHA-384"?v=y.length-2:v=y.length-4;for(var l=0;l<v;++l)g.putInt32(y[l][0]),(l!==v-1||e!=="SHA-512/224")&&g.putInt32(y[l][1]);return g},s};var gi=null,ns=!1,mi=null,Ye=null;function Zh(){gi="\x80",gi+=W.util.fillString("\0",128),mi=[[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]],Ye={},Ye["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Ye["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Ye["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Ye["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],ns=!0}function ts(e,t,r){for(var n,i,a,o,s,f,c,u,h,p,m,l,y,g,v,w,S,I,B,C,R,N,V,de,ue,ie,Qe,Ut,X,se,L,wr,Ar,Br,Cr,wi=r.length();wi>=128;){for(X=0;X<16;++X)t[X][0]=r.getInt32()>>>0,t[X][1]=r.getInt32()>>>0;for(;X<80;++X)wr=t[X-2],se=wr[0],L=wr[1],n=((se>>>19|L<<13)^(L>>>29|se<<3)^se>>>6)>>>0,i=((se<<13|L>>>19)^(L<<3|se>>>29)^(se<<26|L>>>6))>>>0,Br=t[X-15],se=Br[0],L=Br[1],a=((se>>>1|L<<31)^(se>>>8|L<<24)^se>>>7)>>>0,o=((se<<31|L>>>1)^(se<<24|L>>>8)^(se<<25|L>>>7))>>>0,Ar=t[X-7],Cr=t[X-16],L=i+Ar[1]+o+Cr[1],t[X][0]=n+Ar[0]+a+Cr[0]+(L/4294967296>>>0)>>>0,t[X][1]=L>>>0;for(y=e[0][0],g=e[0][1],v=e[1][0],w=e[1][1],S=e[2][0],I=e[2][1],B=e[3][0],C=e[3][1],R=e[4][0],N=e[4][1],V=e[5][0],de=e[5][1],ue=e[6][0],ie=e[6][1],Qe=e[7][0],Ut=e[7][1],X=0;X<80;++X)c=((R>>>14|N<<18)^(R>>>18|N<<14)^(N>>>9|R<<23))>>>0,u=((R<<18|N>>>14)^(R<<14|N>>>18)^(N<<23|R>>>9))>>>0,h=(ue^R&(V^ue))>>>0,p=(ie^N&(de^ie))>>>0,s=((y>>>28|g<<4)^(g>>>2|y<<30)^(g>>>7|y<<25))>>>0,f=((y<<4|g>>>28)^(g<<30|y>>>2)^(g<<25|y>>>7))>>>0,m=(y&v|S&(y^v))>>>0,l=(g&w|I&(g^w))>>>0,L=Ut+u+p+mi[X][1]+t[X][1],n=Qe+c+h+mi[X][0]+t[X][0]+(L/4294967296>>>0)>>>0,i=L>>>0,L=f+l,a=s+m+(L/4294967296>>>0)>>>0,o=L>>>0,Qe=ue,Ut=ie,ue=V,ie=de,V=R,de=N,L=C+i,R=B+n+(L/4294967296>>>0)>>>0,N=L>>>0,B=S,C=I,S=v,I=w,v=y,w=g,L=i+o,y=n+a+(L/4294967296>>>0)>>>0,g=L>>>0;L=e[0][1]+g,e[0][0]=e[0][0]+y+(L/4294967296>>>0)>>>0,e[0][1]=L>>>0,L=e[1][1]+w,e[1][0]=e[1][0]+v+(L/4294967296>>>0)>>>0,e[1][1]=L>>>0,L=e[2][1]+I,e[2][0]=e[2][0]+S+(L/4294967296>>>0)>>>0,e[2][1]=L>>>0,L=e[3][1]+C,e[3][0]=e[3][0]+B+(L/4294967296>>>0)>>>0,e[3][1]=L>>>0,L=e[4][1]+N,e[4][0]=e[4][0]+R+(L/4294967296>>>0)>>>0,e[4][1]=L>>>0,L=e[5][1]+de,e[5][0]=e[5][0]+V+(L/4294967296>>>0)>>>0,e[5][1]=L>>>0,L=e[6][1]+ie,e[6][0]=e[6][0]+ue+(L/4294967296>>>0)>>>0,e[6][1]=L>>>0,L=e[7][1]+Ut,e[7][0]=e[7][0]+Qe+(L/4294967296>>>0)>>>0,e[7][1]=L>>>0,wi-=128}}});var wl={};G(wl,{PING_PROTOCOL:()=>ls,ping:()=>El});var Bl=Symbol.for("@libp2p/connection");var Tl=Symbol.for("@libp2p/content-routing");var Rl=Symbol.for("@libp2p/peer-discovery");var Nl=Symbol.for("@libp2p/peer-id");var kl=Symbol.for("@libp2p/peer-routing");var Bi;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(Bi||(Bi={}));var Ml=Symbol.for("@libp2p/transport");var Ci;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(Ci||(Ci={}));var Z=class extends Error{code;props;constructor(t,r,n){super(t),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};var Ti="ERR_TIMEOUT";var Tr=class extends Event{detail;constructor(t,r){super(t,r),this.detail=r?.detail}},Vl=globalThis.CustomEvent??Tr;var md=re(qt(),1),K0=re(F(),1);function zt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}var zr={};G(zr,{base10:()=>ks});function _s(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var y=0,g=0,v=0,w=l.length;v!==w&&l[v]===0;)v++,y++;for(var S=(w-v)*u+1>>>0,I=new Uint8Array(S);v!==w;){for(var B=l[v],C=0,R=S-1;(B!==0||C<g)&&R!==-1;R--,C++)B+=256*I[R]>>>0,I[R]=B%s>>>0,B=B/s>>>0;if(B!==0)throw new Error("Non-zero carry");g=C,v++}for(var N=S-g;N!==S&&I[N]===0;)N++;for(var V=f.repeat(y);N<S;++N)V+=e.charAt(I[N]);return V}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var y=0;if(l[y]!==" "){for(var g=0,v=0;l[y]===f;)g++,y++;for(var w=(l.length-y)*c+1>>>0,S=new Uint8Array(w);l[y];){var I=r[l.charCodeAt(y)];if(I===255)return;for(var B=0,C=w-1;(I!==0||B<v)&&C!==-1;C--,B++)I+=s*S[C]>>>0,S[C]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");v=B,y++}if(l[y]!==" "){for(var R=w-v;R!==w&&S[R]===0;)R++;for(var N=new Uint8Array(g+(w-R)),V=g;R!==w;)N[V++]=S[R++];return N}}}function m(l){var y=p(l);if(y)return y;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var Rs=_s,Ds=Rs,qi=Ds;var Tp=new Uint8Array(0);var zi=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Ce=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var Gi=e=>new TextEncoder().encode(e),Hi=e=>new TextDecoder().decode(e);var Or=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},Fr=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return $i(this,t)}},Vr=class{constructor(t){this.decoders=t}or(t){return $i(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},$i=(e,t)=>new Vr({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),qr=class{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Or(t,r,n),this.decoder=new Fr(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Ze=({name:e,prefix:t,encode:r,decode:n})=>new qr(e,t,r,n),Le=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=qi(r,t);return Ze({prefix:e,name:t,encode:n,decode:a=>Ce(i(a))})},Ns=(e,t,r,n)=>{let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},Ls=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},Y=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ze({prefix:t,name:e,encode(i){return Ls(i,n,r)},decode(i){return Ns(i,n,r,e)}});var ks=Le({prefix:"9",name:"base10",alphabet:"0123456789"});var Gr={};G(Gr,{base16:()=>Ps,base16upper:()=>Us});var Ps=Y({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Us=Y({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Hr={};G(Hr,{base2:()=>Ks});var Ks=Y({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Wr={};G(Wr,{base256emoji:()=>qs});var Yi=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ms=Yi.reduce((e,t,r)=>(e[r]=t,e),[]),Os=Yi.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Fs(e){return e.reduce((t,r)=>(t+=Ms[r],t),"")}function Vs(e){let t=[];for(let r of e){let n=Os[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var qs=Ze({prefix:"\u{1F680}",name:"base256emoji",encode:Fs,decode:Vs});var $r={};G($r,{base32:()=>je,base32hex:()=>Ws,base32hexpad:()=>Ys,base32hexpadupper:()=>Qs,base32hexupper:()=>$s,base32pad:()=>Gs,base32padupper:()=>Hs,base32upper:()=>zs,base32z:()=>Js});var je=Y({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zs=Y({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gs=Y({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Hs=Y({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ws=Y({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$s=Y({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ys=Y({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qs=Y({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Js=Y({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Yr={};G(Yr,{base36:()=>Xs,base36upper:()=>Zs});var Xs=Le({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Zs=Le({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Qr={};G(Qr,{base58btc:()=>me,base58flickr:()=>js});var me=Le({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),js=Le({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jr={};G(Jr,{base64:()=>e0,base64pad:()=>t0,base64url:()=>r0,base64urlpad:()=>n0});var e0=Y({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),t0=Y({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),r0=Y({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n0=Y({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Xr={};G(Xr,{base8:()=>i0});var i0=Y({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Zr={};G(Zr,{identity:()=>a0});var a0=Ze({prefix:"\0",name:"identity",encode:e=>Hi(e),decode:e=>Gi(e)});var qp=new TextEncoder,zp=new TextDecoder;var en={};G(en,{identity:()=>I0});var f0=Xi,Qi=128,c0=127,u0=~c0,h0=Math.pow(2,31);function Xi(e,t,r){t=t||[],r=r||0;for(var n=r;e>=h0;)t[r++]=e&255|Qi,e/=128;for(;e&u0;)t[r++]=e&255|Qi,e>>>=7;return t[r]=e|0,Xi.bytes=r-n+1,t}var l0=jr,p0=128,Ji=127;function jr(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw jr.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&Ji)<<i:(o&Ji)*Math.pow(2,i),i+=7}while(o>=p0);return jr.bytes=a-n,r}var d0=Math.pow(2,7),y0=Math.pow(2,14),x0=Math.pow(2,21),g0=Math.pow(2,28),m0=Math.pow(2,35),v0=Math.pow(2,42),b0=Math.pow(2,49),S0=Math.pow(2,56),E0=Math.pow(2,63),w0=function(e){return e<d0?1:e<y0?2:e<x0?3:e<g0?4:e<m0?5:e<v0?6:e<b0?7:e<S0?8:e<E0?9:10},A0={encode:f0,decode:l0,encodingLength:w0},B0=A0,mt=B0;var vt=(e,t=0)=>[mt.decode(e,t),mt.decode.bytes],et=(e,t,r=0)=>(mt.encode(e,t,r),t),tt=e=>mt.encodingLength(e);var Oe=(e,t)=>{let r=t.byteLength,n=tt(e),i=n+tt(r),a=new Uint8Array(i+r);return et(e,a,0),et(r,a,n),a.set(t,i),new rt(e,r,t,a)},Zi=e=>{let t=Ce(e),[r,n]=vt(t),[i,a]=vt(t.subarray(n)),o=t.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new rt(r,i,o,t)},ji=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&zi(e.bytes,r.bytes)}},rt=class{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};var ea=0,C0="identity",ta=Ce,T0=e=>Oe(ea,ta(e)),I0={code:ea,name:C0,encode:ta,digest:T0};var nn={};G(nn,{sha256:()=>_0,sha512:()=>R0});var rn=({name:e,code:t,encode:r})=>new tn(e,t,r),tn=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?Oe(this.code,r):r.then(n=>Oe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var na=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),_0=rn({name:"sha2-256",code:18,encode:na("SHA-256")}),R0=rn({name:"sha2-512",code:19,encode:na("SHA-512")});var ia=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return N0(r,an(e),t||me.encoder);default:return L0(r,an(e),t||je.encoder)}};var aa=new WeakMap,an=e=>{let t=aa.get(e);if(t==null){let r=new Map;return aa.set(e,r),r}return t},Ht=class e{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==St)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==k0)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Oe(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&ji(t.multihash,n.multihash)}toString(t){return ia(this,t)}toJSON(){return{"/":ia(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new e(n,i,a,o||oa(n,i,a.bytes))}else if(r[P0]===!0){let{version:n,multihash:i,code:a}=r,o=Zi(i);return e.create(n,a,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==St)throw new Error(`Version 0 CID must use dag-pb (code: ${St}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let i=oa(t,r,n.bytes);return new e(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,St,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,i=Ce(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new rt(r.multihashCode,r.digestSize,a,i);return[r.version===0?e.createV0(o):e.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[h,p]=vt(t.subarray(r));return r+=p,h},i=n(),a=St;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(t,r){let[n,i]=D0(t,r),a=e.decode(i);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return an(a).set(n,t),a}},D0=(e,t)=>{switch(e[0]){case"Q":{let r=t||me;return[me.prefix,r.decode(`${me.prefix}${e}`)]}case me.prefix:{let r=t||me;return[me.prefix,r.decode(e)]}case je.prefix:{let r=t||je;return[je.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},N0=(e,t,r)=>{let{prefix:n}=r;if(n!==me.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let a=r.encode(e).slice(1);return t.set(n,a),a}else return i},L0=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let a=r.encode(e);return t.set(n,a),a}else return i},St=112,k0=18,oa=(e,t,r)=>{let n=tt(e),i=n+tt(t),a=new Uint8Array(i+r.byteLength);return et(e,a,0),et(t,a,n),a.set(r,i),a},P0=Symbol.for("@ipld/js-cid/CID");var on={...Zr,...Hr,...Xr,...zr,...Gr,...$r,...Yr,...Qr,...Jr,...Wr},ad={...nn,...en};function sn(e=0){return globalThis.Buffer?.allocUnsafe!=null?zt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function fa(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var sa=fa("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),fn=fa("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=sn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),hd={utf8:sa,"utf-8":sa,hex:on.base16,latin1:fn,ascii:fn,binary:fn,...on};var Fg=re(At(),1),Vg=re(uo(),1);var sl=re(F(),1);var Qd=new Uint8Array(0);function or(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function iu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var y=0,g=0,v=0,w=l.length;v!==w&&l[v]===0;)v++,y++;for(var S=(w-v)*u+1>>>0,I=new Uint8Array(S);v!==w;){for(var B=l[v],C=0,R=S-1;(B!==0||C<g)&&R!==-1;R--,C++)B+=256*I[R]>>>0,I[R]=B%s>>>0,B=B/s>>>0;if(B!==0)throw new Error("Non-zero carry");g=C,v++}for(var N=S-g;N!==S&&I[N]===0;)N++;for(var V=f.repeat(y);N<S;++N)V+=e.charAt(I[N]);return V}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var y=0;if(l[y]!==" "){for(var g=0,v=0;l[y]===f;)g++,y++;for(var w=(l.length-y)*c+1>>>0,S=new Uint8Array(w);l[y];){var I=r[l.charCodeAt(y)];if(I===255)return;for(var B=0,C=w-1;(I!==0||B<v)&&C!==-1;C--,B++)I+=s*S[C]>>>0,S[C]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");v=B,y++}if(l[y]!==" "){for(var R=w-v;R!==w&&S[R]===0;)R++;for(var N=new Uint8Array(g+(w-R)),V=g;R!==w;)N[V++]=S[R++];return N}}}function m(l){var y=p(l);if(y)return y;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var au=iu,ou=au,ho=ou;var Sn=class{name;prefix;baseEncode;constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},En=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return lo(this,t)}},wn=class{decoders;constructor(t){this.decoders=t}or(t){return lo(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function lo(e,t){return new wn({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var An=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Sn(t,r,n),this.decoder=new En(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function po({name:e,prefix:t,encode:r,decode:n}){return new An(e,t,r,n)}function Bn({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=ho(r,e);return po({prefix:t,name:e,encode:n,decode:a=>or(i(a))})}function su(e,t,r,n){let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o}function fu(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o!==0&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a}function Tt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){return po({prefix:t,name:e,encode(i){return fu(i,n,r)},decode(i){return su(i,n,r,e)}})}var cu=Bn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ry=Bn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var uu=go,yo=128,hu=127,lu=~hu,pu=Math.pow(2,31);function go(e,t,r){t=t||[],r=r||0;for(var n=r;e>=pu;)t[r++]=e&255|yo,e/=128;for(;e&lu;)t[r++]=e&255|yo,e>>>=7;return t[r]=e|0,go.bytes=r-n+1,t}var du=Cn,yu=128,xo=127;function Cn(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw Cn.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&xo)<<i:(o&xo)*Math.pow(2,i),i+=7}while(o>=yu);return Cn.bytes=a-n,r}var xu=Math.pow(2,7),gu=Math.pow(2,14),mu=Math.pow(2,21),vu=Math.pow(2,28),bu=Math.pow(2,35),Su=Math.pow(2,42),Eu=Math.pow(2,49),wu=Math.pow(2,56),Au=Math.pow(2,63),Bu=function(e){return e<xu?1:e<gu?2:e<mu?3:e<vu?4:e<bu?5:e<Su?6:e<Eu?7:e<wu?8:e<Au?9:10},Cu={encode:uu,decode:du,encodingLength:Bu},Tu=Cu,Tn=Tu;function In(e,t,r=0){return Tn.encode(e,t,r),t}function _n(e){return Tn.encodingLength(e)}function sr(e,t){let r=t.byteLength,n=_n(e),i=n+_n(r),a=new Uint8Array(i+r);return In(e,a,0),In(r,a,n),a.set(t,i),new Rn(e,r,t,a)}var Rn=class{code;size;digest;bytes;constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};function Nn({name:e,code:t,encode:r}){return new Dn(e,t,r)}var Dn=class{name;code;encode;constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?sr(this.code,r):r.then(n=>sr(this.code,n))}else throw Error("Unknown type, must be binary type")}};function vo(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var fr=Nn({name:"sha2-256",code:18,encode:vo("SHA-256")}),py=Nn({name:"sha2-512",code:19,encode:vo("SHA-512")});var vy=re(J(),1),by=re(rr(),1),_u=re(F(),1);var cr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Ru=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ru)throw new Error("Non little-endian hardware is not supported");var Ty={}.toString;function bo(e=32){if(cr&&typeof cr.getRandomValues=="function")return cr.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}var So=Tt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ry=Tt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Dy=Tt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ny=Tt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var kn=new Float32Array([-0]),Ue=new Uint8Array(kn.buffer);function wo(e,t,r){kn[0]=e,t[r]=Ue[0],t[r+1]=Ue[1],t[r+2]=Ue[2],t[r+3]=Ue[3]}function Ao(e,t){return Ue[0]=e[t],Ue[1]=e[t+1],Ue[2]=e[t+2],Ue[3]=e[t+3],kn[0]}var Pn=new Float64Array([-0]),ne=new Uint8Array(Pn.buffer);function Bo(e,t,r){Pn[0]=e,t[r]=ne[0],t[r+1]=ne[1],t[r+2]=ne[2],t[r+3]=ne[3],t[r+4]=ne[4],t[r+5]=ne[5],t[r+6]=ne[6],t[r+7]=ne[7]}function Co(e,t){return ne[0]=e[t],ne[1]=e[t+1],ne[2]=e[t+2],ne[3]=e[t+3],ne[4]=e[t+4],ne[5]=e[t+5],ne[6]=e[t+6],ne[7]=e[t+7],Pn[0]}var Lu=BigInt(Number.MAX_SAFE_INTEGER),ku=BigInt(Number.MIN_SAFE_INTEGER),ce=class e{lo;hi;constructor(t,r){this.lo=t|0,this.hi=r|0}toNumber(t=!1){if(!t&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(t=!1){if(t)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(t=!1){return this.toBigInt(t).toString()}zzEncode(){let t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this}zzDecode(){let t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this}length(){let t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(t){if(t===0n)return Ge;if(t<Lu&&t>ku)return this.fromNumber(Number(t));let r=t<0n;r&&(t=-t);let n=t>>32n,i=t-(n<<32n);return r&&(n=~n|0n,i=~i|0n,++i>To&&(i=0n,++n>To&&(n=0n))),new e(Number(i),Number(n))}static fromNumber(t){if(t===0)return Ge;let r=t<0;r&&(t=-t);let n=t>>>0,i=(t-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new e(n,i)}static from(t){return typeof t=="number"?e.fromNumber(t):typeof t=="bigint"?e.fromBigInt(t):typeof t=="string"?e.fromBigInt(BigInt(t)):t.low!=null||t.high!=null?new e(t.low>>>0,t.high>>>0):Ge}},Ge=new ce(0,0);Ge.toBigInt=function(){return 0n};Ge.zzEncode=Ge.zzDecode=function(){return this};Ge.length=function(){return 1};var To=4294967296n;function Io(e){let t=0,r=0;for(let n=0;n<e.length;++n)r=e.charCodeAt(n),r<128?t+=1:r<2048?t+=2:(r&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t}function _o(e,t,r){if(r-t<1)return"";let i,a=[],o=0,s;for(;t<r;)s=e[t++],s<128?a[o++]=s:s>191&&s<224?a[o++]=(s&31)<<6|e[t++]&63:s>239&&s<365?(s=((s&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,a[o++]=55296+(s>>10),a[o++]=56320+(s&1023)):a[o++]=(s&15)<<12|(e[t++]&63)<<6|e[t++]&63,o>8191&&((i??(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i!=null?(o>0&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))}function Un(e,t,r){let n=r,i,a;for(let o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&((a=e.charCodeAt(o+1))&64512)===56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128);return r-n}function ge(e,t){return RangeError(`index out of range: ${e.pos} + ${t??1} > ${e.len}`)}function ur(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}var Kn=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(t){this.buf=t,this.pos=0,this.len=t.length}uint32(){let t=4294967295;if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,ge(this,10);return t}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw ge(this,4);return ur(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw ge(this,4);return ur(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw ge(this,4);let t=Ao(this.buf,this.pos);return this.pos+=4,t}double(){if(this.pos+8>this.len)throw ge(this,4);let t=Co(this.buf,this.pos);return this.pos+=8,t}bytes(){let t=this.uint32(),r=this.pos,n=this.pos+t;if(n>this.len)throw ge(this,t);return this.pos+=t,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let t=this.bytes();return _o(t,0,t.length)}skip(t){if(typeof t=="number"){if(this.pos+t>this.len)throw ge(this,t);this.pos+=t}else do if(this.pos>=this.len)throw ge(this);while(this.buf[this.pos++]&128);return this}skipType(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${t} at offset ${this.pos}`)}return this}readLongVarint(){let t=new ce(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw ge(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,t}if(this.len-this.pos>4){for(;r<5;++r)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;r<5;++r){if(this.pos>=this.len)throw ge(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw ge(this,8);let t=ur(this.buf,this.pos+=4),r=ur(this.buf,this.pos+=4);return new ce(t,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){return this.readLongVarint().toNumber(!0)}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function Mn(e){return new Kn(e instanceof Uint8Array?e:e.subarray())}function hr(e,t){let r=Mn(e);return t.decode(r)}function lr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function He(e=0){return globalThis.Buffer?.allocUnsafe!=null?lr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}var zn={};G(zn,{base10:()=>Fu});function Pu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=e.length,f=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function h(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var y=0,g=0,v=0,w=l.length;v!==w&&l[v]===0;)v++,y++;for(var S=(w-v)*u+1>>>0,I=new Uint8Array(S);v!==w;){for(var B=l[v],C=0,R=S-1;(B!==0||C<g)&&R!==-1;R--,C++)B+=256*I[R]>>>0,I[R]=B%s>>>0,B=B/s>>>0;if(B!==0)throw new Error("Non-zero carry");g=C,v++}for(var N=S-g;N!==S&&I[N]===0;)N++;for(var V=f.repeat(y);N<S;++N)V+=e.charAt(I[N]);return V}function p(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var y=0;if(l[y]!==" "){for(var g=0,v=0;l[y]===f;)g++,y++;for(var w=(l.length-y)*c+1>>>0,S=new Uint8Array(w);l[y];){var I=r[l.charCodeAt(y)];if(I===255)return;for(var B=0,C=w-1;(I!==0||B<v)&&C!==-1;C--,B++)I+=s*S[C]>>>0,S[C]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");v=B,y++}if(l[y]!==" "){for(var R=w-v;R!==w&&S[R]===0;)R++;for(var N=new Uint8Array(g+(w-R)),V=g;R!==w;)N[V++]=S[R++];return N}}}function m(l){var y=p(l);if(y)return y;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:m}}var Uu=Pu,Ku=Uu,Do=Ku;var Jy=new Uint8Array(0);var No=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Re=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};var Lo=e=>new TextEncoder().encode(e),ko=e=>new TextDecoder().decode(e);var On=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},Fn=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Uo(this,t)}},Vn=class{constructor(t){this.decoders=t}or(t){return Uo(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Uo=(e,t)=>new Vn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),qn=class{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new On(t,r,n),this.decoder=new Fn(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},st=({name:e,prefix:t,encode:r,decode:n})=>new qn(e,t,r,n),Ke=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=Do(r,t);return st({prefix:e,name:t,encode:n,decode:a=>Re(i(a))})},Mu=(e,t,r,n)=>{let i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let a=e.length;for(;e[a-1]==="=";)--a;let o=new Uint8Array(a*r/8|0),s=0,f=0,c=0;for(let u=0;u<a;++u){let h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);f=f<<r|h,s+=r,s>=8&&(s-=8,o[c++]=255&f>>s)}if(s>=r||255&f<<8-s)throw new SyntaxError("Unexpected end of data");return o},Ou=(e,t,r)=>{let n=t[t.length-1]==="=",i=(1<<r)-1,a="",o=0,s=0;for(let f=0;f<e.length;++f)for(s=s<<8|e[f],o+=8;o>r;)o-=r,a+=t[i&s>>o];if(o&&(a+=t[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},Q=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>st({prefix:t,name:e,encode(i){return Ou(i,n,r)},decode(i){return Mu(i,n,r,e)}});var Fu=Ke({prefix:"9",name:"base10",alphabet:"0123456789"});var Gn={};G(Gn,{base16:()=>Vu,base16upper:()=>qu});var Vu=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qu=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Hn={};G(Hn,{base2:()=>zu});var zu=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Wn={};G(Wn,{base256emoji:()=>Yu});var Ko=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Gu=Ko.reduce((e,t,r)=>(e[r]=t,e),[]),Hu=Ko.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Wu(e){return e.reduce((t,r)=>(t+=Gu[r],t),"")}function $u(e){let t=[];for(let r of e){let n=Hu[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var Yu=st({prefix:"\u{1F680}",name:"base256emoji",encode:Wu,decode:$u});var $n={};G($n,{base32:()=>ft,base32hex:()=>Zu,base32hexpad:()=>eh,base32hexpadupper:()=>th,base32hexupper:()=>ju,base32pad:()=>Ju,base32padupper:()=>Xu,base32upper:()=>Qu,base32z:()=>rh});var ft=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qu=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ju=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Xu=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Zu=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ju=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),eh=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),th=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rh=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Yn={};G(Yn,{base36:()=>nh,base36upper:()=>ih});var nh=Ke({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ih=Ke({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Qn={};G(Qn,{base58btc:()=>Be,base58flickr:()=>ah});var Be=Ke({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ah=Ke({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jn={};G(Jn,{base64:()=>oh,base64pad:()=>sh,base64url:()=>fh,base64urlpad:()=>ch});var oh=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),sh=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fh=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ch=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Xn={};G(Xn,{base8:()=>uh});var uh=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Zn={};G(Zn,{identity:()=>hh});var hh=st({prefix:"\0",name:"identity",encode:e=>ko(e),decode:e=>Lo(e)});var h1=new TextEncoder,l1=new TextDecoder;var ei={};G(ei,{identity:()=>kh});var dh=Fo,Mo=128,yh=127,xh=~yh,gh=Math.pow(2,31);function Fo(e,t,r){t=t||[],r=r||0;for(var n=r;e>=gh;)t[r++]=e&255|Mo,e/=128;for(;e&xh;)t[r++]=e&255|Mo,e>>>=7;return t[r]=e|0,Fo.bytes=r-n+1,t}var mh=jn,vh=128,Oo=127;function jn(e,n){var r=0,n=n||0,i=0,a=n,o,s=e.length;do{if(a>=s)throw jn.bytes=0,new RangeError("Could not decode varint");o=e[a++],r+=i<28?(o&Oo)<<i:(o&Oo)*Math.pow(2,i),i+=7}while(o>=vh);return jn.bytes=a-n,r}var bh=Math.pow(2,7),Sh=Math.pow(2,14),Eh=Math.pow(2,21),wh=Math.pow(2,28),Ah=Math.pow(2,35),Bh=Math.pow(2,42),Ch=Math.pow(2,49),Th=Math.pow(2,56),Ih=Math.pow(2,63),_h=function(e){return e<bh?1:e<Sh?2:e<Eh?3:e<wh?4:e<Ah?5:e<Bh?6:e<Ch?7:e<Th?8:e<Ih?9:10},Rh={encode:dh,decode:mh,encodingLength:_h},Dh=Rh,It=Dh;var _t=(e,t=0)=>[It.decode(e,t),It.decode.bytes],ct=(e,t,r=0)=>(It.encode(e,t,r),t),ut=e=>It.encodingLength(e);var We=(e,t)=>{let r=t.byteLength,n=ut(e),i=n+ut(r),a=new Uint8Array(i+r);return ct(e,a,0),ct(r,a,n),a.set(t,i),new ht(e,r,t,a)},Vo=e=>{let t=Re(e),[r,n]=_t(t),[i,a]=_t(t.subarray(n)),o=t.subarray(n+a);if(o.byteLength!==i)throw new Error("Incorrect length");return new ht(r,i,o,t)},qo=(e,t)=>{if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&No(e.bytes,r.bytes)}},ht=class{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}};var zo=0,Nh="identity",Go=Re,Lh=e=>We(zo,Go(e)),kh={code:zo,name:Nh,encode:Go,digest:Lh};var ni={};G(ni,{sha256:()=>Ph,sha512:()=>Uh});var ri=({name:e,code:t,encode:r})=>new ti(e,t,r),ti=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?We(this.code,r):r.then(n=>We(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Wo=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Ph=ri({name:"sha2-256",code:18,encode:Wo("SHA-256")}),Uh=ri({name:"sha2-512",code:19,encode:Wo("SHA-512")});var $o=(e,t)=>{let{bytes:r,version:n}=e;switch(n){case 0:return Mh(r,ii(e),t||Be.encoder);default:return Oh(r,ii(e),t||ft.encoder)}};var Yo=new WeakMap,ii=e=>{let t=Yo.get(e);if(t==null){let r=new Map;return Yo.set(e,r),r}return t},dr=class e{constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Dt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Fh)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=We(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return e.equals(this,t)}static equals(t,r){let n=r;return n&&t.code===n.code&&t.version===n.version&&qo(t.multihash,n.multihash)}toString(t){return $o(this,t)}toJSON(){return{"/":$o(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof e)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:a,bytes:o}=r;return new e(n,i,a,o||Qo(n,i,a.bytes))}else if(r[Vh]===!0){let{version:n,multihash:i,code:a}=r,o=Vo(i);return e.create(n,a,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Dt)throw new Error(`Version 0 CID must use dag-pb (code: ${Dt}) block encoding`);return new e(t,r,n,n.bytes)}case 1:{let i=Qo(t,r,n.bytes);return new e(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,Dt,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,i=Re(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),o=new ht(r.multihashCode,r.digestSize,a,i);return[r.version===0?e.createV0(o):e.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[h,p]=_t(t.subarray(r));return r+=p,h},i=n(),a=Dt;if(i===18?(i=0,r=0):a=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,s=n(),f=n(),c=r+f,u=c-o;return{version:i,codec:a,multihashCode:s,digestSize:f,multihashSize:u,size:c}}static parse(t,r){let[n,i]=Kh(t,r),a=e.decode(i);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ii(a).set(n,t),a}},Kh=(e,t)=>{switch(e[0]){case"Q":{let r=t||Be;return[Be.prefix,r.decode(`${Be.prefix}${e}`)]}case Be.prefix:{let r=t||Be;return[Be.prefix,r.decode(e)]}case ft.prefix:{let r=t||ft;return[ft.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},Mh=(e,t,r)=>{let{prefix:n}=r;if(n!==Be.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let a=r.encode(e).slice(1);return t.set(n,a),a}else return i},Oh=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(i==null){let a=r.encode(e);return t.set(n,a),a}else return i},Dt=112,Fh=18,Qo=(e,t,r)=>{let n=ut(e),i=n+ut(t),a=new Uint8Array(i+r.byteLength);return ct(e,a,0),ct(t,a,n),a.set(r,i),a},Vh=Symbol.for("@ipld/js-cid/CID");var ai={...Zn,...Hn,...Xn,...zn,...Gn,...$n,...Yn,...Qn,...Jn,...Wn},I1={...ni,...ei};function Xo(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var Jo=Xo("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),oi=Xo("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=He(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),qh={utf8:Jo,"utf-8":Jo,hex:ai.base16,latin1:oi,ascii:oi,binary:oi,...ai},Zo=qh;function jo(e,t="utf8"){let r=Zo[t];if(r==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?lr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function si(e){let t=e??8192,r=t>>>1,n,i=t;return function(o){if(o<1||o>r)return He(o);i+o>t&&(n=He(t),i=0);let s=n.subarray(i,i+=o);return i&7&&(i=(i|7)+1),s}}var $e=class{fn;len;next;val;constructor(t,r,n){this.fn=t,this.len=r,this.next=void 0,this.val=n}};function fi(){}var ui=class{head;tail;len;next;constructor(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}},zh=si();function Gh(e){return globalThis.Buffer!=null?He(e):zh(e)}var kt=class{len;head;tail;states;constructor(){this.len=0,this.head=new $e(fi,0,0),this.tail=this.head,this.states=null}_push(t,r,n){return this.tail=this.tail.next=new $e(t,r,n),this.len+=r,this}uint32(t){return this.len+=(this.tail=this.tail.next=new hi((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this}int32(t){return t<0?this._push(Nt,10,ce.fromNumber(t)):this.uint32(t)}sint32(t){return this.uint32((t<<1^t>>31)>>>0)}uint64(t){let r=ce.fromBigInt(t);return this._push(Nt,r.length(),r)}uint64Number(t){let r=ce.fromNumber(t);return this._push(Nt,r.length(),r)}uint64String(t){return this.uint64(BigInt(t))}int64(t){return this.uint64(t)}int64Number(t){return this.uint64Number(t)}int64String(t){return this.uint64String(t)}sint64(t){let r=ce.fromBigInt(t).zzEncode();return this._push(Nt,r.length(),r)}sint64Number(t){let r=ce.fromNumber(t).zzEncode();return this._push(Nt,r.length(),r)}sint64String(t){return this.sint64(BigInt(t))}bool(t){return this._push(ci,1,t?1:0)}fixed32(t){return this._push(Lt,4,t>>>0)}sfixed32(t){return this.fixed32(t)}fixed64(t){let r=ce.fromBigInt(t);return this._push(Lt,4,r.lo)._push(Lt,4,r.hi)}fixed64Number(t){let r=ce.fromNumber(t);return this._push(Lt,4,r.lo)._push(Lt,4,r.hi)}fixed64String(t){return this.fixed64(BigInt(t))}sfixed64(t){return this.fixed64(t)}sfixed64Number(t){return this.fixed64Number(t)}sfixed64String(t){return this.fixed64String(t)}float(t){return this._push(wo,4,t)}double(t){return this._push(Bo,8,t)}bytes(t){let r=t.length>>>0;return r===0?this._push(ci,1,0):this.uint32(r)._push(Wh,r,t)}string(t){let r=Io(t);return r!==0?this.uint32(r)._push(Un,r,t):this._push(ci,1,0)}fork(){return this.states=new ui(this),this.head=this.tail=new $e(fi,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new $e(fi,0,0),this.len=0),this}ldelim(){let t=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=t.next,this.tail=r,this.len+=n),this}finish(){let t=this.head.next,r=Gh(this.len),n=0;for(;t!=null;)t.fn(t.val,r,n),n+=t.len,t=t.next;return r}};function ci(e,t,r){t[r]=e&255}function Hh(e,t,r){for(;e>127;)t[r++]=e&127|128,e>>>=7;t[r]=e}var hi=class extends $e{next;constructor(t,r){super(Hh,t,r),this.next=void 0}};function Nt(e,t,r){for(;e.hi!==0;)t[r++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=e.lo&127|128,e.lo=e.lo>>>7;t[r++]=e.lo}function Lt(e,t,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function Wh(e,t,r){t.set(e,r)}globalThis.Buffer!=null&&(kt.prototype.bytes=function(e){let t=e.length>>>0;return this.uint32(t),t>0&&this._push($h,t,e),this},kt.prototype.string=function(e){let t=globalThis.Buffer.byteLength(e);return this.uint32(t),t>0&&this._push(Yh,t,e),this});function $h(e,t,r){t.set(e,r)}function Yh(e,t,r){e.length<40?Un(e,t,r):t.utf8Write!=null?t.utf8Write(e,r):t.set(jo(e),r)}function li(){return new kt}function yr(e,t){let r=li();return t.encode(e,r,{lengthDelimited:!1}),r.finish()}var lt;(function(e){e[e.VARINT=0]="VARINT",e[e.BIT64=1]="BIT64",e[e.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",e[e.START_GROUP=3]="START_GROUP",e[e.END_GROUP=4]="END_GROUP",e[e.BIT32=5]="BIT32"})(lt||(lt={}));function xr(e,t,r,n){return{name:e,type:t,encode:r,decode:n}}function pi(e){function t(i){if(e[i.toString()]==null)throw new Error("Invalid enum value");return e[i]}let r=function(a,o){let s=t(a);o.int32(s)},n=function(a){let o=a.int32();return t(o)};return xr("enum",lt.VARINT,r,n)}function gr(e,t){return xr("message",lt.LENGTH_DELIMITED,e,t)}var pe;(function(e){e.RSA="RSA",e.Ed25519="Ed25519",e.Secp256k1="Secp256k1"})(pe||(pe={}));var di;(function(e){e[e.RSA=0]="RSA",e[e.Ed25519=1]="Ed25519",e[e.Secp256k1=2]="Secp256k1"})(di||(di={}));(function(e){e.codec=()=>pi(di)})(pe||(pe={}));var pt;(function(e){let t;e.codec=()=>(t==null&&(t=gr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),pe.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=pe.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),t),e.encode=r=>yr(r,e.codec()),e.decode=r=>hr(r,e.codec())})(pt||(pt={}));var dt;(function(e){let t;e.codec=()=>(t==null&&(t=gr((r,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),r.Type!=null&&(n.uint32(8),pe.codec().encode(r.Type,n)),r.Data!=null&&(n.uint32(18),n.bytes(r.Data)),i.lengthDelimited!==!1&&n.ldelim()},(r,n)=>{let i={},a=n==null?r.len:r.pos+n;for(;r.pos<a;){let o=r.uint32();switch(o>>>3){case 1:i.Type=pe.codec().decode(r);break;case 2:i.Data=r.bytes();break;default:r.skipType(o&7);break}}return i})),t),e.encode=r=>yr(r,e.codec()),e.decode=r=>hr(r,e.codec())})(dt||(dt={}));var Jh={"P-256":256,"P-384":384,"P-521":521},Xh=Object.keys(Jh),Cx=Xh.join(" / ");var nl=re(F(),1);var xg=re(as(),1);function yt(e){if(isNaN(e)||e<=0)throw new Z("random bytes length must be a Number bigger than 0","ERR_INVALID_LENGTH");return bo(e)}var qx=re(ar(),1),el=re(F(),1);var Wx=re(At(),1),$x=re(ar(),1);var tl=re(F(),1);var cl=re(hn(),1),ul=re(J(),1);function hl(e){return e[Symbol.asyncIterator]!=null}function ll(e){if(hl(e))return(async()=>{for await(let t of e)return t})();for(let t of e)return t}var ss=ll;function vr(){let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}var br=class{buffer;mask;top;btm;next;constructor(t){if(!(t>0)||t-1&t)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}push(t){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){let t=this.buffer[this.btm];if(t!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}isEmpty(){return this.buffer[this.btm]===void 0}},xt=class{size;hwm;head;tail;constructor(t={}){this.hwm=t.splitLimit??16,this.head=new br(this.hwm),this.tail=this.head,this.size=0}calculateSize(t){return t?.byteLength!=null?t.byteLength:1}push(t){if(t?.value!=null&&(this.size+=this.calculateSize(t.value)),!this.head.push(t)){let r=this.head;this.head=r.next=new br(2*this.head.buffer.length),this.head.push(t)}}shift(){let t=this.tail.shift();if(t===void 0&&this.tail.next!=null){let r=this.tail.next;this.tail.next=null,this.tail=r,t=this.tail.shift()}return t?.value!=null&&(this.size-=this.calculateSize(t.value)),t}isEmpty(){return this.head.isEmpty()}};var vi=class extends Error{type;code;constructor(t,r){super(t??"The operation was aborted"),this.type="aborted",this.code=r??"ABORT_ERR"}};function Sr(e={}){return pl(r=>{let n=r.shift();if(n==null)return{done:!0};if(n.error!=null)throw n.error;return{done:n.done===!0,value:n.value}},e)}function pl(e,t){t=t??{};let r=t.onEnd,n=new xt,i,a,o,s=vr(),f=async()=>{try{return n.isEmpty()?o?{done:!0}:await new Promise((g,v)=>{a=w=>{a=null,n.push(w);try{g(e(n))}catch(S){v(S)}return i}}):e(n)}finally{n.isEmpty()&&queueMicrotask(()=>{s.resolve(),s=vr()})}},c=g=>a!=null?a(g):(n.push(g),i),u=g=>(n=new xt,a!=null?a({error:g}):(n.push({error:g}),i)),h=g=>{if(o)return i;if(t?.objectMode!==!0&&g?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return c({done:!1,value:g})},p=g=>o?i:(o=!0,g!=null?u(g):c({done:!0})),m=()=>(n=new xt,p(),{done:!0}),l=g=>(p(g),{done:!0});if(i={[Symbol.asyncIterator](){return this},next:f,return:m,throw:l,push:h,end:p,get readableLength(){return n.size},onEmpty:async g=>{let v=g?.signal;if(v?.throwIfAborted(),n.isEmpty())return;let w,S;v!=null&&(w=new Promise((I,B)=>{S=()=>{B(new vi)},v.addEventListener("abort",S)}));try{await Promise.race([s.promise,w])}finally{S!=null&&v!=null&&v?.removeEventListener("abort",S)}}},r==null)return i;let y=i;return i={[Symbol.asyncIterator](){return this},next(){return y.next()},throw(g){return y.throw(g),r!=null&&(r(g),r=void 0),{done:!0}},return(){return y.return(),r!=null&&(r(),r=void 0),{done:!0}},push:h,end(g){return y.end(g),r!=null&&(r(g),r=void 0),i},get readableLength(){return y.readableLength},onEmpty:g=>y.onEmpty(g)},i}function dl(e){return e[Symbol.asyncIterator]!=null}function yl(...e){let t=[];for(let r of e)dl(r)||t.push(r);return t.length===e.length?function*(){for(let r of t)yield*r}():async function*(){let r=Sr({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(e.map(async n=>{for await(let i of n)r.push(i)})),r.end()}catch(n){r.end(n)}}),yield*r}()}var fs=yl;function Si(e,...t){if(e==null)throw new Error("Empty pipeline");if(bi(e)){let n=e;e=()=>n.source}else if(us(e)||cs(e)){let n=e;e=()=>n}let r=[e,...t];if(r.length>1&&bi(r[r.length-1])&&(r[r.length-1]=r[r.length-1].sink),r.length>2)for(let n=1;n<r.length-1;n++)bi(r[n])&&(r[n]=gl(r[n]));return xl(...r)}var xl=(...e)=>{let t;for(;e.length>0;)t=e.shift()(t);return t},cs=e=>e?.[Symbol.asyncIterator]!=null,us=e=>e?.[Symbol.iterator]!=null,bi=e=>e==null?!1:e.sink!=null&&e.source!=null,gl=e=>t=>{let r=e.sink(t);if(r?.then!=null){let n=Sr({objectMode:!0});r.then(()=>{n.end()},o=>{n.end(o)});let i,a=e.source;if(cs(a))i=async function*(){yield*a,n.end()};else if(us(a))i=function*(){yield*a,n.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return fs(n,i())}return e.source};function hs(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}var ls="/ipfs/ping/1.0.0";var ps="1.0.0",ds="ping",ys="ipfs";var Ei="ERR_WRONG_PING_ACK";var Er=class{protocol;components;started;timeout;maxInboundStreams;maxOutboundStreams;runOnTransientConnection;log;constructor(t,r={}){this.components=t,this.log=t.logger.forComponent("libp2p:ping"),this.started=!1,this.protocol=`/${r.protocolPrefix??ys}/${ds}/${ps}`,this.timeout=r.timeout??1e4,this.maxInboundStreams=r.maxInboundStreams??2,this.maxOutboundStreams=r.maxOutboundStreams??1,this.runOnTransientConnection=r.runOnTransientConnection??!0,this.handleMessage=this.handleMessage.bind(this)}async start(){await this.components.registrar.handle(this.protocol,this.handleMessage,{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnTransientConnection:this.runOnTransientConnection}),this.started=!0}async stop(){await this.components.registrar.unhandle(this.protocol),this.started=!1}isStarted(){return this.started}handleMessage(t){this.log("incoming ping from %p",t.connection.remotePeer);let{stream:r}=t,n=Date.now();Si(r,r).catch(i=>{this.log.error("incoming ping from %p failed with error",t.connection.remotePeer,i)}).finally(()=>{let i=Date.now()-n;this.log("incoming ping from %p complete in %dms",t.connection.remotePeer,i)})}async ping(t,r={}){this.log("pinging %p",t);let n=Date.now(),i=yt(32),a=await this.components.connectionManager.openConnection(t,r),o,s=()=>{};if(r.signal==null){let f=AbortSignal.timeout(this.timeout);r={...r,signal:f}}try{o=await a.newStream(this.protocol,{...r,runOnTransientConnection:this.runOnTransientConnection}),s=()=>{o?.abort(new Z("ping timeout",Ti))},r.signal?.addEventListener("abort",s,{once:!0});let f=await Si([i],o,async u=>ss(u)),c=Date.now()-n;if(f==null)throw new Z(`Did not receive a ping ack after ${c}ms`,Ei);if(!hs(i,f.subarray()))throw new Z(`Received wrong ping ack after ${c}ms`,Ei);return this.log("ping %p complete in %dms",a.remotePeer,c),c}catch(f){throw this.log.error("error while pinging %p",a.remotePeer,f),o?.abort(f),f}finally{r.signal?.removeEventListener("abort",s),o!=null&&await o.close()}}};function El(e={}){return t=>new Er(t,e)}return Ss(wl);})();
|
|
16
16
|
/*! Bundled license information:
|
|
17
17
|
|
|
18
18
|
@noble/hashes/esm/utils.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/ping",
|
|
3
|
-
"version": "1.0.6-
|
|
3
|
+
"version": "1.0.6-4e0135c7d",
|
|
4
4
|
"description": "Implementation of Ping Protocol",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-ping#readme",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
"dep-check": "aegir dep-check"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@libp2p/crypto": "3.0.2-
|
|
53
|
-
"@libp2p/interface": "1.0.2-
|
|
54
|
-
"@libp2p/interface-internal": "1.0.3-
|
|
55
|
-
"@libp2p/peer-id-factory": "4.0.1-
|
|
52
|
+
"@libp2p/crypto": "3.0.2-4e0135c7d",
|
|
53
|
+
"@libp2p/interface": "1.0.2-4e0135c7d",
|
|
54
|
+
"@libp2p/interface-internal": "1.0.3-4e0135c7d",
|
|
55
|
+
"@libp2p/peer-id-factory": "4.0.1-4e0135c7d",
|
|
56
56
|
"@multiformats/multiaddr": "^12.1.10",
|
|
57
57
|
"it-first": "^3.0.3",
|
|
58
58
|
"it-pipe": "^3.0.1",
|
|
59
59
|
"uint8arrays": "^5.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@libp2p/logger": "4.0.2-
|
|
62
|
+
"@libp2p/logger": "4.0.2-4e0135c7d",
|
|
63
63
|
"aegir": "^41.0.2",
|
|
64
64
|
"it-byte-stream": "^1.0.1",
|
|
65
65
|
"it-pair": "^2.0.6",
|